Sfoglia il codice sorgente

cpms优化
nonc清单
csocsc清单

jiangbiao 1 anno fa
parent
commit
f909d2d72e
100 ha cambiato i file con 10420 aggiunte e 0 eliminazioni
  1. 32 0
      cpms-admin/src/main/java/com/cpms/RuoYiApplication.java
  2. 18 0
      cpms-admin/src/main/java/com/cpms/RuoYiServletInitializer.java
  3. 202 0
      cpms-admin/src/main/java/com/cpms/project/approval/controller/TApprovalController.java
  4. 450 0
      cpms-admin/src/main/java/com/cpms/project/approval/domain/TApproval.java
  5. 62 0
      cpms-admin/src/main/java/com/cpms/project/approval/mapper/TApprovalMapper.java
  6. 62 0
      cpms-admin/src/main/java/com/cpms/project/approval/service/ITApprovalService.java
  7. 94 0
      cpms-admin/src/main/java/com/cpms/project/approval/service/impl/TApprovalServiceImpl.java
  8. 195 0
      cpms-admin/src/main/java/com/cpms/project/asset/controller/TLeakagePointsController.java
  9. 138 0
      cpms-admin/src/main/java/com/cpms/project/asset/controller/TLeakagePointsPatrolController.java
  10. 104 0
      cpms-admin/src/main/java/com/cpms/project/asset/controller/TLeakagePointsRecordController.java
  11. 390 0
      cpms-admin/src/main/java/com/cpms/project/asset/controller/TSpecdevAssetController.java
  12. 257 0
      cpms-admin/src/main/java/com/cpms/project/asset/controller/TSpecdevFixedAssetController.java
  13. 338 0
      cpms-admin/src/main/java/com/cpms/project/asset/controller/TSpecdevMainController.java
  14. 111 0
      cpms-admin/src/main/java/com/cpms/project/asset/controller/TSpecdevTypemgrController.java
  15. 323 0
      cpms-admin/src/main/java/com/cpms/project/asset/domain/TLeakagePoints.java
  16. 236 0
      cpms-admin/src/main/java/com/cpms/project/asset/domain/TLeakagePointsPatrol.java
  17. 250 0
      cpms-admin/src/main/java/com/cpms/project/asset/domain/TLeakagePointsRecord.java
  18. 453 0
      cpms-admin/src/main/java/com/cpms/project/asset/domain/TSpecdevAsset.java
  19. 571 0
      cpms-admin/src/main/java/com/cpms/project/asset/domain/TSpecdevFixedAsset.java
  20. 555 0
      cpms-admin/src/main/java/com/cpms/project/asset/domain/TSpecdevMain.java
  21. 180 0
      cpms-admin/src/main/java/com/cpms/project/asset/domain/TSpecdevTypemgr.java
  22. 61 0
      cpms-admin/src/main/java/com/cpms/project/asset/mapper/TLeakagePointsMapper.java
  23. 61 0
      cpms-admin/src/main/java/com/cpms/project/asset/mapper/TLeakagePointsPatrolMapper.java
  24. 61 0
      cpms-admin/src/main/java/com/cpms/project/asset/mapper/TLeakagePointsRecordMapper.java
  25. 64 0
      cpms-admin/src/main/java/com/cpms/project/asset/mapper/TSpecdevAssetMapper.java
  26. 64 0
      cpms-admin/src/main/java/com/cpms/project/asset/mapper/TSpecdevFixedAssetMapper.java
  27. 64 0
      cpms-admin/src/main/java/com/cpms/project/asset/mapper/TSpecdevMainMapper.java
  28. 61 0
      cpms-admin/src/main/java/com/cpms/project/asset/mapper/TSpecdevTypemgrMapper.java
  29. 61 0
      cpms-admin/src/main/java/com/cpms/project/asset/service/ITLeakagePointsPatrolService.java
  30. 61 0
      cpms-admin/src/main/java/com/cpms/project/asset/service/ITLeakagePointsRecordService.java
  31. 61 0
      cpms-admin/src/main/java/com/cpms/project/asset/service/ITLeakagePointsService.java
  32. 61 0
      cpms-admin/src/main/java/com/cpms/project/asset/service/ITSpecdevAssetService.java
  33. 62 0
      cpms-admin/src/main/java/com/cpms/project/asset/service/ITSpecdevFixedAssetService.java
  34. 61 0
      cpms-admin/src/main/java/com/cpms/project/asset/service/ITSpecdevMainService.java
  35. 61 0
      cpms-admin/src/main/java/com/cpms/project/asset/service/ITSpecdevTypemgrService.java
  36. 93 0
      cpms-admin/src/main/java/com/cpms/project/asset/service/impl/TLeakagePointsPatrolServiceImpl.java
  37. 93 0
      cpms-admin/src/main/java/com/cpms/project/asset/service/impl/TLeakagePointsRecordServiceImpl.java
  38. 94 0
      cpms-admin/src/main/java/com/cpms/project/asset/service/impl/TLeakagePointsServiceImpl.java
  39. 93 0
      cpms-admin/src/main/java/com/cpms/project/asset/service/impl/TSpecdevAssetServiceImpl.java
  40. 94 0
      cpms-admin/src/main/java/com/cpms/project/asset/service/impl/TSpecdevFixedAssetServiceImpl.java
  41. 93 0
      cpms-admin/src/main/java/com/cpms/project/asset/service/impl/TSpecdevMainServiceImpl.java
  42. 93 0
      cpms-admin/src/main/java/com/cpms/project/asset/service/impl/TSpecdevTypemgrServiceImpl.java
  43. 25 0
      cpms-admin/src/main/java/com/cpms/project/common/DataEntity.java
  44. 101 0
      cpms-admin/src/main/java/com/cpms/project/file/controller/TFileController.java
  45. 139 0
      cpms-admin/src/main/java/com/cpms/project/file/domain/TFile.java
  46. 62 0
      cpms-admin/src/main/java/com/cpms/project/file/mapper/TFileMapper.java
  47. 62 0
      cpms-admin/src/main/java/com/cpms/project/file/service/ITFileService.java
  48. 94 0
      cpms-admin/src/main/java/com/cpms/project/file/service/impl/TFileServiceImpl.java
  49. 85 0
      cpms-admin/src/main/java/com/cpms/project/office/OnlyofficeConfiguration.java
  50. 188 0
      cpms-admin/src/main/java/com/cpms/project/office/OnlyofficeController.java
  51. 32 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/callbacks/Callback.java
  52. 50 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/callbacks/CallbackHandler.java
  53. 35 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/callbacks/Status.java
  54. 57 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/callbacks/implementations/EditCallback.java
  55. 49 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/callbacks/implementations/ForcesaveCallback.java
  56. 50 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/callbacks/implementations/SaveCallback.java
  57. 30 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/managers/callback/CallbackManager.java
  58. 281 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/managers/callback/DefaultCallbackManager.java
  59. 219 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/managers/document/DefaultDocumentManager.java
  60. 36 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/managers/document/DocumentManager.java
  61. 158 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/managers/history/DefaultHistoryManager.java
  62. 27 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/managers/history/HistoryManager.java
  63. 121 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/managers/jwt/DefaultJwtManager.java
  64. 32 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/managers/jwt/JwtManager.java
  65. 68 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/managers/template/SampleTemplateManager.java
  66. 30 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/managers/template/TemplateManager.java
  67. 24 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/AbstractModel.java
  68. 48 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/configurations/Customization.java
  69. 36 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/configurations/Embedded.java
  70. 44 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/configurations/Goback.java
  71. 43 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/configurations/Info.java
  72. 38 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/configurations/Logo.java
  73. 31 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/enums/Action.java
  74. 25 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/enums/DocumentType.java
  75. 24 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/enums/Mode.java
  76. 24 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/enums/ToolbarDocked.java
  77. 25 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/enums/Type.java
  78. 41 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/filemodel/CommentGroup.java
  79. 42 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/filemodel/Document.java
  80. 54 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/filemodel/EditorConfig.java
  81. 41 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/filemodel/FileModel.java
  82. 53 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/filemodel/Permission.java
  83. 14 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/filemodel/Template.java
  84. 43 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/filemodel/User.java
  85. 23 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/serializers/FilterState.java
  86. 34 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/serializers/SerializerFilter.java
  87. 23 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/storage/FileStorageMutator.java
  88. 12 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/storage/FileStoragePathBuilder.java
  89. 361 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/storage/LocalFileStorage.java
  90. 16 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/util/Misc.java
  91. 54 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/util/SSLUtils.java
  92. 197 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/util/file/DefaultFileUtility.java
  93. 41 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/util/file/FileUtility.java
  94. 274 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/util/service/DefaultServiceConverter.java
  95. 31 0
      cpms-admin/src/main/java/com/cpms/project/office/documentserver/util/service/ServiceConverter.java
  96. 33 0
      cpms-admin/src/main/java/com/cpms/project/office/dto/Action.java
  97. 13 0
      cpms-admin/src/main/java/com/cpms/project/office/dto/ChangesHistory.java
  98. 13 0
      cpms-admin/src/main/java/com/cpms/project/office/dto/ChangesUser.java
  99. 40 0
      cpms-admin/src/main/java/com/cpms/project/office/dto/Convert.java
  100. 36 0
      cpms-admin/src/main/java/com/cpms/project/office/dto/Converter.java

+ 32 - 0
cpms-admin/src/main/java/com/cpms/RuoYiApplication.java

@@ -0,0 +1,32 @@
+package com.cpms;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.boot.web.servlet.MultipartConfigFactory;
+import org.springframework.context.annotation.Bean;
+
+import javax.servlet.MultipartConfigElement;
+
+/**
+ * 启动程序
+ * 
+ * @author admin
+ */
+@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
+public class RuoYiApplication
+{
+    public static void main(String[] args)
+    {
+        // System.setProperty("spring.devtools.restart.enabled", "false");
+        SpringApplication.run(RuoYiApplication.class, args);
+        System.out.println("(♥◠‿◠)ノ゙  cpms启动成功   ლ(´ڡ`ლ)゙  ");
+    }
+
+    @Bean
+    MultipartConfigElement multipartConfigElement() {
+        MultipartConfigFactory factory = new MultipartConfigFactory();
+        factory.setLocation("/u03/tmp");
+        return factory.createMultipartConfig();
+    }
+}

+ 18 - 0
cpms-admin/src/main/java/com/cpms/RuoYiServletInitializer.java

@@ -0,0 +1,18 @@
+package com.cpms;
+
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
+
+/**
+ * web容器中进行部署
+ * 
+ * @author admin
+ */
+public class RuoYiServletInitializer extends SpringBootServletInitializer
+{
+    @Override
+    protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
+    {
+        return application.sources(RuoYiApplication.class);
+    }
+}

+ 202 - 0
cpms-admin/src/main/java/com/cpms/project/approval/controller/TApprovalController.java

@@ -0,0 +1,202 @@
+package com.cpms.project.approval.controller;
+
+import com.alibaba.fastjson2.JSON;
+import com.cpms.common.annotation.Log;
+import com.cpms.common.core.controller.BaseController;
+import com.cpms.common.core.domain.AjaxResult;
+import com.cpms.common.core.page.TableDataInfo;
+import com.cpms.common.enums.BusinessType;
+import com.cpms.common.utils.DateUtils;
+import com.cpms.common.utils.file.ExcelUtils;
+import com.cpms.common.utils.poi.ExcelUtil;
+import com.cpms.project.approval.domain.TApproval;
+import com.cpms.project.approval.service.ITApprovalService;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 批文清单Controller
+ *
+ * @author admin
+ * @date 2023-10-18
+ */
+@RestController
+@RequestMapping("/ehs/approval")
+public class TApprovalController extends BaseController {
+    @Autowired
+    private ITApprovalService tApprovalService;
+
+    /**
+     * 查询批文清单列表
+     */
+    @PreAuthorize("@ss.hasPermi('ehs:approval:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TApproval tApproval) {
+        startPage();
+        List<TApproval> list = tApprovalService.selectTApprovalList(tApproval);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出批文清单列表
+     */
+    @PreAuthorize("@ss.hasPermi('ehs:approval:export')")
+    @Log(title = "批文清单", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(TApproval tApproval) {
+        List<TApproval> list = tApprovalService.selectTApprovalList(tApproval);
+        ExcelUtil<TApproval> util = new ExcelUtil<TApproval>(TApproval.class);
+        return util.exportExcel(list, "批文清单数据");
+    }
+
+    /**
+     * 获取批文清单详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('ehs:approval:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return AjaxResult.success(tApprovalService.selectTApprovalById(id));
+    }
+
+    /**
+     * 新增批文清单
+     */
+    @PreAuthorize("@ss.hasPermi('ehs:approval:add')")
+    @Log(title = "批文清单", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TApproval tApproval) {
+        return toAjax(tApprovalService.insertTApproval(tApproval));
+    }
+
+    /**
+     * 修改批文清单
+     */
+    @PreAuthorize("@ss.hasPermi('ehs:approval:edit')")
+    @Log(title = "批文清单", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TApproval tApproval) {
+        return toAjax(tApprovalService.updateTApproval(tApproval));
+    }
+
+    /**
+     * 删除批文清单
+     */
+    @PreAuthorize("@ss.hasPermi('ehs:approval:remove')")
+    @Log(title = "批文清单", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(tApprovalService.deleteTApprovalByIds(ids));
+    }
+
+    @PreAuthorize("@ss.hasPermi('ehs:approval:add')")
+    @Log(title = "批文清单批量导入", businessType = BusinessType.INSERT)
+    @PostMapping("/importData")
+    public AjaxResult updateData(@RequestParam("file") MultipartFile file) throws IOException {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<Integer>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TApproval> list = new ArrayList<>();
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 2; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                int cellNum = row.getLastCellNum();
+                TApproval entity = new TApproval();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+
+                    if (j == 0) {
+                        entity.setApprovalAttibutes(cellValue);
+                    } else if (j == 1) {
+                        entity.setEffetivedate(DateUtils.parseDate(cellValue));//装置名称
+                    } else if (j == 2) {
+                        entity.setItemName(cellValue);//位号
+                    } else if (j == 3) {
+                        entity.setItemOverview(cellValue);//设备名称
+                    } else if (j == 4) {
+                        entity.setApprovalname(cellValue);//使用证号
+                    } else if (j == 5) {
+                        entity.setFileno(cellValue);//检验单位
+                    } else if (j == 6) {
+                        entity.setResponsauth(cellValue);
+                    } else if (j == 7) {
+                        entity.setContent(cellValue);//内部检验结论
+                    } else if (j == 8) {
+                        entity.setScope(cellValue);//内部检验报告编号
+                    } else if (j == 9) {
+                        entity.setRelatedlaw(cellValue);
+                    } else if (j == 10) {
+                        entity.setValidityBefore(DateUtils.parseDate(cellValue));
+                    } else if (j == 11) {
+                        entity.setValidityAfter(DateUtils.parseDate(cellValue));//外部检验结论
+                    } else if (j == 12) {
+                        if ("是".equals(cellValue)) {
+                            entity.setIsPermanent("1");
+                        } else if ("否".equals(cellValue)) {
+                            entity.setIsPermanent("0");
+                        }
+                    } else if (j == 13) {
+                        entity.setFollow(cellValue);
+                    } else if (j == 14) {
+                        entity.setOwner(cellValue);
+                    } else if (j == 15) {
+                        entity.setReviewer(cellValue);
+                    } else if (j == 16) {
+                        entity.setReviewdate(DateUtils.parseDate(cellValue));
+                    } else if (j == 17) {
+                        entity.setIsCompliance(cellValue);
+                    } else if (j == 18) {
+                        entity.setNextreviewdate(DateUtils.parseDate(cellValue));
+                    } else if (j == 19) {
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                logger.info("entity:" + JSON.toJSONString(entity));
+                list.add(entity);
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + JSON.toJSONString(e));
+                failRow.add(i + 1);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TApproval t : list) {
+            failNum++;
+            try {
+                add(t);
+                successNumber++;
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum + 1);
+                e.printStackTrace();
+            }
+        }
+        logger.info("list:" + JSON.toJSONString(list));
+        logger.info("successNumber:" + String.valueOf(successNumber));
+        logger.info("failNumber:" + String.valueOf(failNumber));
+        logger.info("failRow:" + String.valueOf(failRow));
+        return AjaxResult.success(String.valueOf(successNumber), failRow);
+    }
+}

+ 450 - 0
cpms-admin/src/main/java/com/cpms/project/approval/domain/TApproval.java

@@ -0,0 +1,450 @@
+package com.cpms.project.approval.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.cpms.common.annotation.Excel;
+import com.cpms.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.Date;
+
+/**
+ * 批文清单对象 t_approval
+ * 
+ * @author admin
+ * @date 2024-03-25
+ */
+public class TApproval extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long id;
+
+    /** 装置 */
+    @Excel(name = "装置")
+    private String plantCode;
+
+    /** 部门 */
+    @Excel(name = "部门")
+    private String division;
+
+    /** 批准日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    @Excel(name = "批准日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date effetivedate;
+
+    /** 项目名称 */
+    @Excel(name = "项目名称")
+    private String itemName;
+
+    /** 项目概况 */
+    @Excel(name = "项目概况")
+    private String itemOverview;
+
+    /** 批文属性 */
+    @Excel(name = "批文属性")
+    private String approvalAttibutes;
+
+    /** 批文名称 */
+    @Excel(name = "批文名称")
+    private String approvalname;
+
+    /** 批文编号 */
+    @Excel(name = "批文编号")
+    private String fileno;
+
+    /** 审批单位 */
+    @Excel(name = "审批单位")
+    private String responsauth;
+
+    /** 主要内容-图文 */
+    @Excel(name = "主要内容-图文")
+    private String contentFile;
+
+    /** 主要内容 */
+    @Excel(name = "主要内容")
+    private String content;
+
+    /** 适用范围 */
+    @Excel(name = "适用范围")
+    private String scope;
+
+    /** 相关法规 */
+    @Excel(name = "相关法规")
+    private String relatedlaw;
+
+    /** 证书有效期(前) */
+    @Excel(name = "证书有效期", readConverterExp = "前=")
+    private Date validityBefore;
+
+    /** 证书有效期(后) */
+    @Excel(name = "证书有效期", readConverterExp = "后=")
+    private Date validityAfter;
+
+    /** 证书有效期是否永久 */
+    @Excel(name = "证书有效期是否永久")
+    private String isPermanent;
+
+    /** 是否需要跟进 */
+    @Excel(name = "是否需要跟进")
+    private String follow;
+
+    /** 负责人 */
+    @Excel(name = "负责人")
+    private String owner;
+
+    /** 回顾人 */
+    @Excel(name = "回顾人")
+    private String reviewer;
+
+    /** 回顾时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    @Excel(name = "回顾时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date reviewdate;
+
+    /** 是否合规 */
+    @Excel(name = "是否合规")
+    private String isCompliance;
+
+    /** 下次回顾时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    @Excel(name = "下次回顾时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date nextreviewdate;
+
+    /** 备注 */
+    @Excel(name = "备注")
+    private String remarks;
+
+    /** 删除标识 */
+    private Integer delFlag;
+
+    /** 创建人 */
+    @Excel(name = "创建人")
+    private String createrCode;
+
+    /** 创建日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    @Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date createdate;
+
+    /** 更新人 */
+    @Excel(name = "更新人")
+    private String updaterCode;
+
+    /** 更新日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    @Excel(name = "更新日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date updatedate;
+
+    /** 部门编号 */
+    @Excel(name = "部门编号")
+    private Long deptId;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setPlantCode(String plantCode) 
+    {
+        this.plantCode = plantCode;
+    }
+
+    public String getPlantCode() 
+    {
+        return plantCode;
+    }
+    public void setDivision(String division) 
+    {
+        this.division = division;
+    }
+
+    public String getDivision() 
+    {
+        return division;
+    }
+    public void setEffetivedate(Date effetivedate) 
+    {
+        this.effetivedate = effetivedate;
+    }
+
+    public Date getEffetivedate() 
+    {
+        return effetivedate;
+    }
+    public void setItemName(String itemName) 
+    {
+        this.itemName = itemName;
+    }
+
+    public String getItemName() 
+    {
+        return itemName;
+    }
+    public void setItemOverview(String itemOverview) 
+    {
+        this.itemOverview = itemOverview;
+    }
+
+    public String getItemOverview() 
+    {
+        return itemOverview;
+    }
+    public void setApprovalAttibutes(String approvalAttibutes) 
+    {
+        this.approvalAttibutes = approvalAttibutes;
+    }
+
+    public String getApprovalAttibutes() 
+    {
+        return approvalAttibutes;
+    }
+    public void setApprovalname(String approvalname) 
+    {
+        this.approvalname = approvalname;
+    }
+
+    public String getApprovalname() 
+    {
+        return approvalname;
+    }
+    public void setFileno(String fileno) 
+    {
+        this.fileno = fileno;
+    }
+
+    public String getFileno() 
+    {
+        return fileno;
+    }
+    public void setResponsauth(String responsauth) 
+    {
+        this.responsauth = responsauth;
+    }
+
+    public String getResponsauth() 
+    {
+        return responsauth;
+    }
+    public void setContentFile(String contentFile) 
+    {
+        this.contentFile = contentFile;
+    }
+
+    public String getContentFile() 
+    {
+        return contentFile;
+    }
+    public void setContent(String content) 
+    {
+        this.content = content;
+    }
+
+    public String getContent() 
+    {
+        return content;
+    }
+    public void setScope(String scope) 
+    {
+        this.scope = scope;
+    }
+
+    public String getScope() 
+    {
+        return scope;
+    }
+    public void setRelatedlaw(String relatedlaw) 
+    {
+        this.relatedlaw = relatedlaw;
+    }
+
+    public String getRelatedlaw() 
+    {
+        return relatedlaw;
+    }
+    public void setValidityBefore(Date validityBefore) 
+    {
+        this.validityBefore = validityBefore;
+    }
+
+    public Date getValidityBefore() 
+    {
+        return validityBefore;
+    }
+    public void setValidityAfter(Date validityAfter) 
+    {
+        this.validityAfter = validityAfter;
+    }
+
+    public Date getValidityAfter() 
+    {
+        return validityAfter;
+    }
+    public void setIsPermanent(String isPermanent) 
+    {
+        this.isPermanent = isPermanent;
+    }
+
+    public String getIsPermanent() 
+    {
+        return isPermanent;
+    }
+    public void setFollow(String follow) 
+    {
+        this.follow = follow;
+    }
+
+    public String getFollow() 
+    {
+        return follow;
+    }
+    public void setOwner(String owner) 
+    {
+        this.owner = owner;
+    }
+
+    public String getOwner() 
+    {
+        return owner;
+    }
+    public void setReviewer(String reviewer) 
+    {
+        this.reviewer = reviewer;
+    }
+
+    public String getReviewer() 
+    {
+        return reviewer;
+    }
+    public void setReviewdate(Date reviewdate) 
+    {
+        this.reviewdate = reviewdate;
+    }
+
+    public Date getReviewdate() 
+    {
+        return reviewdate;
+    }
+    public void setIsCompliance(String isCompliance) 
+    {
+        this.isCompliance = isCompliance;
+    }
+
+    public String getIsCompliance() 
+    {
+        return isCompliance;
+    }
+    public void setNextreviewdate(Date nextreviewdate) 
+    {
+        this.nextreviewdate = nextreviewdate;
+    }
+
+    public Date getNextreviewdate() 
+    {
+        return nextreviewdate;
+    }
+    public void setRemarks(String remarks) 
+    {
+        this.remarks = remarks;
+    }
+
+    public String getRemarks() 
+    {
+        return remarks;
+    }
+    public void setDelFlag(Integer delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public Integer getDelFlag() 
+    {
+        return delFlag;
+    }
+    public void setCreaterCode(String createrCode) 
+    {
+        this.createrCode = createrCode;
+    }
+
+    public String getCreaterCode() 
+    {
+        return createrCode;
+    }
+    public void setCreatedate(Date createdate) 
+    {
+        this.createdate = createdate;
+    }
+
+    public Date getCreatedate() 
+    {
+        return createdate;
+    }
+    public void setUpdaterCode(String updaterCode) 
+    {
+        this.updaterCode = updaterCode;
+    }
+
+    public String getUpdaterCode() 
+    {
+        return updaterCode;
+    }
+    public void setUpdatedate(Date updatedate) 
+    {
+        this.updatedate = updatedate;
+    }
+
+    public Date getUpdatedate() 
+    {
+        return updatedate;
+    }
+    public void setDeptId(Long deptId) 
+    {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId() 
+    {
+        return deptId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("plantCode", getPlantCode())
+            .append("division", getDivision())
+            .append("effetivedate", getEffetivedate())
+            .append("itemName", getItemName())
+            .append("itemOverview", getItemOverview())
+            .append("approvalAttibutes", getApprovalAttibutes())
+            .append("approvalname", getApprovalname())
+            .append("fileno", getFileno())
+            .append("responsauth", getResponsauth())
+            .append("contentFile", getContentFile())
+            .append("content", getContent())
+            .append("scope", getScope())
+            .append("relatedlaw", getRelatedlaw())
+            .append("validityBefore", getValidityBefore())
+            .append("validityAfter", getValidityAfter())
+            .append("isPermanent", getIsPermanent())
+            .append("follow", getFollow())
+            .append("owner", getOwner())
+            .append("reviewer", getReviewer())
+            .append("reviewdate", getReviewdate())
+            .append("isCompliance", getIsCompliance())
+            .append("nextreviewdate", getNextreviewdate())
+            .append("remarks", getRemarks())
+            .append("delFlag", getDelFlag())
+            .append("createrCode", getCreaterCode())
+            .append("createdate", getCreatedate())
+            .append("updaterCode", getUpdaterCode())
+            .append("updatedate", getUpdatedate())
+            .append("deptId", getDeptId())
+            .toString();
+    }
+}

+ 62 - 0
cpms-admin/src/main/java/com/cpms/project/approval/mapper/TApprovalMapper.java

@@ -0,0 +1,62 @@
+package com.cpms.project.approval.mapper;
+
+import com.cpms.project.approval.domain.TApproval;
+
+import java.util.List;
+
+/**
+ * 批文清单Mapper接口
+ * 
+ * @author admin
+ * @date 2024-03-25
+ */
+public interface TApprovalMapper 
+{
+    /**
+     * 查询批文清单
+     * 
+     * @param id 批文清单主键
+     * @return 批文清单
+     */
+    public TApproval selectTApprovalById(Long id);
+
+    /**
+     * 查询批文清单列表
+     * 
+     * @param tApproval 批文清单
+     * @return 批文清单集合
+     */
+    public List<TApproval> selectTApprovalList(TApproval tApproval);
+
+    /**
+     * 新增批文清单
+     * 
+     * @param tApproval 批文清单
+     * @return 结果
+     */
+    public int insertTApproval(TApproval tApproval);
+
+    /**
+     * 修改批文清单
+     * 
+     * @param tApproval 批文清单
+     * @return 结果
+     */
+    public int updateTApproval(TApproval tApproval);
+
+    /**
+     * 删除批文清单
+     * 
+     * @param id 批文清单主键
+     * @return 结果
+     */
+    public int deleteTApprovalById(Long id);
+
+    /**
+     * 批量删除批文清单
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTApprovalByIds(Long[] ids);
+}

+ 62 - 0
cpms-admin/src/main/java/com/cpms/project/approval/service/ITApprovalService.java

@@ -0,0 +1,62 @@
+package com.cpms.project.approval.service;
+
+import com.cpms.project.approval.domain.TApproval;
+
+import java.util.List;
+
+/**
+ * 批文清单Service接口
+ * 
+ * @author admin
+ * @date 2024-03-25
+ */
+public interface ITApprovalService 
+{
+    /**
+     * 查询批文清单
+     * 
+     * @param id 批文清单主键
+     * @return 批文清单
+     */
+    public TApproval selectTApprovalById(Long id);
+
+    /**
+     * 查询批文清单列表
+     * 
+     * @param tApproval 批文清单
+     * @return 批文清单集合
+     */
+    public List<TApproval> selectTApprovalList(TApproval tApproval);
+
+    /**
+     * 新增批文清单
+     * 
+     * @param tApproval 批文清单
+     * @return 结果
+     */
+    public int insertTApproval(TApproval tApproval);
+
+    /**
+     * 修改批文清单
+     * 
+     * @param tApproval 批文清单
+     * @return 结果
+     */
+    public int updateTApproval(TApproval tApproval);
+
+    /**
+     * 批量删除批文清单
+     * 
+     * @param ids 需要删除的批文清单主键集合
+     * @return 结果
+     */
+    public int deleteTApprovalByIds(Long[] ids);
+
+    /**
+     * 删除批文清单信息
+     * 
+     * @param id 批文清单主键
+     * @return 结果
+     */
+    public int deleteTApprovalById(Long id);
+}

+ 94 - 0
cpms-admin/src/main/java/com/cpms/project/approval/service/impl/TApprovalServiceImpl.java

@@ -0,0 +1,94 @@
+package com.cpms.project.approval.service.impl;
+
+import com.cpms.project.approval.domain.TApproval;
+import com.cpms.project.approval.mapper.TApprovalMapper;
+import com.cpms.project.approval.service.ITApprovalService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 批文清单Service业务层处理
+ * 
+ * @author admin
+ * @date 2024-03-25
+ */
+@Service
+public class TApprovalServiceImpl implements ITApprovalService 
+{
+    @Autowired
+    private TApprovalMapper tApprovalMapper;
+
+    /**
+     * 查询批文清单
+     * 
+     * @param id 批文清单主键
+     * @return 批文清单
+     */
+    @Override
+    public TApproval selectTApprovalById(Long id)
+    {
+        return tApprovalMapper.selectTApprovalById(id);
+    }
+
+    /**
+     * 查询批文清单列表
+     * 
+     * @param tApproval 批文清单
+     * @return 批文清单
+     */
+    @Override
+    public List<TApproval> selectTApprovalList(TApproval tApproval)
+    {
+        return tApprovalMapper.selectTApprovalList(tApproval);
+    }
+
+    /**
+     * 新增批文清单
+     * 
+     * @param tApproval 批文清单
+     * @return 结果
+     */
+    @Override
+    public int insertTApproval(TApproval tApproval)
+    {
+        return tApprovalMapper.insertTApproval(tApproval);
+    }
+
+    /**
+     * 修改批文清单
+     * 
+     * @param tApproval 批文清单
+     * @return 结果
+     */
+    @Override
+    public int updateTApproval(TApproval tApproval)
+    {
+        return tApprovalMapper.updateTApproval(tApproval);
+    }
+
+    /**
+     * 批量删除批文清单
+     * 
+     * @param ids 需要删除的批文清单主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTApprovalByIds(Long[] ids)
+    {
+        return tApprovalMapper.deleteTApprovalByIds(ids);
+    }
+
+    /**
+     * 删除批文清单信息
+     * 
+     * @param id 批文清单主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTApprovalById(Long id)
+    {
+        return tApprovalMapper.deleteTApprovalById(id);
+    }
+}

+ 195 - 0
cpms-admin/src/main/java/com/cpms/project/asset/controller/TLeakagePointsController.java

@@ -0,0 +1,195 @@
+package com.cpms.project.asset.controller;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.alibaba.fastjson2.JSON;
+import com.cpms.common.utils.DateUtils;
+import com.cpms.common.utils.file.ExcelUtils;
+import com.cpms.project.asset.service.ITLeakagePointsService;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import com.cpms.common.annotation.Log;
+import com.cpms.common.core.controller.BaseController;
+import com.cpms.common.core.domain.AjaxResult;
+import com.cpms.common.enums.BusinessType;
+import com.cpms.project.asset.domain.TLeakagePoints;
+import com.cpms.common.utils.poi.ExcelUtil;
+import com.cpms.common.core.page.TableDataInfo;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * 漏点清单Controller
+ * 
+ * @author admin
+ * @date 2024-03-28
+ */
+@RestController
+@RequestMapping("/asset/points")
+public class TLeakagePointsController extends BaseController
+{
+    @Autowired
+    private ITLeakagePointsService tLeakagePointsService;
+
+    /**
+     * 查询漏点清单列表
+     */
+    @PreAuthorize("@ss.hasPermi('asset:points:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TLeakagePoints tLeakagePoints)
+    {
+        startPage();
+        List<TLeakagePoints> list = tLeakagePointsService.selectTLeakagePointsList(tLeakagePoints);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出漏点清单列表
+     */
+    @PreAuthorize("@ss.hasPermi('asset:points:export')")
+    @Log(title = "漏点清单", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TLeakagePoints tLeakagePoints)
+    {
+        List<TLeakagePoints> list = tLeakagePointsService.selectTLeakagePointsList(tLeakagePoints);
+        ExcelUtil<TLeakagePoints> util = new ExcelUtil<TLeakagePoints>(TLeakagePoints.class);
+        util.exportExcel(response, list, "漏点清单数据");
+    }
+
+    /**
+     * 获取漏点清单详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('asset:points:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(tLeakagePointsService.selectTLeakagePointsById(id));
+    }
+
+    /**
+     * 新增漏点清单
+     */
+    @PreAuthorize("@ss.hasPermi('asset:points:add')")
+    @Log(title = "漏点清单", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TLeakagePoints tLeakagePoints)
+    {
+        return toAjax(tLeakagePointsService.insertTLeakagePoints(tLeakagePoints));
+    }
+
+    /**
+     * 修改漏点清单
+     */
+    @PreAuthorize("@ss.hasPermi('asset:points:edit')")
+    @Log(title = "漏点清单", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TLeakagePoints tLeakagePoints)
+    {
+        return toAjax(tLeakagePointsService.updateTLeakagePoints(tLeakagePoints));
+    }
+
+    /**
+     * 删除漏点清单
+     */
+    @PreAuthorize("@ss.hasPermi('asset:points:remove')")
+    @Log(title = "漏点清单", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tLeakagePointsService.deleteTLeakagePointsByIds(ids));
+    }
+
+
+    @Log(title = "漏点清单批量导入", businessType = BusinessType.INSERT)
+    @PostMapping("/importData")
+    public AjaxResult importData(@RequestParam("file") MultipartFile file) throws IOException {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TLeakagePoints> list = new ArrayList<>();
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 2; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                int cellNum = row.getLastCellNum();
+                TLeakagePoints entity = new TLeakagePoints();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        entity.setPointNo(cellValue);
+                    } else if (j == 1) {
+                        entity.setLeakagePosition(cellValue);
+                    } else if (j == 2) {
+                        entity.setLeakageMedium(cellValue);
+                    } else if (j == 3) {
+                        entity.setDiscoveryTime(DateUtils.parseDate(cellValue));
+                    } else if (j == 4) {
+                        entity.setDiscoveryName(cellValue);
+                    } else if (j == 5) {
+                        entity.setLeakageAmount(cellValue);
+                    } else if (j == 6) {
+                        entity.setSapNo(cellValue);
+                    } else if (j == 7) {
+                        entity.setLeakageEliminationTime(DateUtils.parseDate(cellValue));
+                    } else if (j == 8) {
+                        entity.setLeakageEliminationFunc(cellValue);
+                    } else if (j == 9) {
+                        entity.setListing(cellValue);
+                    } else if (j == 10) {
+                        entity.setPressurePlugging(cellValue);
+                    } else if (j == 11) {
+                        entity.setLeakageEliminationResult(cellValue);
+                    } else if (j == 12) {
+                        entity.setNextCheckDate(DateUtils.parseDate(cellValue));
+                    } else if (j == 13) {
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                entity.setCreaterCode(String.valueOf(userId));
+                logger.info("entity:" + entity);
+                list.add(entity);
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + JSON.toJSONString(e));
+                failRow.add(i + 1);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TLeakagePoints t : list
+        ) {
+            failNum++;
+            try {
+                //根据使用证、注册编号、位号,进行数据更新
+                add(t);
+                successNumber++;
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum + 1);
+            }
+        }
+        logger.info("list:" + JSON.toJSONString(list));
+        logger.info("successNumber:" + successNumber);
+        logger.info("failNumber:" + failNumber);
+        logger.info("failRow:" + failRow);
+        return AjaxResult.success(String.valueOf(successNumber), failRow);
+    }
+}

+ 138 - 0
cpms-admin/src/main/java/com/cpms/project/asset/controller/TLeakagePointsPatrolController.java

@@ -0,0 +1,138 @@
+package com.cpms.project.asset.controller;
+
+import com.cpms.common.annotation.Log;
+import com.cpms.common.core.controller.BaseController;
+import com.cpms.common.core.domain.AjaxResult;
+import com.cpms.common.core.page.TableDataInfo;
+import com.cpms.common.enums.BusinessType;
+import com.cpms.common.utils.poi.ExcelUtil;
+import com.cpms.project.asset.domain.TLeakagePoints;
+import com.cpms.project.asset.domain.TLeakagePointsPatrol;
+import com.cpms.project.asset.domain.TLeakagePointsRecord;
+import com.cpms.project.asset.service.ITLeakagePointsPatrolService;
+import com.cpms.project.asset.service.ITLeakagePointsRecordService;
+import com.cpms.project.asset.service.ITLeakagePointsService;
+import org.apache.commons.collections4.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 漏点巡检Controller
+ *
+ * @author admin
+ * @date 2024-04-01
+ */
+@RestController
+@RequestMapping("/asset/pointPatrol")
+public class TLeakagePointsPatrolController extends BaseController {
+    @Autowired
+    private ITLeakagePointsPatrolService tLeakagePointsPatrolService;
+
+    @Autowired
+    private ITLeakagePointsRecordService tLeakagePointsRecordService;
+
+    @Autowired
+    private ITLeakagePointsService tLeakagePointsService;
+
+    /**
+     * 查询漏点巡检列表
+     */
+    @PreAuthorize("@ss.hasPermi('asset:pointPatrol:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TLeakagePointsPatrol tLeakagePointsPatrol) {
+        startPage();
+        if (tLeakagePointsPatrol.getCheckDateM() == null) {
+            tLeakagePointsPatrol.setCheckDateM(new Date());
+        }
+        List<TLeakagePointsPatrol> list = tLeakagePointsPatrolService.selectTLeakagePointsPatrolList(tLeakagePointsPatrol);
+        if (CollectionUtils.isNotEmpty(list)) {
+            TLeakagePointsRecord record = new TLeakagePointsRecord();
+            record.setPatrolId(list.get(0).getId());
+            list.get(0).setRecords(tLeakagePointsRecordService.selectTLeakagePointsRecordList(record));
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出漏点巡检列表
+     */
+    @PreAuthorize("@ss.hasPermi('asset:pointPatrol:export')")
+    @Log(title = "漏点巡检", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TLeakagePointsPatrol tLeakagePointsPatrol) {
+        List<TLeakagePointsPatrol> list = tLeakagePointsPatrolService.selectTLeakagePointsPatrolList(tLeakagePointsPatrol);
+        ExcelUtil<TLeakagePointsPatrol> util = new ExcelUtil<TLeakagePointsPatrol>(TLeakagePointsPatrol.class);
+        util.exportExcel(response, list, "漏点巡检数据");
+    }
+
+    /**
+     * 获取漏点巡检详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('asset:pointPatrol:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(tLeakagePointsPatrolService.selectTLeakagePointsPatrolById(id));
+    }
+
+    /**
+     * 新增漏点巡检
+     */
+    @PreAuthorize("@ss.hasPermi('asset:pointPatrol:add')")
+    @Log(title = "漏点巡检", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TLeakagePointsPatrol tLeakagePointsPatrol) {
+        tLeakagePointsPatrol.setCheckDateN(tLeakagePointsPatrol.getCheckDateM());
+        TLeakagePointsPatrol patrol = new TLeakagePointsPatrol();
+        patrol.setCheckDateM(tLeakagePointsPatrol.getCheckDateM());
+        List<TLeakagePointsPatrol> list = tLeakagePointsPatrolService.selectTLeakagePointsPatrolList(patrol);
+        if (CollectionUtils.isNotEmpty(list)) {
+            return AjaxResult.warn("当前日期已存在巡检记录!");
+        }
+        tLeakagePointsPatrolService.insertTLeakagePointsPatrol(tLeakagePointsPatrol);
+        TLeakagePoints tLeakagePoints = new TLeakagePoints();
+        tLeakagePoints.setLeakageEliminationResult("1,2");
+        for (TLeakagePoints leakagePoints : tLeakagePointsService.selectTLeakagePointsList(tLeakagePoints)) {
+            TLeakagePointsRecord record = new TLeakagePointsRecord();
+            record.setPatrolId(tLeakagePointsPatrol.getId());
+            record.setPointNo(leakagePoints.getPointNo());
+            record.setLeakagePosition(leakagePoints.getLeakagePosition());
+            record.setLeakageMedium(leakagePoints.getLeakageMedium());
+            record.setCreatedate(new Date());
+            record.setCreaterCode(getUserId().toString());
+            tLeakagePointsRecordService.insertTLeakagePointsRecord(record);
+        }
+        return toAjax(1);
+    }
+
+    /**
+     * 修改漏点巡检
+     */
+    @PreAuthorize("@ss.hasPermi('asset:pointPatrol:edit')")
+    @Log(title = "漏点巡检", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TLeakagePointsPatrol tLeakagePointsPatrol) {
+        if (CollectionUtils.isNotEmpty(tLeakagePointsPatrol.getRecords())) {
+            tLeakagePointsPatrol.getRecords().forEach(item -> {
+                item.setUpdatedate(new Date());
+                item.setUpdaterCode(getUserId().toString());
+                tLeakagePointsRecordService.updateTLeakagePointsRecord(item);
+            });
+        }
+        return toAjax(tLeakagePointsPatrolService.updateTLeakagePointsPatrol(tLeakagePointsPatrol));
+    }
+
+    /**
+     * 删除漏点巡检
+     */
+    @PreAuthorize("@ss.hasPermi('asset:pointPatrol:remove')")
+    @Log(title = "漏点巡检", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(tLeakagePointsPatrolService.deleteTLeakagePointsPatrolByIds(ids));
+    }
+}

+ 104 - 0
cpms-admin/src/main/java/com/cpms/project/asset/controller/TLeakagePointsRecordController.java

@@ -0,0 +1,104 @@
+package com.cpms.project.asset.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.cpms.common.annotation.Log;
+import com.cpms.common.core.controller.BaseController;
+import com.cpms.common.core.domain.AjaxResult;
+import com.cpms.common.enums.BusinessType;
+import com.cpms.project.asset.domain.TLeakagePointsRecord;
+import com.cpms.project.asset.service.ITLeakagePointsRecordService;
+import com.cpms.common.utils.poi.ExcelUtil;
+import com.cpms.common.core.page.TableDataInfo;
+
+/**
+ * 漏点巡检记录 Controller
+ * 
+ * @author admin
+ * @date 2024-04-01
+ */
+@RestController
+@RequestMapping("/asset/pointRecord")
+public class TLeakagePointsRecordController extends BaseController
+{
+    @Autowired
+    private ITLeakagePointsRecordService tLeakagePointsRecordService;
+
+    /**
+     * 查询漏点巡检记录 列表
+     */
+    @PreAuthorize("@ss.hasPermi('asset:pointRecord:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TLeakagePointsRecord tLeakagePointsRecord)
+    {
+        startPage();
+        List<TLeakagePointsRecord> list = tLeakagePointsRecordService.selectTLeakagePointsRecordList(tLeakagePointsRecord);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出漏点巡检记录 列表
+     */
+    @PreAuthorize("@ss.hasPermi('asset:pointRecord:export')")
+    @Log(title = "漏点巡检记录 ", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TLeakagePointsRecord tLeakagePointsRecord)
+    {
+        List<TLeakagePointsRecord> list = tLeakagePointsRecordService.selectTLeakagePointsRecordList(tLeakagePointsRecord);
+        ExcelUtil<TLeakagePointsRecord> util = new ExcelUtil<TLeakagePointsRecord>(TLeakagePointsRecord.class);
+        util.exportExcel(response, list, "漏点巡检记录 数据");
+    }
+
+    /**
+     * 获取漏点巡检记录 详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('asset:pointRecord:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(tLeakagePointsRecordService.selectTLeakagePointsRecordById(id));
+    }
+
+    /**
+     * 新增漏点巡检记录 
+     */
+    @PreAuthorize("@ss.hasPermi('asset:pointRecord:add')")
+    @Log(title = "漏点巡检记录 ", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TLeakagePointsRecord tLeakagePointsRecord)
+    {
+        return toAjax(tLeakagePointsRecordService.insertTLeakagePointsRecord(tLeakagePointsRecord));
+    }
+
+    /**
+     * 修改漏点巡检记录 
+     */
+    @PreAuthorize("@ss.hasPermi('asset:pointRecord:edit')")
+    @Log(title = "漏点巡检记录 ", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TLeakagePointsRecord tLeakagePointsRecord)
+    {
+        return toAjax(tLeakagePointsRecordService.updateTLeakagePointsRecord(tLeakagePointsRecord));
+    }
+
+    /**
+     * 删除漏点巡检记录 
+     */
+    @PreAuthorize("@ss.hasPermi('asset:pointRecord:remove')")
+    @Log(title = "漏点巡检记录 ", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tLeakagePointsRecordService.deleteTLeakagePointsRecordByIds(ids));
+    }
+}

+ 390 - 0
cpms-admin/src/main/java/com/cpms/project/asset/controller/TSpecdevAssetController.java

@@ -0,0 +1,390 @@
+package com.cpms.project.asset.controller;
+
+ import com.alibaba.fastjson2.JSON;
+ import com.cpms.common.annotation.Log;
+ import com.cpms.common.config.RuoYiConfig;
+ import com.cpms.common.core.controller.BaseController;
+ import com.cpms.common.core.domain.AjaxResult;
+ import com.cpms.common.core.page.TableDataInfo;
+ import com.cpms.common.enums.BusinessType;
+ import com.cpms.common.utils.StringUtils;
+import com.cpms.common.utils.file.ExcelUtils;
+import com.cpms.common.utils.file.FileUploadUtils;
+import com.cpms.common.utils.poi.ExcelUtil;
+import com.cpms.project.asset.domain.TSpecdevAsset;
+import com.cpms.project.asset.service.ITSpecdevAssetService;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.ss.util.CellRangeAddress;
+import org.apache.poi.xssf.streaming.SXSSFWorkbook;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+ import java.io.IOException;
+import java.io.OutputStream;
+ import java.nio.file.Files;
+ import java.nio.file.Paths;
+ import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 资产与运营Controller
+ *
+ * @author admin
+ * @date 2022-10-12
+ */
+@RestController
+@RequestMapping("/sems/asset")
+public class TSpecdevAssetController extends BaseController {
+    @Autowired
+    private ITSpecdevAssetService tSpecdevAssetService;
+
+    /**
+     * 查询资产与运营列表
+     */
+    @PreAuthorize("@ss.hasPermi('sems:asset:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TSpecdevAsset tSpecdevAsset) {
+        startPage();
+        List<TSpecdevAsset> list = tSpecdevAssetService.selectTSpecdevAssetList(tSpecdevAsset);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出资产与运营列表
+     */
+    @PreAuthorize("@ss.hasPermi('sems:asset:export')")
+    @Log(title = "资产与运营", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(TSpecdevAsset tSpecdevAsset) throws IOException {
+        List<TSpecdevAsset> list = tSpecdevAssetService.selectTSpecdevAssetList(tSpecdevAsset);
+        SXSSFWorkbook wb = new SXSSFWorkbook(1000);
+        // 创建标题样式
+        CellStyle cellStyle = wb.createCellStyle();
+        // 内容垂直居中,四周加边框线,设置单元格前景色为灰色
+        cellStyle.setAlignment(HorizontalAlignment.CENTER);
+        cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
+        cellStyle.setFillForegroundColor(IndexedColors.GREY_40_PERCENT.getIndex());
+        cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
+        cellStyle.setBorderBottom(BorderStyle.THIN);
+        cellStyle.setBorderLeft(BorderStyle.THIN);
+        cellStyle.setBorderRight(BorderStyle.THIN);
+        cellStyle.setBorderTop(BorderStyle.THIN);
+        // 设置字体,加粗,字体颜色
+        Font headerFont = wb.createFont();
+        headerFont.setFontName("Arial");
+        headerFont.setFontHeightInPoints((short) 10);
+        headerFont.setBold(true);
+        headerFont.setColor(IndexedColors.WHITE.getIndex());
+        cellStyle.setFont(headerFont);
+
+        // 正文格式
+        CellStyle style2 = wb.createCellStyle();
+        // 内容垂直居中,四周加边框线,自动换行
+        style2.setAlignment(HorizontalAlignment.CENTER);
+        style2.setVerticalAlignment(VerticalAlignment.CENTER);
+        style2.setBorderBottom(BorderStyle.THIN);
+        style2.setBorderLeft(BorderStyle.THIN);
+        style2.setBorderRight(BorderStyle.THIN);
+        style2.setBorderTop(BorderStyle.THIN);
+        style2.setWrapText(true);
+        // 设置正文字体,字体颜色
+        Font headerFont2 = wb.createFont();
+        headerFont2.setFontName("Arial");
+        headerFont2.setFontHeightInPoints((short) 10);
+        headerFont2.setColor(IndexedColors.BLACK.getIndex());
+        style2.setFont(headerFont2);
+        //创建sheet页
+        Sheet sheet = wb.createSheet("sheet1");
+        //设置列的宽度,第一个参数为列的序号,从0开始,第二参数为列宽,单位1/256个字节
+        sheet.setColumnWidth(2, 20 * 256);
+        sheet.setColumnWidth(3, 20 * 256);
+        sheet.setColumnWidth(4, 20 * 256);
+        sheet.setColumnWidth(20, 20 * 256);
+        // 创建表格第一行并设置相应标题
+        Row row0 = sheet.createRow(0);
+        row0.createCell(0).setCellValue("Type");
+        row0.createCell(1).setCellValue("内容");
+        row0.createCell(2).setCellValue("PID图号/管线号");
+        row0.createCell(3).setCellValue("分界具体位置及描述");
+        row0.createCell(4).setCellValue("According to");
+        row0.createCell(5).setCellValue("资产");
+        row0.createCell(6).setCellValue("DCS操作");
+        row0.createCell(7).setCellValue("现场操作");
+        row0.createCell(9).setCellValue("巡检");
+        row0.createCell(11).setCellValue("维修");
+        row0.createCell(13).setCellValue("维修协调");
+        row0.createCell(15).setCellValue("技术管理");
+        row0.createCell(17).setCellValue("资产分界点信息");
+        row0.createCell(20).setCellValue("备注");
+        row0.createCell(8);
+        row0.createCell(10);
+        row0.createCell(12);
+        row0.createCell(14);
+        row0.createCell(16);
+        row0.createCell(18);
+        row0.createCell(19);
+        // 设置单元格样式
+        setStyle(row0,20,cellStyle);
+
+        // 创建第二行标题
+        Row row1 = sheet.createRow(1);
+        row1.createCell(0);
+        row1.createCell(1);
+        row1.createCell(2);
+        row1.createCell(3);
+        row1.createCell(4);
+        row1.createCell(5).setCellValue("N.A");
+        row1.createCell(6).setCellValue("N.A");
+        row1.createCell(7).setCellValue("8小时");
+        row1.createCell(8).setCellValue("8小时外");
+        row1.createCell(9).setCellValue("8小时");
+        row1.createCell(10).setCellValue("8小时外");
+        row1.createCell(11).setCellValue("8小时");
+        row1.createCell(12).setCellValue("8小时外");
+        row1.createCell(13).setCellValue("8小时");
+        row1.createCell(14).setCellValue("8小时外");
+        row1.createCell(15).setCellValue("8小时");
+        row1.createCell(16).setCellValue("8小时外");
+        row1.createCell(17).setCellValue("位置");
+        row1.createCell(18).setCellValue("管径");
+        row1.createCell(19).setCellValue("照片");
+        row1.createCell(20);
+        // 设置单元格样式
+        setStyle(row1,20,cellStyle);
+        // 合并单元格  参数(1:起始行,2:结束行,3:起始列,4:结束列)
+        sheet.addMergedRegion(new CellRangeAddress(0, 1, 0, 0));
+        sheet.addMergedRegion(new CellRangeAddress(0, 1, 1, 1));
+        sheet.addMergedRegion(new CellRangeAddress(0, 1, 2, 2));
+        sheet.addMergedRegion(new CellRangeAddress(0, 1, 3, 3));
+        sheet.addMergedRegion(new CellRangeAddress(0, 1, 4, 4));
+        sheet.addMergedRegion(new CellRangeAddress(0, 0, 7, 8));
+        sheet.addMergedRegion(new CellRangeAddress(0, 0, 9, 10));
+        sheet.addMergedRegion(new CellRangeAddress(0, 0, 11, 12));
+        sheet.addMergedRegion(new CellRangeAddress(0, 0, 13, 14));
+        sheet.addMergedRegion(new CellRangeAddress(0, 0, 15, 16));
+        sheet.addMergedRegion(new CellRangeAddress(0, 0, 17, 19));
+        sheet.addMergedRegion(new CellRangeAddress(0, 1, 20, 20));
+
+        //填充数据
+        int rowIndex = 2;
+        int columnIndex = 1;
+        for (TSpecdevAsset t : list
+        ) {
+            Row row = sheet.createRow(rowIndex);// 创建行
+            //填充数据
+            row.createCell(0).setCellValue(t.getType());
+            row.createCell(1).setCellValue(t.getContent());
+            row.createCell(2).setCellValue(t.getPidNo());
+            row.createCell(3).setCellValue(t.getPositionDescribe());
+            row.createCell(4).setCellValue(t.getAccordingTo());
+            row.createCell(5).setCellValue(t.getAsset());
+            row.createCell(6).setCellValue(t.getDcsOperation());
+            row.createCell(7).setCellValue(t.getInSceneOperation());
+            row.createCell(8).setCellValue(t.getOutSceneOperation());
+            row.createCell(9).setCellValue(t.getInInspection());
+            row.createCell(10).setCellValue(t.getOutInspection());
+            row.createCell(11).setCellValue(t.getInRepair());
+            row.createCell(12).setCellValue(t.getOutRepair());
+            row.createCell(13).setCellValue(t.getInMaintenanceCoordination());
+            row.createCell(14).setCellValue(t.getOutMaintenanceCoordination());
+            row.createCell(15).setCellValue(t.getInTechnicalManagement());
+            row.createCell(16).setCellValue(t.getOutTechnicalManagement());
+            row.createCell(17).setCellValue(t.getPosition());
+            row.createCell(18).setCellValue(t.getPipeDiameter());
+            row.createCell(19).setCellValue(StringUtils.isNotEmpty(t.getPicUrl())?"Y":"N.A");
+            row.createCell(20).setCellValue(t.getRemarks());
+            setStyle(row,20,style2);
+            rowIndex++;
+        }
+
+        // 生成文件返回下载地址
+        OutputStream out;
+        String filename = ExcelUtil.encodingFilename("资产与运营");
+        out = Files.newOutputStream(Paths.get(ExcelUtil.getAbsoluteFile(filename)));
+        wb.write(out);
+        wb.close();
+        out.close();
+        return AjaxResult.success(filename);
+    }
+
+    /**
+     * 设置单元格格式
+     * @param row 行
+     * @param colNum 该行列数
+     * @param style 单元格样式
+     */
+    private void setStyle(Row row,int colNum,CellStyle style){
+        for (int i = 0; i <= colNum; i++) {
+            row.getCell(i).setCellStyle(style);
+        }
+    }
+
+    /**
+     * 获取资产与运营详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('sems:asset:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return AjaxResult.success(tSpecdevAssetService.selectTSpecdevAssetById(id));
+    }
+
+    /**
+     * 新增资产与运营
+     */
+    @PreAuthorize("@ss.hasPermi('sems:asset:add')")
+    @Log(title = "资产与运营", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TSpecdevAsset tSpecdevAsset) {
+        return toAjax(tSpecdevAssetService.insertTSpecdevAsset(tSpecdevAsset));
+    }
+
+    /**
+     * 修改资产与运营
+     */
+    @PreAuthorize("@ss.hasPermi('sems:asset:edit')")
+    @Log(title = "资产与运营", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TSpecdevAsset tSpecdevAsset) {
+        return toAjax(tSpecdevAssetService.updateTSpecdevAsset(tSpecdevAsset));
+    }
+
+    /**
+     * 删除资产与运营
+     */
+    @PreAuthorize("@ss.hasPermi('sems:asset:remove')")
+    @Log(title = "资产与运营", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(tSpecdevAssetService.deleteTSpecdevAssetByIds(ids));
+    }
+
+    @Log(title = "文件上传", businessType = BusinessType.UPDATE)
+    @PostMapping("/uploadFile")
+    public AjaxResult uploadFile(@RequestParam("file") MultipartFile file) throws IOException {
+        if (!file.isEmpty()) {
+            String avatar = FileUploadUtils.upload(RuoYiConfig.getFilePath("/specAsset"), file);
+            return AjaxResult.success(avatar);
+        }
+        return AjaxResult.error("上传异常,请联系管理员");
+    }
+
+    @Log(title = "资产与运营批量导入更新", businessType = BusinessType.INSERT)
+    @PostMapping("/importData")
+    public AjaxResult importData(@RequestParam("file") MultipartFile file) throws IOException {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TSpecdevAsset> list = new ArrayList<>();
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 3; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                int cellNum = row.getLastCellNum();
+                TSpecdevAsset entity = new TSpecdevAsset();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        //type
+                        entity.setType(cellValue);
+                    } else if (j == 1) {
+                        //内容
+                        entity.setContent(cellValue);
+                    } else if (j == 2) {
+                        //PID图号/管线号
+                        entity.setPidNo(cellValue);
+                    } else if (j == 3) {
+                        //是分解具体位置及描述
+                        entity.setPositionDescribe(cellValue);
+                    } else if (j == 4) {
+                        //According to
+                        entity.setAccordingTo(cellValue);
+                    } else if (j == 5) {
+                        //资产
+                        entity.setAsset(cellValue);
+                    } else if (j == 6) {
+                        //DCS操作
+                        entity.setDcsOperation(cellValue);
+                    } else if (j == 7) {
+                        //现场操作8小时
+                        entity.setInSceneOperation(cellValue);
+                    } else if (j == 8) {
+                        //现场操作8小时外
+                        entity.setOutSceneOperation(cellValue);
+                    } else if (j == 9) {
+                        //巡检8小时
+                        entity.setInInspection(cellValue);
+                    } else if (j == 10) {
+                        //巡检8小时外
+                        entity.setOutInspection(cellValue);
+                    } else if (j == 11) {
+                        //维修8小时
+                        entity.setInRepair(cellValue);
+                    } else if (j == 12) {
+                        //维修8小时外
+                        entity.setOutRepair(cellValue);
+                    } else if (j == 13) {
+                        //维修协调8小时
+                        entity.setInMaintenanceCoordination(cellValue);
+                    } else if (j == 14) {
+                        //维修协调8小时外
+                        entity.setOutMaintenanceCoordination(cellValue);
+                    } else if (j == 15) {
+                        //技术管理8小时
+                        entity.setInTechnicalManagement(cellValue);
+                    } else if (j == 16) {
+                        //技术管理8小时外
+                        entity.setOutTechnicalManagement(cellValue);
+                    } else if (j == 17) {
+                        //位置
+                        entity.setPosition(cellValue);
+                    } else if (j == 18) {
+                        //管径
+                        entity.setPipeDiameter(cellValue);
+                    } else if (j == 19) {
+                        //备注
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                entity.setCreaterCode(userId);
+                logger.info("entity:" + entity);
+                list.add(entity);
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + JSON.toJSONString(e));
+                failRow.add(i + 1);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TSpecdevAsset t : list
+        ) {
+            failNum++;
+            try {
+                //根据使用证、注册编号、位号,进行数据更新
+                add(t);
+                successNumber++;
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum + 1);
+            }
+        }
+        logger.info("list:" + JSON.toJSONString(list));
+        logger.info("successNumber:" + String.valueOf(successNumber));
+        logger.info("failNumber:" + String.valueOf(failNumber));
+        logger.info("failRow:" + String.valueOf(failRow));
+        return AjaxResult.success(String.valueOf(successNumber), failRow);
+    }
+}

+ 257 - 0
cpms-admin/src/main/java/com/cpms/project/asset/controller/TSpecdevFixedAssetController.java

@@ -0,0 +1,257 @@
+package com.cpms.project.asset.controller;
+
+ import com.alibaba.fastjson2.JSON;
+ import com.cpms.common.annotation.Log;
+ import com.cpms.common.core.controller.BaseController;
+ import com.cpms.common.core.domain.AjaxResult;
+ import com.cpms.common.core.domain.entity.SysDictData;
+ import com.cpms.common.core.page.TableDataInfo;
+ import com.cpms.common.enums.BusinessType;
+ import com.cpms.common.utils.file.ExcelUtils;
+import com.cpms.common.utils.poi.ExcelUtil;
+import com.cpms.project.asset.domain.TSpecdevFixedAsset;
+import com.cpms.project.asset.service.ITSpecdevFixedAssetService;
+ import com.cpms.system.service.ISysDictTypeService;
+ import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 固定资产Controller
+ *
+ * @author admin
+ * @date 2022-10-18
+ */
+@RestController
+@RequestMapping("/sems/fixedAsset")
+public class TSpecdevFixedAssetController extends BaseController
+{
+    @Autowired
+    private ITSpecdevFixedAssetService tSpecdevFixedAssetService;
+
+    @Autowired
+    private ISysDictTypeService iSysDictTypeService;
+    /**
+     * 查询固定资产列表
+     */
+    @PreAuthorize("@ss.hasPermi('sems:fixedAsset:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TSpecdevFixedAsset tSpecdevFixedAsset)
+    {
+        startPage();
+        List<TSpecdevFixedAsset> list = tSpecdevFixedAssetService.selectTSpecdevFixedAssetList(tSpecdevFixedAsset);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出固定资产列表
+     */
+    @PreAuthorize("@ss.hasPermi('sems:fixedAsset:export')")
+    @Log(title = "固定资产", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(TSpecdevFixedAsset tSpecdevFixedAsset)
+    {
+        List<TSpecdevFixedAsset> list = tSpecdevFixedAssetService.selectTSpecdevFixedAssetList(tSpecdevFixedAsset);
+        ExcelUtil<TSpecdevFixedAsset> util = new ExcelUtil<TSpecdevFixedAsset>(TSpecdevFixedAsset.class);
+        return util.exportExcel(list, "asset");
+    }
+
+    /**
+     * 获取固定资产详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('sems:fixedAsset:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(tSpecdevFixedAssetService.selectTSpecdevFixedAssetById(id));
+    }
+
+    /**
+     * 新增固定资产
+     */
+    @PreAuthorize("@ss.hasPermi('sems:fixedAsset:add')")
+    @Log(title = "固定资产", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TSpecdevFixedAsset tSpecdevFixedAsset)
+    {
+        return toAjax(tSpecdevFixedAssetService.insertTSpecdevFixedAsset(tSpecdevFixedAsset));
+    }
+
+    /**
+     * 修改固定资产
+     */
+    @PreAuthorize("@ss.hasPermi('sems:fixedAsset:edit')")
+    @Log(title = "固定资产", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TSpecdevFixedAsset tSpecdevFixedAsset)
+    {
+        return toAjax(tSpecdevFixedAssetService.updateTSpecdevFixedAsset(tSpecdevFixedAsset));
+    }
+
+    /**
+     * 删除固定资产
+     */
+    @PreAuthorize("@ss.hasPermi('sems:fixedAsset:remove')")
+    @Log(title = "固定资产", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tSpecdevFixedAssetService.deleteTSpecdevFixedAssetByIds(ids));
+    }
+
+    @Log(title = "固定资产清单批量导入", businessType = BusinessType.INSERT)
+    @PostMapping("/importData")
+    public AjaxResult importData(@RequestParam("file") MultipartFile file) throws IOException {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TSpecdevFixedAsset> list = new ArrayList<>();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        //字典查询
+        List<SysDictData> usingStatus = iSysDictTypeService.selectDictDataByType("spec_dev_status");
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 2; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                int cellNum = row.getLastCellNum();
+                TSpecdevFixedAsset entity = new TSpecdevFixedAsset();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        //资产类别
+                        entity.setAssetType(cellValue);
+                    } else if (j == 1) {
+                        //资产编号
+                        entity.setAssetNo(cellValue);
+                    } else if (j == 2) {
+                        //资产子编号
+                        entity.setAssetSubNo(cellValue);
+                    } else if (j == 3) {
+                        //资产描述(中文)
+                        entity.setDevName(cellValue);
+                    } else if (j == 4) {
+                        //资产描述(英文)
+                        entity.setDevEnname(cellValue);
+                    } else if (j == 5) {
+                        //成本中心名称
+                        entity.setCostCenter(cellValue);
+                    } else if (j == 6) {
+                        //成本中心代码
+                        entity.setCostCenterCode(cellValue);
+                    } else if (j == 7) {
+                        //资产类别ap003xxx
+                        entity.setAssetTypeAp(cellValue);
+                    } else if (j == 8) {
+                        //资本化日期
+                        entity.setCapitalizedDate(sdf.parse(cellValue));
+                    } else if (j == 9) {
+                        //数量
+                        entity.setQuantity(cellValue);
+                    } else if (j == 10) {
+                        //币种
+                        entity.setCurrency(cellValue);
+                    } else if (j == 11) {
+                        //原值
+                        entity.setCurrentApc(cellValue);
+                    } else if (j == 12) {
+                        //使用年限
+                        entity.setServiceLife(cellValue);
+                    } else if (j == 13) {
+                        //管理人
+                        entity.setAdministrator(cellValue);
+                    } else if (j == 14) {
+                        //位号
+                        entity.setDevNo(cellValue);
+                    } else if (j == 15) {
+                        //资产详细描述
+                        entity.setAssetDetail(cellValue);
+                    } else if (j == 16) {
+                        //工艺子单元
+                        entity.setProcessSubunit(cellValue);
+                    } else if (j == 17) {
+                        //pid图号/其他图号
+                        entity.setPidNo(cellValue);
+                    } else if (j == 18) {
+                        //安装位置
+                        entity.setInstallPosition(cellValue);
+                    } else if (j == 19) {
+                        //创建原由
+                        entity.setCreateReason(cellValue);
+                    } else if (j == 20) {
+                        //条形码位置
+                        entity.setBarcodePosition(cellValue);
+                    } else if (j == 21) {
+                        //报废原由
+                        entity.setScrapReason(cellValue);
+                    } else if (j == 22) {
+                        //报废提出日期
+                        entity.setScrapPoseDate(sdf.parse(cellValue));
+                    } else if (j == 23) {
+                        //报废完成时间
+                        entity.setScrapDoneDate(sdf.parse(cellValue));
+                    } else if (j == 24) {
+                        //报废人
+                        entity.setScraper(cellValue);
+                    } else if (j == 25) {
+                        //在用状态
+                        for (SysDictData dictData : usingStatus) {
+                            if (dictData.getDictLabel().equals(cellValue.trim())) {
+                                entity.setUsingStatus(dictData.getDictValue());
+                            }
+                        }
+                    } else if (j == 26) {
+                        //备注
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                entity.setCreaterCode(userId);
+                logger.info("entity:" + entity);
+                list.add(entity);
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + JSON.toJSONString(e));
+                failRow.add(i + 1);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TSpecdevFixedAsset t : list
+        ) {
+            failNum++;
+            try {
+                //根据使用证、注册编号、位号,进行数据更新
+                add(t);
+                successNumber++;
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum + 1);
+            }
+        }
+        logger.info("list:" + JSON.toJSONString(list));
+        logger.info("successNumber:" + String.valueOf(successNumber));
+        logger.info("failNumber:" + String.valueOf(failNumber));
+        logger.info("failRow:" + String.valueOf(failRow));
+        return AjaxResult.success(String.valueOf(successNumber), failRow);
+    }
+}

+ 338 - 0
cpms-admin/src/main/java/com/cpms/project/asset/controller/TSpecdevMainController.java

@@ -0,0 +1,338 @@
+package com.cpms.project.asset.controller;
+
+import com.alibaba.fastjson2.JSON;
+import com.cpms.common.annotation.Log;
+import com.cpms.common.core.controller.BaseController;
+import com.cpms.common.core.domain.AjaxResult;
+import com.cpms.common.core.domain.entity.SysDictData;
+import com.cpms.common.core.page.TableDataInfo;
+import com.cpms.common.enums.BusinessType;
+import com.cpms.common.utils.file.ExcelUtils;
+import com.cpms.common.utils.poi.ExcelUtil;
+import com.cpms.project.asset.domain.TSpecdevMain;
+import com.cpms.project.sems.service.ITSpecdevAqfService;
+import com.cpms.project.asset.service.ITSpecdevFixedAssetService;
+import com.cpms.project.asset.service.ITSpecdevMainService;
+import com.cpms.system.service.ISysDictTypeService;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 设备总Controller
+ *
+ * @author admin
+ * @date 2022-10-09
+ */
+@RestController
+@RequestMapping("/sems/main")
+public class TSpecdevMainController extends BaseController {
+    @Autowired
+    private ITSpecdevMainService tSpecdevMainService;
+
+    @Autowired
+    private ITSpecdevAqfService tSpecdevAqfService;
+
+    @Autowired
+    private ISysDictTypeService iSysDictTypeService;
+
+    @Autowired
+    private ITSpecdevFixedAssetService tSpecdevFixedAssetService;
+
+    /**
+     * 查询设备总列表
+     */
+    @PreAuthorize("@ss.hasPermi('sems:main:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TSpecdevMain tSpecdevMain) {
+        startPage();
+        List<TSpecdevMain> list = tSpecdevMainService.selectTSpecdevMainList(tSpecdevMain);
+//        for (TSpecdevMain specdevMain : list) {
+//            getDevType2(specdevMain);
+//        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出设备总列表
+     */
+    @PreAuthorize("@ss.hasPermi('sems:main:export')")
+    @Log(title = "设备总表格", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(TSpecdevMain tSpecdevMain) {
+        List<TSpecdevMain> list = tSpecdevMainService.selectTSpecdevMainList(tSpecdevMain);
+        List<SysDictData> devType = iSysDictTypeService.selectDictDataByType("dev_type");
+        List<SysDictData> assetStatus = iSysDictTypeService.selectDictDataByType("spec_dev_status");
+        int index = 1;
+        for (TSpecdevMain specdevMain : list) {
+            specdevMain.setIndex(index++);
+        }
+        ExcelUtil<TSpecdevMain> util = new ExcelUtil<TSpecdevMain>(TSpecdevMain.class);
+        return util.exportExcel(list, "main");
+    }
+
+    /**
+     * 获取设备总详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('sems:main:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return AjaxResult.success(tSpecdevMainService.selectTSpecdevMainById(id));
+    }
+
+    /**
+     * 新增设备总
+     */
+    @PreAuthorize("@ss.hasPermi('sems:main:add')")
+    @Log(title = "设备总表格", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TSpecdevMain tSpecdevMain) {
+        tSpecdevMainService.insertTSpecdevMain(tSpecdevMain);
+        /*switch (tSpecdevMain.getDevType2()) {
+                case "安全阀":
+                    TSpecdevAqf tSpecdevAqf = new TSpecdevAqf(tSpecdevMain);
+                    tSpecdevAqfService.insertTSpecdevAqf(tSpecdevAqf);
+                    break;
+            }*/
+        return AjaxResult.success();
+    }
+
+    /**
+     * 修改设备总
+     */
+    @PreAuthorize("@ss.hasPermi('sems:main:edit')")
+    @Log(title = "设备总表格", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TSpecdevMain tSpecdevMain) {
+        tSpecdevMainService.updateTSpecdevMain(tSpecdevMain);//            switch (tSpecdevMain.getDevType2()) {
+//                case "安全阀":
+//                    TSpecdevAqf tSpecdevAqf = new TSpecdevAqf();
+//                    tSpecdevAqf.setMainId(tSpecdevMain.getId());
+//                    if (CollectionUtils.isNotEmpty(tSpecdevAqfService.selectTSpecdevAqfList(tSpecdevAqf))) {
+//                        tSpecdevAqf = new TSpecdevAqf(tSpecdevMain);
+//                        tSpecdevAqfService.updateTSpecdevAqf(tSpecdevAqf);
+//                    } else {
+//                        tSpecdevAqf = new TSpecdevAqf(tSpecdevMain);
+//                        tSpecdevAqfService.insertTSpecdevAqf(tSpecdevAqf);
+//                    }
+//                    break;
+//            }
+        return AjaxResult.success();
+    }
+
+    /**
+     * 删除设备总
+     */
+    @PreAuthorize("@ss.hasPermi('sems:main:remove')")
+    @Log(title = "设备总表格", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        for (Long id : ids) {
+            TSpecdevMain tSpecdevMain = tSpecdevMainService.selectTSpecdevMainById(id);
+            tSpecdevMainService.deleteTSpecdevMainById(id);
+            //                switch (tSpecdevMain.getDevType2()) {
+//                    case "安全阀":
+//                        tSpecdevAqfService.deleteTSpecdevAqfByMainId(id);
+//                        break;
+//                }
+        }
+        return AjaxResult.success();
+    }
+
+    @Log(title = "设备总表格批量导入更新", businessType = BusinessType.INSERT)
+    @PostMapping("/importData")
+    public AjaxResult importData(@RequestParam("file") MultipartFile file) throws IOException {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TSpecdevMain> list = new ArrayList<>();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        //字典查询
+        List<SysDictData> devType = iSysDictTypeService.selectDictDataByType("dev_type");
+        List<SysDictData> assetStatus = iSysDictTypeService.selectDictDataByType("spec_dev_status");
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 22; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                int cellNum = row.getLastCellNum();
+                TSpecdevMain entity = new TSpecdevMain();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        //中文名
+                        entity.setDevName(cellValue);
+                    } else if (j == 1) {
+                        //英文名
+                        entity.setDevEnname(cellValue);
+                    } else if (j == 2) {
+                        //位号
+                        entity.setDevno(cellValue);
+                    } else if (j == 3) {
+                        //是否在pid上
+                        entity.setIsPid(cellValue.equals("是") ? "1" : "0");
+                    } else if (j == 4) {
+                        //PID图号/其他图号
+                        entity.setPidNo(cellValue);
+                    } else if (j == 5) {
+                        //安装位置
+                        entity.setInstallPosition(cellValue);
+                    } else if (j == 6) {
+                        //功能位置
+                        entity.setFuncPosition(cellValue);
+                    } else if (j == 7) {
+                        //资产号
+                        entity.setAssetNo(cellValue);
+                    } else if (j == 8) {
+                        //安全相关
+                        entity.setSecurityRelevant(cellValue);
+                    } else if (j == 9) {
+                        //安全相关来自
+                        entity.setSecurityRelevantFrom(cellValue);
+                    } else if (j == 10) {
+                        //生产厂家
+                        entity.setManufacturer(cellValue);
+                    } else if (j == 11) {
+                        //生产年份
+                        entity.setProductionYear(cellValue);
+                    } else if (j == 12) {
+                        //型号
+                        entity.setModel(cellValue);
+                    } else if (j == 13) {
+                        //主要规格参数
+                        entity.setMainSpecifications(cellValue);
+                    } else if (j == 14) {
+                        //设备铭牌
+                        entity.setDataPlate(cellValue);
+                    } else if (j == 15) {
+                        //维修风险
+                        entity.setMaintenanceRisk(cellValue);
+                    } else if (j == 16) {
+                        //生产风险
+                        entity.setProductionRisk(cellValue);
+                    } else if (j == 17) {
+                        //设备分级
+                        entity.setDevGrade(cellValue);
+                    } else if (j == 18) {
+                        //设备来自
+                        entity.setDevFrom(cellValue);
+                    } else if (j == 19) {
+                        //设备类型 (一级)
+//                        for (SysDictData dictData : devType) {
+//                            if (dictData.getDictLabel().equals(cellValue.trim())) {
+//                                entity.setDevType1(dictData.getDictValue());
+//                            }
+//                        }
+                        entity.setDevType1(cellValue);
+                    } else if (j == 20) {
+//                        //设备类型 (二级)
+//                        List<SysDictData> devType2 = new ArrayList<>();
+//                        switch (entity.getDevType1()) {
+//                            case "1"://固定资产
+//                            case "5"://电气
+//                                break;
+//                            case "2"://静设备
+//                                devType2 = iSysDictTypeService.selectDictDataByType("dev_static");
+//                                break;
+//                            case "4"://仪表
+//                                devType2 = iSysDictTypeService.selectDictDataByType("dev_meter");
+//                                break;
+//                            case "6"://动设备
+//                                devType2 = iSysDictTypeService.selectDictDataByType("dev_act");
+//                                break;
+//                            case "3"://管线
+//                                devType2 = iSysDictTypeService.selectDictDataByType("dev_tunnel");
+//                                break;
+//                        }
+//                        for (SysDictData dictData : devType2) {
+//                            if (dictData.getDictLabel().equals(cellValue.trim())) {
+//                                entity.setDevType2(dictData.getDictValue());
+//                            }
+//                        }
+                        entity.setDevType2(cellValue);
+                    } else if (j == 21) {
+                        //资产状态
+                        for (SysDictData dictData : assetStatus) {
+                            if (dictData.getDictLabel().equals(cellValue.trim())) {
+                                entity.setAssetStatus(dictData.getDictValue());
+                            }
+                        }
+                    } else if (j == 22) {
+                        //备注
+                        entity.setRemarks(cellValue);
+                    } else if (j == 23) {
+                        //
+                        entity.setMainSpecifications(entity.getMainSpecifications() + " " + cellValue);
+                    }
+                }
+                entity.setCreaterCode(userId);
+                logger.info("entity:" + entity);
+                list.add(entity);
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + JSON.toJSONString(e));
+                failRow.add(i + 1);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TSpecdevMain t : list
+        ) {
+            failNum++;
+            try {
+                //根据使用证、注册编号、位号,进行数据更新
+                add(t);
+                successNumber++;
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum + 1);
+            }
+        }
+        logger.info("list:" + JSON.toJSONString(list));
+        logger.info("successNumber:" + successNumber);
+        logger.info("failNumber:" + failNumber);
+        logger.info("failRow:" + failRow);
+        return AjaxResult.success(String.valueOf(successNumber), failRow);
+    }
+
+    @PostMapping("/syncAllDev")
+    public AjaxResult syncAllDev() {
+        for (TSpecdevMain tSpecdevMain : tSpecdevMainService.selectTSpecdevMainList(new TSpecdevMain())) {
+//            if (StringUtils.isNotEmpty(tSpecdevMain.getDevType2())) {
+//                switch (tSpecdevMain.getDevType2()) {
+//                    case "安全阀":
+//                        TSpecdevAqf tSpecdevAqf = new TSpecdevAqf();
+//                        tSpecdevAqf.setMainId(tSpecdevMain.getId());
+//                        if (CollectionUtils.isEmpty(tSpecdevAqfService.selectTSpecdevAqfList(tSpecdevAqf))) {
+//                            tSpecdevAqf = new TSpecdevAqf(tSpecdevMain);
+//                            tSpecdevAqfService.insertTSpecdevAqf(tSpecdevAqf);
+//                        }
+//                        break;
+//                    default:
+//                        break;
+//                }
+//            }
+        }
+        return AjaxResult.success();
+    }
+}

+ 111 - 0
cpms-admin/src/main/java/com/cpms/project/asset/controller/TSpecdevTypemgrController.java

@@ -0,0 +1,111 @@
+package com.cpms.project.asset.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.cpms.common.annotation.Log;
+import com.cpms.common.core.controller.BaseController;
+import com.cpms.common.core.domain.AjaxResult;
+import com.cpms.common.core.page.TableDataInfo;
+import com.cpms.common.enums.BusinessType;
+import com.cpms.common.utils.poi.ExcelUtil;
+import com.cpms.project.asset.domain.TSpecdevTypemgr;
+import com.cpms.project.asset.service.ITSpecdevTypemgrService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 设备类型管理Controller
+ *
+ * @author admin
+ * @date 2023-08-08
+ */
+@RestController
+@RequestMapping("/sems/typemgr")
+public class TSpecdevTypemgrController extends BaseController
+{
+    @Autowired
+    private ITSpecdevTypemgrService tSpecdevTypemgrService;
+
+    /**
+     * 查询设备类型管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('sems:typemgr:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TSpecdevTypemgr tSpecdevTypemgr)
+    {
+        startPage();
+        List<TSpecdevTypemgr> list = tSpecdevTypemgrService.selectTSpecdevTypemgrList(tSpecdevTypemgr);
+        return getDataTable(list);
+    }
+    @PreAuthorize("@ss.hasPermi('sems:typemgr:list')")
+    @GetMapping("/listAll")
+    public AjaxResult listAll(TSpecdevTypemgr tSpecdevTypemgr)
+    {
+        return AjaxResult.success(tSpecdevTypemgrService.selectTSpecdevTypemgrList(tSpecdevTypemgr));
+    }
+
+    /**
+     * 导出设备类型管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('sems:typemgr:export')")
+    @Log(title = "设备类型管理", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TSpecdevTypemgr tSpecdevTypemgr)
+    {
+        List<TSpecdevTypemgr> list = tSpecdevTypemgrService.selectTSpecdevTypemgrList(tSpecdevTypemgr);
+        ExcelUtil<TSpecdevTypemgr> util = new ExcelUtil<TSpecdevTypemgr>(TSpecdevTypemgr.class);
+        util.exportExcel( list, "设备类型管理数据");
+    }
+
+    /**
+     * 获取设备类型管理详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('sems:typemgr:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(tSpecdevTypemgrService.selectTSpecdevTypemgrById(id));
+    }
+
+    /**
+     * 新增设备类型管理
+     */
+    @PreAuthorize("@ss.hasPermi('sems:typemgr:add')")
+    @Log(title = "设备类型管理", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TSpecdevTypemgr tSpecdevTypemgr)
+    {
+        return toAjax(tSpecdevTypemgrService.insertTSpecdevTypemgr(tSpecdevTypemgr));
+    }
+
+    /**
+     * 修改设备类型管理
+     */
+    @PreAuthorize("@ss.hasPermi('sems:typemgr:edit')")
+    @Log(title = "设备类型管理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TSpecdevTypemgr tSpecdevTypemgr)
+    {
+        return toAjax(tSpecdevTypemgrService.updateTSpecdevTypemgr(tSpecdevTypemgr));
+    }
+
+    /**
+     * 删除设备类型管理
+     */
+    @PreAuthorize("@ss.hasPermi('sems:typemgr:remove')")
+    @Log(title = "设备类型管理", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tSpecdevTypemgrService.deleteTSpecdevTypemgrByIds(ids));
+    }
+}

+ 323 - 0
cpms-admin/src/main/java/com/cpms/project/asset/domain/TLeakagePoints.java

@@ -0,0 +1,323 @@
+package com.cpms.project.asset.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.cpms.common.annotation.Excel;
+import com.cpms.common.core.domain.BaseEntity;
+
+/**
+ * 漏点清单对象 t_leakage_points
+ * 
+ * @author admin
+ * @date 2024-03-28
+ */
+public class TLeakagePoints extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long id;
+
+    /** 漏点编号 */
+    @Excel(name = "漏点编号")
+    private String pointNo;
+
+    /** 泄漏位置 */
+    @Excel(name = "泄漏位置")
+    private String leakagePosition;
+
+    /** 泄漏介质 */
+    @Excel(name = "泄漏介质")
+    private String leakageMedium;
+
+    /** 发现时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    @Excel(name = "发现时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date discoveryTime;
+
+    /** 发现人员 */
+    @Excel(name = "发现人员")
+    private String discoveryName;
+
+    /** 泄漏量 */
+    @Excel(name = "泄漏量")
+    private String leakageAmount;
+
+    /** SAP通知单号 */
+    @Excel(name = "SAP通知单号")
+    private String sapNo;
+
+    /** 消漏时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    @Excel(name = "消漏时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date leakageEliminationTime;
+
+    /** 消漏方法 */
+    @Excel(name = "消漏方法")
+    private String leakageEliminationFunc;
+
+    /** 挂牌 */
+    @Excel(name = "挂牌")
+    private String listing;
+
+    /** 带压堵漏 */
+    @Excel(name = "带压堵漏")
+    private String pressurePlugging;
+
+    /** 消漏结果 */
+    @Excel(name = "消漏结果")
+    private String leakageEliminationResult;
+
+    /** 下次检修日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    @Excel(name = "下次检修日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date nextCheckDate;
+
+    /** 备注 */
+    @Excel(name = "备注")
+    private String remarks;
+
+    /** 删除标识 */
+    private Integer delFlag;
+
+    /** 创建人 */
+    @Excel(name = "创建人")
+    private String createrCode;
+
+    /** 创建日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    @Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date createdate;
+
+    /** 更新人 */
+    @Excel(name = "更新人")
+    private String updaterCode;
+
+    /** 更新日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    @Excel(name = "更新日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date updatedate;
+
+    /** 部门编号 */
+    @Excel(name = "部门编号")
+    private Long deptId;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setPointNo(String pointNo) 
+    {
+        this.pointNo = pointNo;
+    }
+
+    public String getPointNo() 
+    {
+        return pointNo;
+    }
+    public void setLeakagePosition(String leakagePosition) 
+    {
+        this.leakagePosition = leakagePosition;
+    }
+
+    public String getLeakagePosition() 
+    {
+        return leakagePosition;
+    }
+    public void setLeakageMedium(String leakageMedium) 
+    {
+        this.leakageMedium = leakageMedium;
+    }
+
+    public String getLeakageMedium() 
+    {
+        return leakageMedium;
+    }
+    public void setDiscoveryTime(Date discoveryTime) 
+    {
+        this.discoveryTime = discoveryTime;
+    }
+
+    public Date getDiscoveryTime() 
+    {
+        return discoveryTime;
+    }
+    public void setDiscoveryName(String discoveryName) 
+    {
+        this.discoveryName = discoveryName;
+    }
+
+    public String getDiscoveryName() 
+    {
+        return discoveryName;
+    }
+    public void setLeakageAmount(String leakageAmount) 
+    {
+        this.leakageAmount = leakageAmount;
+    }
+
+    public String getLeakageAmount() 
+    {
+        return leakageAmount;
+    }
+    public void setSapNo(String sapNo) 
+    {
+        this.sapNo = sapNo;
+    }
+
+    public String getSapNo() 
+    {
+        return sapNo;
+    }
+    public void setLeakageEliminationTime(Date leakageEliminationTime) 
+    {
+        this.leakageEliminationTime = leakageEliminationTime;
+    }
+
+    public Date getLeakageEliminationTime() 
+    {
+        return leakageEliminationTime;
+    }
+    public void setLeakageEliminationFunc(String leakageEliminationFunc) 
+    {
+        this.leakageEliminationFunc = leakageEliminationFunc;
+    }
+
+    public String getLeakageEliminationFunc() 
+    {
+        return leakageEliminationFunc;
+    }
+    public void setListing(String listing) 
+    {
+        this.listing = listing;
+    }
+
+    public String getListing() 
+    {
+        return listing;
+    }
+    public void setPressurePlugging(String pressurePlugging) 
+    {
+        this.pressurePlugging = pressurePlugging;
+    }
+
+    public String getPressurePlugging() 
+    {
+        return pressurePlugging;
+    }
+    public void setLeakageEliminationResult(String leakageEliminationResult) 
+    {
+        this.leakageEliminationResult = leakageEliminationResult;
+    }
+
+    public String getLeakageEliminationResult() 
+    {
+        return leakageEliminationResult;
+    }
+    public void setNextCheckDate(Date nextCheckDate) 
+    {
+        this.nextCheckDate = nextCheckDate;
+    }
+
+    public Date getNextCheckDate() 
+    {
+        return nextCheckDate;
+    }
+    public void setRemarks(String remarks) 
+    {
+        this.remarks = remarks;
+    }
+
+    public String getRemarks() 
+    {
+        return remarks;
+    }
+    public void setDelFlag(Integer delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public Integer getDelFlag() 
+    {
+        return delFlag;
+    }
+    public void setCreaterCode(String createrCode) 
+    {
+        this.createrCode = createrCode;
+    }
+
+    public String getCreaterCode() 
+    {
+        return createrCode;
+    }
+    public void setCreatedate(Date createdate) 
+    {
+        this.createdate = createdate;
+    }
+
+    public Date getCreatedate() 
+    {
+        return createdate;
+    }
+    public void setUpdaterCode(String updaterCode) 
+    {
+        this.updaterCode = updaterCode;
+    }
+
+    public String getUpdaterCode() 
+    {
+        return updaterCode;
+    }
+    public void setUpdatedate(Date updatedate) 
+    {
+        this.updatedate = updatedate;
+    }
+
+    public Date getUpdatedate() 
+    {
+        return updatedate;
+    }
+    public void setDeptId(Long deptId) 
+    {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId() 
+    {
+        return deptId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("pointNo", getPointNo())
+            .append("leakagePosition", getLeakagePosition())
+            .append("leakageMedium", getLeakageMedium())
+            .append("discoveryTime", getDiscoveryTime())
+            .append("discoveryName", getDiscoveryName())
+            .append("leakageAmount", getLeakageAmount())
+            .append("sapNo", getSapNo())
+            .append("leakageEliminationTime", getLeakageEliminationTime())
+            .append("leakageEliminationFunc", getLeakageEliminationFunc())
+            .append("listing", getListing())
+            .append("pressurePlugging", getPressurePlugging())
+            .append("leakageEliminationResult", getLeakageEliminationResult())
+            .append("nextCheckDate", getNextCheckDate())
+            .append("remarks", getRemarks())
+            .append("delFlag", getDelFlag())
+            .append("createrCode", getCreaterCode())
+            .append("createdate", getCreatedate())
+            .append("updaterCode", getUpdaterCode())
+            .append("updatedate", getUpdatedate())
+            .append("deptId", getDeptId())
+            .toString();
+    }
+}

+ 236 - 0
cpms-admin/src/main/java/com/cpms/project/asset/domain/TLeakagePointsPatrol.java

@@ -0,0 +1,236 @@
+package com.cpms.project.asset.domain;
+
+import java.util.Date;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.cpms.common.annotation.Excel;
+import com.cpms.common.core.domain.BaseEntity;
+
+/**
+ * 漏点巡检对象 t_leakage_points_patrol
+ * 
+ * @author admin
+ * @date 2024-04-01
+ */
+public class TLeakagePointsPatrol extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long id;
+
+    /** 班组 */
+    @Excel(name = "班组")
+    private String teamM;
+
+    /** 日期 */
+   @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    @Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date checkDateM;
+
+    /** 检查人 */
+    @Excel(name = "检查人")
+    private String signM;
+
+    /** 班组 */
+    @Excel(name = "班组")
+    private String teamN;
+
+    /** 日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    @Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date checkDateN;
+
+    /** 检查人 */
+    @Excel(name = "检查人")
+    private String signN;
+
+    /** 备注 */
+    @Excel(name = "备注")
+    private String remarks;
+
+    /** 删除标识 */
+    private Integer delFlag;
+
+    /** 创建人 */
+    @Excel(name = "创建人")
+    private String createrCode;
+
+    /** 创建日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    @Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date createdate;
+
+    /** 更新人 */
+    @Excel(name = "更新人")
+    private String updaterCode;
+
+    /** 更新日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    @Excel(name = "更新日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date updatedate;
+
+    /** 部门编号 */
+    @Excel(name = "部门编号")
+    private Long deptId;
+
+    private List<TLeakagePointsRecord> records;
+
+    public List<TLeakagePointsRecord> getRecords() {
+        return records;
+    }
+
+    public void setRecords(List<TLeakagePointsRecord> records) {
+        this.records = records;
+    }
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setTeamM(String teamM) 
+    {
+        this.teamM = teamM;
+    }
+
+    public String getTeamM() 
+    {
+        return teamM;
+    }
+    public void setCheckDateM(Date checkDateM) 
+    {
+        this.checkDateM = checkDateM;
+    }
+
+    public Date getCheckDateM() 
+    {
+        return checkDateM;
+    }
+    public void setSignM(String signM) 
+    {
+        this.signM = signM;
+    }
+
+    public String getSignM() 
+    {
+        return signM;
+    }
+    public void setTeamN(String teamN) 
+    {
+        this.teamN = teamN;
+    }
+
+    public String getTeamN() 
+    {
+        return teamN;
+    }
+    public void setCheckDateN(Date checkDateN) 
+    {
+        this.checkDateN = checkDateN;
+    }
+
+    public Date getCheckDateN() 
+    {
+        return checkDateN;
+    }
+    public void setSignN(String signN) 
+    {
+        this.signN = signN;
+    }
+
+    public String getSignN() 
+    {
+        return signN;
+    }
+    public void setRemarks(String remarks) 
+    {
+        this.remarks = remarks;
+    }
+
+    public String getRemarks() 
+    {
+        return remarks;
+    }
+    public void setDelFlag(Integer delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public Integer getDelFlag() 
+    {
+        return delFlag;
+    }
+    public void setCreaterCode(String createrCode) 
+    {
+        this.createrCode = createrCode;
+    }
+
+    public String getCreaterCode() 
+    {
+        return createrCode;
+    }
+    public void setCreatedate(Date createdate) 
+    {
+        this.createdate = createdate;
+    }
+
+    public Date getCreatedate() 
+    {
+        return createdate;
+    }
+    public void setUpdaterCode(String updaterCode) 
+    {
+        this.updaterCode = updaterCode;
+    }
+
+    public String getUpdaterCode() 
+    {
+        return updaterCode;
+    }
+    public void setUpdatedate(Date updatedate) 
+    {
+        this.updatedate = updatedate;
+    }
+
+    public Date getUpdatedate() 
+    {
+        return updatedate;
+    }
+    public void setDeptId(Long deptId) 
+    {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId() 
+    {
+        return deptId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("teamM", getTeamM())
+            .append("checkDateM", getCheckDateM())
+            .append("signM", getSignM())
+            .append("teamN", getTeamN())
+            .append("checkDateN", getCheckDateN())
+            .append("signN", getSignN())
+            .append("remarks", getRemarks())
+            .append("delFlag", getDelFlag())
+            .append("createrCode", getCreaterCode())
+            .append("createdate", getCreatedate())
+            .append("updaterCode", getUpdaterCode())
+            .append("updatedate", getUpdatedate())
+            .append("deptId", getDeptId())
+            .toString();
+    }
+}

+ 250 - 0
cpms-admin/src/main/java/com/cpms/project/asset/domain/TLeakagePointsRecord.java

@@ -0,0 +1,250 @@
+package com.cpms.project.asset.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.cpms.common.annotation.Excel;
+import com.cpms.common.core.domain.BaseEntity;
+
+/**
+ * 漏点巡检记录 对象 t_leakage_points_record
+ * 
+ * @author admin
+ * @date 2024-04-01
+ */
+public class TLeakagePointsRecord extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long id;
+
+    /** 巡检id */
+    @Excel(name = "巡检id")
+    private Long patrolId;
+
+    /** 漏点编号 */
+    @Excel(name = "漏点编号")
+    private String pointNo;
+
+    /** 泄漏位置 */
+    @Excel(name = "泄漏位置")
+    private String leakagePosition;
+
+    /** 介质 */
+    @Excel(name = "介质")
+    private String leakageMedium;
+
+    /** 挂牌 */
+    @Excel(name = "挂牌")
+    private String suspendPlateM;
+
+    /** 泄露状态 */
+    @Excel(name = "泄露状态")
+    private String leakageStatusM;
+
+    /** 挂牌 */
+    @Excel(name = "挂牌")
+    private String suspendPlateN;
+
+    /** 泄露状态 */
+    @Excel(name = "泄露状态")
+    private String leakageStatusN;
+
+    /** 备注 */
+    @Excel(name = "备注")
+    private String remarks;
+
+    /** 删除标识 */
+    private Integer delFlag;
+
+    /** 创建人 */
+    @Excel(name = "创建人")
+    private String createrCode;
+
+    /** 创建日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    @Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date createdate;
+
+    /** 更新人 */
+    @Excel(name = "更新人")
+    private String updaterCode;
+
+    /** 更新日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    @Excel(name = "更新日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date updatedate;
+
+    /** 部门编号 */
+    @Excel(name = "部门编号")
+    private Long deptId;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setPatrolId(Long patrolId) 
+    {
+        this.patrolId = patrolId;
+    }
+
+    public Long getPatrolId() 
+    {
+        return patrolId;
+    }
+    public void setPointNo(String pointNo) 
+    {
+        this.pointNo = pointNo;
+    }
+
+    public String getPointNo() 
+    {
+        return pointNo;
+    }
+    public void setLeakagePosition(String leakagePosition) 
+    {
+        this.leakagePosition = leakagePosition;
+    }
+
+    public String getLeakagePosition() 
+    {
+        return leakagePosition;
+    }
+    public void setLeakageMedium(String leakageMedium) 
+    {
+        this.leakageMedium = leakageMedium;
+    }
+
+    public String getLeakageMedium() 
+    {
+        return leakageMedium;
+    }
+    public void setSuspendPlateM(String suspendPlateM) 
+    {
+        this.suspendPlateM = suspendPlateM;
+    }
+
+    public String getSuspendPlateM() 
+    {
+        return suspendPlateM;
+    }
+    public void setLeakageStatusM(String leakageStatusM) 
+    {
+        this.leakageStatusM = leakageStatusM;
+    }
+
+    public String getLeakageStatusM() 
+    {
+        return leakageStatusM;
+    }
+    public void setSuspendPlateN(String suspendPlateN) 
+    {
+        this.suspendPlateN = suspendPlateN;
+    }
+
+    public String getSuspendPlateN() 
+    {
+        return suspendPlateN;
+    }
+    public void setLeakageStatusN(String leakageStatusN) 
+    {
+        this.leakageStatusN = leakageStatusN;
+    }
+
+    public String getLeakageStatusN() 
+    {
+        return leakageStatusN;
+    }
+    public void setRemarks(String remarks) 
+    {
+        this.remarks = remarks;
+    }
+
+    public String getRemarks() 
+    {
+        return remarks;
+    }
+    public void setDelFlag(Integer delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public Integer getDelFlag() 
+    {
+        return delFlag;
+    }
+    public void setCreaterCode(String createrCode) 
+    {
+        this.createrCode = createrCode;
+    }
+
+    public String getCreaterCode() 
+    {
+        return createrCode;
+    }
+    public void setCreatedate(Date createdate) 
+    {
+        this.createdate = createdate;
+    }
+
+    public Date getCreatedate() 
+    {
+        return createdate;
+    }
+    public void setUpdaterCode(String updaterCode) 
+    {
+        this.updaterCode = updaterCode;
+    }
+
+    public String getUpdaterCode() 
+    {
+        return updaterCode;
+    }
+    public void setUpdatedate(Date updatedate) 
+    {
+        this.updatedate = updatedate;
+    }
+
+    public Date getUpdatedate() 
+    {
+        return updatedate;
+    }
+    public void setDeptId(Long deptId) 
+    {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId() 
+    {
+        return deptId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("patrolId", getPatrolId())
+            .append("pointNo", getPointNo())
+            .append("leakagePosition", getLeakagePosition())
+            .append("leakageMedium", getLeakageMedium())
+            .append("suspendPlateM", getSuspendPlateM())
+            .append("leakageStatusM", getLeakageStatusM())
+            .append("suspendPlateN", getSuspendPlateN())
+            .append("leakageStatusN", getLeakageStatusN())
+            .append("remarks", getRemarks())
+            .append("delFlag", getDelFlag())
+            .append("createrCode", getCreaterCode())
+            .append("createdate", getCreatedate())
+            .append("updaterCode", getUpdaterCode())
+            .append("updatedate", getUpdatedate())
+            .append("deptId", getDeptId())
+            .toString();
+    }
+}

+ 453 - 0
cpms-admin/src/main/java/com/cpms/project/asset/domain/TSpecdevAsset.java

@@ -0,0 +1,453 @@
+package com.cpms.project.asset.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.cpms.common.annotation.Excel;
+import com.cpms.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.Date;
+
+/**
+ * 资产与运营对象 t_specdev_asset
+ *
+ * @author admin
+ * @date 2022-10-12
+ */
+public class TSpecdevAsset extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 唯一标识id */
+    private Long id;
+
+    /** Type */
+    @Excel(name = "Type")
+    private String type;
+
+    /** 内容 */
+    @Excel(name = "内容")
+    private String content;
+
+    /** PID图号/管线号 */
+    @Excel(name = "PID图号/管线号")
+    private String pidNo;
+
+    /** 分界具体位置及描述 */
+    @Excel(name = "分界具体位置及描述")
+    private String positionDescribe;
+
+    /** According to */
+    @Excel(name = "According to")
+    private String accordingTo;
+
+    /** 资产 */
+    @Excel(name = "资产")
+    private String asset;
+
+    /** DCS操作 */
+    @Excel(name = "DCS操作")
+    private String dcsOperation;
+
+    /** 现场操作8小时 */
+    @Excel(name = "现场操作8小时")
+    private String inSceneOperation;
+
+    /** 现场操作8小时外 */
+    @Excel(name = "现场操作8小时外")
+    private String outSceneOperation;
+
+    /** 巡检8小时 */
+    @Excel(name = "巡检8小时")
+    private String inInspection;
+
+    /** 巡检8小时外 */
+    @Excel(name = "巡检8小时外")
+    private String outInspection;
+
+    /** 维修8小时 */
+    @Excel(name = "维修8小时")
+    private String inRepair;
+
+    /** 维修8小时外 */
+    @Excel(name = "维修8小时外")
+    private String outRepair;
+
+    /** 维修协调8小时 */
+    @Excel(name = "维修协调8小时")
+    private String inMaintenanceCoordination;
+
+    /** 维修协调8小时外 */
+    @Excel(name = "维修协调8小时外")
+    private String outMaintenanceCoordination;
+
+    /** 现场操作8小时 */
+    @Excel(name = "技术管理8小时")
+    private String inTechnicalManagement;
+
+    /** 现场操作8小时外 */
+    @Excel(name = "技术管理8小时外")
+    private String outTechnicalManagement;
+
+    /** 位置 */
+    @Excel(name = "位置")
+    private String position;
+
+    /** 管径 */
+    @Excel(name = "管径")
+    private String pipeDiameter;
+
+    /** 照片 */
+    @Excel(name = "照片")
+    private String picUrl;
+    private String picName;
+
+    /** 状态 */
+    @Excel(name = "状态")
+    private Long status;
+
+    /** 状态 0 :正常 ;-1:删除 */
+    private Long delFlag;
+
+    /** 创建人 */
+    @Excel(name = "创建人")
+    private Long createrCode;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date createdate;
+
+    /** 修改人 */
+    @Excel(name = "修改人")
+    private Long updaterCode;
+
+    /** 修改时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date updatedate;
+
+    /** 部门编号 */
+    @Excel(name = "部门编号")
+    private Long deptId;
+
+    /** 备注 */
+    @Excel(name = "备注")
+    private String remarks;
+
+
+    private String fuzzy;
+
+    public String getFuzzy() {
+        return fuzzy;
+    }
+
+    public void setFuzzy(String fuzzy) {
+        this.fuzzy = fuzzy;
+    }
+
+    public String getPicName() {
+        return picName;
+    }
+
+    public void setPicName(String picName) {
+        this.picName = picName;
+    }
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setType(String type)
+    {
+        this.type = type;
+    }
+
+    public String getType()
+    {
+        return type;
+    }
+    public void setContent(String content)
+    {
+        this.content = content;
+    }
+
+    public String getContent()
+    {
+        return content;
+    }
+    public void setPidNo(String pidNo)
+    {
+        this.pidNo = pidNo;
+    }
+
+    public String getPidNo()
+    {
+        return pidNo;
+    }
+    public void setPositionDescribe(String positionDescribe)
+    {
+        this.positionDescribe = positionDescribe;
+    }
+
+    public String getPositionDescribe()
+    {
+        return positionDescribe;
+    }
+    public void setAccordingTo(String accordingTo)
+    {
+        this.accordingTo = accordingTo;
+    }
+
+    public String getAccordingTo()
+    {
+        return accordingTo;
+    }
+    public void setAsset(String asset)
+    {
+        this.asset = asset;
+    }
+
+    public String getAsset()
+    {
+        return asset;
+    }
+    public void setDcsOperation(String dcsOperation)
+    {
+        this.dcsOperation = dcsOperation;
+    }
+
+    public String getDcsOperation()
+    {
+        return dcsOperation;
+    }
+    public void setInSceneOperation(String inSceneOperation)
+    {
+        this.inSceneOperation = inSceneOperation;
+    }
+
+    public String getInSceneOperation()
+    {
+        return inSceneOperation;
+    }
+    public void setOutSceneOperation(String outSceneOperation)
+    {
+        this.outSceneOperation = outSceneOperation;
+    }
+
+    public String getOutSceneOperation()
+    {
+        return outSceneOperation;
+    }
+    public void setInInspection(String inInspection)
+    {
+        this.inInspection = inInspection;
+    }
+
+    public String getInInspection()
+    {
+        return inInspection;
+    }
+    public void setOutInspection(String outInspection)
+    {
+        this.outInspection = outInspection;
+    }
+
+    public String getOutInspection()
+    {
+        return outInspection;
+    }
+    public void setInRepair(String inRepair)
+    {
+        this.inRepair = inRepair;
+    }
+
+    public String getInRepair()
+    {
+        return inRepair;
+    }
+    public void setOutRepair(String outRepair)
+    {
+        this.outRepair = outRepair;
+    }
+
+    public String getOutRepair()
+    {
+        return outRepair;
+    }
+    public void setInMaintenanceCoordination(String inMaintenanceCoordination)
+    {
+        this.inMaintenanceCoordination = inMaintenanceCoordination;
+    }
+
+    public String getInMaintenanceCoordination()
+    {
+        return inMaintenanceCoordination;
+    }
+    public void setOutMaintenanceCoordination(String outMaintenanceCoordination)
+    {
+        this.outMaintenanceCoordination = outMaintenanceCoordination;
+    }
+
+    public String getOutMaintenanceCoordination()
+    {
+        return outMaintenanceCoordination;
+    }
+    public void setInTechnicalManagement(String inTechnicalManagement)
+    {
+        this.inTechnicalManagement = inTechnicalManagement;
+    }
+
+    public String getInTechnicalManagement()
+    {
+        return inTechnicalManagement;
+    }
+    public void setOutTechnicalManagement(String outTechnicalManagement)
+    {
+        this.outTechnicalManagement = outTechnicalManagement;
+    }
+
+    public String getOutTechnicalManagement()
+    {
+        return outTechnicalManagement;
+    }
+    public void setPosition(String position)
+    {
+        this.position = position;
+    }
+
+    public String getPosition()
+    {
+        return position;
+    }
+    public void setPipeDiameter(String pipeDiameter)
+    {
+        this.pipeDiameter = pipeDiameter;
+    }
+
+    public String getPipeDiameter()
+    {
+        return pipeDiameter;
+    }
+    public void setPicUrl(String picUrl)
+    {
+        this.picUrl = picUrl;
+    }
+
+    public String getPicUrl()
+    {
+        return picUrl;
+    }
+    public void setStatus(Long status)
+    {
+        this.status = status;
+    }
+
+    public Long getStatus()
+    {
+        return status;
+    }
+    public void setDelFlag(Long delFlag)
+    {
+        this.delFlag = delFlag;
+    }
+
+    public Long getDelFlag()
+    {
+        return delFlag;
+    }
+    public void setCreaterCode(Long createrCode)
+    {
+        this.createrCode = createrCode;
+    }
+
+    public Long getCreaterCode()
+    {
+        return createrCode;
+    }
+    public void setCreatedate(Date createdate)
+    {
+        this.createdate = createdate;
+    }
+
+    public Date getCreatedate()
+    {
+        return createdate;
+    }
+    public void setUpdaterCode(Long updaterCode)
+    {
+        this.updaterCode = updaterCode;
+    }
+
+    public Long getUpdaterCode()
+    {
+        return updaterCode;
+    }
+    public void setUpdatedate(Date updatedate)
+    {
+        this.updatedate = updatedate;
+    }
+
+    public Date getUpdatedate()
+    {
+        return updatedate;
+    }
+    public void setDeptId(Long deptId)
+    {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId()
+    {
+        return deptId;
+    }
+    public void setRemarks(String remarks)
+    {
+        this.remarks = remarks;
+    }
+
+    public String getRemarks()
+    {
+        return remarks;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("type", getType())
+            .append("content", getContent())
+            .append("pidNo", getPidNo())
+            .append("positionDescribe", getPositionDescribe())
+            .append("accordingTo", getAccordingTo())
+            .append("asset", getAsset())
+            .append("dcsOperation", getDcsOperation())
+            .append("inSceneOperation", getInSceneOperation())
+            .append("outSceneOperation", getOutSceneOperation())
+            .append("inInspection", getInInspection())
+            .append("outInspection", getOutInspection())
+            .append("inRepair", getInRepair())
+            .append("outRepair", getOutRepair())
+            .append("inMaintenanceCoordination", getInMaintenanceCoordination())
+            .append("outMaintenanceCoordination", getOutMaintenanceCoordination())
+            .append("inTechnicalManagement", getInTechnicalManagement())
+            .append("outTechnicalManagement", getOutTechnicalManagement())
+            .append("position", getPosition())
+            .append("pipeDiameter", getPipeDiameter())
+            .append("picUrl", getPicUrl())
+            .append("status", getStatus())
+            .append("delFlag", getDelFlag())
+            .append("createrCode", getCreaterCode())
+            .append("createdate", getCreatedate())
+            .append("updaterCode", getUpdaterCode())
+            .append("updatedate", getUpdatedate())
+            .append("deptId", getDeptId())
+            .append("remarks", getRemarks())
+            .toString();
+    }
+}

+ 571 - 0
cpms-admin/src/main/java/com/cpms/project/asset/domain/TSpecdevFixedAsset.java

@@ -0,0 +1,571 @@
+package com.cpms.project.asset.domain;
+
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.cpms.common.annotation.Excel;
+import com.cpms.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.Date;
+
+/**
+ * 固定资产对象 t_specdev_fixed_asset
+ *
+ * @author admin
+ * @date 2022-10-18
+ */
+public class TSpecdevFixedAsset extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    public TSpecdevFixedAsset(TSpecdevMain main) {
+        this.devNo = main.getDevno();
+        this.pidNo = main.getPidNo();
+        this.devName = main.getDevName();
+        this.devEnname = main.getDevEnname();
+        this.installPosition = main.getInstallPosition();
+//        this.assetNo = main.getAssetNo();
+        this.usingStatus = main.getAssetStatus();
+    }
+
+    public TSpecdevFixedAsset() {
+    }
+
+    /**
+     * 唯一标识id
+     */
+    private Long id;
+
+    /**
+     * 资产类别
+     */
+    @Excel(name = "资产类别")
+    private String assetType;
+
+    /**
+     * 资产编号
+     */
+    @Excel(name = "资产编号")
+    private String assetNo;
+
+    /**
+     * 资产子编号
+     */
+    @Excel(name = "资产子编号")
+    private String assetSubNo;
+
+    /**
+     * 资产描述(中文)
+     */
+    @Excel(name = "资产描述(中文)")
+    private String devName;
+
+    /**
+     * 资产描述(英文)
+     */
+    @Excel(name = "资产描述(英文)")
+    private String devEnname;
+
+    /**
+     * 成本中心名称
+     */
+    @Excel(name = "成本中心名称")
+    private String costCenter;
+
+    /**
+     * 成本中心代码
+     */
+    @Excel(name = "成本中心代码")
+    private String costCenterCode;
+
+    /**
+     * 资产类别AP03XXX
+     */
+    @Excel(name = "资产类别AP03XXX")
+    private String assetTypeAp;
+
+    /**
+     * 资本化日期Capitalized on
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @Excel(name = "资本化日期Capitalized on", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date capitalizedDate;
+
+    /**
+     * 数量Quantity
+     */
+    @Excel(name = "数量Quantity")
+    private String quantity;
+
+    /**
+     * 币种
+     */
+    @Excel(name = "币种")
+    private String currency;
+
+    /**
+     * 原值Current APC
+     */
+    @Excel(name = "原值Current APC")
+    private String currentApc;
+
+    /**
+     * 使用年限
+     */
+    @Excel(name = "使用年限")
+    private String serviceLife;
+
+    /**
+     * 管理人
+     */
+    @Excel(name = "管理人")
+    private String administrator;
+
+    /**
+     * 位号
+     */
+    @Excel(name = "位号")
+    private String devNo;
+
+    /**
+     * 资产详细
+     */
+    @Excel(name = "资产详细")
+    private String assetDetail;
+
+    /**
+     * 工艺子单元
+     */
+    @Excel(name = "工艺子单元")
+    private String processSubunit;
+
+    /**
+     * PID图号/其他图号
+     */
+    @Excel(name = "PID图号/其他图号")
+    private String pidNo;
+
+    /**
+     * 安装位置
+     */
+    @Excel(name = "安装位置")
+    private String installPosition;
+
+    /**
+     * 创建原由(项目号MOC号)
+     */
+    @Excel(name = "创建原由(项目号MOC号)")
+    private String createReason;
+
+    /**
+     * 条形码位置
+     */
+    @Excel(name = "条形码位置")
+    private String barcodePosition;
+
+    /**
+     * 报废原由
+     */
+    @Excel(name = "报废原由")
+    private String scrapReason;
+
+    /**
+     * 报废提出时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @Excel(name = "报废提出时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date scrapPoseDate;
+
+    /**
+     * 报废完成时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @Excel(name = "报废完成时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date scrapDoneDate;
+
+    /**
+     * 报废人
+     */
+    @Excel(name = "报废人")
+    private String scraper;
+
+    /**
+     * 在用状态
+     */
+    @Excel(name = "在用状态", dictType = "spec_dev_status")
+    private String usingStatus;
+
+    /**
+     * 状态
+     */
+    private Long status;
+
+    /**
+     * 状态 0 :正常 ;-1:删除
+     */
+    private Long delFlag;
+
+    /**
+     * 创建人
+     */
+    private Long createrCode;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date createdate;
+
+    /**
+     * 修改人
+     */
+    private Long updaterCode;
+
+    /**
+     * 修改时间
+     */
+    private Date updatedate;
+
+    /**
+     * 部门编号
+     */
+    private Long deptId;
+
+    /**
+     * 备注
+     */
+    @Excel(name = "备注")
+    private String remarks;
+
+
+    private String fuzzy;
+
+    public String getFuzzy() {
+        return fuzzy;
+    }
+
+    public void setFuzzy(String fuzzy) {
+        this.fuzzy = fuzzy;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setAssetType(String assetType) {
+        this.assetType = assetType;
+    }
+
+    public String getAssetType() {
+        return assetType;
+    }
+
+    public void setAssetNo(String assetNo) {
+        this.assetNo = assetNo;
+    }
+
+    public String getAssetNo() {
+        return assetNo;
+    }
+
+    public void setAssetSubNo(String assetSubNo) {
+        this.assetSubNo = assetSubNo;
+    }
+
+    public String getAssetSubNo() {
+        return assetSubNo;
+    }
+
+    public void setDevName(String devName) {
+        this.devName = devName;
+    }
+
+    public String getDevName() {
+        return devName;
+    }
+
+    public void setDevEnname(String devEnname) {
+        this.devEnname = devEnname;
+    }
+
+    public String getDevEnname() {
+        return devEnname;
+    }
+
+    public void setCostCenter(String costCenter) {
+        this.costCenter = costCenter;
+    }
+
+    public String getCostCenter() {
+        return costCenter;
+    }
+
+    public void setCostCenterCode(String costCenterCode) {
+        this.costCenterCode = costCenterCode;
+    }
+
+    public String getCostCenterCode() {
+        return costCenterCode;
+    }
+
+    public void setAssetTypeAp(String assetTypeAp) {
+        this.assetTypeAp = assetTypeAp;
+    }
+
+    public String getAssetTypeAp() {
+        return assetTypeAp;
+    }
+
+    public void setCapitalizedDate(Date capitalizedDate) {
+        this.capitalizedDate = capitalizedDate;
+    }
+
+    public Date getCapitalizedDate() {
+        return capitalizedDate;
+    }
+
+    public void setQuantity(String quantity) {
+        this.quantity = quantity;
+    }
+
+    public String getQuantity() {
+        return quantity;
+    }
+
+    public void setCurrency(String currency) {
+        this.currency = currency;
+    }
+
+    public String getCurrency() {
+        return currency;
+    }
+
+    public void setCurrentApc(String currentApc) {
+        this.currentApc = currentApc;
+    }
+
+    public String getCurrentApc() {
+        return currentApc;
+    }
+
+    public void setServiceLife(String serviceLife) {
+        this.serviceLife = serviceLife;
+    }
+
+    public String getServiceLife() {
+        return serviceLife;
+    }
+
+    public void setAdministrator(String administrator) {
+        this.administrator = administrator;
+    }
+
+    public String getAdministrator() {
+        return administrator;
+    }
+
+    public void setDevNo(String devNo) {
+        this.devNo = devNo;
+    }
+
+    public String getDevNo() {
+        return devNo;
+    }
+
+    public void setAssetDetail(String assetDetail) {
+        this.assetDetail = assetDetail;
+    }
+
+    public String getAssetDetail() {
+        return assetDetail;
+    }
+
+    public void setProcessSubunit(String processSubunit) {
+        this.processSubunit = processSubunit;
+    }
+
+    public String getProcessSubunit() {
+        return processSubunit;
+    }
+
+    public void setPidNo(String pidNo) {
+        this.pidNo = pidNo;
+    }
+
+    public String getPidNo() {
+        return pidNo;
+    }
+
+    public void setInstallPosition(String installPosition) {
+        this.installPosition = installPosition;
+    }
+
+    public String getInstallPosition() {
+        return installPosition;
+    }
+
+    public void setCreateReason(String createReason) {
+        this.createReason = createReason;
+    }
+
+    public String getCreateReason() {
+        return createReason;
+    }
+
+    public void setBarcodePosition(String barcodePosition) {
+        this.barcodePosition = barcodePosition;
+    }
+
+    public String getBarcodePosition() {
+        return barcodePosition;
+    }
+
+    public void setScrapReason(String scrapReason) {
+        this.scrapReason = scrapReason;
+    }
+
+    public String getScrapReason() {
+        return scrapReason;
+    }
+
+    public void setScrapPoseDate(Date scrapPoseDate) {
+        this.scrapPoseDate = scrapPoseDate;
+    }
+
+    public Date getScrapPoseDate() {
+        return scrapPoseDate;
+    }
+
+    public void setScrapDoneDate(Date scrapDoneDate) {
+        this.scrapDoneDate = scrapDoneDate;
+    }
+
+    public Date getScrapDoneDate() {
+        return scrapDoneDate;
+    }
+
+    public void setScraper(String scraper) {
+        this.scraper = scraper;
+    }
+
+    public String getScraper() {
+        return scraper;
+    }
+
+    public void setUsingStatus(String usingStatus) {
+        this.usingStatus = usingStatus;
+    }
+
+    public String getUsingStatus() {
+        return usingStatus;
+    }
+
+    public void setStatus(Long status) {
+        this.status = status;
+    }
+
+    public Long getStatus() {
+        return status;
+    }
+
+    public void setDelFlag(Long delFlag) {
+        this.delFlag = delFlag;
+    }
+
+    public Long getDelFlag() {
+        return delFlag;
+    }
+
+    public void setCreaterCode(Long createrCode) {
+        this.createrCode = createrCode;
+    }
+
+    public Long getCreaterCode() {
+        return createrCode;
+    }
+
+    public void setCreatedate(Date createdate) {
+        this.createdate = createdate;
+    }
+
+    public Date getCreatedate() {
+        return createdate;
+    }
+
+    public void setUpdaterCode(Long updaterCode) {
+        this.updaterCode = updaterCode;
+    }
+
+    public Long getUpdaterCode() {
+        return updaterCode;
+    }
+
+    public void setUpdatedate(Date updatedate) {
+        this.updatedate = updatedate;
+    }
+
+    public Date getUpdatedate() {
+        return updatedate;
+    }
+
+    public void setDeptId(Long deptId) {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId() {
+        return deptId;
+    }
+
+    public void setRemarks(String remarks) {
+        this.remarks = remarks;
+    }
+
+    public String getRemarks() {
+        return remarks;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("assetType", getAssetType())
+                .append("assetNo", getAssetNo())
+                .append("assetSubNo", getAssetSubNo())
+                .append("devName", getDevName())
+                .append("devEnname", getDevEnname())
+                .append("costCenter", getCostCenter())
+                .append("costCenterCode", getCostCenterCode())
+                .append("assetTypeAp", getAssetTypeAp())
+                .append("capitalizedDate", getCapitalizedDate())
+                .append("quantity", getQuantity())
+                .append("currency", getCurrency())
+                .append("currentApc", getCurrentApc())
+                .append("serviceLife", getServiceLife())
+                .append("administrator", getAdministrator())
+                .append("devNo", getDevNo())
+                .append("assetDetail", getAssetDetail())
+                .append("processSubunit", getProcessSubunit())
+                .append("pidNo", getPidNo())
+                .append("installPosition", getInstallPosition())
+                .append("createReason", getCreateReason())
+                .append("barcodePosition", getBarcodePosition())
+                .append("scrapReason", getScrapReason())
+                .append("scrapPoseDate", getScrapPoseDate())
+                .append("scrapDoneDate", getScrapDoneDate())
+                .append("scraper", getScraper())
+                .append("usingStatus", getUsingStatus())
+                .append("status", getStatus())
+                .append("delFlag", getDelFlag())
+                .append("createrCode", getCreaterCode())
+                .append("createdate", getCreatedate())
+                .append("updaterCode", getUpdaterCode())
+                .append("updatedate", getUpdatedate())
+                .append("deptId", getDeptId())
+                .append("remarks", getRemarks())
+                .toString();
+    }
+}

+ 555 - 0
cpms-admin/src/main/java/com/cpms/project/asset/domain/TSpecdevMain.java

@@ -0,0 +1,555 @@
+package com.cpms.project.asset.domain;
+
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.cpms.common.annotation.Excel;
+import com.cpms.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.Date;
+
+/**
+ * 设备总对象 t_specdev_main
+ *
+ * @author admin
+ * @date 2022-10-09
+ */
+public class TSpecdevMain extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 唯一标识id */
+    private Long id;
+
+    @Excel(name = "序号")
+
+    private int index;
+    /** 中文名 */
+    @Excel(name = "中文名")
+    private String devName;
+
+    /** 英文名 */
+    @Excel(name = "英文名")
+    private String devEnname;
+
+    /** 位号 */
+    @Excel(name = "位号")
+    private String devno;
+
+    /** 是否在PID上 */
+    @Excel(name = "是否在PID上",readConverterExp = "1=是,0=否")
+    private String isPid;
+
+    /** P&ID图号/其他图号 */
+    @Excel(name = "P&ID图号/其他图号")
+    private String pidNo;
+
+    /** 安装位置 */
+    @Excel(name = "安装位置")
+    private String installPosition;
+
+    /** 功能位置 */
+    @Excel(name = "功能位置")
+    private String funcPosition;
+
+    /** 资产号 */
+    @Excel(name = "资产号")
+    private String assetNo;
+
+    /** 安全相关 */
+    @Excel(name = "安全相关")
+    private String securityRelevant;
+
+    /** 安全相关来自于 */
+    @Excel(name = "安全相关来自于")
+    private String securityRelevantFrom;
+
+    /** 生产厂家 */
+    @Excel(name = "生产厂家")
+    private String manufacturer;
+
+    /** 生产年份 */
+    @Excel(name = "生产年份")
+    private String productionYear;
+
+    /** 型号 */
+    @Excel(name = "型号")
+    private String model;
+
+    /** 主要规格参数 */
+    @Excel(name = "主要规格参数")
+    private String mainSpecifications;
+
+    /** 设备铭牌 */
+    @Excel(name = "设备铭牌")
+    private String dataPlate;
+
+    /** 维修风险 */
+    @Excel(name = "维修风险")
+    private String maintenanceRisk;
+
+    /** 生产风险 */
+    @Excel(name = "生产风险")
+    private String productionRisk;
+
+    /** 设备分级 */
+    @Excel(name = "设备分级")
+    private String devGrade;
+
+    /** 设备来自 */
+    @Excel(name = "设备来自")
+    private String devFrom;
+
+    /** 设备类型(一级) */
+    @Excel(name = "设备类型(一级)" )
+    private String devType1;
+
+    /** 设备类型(二级) */
+    @Excel(name = "设备类型(二级)")
+    private String devType2;
+
+    /** 资产状态 */
+    @Excel(name = "资产状态",readConverterExp = "1=在用,2=停用,3=报废,-1=封存")
+    private String assetStatus;
+
+    /** 资料完整度 */
+    @Excel(name = "资料完整度")
+    private String dataIntegrity;
+
+    /** PM状态 */
+    @Excel(name = "PM状态")
+    private String pmStatus;
+
+    /** 资产剩余寿命评估 */
+    @Excel(name = "资产剩余寿命评估")
+    private String assetResidueLifeAssess;
+
+    /** 资产整体状态 */
+    @Excel(name = "资产整体状态")
+    private String overallAssetStatus;
+
+    /** 状态 */
+    private Long status;
+
+    /** 状态 0 :正常 ;-1:删除 */
+    private Long delFlag;
+
+    /** 创建人 */
+    private Long createrCode;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date createdate;
+
+    /** 修改人 */
+    private Long updaterCode;
+
+    /** 修改时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    private Date updatedate;
+
+    /** 部门编号 */
+
+    private Long deptId;
+
+    /** 备注 */
+    @Excel(name = "备注")
+    private String remarks;
+
+    private String deptName;
+
+    private String subId;
+
+    private String fuzzy;
+
+    public String getFuzzy() {
+        return fuzzy;
+    }
+
+    public void setFuzzy(String fuzzy) {
+        this.fuzzy = fuzzy;
+    }
+
+    public int getIndex() {
+        return index;
+    }
+
+    public void setIndex(int index) {
+        this.index = index;
+    }
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setDevName(String devName)
+    {
+        this.devName = devName;
+    }
+
+    public String getDevName()
+    {
+        return devName;
+    }
+    public void setDevEnname(String devEnname)
+    {
+        this.devEnname = devEnname;
+    }
+
+    public String getDevEnname()
+    {
+        return devEnname;
+    }
+    public void setDevno(String devno)
+    {
+        this.devno = devno;
+    }
+
+    public String getDevno()
+    {
+        return devno;
+    }
+    public void setIsPid(String isPid)
+    {
+        this.isPid = isPid;
+    }
+
+    public String getIsPid()
+    {
+        return isPid;
+    }
+    public void setPidNo(String pidNo)
+    {
+        this.pidNo = pidNo;
+    }
+
+    public String getPidNo()
+    {
+        return pidNo;
+    }
+    public void setInstallPosition(String installPosition)
+    {
+        this.installPosition = installPosition;
+    }
+
+    public String getInstallPosition()
+    {
+        return installPosition;
+    }
+    public void setFuncPosition(String funcPosition)
+    {
+        this.funcPosition = funcPosition;
+    }
+
+    public String getFuncPosition()
+    {
+        return funcPosition;
+    }
+    public void setAssetNo(String assetNo)
+    {
+        this.assetNo = assetNo;
+    }
+
+    public String getAssetNo()
+    {
+        return assetNo;
+    }
+    public void setSecurityRelevant(String securityRelevant)
+    {
+        this.securityRelevant = securityRelevant;
+    }
+
+    public String getSecurityRelevant()
+    {
+        return securityRelevant;
+    }
+    public void setSecurityRelevantFrom(String securityRelevantFrom)
+    {
+        this.securityRelevantFrom = securityRelevantFrom;
+    }
+
+    public String getSecurityRelevantFrom()
+    {
+        return securityRelevantFrom;
+    }
+    public void setManufacturer(String manufacturer)
+    {
+        this.manufacturer = manufacturer;
+    }
+
+    public String getManufacturer()
+    {
+        return manufacturer;
+    }
+    public void setProductionYear(String productionYear)
+    {
+        this.productionYear = productionYear;
+    }
+
+    public String getProductionYear()
+    {
+        return productionYear;
+    }
+    public void setModel(String model)
+    {
+        this.model = model;
+    }
+
+    public String getModel()
+    {
+        return model;
+    }
+    public void setMainSpecifications(String mainSpecifications)
+    {
+        this.mainSpecifications = mainSpecifications;
+    }
+
+    public String getMainSpecifications()
+    {
+        return mainSpecifications;
+    }
+    public void setDataPlate(String dataPlate)
+    {
+        this.dataPlate = dataPlate;
+    }
+
+    public String getDataPlate()
+    {
+        return dataPlate;
+    }
+    public void setMaintenanceRisk(String maintenanceRisk)
+    {
+        this.maintenanceRisk = maintenanceRisk;
+    }
+
+    public String getMaintenanceRisk()
+    {
+        return maintenanceRisk;
+    }
+    public void setProductionRisk(String productionRisk)
+    {
+        this.productionRisk = productionRisk;
+    }
+
+    public String getProductionRisk()
+    {
+        return productionRisk;
+    }
+    public void setDevGrade(String devGrade)
+    {
+        this.devGrade = devGrade;
+    }
+
+    public String getDevGrade()
+    {
+        return devGrade;
+    }
+    public void setDevFrom(String devFrom)
+    {
+        this.devFrom = devFrom;
+    }
+
+    public String getDevFrom()
+    {
+        return devFrom;
+    }
+    public void setDevType1(String devType1)
+    {
+        this.devType1 = devType1;
+    }
+
+    public String getDevType1()
+    {
+        return devType1;
+    }
+    public void setDevType2(String devType2)
+    {
+        this.devType2 = devType2;
+    }
+
+    public String getDevType2()
+    {
+        return devType2;
+    }
+    public void setAssetStatus(String assetStatus)
+    {
+        this.assetStatus = assetStatus;
+    }
+
+    public String getAssetStatus()
+    {
+        return assetStatus;
+    }
+    public void setDataIntegrity(String dataIntegrity)
+    {
+        this.dataIntegrity = dataIntegrity;
+    }
+
+    public String getDataIntegrity()
+    {
+        return dataIntegrity;
+    }
+    public void setPmStatus(String pmStatus)
+    {
+        this.pmStatus = pmStatus;
+    }
+
+    public String getPmStatus()
+    {
+        return pmStatus;
+    }
+    public void setAssetResidueLifeAssess(String assetResidueLifeAssess)
+    {
+        this.assetResidueLifeAssess = assetResidueLifeAssess;
+    }
+
+    public String getAssetResidueLifeAssess()
+    {
+        return assetResidueLifeAssess;
+    }
+    public void setOverallAssetStatus(String overallAssetStatus)
+    {
+        this.overallAssetStatus = overallAssetStatus;
+    }
+
+    public String getOverallAssetStatus()
+    {
+        return overallAssetStatus;
+    }
+    public void setStatus(Long status)
+    {
+        this.status = status;
+    }
+
+    public Long getStatus()
+    {
+        return status;
+    }
+    public void setDelFlag(Long delFlag)
+    {
+        this.delFlag = delFlag;
+    }
+
+    public Long getDelFlag()
+    {
+        return delFlag;
+    }
+    public void setCreaterCode(Long createrCode)
+    {
+        this.createrCode = createrCode;
+    }
+
+    public Long getCreaterCode()
+    {
+        return createrCode;
+    }
+    public void setCreatedate(Date createdate)
+    {
+        this.createdate = createdate;
+    }
+
+    public Date getCreatedate()
+    {
+        return createdate;
+    }
+    public void setUpdaterCode(Long updaterCode)
+    {
+        this.updaterCode = updaterCode;
+    }
+
+    public Long getUpdaterCode()
+    {
+        return updaterCode;
+    }
+    public void setUpdatedate(Date updatedate)
+    {
+        this.updatedate = updatedate;
+    }
+
+    public Date getUpdatedate()
+    {
+        return updatedate;
+    }
+    public void setDeptId(Long deptId)
+    {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId()
+    {
+        return deptId;
+    }
+    public void setRemarks(String remarks)
+    {
+        this.remarks = remarks;
+    }
+
+    public String getRemarks()
+    {
+        return remarks;
+    }
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public String getSubId() {
+        return subId;
+    }
+
+    public void setSubId(String subId) {
+        this.subId = subId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("devName", getDevName())
+            .append("devEnname", getDevEnname())
+            .append("devno", getDevno())
+            .append("isPid", getIsPid())
+            .append("pidNo", getPidNo())
+            .append("installPosition", getInstallPosition())
+            .append("funcPosition", getFuncPosition())
+            .append("assetNo", getAssetNo())
+            .append("securityRelevant", getSecurityRelevant())
+            .append("securityRelevantFrom", getSecurityRelevantFrom())
+            .append("manufacturer", getManufacturer())
+            .append("productionYear", getProductionYear())
+            .append("model", getModel())
+            .append("mainSpecifications", getMainSpecifications())
+            .append("dataPlate", getDataPlate())
+            .append("maintenanceRisk", getMaintenanceRisk())
+            .append("productionRisk", getProductionRisk())
+            .append("devGrade", getDevGrade())
+            .append("devFrom", getDevFrom())
+            .append("devType1", getDevType1())
+            .append("devType2", getDevType2())
+            .append("assetStatus", getAssetStatus())
+            .append("dataIntegrity", getDataIntegrity())
+            .append("pmStatus", getPmStatus())
+            .append("assetResidueLifeAssess", getAssetResidueLifeAssess())
+            .append("overallAssetStatus", getOverallAssetStatus())
+            .append("status", getStatus())
+            .append("delFlag", getDelFlag())
+            .append("createrCode", getCreaterCode())
+            .append("createdate", getCreatedate())
+            .append("updaterCode", getUpdaterCode())
+            .append("updatedate", getUpdatedate())
+            .append("deptId", getDeptId())
+            .append("remarks", getRemarks())
+            .toString();
+    }
+}

+ 180 - 0
cpms-admin/src/main/java/com/cpms/project/asset/domain/TSpecdevTypemgr.java

@@ -0,0 +1,180 @@
+package com.cpms.project.asset.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.cpms.common.annotation.Excel;
+import com.cpms.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 设备类型管理对象 t_specdev_typemgr
+ *
+ * @author admin
+ * @date 2023-08-08
+ */
+public class TSpecdevTypemgr extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long id;
+
+    /** 主题 */
+    @Excel(name = "主题")
+    private String devType;
+
+    /** pid */
+    @Excel(name = "pid")
+    private Long pid;
+
+    /** 删除标识 */
+    private Integer delFlag;
+
+    /** 状态 */
+    @Excel(name = "状态")
+    private Integer status;
+
+    /** 创建人 */
+    @Excel(name = "创建人")
+    private String createrCode;
+
+    /** 创建日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    @Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date createdate;
+
+    /** 更新人 */
+    @Excel(name = "更新人")
+    private String updaterCode;
+
+    /** 更新日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    @Excel(name = "更新日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date updatedate;
+
+    /** 部门编号 */
+    @Excel(name = "部门编号")
+    private Long deptId;
+
+    /** 备注 */
+    @Excel(name = "备注")
+    private String remarks;
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setDevType(String devType)
+    {
+        this.devType = devType;
+    }
+
+    public String getDevType()
+    {
+        return devType;
+    }
+    public void setPid(Long pid)
+    {
+        this.pid = pid;
+    }
+
+    public Long getPid()
+    {
+        return pid;
+    }
+    public void setDelFlag(Integer delFlag)
+    {
+        this.delFlag = delFlag;
+    }
+
+    public Integer getDelFlag()
+    {
+        return delFlag;
+    }
+    public void setStatus(Integer status)
+    {
+        this.status = status;
+    }
+
+    public Integer getStatus()
+    {
+        return status;
+    }
+    public void setCreaterCode(String createrCode)
+    {
+        this.createrCode = createrCode;
+    }
+
+    public String getCreaterCode()
+    {
+        return createrCode;
+    }
+    public void setCreatedate(Date createdate)
+    {
+        this.createdate = createdate;
+    }
+
+    public Date getCreatedate()
+    {
+        return createdate;
+    }
+    public void setUpdaterCode(String updaterCode)
+    {
+        this.updaterCode = updaterCode;
+    }
+
+    public String getUpdaterCode()
+    {
+        return updaterCode;
+    }
+    public void setUpdatedate(Date updatedate)
+    {
+        this.updatedate = updatedate;
+    }
+
+    public Date getUpdatedate()
+    {
+        return updatedate;
+    }
+    public void setDeptId(Long deptId)
+    {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId()
+    {
+        return deptId;
+    }
+    public void setRemarks(String remarks)
+    {
+        this.remarks = remarks;
+    }
+
+    public String getRemarks()
+    {
+        return remarks;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("devType", getDevType())
+            .append("pid", getPid())
+            .append("delFlag", getDelFlag())
+            .append("status", getStatus())
+            .append("createrCode", getCreaterCode())
+            .append("createdate", getCreatedate())
+            .append("updaterCode", getUpdaterCode())
+            .append("updatedate", getUpdatedate())
+            .append("deptId", getDeptId())
+            .append("remarks", getRemarks())
+            .toString();
+    }
+}

+ 61 - 0
cpms-admin/src/main/java/com/cpms/project/asset/mapper/TLeakagePointsMapper.java

@@ -0,0 +1,61 @@
+package com.cpms.project.asset.mapper;
+
+import java.util.List;
+import com.cpms.project.asset.domain.TLeakagePoints;
+
+/**
+ * 漏点清单Mapper接口
+ * 
+ * @author admin
+ * @date 2024-03-28
+ */
+public interface TLeakagePointsMapper 
+{
+    /**
+     * 查询漏点清单
+     * 
+     * @param id 漏点清单主键
+     * @return 漏点清单
+     */
+    public TLeakagePoints selectTLeakagePointsById(Long id);
+
+    /**
+     * 查询漏点清单列表
+     * 
+     * @param tLeakagePoints 漏点清单
+     * @return 漏点清单集合
+     */
+    public List<TLeakagePoints> selectTLeakagePointsList(TLeakagePoints tLeakagePoints);
+
+    /**
+     * 新增漏点清单
+     * 
+     * @param tLeakagePoints 漏点清单
+     * @return 结果
+     */
+    public int insertTLeakagePoints(TLeakagePoints tLeakagePoints);
+
+    /**
+     * 修改漏点清单
+     * 
+     * @param tLeakagePoints 漏点清单
+     * @return 结果
+     */
+    public int updateTLeakagePoints(TLeakagePoints tLeakagePoints);
+
+    /**
+     * 删除漏点清单
+     * 
+     * @param id 漏点清单主键
+     * @return 结果
+     */
+    public int deleteTLeakagePointsById(Long id);
+
+    /**
+     * 批量删除漏点清单
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTLeakagePointsByIds(Long[] ids);
+}

+ 61 - 0
cpms-admin/src/main/java/com/cpms/project/asset/mapper/TLeakagePointsPatrolMapper.java

@@ -0,0 +1,61 @@
+package com.cpms.project.asset.mapper;
+
+import java.util.List;
+import com.cpms.project.asset.domain.TLeakagePointsPatrol;
+
+/**
+ * 漏点巡检Mapper接口
+ * 
+ * @author admin
+ * @date 2024-04-01
+ */
+public interface TLeakagePointsPatrolMapper 
+{
+    /**
+     * 查询漏点巡检
+     * 
+     * @param id 漏点巡检主键
+     * @return 漏点巡检
+     */
+    public TLeakagePointsPatrol selectTLeakagePointsPatrolById(Long id);
+
+    /**
+     * 查询漏点巡检列表
+     * 
+     * @param tLeakagePointsPatrol 漏点巡检
+     * @return 漏点巡检集合
+     */
+    public List<TLeakagePointsPatrol> selectTLeakagePointsPatrolList(TLeakagePointsPatrol tLeakagePointsPatrol);
+
+    /**
+     * 新增漏点巡检
+     * 
+     * @param tLeakagePointsPatrol 漏点巡检
+     * @return 结果
+     */
+    public int insertTLeakagePointsPatrol(TLeakagePointsPatrol tLeakagePointsPatrol);
+
+    /**
+     * 修改漏点巡检
+     * 
+     * @param tLeakagePointsPatrol 漏点巡检
+     * @return 结果
+     */
+    public int updateTLeakagePointsPatrol(TLeakagePointsPatrol tLeakagePointsPatrol);
+
+    /**
+     * 删除漏点巡检
+     * 
+     * @param id 漏点巡检主键
+     * @return 结果
+     */
+    public int deleteTLeakagePointsPatrolById(Long id);
+
+    /**
+     * 批量删除漏点巡检
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTLeakagePointsPatrolByIds(Long[] ids);
+}

+ 61 - 0
cpms-admin/src/main/java/com/cpms/project/asset/mapper/TLeakagePointsRecordMapper.java

@@ -0,0 +1,61 @@
+package com.cpms.project.asset.mapper;
+
+import java.util.List;
+import com.cpms.project.asset.domain.TLeakagePointsRecord;
+
+/**
+ * 漏点巡检记录 Mapper接口
+ * 
+ * @author admin
+ * @date 2024-04-01
+ */
+public interface TLeakagePointsRecordMapper 
+{
+    /**
+     * 查询漏点巡检记录 
+     * 
+     * @param id 漏点巡检记录 主键
+     * @return 漏点巡检记录 
+     */
+    public TLeakagePointsRecord selectTLeakagePointsRecordById(Long id);
+
+    /**
+     * 查询漏点巡检记录 列表
+     * 
+     * @param tLeakagePointsRecord 漏点巡检记录 
+     * @return 漏点巡检记录 集合
+     */
+    public List<TLeakagePointsRecord> selectTLeakagePointsRecordList(TLeakagePointsRecord tLeakagePointsRecord);
+
+    /**
+     * 新增漏点巡检记录 
+     * 
+     * @param tLeakagePointsRecord 漏点巡检记录 
+     * @return 结果
+     */
+    public int insertTLeakagePointsRecord(TLeakagePointsRecord tLeakagePointsRecord);
+
+    /**
+     * 修改漏点巡检记录 
+     * 
+     * @param tLeakagePointsRecord 漏点巡检记录 
+     * @return 结果
+     */
+    public int updateTLeakagePointsRecord(TLeakagePointsRecord tLeakagePointsRecord);
+
+    /**
+     * 删除漏点巡检记录 
+     * 
+     * @param id 漏点巡检记录 主键
+     * @return 结果
+     */
+    public int deleteTLeakagePointsRecordById(Long id);
+
+    /**
+     * 批量删除漏点巡检记录 
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTLeakagePointsRecordByIds(Long[] ids);
+}

+ 64 - 0
cpms-admin/src/main/java/com/cpms/project/asset/mapper/TSpecdevAssetMapper.java

@@ -0,0 +1,64 @@
+package com.cpms.project.asset.mapper;
+
+import java.util.List;
+
+import com.cpms.common.annotation.DataScope;
+import com.cpms.project.asset.domain.TSpecdevAsset;
+
+/**
+ * 资产与运营Mapper接口
+ * 
+ * @author admin
+ * @date 2022-10-12
+ */
+public interface TSpecdevAssetMapper 
+{
+    /**
+     * 查询资产与运营
+     * 
+     * @param id 资产与运营ID
+     * @return 资产与运营
+     */
+    public TSpecdevAsset selectTSpecdevAssetById(Long id);
+
+    /**
+     * 查询资产与运营列表
+     * 
+     * @param tSpecdevAsset 资产与运营
+     * @return 资产与运营集合
+     */
+    @DataScope(deptAlias = "d")
+    public List<TSpecdevAsset> selectTSpecdevAssetList(TSpecdevAsset tSpecdevAsset);
+
+    /**
+     * 新增资产与运营
+     * 
+     * @param tSpecdevAsset 资产与运营
+     * @return 结果
+     */
+    public int insertTSpecdevAsset(TSpecdevAsset tSpecdevAsset);
+
+    /**
+     * 修改资产与运营
+     * 
+     * @param tSpecdevAsset 资产与运营
+     * @return 结果
+     */
+    public int updateTSpecdevAsset(TSpecdevAsset tSpecdevAsset);
+
+    /**
+     * 删除资产与运营
+     * 
+     * @param id 资产与运营ID
+     * @return 结果
+     */
+    public int deleteTSpecdevAssetById(Long id);
+
+    /**
+     * 批量删除资产与运营
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteTSpecdevAssetByIds(Long[] ids);
+}

+ 64 - 0
cpms-admin/src/main/java/com/cpms/project/asset/mapper/TSpecdevFixedAssetMapper.java

@@ -0,0 +1,64 @@
+package com.cpms.project.asset.mapper;
+
+import com.cpms.common.annotation.DataScope;
+import com.cpms.project.asset.domain.TSpecdevFixedAsset;
+
+import java.util.List;
+
+/**
+ * 固定资产Mapper接口
+ *
+ * @author admin
+ * @date 2022-10-18
+ */
+public interface TSpecdevFixedAssetMapper
+{
+    /**
+     * 查询固定资产
+     *
+     * @param id 固定资产ID
+     * @return 固定资产
+     */
+    public TSpecdevFixedAsset selectTSpecdevFixedAssetById(Long id);
+
+    /**
+     * 查询固定资产列表
+     *
+     * @param tSpecdevFixedAsset 固定资产
+     * @return 固定资产集合
+     */
+    @DataScope(deptAlias = "d")
+    public List<TSpecdevFixedAsset> selectTSpecdevFixedAssetList(TSpecdevFixedAsset tSpecdevFixedAsset);
+
+    /**
+     * 新增固定资产
+     *
+     * @param tSpecdevFixedAsset 固定资产
+     * @return 结果
+     */
+    public int insertTSpecdevFixedAsset(TSpecdevFixedAsset tSpecdevFixedAsset);
+
+    /**
+     * 修改固定资产
+     *
+     * @param tSpecdevFixedAsset 固定资产
+     * @return 结果
+     */
+    public int updateTSpecdevFixedAsset(TSpecdevFixedAsset tSpecdevFixedAsset);
+
+    /**
+     * 删除固定资产
+     *
+     * @param id 固定资产ID
+     * @return 结果
+     */
+    public int deleteTSpecdevFixedAssetById(Long id);
+
+    /**
+     * 批量删除固定资产
+     *
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteTSpecdevFixedAssetByIds(Long[] ids);
+}

+ 64 - 0
cpms-admin/src/main/java/com/cpms/project/asset/mapper/TSpecdevMainMapper.java

@@ -0,0 +1,64 @@
+package com.cpms.project.asset.mapper;
+
+import java.util.List;
+
+import com.cpms.common.annotation.DataScope;
+import com.cpms.project.asset.domain.TSpecdevMain;
+
+/**
+ * 设备总Mapper接口
+ * 
+ * @author admin
+ * @date 2022-10-09
+ */
+public interface TSpecdevMainMapper 
+{
+    /**
+     * 查询设备总
+     * 
+     * @param id 设备总ID
+     * @return 设备总
+     */
+    public TSpecdevMain selectTSpecdevMainById(Long id);
+
+    /**
+     * 查询设备总列表
+     * 
+     * @param tSpecdevMain 设备总
+     * @return 设备总集合
+     */
+    @DataScope(deptAlias = "d")
+    public List<TSpecdevMain> selectTSpecdevMainList(TSpecdevMain tSpecdevMain);
+
+    /**
+     * 新增设备总
+     * 
+     * @param tSpecdevMain 设备总
+     * @return 结果
+     */
+    public int insertTSpecdevMain(TSpecdevMain tSpecdevMain);
+
+    /**
+     * 修改设备总
+     * 
+     * @param tSpecdevMain 设备总
+     * @return 结果
+     */
+    public int updateTSpecdevMain(TSpecdevMain tSpecdevMain);
+
+    /**
+     * 删除设备总
+     * 
+     * @param id 设备总ID
+     * @return 结果
+     */
+    public int deleteTSpecdevMainById(Long id);
+
+    /**
+     * 批量删除设备总
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteTSpecdevMainByIds(Long[] ids);
+}

+ 61 - 0
cpms-admin/src/main/java/com/cpms/project/asset/mapper/TSpecdevTypemgrMapper.java

@@ -0,0 +1,61 @@
+package com.cpms.project.asset.mapper;
+
+import java.util.List;
+import com.cpms.project.asset.domain.TSpecdevTypemgr;
+
+/**
+ * 设备类型管理Mapper接口
+ * 
+ * @author admin
+ * @date 2023-08-08
+ */
+public interface TSpecdevTypemgrMapper 
+{
+    /**
+     * 查询设备类型管理
+     * 
+     * @param id 设备类型管理主键
+     * @return 设备类型管理
+     */
+    public TSpecdevTypemgr selectTSpecdevTypemgrById(Long id);
+
+    /**
+     * 查询设备类型管理列表
+     * 
+     * @param tSpecdevTypemgr 设备类型管理
+     * @return 设备类型管理集合
+     */
+    public List<TSpecdevTypemgr> selectTSpecdevTypemgrList(TSpecdevTypemgr tSpecdevTypemgr);
+
+    /**
+     * 新增设备类型管理
+     * 
+     * @param tSpecdevTypemgr 设备类型管理
+     * @return 结果
+     */
+    public int insertTSpecdevTypemgr(TSpecdevTypemgr tSpecdevTypemgr);
+
+    /**
+     * 修改设备类型管理
+     * 
+     * @param tSpecdevTypemgr 设备类型管理
+     * @return 结果
+     */
+    public int updateTSpecdevTypemgr(TSpecdevTypemgr tSpecdevTypemgr);
+
+    /**
+     * 删除设备类型管理
+     * 
+     * @param id 设备类型管理主键
+     * @return 结果
+     */
+    public int deleteTSpecdevTypemgrById(Long id);
+
+    /**
+     * 批量删除设备类型管理
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTSpecdevTypemgrByIds(Long[] ids);
+}

+ 61 - 0
cpms-admin/src/main/java/com/cpms/project/asset/service/ITLeakagePointsPatrolService.java

@@ -0,0 +1,61 @@
+package com.cpms.project.asset.service;
+
+import java.util.List;
+import com.cpms.project.asset.domain.TLeakagePointsPatrol;
+
+/**
+ * 漏点巡检Service接口
+ * 
+ * @author admin
+ * @date 2024-04-01
+ */
+public interface ITLeakagePointsPatrolService 
+{
+    /**
+     * 查询漏点巡检
+     * 
+     * @param id 漏点巡检主键
+     * @return 漏点巡检
+     */
+    public TLeakagePointsPatrol selectTLeakagePointsPatrolById(Long id);
+
+    /**
+     * 查询漏点巡检列表
+     * 
+     * @param tLeakagePointsPatrol 漏点巡检
+     * @return 漏点巡检集合
+     */
+    public List<TLeakagePointsPatrol> selectTLeakagePointsPatrolList(TLeakagePointsPatrol tLeakagePointsPatrol);
+
+    /**
+     * 新增漏点巡检
+     * 
+     * @param tLeakagePointsPatrol 漏点巡检
+     * @return 结果
+     */
+    public int insertTLeakagePointsPatrol(TLeakagePointsPatrol tLeakagePointsPatrol);
+
+    /**
+     * 修改漏点巡检
+     * 
+     * @param tLeakagePointsPatrol 漏点巡检
+     * @return 结果
+     */
+    public int updateTLeakagePointsPatrol(TLeakagePointsPatrol tLeakagePointsPatrol);
+
+    /**
+     * 批量删除漏点巡检
+     * 
+     * @param ids 需要删除的漏点巡检主键集合
+     * @return 结果
+     */
+    public int deleteTLeakagePointsPatrolByIds(Long[] ids);
+
+    /**
+     * 删除漏点巡检信息
+     * 
+     * @param id 漏点巡检主键
+     * @return 结果
+     */
+    public int deleteTLeakagePointsPatrolById(Long id);
+}

+ 61 - 0
cpms-admin/src/main/java/com/cpms/project/asset/service/ITLeakagePointsRecordService.java

@@ -0,0 +1,61 @@
+package com.cpms.project.asset.service;
+
+import java.util.List;
+import com.cpms.project.asset.domain.TLeakagePointsRecord;
+
+/**
+ * 漏点巡检记录 Service接口
+ * 
+ * @author admin
+ * @date 2024-04-01
+ */
+public interface ITLeakagePointsRecordService 
+{
+    /**
+     * 查询漏点巡检记录 
+     * 
+     * @param id 漏点巡检记录 主键
+     * @return 漏点巡检记录 
+     */
+    public TLeakagePointsRecord selectTLeakagePointsRecordById(Long id);
+
+    /**
+     * 查询漏点巡检记录 列表
+     * 
+     * @param tLeakagePointsRecord 漏点巡检记录 
+     * @return 漏点巡检记录 集合
+     */
+    public List<TLeakagePointsRecord> selectTLeakagePointsRecordList(TLeakagePointsRecord tLeakagePointsRecord);
+
+    /**
+     * 新增漏点巡检记录 
+     * 
+     * @param tLeakagePointsRecord 漏点巡检记录 
+     * @return 结果
+     */
+    public int insertTLeakagePointsRecord(TLeakagePointsRecord tLeakagePointsRecord);
+
+    /**
+     * 修改漏点巡检记录 
+     * 
+     * @param tLeakagePointsRecord 漏点巡检记录 
+     * @return 结果
+     */
+    public int updateTLeakagePointsRecord(TLeakagePointsRecord tLeakagePointsRecord);
+
+    /**
+     * 批量删除漏点巡检记录 
+     * 
+     * @param ids 需要删除的漏点巡检记录 主键集合
+     * @return 结果
+     */
+    public int deleteTLeakagePointsRecordByIds(Long[] ids);
+
+    /**
+     * 删除漏点巡检记录 信息
+     * 
+     * @param id 漏点巡检记录 主键
+     * @return 结果
+     */
+    public int deleteTLeakagePointsRecordById(Long id);
+}

+ 61 - 0
cpms-admin/src/main/java/com/cpms/project/asset/service/ITLeakagePointsService.java

@@ -0,0 +1,61 @@
+package com.cpms.project.asset.service;
+
+import java.util.List;
+import com.cpms.project.asset.domain.TLeakagePoints;
+
+/**
+ * 漏点清单Service接口
+ * 
+ * @author admin
+ * @date 2024-03-28
+ */
+public interface ITLeakagePointsService 
+{
+    /**
+     * 查询漏点清单
+     * 
+     * @param id 漏点清单主键
+     * @return 漏点清单
+     */
+    public TLeakagePoints selectTLeakagePointsById(Long id);
+
+    /**
+     * 查询漏点清单列表
+     * 
+     * @param tLeakagePoints 漏点清单
+     * @return 漏点清单集合
+     */
+    public List<TLeakagePoints> selectTLeakagePointsList(TLeakagePoints tLeakagePoints);
+
+    /**
+     * 新增漏点清单
+     * 
+     * @param tLeakagePoints 漏点清单
+     * @return 结果
+     */
+    public int insertTLeakagePoints(TLeakagePoints tLeakagePoints);
+
+    /**
+     * 修改漏点清单
+     * 
+     * @param tLeakagePoints 漏点清单
+     * @return 结果
+     */
+    public int updateTLeakagePoints(TLeakagePoints tLeakagePoints);
+
+    /**
+     * 批量删除漏点清单
+     * 
+     * @param ids 需要删除的漏点清单主键集合
+     * @return 结果
+     */
+    public int deleteTLeakagePointsByIds(Long[] ids);
+
+    /**
+     * 删除漏点清单信息
+     * 
+     * @param id 漏点清单主键
+     * @return 结果
+     */
+    public int deleteTLeakagePointsById(Long id);
+}

+ 61 - 0
cpms-admin/src/main/java/com/cpms/project/asset/service/ITSpecdevAssetService.java

@@ -0,0 +1,61 @@
+package com.cpms.project.asset.service;
+
+import java.util.List;
+import com.cpms.project.asset.domain.TSpecdevAsset;
+
+/**
+ * 资产与运营Service接口
+ * 
+ * @author admin
+ * @date 2022-10-12
+ */
+public interface ITSpecdevAssetService 
+{
+    /**
+     * 查询资产与运营
+     * 
+     * @param id 资产与运营ID
+     * @return 资产与运营
+     */
+    public TSpecdevAsset selectTSpecdevAssetById(Long id);
+
+    /**
+     * 查询资产与运营列表
+     * 
+     * @param tSpecdevAsset 资产与运营
+     * @return 资产与运营集合
+     */
+    public List<TSpecdevAsset> selectTSpecdevAssetList(TSpecdevAsset tSpecdevAsset);
+
+    /**
+     * 新增资产与运营
+     * 
+     * @param tSpecdevAsset 资产与运营
+     * @return 结果
+     */
+    public int insertTSpecdevAsset(TSpecdevAsset tSpecdevAsset);
+
+    /**
+     * 修改资产与运营
+     * 
+     * @param tSpecdevAsset 资产与运营
+     * @return 结果
+     */
+    public int updateTSpecdevAsset(TSpecdevAsset tSpecdevAsset);
+
+    /**
+     * 批量删除资产与运营
+     * 
+     * @param ids 需要删除的资产与运营ID
+     * @return 结果
+     */
+    public int deleteTSpecdevAssetByIds(Long[] ids);
+
+    /**
+     * 删除资产与运营信息
+     * 
+     * @param id 资产与运营ID
+     * @return 结果
+     */
+    public int deleteTSpecdevAssetById(Long id);
+}

+ 62 - 0
cpms-admin/src/main/java/com/cpms/project/asset/service/ITSpecdevFixedAssetService.java

@@ -0,0 +1,62 @@
+package com.cpms.project.asset.service;
+
+import com.cpms.project.asset.domain.TSpecdevFixedAsset;
+
+import java.util.List;
+
+/**
+ * 固定资产Service接口
+ *
+ * @author admin
+ * @date 2022-10-18
+ */
+public interface ITSpecdevFixedAssetService
+{
+    /**
+     * 查询固定资产
+     *
+     * @param id 固定资产ID
+     * @return 固定资产
+     */
+    public TSpecdevFixedAsset selectTSpecdevFixedAssetById(Long id);
+
+    /**
+     * 查询固定资产列表
+     *
+     * @param tSpecdevFixedAsset 固定资产
+     * @return 固定资产集合
+     */
+    public List<TSpecdevFixedAsset> selectTSpecdevFixedAssetList(TSpecdevFixedAsset tSpecdevFixedAsset);
+
+    /**
+     * 新增固定资产
+     *
+     * @param tSpecdevFixedAsset 固定资产
+     * @return 结果
+     */
+    public int insertTSpecdevFixedAsset(TSpecdevFixedAsset tSpecdevFixedAsset);
+
+    /**
+     * 修改固定资产
+     *
+     * @param tSpecdevFixedAsset 固定资产
+     * @return 结果
+     */
+    public int updateTSpecdevFixedAsset(TSpecdevFixedAsset tSpecdevFixedAsset);
+
+    /**
+     * 批量删除固定资产
+     *
+     * @param ids 需要删除的固定资产ID
+     * @return 结果
+     */
+    public int deleteTSpecdevFixedAssetByIds(Long[] ids);
+
+    /**
+     * 删除固定资产信息
+     *
+     * @param id 固定资产ID
+     * @return 结果
+     */
+    public int deleteTSpecdevFixedAssetById(Long id);
+}

+ 61 - 0
cpms-admin/src/main/java/com/cpms/project/asset/service/ITSpecdevMainService.java

@@ -0,0 +1,61 @@
+package com.cpms.project.asset.service;
+
+import java.util.List;
+import com.cpms.project.asset.domain.TSpecdevMain;
+
+/**
+ * 设备总Service接口
+ * 
+ * @author admin
+ * @date 2022-10-09
+ */
+public interface ITSpecdevMainService 
+{
+    /**
+     * 查询设备总
+     * 
+     * @param id 设备总ID
+     * @return 设备总
+     */
+    public TSpecdevMain selectTSpecdevMainById(Long id);
+
+    /**
+     * 查询设备总列表
+     * 
+     * @param tSpecdevMain 设备总
+     * @return 设备总集合
+     */
+    public List<TSpecdevMain> selectTSpecdevMainList(TSpecdevMain tSpecdevMain);
+
+    /**
+     * 新增设备总
+     * 
+     * @param tSpecdevMain 设备总
+     * @return 结果
+     */
+    public int insertTSpecdevMain(TSpecdevMain tSpecdevMain);
+
+    /**
+     * 修改设备总
+     * 
+     * @param tSpecdevMain 设备总
+     * @return 结果
+     */
+    public int updateTSpecdevMain(TSpecdevMain tSpecdevMain);
+
+    /**
+     * 批量删除设备总
+     * 
+     * @param ids 需要删除的设备总ID
+     * @return 结果
+     */
+    public int deleteTSpecdevMainByIds(Long[] ids);
+
+    /**
+     * 删除设备总信息
+     * 
+     * @param id 设备总ID
+     * @return 结果
+     */
+    public int deleteTSpecdevMainById(Long id);
+}

+ 61 - 0
cpms-admin/src/main/java/com/cpms/project/asset/service/ITSpecdevTypemgrService.java

@@ -0,0 +1,61 @@
+package com.cpms.project.asset.service;
+
+import java.util.List;
+import com.cpms.project.asset.domain.TSpecdevTypemgr;
+
+/**
+ * 设备类型管理Service接口
+ * 
+ * @author admin
+ * @date 2023-08-08
+ */
+public interface ITSpecdevTypemgrService 
+{
+    /**
+     * 查询设备类型管理
+     * 
+     * @param id 设备类型管理主键
+     * @return 设备类型管理
+     */
+    public TSpecdevTypemgr selectTSpecdevTypemgrById(Long id);
+
+    /**
+     * 查询设备类型管理列表
+     * 
+     * @param tSpecdevTypemgr 设备类型管理
+     * @return 设备类型管理集合
+     */
+    public List<TSpecdevTypemgr> selectTSpecdevTypemgrList(TSpecdevTypemgr tSpecdevTypemgr);
+
+    /**
+     * 新增设备类型管理
+     * 
+     * @param tSpecdevTypemgr 设备类型管理
+     * @return 结果
+     */
+    public int insertTSpecdevTypemgr(TSpecdevTypemgr tSpecdevTypemgr);
+
+    /**
+     * 修改设备类型管理
+     * 
+     * @param tSpecdevTypemgr 设备类型管理
+     * @return 结果
+     */
+    public int updateTSpecdevTypemgr(TSpecdevTypemgr tSpecdevTypemgr);
+
+    /**
+     * 批量删除设备类型管理
+     * 
+     * @param ids 需要删除的设备类型管理主键集合
+     * @return 结果
+     */
+    public int deleteTSpecdevTypemgrByIds(Long[] ids);
+
+    /**
+     * 删除设备类型管理信息
+     * 
+     * @param id 设备类型管理主键
+     * @return 结果
+     */
+    public int deleteTSpecdevTypemgrById(Long id);
+}

+ 93 - 0
cpms-admin/src/main/java/com/cpms/project/asset/service/impl/TLeakagePointsPatrolServiceImpl.java

@@ -0,0 +1,93 @@
+package com.cpms.project.asset.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.cpms.project.asset.mapper.TLeakagePointsPatrolMapper;
+import com.cpms.project.asset.domain.TLeakagePointsPatrol;
+import com.cpms.project.asset.service.ITLeakagePointsPatrolService;
+
+/**
+ * 漏点巡检Service业务层处理
+ * 
+ * @author admin
+ * @date 2024-04-01
+ */
+@Service
+public class TLeakagePointsPatrolServiceImpl implements ITLeakagePointsPatrolService 
+{
+    @Autowired
+    private TLeakagePointsPatrolMapper tLeakagePointsPatrolMapper;
+
+    /**
+     * 查询漏点巡检
+     * 
+     * @param id 漏点巡检主键
+     * @return 漏点巡检
+     */
+    @Override
+    public TLeakagePointsPatrol selectTLeakagePointsPatrolById(Long id)
+    {
+        return tLeakagePointsPatrolMapper.selectTLeakagePointsPatrolById(id);
+    }
+
+    /**
+     * 查询漏点巡检列表
+     * 
+     * @param tLeakagePointsPatrol 漏点巡检
+     * @return 漏点巡检
+     */
+    @Override
+    public List<TLeakagePointsPatrol> selectTLeakagePointsPatrolList(TLeakagePointsPatrol tLeakagePointsPatrol)
+    {
+        return tLeakagePointsPatrolMapper.selectTLeakagePointsPatrolList(tLeakagePointsPatrol);
+    }
+
+    /**
+     * 新增漏点巡检
+     * 
+     * @param tLeakagePointsPatrol 漏点巡检
+     * @return 结果
+     */
+    @Override
+    public int insertTLeakagePointsPatrol(TLeakagePointsPatrol tLeakagePointsPatrol)
+    {
+        return tLeakagePointsPatrolMapper.insertTLeakagePointsPatrol(tLeakagePointsPatrol);
+    }
+
+    /**
+     * 修改漏点巡检
+     * 
+     * @param tLeakagePointsPatrol 漏点巡检
+     * @return 结果
+     */
+    @Override
+    public int updateTLeakagePointsPatrol(TLeakagePointsPatrol tLeakagePointsPatrol)
+    {
+        return tLeakagePointsPatrolMapper.updateTLeakagePointsPatrol(tLeakagePointsPatrol);
+    }
+
+    /**
+     * 批量删除漏点巡检
+     * 
+     * @param ids 需要删除的漏点巡检主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTLeakagePointsPatrolByIds(Long[] ids)
+    {
+        return tLeakagePointsPatrolMapper.deleteTLeakagePointsPatrolByIds(ids);
+    }
+
+    /**
+     * 删除漏点巡检信息
+     * 
+     * @param id 漏点巡检主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTLeakagePointsPatrolById(Long id)
+    {
+        return tLeakagePointsPatrolMapper.deleteTLeakagePointsPatrolById(id);
+    }
+}

+ 93 - 0
cpms-admin/src/main/java/com/cpms/project/asset/service/impl/TLeakagePointsRecordServiceImpl.java

@@ -0,0 +1,93 @@
+package com.cpms.project.asset.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.cpms.project.asset.mapper.TLeakagePointsRecordMapper;
+import com.cpms.project.asset.domain.TLeakagePointsRecord;
+import com.cpms.project.asset.service.ITLeakagePointsRecordService;
+
+/**
+ * 漏点巡检记录 Service业务层处理
+ * 
+ * @author admin
+ * @date 2024-04-01
+ */
+@Service
+public class TLeakagePointsRecordServiceImpl implements ITLeakagePointsRecordService 
+{
+    @Autowired
+    private TLeakagePointsRecordMapper tLeakagePointsRecordMapper;
+
+    /**
+     * 查询漏点巡检记录 
+     * 
+     * @param id 漏点巡检记录 主键
+     * @return 漏点巡检记录 
+     */
+    @Override
+    public TLeakagePointsRecord selectTLeakagePointsRecordById(Long id)
+    {
+        return tLeakagePointsRecordMapper.selectTLeakagePointsRecordById(id);
+    }
+
+    /**
+     * 查询漏点巡检记录 列表
+     * 
+     * @param tLeakagePointsRecord 漏点巡检记录 
+     * @return 漏点巡检记录 
+     */
+    @Override
+    public List<TLeakagePointsRecord> selectTLeakagePointsRecordList(TLeakagePointsRecord tLeakagePointsRecord)
+    {
+        return tLeakagePointsRecordMapper.selectTLeakagePointsRecordList(tLeakagePointsRecord);
+    }
+
+    /**
+     * 新增漏点巡检记录 
+     * 
+     * @param tLeakagePointsRecord 漏点巡检记录 
+     * @return 结果
+     */
+    @Override
+    public int insertTLeakagePointsRecord(TLeakagePointsRecord tLeakagePointsRecord)
+    {
+        return tLeakagePointsRecordMapper.insertTLeakagePointsRecord(tLeakagePointsRecord);
+    }
+
+    /**
+     * 修改漏点巡检记录 
+     * 
+     * @param tLeakagePointsRecord 漏点巡检记录 
+     * @return 结果
+     */
+    @Override
+    public int updateTLeakagePointsRecord(TLeakagePointsRecord tLeakagePointsRecord)
+    {
+        return tLeakagePointsRecordMapper.updateTLeakagePointsRecord(tLeakagePointsRecord);
+    }
+
+    /**
+     * 批量删除漏点巡检记录 
+     * 
+     * @param ids 需要删除的漏点巡检记录 主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTLeakagePointsRecordByIds(Long[] ids)
+    {
+        return tLeakagePointsRecordMapper.deleteTLeakagePointsRecordByIds(ids);
+    }
+
+    /**
+     * 删除漏点巡检记录 信息
+     * 
+     * @param id 漏点巡检记录 主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTLeakagePointsRecordById(Long id)
+    {
+        return tLeakagePointsRecordMapper.deleteTLeakagePointsRecordById(id);
+    }
+}

+ 94 - 0
cpms-admin/src/main/java/com/cpms/project/asset/service/impl/TLeakagePointsServiceImpl.java

@@ -0,0 +1,94 @@
+package com.cpms.project.asset.service.impl;
+
+import java.util.List;
+
+import com.cpms.project.asset.service.ITLeakagePointsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.cpms.project.asset.mapper.TLeakagePointsMapper;
+import com.cpms.project.asset.domain.TLeakagePoints;
+
+/**
+ * 漏点清单Service业务层处理
+ * 
+ * @author admin
+ * @date 2024-03-28
+ */
+@Service
+public class TLeakagePointsServiceImpl implements ITLeakagePointsService
+{
+    @Autowired
+    private TLeakagePointsMapper tLeakagePointsMapper;
+
+    /**
+     * 查询漏点清单
+     * 
+     * @param id 漏点清单主键
+     * @return 漏点清单
+     */
+    @Override
+    public TLeakagePoints selectTLeakagePointsById(Long id)
+    {
+        return tLeakagePointsMapper.selectTLeakagePointsById(id);
+    }
+
+    /**
+     * 查询漏点清单列表
+     * 
+     * @param tLeakagePoints 漏点清单
+     * @return 漏点清单
+     */
+    @Override
+    public List<TLeakagePoints> selectTLeakagePointsList(TLeakagePoints tLeakagePoints)
+    {
+        return tLeakagePointsMapper.selectTLeakagePointsList(tLeakagePoints);
+    }
+
+    /**
+     * 新增漏点清单
+     * 
+     * @param tLeakagePoints 漏点清单
+     * @return 结果
+     */
+    @Override
+    public int insertTLeakagePoints(TLeakagePoints tLeakagePoints)
+    {
+        return tLeakagePointsMapper.insertTLeakagePoints(tLeakagePoints);
+    }
+
+    /**
+     * 修改漏点清单
+     * 
+     * @param tLeakagePoints 漏点清单
+     * @return 结果
+     */
+    @Override
+    public int updateTLeakagePoints(TLeakagePoints tLeakagePoints)
+    {
+        return tLeakagePointsMapper.updateTLeakagePoints(tLeakagePoints);
+    }
+
+    /**
+     * 批量删除漏点清单
+     * 
+     * @param ids 需要删除的漏点清单主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTLeakagePointsByIds(Long[] ids)
+    {
+        return tLeakagePointsMapper.deleteTLeakagePointsByIds(ids);
+    }
+
+    /**
+     * 删除漏点清单信息
+     * 
+     * @param id 漏点清单主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTLeakagePointsById(Long id)
+    {
+        return tLeakagePointsMapper.deleteTLeakagePointsById(id);
+    }
+}

+ 93 - 0
cpms-admin/src/main/java/com/cpms/project/asset/service/impl/TSpecdevAssetServiceImpl.java

@@ -0,0 +1,93 @@
+package com.cpms.project.asset.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.cpms.project.asset.mapper.TSpecdevAssetMapper;
+import com.cpms.project.asset.domain.TSpecdevAsset;
+import com.cpms.project.asset.service.ITSpecdevAssetService;
+
+/**
+ * 资产与运营Service业务层处理
+ *
+ * @author admin
+ * @date 2022-10-12
+ */
+@Service
+public class TSpecdevAssetServiceImpl implements ITSpecdevAssetService
+{
+    @Autowired
+    private TSpecdevAssetMapper tSpecdevAssetMapper;
+
+    /**
+     * 查询资产与运营
+     *
+     * @param id 资产与运营ID
+     * @return 资产与运营
+     */
+    @Override
+    public TSpecdevAsset selectTSpecdevAssetById(Long id)
+    {
+        return tSpecdevAssetMapper.selectTSpecdevAssetById(id);
+    }
+
+    /**
+     * 查询资产与运营列表
+     *
+     * @param tSpecdevAsset 资产与运营
+     * @return 资产与运营
+     */
+    @Override
+    public List<TSpecdevAsset> selectTSpecdevAssetList(TSpecdevAsset tSpecdevAsset)
+    {
+        return tSpecdevAssetMapper.selectTSpecdevAssetList(tSpecdevAsset);
+    }
+
+    /**
+     * 新增资产与运营
+     *
+     * @param tSpecdevAsset 资产与运营
+     * @return 结果
+     */
+    @Override
+    public int insertTSpecdevAsset(TSpecdevAsset tSpecdevAsset)
+    {
+        return tSpecdevAssetMapper.insertTSpecdevAsset(tSpecdevAsset);
+    }
+
+    /**
+     * 修改资产与运营
+     *
+     * @param tSpecdevAsset 资产与运营
+     * @return 结果
+     */
+    @Override
+    public int updateTSpecdevAsset(TSpecdevAsset tSpecdevAsset)
+    {
+        return tSpecdevAssetMapper.updateTSpecdevAsset(tSpecdevAsset);
+    }
+
+    /**
+     * 批量删除资产与运营
+     *
+     * @param ids 需要删除的资产与运营ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTSpecdevAssetByIds(Long[] ids)
+    {
+        return tSpecdevAssetMapper.deleteTSpecdevAssetByIds(ids);
+    }
+
+    /**
+     * 删除资产与运营信息
+     *
+     * @param id 资产与运营ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTSpecdevAssetById(Long id)
+    {
+        return tSpecdevAssetMapper.deleteTSpecdevAssetById(id);
+    }
+}

+ 94 - 0
cpms-admin/src/main/java/com/cpms/project/asset/service/impl/TSpecdevFixedAssetServiceImpl.java

@@ -0,0 +1,94 @@
+package com.cpms.project.asset.service.impl;
+
+import com.cpms.project.asset.domain.TSpecdevFixedAsset;
+import com.cpms.project.asset.mapper.TSpecdevFixedAssetMapper;
+import com.cpms.project.asset.service.ITSpecdevFixedAssetService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 固定资产Service业务层处理
+ *
+ * @author admin
+ * @date 2022-10-18
+ */
+@Service
+public class TSpecdevFixedAssetServiceImpl implements ITSpecdevFixedAssetService
+{
+    @Autowired
+    private TSpecdevFixedAssetMapper tSpecdevFixedAssetMapper;
+
+    /**
+     * 查询固定资产
+     *
+     * @param id 固定资产ID
+     * @return 固定资产
+     */
+    @Override
+    public TSpecdevFixedAsset selectTSpecdevFixedAssetById(Long id)
+    {
+        return tSpecdevFixedAssetMapper.selectTSpecdevFixedAssetById(id);
+    }
+
+    /**
+     * 查询固定资产列表
+     *
+     * @param tSpecdevFixedAsset 固定资产
+     * @return 固定资产
+     */
+    @Override
+    public List<TSpecdevFixedAsset> selectTSpecdevFixedAssetList(TSpecdevFixedAsset tSpecdevFixedAsset)
+    {
+        return tSpecdevFixedAssetMapper.selectTSpecdevFixedAssetList(tSpecdevFixedAsset);
+    }
+
+    /**
+     * 新增固定资产
+     *
+     * @param tSpecdevFixedAsset 固定资产
+     * @return 结果
+     */
+    @Override
+    public int insertTSpecdevFixedAsset(TSpecdevFixedAsset tSpecdevFixedAsset)
+    {
+        return tSpecdevFixedAssetMapper.insertTSpecdevFixedAsset(tSpecdevFixedAsset);
+    }
+
+    /**
+     * 修改固定资产
+     *
+     * @param tSpecdevFixedAsset 固定资产
+     * @return 结果
+     */
+    @Override
+    public int updateTSpecdevFixedAsset(TSpecdevFixedAsset tSpecdevFixedAsset)
+    {
+        return tSpecdevFixedAssetMapper.updateTSpecdevFixedAsset(tSpecdevFixedAsset);
+    }
+
+    /**
+     * 批量删除固定资产
+     *
+     * @param ids 需要删除的固定资产ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTSpecdevFixedAssetByIds(Long[] ids)
+    {
+        return tSpecdevFixedAssetMapper.deleteTSpecdevFixedAssetByIds(ids);
+    }
+
+    /**
+     * 删除固定资产信息
+     *
+     * @param id 固定资产ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTSpecdevFixedAssetById(Long id)
+    {
+        return tSpecdevFixedAssetMapper.deleteTSpecdevFixedAssetById(id);
+    }
+}

+ 93 - 0
cpms-admin/src/main/java/com/cpms/project/asset/service/impl/TSpecdevMainServiceImpl.java

@@ -0,0 +1,93 @@
+package com.cpms.project.asset.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.cpms.project.asset.mapper.TSpecdevMainMapper;
+import com.cpms.project.asset.domain.TSpecdevMain;
+import com.cpms.project.asset.service.ITSpecdevMainService;
+
+/**
+ * 设备总Service业务层处理
+ *
+ * @author admin
+ * @date 2022-10-09
+ */
+@Service
+public class TSpecdevMainServiceImpl implements ITSpecdevMainService
+{
+    @Autowired
+    private TSpecdevMainMapper tSpecdevMainMapper;
+
+    /**
+     * 查询设备总
+     *
+     * @param id 设备总ID
+     * @return 设备总
+     */
+    @Override
+    public TSpecdevMain selectTSpecdevMainById(Long id)
+    {
+        return tSpecdevMainMapper.selectTSpecdevMainById(id);
+    }
+
+    /**
+     * 查询设备总列表
+     *
+     * @param tSpecdevMain 设备总
+     * @return 设备总
+     */
+    @Override
+    public List<TSpecdevMain> selectTSpecdevMainList(TSpecdevMain tSpecdevMain)
+    {
+        return tSpecdevMainMapper.selectTSpecdevMainList(tSpecdevMain);
+    }
+
+    /**
+     * 新增设备总
+     *
+     * @param tSpecdevMain 设备总
+     * @return 结果
+     */
+    @Override
+    public int insertTSpecdevMain(TSpecdevMain tSpecdevMain)
+    {
+        return tSpecdevMainMapper.insertTSpecdevMain(tSpecdevMain);
+    }
+
+    /**
+     * 修改设备总
+     *
+     * @param tSpecdevMain 设备总
+     * @return 结果
+     */
+    @Override
+    public int updateTSpecdevMain(TSpecdevMain tSpecdevMain)
+    {
+        return tSpecdevMainMapper.updateTSpecdevMain(tSpecdevMain);
+    }
+
+    /**
+     * 批量删除设备总
+     *
+     * @param ids 需要删除的设备总ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTSpecdevMainByIds(Long[] ids)
+    {
+        return tSpecdevMainMapper.deleteTSpecdevMainByIds(ids);
+    }
+
+    /**
+     * 删除设备总信息
+     *
+     * @param id 设备总ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTSpecdevMainById(Long id)
+    {
+        return tSpecdevMainMapper.deleteTSpecdevMainById(id);
+    }
+}

+ 93 - 0
cpms-admin/src/main/java/com/cpms/project/asset/service/impl/TSpecdevTypemgrServiceImpl.java

@@ -0,0 +1,93 @@
+package com.cpms.project.asset.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.cpms.project.asset.mapper.TSpecdevTypemgrMapper;
+import com.cpms.project.asset.domain.TSpecdevTypemgr;
+import com.cpms.project.asset.service.ITSpecdevTypemgrService;
+
+/**
+ * 设备类型管理Service业务层处理
+ * 
+ * @author admin
+ * @date 2023-08-08
+ */
+@Service
+public class TSpecdevTypemgrServiceImpl implements ITSpecdevTypemgrService 
+{
+    @Autowired
+    private TSpecdevTypemgrMapper tSpecdevTypemgrMapper;
+
+    /**
+     * 查询设备类型管理
+     * 
+     * @param id 设备类型管理主键
+     * @return 设备类型管理
+     */
+    @Override
+    public TSpecdevTypemgr selectTSpecdevTypemgrById(Long id)
+    {
+        return tSpecdevTypemgrMapper.selectTSpecdevTypemgrById(id);
+    }
+
+    /**
+     * 查询设备类型管理列表
+     * 
+     * @param tSpecdevTypemgr 设备类型管理
+     * @return 设备类型管理
+     */
+    @Override
+    public List<TSpecdevTypemgr> selectTSpecdevTypemgrList(TSpecdevTypemgr tSpecdevTypemgr)
+    {
+        return tSpecdevTypemgrMapper.selectTSpecdevTypemgrList(tSpecdevTypemgr);
+    }
+
+    /**
+     * 新增设备类型管理
+     * 
+     * @param tSpecdevTypemgr 设备类型管理
+     * @return 结果
+     */
+    @Override
+    public int insertTSpecdevTypemgr(TSpecdevTypemgr tSpecdevTypemgr)
+    {
+        return tSpecdevTypemgrMapper.insertTSpecdevTypemgr(tSpecdevTypemgr);
+    }
+
+    /**
+     * 修改设备类型管理
+     * 
+     * @param tSpecdevTypemgr 设备类型管理
+     * @return 结果
+     */
+    @Override
+    public int updateTSpecdevTypemgr(TSpecdevTypemgr tSpecdevTypemgr)
+    {
+        return tSpecdevTypemgrMapper.updateTSpecdevTypemgr(tSpecdevTypemgr);
+    }
+
+    /**
+     * 批量删除设备类型管理
+     * 
+     * @param ids 需要删除的设备类型管理主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTSpecdevTypemgrByIds(Long[] ids)
+    {
+        return tSpecdevTypemgrMapper.deleteTSpecdevTypemgrByIds(ids);
+    }
+
+    /**
+     * 删除设备类型管理信息
+     * 
+     * @param id 设备类型管理主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTSpecdevTypemgrById(Long id)
+    {
+        return tSpecdevTypemgrMapper.deleteTSpecdevTypemgrById(id);
+    }
+}

+ 25 - 0
cpms-admin/src/main/java/com/cpms/project/common/DataEntity.java

@@ -0,0 +1,25 @@
+package com.cpms.project.common;
+
+import com.cpms.common.core.domain.BaseEntity;
+
+public class DataEntity extends BaseEntity {
+
+    private String dataName;
+    private Integer dataNum;
+
+    public String getDataName() {
+        return dataName;
+    }
+
+    public void setDataName(String dataName) {
+        this.dataName = dataName;
+    }
+
+    public Integer getDataNum() {
+        return dataNum;
+    }
+
+    public void setDataNum(Integer dataNum) {
+        this.dataNum = dataNum;
+    }
+}

+ 101 - 0
cpms-admin/src/main/java/com/cpms/project/file/controller/TFileController.java

@@ -0,0 +1,101 @@
+package com.cpms.project.file.controller;
+
+import com.cpms.common.annotation.Log;
+import com.cpms.common.config.RuoYiConfig;
+import com.cpms.common.core.controller.BaseController;
+import com.cpms.common.core.domain.AjaxResult;
+import com.cpms.common.core.page.TableDataInfo;
+import com.cpms.common.enums.BusinessType;
+import com.cpms.common.utils.file.FileUploadUtils;
+import com.cpms.project.file.domain.TFile;
+import com.cpms.project.file.service.ITFileService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 附件Controller
+ *
+ * @author jiang
+ * @date 2023-10-16
+ */
+@RestController
+@RequestMapping("/file/file")
+public class TFileController extends BaseController {
+    @Autowired
+    private ITFileService tFileService;
+
+    /**
+     * 查询附件列表
+     */
+    @PreAuthorize("@ss.hasPermi('file:file:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TFile tFile) {
+        startPage();
+        List<TFile> list = tFileService.selectTFileList(tFile);
+        return getDataTable(list);
+    }
+
+
+    /**
+     * 获取附件详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('file:file:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return AjaxResult.success(tFileService.selectTFileById(id));
+    }
+
+    /**
+     * 新增附件
+     */
+    @PreAuthorize("@ss.hasPermi('file:file:add')")
+    @Log(title = "附件", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TFile tFile) {
+        return toAjax(tFileService.insertTFile(tFile));
+    }
+
+    /**
+     * 修改附件
+     */
+    @PreAuthorize("@ss.hasPermi('file:file:edit')")
+    @Log(title = "附件", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TFile tFile) {
+        return toAjax(tFileService.updateTFile(tFile));
+    }
+
+    /**
+     * 删除附件
+     */
+    @PreAuthorize("@ss.hasPermi('file:file:remove')")
+    @Log(title = "附件", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(tFileService.deleteTFileByIds(ids));
+    }
+
+
+    @PostMapping("/uploadFile")
+    public AjaxResult uploadFile(@RequestParam("file") MultipartFile file, @RequestParam(value = "linkId", required = false) Long linkId, @RequestParam(value = "linkName", required = false) String linkName) throws IOException {
+        if (!file.isEmpty()) {
+            String avatar = FileUploadUtils.upload(RuoYiConfig.getUploadPath(), file);
+            TFile tFile = new TFile();
+            tFile.setFileName(file.getOriginalFilename());
+            tFile.setFileUrl(avatar);
+            tFile.setUploader(getNickname());
+            tFile.setUploadDate(new Date());
+            tFile.setLinkId(linkId);
+            tFile.setLinkName(linkName);
+            tFileService.insertTFile(tFile);
+            return AjaxResult.success(avatar);
+        }
+        return AjaxResult.error("上传异常,请联系管理员");
+    }
+}

+ 139 - 0
cpms-admin/src/main/java/com/cpms/project/file/domain/TFile.java

@@ -0,0 +1,139 @@
+package com.cpms.project.file.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.cpms.common.annotation.Excel;
+import com.cpms.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.Date;
+
+/**
+ * 附件对象 t_file
+ *
+ * @author jiang
+ * @date 2023-10-16
+ */
+public class TFile extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private Long id;
+
+    /** 附件地址 */
+    @Excel(name = "附件地址")
+    private String fileUrl;
+
+    /** 附件名称 */
+    @Excel(name = "附件名称")
+    private String fileName;
+
+    /** 上传时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    @Excel(name = "上传时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date uploadDate;
+
+    /** 上传人 */
+    @Excel(name = "上传人")
+    private String uploader;
+
+    /** 关联表id */
+    @Excel(name = "关联表id")
+    private Long linkId;
+
+    /** 关联表名 */
+    @Excel(name = "关联表名")
+    private String linkName;
+
+    /** 删除标识 */
+    private String delFlag;
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setFileUrl(String fileUrl)
+    {
+        this.fileUrl = fileUrl;
+    }
+
+    public String getFileUrl()
+    {
+        return fileUrl;
+    }
+    public void setFileName(String fileName)
+    {
+        this.fileName = fileName;
+    }
+
+    public String getFileName()
+    {
+        return fileName;
+    }
+    public void setUploadDate(Date uploadDate)
+    {
+        this.uploadDate = uploadDate;
+    }
+
+    public Date getUploadDate()
+    {
+        return uploadDate;
+    }
+    public void setUploader(String uploader)
+    {
+        this.uploader = uploader;
+    }
+
+    public String getUploader()
+    {
+        return uploader;
+    }
+    public void setLinkId(Long linkId)
+    {
+        this.linkId = linkId;
+    }
+
+    public Long getLinkId()
+    {
+        return linkId;
+    }
+    public void setLinkName(String linkName)
+    {
+        this.linkName = linkName;
+    }
+
+    public String getLinkName()
+    {
+        return linkName;
+    }
+    public void setDelFlag(String delFlag)
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag()
+    {
+        return delFlag;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("fileUrl", getFileUrl())
+            .append("fileName", getFileName())
+            .append("uploadDate", getUploadDate())
+            .append("uploader", getUploader())
+            .append("remark", getRemark())
+            .append("linkId", getLinkId())
+            .append("linkName", getLinkName())
+            .append("delFlag", getDelFlag())
+            .toString();
+    }
+}

+ 62 - 0
cpms-admin/src/main/java/com/cpms/project/file/mapper/TFileMapper.java

@@ -0,0 +1,62 @@
+package com.cpms.project.file.mapper;
+
+import com.cpms.project.file.domain.TFile;
+
+import java.util.List;
+
+/**
+ * 附件Mapper接口
+ * 
+ * @author jiang
+ * @date 2023-10-16
+ */
+public interface TFileMapper 
+{
+    /**
+     * 查询附件
+     * 
+     * @param id 附件主键
+     * @return 附件
+     */
+    public TFile selectTFileById(Long id);
+
+    /**
+     * 查询附件列表
+     * 
+     * @param tFile 附件
+     * @return 附件集合
+     */
+    public List<TFile> selectTFileList(TFile tFile);
+
+    /**
+     * 新增附件
+     * 
+     * @param tFile 附件
+     * @return 结果
+     */
+    public int insertTFile(TFile tFile);
+
+    /**
+     * 修改附件
+     * 
+     * @param tFile 附件
+     * @return 结果
+     */
+    public int updateTFile(TFile tFile);
+
+    /**
+     * 删除附件
+     * 
+     * @param id 附件主键
+     * @return 结果
+     */
+    public int deleteTFileById(Long id);
+
+    /**
+     * 批量删除附件
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTFileByIds(Long[] ids);
+}

+ 62 - 0
cpms-admin/src/main/java/com/cpms/project/file/service/ITFileService.java

@@ -0,0 +1,62 @@
+package com.cpms.project.file.service;
+
+import com.cpms.project.file.domain.TFile;
+
+import java.util.List;
+
+/**
+ * 附件Service接口
+ * 
+ * @author jiang
+ * @date 2023-10-16
+ */
+public interface ITFileService 
+{
+    /**
+     * 查询附件
+     * 
+     * @param id 附件主键
+     * @return 附件
+     */
+    public TFile selectTFileById(Long id);
+
+    /**
+     * 查询附件列表
+     * 
+     * @param tFile 附件
+     * @return 附件集合
+     */
+    public List<TFile> selectTFileList(TFile tFile);
+
+    /**
+     * 新增附件
+     * 
+     * @param tFile 附件
+     * @return 结果
+     */
+    public int insertTFile(TFile tFile);
+
+    /**
+     * 修改附件
+     * 
+     * @param tFile 附件
+     * @return 结果
+     */
+    public int updateTFile(TFile tFile);
+
+    /**
+     * 批量删除附件
+     * 
+     * @param ids 需要删除的附件主键集合
+     * @return 结果
+     */
+    public int deleteTFileByIds(Long[] ids);
+
+    /**
+     * 删除附件信息
+     * 
+     * @param id 附件主键
+     * @return 结果
+     */
+    public int deleteTFileById(Long id);
+}

+ 94 - 0
cpms-admin/src/main/java/com/cpms/project/file/service/impl/TFileServiceImpl.java

@@ -0,0 +1,94 @@
+package com.cpms.project.file.service.impl;
+
+import com.cpms.project.file.domain.TFile;
+import com.cpms.project.file.mapper.TFileMapper;
+import com.cpms.project.file.service.ITFileService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 附件Service业务层处理
+ * 
+ * @author jiang
+ * @date 2023-10-16
+ */
+@Service
+public class TFileServiceImpl implements ITFileService 
+{
+    @Autowired
+    private TFileMapper tFileMapper;
+
+    /**
+     * 查询附件
+     * 
+     * @param id 附件主键
+     * @return 附件
+     */
+    @Override
+    public TFile selectTFileById(Long id)
+    {
+        return tFileMapper.selectTFileById(id);
+    }
+
+    /**
+     * 查询附件列表
+     * 
+     * @param tFile 附件
+     * @return 附件
+     */
+    @Override
+    public List<TFile> selectTFileList(TFile tFile)
+    {
+        return tFileMapper.selectTFileList(tFile);
+    }
+
+    /**
+     * 新增附件
+     * 
+     * @param tFile 附件
+     * @return 结果
+     */
+    @Override
+    public int insertTFile(TFile tFile)
+    {
+        return tFileMapper.insertTFile(tFile);
+    }
+
+    /**
+     * 修改附件
+     * 
+     * @param tFile 附件
+     * @return 结果
+     */
+    @Override
+    public int updateTFile(TFile tFile)
+    {
+        return tFileMapper.updateTFile(tFile);
+    }
+
+    /**
+     * 批量删除附件
+     * 
+     * @param ids 需要删除的附件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTFileByIds(Long[] ids)
+    {
+        return tFileMapper.deleteTFileByIds(ids);
+    }
+
+    /**
+     * 删除附件信息
+     * 
+     * @param id 附件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTFileById(Long id)
+    {
+        return tFileMapper.deleteTFileById(id);
+    }
+}

+ 85 - 0
cpms-admin/src/main/java/com/cpms/project/office/OnlyofficeConfiguration.java

@@ -0,0 +1,85 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.cpms.project.office.documentserver.storage.FileStoragePathBuilder;
+import com.cpms.project.office.documentserver.util.SSLUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.modelmapper.ModelMapper;
+import org.modelmapper.convention.MatchingStrategies;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import javax.annotation.PostConstruct;
+
+@Configuration
+public class OnlyofficeConfiguration {
+
+    @Value("${files.storage}")
+    private String storageAddress;
+
+    @Value("${files.docservice.verify-peer-off}")
+    private String verifyPerrOff;
+
+    @Autowired
+    private FileStoragePathBuilder storagePathBuilder;
+
+    @Autowired
+    private SSLUtils ssl;
+
+    @Bean
+    public ModelMapper mapper(){  // create the model mapper
+        ModelMapper mapper = new ModelMapper();
+        mapper.getConfiguration()  // get the mapper configuration and set new parameters to it
+                .setMatchingStrategy(MatchingStrategies.STRICT)  // specify the STRICT matching strategy
+                .setFieldMatchingEnabled(true)  // define if the field matching is enabled or not
+                .setSkipNullEnabled(true)  // define if null value will be skipped or not
+                .setFieldAccessLevel(org.modelmapper.config.Configuration.AccessLevel.PRIVATE);  // specify the PRIVATE field access level
+        return mapper;
+    }
+
+//    @Bean
+//    public JSONParser jsonParser(){  // create JSON parser
+//        return new JSONParser();
+//    }
+
+    @PostConstruct
+    public void init(){  // initialize the storage path builder
+        storagePathBuilder.configure(StringUtils.isEmpty(storageAddress) ? null : storageAddress);
+        if(!verifyPerrOff.isEmpty()) {
+            try{
+                if(verifyPerrOff.equals("true")) {
+                    ssl.turnOffSslChecking(); //the certificate will be ignored
+                } else {
+                    ssl.turnOnSslChecking(); //the certificate will be verified
+                }
+            } catch(Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    @Bean
+    public ObjectMapper objectMapper(){  // create the object mapper
+        return new ObjectMapper();
+    }
+}

+ 188 - 0
cpms-admin/src/main/java/com/cpms/project/office/OnlyofficeController.java

@@ -0,0 +1,188 @@
+package com.cpms.project.office;
+
+import com.cpms.common.core.controller.BaseController;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+
+@Component
+@RestController
+@RequestMapping(value = "/onlyoffice", method = RequestMethod.POST)
+public class OnlyofficeController extends BaseController {
+//
+//    protected final Logger logger = LoggerFactory.getLogger(BaseController.class);
+//    @Autowired
+//    private ISysUserService sysUserService;
+//
+//    @Autowired
+//    private FileConfigurer<DefaultFileWrapper> fileConfigurer;
+//
+//    @Value("${deployment.host}")
+//    private String deploymentHost;
+//    @Value("${server.port}")
+//    private String port;
+//
+//    @Value("${files.docservice.url.site}")
+//    private String docserviceSite;
+//
+//    @Value("${files.docservice.url.api}")
+//    private String docserviceApiUrl;
+//
+//    @Autowired
+//    private ITFileService tFileService;
+//
+//    @PostMapping("/previewFile")
+//    public AjaxResult preview(HttpServletRequest request, @RequestBody PreviewOfficeFileDTO previewOfficeFileDTO) {
+//        //获取当前用户
+//        SysUser sysUser = sysUserService.selectUserById(getUserId());
+//        Action action = Action.view;
+//        Type type = Type.desktop;
+//        Locale locale = new Locale("zh");
+//
+//        User user = new User(sysUser);
+//        //文件
+//        UserFile userFile = new UserFile();
+//        TFile rcfile = tFileService.selectTFileById(Long.parseLong(previewOfficeFileDTO.getUserFileId()));
+//        userFile.setFileId(rcfile.getId().toString());
+//        userFile.setFilePath(rcfile.getFileUrl());
+//        userFile.setFileName(rcfile.getFileName());
+//        userFile.setExtendName("");
+//        userFile.setUserFileId(rcfile.getId().toString());
+//        userFile.setUploadTime(String.valueOf(rcfile.getUploadDate().getTime()));
+//
+//        //下载地址
+//        String previewUrl = deploymentHost + rcfile.getFileUrl();
+////        String previewUrl = "/onlyoffice/download?filePath=" + rcfile.getFileUrl();
+//
+//
+//        FileModel fileModel = fileConfigurer.getFileModel(
+//                DefaultFileWrapper
+//                        .builder()
+//                        .userFile(userFile)
+//                        .type(type)
+//                        .lang(locale.toLanguageTag())
+//                        .action(action)
+//                        .user(user)
+//                        .actionData(previewUrl)
+//                        .build()
+//        );
+//        fileModel.setToken(null);
+//        JSONObject jsonObject = new JSONObject();
+//        jsonObject.put("file", fileModel);
+//        jsonObject.put("docserviceApiUrl", docserviceSite + docserviceApiUrl);
+//        jsonObject.put("reportName", userFile.getFileName());
+//        return AjaxResult.success(jsonObject);
+//    }
+//
+///*    @PostMapping("/editFile")
+//
+//    public AjaxResult edit(HttpServletRequest request,  @RequestBody PreviewOfficeFileDTO previewOfficeFileDTO) {
+//
+//        //
+//        SysUser sysUser = sysUserService.selectUserById(getUserId());
+//        Action action = Action.edit;
+//        Type type = Type.desktop;
+//        Locale locale = new Locale("zh");
+//
+//        User user = new User(sysUser);
+//        //文件
+//        UserFile userFile = new UserFile();
+//        TRcfile rcfile = tRcfileService.selectTRcfileById(Long.parseLong(previewOfficeFileDTO.getUserFileId()));
+//        userFile.setFileId(rcfile.getId().toString());
+//        userFile.setFilePath(rcfile.getFileUrl());
+//        userFile.setFileName(rcfile.getFileName());
+//        userFile.setExtendName("");
+//        userFile.setUserFileId(rcfile.getId().toString());
+//        userFile.setUploadTime(String.valueOf(rcfile.getUpdatedate().getTime()));
+//
+//        String previewUrl = "/onlyoffice/download?filePath=" + rcfile.getFileUrl();
+//
+//
+//        FileModel fileModel = fileConfigurer.getFileModel(
+//                DefaultFileWrapper
+//                        .builder()
+//                        .userFile(userFile)
+//                        .type(type)
+//                        .lang(locale.toLanguageTag())
+//                        .action(action)
+//                        .user(user)
+//                        .actionData(previewUrl)
+//                        .build()
+//        );
+//        fileModel.setToken(null);
+//        JSONObject jsonObject = new JSONObject();
+//        jsonObject.put("file",fileModel);
+//        jsonObject.put("docserviceApiUrl", docserviceSite + docserviceApiUrl);
+//        jsonObject.put("reportName",userFile.getFileName());
+//        return  AjaxResult.success(jsonObject);
+//    }
+//*/
+//
+///*    @RequestMapping(value = "/IndexServlet", method = RequestMethod.POST)
+//    @ResponseBody
+//    public void IndexServlet(HttpServletResponse response, HttpServletRequest request) throws IOException {
+//        logger.info(JSON.toJSONString(request.getParameterMap()));
+//        String token = request.getParameter("token");
+//
+//        PrintWriter writer = response.getWriter();
+//        Scanner scanner = new Scanner(request.getInputStream()).useDelimiter("\\A");
+//        String body = scanner.hasNext() ? scanner.next() : "";
+//        JSONObject jsonObj = JSON.parseObject(body);
+//        logger.info(jsonObj.toJSONString());
+//        logger.info("===saveeditedfile:" + jsonObj.get("status"));
+//        String status = jsonObj != null ? jsonObj.get("status").toString() : "";
+//        if ("2".equals(status) || "6".equals(status)) {
+//            String type = request.getParameter("type");
+//            String downloadUri = (String) jsonObj.get("url");
+//            if("edit".equals(type)){ //修改报告
+//                String userFileId = request.getParameter("userFileId");
+//                TRcfile rcfile = tRcfileService.selectTRcfileById(Long.parseLong( userFileId ));
+//
+//                String pathForSave = RuoYiConfig.getProfile() + rcfile.getFileUrl().replace("/profile","");
+//                URL url = new URL(downloadUri);
+//                HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+//
+//                InputStream stream = connection.getInputStream();
+//
+//                File savedFile = new File(pathForSave);
+//                try (FileOutputStream out = new FileOutputStream(savedFile)) {
+//                    int read;
+//                    final byte[] bytes = new byte[1024];
+//                    while ((read = stream.read(bytes)) != -1) {
+//                        out.write(bytes, 0, read);
+//                    }
+//                    out.flush();
+//                }
+//                connection.disconnect();
+//                //更新文件时间
+//                rcfile.setUpdatedate(new Date());
+//                tRcfileService.updateTRcfile(rcfile);
+//            }
+//        }
+//        writer.write("{\"error\":" + "0" + "}");
+//    }*/
+//
+//    /**
+//     *
+//     * @param response
+//     */
+///*    @GetMapping("/download")
+//    public void download(UserFile userFile, HttpServletResponse response) {
+//        try {
+//            String newFilePath = userFile.getFilePath().replace("/profile","");
+//            // 需要转换的文件路径
+//           String pathName = RuoYiConfig.getProfile()+newFilePath;
+//            logger.info("pathName::::::::::" + pathName);
+//            String fileName = pathName.substring(pathName.lastIndexOf("/") + 1);
+//            logger.info("fileName::::::::::" + fileName);
+//            FileUtils.downloadInline(pathName, fileName,response);
+//        }catch (Exception e){
+//            e.printStackTrace();
+//        }
+//
+//    }*/
+//
+
+}

+ 32 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/callbacks/Callback.java

@@ -0,0 +1,32 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.callbacks;
+
+import com.cpms.project.office.dto.Track;
+import org.springframework.beans.factory.annotation.Autowired;
+
+// specify the callback handler functions
+public interface Callback {
+    int handle(Track body, String fileName);  // handle the callback
+    int getStatus();  // get document status
+    @Autowired
+    default void selfRegistration(CallbackHandler callbackHandler){  // register a callback handler
+        callbackHandler.register(getStatus(), this);
+    }
+}

+ 50 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/callbacks/CallbackHandler.java

@@ -0,0 +1,50 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.callbacks;
+
+import com.cpms.project.office.dto.Track;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Service
+public class CallbackHandler {
+
+    private Logger logger = LoggerFactory.getLogger(CallbackHandler.class);
+
+    private Map<Integer, Callback> callbackHandlers = new HashMap<>();
+
+    public void register(int code, Callback callback){  // register a callback handler
+        callbackHandlers.put(code, callback);
+    }
+
+    public int handle(Track body, String fileName){  // handle a callback
+        Callback callback = callbackHandlers.get(body.getStatus());
+        if (callback == null){
+            logger.warn("Callback status "+body.getStatus()+" is not supported yet");
+           return 0;
+        }
+
+        int result = callback.handle(body, fileName);
+        return result;
+    }
+}

+ 35 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/callbacks/Status.java

@@ -0,0 +1,35 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.callbacks;
+
+// document status
+public enum Status {
+    EDITING(1),  // 1 - document is being edited
+    SAVE(2),  // 2 - document is ready for saving
+    CORRUPTED(3),  // 3 - document saving error has occurred
+    MUST_FORCE_SAVE(6),  // 6 - document is being edited, but the current document state is saved
+    CORRUPTED_FORCE_SAVE(7);  // 7 - error has occurred while force saving the document
+    private int code;
+    Status(int code){
+        this.code = code;
+    }
+    public int getCode(){  // get document status
+        return this.code;
+    }
+}

+ 57 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/callbacks/implementations/EditCallback.java

@@ -0,0 +1,57 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.callbacks.implementations;
+
+
+import com.cpms.project.office.documentserver.callbacks.Callback;
+import com.cpms.project.office.documentserver.callbacks.Status;
+import com.cpms.project.office.documentserver.managers.callback.CallbackManager;
+import com.cpms.project.office.dto.Action;
+import com.cpms.project.office.dto.Track;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class EditCallback implements Callback {
+    @Autowired
+    private CallbackManager callbackManager;
+    @Override
+    public int handle(Track body, String fileName) {  // handle the callback when the document is being edited
+        int result = 0;
+        Action action =  body.getActions().get(0);  // get the user ID who is editing the document
+        if (action.getType().equals(com.cpms.project.office.documentserver.models.enums.Action.edit)) {  // if this value is not equal to the user ID
+            String user =  action.getUserid();  // get user ID
+            if (!body.getUsers().contains(user)) {  // if this user is not specified in the body
+                String key = body.getKey();  // get document key
+                try {
+                    callbackManager.commandRequest("forcesave", key, null);  // create a command request to forcibly save the document being edited without closing it
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    result = 1;
+                }
+            }
+        }
+        return result;
+    }
+
+    @Override
+    public int getStatus() {  // get document status
+        return Status.EDITING.getCode();  // return status 1 - document is being edited
+    }
+}

+ 49 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/callbacks/implementations/ForcesaveCallback.java

@@ -0,0 +1,49 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.callbacks.implementations;
+
+
+import com.cpms.project.office.documentserver.callbacks.Callback;
+import com.cpms.project.office.documentserver.callbacks.Status;
+import com.cpms.project.office.documentserver.managers.callback.CallbackManager;
+import com.cpms.project.office.dto.Track;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class ForcesaveCallback implements Callback {
+    @Autowired
+    private CallbackManager callbackManager;
+    @Override
+    public int handle(Track body, String fileName) {  // handle the callback when the force saving request is performed
+        int result = 0;
+        try {
+            callbackManager.processForceSave(body, fileName);  // file force saving process
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            result = 1;
+        }
+        return result;
+    }
+
+    @Override
+    public int getStatus() {  // get document status
+        return Status.MUST_FORCE_SAVE.getCode();  // return status 6 - document is being edited, but the current document state is saved
+    }
+}

+ 50 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/callbacks/implementations/SaveCallback.java

@@ -0,0 +1,50 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.callbacks.implementations;
+
+
+import com.cpms.project.office.documentserver.callbacks.Callback;
+import com.cpms.project.office.documentserver.callbacks.Status;
+import com.cpms.project.office.documentserver.managers.callback.CallbackManager;
+import com.cpms.project.office.dto.Track;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class SaveCallback implements Callback {
+    @Autowired
+    private CallbackManager callbackManager;
+    @Override
+    public int handle(Track body, String fileName) {  // handle the callback when the saving request is performed
+        int result = 0;
+        try {
+            callbackManager.processSave(body, fileName);  // file saving process
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            result = 1;
+        }
+
+        return result;
+    }
+
+    @Override
+    public int getStatus() {  // get document status
+        return Status.SAVE.getCode();  // return status 2 - document is ready for saving
+    }
+}

+ 30 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/managers/callback/CallbackManager.java

@@ -0,0 +1,30 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.managers.callback;
+
+
+import com.cpms.project.office.dto.Track;
+
+import java.util.HashMap;
+
+public interface CallbackManager {  // specify the callback manager functions
+    void processSave(Track body, String fileName);  // file saving process
+    void commandRequest(String method, String key, HashMap meta);  // create a command request
+    void processForceSave(Track body, String fileName);  // file force saving process
+}

+ 281 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/managers/callback/DefaultCallbackManager.java

@@ -0,0 +1,281 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.managers.callback;
+
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.cpms.project.office.documentserver.managers.document.DocumentManager;
+import com.cpms.project.office.documentserver.managers.jwt.JwtManager;
+import com.cpms.project.office.documentserver.storage.FileStorageMutator;
+import com.cpms.project.office.documentserver.storage.FileStoragePathBuilder;
+import com.cpms.project.office.documentserver.util.file.FileUtility;
+import com.cpms.project.office.documentserver.util.service.ServiceConverter;
+import com.cpms.project.office.dto.Action;
+import com.cpms.project.office.dto.Track;
+import lombok.SneakyThrows;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Primary;
+import org.springframework.stereotype.Component;
+
+import java.io.File;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+//TODO: Refactoring
+@Component
+@Primary
+public class DefaultCallbackManager implements CallbackManager {
+
+    @Value("${files.docservice.url.site}")
+    private String docserviceUrlSite;
+    @Value("${files.docservice.url.command}")
+    private String docserviceUrlCommand;
+    @Value("${files.docservice.header}")
+    private String documentJwtHeader;
+
+    @Autowired
+    private DocumentManager documentManager;
+    @Autowired
+    private JwtManager jwtManager;
+    @Autowired
+    private FileUtility fileUtility;
+    @Autowired
+    private FileStorageMutator storageMutator;
+    @Autowired
+    private FileStoragePathBuilder storagePathBuilder;
+//    @Autowired
+//    private ObjectMapper objectMapper;
+    @Autowired
+    private ServiceConverter serviceConverter;
+
+    // save file information from the URL to the file specified
+    private void downloadToFile(String url, Path path) throws Exception {
+        if (url == null || url.isEmpty()) throw new RuntimeException("Url argument is not specified");  // URL isn't specified
+        if (path == null) throw new RuntimeException("Path argument is not specified");  // file isn't specified
+
+        URL uri = new URL(url);
+        java.net.HttpURLConnection connection = (java.net.HttpURLConnection) uri.openConnection();
+        InputStream stream = connection.getInputStream();  // get input stream of the file information from the URL
+
+        if (stream == null) {
+            connection.disconnect();
+            throw new RuntimeException("Input stream is null");
+        }
+
+        storageMutator.createOrUpdateFile(path, stream);  // update a file or create a new one
+    }
+
+    @SneakyThrows
+    public void processSave(Track body, String fileName) {  // file saving process
+        String downloadUri = body.getUrl();
+        String changesUri = body.getChangesurl();
+        String key = body.getKey();
+        String newFileName = fileName;
+
+        String curExt = fileUtility.getFileExtension(fileName);  // get current file extension
+        String downloadExt = "." + body.getFiletype(); // get an extension of the downloaded file
+
+        // Todo [Delete in version 7.0 or higher]
+        if (downloadExt != "." + null) downloadExt = fileUtility.getFileExtension(downloadUri); // Support for versions below 7.0
+
+        //TODO: Refactoring
+        if (!curExt.equals(downloadExt)) {  // convert downloaded file to the file with the current extension if these extensions aren't equal
+            try {
+                String newFileUri = serviceConverter.getConvertedUri(downloadUri, downloadExt, curExt, serviceConverter.generateRevisionId(downloadUri), null, false, null);  // convert a file and get URL to a new file
+                if (newFileUri.isEmpty()) {
+                    newFileName = documentManager
+                            .getCorrectName(fileUtility.getFileNameWithoutExtension(fileName) + downloadExt);  // get the correct file name if it already exists
+                } else {
+                    downloadUri = newFileUri;
+                }
+            } catch (Exception e){
+                newFileName = documentManager.getCorrectName(fileUtility.getFileNameWithoutExtension(fileName) + downloadExt);
+            }
+        }
+
+        String storagePath = storagePathBuilder.getFileLocation(newFileName);  // get the path to a new file
+        Path lastVersion = Paths.get(storagePathBuilder.getFileLocation(fileName));  // get the path to the last file version
+
+        if (lastVersion.toFile().exists()) {  // if the last file version exists
+            Path histDir = Paths.get(storagePathBuilder.getHistoryDir(storagePath));  // get the history directory
+            storageMutator.createDirectory(histDir);  // and create it
+
+            String versionDir = documentManager.versionDir(histDir.toAbsolutePath().toString(),  // get the file version directory
+                    storagePathBuilder.getFileVersion(histDir.toAbsolutePath().toString(), false), true);
+
+            Path ver = Paths.get(versionDir);
+            Path toSave = Paths.get(storagePath);
+
+            storageMutator.createDirectory(ver);  // create the file version directory
+            storageMutator.moveFile(lastVersion, Paths.get(versionDir + File.separator + "prev" + curExt));  // move the last file version to the file version directory with the "prev" postfix
+
+            downloadToFile(downloadUri, toSave);  // save file to the storage path
+            downloadToFile(changesUri, new File(versionDir + File.separator + "diff.zip").toPath());  // save file changes to the diff.zip archive
+
+            JSONObject jsonChanges = new JSONObject();  // create a json object for document changes
+            jsonChanges.put("changes", body.getHistory().getChanges());  // put the changes to the json object
+            jsonChanges.put("serverVersion", body.getHistory().getServerVersion());  // put the server version to the json object
+//            String history = objectMapper.writeValueAsString(jsonChanges);
+            String history = JSON.toJSONString(jsonChanges);
+            if (history == null && body.getHistory() != null) {
+                history = JSON.toJSONString(body.getHistory());
+            }
+
+            if (history != null && !history.isEmpty()) {
+                storageMutator.writeToFile(versionDir + File.separator + "changes.json", history);  // write the history changes to the changes.json file
+            }
+
+            storageMutator.writeToFile(versionDir + File.separator + "key.txt", key);  // write the key value to the key.txt file
+            storageMutator.deleteFile(storagePathBuilder.getForcesavePath(newFileName, false));  // get the path to the forcesaved file version and remove it
+        }
+    }
+
+    //TODO: Replace (String method) with (Enum method)
+    @SneakyThrows
+    public void commandRequest(String method, String key, HashMap meta) {  // create a command request
+        String DocumentCommandUrl = docserviceUrlSite + docserviceUrlCommand;
+
+        URL url = new URL(DocumentCommandUrl);
+        java.net.HttpURLConnection connection = (java.net.HttpURLConnection) url.openConnection();
+
+        HashMap<String, Object> params = new HashMap<String, Object>();
+        params.put("c", method);
+        params.put("key", key);
+
+        if (meta != null) {
+            params.put("meta", meta);
+        }
+
+        String headerToken;
+        if (jwtManager.tokenEnabled())  // check if a secret key to generate token exists or not
+        {
+            Map<String, Object> payloadMap = new HashMap<>();
+            payloadMap.put("payload", params);
+            headerToken = jwtManager.createToken(payloadMap);  // encode a payload object into a header token
+            connection.setRequestProperty(documentJwtHeader.equals("") ? "Authorization" : documentJwtHeader, "Bearer " + headerToken);  // add a header Authorization with a header token and Authorization prefix in it
+
+            String token = jwtManager.createToken(params);  // encode a payload object into a body token
+            params.put("token", token);
+        }
+
+        String bodyString = JSON.toJSONString(params);
+
+        byte[] bodyByte = bodyString.getBytes(StandardCharsets.UTF_8);
+
+        connection.setRequestMethod("POST");  // set the request method
+        connection.setRequestProperty("Content-Type", "application/json; charset=UTF-8");  // set the Content-Type header
+        connection.setDoOutput(true);  // set the doOutput field to true
+        connection.connect();
+
+        try (OutputStream os = connection.getOutputStream()) {
+            os.write(bodyByte);  // write bytes to the output stream
+        }
+
+        InputStream stream = connection.getInputStream();  // get input stream
+
+        if (stream == null) throw new RuntimeException("Could not get an answer");
+
+        String jsonString = serviceConverter.convertStreamToString(stream);  // convert stream to json string
+        connection.disconnect();
+
+        JSONObject response = JSON.parseObject(jsonString);  // convert json string to json object
+        //TODO: Add errors ENUM
+        String responseCode = response.get("error").toString();
+        switch(responseCode) {
+            case "0":
+            case "4": {
+                break;
+            }
+            default: {
+                throw new RuntimeException(response.toJSONString());
+            }
+        }
+    }
+
+    @SneakyThrows
+    public void processForceSave(Track body, String fileName) {  // file force saving process
+
+        String downloadUri = body.getUrl();
+
+        String curExt = fileUtility.getFileExtension(fileName);  // get current file extension
+        String downloadExt = "."+body.getFiletype();  // get an extension of the downloaded file
+
+        // Todo [Delete in version 7.0 or higher]
+        if (downloadExt != "."+null) downloadExt = fileUtility.getFileExtension(downloadUri);    // Support for versions below 7.0
+
+        Boolean newFileName = false;
+
+        // convert downloaded file to the file with the current extension if these extensions aren't equal
+        //TODO: Extract function
+        if (!curExt.equals(downloadExt)) {
+            try {
+                String newFileUri = serviceConverter.getConvertedUri(downloadUri, downloadExt,
+                        curExt, serviceConverter.generateRevisionId(downloadUri), null, false, null);  // convert file and get URL to a new file
+                if (newFileUri.isEmpty()) {
+                    newFileName = true;
+                } else {
+                    downloadUri = newFileUri;
+                }
+            } catch (Exception e){
+                newFileName = true;
+            }
+        }
+
+        String forcesavePath = "";
+
+        //TODO: Use ENUMS
+        //TODO: Pointless toString conversion
+        boolean isSubmitForm = body.getForcesavetype().toString().equals("3");
+
+        //TODO: Extract function
+        if (isSubmitForm) {  // if the form is submitted
+            if (newFileName){
+                fileName = documentManager
+                        .getCorrectName(fileUtility.getFileNameWithoutExtension(fileName) + "-form" + downloadExt);  // get the correct file name if it already exists
+            } else {
+                fileName = documentManager.getCorrectName(fileUtility.getFileNameWithoutExtension(fileName) + "-form" + curExt);
+            }
+            forcesavePath = storagePathBuilder.getFileLocation(fileName);  // create forcesave path if it doesn't exist
+            List<Action> actions =  body.getActions();
+            Action action = actions.get(0);
+            String user = action.getUserid();  // get the user ID
+            storageMutator.createMeta(fileName, user, "Filling Form");  // create meta data for the forcesaved file
+        } else {
+            if (newFileName){
+                fileName = documentManager.getCorrectName(fileUtility.getFileNameWithoutExtension(fileName) + downloadExt);
+            }
+
+            forcesavePath = storagePathBuilder.getForcesavePath(fileName, false);
+            if (forcesavePath.isEmpty()) {
+                forcesavePath = storagePathBuilder.getForcesavePath(fileName, true);
+            }
+        }
+
+        downloadToFile(downloadUri, new File(forcesavePath).toPath());
+    }
+}

+ 219 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/managers/document/DefaultDocumentManager.java

@@ -0,0 +1,219 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.managers.document;
+
+
+import com.cpms.project.office.documentserver.storage.FileStorageMutator;
+import com.cpms.project.office.documentserver.storage.FileStoragePathBuilder;
+import com.cpms.project.office.documentserver.util.file.FileUtility;
+import com.cpms.project.office.documentserver.util.service.ServiceConverter;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Primary;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.io.File;
+import java.io.UnsupportedEncodingException;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.net.InetAddress;
+import java.net.URLEncoder;
+import java.net.UnknownHostException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+@Component
+@Primary
+public class DefaultDocumentManager implements DocumentManager {
+
+    @Value("${files.storage.folder}")
+    private String storageFolder;
+    @Value("${files.storage}")
+    private String filesStorage;
+
+    @Autowired
+    private FileStorageMutator storageMutator;
+    @Autowired
+    private FileStoragePathBuilder storagePathBuilder;
+    @Autowired
+    private FileUtility fileUtility;
+    @Autowired
+    private ServiceConverter serviceConverter;
+    @Resource
+    private HttpServletRequest request;
+
+    // get URL to the created file
+    public String getCreateUrl(String fileName, Boolean sample){
+        String fileExt = fileName.substring(fileName.length() - 4);
+        String url = storagePathBuilder.getServerUrl(true) + "/create?fileExt=" + fileExt + "&sample=" + sample;
+        return url;
+    }
+
+    // get a file name with an index if the file with such a name already exists
+    public String getCorrectName(String fileName)
+    {
+        String baseName = fileUtility.getFileNameWithoutExtension(fileName);  // get file name without extension
+        String ext = fileUtility.getFileExtension(fileName);  // get file extension
+        String name = baseName + ext;  // create a full file name
+
+        Path path = Paths.get(storagePathBuilder.getFileLocation(name));
+
+        for (int i = 1; Files.exists(path); i++)  // run through all the files with such a name in the storage directory
+        {
+            name = baseName + " (" + i + ")" + ext;  // and add an index to the base name
+            path = Paths.get(storagePathBuilder.getFileLocation(name));
+        }
+
+        return name;
+    }
+
+    // get file URL
+    public String getFileUri(String fileName, Boolean forDocumentServer)
+    {
+        try
+        {
+            String serverPath = storagePathBuilder.getServerUrl(forDocumentServer);  // get server URL
+            String hostAddress = storagePathBuilder.getStorageLocation();  // get the storage directory
+            String filePathDownload = !fileName.contains(InetAddress.getLocalHost().getHostAddress()) ? fileName
+                    : fileName.substring(fileName.indexOf(InetAddress.getLocalHost().getHostAddress()) + InetAddress.getLocalHost().getHostAddress().length() + 1);
+            if (!filesStorage.isEmpty() && filePathDownload.contains(filesStorage)) {
+                filePathDownload = filePathDownload.substring(filesStorage.length() + 1);
+            }
+
+            String filePath = serverPath + "/download?fileName=" + URLEncoder.encode(filePathDownload, java.nio.charset.StandardCharsets.UTF_8.toString())
+                    + "&userAddress" + URLEncoder.encode(hostAddress, java.nio.charset.StandardCharsets.UTF_8.toString());
+            return filePath;
+        }
+        catch (UnsupportedEncodingException | UnknownHostException e)
+        {
+            return "";
+        }
+    }
+
+    // get file URL
+    public String getHistoryFileUrl(String fileName, Integer version, String file, Boolean forDocumentServer)
+    {
+        try
+        {
+            String serverPath = storagePathBuilder.getServerUrl(forDocumentServer);  // get server URL
+            String hostAddress = storagePathBuilder.getStorageLocation();  // get the storage directory
+            String filePathDownload = !fileName.contains(InetAddress.getLocalHost().getHostAddress()) ? fileName
+                    : fileName.substring(fileName.indexOf(InetAddress.getLocalHost().getHostAddress()) + InetAddress.getLocalHost().getHostAddress().length() + 1);
+            String userAddress = forDocumentServer ? "&userAddress" + URLEncoder.encode(hostAddress, java.nio.charset.StandardCharsets.UTF_8.toString()) : "";
+            String filePath = serverPath + "/downloadhistory?fileName=" + URLEncoder.encode(filePathDownload, java.nio.charset.StandardCharsets.UTF_8.toString())
+                + "&ver=" + version + "&file="+file
+                + userAddress;
+            return filePath;
+        }
+        catch (UnsupportedEncodingException | UnknownHostException e)
+        {
+            return "";
+        }
+    }
+
+    // get the callback URL
+    public String getCallback(String userFileId)
+    {
+        String serverPath = storagePathBuilder.getServerUrl(true);
+
+            String query = "?type=edit&userFileId="+userFileId+"&token="+request.getHeader("token");
+
+            return serverPath + "/onlyoffice/IndexServlet" + query;
+
+
+    }
+
+    // get URL to download a file
+    public String getDownloadUrl(String fileName, Boolean isServer) {
+
+        return "";
+    }
+
+    // get file information
+    public ArrayList<Map<String, Object>> getFilesInfo(){
+        ArrayList<Map<String, Object>> files = new ArrayList<>();
+
+        // run through all the stored files
+        for(File file : storageMutator.getStoredFiles()){
+            Map<String, Object> map = new LinkedHashMap<>();  // write all the parameters to the map
+            map.put("version", storagePathBuilder.getFileVersion(file.getName(), false));
+            map.put("id", serviceConverter
+                    .generateRevisionId(storagePathBuilder.getStorageLocation() +
+                            "/" + file.getName() + "/"
+                            + Paths.get(storagePathBuilder.getFileLocation(file.getName()))
+                            .toFile()
+                            .lastModified()));
+            map.put("contentLength", new BigDecimal(String.valueOf((file.length()/1024.0)))
+                    .setScale(2, RoundingMode.HALF_UP) + " KB");
+            map.put("pureContentLength", file.length());
+            map.put("title", file.getName());
+            map.put("updated", String.valueOf(new Date(file.lastModified())));
+            files.add(map);
+        }
+
+        return files;
+    }
+
+    // get file information by its ID
+    public ArrayList<Map<String, Object>> getFilesInfo(String fileId){
+        ArrayList<Map<String, Object>> file = new ArrayList<>();
+
+        for (Map<String, Object> map : getFilesInfo()){
+            if (map.get("id").equals(fileId)){
+                file.add(map);
+                break;
+            }
+        }
+
+        return file;
+    }
+
+    // get the path to the file version by the history path and file version
+    public String versionDir(String path, Integer version, boolean historyPath) {
+        if (!historyPath){
+            return storagePathBuilder.getHistoryDir(storagePathBuilder.getFileLocation(path)) + version;
+        }
+        return path + File.separator + version;
+    }
+
+    // create demo document
+//    public String createDemo(String fileExt,Boolean sample,String uid,String uname) {
+//        String demoName = (sample ? "sample." : "new.") + fileExt;  // create sample or new template file with the necessary extension
+//        String demoPath = "assets" + File.separator  + (sample ? "sample" : "new") + File.separator + demoName;  // get the path to the sample document
+//        String fileName = getCorrectName(demoName);  // get a file name with an index if the file with such a name already exists
+//
+//        InputStream stream = Thread.currentThread()
+//                                    .getContextClassLoader()
+//                                    .getResourceAsStream(demoPath);  // get the input file stream
+//
+//        if (stream == null) return null;
+//
+//        storageMutator.createFile(Path.of(storagePathBuilder.getFileLocation(fileName)), stream);  // create a file in the specified directory
+//        storageMutator.createMeta(fileName, uid, uname);  // create meta information of the demo file
+//
+//        return fileName;
+//    }
+}

+ 36 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/managers/document/DocumentManager.java

@@ -0,0 +1,36 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.managers.document;
+
+import java.util.ArrayList;
+import java.util.Map;
+
+// specify the document manager functions
+public interface DocumentManager {
+    String getCorrectName(String fileName);  // get a file name with an index if the file with such a name already exists
+    String getFileUri(String fileName, Boolean forDocumentServer);  // get file URL
+    String getHistoryFileUrl(String fileName, Integer version, String file, Boolean forDocumentServer);  // get file URL
+    String getCallback(String userFileId);  // get the callback URL
+    String getDownloadUrl(String fileName, Boolean forDocumentServer);  // get URL to download a file
+    ArrayList<Map<String, Object>> getFilesInfo();  // get file information
+    ArrayList<Map<String, Object>> getFilesInfo(String fileId);  // get file information by its ID
+    String versionDir(String path, Integer version, boolean historyPath);  // get the path to the file version by the history path and file version
+//    String createDemo(String fileExt,Boolean sample,String uid,String uname) throws Exception;  // create demo document
+    String getCreateUrl(String fileName, Boolean sample);  // get URL to the created file
+}

+ 158 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/managers/history/DefaultHistoryManager.java

@@ -0,0 +1,158 @@
+/**
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.cpms.project.office.documentserver.managers.history;
+
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONArray;
+import com.alibaba.fastjson2.JSONObject;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.cpms.project.office.documentserver.managers.document.DocumentManager;
+import com.cpms.project.office.documentserver.managers.jwt.JwtManager;
+import com.cpms.project.office.documentserver.models.filemodel.Document;
+import com.cpms.project.office.documentserver.storage.FileStoragePathBuilder;
+import com.cpms.project.office.documentserver.util.file.FileUtility;
+import lombok.SneakyThrows;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.*;
+
+//TODO: Rebuild completely
+@Component
+public class DefaultHistoryManager implements HistoryManager {
+
+    @Autowired
+    private FileStoragePathBuilder storagePathBuilder;
+
+    @Autowired
+    private DocumentManager documentManager;
+
+    @Autowired
+    private JwtManager jwtManager;
+
+    @Autowired
+    private FileUtility fileUtility;
+
+//    @Autowired
+//    private JSONParser parser;
+
+    @Autowired
+    private ObjectMapper objectMapper;
+
+    //TODO: Refactoring
+    @SneakyThrows
+    public String[] getHistory(Document document) {  // get document history
+        String histDir = storagePathBuilder.getHistoryDir(storagePathBuilder.getFileLocation(document.getTitle()));  // get history directory
+        Integer curVer = storagePathBuilder.getFileVersion(histDir, false);  // get current file version
+
+        if (curVer > 0) {  // check if the current file version is greater than 0
+            List<Object> hist = new ArrayList<>();
+            Map<String, Object> histData = new HashMap<>();
+
+            for (Integer i = 1; i <= curVer; i++) {  // run through all the file versions
+                Map<String, Object> obj = new HashMap<String, Object>();
+                Map<String, Object> dataObj = new HashMap<String, Object>();
+                String verDir = documentManager.versionDir(histDir, i, true);  // get the path to the given file version
+
+                String key = i == curVer ? document.getKey() : readFileToEnd(new File(verDir + File.separator + "key.txt"));  // get document key
+                obj.put("key", key);
+                obj.put("version", i);
+
+                if (i == 1) {  // check if the version number is equal to 1
+                    String createdInfo = readFileToEnd(new File(histDir + File.separator + "createdInfo.json"));  // get file with meta data
+                    JSONObject json = JSON.parseObject(createdInfo);  // and turn it into json object
+
+                    // write meta information to the object (user information and creation date)
+                    obj.put("created", json.get("created"));
+                    Map<String, Object> user = new HashMap<String, Object>();
+                    user.put("id", json.get("id"));
+                    user.put("name", json.get("name"));
+                    obj.put("user", user);
+                }
+
+                dataObj.put("fileType", fileUtility.getFileExtension(document.getTitle()).replace(".", ""));
+                dataObj.put("key", key);
+                dataObj.put("url", i == curVer ? document.getUrl() :
+                        documentManager.getHistoryFileUrl(document.getTitle(), i, "prev" + fileUtility.getFileExtension(document.getTitle()), true));
+//                dataObj.put("directUrl", i == curVer ? document.getDirectUrl() :
+//                        documentManager.getHistoryFileUrl(document.getTitle(), i, "prev" + fileUtility.getFileExtension(document.getTitle()), false));
+                dataObj.put("version", i);
+
+                if (i > 1) {  //check if the version number is greater than 1
+                    // if so, get the path to the changes.json file
+                    JSONObject changes = JSON.parseObject(readFileToEnd(new File(documentManager.versionDir(histDir, i - 1, true) + File.separator + "changes.json")));
+                    JSONObject change = (JSONObject) ((JSONArray) changes.get("changes")).get(0);
+
+                    // write information about changes to the object
+                    obj.put("changes", changes.get("changes"));
+                    obj.put("serverVersion", changes.get("serverVersion"));
+                    obj.put("created", change.get("created"));
+                    obj.put("user", change.get("user"));
+
+                    Map<String, Object> prev = (Map<String, Object>) histData.get(Integer.toString(i - 2));  // get the history data from the previous file version
+                    Map<String, Object> prevInfo = new HashMap<String, Object>();
+                    prevInfo.put("fileType", prev.get("fileType"));
+                    prevInfo.put("key", prev.get("key"));  // write key and URL information about previous file version
+                    prevInfo.put("url", prev.get("url"));
+                    prevInfo.put("directUrl", prev.get("directUrl"));
+                    dataObj.put("previous", prevInfo);  // write information about previous file version to the data object
+                    // write the path to the diff.zip archive with differences in this file version
+                    Integer verdiff = i - 1;
+                    dataObj.put("changesUrl", documentManager.getHistoryFileUrl(document.getTitle(), verdiff, "diff.zip", true));
+                }
+
+                if (jwtManager.tokenEnabled()) dataObj.put("token", jwtManager.createToken(dataObj));
+
+                hist.add(obj);
+                histData.put(Integer.toString(i - 1), dataObj);
+            }
+
+            // write history information about the current file version to the history object
+            Map<String, Object> histObj = new HashMap<String, Object>();
+            histObj.put("currentVersion", curVer);
+            histObj.put("history", hist);
+
+            try {
+                return new String[]{objectMapper.writeValueAsString(histObj), objectMapper.writeValueAsString(histData)};
+            } catch (JsonProcessingException e) {
+                e.printStackTrace();
+            }
+        }
+        return new String[]{"", ""};
+    }
+
+    // read a file
+    private String readFileToEnd(File file) {
+        String output = "";
+        try {
+            try (FileInputStream is = new FileInputStream(file)) {
+                Scanner scanner = new Scanner(is);  // read data from the source
+                scanner.useDelimiter("\\A");
+                while (scanner.hasNext()) {
+                    output += scanner.next();
+                }
+                scanner.close();
+            }
+        } catch (Exception e) {
+        }
+        return output;
+    }
+}

+ 27 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/managers/history/HistoryManager.java

@@ -0,0 +1,27 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.managers.history;
+
+
+import com.cpms.project.office.documentserver.models.filemodel.Document;
+
+// specify the history manager functions
+public interface HistoryManager {
+    String[] getHistory(Document document);  // get document history
+}

+ 121 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/managers/jwt/DefaultJwtManager.java

@@ -0,0 +1,121 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.managers.jwt;
+
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.commons.lang3.StringUtils;
+import org.primeframework.jwt.Signer;
+import org.primeframework.jwt.Verifier;
+import org.primeframework.jwt.domain.JWT;
+import org.primeframework.jwt.hmac.HMACSigner;
+import org.primeframework.jwt.hmac.HMACVerifier;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+@Component
+public class DefaultJwtManager implements JwtManager {
+    @Value("${files.docservice.secret}")
+    private String tokenSecret;
+    @Autowired
+    private ObjectMapper objectMapper;
+//    @Autowired
+//    private JSONParser parser;
+
+    // create document token
+    public String createToken(Map<String, Object> payloadClaims) {
+        try {
+            // build a HMAC signer using a SHA-256 hash
+            Signer signer = HMACSigner.newSHA256Signer(tokenSecret);
+            JWT jwt = new JWT();
+            for (String key : payloadClaims.keySet()) {  // run through all the keys from the payload
+                jwt.addClaim(key, payloadClaims.get(key));  // and write each claim to the jwt
+            }
+            return JWT.getEncoder().encode(jwt, signer);  // sign and encode the JWT to a JSON string representation
+        } catch (Exception e) {
+            return "";
+        }
+    }
+
+    // check if the token is enabled
+    public boolean tokenEnabled() {
+        return tokenSecret != null && !tokenSecret.isEmpty();
+    }
+
+    // read document token
+    public JWT readToken(String token) {
+        try {
+            // build a HMAC verifier using the token secret
+            Verifier verifier = HMACVerifier.newVerifier(tokenSecret);
+            return JWT.getDecoder().decode(token, verifier);  // verify and decode the encoded string JWT to a rich object
+        } catch (Exception exception) {
+            return null;
+        }
+    }
+
+    // parse the body
+    public JSONObject parseBody(String payload, String header) {
+        JSONObject body;
+        try {
+            body = JSON.parseObject(payload);  // get body parameters by parsing the payload
+        } catch (Exception ex) {
+            throw new RuntimeException("{\"error\":1,\"message\":\"JSON Parsing error\"}");
+        }
+        if (tokenEnabled()) {  // check if the token is enabled
+            String token = (String) body.get("token");  // get token from the body
+            if (token == null) {  // if token is empty
+                if (header != null && !StringUtils.isBlank(header)) {  // and the header is defined
+                    token = header.startsWith("Bearer ") ? header.substring(7) : header;  // get token from the header (it is placed after the Bearer prefix if it exists)
+                }
+            }
+            if (token == null || StringUtils.isBlank(token)) {
+                throw new RuntimeException("{\"error\":1,\"message\":\"JWT expected\"}");
+            }
+
+            JWT jwt = readToken(token);  // read token
+            if (jwt == null) {
+                throw new RuntimeException("{\"error\":1,\"message\":\"JWT validation failed\"}");
+            }
+            LinkedHashMap<String, Object> claims = null;
+            if (jwt.getObject("payload") != null) {  // get payload from the token and check if it is not empty
+                try {
+                    @SuppressWarnings("unchecked") LinkedHashMap<String, Object> jwtPayload =
+                            (LinkedHashMap<String, Object>)jwt.getObject("payload");
+
+                    claims = jwtPayload;
+                } catch (Exception ex) {
+                    throw new RuntimeException("{\"error\":1,\"message\":\"Wrong payload\"}");
+                }
+            }
+            try {
+                body =JSON.parseObject(JSON.toJSONString(claims));
+            } catch (Exception ex) {
+                throw new RuntimeException("{\"error\":1,\"message\":\"Parsing error\"}");
+            }
+        }
+
+        return body;
+    }
+}

+ 32 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/managers/jwt/JwtManager.java

@@ -0,0 +1,32 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.managers.jwt;
+
+import com.alibaba.fastjson2.JSONObject;
+import org.primeframework.jwt.domain.JWT;
+
+import java.util.Map;
+
+// specify the jwt manager functions
+public interface JwtManager {
+    boolean tokenEnabled();  // check if the token is enabled
+    String createToken(Map<String, Object> payloadClaims);  // create document token
+    JWT readToken(String token);  // read document token
+    JSONObject parseBody(String payload, String header);  // parse the body
+}

+ 68 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/managers/template/SampleTemplateManager.java

@@ -0,0 +1,68 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.managers.template;
+
+
+import com.cpms.project.office.documentserver.managers.document.DocumentManager;
+import com.cpms.project.office.documentserver.models.enums.DocumentType;
+import com.cpms.project.office.documentserver.models.filemodel.Template;
+import com.cpms.project.office.documentserver.storage.FileStoragePathBuilder;
+import com.cpms.project.office.documentserver.util.file.FileUtility;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Component
+@Qualifier("sample")
+public class SampleTemplateManager implements TemplateManager {
+    @Autowired
+    private DocumentManager documentManager;
+
+    @Autowired
+    private FileStoragePathBuilder storagePathBuilder;
+
+    @Autowired
+    private FileUtility fileUtility;
+
+    // create a template document with the specified name
+    public List<Template> createTemplates(String fileName){
+        List<Template> templates = new ArrayList<>();
+        templates.add(new Template("", "Blank", documentManager.getCreateUrl(fileName, false)));
+        templates.add(new Template(getTemplateImageUrl(fileName), "With sample content", documentManager.getCreateUrl(fileName, true)));
+
+        return templates;
+    }
+
+    // get the template image URL for the specified file
+    public String getTemplateImageUrl(String fileName){
+        DocumentType fileType = fileUtility.getDocumentType(fileName);  // get the file type
+        String path = storagePathBuilder.getServerUrl(true);  // get server URL
+        if(fileType.equals(DocumentType.word)){  // get URL to the template image for the word document type
+            return path + "/css/img/file_docx.svg";
+        } else if(fileType.equals(DocumentType.slide)){  // get URL to the template image for the slide document type
+            return path + "/css/img/file_pptx.svg";
+        } else if(fileType.equals(DocumentType.cell)){  // get URL to the template image for the cell document type
+            return path + "/css/img/file_xlsx.svg";
+        }
+        return path + "/css/img/file_docx.svg";  // get URL to the template image for the default document type (word)
+    }
+}

+ 30 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/managers/template/TemplateManager.java

@@ -0,0 +1,30 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.managers.template;
+
+
+import com.cpms.project.office.documentserver.models.filemodel.Template;
+
+import java.util.List;
+
+// specify the template manager functions
+public interface TemplateManager {
+    List<Template> createTemplates(String fileName);  // create a template document with the specified name
+    String getTemplateImageUrl(String fileName);  // get the template image URL for the specified file
+}

+ 24 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/AbstractModel.java

@@ -0,0 +1,24 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.models;
+
+import java.io.Serializable;
+
+public abstract class AbstractModel implements Serializable {
+}

+ 48 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/configurations/Customization.java

@@ -0,0 +1,48 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.models.configurations;
+
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+@Component
+@Scope("prototype")
+@Getter
+@Setter
+public class Customization {  // the parameters which allow to customize the editor interface so that it looked like your other products (if there are any) and change the presence or absence of the additional buttons, links, change logos and editor owner details
+    @Autowired
+    private Logo logo;  // the image file at the top left corner of the Editor header
+    @Autowired
+    private Goback goback;  // the settings for the Open file location menu button and upper right corner button
+    private Boolean autosave = false;  // if the Autosave menu option is enabled or disabled
+    private Boolean comments = true;  // if the Comments menu button is displayed or hidden
+    private Boolean compactHeader = false;  // if the additional action buttons are displayed in the upper part of the editor window header next to the logo (false) or in the toolbar (true)
+    private Boolean compactToolbar = false;  // if the top toolbar type displayed is full (false) or compact (true)
+    private Boolean compatibleFeatures = false;  // the use of functionality only compatible with the OOXML format
+    private Boolean forcesave = false;  // add the request for the forced file saving to the callback handler when saving the document within the document editing service
+    private Boolean help = true;  //  if the Help menu button is displayed or hidden
+    private Boolean hideRightMenu = false;  // if the right menu is displayed or hidden on first loading
+    private Boolean hideRulers = false;  // if the editor rulers are displayed or hidden
+    private Boolean submitForm = false;  // if the Submit form button is displayed or hidden
+    private Boolean about = true;
+    private Boolean feedback =true;
+}

+ 36 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/configurations/Embedded.java

@@ -0,0 +1,36 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.models.configurations;
+
+import com.cpms.project.office.documentserver.models.enums.ToolbarDocked;
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+@Component
+@Scope("prototype")
+@Getter
+@Setter
+public class Embedded {  // the parameters which allow to change the settings which define the behavior of the buttons in the embedded mode
+    private String embedUrl;  // the absolute URL to the document serving as a source file for the document embedded into the web page
+    private String saveUrl;  // the absolute URL that will allow the document to be saved onto the user personal computer
+    private String shareUrl;  // the absolute URL that will allow other users to share this document
+    private ToolbarDocked toolbarDocked;  // the place for the embedded viewer toolbar, can be either top or bottom
+}

+ 44 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/configurations/Goback.java

@@ -0,0 +1,44 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.models.configurations;
+
+import com.cpms.project.office.documentserver.storage.FileStoragePathBuilder;
+import lombok.Getter;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.PostConstruct;
+
+@Component
+@Scope("prototype")
+public class Goback {  // the settings for the Open file location menu button and upper right corner button
+
+    @Autowired
+    private FileStoragePathBuilder storagePathBuilder;
+
+
+    @Getter
+    private String url;  // the absolute URL to the website address which will be opened when clicking the Open file location menu button
+
+    @PostConstruct
+    private void init() {
+        this.url = storagePathBuilder.getServerUrl(false);
+    }
+}

+ 43 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/configurations/Info.java

@@ -0,0 +1,43 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.models.configurations;
+
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Locale;
+
+@Component
+@Scope("prototype")
+@Getter
+@Setter
+public class Info {  // the additional parameters for the document (document owner, folder where the document is stored, uploading date, sharing settings)
+    private String owner = "Me";  // the name of the document owner/creator
+    private Boolean favorite = null;  // the highlighting state of the Favorite icon
+    private String uploaded = getDate();  // the document uploading date
+
+    private String getDate() {
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd yyyy", Locale.US);
+        return simpleDateFormat.format(new Date());
+    }
+}

+ 38 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/configurations/Logo.java

@@ -0,0 +1,38 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.models.configurations;
+
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+@Component
+@Scope("prototype")
+@Getter
+@Setter
+public class Logo {  // the image file at the top left corner of the Editor header
+    @Value("${logo.image}")
+    private String image;  // the path to the image file used to show in common work mode
+    @Value("${logo.imageEmbedded}")
+    private String imageEmbedded;  // the path to the image file used to show in the embedded mode
+    @Value("${logo.url}")
+    private String url;  // the absolute URL which will be used when someone clicks the logo image
+}

+ 31 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/enums/Action.java

@@ -0,0 +1,31 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.models.enums;
+
+public enum Action {
+    edit,
+    review,
+    view,
+    embedded,
+    filter,
+    comment,
+    chat,
+    fillForms,
+    blockcontent
+}

+ 25 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/enums/DocumentType.java

@@ -0,0 +1,25 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.models.enums;
+
+public enum DocumentType {
+    word,
+    cell,
+    slide
+}

+ 24 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/enums/Mode.java

@@ -0,0 +1,24 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.models.enums;
+
+public enum Mode {
+    edit,
+    view
+}

+ 24 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/enums/ToolbarDocked.java

@@ -0,0 +1,24 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.models.enums;
+
+public enum ToolbarDocked {
+    top,
+    bottom
+}

+ 25 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/enums/Type.java

@@ -0,0 +1,25 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.models.enums;
+
+public enum Type {
+    desktop,
+    mobile,
+    embedded
+}

+ 41 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/filemodel/CommentGroup.java

@@ -0,0 +1,41 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.models.filemodel;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.cpms.project.office.documentserver.serializers.SerializerFilter;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class CommentGroup {
+    @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = SerializerFilter.class)
+    private List<String> view;  // define a list of groups whose comments the user can view
+    @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = SerializerFilter.class)
+    private List<String> edit;  // define a list of groups whose comments the user can edit
+    @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = SerializerFilter.class)
+    private List<String> remove;  // define a list of groups whose comments the user can remove
+}

+ 42 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/filemodel/Document.java

@@ -0,0 +1,42 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.models.filemodel;
+
+import com.cpms.project.office.documentserver.models.configurations.Info;
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+@Component
+@Scope("prototype")
+@Getter
+@Setter
+public class Document {  // the parameters pertaining to the document (title, url, file type, etc.)
+    @Autowired
+    private Info info;  // additional parameters for the document (document owner, folder where the document is stored, uploading date, sharing settings)
+    @Autowired
+    private Permission permissions;  // the permission for the document to be edited and downloaded or not
+    private String fileType;  //  the file type for the source viewed or edited document
+    private String key;  // the unique document identifier used by the service to recognize the document
+    private String title;  // the desired file name for the viewed or edited document which will also be used as file name when the document is downloaded
+    private String url;  // the absolute URL where the source viewed or edited document is stored
+
+}

+ 54 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/filemodel/EditorConfig.java

@@ -0,0 +1,54 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.models.filemodel;
+
+
+import com.cpms.project.office.documentserver.models.configurations.Customization;
+import com.cpms.project.office.documentserver.models.configurations.Embedded;
+import com.cpms.project.office.documentserver.models.enums.Mode;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.List;
+
+@Component
+@Scope("prototype")
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class EditorConfig {  // the parameters pertaining to the editor interface: opening mode (viewer or editor), interface language, additional buttons, etc.
+    private HashMap<String, Object> actionLink = null;  // the data which contains the information about the action in the document that will be scrolled to
+    private String callbackUrl;  // the absolute URL to the document storage service
+    private HashMap<String, Object> coEditing = null;
+    private String createUrl;  // the absolute URL of the document where it will be created and available after creation
+    @Autowired
+    private Customization customization;  // the parameters which allow to customize the editor interface so that it looked like your other products (if there are any) and change the presence or absence of the additional buttons, links, change logos and editor owner details
+    @Autowired
+    private Embedded embedded;  // the parameters which allow to change the settings which define the behavior of the buttons in the embedded mode
+    private String lang;  // the editor interface language
+    private Mode mode;  // the editor opening mode
+    @Autowired
+    private User user;  // the user currently viewing or editing the document
+    private List<Template> templates;  // the presence or absence of the templates in the <b>Create New...</b> menu option
+}

+ 41 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/filemodel/FileModel.java

@@ -0,0 +1,41 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.models.filemodel;
+
+import com.cpms.project.office.documentserver.models.enums.DocumentType;
+import com.cpms.project.office.documentserver.models.enums.Type;
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+@Component
+@Scope("prototype")
+@Getter
+@Setter
+public class FileModel {  // the file base parameters which include the platform type used, document display size (width and height) and type of the document opened
+    @Autowired
+    private Document document;  // the parameters pertaining to the document (title, url, file type, etc.)
+    private DocumentType documentType;  // the document type to be opened
+    @Autowired
+    private EditorConfig editorConfig;  //  the parameters pertaining to the editor interface: opening mode (viewer or editor), interface language, additional buttons, etc.
+    private String token;  // the encrypted signature added to the Document Server config
+    private Type type;  // the platform type used to access the document
+}

+ 53 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/filemodel/Permission.java

@@ -0,0 +1,53 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.models.filemodel;
+
+import com.cpms.project.office.documentserver.models.AbstractModel;
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Component
+@Scope("prototype")
+@Getter
+@Setter
+public class Permission extends AbstractModel {  // the permission for the document to be edited and downloaded or not
+    private Boolean comment = true;  // if the document can be commented or not
+    private Boolean copy = true;  // if the content can be copied to the clipboard or not
+    private Boolean download = true;  // if the document can be downloaded or only viewed or edited online
+    private Boolean edit = true;  // if the document can be edited or only viewed
+    private Boolean print = true;  // if the document can be printed or not
+    private Boolean fillForms = true;  // if the forms can be filled
+    private Boolean modifyFilter = true;  // if the filter can applied globally (true) affecting all the other users, or locally (false)
+    private Boolean modifyContentControl = true;  // if the content control settings can be changed
+    private Boolean review = true;  // if the document can be reviewed or not
+    private Boolean chat = true;  // if a chat can be used
+//    private List<String> reviewGroups;  // the groups whose changes the user can accept/reject
+//    private CommentGroup commentGroups = new CommentGroup();  //  the groups whose comments the user can edit, remove and/or view
+    private Map commentGroups = new HashMap();
+
+    public Permission(){
+        commentGroups.put("aaa", "bbb");
+    }
+//    private List<String> userInfoGroups;
+}

+ 14 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/filemodel/Template.java

@@ -0,0 +1,14 @@
+package com.cpms.project.office.documentserver.models.filemodel;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+@AllArgsConstructor
+public class Template {  // the document template parameters
+    private String image;  // the absolute URL to the image for template
+    private String title;  // the template title that will be displayed in the <b>Create New...</b> menu option
+    private String url;  // the absolute URL to the document where it will be created and available after creation
+}

+ 43 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/models/filemodel/User.java

@@ -0,0 +1,43 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.models.filemodel;
+
+import com.cpms.project.office.documentserver.models.AbstractModel;
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+@Component
+@Scope("prototype")
+@Getter
+@Setter
+public class User extends AbstractModel {
+    private String id;
+    private String name;
+    private String group;
+
+
+    // the user configuration parameters
+    public void configure(int id, String name, String group){
+        this.id = "uid-"+id;  // the user id
+        this.name = name;  // the user name
+        this.group = group;  // the group the user belongs to
+    }
+}

+ 23 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/serializers/FilterState.java

@@ -0,0 +1,23 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.serializers;
+
+public enum FilterState {
+    NULL
+}

+ 34 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/serializers/SerializerFilter.java

@@ -0,0 +1,34 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.serializers;
+
+import java.util.List;
+
+public class SerializerFilter {
+    @Override
+    public boolean equals(Object obj) {
+        if (obj instanceof List) {
+            if(((List<?>) obj).size() == 1 && ((List<?>) obj).get(0) == FilterState.NULL.toString()){
+                return true;
+            }
+            return false;
+        }
+        return false;
+    }
+}

+ 23 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/storage/FileStorageMutator.java

@@ -0,0 +1,23 @@
+package com.cpms.project.office.documentserver.storage;
+
+import org.springframework.core.io.Resource;
+
+import java.io.File;
+import java.io.InputStream;
+import java.nio.file.Path;
+
+// specify the file storage mutator functions
+public interface FileStorageMutator {
+    void createDirectory(Path path);  // create a new directory if it does not exist
+    boolean createFile(Path path, InputStream stream);  // create a new file if it does not exist
+    boolean deleteFile(String fileName);  // delete a file
+    boolean deleteFileHistory(String fileName);  // delete file history
+    String updateFile(String fileName, byte[] bytes);  // update a file
+    boolean writeToFile(String pathName, String payload);  // write the payload to the file
+    boolean moveFile(Path source, Path destination);  // move a file to the specified destination
+    Resource loadFileAsResource(String fileName);  // load file as a resource
+    Resource loadFileAsResourceHistory(String fileName,String version,String file);  // load file as a resource
+    File[] getStoredFiles();  // get a collection of all the stored files
+    void createMeta(String fileName, String uid, String uname);  // create the file meta information
+    boolean createOrUpdateFile(Path path, InputStream stream);  // create or update a file
+}

+ 12 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/storage/FileStoragePathBuilder.java

@@ -0,0 +1,12 @@
+package com.cpms.project.office.documentserver.storage;
+
+// specify the file storage path builder functions
+public interface FileStoragePathBuilder {
+    void configure(String address);  // create a new storage folder
+    String getStorageLocation();  // get the storage directory
+    String getFileLocation(String fileName);  // get the directory of the specified file
+    String getServerUrl(Boolean forDocumentServer);  // get the server URL
+    String getHistoryDir(String fileName);  // get the history directory
+    int getFileVersion(String historyPath, Boolean ifIndexPage);  // get the file version
+    String getForcesavePath(String fileName, Boolean create);  // get the path where all the forcely saved file versions are saved or create it
+}

+ 361 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/storage/LocalFileStorage.java

@@ -0,0 +1,361 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.storage;
+
+import com.alibaba.fastjson2.JSONObject;
+import com.cpms.project.office.documentserver.util.file.FileUtility;
+import lombok.Getter;
+import lombok.SneakyThrows;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Primary;
+import org.springframework.core.io.Resource;
+import org.springframework.core.io.UrlResource;
+import org.springframework.stereotype.Component;
+import org.springframework.util.FileSystemUtils;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.*;
+import java.net.InetAddress;
+import java.net.MalformedURLException;
+import java.net.URLDecoder;
+import java.net.UnknownHostException;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+//TODO: Refactoring
+@Component
+@Primary
+public class LocalFileStorage implements FileStorageMutator, FileStoragePathBuilder {
+
+    @Getter
+    private String storageAddress;
+
+    @Value("${files.storage.folder}")
+    private String storageFolder;
+
+    @Value("${files.docservice.url.example}")
+    private String docserviceUrlExample;
+
+    @Value("${files.docservice.history.postfix}")
+    private String historyPostfix;
+
+    @Autowired
+    private FileUtility fileUtility;
+    @Value("${deployment.host}")
+    private String deploymentHost;
+    @Value("${server.port}")
+    private String port;
+
+    @javax.annotation.Resource
+    private HttpServletRequest request;
+
+    /*
+        This Storage configuration method should be called whenever a new storage folder is required
+     */
+    public void configure(String address) {
+        this.storageAddress = address;
+        if(this.storageAddress == null){
+            try{
+                this.storageAddress = InetAddress.getLocalHost().getHostAddress();
+            } catch (UnknownHostException e){
+                this.storageAddress = "unknown_storage";
+            }
+        }
+        this.storageAddress.replaceAll("[^0-9a-zA-Z.=]", "_");
+        createDirectory(Paths.get(getStorageLocation()));
+    }
+
+    // get the storage directory
+    public String getStorageLocation(){
+        String serverPath = System.getProperty("user.dir");  // get the path to the server
+        String directory;  // create the storage directory
+        if (Paths.get(this.storageAddress).isAbsolute()) {
+            directory = this.storageAddress + File.separator;
+        } else {
+            directory = serverPath
+                    + File.separator + storageFolder
+                    + File.separator + this.storageAddress
+                    + File.separator;
+        }
+        if (!Files.exists(Paths.get(directory))) {
+            createDirectory(Paths.get(directory));
+        }
+
+        return directory;
+    }
+
+    // get the directory of the specified file
+    public String getFileLocation(String fileName){
+        if (fileName.contains(File.separator)) {
+            return getStorageLocation() + fileName;
+        }
+        return getStorageLocation() + fileUtility.getFileName(fileName);
+    }
+
+    // create a new directory if it does not exist
+    public void createDirectory(Path path){
+        if (Files.exists(path)) return;
+        try {
+            Files.createDirectories(path);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    // create a new file if it does not exist
+    public boolean createFile(Path path, InputStream stream){
+        if (Files.exists(path)){
+            return true;
+        }
+        try {
+            File file = Files.createFile(path).toFile();  // create a new file in the specified path
+            try (FileOutputStream out = new FileOutputStream(file))
+            {
+                int read;
+                final byte[] bytes = new byte[1024];
+                while ((read = stream.read(bytes)) != -1)
+                {
+                    out.write(bytes, 0, read);  // write bytes to the output stream
+                }
+                out.flush();  // force write data to the output stream that can be cached in the current thread
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return false;
+    }
+
+    // delete a file
+    public boolean deleteFile(String fileName){
+        try {
+            fileName = URLDecoder.decode(fileName, StandardCharsets.UTF_8.toString());  // decode a x-www-form-urlencoded string
+        } catch (UnsupportedEncodingException e) {
+            throw new RuntimeException(e);
+        }
+        if (StringUtils.isBlank(fileName)) return false;
+
+        String filenameWithoutExt = fileUtility.getFileNameWithoutExtension(fileName);  // get file name without extension
+
+        Path filePath = fileName.contains(File.separator) ? Paths.get(fileName) : Paths.get(getFileLocation(fileName));  // get the path to the file
+        Path filePathWithoutExt = fileName.contains(File.separator) ? Paths.get(filenameWithoutExt) : Paths.get(getStorageLocation() + filenameWithoutExt);  // get the path to the file without extension
+
+        boolean fileDeleted = FileSystemUtils.deleteRecursively(filePath.toFile());  // delete the specified file; for directories, recursively delete any nested directories or files as well
+        boolean fileWithoutExtDeleted = FileSystemUtils.deleteRecursively(filePathWithoutExt.toFile());  // delete the specified file without extension; for directories, recursively delete any nested directories or files as well
+
+        return fileDeleted && fileWithoutExtDeleted;
+    }
+
+    // delete file history
+    public boolean deleteFileHistory(String fileName) {
+        try {
+            fileName = URLDecoder.decode(fileName, StandardCharsets.UTF_8.toString());  // decode a x-www-form-urlencoded string
+        } catch (UnsupportedEncodingException e) {
+            throw new RuntimeException(e);
+        }
+        if (StringUtils.isBlank(fileName)) return false;
+
+        Path fileHistoryPath = Paths.get(getStorageLocation() + getHistoryDir(fileName));  // get the path to the history file
+        Path fileHistoryPathWithoutExt = Paths.get(getStorageLocation() + getHistoryDir(fileUtility.getFileNameWithoutExtension(fileName)));  // get the path to the history file without extension
+
+        boolean historyDeleted = FileSystemUtils.deleteRecursively(fileHistoryPath.toFile());  // delete the specified history file; for directories, recursively delete any nested directories or files as well
+        boolean historyWithoutExtDeleted = FileSystemUtils.deleteRecursively(fileHistoryPathWithoutExt.toFile());  // delete the specified history file without extension; for directories, recursively delete any nested directories or files as well
+
+        return historyDeleted || historyWithoutExtDeleted;
+    }
+
+    // update a file
+    public String updateFile(String fileName, byte[] bytes) {
+        Path path = fileUtility.generateFilepath(getStorageLocation(), fileName);  // generate the path to the specified file
+        try {
+            Files.write(path, bytes);  // write new information in the bytes format to the file
+            return path.getFileName().toString();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return "";
+    }
+
+    // move a file to the specified destination
+    public boolean moveFile(Path source, Path destination){
+        try {
+            Files.move(source, destination,
+                    new StandardCopyOption[]{StandardCopyOption.REPLACE_EXISTING});
+            return true;
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return false;
+    }
+
+    // write the payload to the file
+    public boolean writeToFile(String pathName, String payload){
+        try (FileWriter fw = new FileWriter(pathName)) {
+            fw.write(payload);
+            return true;
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return false;
+    }
+
+    // get the path where all the forcely saved file versions are saved or create it
+    public String getForcesavePath(String fileName, Boolean create) {
+        String directory = getStorageLocation();
+
+        Path path = Paths.get(directory);  // get the storage directory
+        if (!Files.exists(path)) return "";
+
+        directory = getFileLocation(fileName) + historyPostfix + File.separator;
+
+        path = Paths.get(directory);   // get the history file directory
+        if (!create && !Files.exists(path)) return "";
+
+        createDirectory(path);  // create a new directory where all the forcely saved file versions will be saved
+
+        directory = directory + fileName;
+        path = Paths.get(directory);
+        if (!create && !Files.exists(path)) {
+            return "";
+        }
+
+        return directory;
+    }
+
+    // load file as a resource
+    public Resource loadFileAsResource(String fileName){
+        String fileLocation = getForcesavePath(fileName, false);  // get the path where all the forcely saved file versions are saved
+        if (StringUtils.isBlank(fileLocation)){  // if file location is empty
+            fileLocation = getFileLocation(fileName);  // get it by the file name
+        }
+        try {
+            Path filePath = Paths.get(fileLocation);  // get the path to the file location
+            Resource resource = new UrlResource(filePath.toUri());  // convert the file path to URL
+            if(resource.exists()) return resource;
+        } catch (MalformedURLException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    public Resource loadFileAsResourceHistory(String fileName,String version,String file){
+
+        String fileLocation = getStorageLocation() + fileName + "-hist" + File.separator + version + File.separator + file;  // get it by the file name
+
+        try {
+            Path filePath = Paths.get(fileLocation);  // get the path to the file location
+            Resource resource = new UrlResource(filePath.toUri());  // convert the file path to URL
+            if(resource.exists()) return resource;
+        } catch (MalformedURLException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    // get a collection of all the stored files
+    public File[] getStoredFiles()
+    {
+        File file = new File(getStorageLocation());
+        return file.listFiles(pathname -> pathname.isFile());
+    }
+
+    @SneakyThrows
+    public void createMeta(String fileName, String uid, String uname) {  // create the file meta information
+        String histDir = getHistoryDir(getFileLocation(fileName));  // get the history directory
+
+        Path path = Paths.get(histDir);  // get the path to the history directory
+        createDirectory(path);  // create the history directory
+
+        // create the json object with the file metadata
+        JSONObject json = new JSONObject();
+        json.put("created", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));  // put the file creation date to the json object
+        json.put("id", uid);  // put the user ID to the json object
+        json.put("name", uname);  // put the user name to the json object
+
+        File meta = new File(histDir + File.separator + "createdInfo.json");  // create the createdInfo.json file with the file meta information
+        try (FileWriter writer = new FileWriter(meta)) {
+            writer.append(json.toJSONString());
+        } catch (IOException ex){
+            ex.printStackTrace();
+        }
+    }
+
+    // create or update a file
+    public boolean createOrUpdateFile(Path path, InputStream stream) {
+//        if (!Files.exists(path)){ // if the specified file does not exist
+//            return createFile(path, stream);  // create it in the specified directory
+//        } else {
+//            try {
+//                Files.write(path, stream.readAllBytes());  // otherwise, write new information in the bytes format to the file
+//                return true;
+//            } catch (IOException e) {
+//                e.printStackTrace();
+//            }
+//        }
+        return false;
+    }
+
+    // get the server URL
+    public String getServerUrl(Boolean forDocumentServer) {
+        if (forDocumentServer && !docserviceUrlExample.equals("")) {
+            return docserviceUrlExample;
+        } else {
+            return request.getScheme()+"://"+ deploymentHost + request.getContextPath();
+//            return request.getScheme()+"://"+ deploymentHost + ":" + port + request.getContextPath();
+//            return request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath();
+        }
+    }
+
+    // get the history directory
+    public String getHistoryDir(String path)
+    {
+        return path + historyPostfix;
+    }
+
+    // get the file version
+    public int getFileVersion(String historyPath, Boolean ifIndexPage)
+    {
+        Path path;
+        if (ifIndexPage) {  // if the start page is opened
+            path = Paths.get(getStorageLocation() + getHistoryDir(historyPath));  // get the storage directory and add the history directory to it
+        } else {
+            path = Paths.get(historyPath);  // otherwise, get the path to the history directory
+            if (!Files.exists(path)) return 1;  // if the history directory does not exist, then the file version is 1
+        }
+
+        try (Stream<Path> stream = Files.walk(path, 1)) {  // run through all the files in the history directory
+            return stream
+                    .filter(file -> Files.isDirectory(file))  // take only directories from the history folder
+                    .map(Path::getFileName)  // get file names
+                    .map(Path::toString)  // and convert them into strings
+                    .collect(Collectors.toSet()).size();  // convert stream into set and get its size which specifies the file version
+        } catch (IOException e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+}

+ 16 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/util/Misc.java

@@ -0,0 +1,16 @@
+package com.cpms.project.office.documentserver.util;
+
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Component
+public class Misc {
+    public String convertUserDescriptions(String username, List<String> description){  // cenvert user descriptions to the specified format
+        String result = "<div class=\"user-descr\"><b>"+username+"</b><br/><ul>"+description.
+                stream().map(text -> "<li>"+text+"</li>")
+                .collect(Collectors.joining()) + "</ul></div>";
+        return result;
+    }
+}

+ 54 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/util/SSLUtils.java

@@ -0,0 +1,54 @@
+package com.cpms.project.office.documentserver.util;
+
+import org.springframework.stereotype.Component;
+
+import javax.net.ssl.*;
+import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.X509Certificate;
+
+/**
+ * Disables and enables certificate and host-name checking in
+ * HttpsURLConnection, the default JVM implementation of the HTTPS/TLS protocol.
+ * Has no effect on implementations such as Apache Http Client, Ok Http.
+*/
+@Component
+public final class SSLUtils {
+
+    private final HostnameVerifier jvmHostnameVerifier = HttpsURLConnection.getDefaultHostnameVerifier();
+
+    private final HostnameVerifier trivialHostnameVerifier = new HostnameVerifier() {
+        public boolean verify(String hostname, SSLSession sslSession) {
+            return true;
+        }
+    };
+
+    private final TrustManager[] UNQUESTIONING_TRUST_MANAGER = new TrustManager[] { new X509TrustManager() {
+        public X509Certificate[] getAcceptedIssuers() {
+            return null;
+        }
+
+        public void checkClientTrusted(X509Certificate[] certs, String authType) {
+        }
+
+        public void checkServerTrusted(X509Certificate[] certs, String authType) {
+        }
+    } };
+
+    public void turnOffSslChecking() throws NoSuchAlgorithmException, KeyManagementException {
+        HttpsURLConnection.setDefaultHostnameVerifier(trivialHostnameVerifier);
+        // Install the all-trusting trust manager
+        SSLContext sc = SSLContext.getInstance("SSL");
+        sc.init(null, UNQUESTIONING_TRUST_MANAGER, null);
+        HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
+    }
+
+    public void turnOnSslChecking() throws KeyManagementException, NoSuchAlgorithmException {
+        HttpsURLConnection.setDefaultHostnameVerifier(jvmHostnameVerifier);
+        // Return it to the initial state (discovered by reflection, now hardcoded)
+        SSLContext sc = SSLContext.getInstance("SSL");
+        sc.init(null, null, null);
+        HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
+    }
+
+}

+ 197 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/util/file/DefaultFileUtility.java

@@ -0,0 +1,197 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.util.file;
+
+import com.cpms.project.office.documentserver.models.enums.DocumentType;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+@Component
+@Qualifier("default")
+public class DefaultFileUtility implements FileUtility {
+    @Value("${filesize-max}")
+    private String filesizeMax;
+
+    @Value("${files.docservice.viewed-docs}")
+    private String docserviceViewedDocs;
+
+    @Value("${files.docservice.edited-docs}")
+    private String docserviceEditedDocs;
+
+    @Value("${files.docservice.convert-docs}")
+    private String docserviceConvertDocs;
+
+    @Value("${files.docservice.fillforms-docs}")
+    private String docserviceFillDocs;
+
+    // document extensions
+    private List<String> ExtsDocument = Arrays.asList(
+                            ".doc", ".docx", ".docm",
+                            ".dot", ".dotx", ".dotm",
+                            ".odt", ".fodt", ".ott", ".rtf", ".txt",
+                            ".html", ".htm", ".mht", ".xml",
+                            ".pdf", ".djvu", ".fb2", ".epub", ".xps", ".oform");
+
+    // spreadsheet extensions
+    private List<String> ExtsSpreadsheet = Arrays.asList(
+                            ".xls", ".xlsx", ".xlsm", ".xlsb",
+                            ".xlt", ".xltx", ".xltm",
+                            ".ods", ".fods", ".ots", ".csv");
+
+    // presentation extensions
+    private List<String> ExtsPresentation = Arrays.asList(
+                            ".pps", ".ppsx", ".ppsm",
+                            ".ppt", ".pptx", ".pptm",
+                            ".pot", ".potx", ".potm",
+                            ".odp", ".fodp", ".otp");
+
+    // get the document type
+    public DocumentType getDocumentType(String fileName)
+    {
+        System.out.println("System.out.println(fileName);" + fileName);
+        String ext = getFileExtension(fileName).toLowerCase();  // get file extension from its name
+        System.out.println(ext);
+        // word type for document extensions
+        if (ExtsDocument.contains(ext))
+            return DocumentType.word;
+
+        // cell type for spreadsheet extensions
+        if (ExtsSpreadsheet.contains(ext))
+            return DocumentType.cell;
+
+        // slide type for presentation extensions
+        if (ExtsPresentation.contains(ext))
+            return DocumentType.slide;
+
+        // default file type is word
+        return DocumentType.word;
+    }
+
+    // get file name from its URL
+    public String getFileName(String url)
+    {
+        if (url == null) return "";
+
+        // get file name from the last part of URL
+        String fileName = url.substring(url.lastIndexOf('/') + 1);
+        fileName = fileName.split("\\?")[0];
+        return fileName;
+    }
+
+    // get file name without extension
+    public String getFileNameWithoutExtension(String url)
+    {
+        String fileName = getFileName(url);
+        if (fileName == null) return null;
+        String fileNameWithoutExt = fileName.substring(0, fileName.lastIndexOf('.'));
+        return fileNameWithoutExt;
+    }
+
+    // get file extension from URL
+    public String getFileExtension(String url)
+    {
+        String fileName = getFileName(url);
+        if (fileName == null) return null;
+        String fileExt = fileName.substring(fileName.lastIndexOf("."));
+        return fileExt.toLowerCase();
+    }
+
+    // get an editor internal extension
+    public String getInternalExtension(DocumentType type)
+    {
+        // .docx for word file type
+        if (type.equals(DocumentType.word))
+            return ".docx";
+
+        // .xlsx for cell file type
+        if (type.equals(DocumentType.cell))
+            return ".xlsx";
+
+        // .pptx for slide file type
+        if (type.equals(DocumentType.slide))
+            return ".pptx";
+
+        // the default file type is .docx
+        return ".docx";
+    }
+
+    public List<String> getFillExts()
+    {
+        return Arrays.asList(docserviceFillDocs.split("\\|"));
+    }
+
+    // get file extensions that can be viewed
+    public List<String> getViewedExts()
+    {
+        return Arrays.asList(docserviceViewedDocs.split("\\|"));
+    }
+
+    // get file extensions that can be edited
+    public List<String> getEditedExts()
+    {
+        return Arrays.asList(docserviceEditedDocs.split("\\|"));
+    }
+
+    // get file extensions that can be converted
+    public List<String> getConvertExts()
+    {
+        return Arrays.asList(docserviceConvertDocs.split("\\|"));
+    }
+
+    // get all the supported file extensions
+    public List<String> getFileExts() {
+        List<String> res = new ArrayList<>();
+
+        res.addAll(getViewedExts());
+        res.addAll(getEditedExts());
+        res.addAll(getConvertExts());
+        res.addAll(getFillExts());
+
+        return res;
+    }
+
+    // generate the file path from file directory and name
+    public Path generateFilepath(String directory, String fullFileName){
+        String fileName = getFileNameWithoutExtension(fullFileName);  // get file name without extension
+        String fileExtension = getFileExtension(fullFileName);  // get file extension
+        Path path = Paths.get(directory+fullFileName);  // get the path to the files with the specified name
+
+        for(int i = 1; Files.exists(path); i++){  // run through all the files with the specified name
+            fileName = getFileNameWithoutExtension(fullFileName) + "("+i+")";  // get a name of each file without extension and add an index to it
+            path = Paths.get(directory+fileName+fileExtension);  // create a new path for this file with the correct name and extension
+        }
+
+        path = Paths.get(directory+fileName+fileExtension);
+        return path;
+    }
+
+    // get maximum file size
+    public long getMaxFileSize(){
+        long size = Long.parseLong(filesizeMax);
+        return size > 0 ? size : 5 * 1024 * 1024;
+    }
+}

+ 41 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/util/file/FileUtility.java

@@ -0,0 +1,41 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.util.file;
+
+
+import com.cpms.project.office.documentserver.models.enums.DocumentType;
+
+import java.nio.file.Path;
+import java.util.List;
+
+// specify the file utility functions
+public interface FileUtility {
+    DocumentType getDocumentType(String fileName);  // get the document type
+    String getFileName(String url);  // get file name from its URL
+    String getFileNameWithoutExtension(String url);  // get file name without extension
+    String getFileExtension(String url);  // get file extension from URL
+    String getInternalExtension(DocumentType type);  // get an editor internal extension
+    List<String> getFileExts();  // get all the supported file extensions
+    List<String> getFillExts();  // get file extensions that can be filled
+    List<String> getViewedExts();  // get file extensions that can be viewed
+    List<String> getEditedExts();  // get file extensions that can be edited
+    List<String> getConvertExts();  // get file extensions that can be converted
+    Path generateFilepath(String directory, String fullFileName);  // generate the file path from file directory and name
+    long getMaxFileSize();  // get maximum file size
+}

+ 274 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/util/service/DefaultServiceConverter.java

@@ -0,0 +1,274 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.util.service;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.cpms.project.office.documentserver.managers.jwt.JwtManager;
+import com.cpms.project.office.documentserver.util.file.FileUtility;
+import com.cpms.project.office.dto.Convert;
+import lombok.SneakyThrows;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.PostConstruct;
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.net.URL;
+import java.nio.charset.StandardCharsets;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+//TODO: Refactoring
+@Component
+public class DefaultServiceConverter implements ServiceConverter
+{
+    @Value("${files.docservice.header}")
+    private String documentJwtHeader;
+    @Value("${files.docservice.url.site}")
+    private String docServiceUrl;
+    @Value("${files.docservice.url.converter}")
+    private String docServiceUrlConverter;
+    @Value("${files.docservice.timeout}")
+    private String docserviceTimeout;
+    private int convertTimeout = 120000;
+
+    @Autowired
+    private JwtManager jwtManager;
+    @Autowired
+    private FileUtility fileUtility;
+//    @Autowired
+//    private JSONParser parser;
+    @Autowired
+    private ObjectMapper objectMapper;
+
+    @PostConstruct
+    public void init(){
+        int timeout = Integer.parseInt(docserviceTimeout);  // parse the dcoument service timeout value
+        if (timeout > 0) convertTimeout = timeout;
+    }
+
+    @SneakyThrows
+    private String postToServer(Convert body, String headerToken){  // send the POST request to the server
+        String bodyString = objectMapper.writeValueAsString(body);  // write the body request to the object mapper in the string format
+        URL url = null;
+        java.net.HttpURLConnection connection = null;
+        InputStream response = null;
+        String jsonString = null;
+
+        byte[] bodyByte = bodyString.getBytes(StandardCharsets.UTF_8);  // convert body string into bytes
+        try{
+            // set the request parameters
+            url = new URL(docServiceUrl+docServiceUrlConverter);
+            connection = (java.net.HttpURLConnection) url.openConnection();
+            connection.setRequestMethod("POST");
+            connection.setDoOutput(true);
+            connection.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
+            connection.setFixedLengthStreamingMode(bodyByte.length);
+            connection.setRequestProperty("Accept", "application/json");
+            connection.setConnectTimeout(convertTimeout);
+
+            // check if the token is enabled
+            if (jwtManager.tokenEnabled())
+            {
+                // set the JWT header to the request
+                connection.setRequestProperty(StringUtils.isBlank(documentJwtHeader) ?
+                        "Authorization" : documentJwtHeader, "Bearer " + headerToken);
+            }
+
+            connection.connect();
+            try (OutputStream os = connection.getOutputStream()) {
+                os.write(bodyByte);  // write bytes to the output stream
+                os.flush();  // force write data to the output stream that can be cached in the current thread
+            }
+
+            response = connection.getInputStream();  // get the input stream
+            jsonString = convertStreamToString(response);  // convert the response stream into a string
+        } finally {
+            connection.disconnect();
+            return jsonString;
+        }
+    }
+
+    // get the URL to the converted file
+    public String getConvertedUri(String documentUri, String fromExtension,
+                                  String toExtension, String documentRevisionId,
+                                  String filePass, Boolean isAsync, String lang)
+    {
+        // check if the fromExtension parameter is defined; if not, get it from the document url
+        fromExtension = fromExtension == null || fromExtension.isEmpty() ?
+                fileUtility.getFileExtension(documentUri) : fromExtension;
+
+        // check if the file name parameter is defined; if not, get random uuid for this file
+        String title = fileUtility.getFileName(documentUri);
+        title = title == null || title.isEmpty() ? UUID.randomUUID().toString() : title;
+
+        documentRevisionId = documentRevisionId == null || documentRevisionId.isEmpty() ? documentUri : documentRevisionId;
+
+        documentRevisionId = generateRevisionId(documentRevisionId);  // create document token
+
+        // write all the necessary parameters to the body object
+        Convert body = new Convert();
+        body.setLang(lang);
+        body.setUrl(documentUri);
+        body.setOutputtype(toExtension.replace(".", ""));
+        body.setFiletype(fromExtension.replace(".", ""));
+        body.setTitle(title);
+        body.setKey(documentRevisionId);
+        body.setFilePass(filePass);
+        if (isAsync)
+            body.setAsync(true);
+
+        String headerToken = "";
+        if (jwtManager.tokenEnabled())
+        {
+            HashMap<String, Object> map = new HashMap<String, Object>();
+            map.put("region", lang);
+            map.put("url", body.getUrl());
+            map.put("outputtype", body.getOutputtype());
+            map.put("filetype", body.getFiletype());
+            map.put("title", body.getTitle());
+            map.put("key", body.getKey());
+            map.put("password", body.getFilePass());
+            if (isAsync)
+                map.put("async", body.getAsync());
+
+            // add token to the body if it is enabled
+            String token = jwtManager.createToken(map);
+            body.setToken(token);
+
+            Map<String, Object> payloadMap = new HashMap<String, Object>();
+            payloadMap.put("payload", map);  // create payload object
+            headerToken = jwtManager.createToken(payloadMap);  // create header token
+        }
+
+        String jsonString = postToServer(body, headerToken);
+
+        return getResponseUri(jsonString);
+    }
+
+    // generate document key
+    public String generateRevisionId(String expectedKey)
+    {
+        if (expectedKey.length() > 20)  // if the expected key length is greater than 20
+            expectedKey = Integer.toString(expectedKey.hashCode());  // the expected key is hashed and a fixed length value is stored in the string format
+
+        String key = expectedKey.replace("[^0-9-.a-zA-Z_=]", "_");
+
+        return key.substring(0, Math.min(key.length(), 20));  // the resulting key length is 20 or less
+    }
+
+    //TODO: Replace with a registry (callbacks package for reference)
+    private void processConvertServiceResponceError(int errorCode)  // create an error message for an error code
+    {
+        String errorMessage = "";
+        String errorMessageTemplate = "Error occurred in the ConvertService: ";
+
+        // add the error message to the error message template depending on the error code
+        switch (errorCode)
+        {
+            case -8:
+                errorMessage = errorMessageTemplate + "Error document VKey";
+                break;
+            case -7:
+                errorMessage = errorMessageTemplate + "Error document request";
+                break;
+            case -6:
+                errorMessage = errorMessageTemplate + "Error database";
+                break;
+            case -5:
+                errorMessage = errorMessageTemplate + "Error unexpected guid";
+                break;
+            case -4:
+                errorMessage = errorMessageTemplate + "Error download error";
+                break;
+            case -3:
+                errorMessage = errorMessageTemplate + "Error convertation error";
+                break;
+            case -2:
+                errorMessage = errorMessageTemplate + "Error convertation timeout";
+                break;
+            case -1:
+                errorMessage = errorMessageTemplate + "Error convertation unknown";
+                break;
+            case 0:  // if the error code is equal to 0, the error message is empty
+                break;
+            default:
+                errorMessage = "ErrorCode = " + errorCode;  // default value for the error message
+                break;
+        }
+
+        throw new RuntimeException(errorMessage);
+    }
+
+    @SneakyThrows
+    private String getResponseUri(String jsonString)  // get the response URL
+    {
+//        JSONObject jsonObj = convertStringToJSON(jsonString);
+        JSONObject jsonObj = JSON.parseObject(jsonString);
+        Object error = jsonObj.get("error");
+        if (error != null)  // if an error occurs
+            processConvertServiceResponceError(Math.toIntExact((long)error));  // then get an error message
+
+        // check if the conversion is completed and save the result to a variable
+        Boolean isEndConvert = (Boolean) jsonObj.get("endConvert");
+
+        Long resultPercent = 0l;
+        String responseUri = null;
+
+        if (isEndConvert)  // if the conversion is completed
+        {
+            resultPercent = 100l;
+            responseUri = (String) jsonObj.get("fileUrl");  // get the file URL
+        }
+        else  // if the conversion isn't completed
+        {
+            resultPercent = (Long) jsonObj.get("percent");
+            resultPercent = resultPercent >= 100l ? 99l : resultPercent;  // get the percentage value of the conversion process
+        }
+
+        return resultPercent >= 100l ? responseUri : "";
+    }
+
+    @SneakyThrows
+    public String convertStreamToString(InputStream stream)  // convert stream to string
+    {
+        InputStreamReader inputStreamReader = new InputStreamReader(stream);  // create an object to get incoming stream
+        StringBuilder stringBuilder = new StringBuilder();  // create a string builder object
+        BufferedReader bufferedReader = new BufferedReader(inputStreamReader);  // create an object to read incoming streams
+        String line = bufferedReader.readLine();  // get incoming streams by lines
+
+        while (line != null)
+        {
+            stringBuilder.append(line);  // concatenate strings using the string builder
+            line = bufferedReader.readLine();
+        }
+
+        String result = stringBuilder.toString();
+
+        return result;
+    }
+
+}

+ 31 - 0
cpms-admin/src/main/java/com/cpms/project/office/documentserver/util/service/ServiceConverter.java

@@ -0,0 +1,31 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.documentserver.util.service;
+
+import java.io.InputStream;
+
+
+// specify the converter service functions
+public interface ServiceConverter {
+    String getConvertedUri(String documentUri, String fromExtension,  // get the URL to the converted file
+                                  String toExtension, String documentRevisionId,
+                                  String filePass, Boolean isAsync, String lang);
+    String generateRevisionId(String expectedKey);  // generate document key
+    String convertStreamToString(InputStream stream);  // convert stream to string
+}

+ 33 - 0
cpms-admin/src/main/java/com/cpms/project/office/dto/Action.java

@@ -0,0 +1,33 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+public class Action {
+    private String userid;
+    private com.cpms.project.office.documentserver.models.enums.Action type;
+}

+ 13 - 0
cpms-admin/src/main/java/com/cpms/project/office/dto/ChangesHistory.java

@@ -0,0 +1,13 @@
+package com.cpms.project.office.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class ChangesHistory {
+    private String created;
+    private ChangesUser user;
+}

+ 13 - 0
cpms-admin/src/main/java/com/cpms/project/office/dto/ChangesUser.java

@@ -0,0 +1,13 @@
+package com.cpms.project.office.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class ChangesUser {
+    private String id;
+    private String name;
+}

+ 40 - 0
cpms-admin/src/main/java/com/cpms/project/office/dto/Convert.java

@@ -0,0 +1,40 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+public class Convert {
+    private String url;
+    private String outputtype;
+    private String filetype;
+    private String title;
+    private String key;
+    private String filePass;
+    private Boolean async;
+    private String token;
+    private String lang;
+}

+ 36 - 0
cpms-admin/src/main/java/com/cpms/project/office/dto/Converter.java

@@ -0,0 +1,36 @@
+/**
+ *
+ * (c) Copyright Ascensio System SIA 2021
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.cpms.project.office.dto;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+@Getter
+@Setter
+@NoArgsConstructor
+public class Converter {
+    @JsonProperty("filename")
+    private String fileName;
+    @JsonProperty("filePass")
+    private String filePass;
+    @JsonProperty("lang")
+    private String lang;
+}

Some files were not shown because too many files changed in this diff