Compare commits
42 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
471441918c | ||
90599a8f9a | |||
|
bc38b6767e | ||
|
ac865eafc7 | ||
49f330b35a | |||
|
dca0dcb298 | ||
|
596a721894 | ||
|
045d857ae2 | ||
|
6c53e4c9ae | ||
|
d461048c74 | ||
|
d3ec27eb1b | ||
|
1523a4db4f | ||
|
b69682c2d0 | ||
|
5607c957fb | ||
|
7131d744a4 | ||
|
f90c8e0c6f | ||
|
3d679da3c3 | ||
|
6f70344177 | ||
|
3b86d79ea0 | ||
|
c57babe9ce | ||
|
801ad634dc | ||
|
df7e623f4f | ||
|
e690285338 | ||
|
aa5178ac92 | ||
|
a869af50be | ||
|
242fa6736e | ||
|
ca62286f98 | ||
|
cfa8f461fa | ||
|
a9324dffcf | ||
|
a719d62deb | ||
|
29ce3e1ce9 | ||
|
a2b843bdf3 | ||
|
2e06c76916 | ||
|
10ee4fbc4d | ||
|
7820d4907f | ||
|
2561546ac2 | ||
|
b6a66db6cb | ||
|
9331b57b58 | ||
|
d732771032 | ||
|
f0a14bcd3c | ||
|
f1b84cb823 | ||
|
a272e06018 |
@ -85,6 +85,18 @@
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.documents4j</groupId>
|
||||
<artifactId>documents4j-local</artifactId>
|
||||
<version>1.0.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.documents4j</groupId>
|
||||
<artifactId>documents4j-transformer-msoffice-word</artifactId>
|
||||
<version>1.0.3</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -1,18 +1,5 @@
|
||||
package com.rzdata.web.controller.common;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.rzdata.common.config.JaConfig;
|
||||
import com.rzdata.common.constant.Constants;
|
||||
import com.rzdata.common.core.domain.AjaxResult;
|
||||
@ -20,6 +7,27 @@ import com.rzdata.common.utils.StringUtils;
|
||||
import com.rzdata.common.utils.file.FileUploadUtils;
|
||||
import com.rzdata.common.utils.file.FileUtils;
|
||||
import com.rzdata.framework.config.ServerConfig;
|
||||
import com.rzdata.web.domain.Attachment;
|
||||
import com.rzdata.web.domain.FileOperationRequest;
|
||||
import com.rzdata.web.service.IAttachmentService;
|
||||
import com.rzdata.web.service.impl.AttachmentServiceImpl;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 通用请求处理
|
||||
@ -34,9 +42,13 @@ public class CommonController
|
||||
|
||||
@Autowired
|
||||
private ServerConfig serverConfig;
|
||||
@Autowired
|
||||
private IAttachmentService attachmentService;
|
||||
|
||||
|
||||
private static final String FILE_DELIMETER = ",";
|
||||
|
||||
|
||||
/**
|
||||
* 通用下载请求
|
||||
*
|
||||
@ -84,7 +96,8 @@ public class CommonController
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("url", url);
|
||||
ajax.put("fileName", fileName);
|
||||
ajax.put("filePath", fileName);
|
||||
ajax.put("suffixType", FileUploadUtils.extractSuffix(fileName));
|
||||
ajax.put("newFileName", FileUtils.getName(fileName));
|
||||
ajax.put("originalFilename", file.getOriginalFilename());
|
||||
return ajax;
|
||||
@ -160,4 +173,97 @@ public class CommonController
|
||||
log.error("下载文件失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 预览下载
|
||||
* txt、pdf、word(doc、docx格式)
|
||||
*/
|
||||
@PostMapping("/preview/download")
|
||||
public ResponseEntity<byte[]> resourceDownload(@RequestBody Attachment attachment)
|
||||
{
|
||||
byte[] bytes = attachmentService.loadFileAsBytes(attachment);
|
||||
return ResponseEntity.ok()
|
||||
.contentType(MediaType.parseMediaType("application/octet-stream"))
|
||||
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + attachment.getFileOldName() + "\"")
|
||||
.body(bytes);
|
||||
}
|
||||
|
||||
@PostMapping("/initUpload")
|
||||
public ResponseEntity<Map<String, String>> initUpload(@RequestParam("fileName") String fileName) {
|
||||
// 上传文件路径
|
||||
String filePath = JaConfig.getUploadPath();
|
||||
String uploadId = UUID.randomUUID().toString();
|
||||
// 创建临时目录用于存放分片文件
|
||||
new File(filePath + "/" + uploadId).mkdirs();
|
||||
Map<String, String> response = new HashMap<>();
|
||||
response.put("uploadId", uploadId);
|
||||
return ResponseEntity.ok(response);
|
||||
}
|
||||
|
||||
@PostMapping("/uploadChunk")
|
||||
public ResponseEntity<Map<String, String>> uploadChunk(
|
||||
@RequestParam("chunkFile") MultipartFile chunkFile,
|
||||
@RequestParam("uploadId") String uploadId,
|
||||
@RequestParam("chunkId") int chunkId) {
|
||||
String filePath = JaConfig.getUploadPath();
|
||||
String chunkFilePath = filePath + "/" + uploadId + "/" + chunkId;
|
||||
try {
|
||||
chunkFile.transferTo(new File(chunkFilePath));
|
||||
Map<String, String> response = new HashMap<>();
|
||||
response.put("status", "200");
|
||||
return ResponseEntity.ok(response);
|
||||
} catch (IOException e) {
|
||||
log.error("CommonController-->uploadChunk----e###", e);
|
||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/mergeFile")
|
||||
public ResponseEntity<Map<String, String>> mergeFile(@RequestParam("uploadId") String uploadId,
|
||||
@RequestParam("fileName") String fileName) {
|
||||
String filePath = JaConfig.getUploadPath();
|
||||
//String finalFilePath = FileUploadUtils.generateMergedFilePath(filePath, fileName);
|
||||
String fileNamePath = FileUploadUtils.getFilePath(filePath, fileName);
|
||||
String finalFilePath = filePath + fileNamePath.replace("profile/upload/", "") ;
|
||||
File dir = new File(filePath + "/" + uploadId);
|
||||
File[] chunkFiles = dir.listFiles();
|
||||
|
||||
|
||||
File desc = new File(finalFilePath);
|
||||
if (!desc.exists())
|
||||
{
|
||||
if (!desc.getParentFile().exists())
|
||||
{
|
||||
desc.getParentFile().mkdirs();
|
||||
}
|
||||
}
|
||||
|
||||
// 按文件名(即chunkId)排序
|
||||
Arrays.sort(chunkFiles, Comparator.comparingInt(f -> Integer.parseInt(f.getName())));
|
||||
|
||||
try (FileOutputStream fos = new FileOutputStream(finalFilePath)) {
|
||||
for (File chunk : chunkFiles) {
|
||||
Files.copy(chunk.toPath(), fos);
|
||||
}
|
||||
|
||||
Map<String, String> response = new HashMap<>();
|
||||
String url = serverConfig.getUrl() + fileNamePath;
|
||||
response.put("url", url);
|
||||
response.put("filePath", fileNamePath);
|
||||
response.put("suffixType", FileUploadUtils.extractSuffix(fileNamePath));
|
||||
response.put("newFileName", FileUtils.getName(fileNamePath));
|
||||
response.put("originalFilename", fileName);
|
||||
return ResponseEntity.ok(response);
|
||||
} catch (IOException e) {
|
||||
log.error("CommonController-->uploadChunk----e###", e);
|
||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
|
||||
} finally {
|
||||
// 清理临时文件
|
||||
Arrays.stream(chunkFiles).forEach(File::delete);
|
||||
dir.delete();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,115 @@
|
||||
package com.rzdata.web.controller.document;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.rzdata.common.core.domain.DocumentCategory;
|
||||
import com.rzdata.web.service.IDocumentCategoryService;
|
||||
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.rzdata.common.annotation.Log;
|
||||
import com.rzdata.common.core.controller.BaseController;
|
||||
import com.rzdata.common.core.domain.AjaxResult;
|
||||
import com.rzdata.common.enums.BusinessType;
|
||||
import com.rzdata.common.utils.poi.ExcelUtil;
|
||||
import com.rzdata.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 文档资源分类管理Controller
|
||||
*
|
||||
* @author spongepan
|
||||
* @date 2024-08-27
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/category")
|
||||
public class DocumentCategoryController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDocumentCategoryService documentCategoryService;
|
||||
|
||||
/**
|
||||
* 查询文档资源分类管理列表
|
||||
*/
|
||||
//@PreAuthorize("@ss.hasPermi('system:category:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DocumentCategory documentCategory)
|
||||
{
|
||||
startPage();
|
||||
List<DocumentCategory> list = documentCategoryService.selectDocumentCategoryList(documentCategory);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出文档资源分类管理列表
|
||||
*/
|
||||
//@PreAuthorize("@ss.hasPermi('system:category:export')")
|
||||
@Log(title = "文档资源分类管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DocumentCategory documentCategory)
|
||||
{
|
||||
List<DocumentCategory> list = documentCategoryService.selectDocumentCategoryList(documentCategory);
|
||||
ExcelUtil<DocumentCategory> util = new ExcelUtil<DocumentCategory>(DocumentCategory.class);
|
||||
util.exportExcel(response, list, "文档资源分类管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文档资源分类管理详细信息
|
||||
*/
|
||||
//@PreAuthorize("@ss.hasPermi('system:category:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(documentCategoryService.selectDocumentCategoryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文档资源分类管理
|
||||
*/
|
||||
//@PreAuthorize("@ss.hasPermi('system:category:add')")
|
||||
@Log(title = "文档资源分类管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DocumentCategory documentCategory)
|
||||
{
|
||||
return toAjax(documentCategoryService.insertDocumentCategory(documentCategory));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文档资源分类管理
|
||||
*/
|
||||
//@PreAuthorize("@ss.hasPermi('system:category:edit')")
|
||||
@Log(title = "文档资源分类管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DocumentCategory documentCategory)
|
||||
{
|
||||
return toAjax(documentCategoryService.updateDocumentCategory(documentCategory));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文档资源分类管理
|
||||
*/
|
||||
//@PreAuthorize("@ss.hasPermi('system:category:remove')")
|
||||
@Log(title = "文档资源分类管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(documentCategoryService.deleteDocumentCategoryByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取文档分类树列表
|
||||
*/
|
||||
@GetMapping("/documentTree")
|
||||
public AjaxResult deptTree(DocumentCategory documentCategory)
|
||||
{
|
||||
return success(documentCategoryService.selectDocumentTreeList(documentCategory));
|
||||
}
|
||||
}
|
@ -32,6 +32,7 @@ public class DocumentController extends BaseController
|
||||
/**
|
||||
* 查询【文档资源信息】列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('document:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Document Document)
|
||||
{
|
||||
@ -44,12 +45,13 @@ public class DocumentController extends BaseController
|
||||
* 导出【文档资源信息】列表
|
||||
*/
|
||||
@Log(title = "【文档资源信息】", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('document:list')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Document Document)
|
||||
public void export(HttpServletResponse response, Document document)
|
||||
{
|
||||
List<Document> list = documentService.selectDocumentList(Document);
|
||||
List<Document> list = documentService.selectDocumentList(document);
|
||||
ExcelUtil<Document> util = new ExcelUtil<Document>(Document.class);
|
||||
util.exportExcel(response, list, "【文档资源信息】数据");
|
||||
util.exportExcel(response, list, "【文档资源信息】数据", document.getExcludeFields());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -65,6 +67,7 @@ public class DocumentController extends BaseController
|
||||
* 新增【文档资源信息】
|
||||
*/
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
|
||||
@PreAuthorize("@ss.hasPermi('document:add')")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Document Document)
|
||||
{
|
||||
@ -79,6 +82,7 @@ public class DocumentController extends BaseController
|
||||
* 修改【文档资源信息】
|
||||
*/
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
|
||||
@PreAuthorize("@ss.hasPermi('document:edit')")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Document Document)
|
||||
{
|
||||
@ -88,10 +92,40 @@ public class DocumentController extends BaseController
|
||||
/**
|
||||
* 删除【文档资源信息】
|
||||
*/
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
|
||||
@Log(title = "【逻辑删除-文档资源信息】", businessType = BusinessType.DELETE)
|
||||
@PreAuthorize("@ss.hasPermi('document:remove')")
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(documentService.deleteDocumentByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布文档
|
||||
*/
|
||||
@Log(title = "【发布逻辑】", businessType = BusinessType.UPDATE)
|
||||
@PreAuthorize("@ss.hasPermi('document:push')")
|
||||
@PutMapping("/pushDoc/{ids}")
|
||||
public AjaxResult pushDoc(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(documentService.pushDoc(ids));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 文档统计,涉及文档类别统计、文档来源统计
|
||||
*/
|
||||
@GetMapping("/statistics")
|
||||
public AjaxResult statistics()
|
||||
{
|
||||
return AjaxResult.success(documentService.statistics());
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/export/word/list")
|
||||
public AjaxResult exportWordList(Document Document)
|
||||
{
|
||||
List<Document> list = documentService.selectAllList(Document);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
}
|
||||
|
@ -43,6 +43,15 @@ public class SysDictTypeController extends BaseController
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/bizlist")
|
||||
public TableDataInfo bizlist(SysDictType dictType)
|
||||
{
|
||||
startPage();
|
||||
List<SysDictType> list = dictTypeService.selectBizDictTypeList(dictType);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:export')")
|
||||
@PostMapping("/export")
|
||||
|
@ -2,6 +2,9 @@ package com.rzdata.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.rzdata.web.domain.TzMessage;
|
||||
import com.rzdata.web.service.ITzMessageService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@ -34,6 +37,10 @@ public class SysLoginController
|
||||
@Autowired
|
||||
private SysPermissionService permissionService;
|
||||
|
||||
/** 消息中心 **/
|
||||
@Autowired
|
||||
private ITzMessageService tzMessageService;
|
||||
|
||||
/**
|
||||
* 登录方法
|
||||
*
|
||||
@ -64,9 +71,14 @@ public class SysLoginController
|
||||
Set<String> roles = permissionService.getRolePermission(user);
|
||||
// 权限集合
|
||||
Set<String> permissions = permissionService.getMenuPermission(user);
|
||||
|
||||
/** 未读消息 **/
|
||||
int unMsgNumber = tzMessageService.selectTzMessageByUserCount(String.valueOf(user.getUserId()));
|
||||
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("user", user);
|
||||
ajax.put("roles", roles);
|
||||
ajax.put("unMsgNumber", unMsgNumber);
|
||||
ajax.put("permissions", permissions);
|
||||
return ajax;
|
||||
}
|
||||
|
@ -132,8 +132,8 @@ public class SysRoleController extends BaseController
|
||||
LoginUser loginUser = getLoginUser();
|
||||
if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin())
|
||||
{
|
||||
loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser()));
|
||||
loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName()));
|
||||
loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser()));
|
||||
tokenService.setLoginUser(loginUser);
|
||||
}
|
||||
return success();
|
||||
|
@ -55,7 +55,6 @@ public class SysUserController extends BaseController
|
||||
/**
|
||||
* 获取用户列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysUser user)
|
||||
{
|
||||
@ -246,7 +245,7 @@ public class SysUserController extends BaseController
|
||||
/**
|
||||
* 获取部门树列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||
//@PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||
@GetMapping("/deptTree")
|
||||
public AjaxResult deptTree(SysDept dept)
|
||||
{
|
||||
|
@ -0,0 +1,99 @@
|
||||
package com.rzdata.web.controller.tool;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.rzdata.web.domain.Attachment;
|
||||
import com.rzdata.web.service.IAttachmentService;
|
||||
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.rzdata.common.annotation.Log;
|
||||
import com.rzdata.common.core.controller.BaseController;
|
||||
import com.rzdata.common.core.domain.AjaxResult;
|
||||
import com.rzdata.common.enums.BusinessType;
|
||||
import com.rzdata.common.utils.poi.ExcelUtil;
|
||||
import com.rzdata.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 附件Controller
|
||||
*
|
||||
* @author panchichun
|
||||
* @date 2024-08-28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/attachment")
|
||||
public class AttachmentController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IAttachmentService attachmentService;
|
||||
|
||||
/**
|
||||
* 查询附件列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Attachment attachment)
|
||||
{
|
||||
startPage();
|
||||
List<Attachment> list = attachmentService.selectAttachmentList(attachment);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出附件列表
|
||||
*/
|
||||
@Log(title = "附件", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Attachment attachment)
|
||||
{
|
||||
List<Attachment> list = attachmentService.selectAttachmentList(attachment);
|
||||
ExcelUtil<Attachment> util = new ExcelUtil<Attachment>(Attachment.class);
|
||||
util.exportExcel(response, list, "附件数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取附件详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(attachmentService.selectAttachmentById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增附件
|
||||
*/
|
||||
@Log(title = "附件", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Attachment attachment)
|
||||
{
|
||||
return toAjax(attachmentService.insertAttachment(attachment));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改附件
|
||||
*/
|
||||
@Log(title = "附件", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Attachment attachment)
|
||||
{
|
||||
return toAjax(attachmentService.updateAttachment(attachment));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除附件
|
||||
*/
|
||||
@Log(title = "附件", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(attachmentService.deleteAttachmentByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
package com.rzdata.web.controller.tool;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.rzdata.web.domain.Discussions;
|
||||
import com.rzdata.web.service.IDiscussionsService;
|
||||
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.rzdata.common.annotation.Log;
|
||||
import com.rzdata.common.core.controller.BaseController;
|
||||
import com.rzdata.common.core.domain.AjaxResult;
|
||||
import com.rzdata.common.enums.BusinessType;
|
||||
import com.rzdata.common.utils.poi.ExcelUtil;
|
||||
import com.rzdata.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 讨论Controller
|
||||
*
|
||||
* @author panchichun
|
||||
* @date 2024-08-30
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/discussions")
|
||||
public class DiscussionsController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDiscussionsService discussionsService;
|
||||
|
||||
/**
|
||||
* 查询讨论列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Discussions discussions)
|
||||
{
|
||||
List<Discussions> list = discussionsService.selectDiscussionsList(discussions);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出讨论列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:discussions:export')")
|
||||
@Log(title = "讨论", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Discussions discussions)
|
||||
{
|
||||
List<Discussions> list = discussionsService.selectDiscussionsList(discussions);
|
||||
ExcelUtil<Discussions> util = new ExcelUtil<Discussions>(Discussions.class);
|
||||
util.exportExcel(response, list, "讨论数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取讨论详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:discussions:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(discussionsService.selectDiscussionsById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增讨论
|
||||
*/
|
||||
@Log(title = "讨论", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Discussions discussions)
|
||||
{
|
||||
return toAjax(discussionsService.insertDiscussions(discussions));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改讨论
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:discussions:edit')")
|
||||
@Log(title = "讨论", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Discussions discussions)
|
||||
{
|
||||
return toAjax(discussionsService.updateDiscussions(discussions));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除讨论
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:discussions:remove')")
|
||||
@Log(title = "讨论", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(discussionsService.deleteDiscussionsByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,115 @@
|
||||
package com.rzdata.web.controller.tool;
|
||||
|
||||
import com.rzdata.common.annotation.Log;
|
||||
import com.rzdata.common.core.controller.BaseController;
|
||||
import com.rzdata.common.core.domain.AjaxResult;
|
||||
import com.rzdata.common.core.page.TableDataInfo;
|
||||
import com.rzdata.common.enums.BusinessType;
|
||||
import com.rzdata.common.utils.poi.ExcelUtil;
|
||||
import com.rzdata.web.domain.DownloadCount;
|
||||
import com.rzdata.web.service.IDownloadCountService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工具下载统计Controller
|
||||
*
|
||||
* @author 潘驰春
|
||||
* @date 2024-08-31
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/count")
|
||||
public class DownloadCountController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDownloadCountService downloadCountService;
|
||||
|
||||
/**
|
||||
* 查询工具下载统计列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DownloadCount downloadCount)
|
||||
{
|
||||
startPage();
|
||||
List<DownloadCount> list = downloadCountService.selectDownloadCountList(downloadCount);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询文档下载统计列表
|
||||
*/
|
||||
@GetMapping("/doc/list")
|
||||
public TableDataInfo docList(DownloadCount downloadCount)
|
||||
{
|
||||
startPage();
|
||||
List<DownloadCount> list = downloadCountService.selectDownloadDocCountList(downloadCount);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据详情统计
|
||||
*/
|
||||
@GetMapping("/user/down/list")
|
||||
public TableDataInfo userDownList(DownloadCount downloadCount)
|
||||
{
|
||||
startPage();
|
||||
List<DownloadCount> list = downloadCountService.userDownList(downloadCount);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出工具下载统计列表
|
||||
*/
|
||||
@Log(title = "工具下载统计", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DownloadCount downloadCount)
|
||||
{
|
||||
List<DownloadCount> list = downloadCountService.selectDownloadCountList(downloadCount);
|
||||
ExcelUtil<DownloadCount> util = new ExcelUtil<DownloadCount>(DownloadCount.class);
|
||||
util.exportExcel(response, list, "工具下载统计数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工具下载统计详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(downloadCountService.selectDownloadCountById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增工具下载统计
|
||||
*/
|
||||
@Log(title = "工具下载统计", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DownloadCount downloadCount)
|
||||
{
|
||||
return toAjax(downloadCountService.insertDownloadCount(downloadCount));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改工具下载统计
|
||||
*/
|
||||
@Log(title = "工具下载统计", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DownloadCount downloadCount)
|
||||
{
|
||||
return toAjax(downloadCountService.updateDownloadCount(downloadCount));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除工具下载统计
|
||||
*/
|
||||
@Log(title = "工具下载统计", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(downloadCountService.deleteDownloadCountByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
package com.rzdata.web.controller.tool;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.rzdata.web.domain.Replies;
|
||||
import com.rzdata.web.service.IRepliesService;
|
||||
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.rzdata.common.annotation.Log;
|
||||
import com.rzdata.common.core.controller.BaseController;
|
||||
import com.rzdata.common.core.domain.AjaxResult;
|
||||
import com.rzdata.common.enums.BusinessType;
|
||||
import com.rzdata.common.utils.poi.ExcelUtil;
|
||||
import com.rzdata.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 回复Controller
|
||||
*
|
||||
* @author panchichun
|
||||
* @date 2024-08-30
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/replies")
|
||||
public class RepliesController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRepliesService repliesService;
|
||||
|
||||
/**
|
||||
* 查询回复列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:replies:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Replies replies)
|
||||
{
|
||||
startPage();
|
||||
List<Replies> list = repliesService.selectRepliesList(replies);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出回复列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:replies:export')")
|
||||
@Log(title = "回复", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Replies replies)
|
||||
{
|
||||
List<Replies> list = repliesService.selectRepliesList(replies);
|
||||
ExcelUtil<Replies> util = new ExcelUtil<Replies>(Replies.class);
|
||||
util.exportExcel(response, list, "回复数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取回复详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:replies:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(repliesService.selectRepliesById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增回复
|
||||
*/
|
||||
@Log(title = "回复", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Replies replies)
|
||||
{
|
||||
return toAjax(repliesService.insertReplies(replies));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改回复
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:replies:edit')")
|
||||
@Log(title = "回复", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Replies replies)
|
||||
{
|
||||
return toAjax(repliesService.updateReplies(replies));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除回复
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:replies:remove')")
|
||||
@Log(title = "回复", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(repliesService.deleteRepliesByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,175 @@
|
||||
package com.rzdata.web.controller.tool;
|
||||
|
||||
import cn.hutool.core.util.BooleanUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.blueland.bpmclient.model.BpmClientInputModel;
|
||||
import com.blueland.bpmclient.model.ProcessInstanceModel;
|
||||
import com.rzdata.common.annotation.Log;
|
||||
import com.rzdata.common.constant.Constants;
|
||||
import com.rzdata.common.core.controller.BaseController;
|
||||
import com.rzdata.common.core.domain.AjaxResult;
|
||||
import com.rzdata.common.core.page.TableDataInfo;
|
||||
import com.rzdata.common.enums.BusinessType;
|
||||
import com.rzdata.common.enums.RecordStatusEnum;
|
||||
import com.rzdata.common.utils.DateUtils;
|
||||
import com.rzdata.common.utils.StringUtils;
|
||||
import com.rzdata.common.utils.poi.ExcelUtil;
|
||||
import com.rzdata.web.domain.ToolApply;
|
||||
import com.rzdata.web.domain.bo.BpmClientInputModelBo;
|
||||
import com.rzdata.web.service.IToolApplyService;
|
||||
import com.rzdata.web.service.IUseApplyItemService;
|
||||
import com.rzdata.web.service.WorkflowService;
|
||||
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.List;
|
||||
|
||||
/**
|
||||
* 申请Controller
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/tool/apply")
|
||||
public class ToolApplyController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IToolApplyService toolApplyService;
|
||||
|
||||
@Autowired
|
||||
private WorkflowService workflowService;
|
||||
|
||||
@Autowired
|
||||
private IUseApplyItemService useApplyItemService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询使用申请列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apply:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ToolApply toolApply)
|
||||
{
|
||||
startPage();
|
||||
List<ToolApply> list = toolApplyService.selectToolApplyList(toolApply);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工具信息详细信息
|
||||
*/
|
||||
@GetMapping(value = "/bpmc/{bpmcId}")
|
||||
public AjaxResult getInfoByBpmcId(@PathVariable("bpmcId") String bpmcId)
|
||||
{
|
||||
return success(toolApplyService.getInfoByBpmcId(bpmcId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出使用申请列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apply:export')")
|
||||
@Log(title = "使用申请", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ToolApply toolApply)
|
||||
{
|
||||
List<ToolApply> list = toolApplyService.selectToolApplyList(toolApply);
|
||||
ExcelUtil<ToolApply> util = new ExcelUtil<ToolApply>(ToolApply.class);
|
||||
util.exportExcel(response, list, "使用申请数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取使用申请详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apply:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(toolApplyService.selectToolApplyById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增使用申请
|
||||
*/
|
||||
@Log(title = "使用申请", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ToolApply toolApply)
|
||||
{
|
||||
boolean add = false;
|
||||
if (StringUtils.isEmpty(toolApply.getId())) {
|
||||
toolApply.setId(IdUtil.simpleUUID());
|
||||
add = true;
|
||||
}
|
||||
ProcessInstanceModel processInstanceModel = null;
|
||||
try {
|
||||
if(StringUtils.equals(toolApply.getRecordStatus(), RecordStatusEnum.DRAFT.getCode())){
|
||||
processInstanceModel = workflowService.saveExecute(toolApply.getBpmClientInputModel(), toolApply.getId());
|
||||
}else if (StringUtils.equals(toolApply.getRecordStatus(), RecordStatusEnum.CANCEL.getCode())){
|
||||
processInstanceModel = workflowService.cancelExecute(toolApply.getBpmClientInputModel(), toolApply.getId());
|
||||
}else{
|
||||
processInstanceModel = workflowService.nextExecute(toolApply.getBpmClientInputModel(), toolApply.getId());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (processInstanceModel != null && StringUtils.isNotEmpty(processInstanceModel.getProcInstId())) {
|
||||
if (add) {
|
||||
BpmClientInputModelBo bpmClientInputModelBo = toolApply.getBpmClientInputModel();
|
||||
if(null != bpmClientInputModelBo){
|
||||
BpmClientInputModel bpmClientInputModel = bpmClientInputModelBo.getModel();
|
||||
toolApply.setProcTitle(StrUtil.isNotEmpty(bpmClientInputModel.getWf_procTitle()) ? bpmClientInputModel.getWf_procTitle() : "");
|
||||
}
|
||||
if(toolApply.getItemList().size() > 0){
|
||||
toolApply.setToolId(toolApply.getItemList().get(0).getToolId());
|
||||
}
|
||||
toolApply.setApplyType(Constants.TOOL_APPLY_TYPE_USE);
|
||||
toolApply.setProcInstId(processInstanceModel.getProcInstId());
|
||||
toolApplyService.insertToolApply(toolApply);
|
||||
useApplyItemService.updateItemList(toolApply.getItemList(), toolApply.getId());
|
||||
}else if (BooleanUtil.isTrue(toolApply.getEditStatus())){
|
||||
toolApplyService.updateToolApply(toolApply);
|
||||
useApplyItemService.updateItemList(toolApply.getItemList(), toolApply.getId());
|
||||
}else {
|
||||
ToolApply updateStatus = new ToolApply();
|
||||
updateStatus.setId(toolApply.getId());
|
||||
updateStatus.setRecordStatus(toolApply.getRecordStatus());
|
||||
if("done".equals(toolApply.getRecordStatus())){
|
||||
toolApply.setEndTime(DateUtils.getNowDate());
|
||||
}
|
||||
toolApplyService.updateToolApply(updateStatus);
|
||||
}
|
||||
//办结
|
||||
if(RecordStatusEnum.DONE.getCode().equals(toolApply.getRecordStatus())){
|
||||
//给消息中心发送消息
|
||||
toolApplyService.sendTzMessage(toolApply);
|
||||
}
|
||||
return AjaxResult.success("操作成功",processInstanceModel);
|
||||
}else {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改使用申请
|
||||
*/
|
||||
@Log(title = "使用申请", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@RequestBody ToolApply toolApply)
|
||||
{
|
||||
return toAjax(toolApplyService.updateToolApply(toolApply));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除使用申请
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apply:remove')")
|
||||
@Log(title = "使用申请", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(toolApplyService.deleteToolApplyByIds(ids));
|
||||
}
|
||||
}
|
@ -7,23 +7,27 @@ import com.rzdata.common.annotation.Log;
|
||||
import com.rzdata.common.constant.Constants;
|
||||
import com.rzdata.common.core.controller.BaseController;
|
||||
import com.rzdata.common.core.domain.AjaxResult;
|
||||
import com.rzdata.common.core.domain.entity.SysUser;
|
||||
import com.rzdata.common.core.page.TableDataInfo;
|
||||
import com.rzdata.common.enums.BusinessType;
|
||||
import com.rzdata.common.enums.RecordStatusEnum;
|
||||
import com.rzdata.common.utils.DateUtils;
|
||||
import com.rzdata.common.utils.SecurityUtils;
|
||||
import com.rzdata.common.utils.StringUtils;
|
||||
import com.rzdata.common.utils.poi.ExcelUtil;
|
||||
import com.rzdata.system.service.ISysDeptService;
|
||||
import com.rzdata.web.domain.Tool;
|
||||
import com.rzdata.web.domain.ToolApply;
|
||||
import com.rzdata.web.service.IDocumentService;
|
||||
import com.rzdata.web.service.IToolApplyService;
|
||||
import com.rzdata.web.service.IToolService;
|
||||
import com.rzdata.web.service.IUseApplyService;
|
||||
import com.rzdata.web.service.WorkflowService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -43,14 +47,21 @@ public class ToolController extends BaseController
|
||||
private WorkflowService workflowService;
|
||||
|
||||
@Autowired
|
||||
private IUseApplyService iUseApplyService;
|
||||
private IToolApplyService iToolApplyService;
|
||||
|
||||
@Autowired
|
||||
private ISysDeptService iSysDeptService;
|
||||
|
||||
@Autowired
|
||||
private IDocumentService iDocumentService;
|
||||
|
||||
@Autowired
|
||||
private IToolApplyService toolApplyService;
|
||||
|
||||
/**
|
||||
* 查询工具信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('tool:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Tool tool)
|
||||
{
|
||||
@ -59,12 +70,13 @@ public class ToolController extends BaseController
|
||||
//前端传传参开启下载权限验证
|
||||
if (BooleanUtil.isTrue(tool.getDownloadCheck())) {
|
||||
String userId = SecurityUtils.getUserId().toString();
|
||||
for (Tool vo:list) {
|
||||
//已发布的工具 是创建人 或者 配置了下载权限 或者 通过了使用申请的
|
||||
vo.setDownloadStatus(RecordStatusEnum.DONE.getCode().equals(vo.getRecordStatus())&&
|
||||
(userId.equals(vo.getCreateBy())||
|
||||
SecurityUtils.hasPermi(Constants.DOWNLOAD_TOOL_PERMISSION)||
|
||||
iUseApplyService.checkUseApply(vo.getToolId(),userId)));
|
||||
for (Tool vo : list) {
|
||||
//创建人、下载权限、系统管理员
|
||||
//1.已经审核通过、并且有下载权限
|
||||
vo.setDownloadStatus(toolService.isDownloadStatus(userId, vo));
|
||||
|
||||
// 是否已发起使用申请
|
||||
vo.setIsHasApplyUse(iToolApplyService.hasToolUseApply(vo.getToolId(), userId));
|
||||
}
|
||||
}
|
||||
return getDataTable(list);
|
||||
@ -74,6 +86,7 @@ public class ToolController extends BaseController
|
||||
* 导出工具信息列表
|
||||
*/
|
||||
@Log(title = "工具信息", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('tool:list')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Tool tTool)
|
||||
{
|
||||
@ -82,13 +95,30 @@ public class ToolController extends BaseController
|
||||
util.exportExcel(response, list, "工具信息数据",tTool.getExcludeFields());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 导出工具信息列表
|
||||
*/
|
||||
@Log(title = "工具信息", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('tool:list')")
|
||||
@PostMapping("/export/word/list")
|
||||
public AjaxResult exportWordList(@RequestBody Tool tool)
|
||||
{
|
||||
List<Tool> list = toolService.selectAllList(tool);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工具信息详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{toolId}")
|
||||
public AjaxResult getInfo(@PathVariable("toolId") String toolId)
|
||||
{
|
||||
return success(toolService.selectToolByToolId(toolId));
|
||||
Tool tool = toolService.selectToolByToolId(toolId);
|
||||
String userId = SecurityUtils.getUserId().toString();
|
||||
tool.setDownloadStatus(toolService.isDownloadStatus(userId, tool));
|
||||
return success(tool);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -132,18 +162,41 @@ public class ToolController extends BaseController
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (processInstanceModel!=null&&StringUtils.isNotEmpty(processInstanceModel.getProcInstId())) {
|
||||
if (processInstanceModel != null && StringUtils.isNotEmpty(processInstanceModel.getProcInstId())) {
|
||||
if (add) {
|
||||
tTool.setProcInstId(processInstanceModel.getProcInstId());
|
||||
toolService.insertTool(tTool);
|
||||
}else if (BooleanUtil.isTrue(tTool.getEditStatus())){
|
||||
/** 保存工具关联关系 **/
|
||||
toolService.saveToolRelation(tTool, false);
|
||||
//保存附件
|
||||
toolService.addFileList(tTool);
|
||||
//记录申请数据
|
||||
toolService.recordToolApply(tTool);
|
||||
} else if (BooleanUtil.isTrue(tTool.getEditStatus())){
|
||||
toolService.updateTool(tTool);
|
||||
}else {
|
||||
/** 保存工具关联关系 **/
|
||||
toolService.saveToolRelation(tTool, true);
|
||||
//删除附件
|
||||
toolService.delFile(tTool);
|
||||
//保存附件
|
||||
toolService.addFileList(tTool);
|
||||
} else {
|
||||
Tool tool = new Tool();
|
||||
tool.setToolId(tTool.getToolId());
|
||||
tool.setRecordStatus(tTool.getRecordStatus());
|
||||
if("done".equals(tTool.getRecordStatus())){
|
||||
ToolApply toolApply = toolApplyService.getInfoByBpmcId(tTool.getProcInstId());
|
||||
toolApply.setRecordStatus(tTool.getRecordStatus());
|
||||
toolApply.setEndTime(DateUtils.getNowDate());
|
||||
toolApplyService.updateToolApply(toolApply);
|
||||
}
|
||||
toolService.updateTool(tool);
|
||||
}
|
||||
//办结
|
||||
if(RecordStatusEnum.DONE.getCode().equals(tTool.getRecordStatus())){
|
||||
//给消息中心发送消息
|
||||
toolService.sendTzMessage(tTool);
|
||||
}
|
||||
return AjaxResult.success("操作成功",processInstanceModel);
|
||||
}else {
|
||||
return AjaxResult.error();
|
||||
@ -169,4 +222,15 @@ public class ToolController extends BaseController
|
||||
{
|
||||
return toAjax(toolService.deleteToolByToolIds(toolIds));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 工具统计
|
||||
*/
|
||||
@GetMapping("/statistics")
|
||||
public AjaxResult statistics()
|
||||
{
|
||||
return AjaxResult.success(toolService.statistics());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,107 @@
|
||||
package com.rzdata.web.controller.tool;
|
||||
|
||||
import com.rzdata.common.annotation.Log;
|
||||
import com.rzdata.common.core.controller.BaseController;
|
||||
import com.rzdata.common.core.domain.AjaxResult;
|
||||
import com.rzdata.common.core.page.TableDataInfo;
|
||||
import com.rzdata.common.enums.BusinessType;
|
||||
import com.rzdata.common.utils.poi.ExcelUtil;
|
||||
import com.rzdata.web.domain.ToolRelation;
|
||||
import com.rzdata.web.service.IToolRelationService;
|
||||
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.List;
|
||||
|
||||
/**
|
||||
* tool_relationController
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-09-08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/relation")
|
||||
public class ToolRelationController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IToolRelationService toolRelationService;
|
||||
|
||||
/**
|
||||
* 查询tool_relation列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:relation:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ToolRelation toolRelation)
|
||||
{
|
||||
startPage();
|
||||
List<ToolRelation> list = toolRelationService.selectToolRelationList(toolRelation);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出tool_relation列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:relation:export')")
|
||||
@Log(title = "tool_relation", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ToolRelation toolRelation)
|
||||
{
|
||||
List<ToolRelation> list = toolRelationService.selectToolRelationList(toolRelation);
|
||||
ExcelUtil<ToolRelation> util = new ExcelUtil<ToolRelation>(ToolRelation.class);
|
||||
util.exportExcel(response, list, "tool_relation数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取tool_relation详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:relation:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(toolRelationService.selectToolRelationById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增tool_relation
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:relation:add')")
|
||||
@Log(title = "tool_relation", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ToolRelation toolRelation)
|
||||
{
|
||||
return toAjax(toolRelationService.insertToolRelation(toolRelation));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改tool_relation
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:relation:edit')")
|
||||
@Log(title = "tool_relation", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ToolRelation toolRelation)
|
||||
{
|
||||
return toAjax(toolRelationService.updateToolRelation(toolRelation));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除tool_relation
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:relation:remove')")
|
||||
@Log(title = "tool_relation", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(toolRelationService.deleteToolRelationByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* three,show展示
|
||||
*/
|
||||
@PostMapping("/get/three")
|
||||
public AjaxResult getDataThree(@RequestBody ToolRelation toolRelation)
|
||||
{
|
||||
return success(toolRelationService.getDataThree(toolRelation));
|
||||
}
|
||||
}
|
@ -0,0 +1,121 @@
|
||||
package com.rzdata.web.controller.tool;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.rzdata.web.domain.TzMessage;
|
||||
import com.rzdata.web.service.ITzMessageService;
|
||||
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.rzdata.common.annotation.Log;
|
||||
import com.rzdata.common.core.controller.BaseController;
|
||||
import com.rzdata.common.core.domain.AjaxResult;
|
||||
import com.rzdata.common.enums.BusinessType;
|
||||
import com.rzdata.common.utils.poi.ExcelUtil;
|
||||
import com.rzdata.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 消息Controller
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-08-31
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/message")
|
||||
public class TzMessageController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ITzMessageService tzMessageService;
|
||||
|
||||
/**
|
||||
* 查询消息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:message:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TzMessage tzMessage)
|
||||
{
|
||||
startPage();
|
||||
List<TzMessage> list = tzMessageService.selectTzMessageList(tzMessage);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出消息列表
|
||||
*/
|
||||
@Log(title = "消息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TzMessage tzMessage)
|
||||
{
|
||||
List<TzMessage> list = tzMessageService.selectTzMessageList(tzMessage);
|
||||
ExcelUtil<TzMessage> util = new ExcelUtil<TzMessage>(TzMessage.class);
|
||||
util.exportExcel(response, list, "消息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取消息详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(tzMessageService.selectTzMessageById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增消息
|
||||
*/
|
||||
@Log(title = "消息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TzMessage tzMessage)
|
||||
{
|
||||
return toAjax(tzMessageService.insertTzMessage(tzMessage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改消息
|
||||
*/
|
||||
@Log(title = "消息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TzMessage tzMessage)
|
||||
{
|
||||
return toAjax(tzMessageService.updateTzMessage(tzMessage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除消息
|
||||
*/
|
||||
@Log(title = "消息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(tzMessageService.deleteTzMessageByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 全部标记已读
|
||||
*/
|
||||
@Log(title = "全部标记已读", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/allMarkedRead")
|
||||
public AjaxResult allMarkedRead(@RequestBody TzMessage tzMessage)
|
||||
{
|
||||
return toAjax(tzMessageService.allMarkedRead(tzMessage));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取用户统计
|
||||
*/
|
||||
@GetMapping(value = "/user/msg/count/{id}")
|
||||
public AjaxResult getUserMessageCount(@PathVariable("id") String id)
|
||||
{
|
||||
return success(tzMessageService.selectTzMessageByUserCount(id));
|
||||
}
|
||||
}
|
@ -1,162 +0,0 @@
|
||||
package com.rzdata.web.controller.tool;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import cn.hutool.core.util.BooleanUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.blueland.bpmclient.model.ProcessInstanceModel;
|
||||
import com.rzdata.common.enums.RecordStatusEnum;
|
||||
import com.rzdata.common.utils.DateUtils;
|
||||
import com.rzdata.common.utils.StringUtils;
|
||||
import com.rzdata.web.domain.Tool;
|
||||
import com.rzdata.web.service.IUseApplyItemService;
|
||||
import com.rzdata.web.service.WorkflowService;
|
||||
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.rzdata.common.annotation.Log;
|
||||
import com.rzdata.common.core.controller.BaseController;
|
||||
import com.rzdata.common.core.domain.AjaxResult;
|
||||
import com.rzdata.common.enums.BusinessType;
|
||||
import com.rzdata.web.domain.UseApply;
|
||||
import com.rzdata.web.service.IUseApplyService;
|
||||
import com.rzdata.common.utils.poi.ExcelUtil;
|
||||
import com.rzdata.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 使用申请Controller
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/use/apply")
|
||||
public class UseApplyController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IUseApplyService useApplyService;
|
||||
|
||||
@Autowired
|
||||
private WorkflowService workflowService;
|
||||
|
||||
@Autowired
|
||||
private IUseApplyItemService useApplyItemService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询使用申请列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apply:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(UseApply useApply)
|
||||
{
|
||||
startPage();
|
||||
List<UseApply> list = useApplyService.selectUseApplyList(useApply);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工具信息详细信息
|
||||
*/
|
||||
@GetMapping(value = "/bpmc/{bpmcId}")
|
||||
public AjaxResult getInfoByBpmcId(@PathVariable("bpmcId") String bpmcId)
|
||||
{
|
||||
return success(useApplyService.getInfoByBpmcId(bpmcId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出使用申请列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apply:export')")
|
||||
@Log(title = "使用申请", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, UseApply useApply)
|
||||
{
|
||||
List<UseApply> list = useApplyService.selectUseApplyList(useApply);
|
||||
ExcelUtil<UseApply> util = new ExcelUtil<UseApply>(UseApply.class);
|
||||
util.exportExcel(response, list, "使用申请数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取使用申请详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apply:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(useApplyService.selectUseApplyById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增使用申请
|
||||
*/
|
||||
@Log(title = "使用申请", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody UseApply useApply)
|
||||
{
|
||||
boolean add = false;
|
||||
if (StringUtils.isEmpty(useApply.getId())) {
|
||||
useApply.setId(IdUtil.simpleUUID());
|
||||
add = true;
|
||||
}
|
||||
ProcessInstanceModel processInstanceModel = null;
|
||||
try {
|
||||
if(StringUtils.equals(useApply.getRecordStatus(), RecordStatusEnum.DRAFT.getCode())){
|
||||
processInstanceModel = workflowService.saveExecute(useApply.getBpmClientInputModel(), useApply.getId());
|
||||
}else if (StringUtils.equals(useApply.getRecordStatus(), RecordStatusEnum.CANCEL.getCode())){
|
||||
processInstanceModel = workflowService.cancelExecute(useApply.getBpmClientInputModel(), useApply.getId());
|
||||
}else{
|
||||
processInstanceModel = workflowService.nextExecute(useApply.getBpmClientInputModel(), useApply.getId());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (processInstanceModel!=null&&StringUtils.isNotEmpty(processInstanceModel.getProcInstId())) {
|
||||
if (add) {
|
||||
useApply.setProcInstId(processInstanceModel.getProcInstId());
|
||||
useApplyService.insertUseApply(useApply);
|
||||
useApplyItemService.updateItemList(useApply.getItemList(),useApply.getId());
|
||||
}else if (BooleanUtil.isTrue(useApply.getEditStatus())){
|
||||
useApplyService.updateUseApply(useApply);
|
||||
useApplyItemService.updateItemList(useApply.getItemList(),useApply.getId());
|
||||
}else {
|
||||
UseApply updateStatus = new UseApply();
|
||||
updateStatus.setId(useApply.getId());
|
||||
updateStatus.setRecordStatus(useApply.getRecordStatus());
|
||||
useApplyService.updateUseApply(updateStatus);
|
||||
}
|
||||
return AjaxResult.success("操作成功",processInstanceModel);
|
||||
}else {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改使用申请
|
||||
*/
|
||||
@Log(title = "使用申请", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@RequestBody UseApply useApply)
|
||||
{
|
||||
return toAjax(useApplyService.updateUseApply(useApply));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除使用申请
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apply:remove')")
|
||||
@Log(title = "使用申请", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(useApplyService.deleteUseApplyByIds(ids));
|
||||
}
|
||||
}
|
@ -4,6 +4,7 @@ import com.blueland.bpmclient.model.*;
|
||||
import com.rzdata.common.core.controller.BaseController;
|
||||
import com.rzdata.common.core.domain.AjaxResult;
|
||||
import com.rzdata.common.core.domain.entity.SysUser;
|
||||
import com.rzdata.common.core.domain.model.LoginUser;
|
||||
import com.rzdata.common.utils.SecurityUtils;
|
||||
import com.rzdata.common.utils.StringUtils;
|
||||
import com.rzdata.system.service.ISysConfigService;
|
||||
@ -616,4 +617,18 @@ public class WorkflowController extends BaseController {
|
||||
public AjaxResult getRecordbyPorcInstId(@PathVariable String procInstId) throws Exception{
|
||||
return AjaxResult.success(workflowService.getRecordbyPorcInstId(procInstId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户的消息数量(代办/消息中心)
|
||||
*/
|
||||
@GetMapping("/msg/count")
|
||||
public AjaxResult msgCount() {
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
LoginUser loginUser = getLoginUser();
|
||||
Map<String, Object> resultMap = workflowService.selectUserMsgCount(loginUser.getUser());
|
||||
ajax.put("msgCount", resultMap.get("msgCount"));
|
||||
ajax.put("taskCount", resultMap.get("taskCount"));
|
||||
ajax.put("totalMsgCount", resultMap.get("totalMsgCount"));
|
||||
return ajax;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,88 @@
|
||||
package com.rzdata.web.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.rzdata.common.annotation.Excel;
|
||||
import com.rzdata.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 附件对象 t_attachment
|
||||
*
|
||||
* @author panchichun
|
||||
* @date 2024-08-28
|
||||
*/
|
||||
@Data
|
||||
public class Attachment extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private String id;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String fileType;
|
||||
|
||||
/** 业务类型 */
|
||||
@Excel(name = "业务类型")
|
||||
private String bizType;
|
||||
|
||||
/** 文件路径 */
|
||||
@Excel(name = "文件路径")
|
||||
private String filePath;
|
||||
|
||||
/** 文件URL */
|
||||
@Excel(name = "文件URL")
|
||||
private String fileUrl;
|
||||
|
||||
/** 文件源名称 */
|
||||
@Excel(name = "文件源名称")
|
||||
private String fileOldName;
|
||||
|
||||
/** 文件新名称 */
|
||||
@Excel(name = "文件新名称")
|
||||
private String fileNewName;
|
||||
|
||||
/** 文件后缀 */
|
||||
@Excel(name = "文件后缀")
|
||||
private String suffixType;
|
||||
|
||||
/** 文件大小 */
|
||||
@Excel(name = "文件大小")
|
||||
private Long fileSize;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String businessId;
|
||||
|
||||
/** 序号 */
|
||||
@Excel(name = "序号")
|
||||
private Long sorts;
|
||||
|
||||
/** 删除;1是, 0:否 */
|
||||
@Excel(name = "删除;1是, 0:否")
|
||||
private String del;
|
||||
|
||||
/** 创建时间 */
|
||||
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createDate;
|
||||
|
||||
/** 更新时间 */
|
||||
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updateDate;
|
||||
|
||||
/** 失效时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "失效时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date failureTime;
|
||||
|
||||
private List<String> businessIds;
|
||||
|
||||
/** 文件名称 **/
|
||||
private String fileName;
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package com.rzdata.web.domain;
|
||||
|
||||
import com.rzdata.common.annotation.Excel;
|
||||
import com.rzdata.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 讨论对象 t_discussions
|
||||
*
|
||||
* @author panchichun
|
||||
* @date 2024-08-30
|
||||
*/
|
||||
@Data
|
||||
public class Discussions extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private String id;
|
||||
|
||||
/** 业务id */
|
||||
@Excel(name = "业务id")
|
||||
private String businessId;
|
||||
|
||||
/** 业务类型;(doc:文档,tool:工具) */
|
||||
@Excel(name = "业务类型;", readConverterExp = "d=oc:文档,tool:工具")
|
||||
private String type;
|
||||
|
||||
/** 内容 */
|
||||
@Excel(name = "内容")
|
||||
private String content;
|
||||
|
||||
/** 逻辑删除;(1:删除,0:未删除) */
|
||||
@Excel(name = "逻辑删除;", readConverterExp = "1=:删除,0:未删除")
|
||||
private String isDelete;
|
||||
|
||||
/** 创建人id */
|
||||
@Excel(name = "创建人id")
|
||||
private String createById;
|
||||
|
||||
/** 更新人id */
|
||||
@Excel(name = "更新人id")
|
||||
private String updateById;
|
||||
|
||||
private String nickName;
|
||||
|
||||
|
||||
private List<Replies> repliesList;
|
||||
}
|
@ -1,17 +1,24 @@
|
||||
package com.rzdata.web.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.rzdata.common.annotation.Excel;
|
||||
import com.rzdata.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】对象 t_document
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-07-08
|
||||
*/
|
||||
@Data
|
||||
public class Document extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
@ -26,129 +33,86 @@ public class Document extends BaseEntity {
|
||||
private String docName;
|
||||
|
||||
/** 文档类别 */
|
||||
@Excel(name = "文档类别")
|
||||
@Excel(name = "文档类别", dictType="doc_class")
|
||||
private String docType;
|
||||
|
||||
/** 文档负责人 */
|
||||
@Excel(name = "文档负责人")
|
||||
private String docPrincipals;
|
||||
|
||||
/** 文档负责人名称 */
|
||||
@Excel(name = "负责人")
|
||||
private String docPrincipalsName;
|
||||
|
||||
/** 归属单位 **/
|
||||
@Excel(name = "归属单位")
|
||||
private String docRespDeptName;
|
||||
|
||||
/** 文档归属部门 */
|
||||
@Excel(name = "文档归属部门")
|
||||
private String docRespDept;
|
||||
|
||||
/** 文档来源 */
|
||||
@Excel(name = "文档来源")
|
||||
@Excel(name = "文档来源", dictType="doc_source")
|
||||
private String docSource;
|
||||
|
||||
/**
|
||||
* 工具名称
|
||||
*/
|
||||
private String toolName;
|
||||
|
||||
/** 文档状态 */
|
||||
@Excel(name = "文档状态")
|
||||
@Excel(name = "文档状态", dictType="doc_upload_status")
|
||||
private String docStatus;
|
||||
|
||||
/** 文档地址 */
|
||||
@Excel(name = "文档地址")
|
||||
private String docUrl;
|
||||
|
||||
public void setDocId(String docId)
|
||||
{
|
||||
this.docId = docId;
|
||||
}
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
public String getDocId()
|
||||
{
|
||||
return docId;
|
||||
}
|
||||
public void setDocCode(String docCode)
|
||||
{
|
||||
this.docCode = docCode;
|
||||
}
|
||||
/** 文档分类id */
|
||||
private String docCategoryId;
|
||||
|
||||
public String getDocCode()
|
||||
{
|
||||
return docCode;
|
||||
}
|
||||
public void setDocName(String docName)
|
||||
{
|
||||
this.docName = docName;
|
||||
}
|
||||
/** 创建人id */
|
||||
private String createById;
|
||||
/** 更新人id */
|
||||
private String updateById;
|
||||
/** 逻辑删除(1:删除,0:未删除) */
|
||||
private String isDeleted;
|
||||
|
||||
public String getDocName()
|
||||
{
|
||||
return docName;
|
||||
}
|
||||
public void setDocType(String docType)
|
||||
{
|
||||
this.docType = docType;
|
||||
}
|
||||
/** 主键 **/
|
||||
private List<String> ids;
|
||||
|
||||
public String getDocType()
|
||||
{
|
||||
return docType;
|
||||
}
|
||||
public void setDocPrincipals(String docPrincipals)
|
||||
{
|
||||
this.docPrincipals = docPrincipals;
|
||||
}
|
||||
/** 附件名称 **/
|
||||
private Attachment attachment;
|
||||
|
||||
public String getDocPrincipals()
|
||||
{
|
||||
return docPrincipals;
|
||||
}
|
||||
public void setDocRespDept(String docRespDept)
|
||||
{
|
||||
this.docRespDept = docRespDept;
|
||||
}
|
||||
/** 关联工具id对象 */
|
||||
private String toolId;
|
||||
|
||||
public String getDocRespDept()
|
||||
{
|
||||
return docRespDept;
|
||||
}
|
||||
public void setDocSource(String docSource)
|
||||
{
|
||||
this.docSource = docSource;
|
||||
}
|
||||
/** 工具信息 **/
|
||||
private Tool tool;
|
||||
|
||||
public String getDocSource()
|
||||
{
|
||||
return docSource;
|
||||
}
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "创建时间", dateFormat="yyyy-MM-dd")
|
||||
private Date createTime;
|
||||
|
||||
public void setDocStatus(String docStatus)
|
||||
{
|
||||
this.docStatus = docStatus;
|
||||
}
|
||||
|
||||
public String getDocStatus()
|
||||
{
|
||||
return docStatus;
|
||||
}
|
||||
private List<String> excludeFields;
|
||||
|
||||
public void setDocUrl(String docUrl)
|
||||
{
|
||||
this.docUrl = docUrl;
|
||||
}
|
||||
private Boolean downloadCheck;
|
||||
|
||||
public String getDocUrl()
|
||||
{
|
||||
return docUrl;
|
||||
}
|
||||
private Boolean downloadStatus;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("docId", getDocId())
|
||||
.append("docCode", getDocCode())
|
||||
.append("docName", getDocName())
|
||||
.append("docType", getDocType())
|
||||
.append("docPrincipals", getDocPrincipals())
|
||||
.append("docRespDept", getDocRespDept())
|
||||
.append("docSource", getDocSource())
|
||||
.append("docStatus", getDocStatus())
|
||||
.append("docUrl", getDocUrl())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
private Boolean permissionCheck;
|
||||
|
||||
private Boolean permission;
|
||||
|
||||
private String docTypeName;
|
||||
private String docSourceName;
|
||||
private String statusName;
|
||||
private String createNowTime;
|
||||
|
||||
private List<Attachment> attachmentList;
|
||||
/** 主键 **/
|
||||
private List<String> docIdList;
|
||||
}
|
||||
|
@ -0,0 +1,56 @@
|
||||
package com.rzdata.web.domain;
|
||||
|
||||
import com.rzdata.common.annotation.Excel;
|
||||
import com.rzdata.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 工具下载统计对象 t_download_count
|
||||
*
|
||||
* @author 潘驰春
|
||||
* @date 2024-08-31
|
||||
*/
|
||||
@Data
|
||||
public class DownloadCount extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private String id;
|
||||
|
||||
/** 工具id */
|
||||
@Excel(name = "业务id")
|
||||
private String businessId;
|
||||
/** 业务类型 */
|
||||
private String businessType;
|
||||
/** 附件id */
|
||||
private String attId;
|
||||
/** 附件名称 */
|
||||
private String attName;
|
||||
|
||||
/** 创建人id */
|
||||
@Excel(name = "创建人id")
|
||||
private String createById;
|
||||
|
||||
/** 更新人id */
|
||||
@Excel(name = "更新人id")
|
||||
private String updateById;
|
||||
|
||||
/** 工具code */
|
||||
private String toolCode;
|
||||
/** 工具名称 */
|
||||
private String toolName;
|
||||
/** 工具下载数量 */
|
||||
private String toolDownNum;
|
||||
private String nickName;
|
||||
|
||||
/** 文档code */
|
||||
private String docCode;
|
||||
/** 文档名称 */
|
||||
private String docName;
|
||||
/** 文档下载数量 */
|
||||
private String docDownNum;
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.rzdata.web.domain;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class FileOperationRequest {
|
||||
private String id;
|
||||
private String name;
|
||||
private Boolean isLocal;
|
||||
/** preview:预览,download:下载 **/
|
||||
private String type;
|
||||
/**
|
||||
* 模板下载类型
|
||||
* 1: 导入模板
|
||||
* 2:示例请求模板
|
||||
*/
|
||||
private String templateDownloadType;
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package com.rzdata.web.domain;
|
||||
|
||||
import com.rzdata.common.annotation.Excel;
|
||||
import com.rzdata.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 回复对象 t_replies
|
||||
*
|
||||
* @author panchichun
|
||||
* @date 2024-08-30
|
||||
*/
|
||||
@Data
|
||||
public class Replies extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private String id;
|
||||
|
||||
/** 讨论表id */
|
||||
@Excel(name = "讨论表id")
|
||||
private String discussionId;
|
||||
|
||||
@Excel(name = "回复评论ID")
|
||||
private String repId;
|
||||
|
||||
/** 内容 */
|
||||
@Excel(name = "内容")
|
||||
private String content;
|
||||
|
||||
/** 逻辑删除;(1:删除,0:未删除) */
|
||||
@Excel(name = "逻辑删除;", readConverterExp = "1=:删除,0:未删除")
|
||||
private String isDelete;
|
||||
|
||||
/** 创建人id */
|
||||
@Excel(name = "创建人id")
|
||||
private String createById;
|
||||
|
||||
/** 更新人id */
|
||||
@Excel(name = "更新人id")
|
||||
private String updateById;
|
||||
|
||||
private String nickName;
|
||||
|
||||
private String repTargetNickName;
|
||||
|
||||
private List<String> discussionIdList;
|
||||
}
|
@ -1,14 +1,12 @@
|
||||
package com.rzdata.web.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.rzdata.common.annotation.Excel;
|
||||
import com.rzdata.common.annotation.Excels;
|
||||
import com.rzdata.common.core.domain.BaseEntity;
|
||||
import com.rzdata.common.core.domain.entity.SysDept;
|
||||
import com.rzdata.web.domain.bo.BpmClientInputModelBo;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -26,59 +24,73 @@ public class Tool extends BaseEntity
|
||||
private String toolId;
|
||||
|
||||
/** 工具编号 */
|
||||
@Excel(name = "编号",sort=1)
|
||||
private String toolCode;
|
||||
|
||||
/** 工具名称 */
|
||||
@Excel(name = "工具名称",sort=1)
|
||||
@Excel(name = "中文别名",sort=2)
|
||||
private String toolName;
|
||||
|
||||
/** 工具类别 */
|
||||
@Excel(name = "工具类别",dictType="tool_type",sort=2)
|
||||
@Excel(name = "类别",dictType="tool_type",sort=5)
|
||||
private String toolType;
|
||||
|
||||
/** 来源 */
|
||||
@Excel(name = "工具来源",sort=3)
|
||||
@Excel(name = "来源",dictType="tool_source",sort=3)
|
||||
private String toolSource;
|
||||
|
||||
private String toolSourceName;
|
||||
|
||||
/** 用途 */
|
||||
@Excel(name = "工具用途",sort=7)
|
||||
@Excel(name = "用途",sort=6)
|
||||
private String toolUse;
|
||||
|
||||
/** 测试情况 */
|
||||
@Excel(name = "测评情况",sort=8)
|
||||
@Excel(name = "测评机构",sort=7)
|
||||
private String testSituation;
|
||||
|
||||
/** 功能描述 */
|
||||
@Excel(name = "功能描述",sort=9)
|
||||
@Excel(name = "功能简介",sort=8)
|
||||
private String functionDesc;
|
||||
|
||||
/** 适用条件 */
|
||||
@Excel(name = "适用条件",sort=10)
|
||||
@Excel(name = "适用条件",sort=9)
|
||||
private String applyCondition;
|
||||
|
||||
/** 操作说明 */
|
||||
@Excel(name = "操作说明",sort=11)
|
||||
//@Excel(name = "操作说明",sort=11)
|
||||
private String operateExplain;
|
||||
|
||||
/** 负责人 */
|
||||
private String toolPrincipals;
|
||||
|
||||
/** 负责人名称 */
|
||||
@Excel(name = "负责人",sort=4)
|
||||
private String toolPrincipalsName;
|
||||
|
||||
/** 归属单位 */
|
||||
private String toolRespDept;
|
||||
|
||||
@Excel(name = "归属单位",sort=5)
|
||||
@Excel(name = "归属单位",sort=12)
|
||||
private String toolRespDeptName;
|
||||
|
||||
@Excel(name = "加密方式",sort=10)
|
||||
private String encryptionMode;
|
||||
|
||||
@Excel(name = "服务时间",sort=11)
|
||||
private String serviceTime;
|
||||
|
||||
@Excel(name = "联系人",sort=13)
|
||||
private String contactPerson;
|
||||
|
||||
@Excel(name = "联系方式",sort=14)
|
||||
private String contactPhone;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态",dictType="sys_normal_disable",sort=6)
|
||||
@Excel(name = "形态",dictType="tool_status",sort=4)
|
||||
private String status;
|
||||
|
||||
/** 备注 */
|
||||
@Excel(name = "备注",sort=12)
|
||||
@Excel(name = "备注",sort=15)
|
||||
private String remark;
|
||||
|
||||
/** 关联工具 */
|
||||
@ -86,8 +98,14 @@ public class Tool extends BaseEntity
|
||||
|
||||
private BpmClientInputModelBo bpmClientInputModel;
|
||||
|
||||
/** done:办结,doing:进行中**/
|
||||
private String recordStatus;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
//@Excel(name = "创建时间", dateFormat="yyyy-MM-dd",sort=16)
|
||||
private Date createTime;
|
||||
|
||||
private Boolean editStatus;
|
||||
|
||||
private String procInstId;
|
||||
@ -100,5 +118,21 @@ public class Tool extends BaseEntity
|
||||
|
||||
private Boolean downloadStatus;
|
||||
|
||||
private Boolean isHasApplyUse;
|
||||
|
||||
private List<String> excludeFields;
|
||||
|
||||
private List<Document> documentList;
|
||||
private List<Attachment> attachmentList;
|
||||
|
||||
|
||||
/** 工具类型名称 **/
|
||||
private String toolTypeName;
|
||||
/** 状态名称 **/
|
||||
private String statusName;
|
||||
/** 主键 **/
|
||||
private List<String> toolIdList;
|
||||
/** 需要过滤的主键 **/
|
||||
private List<String> filterToolIds;
|
||||
private String recordStatusName;
|
||||
}
|
||||
|
@ -1,10 +1,12 @@
|
||||
package com.rzdata.web.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.rzdata.common.annotation.Excel;
|
||||
import com.rzdata.common.core.domain.BaseEntity;
|
||||
import com.rzdata.web.domain.bo.BpmClientInputModelBo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -14,7 +16,7 @@ import java.util.List;
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@Data
|
||||
public class UseApply extends BaseEntity
|
||||
public class ToolApply extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ -25,6 +27,15 @@ public class UseApply extends BaseEntity
|
||||
@Excel(name = "申请人id")
|
||||
private String userId;
|
||||
|
||||
@Excel(name = "工具ID")
|
||||
private String toolId;
|
||||
|
||||
@Excel(name = "流程标题")
|
||||
private String procTitle;
|
||||
|
||||
@Excel(name = "申请类型")
|
||||
private String applyType;
|
||||
|
||||
@Excel(name = "申请人名称")
|
||||
private String nickName;
|
||||
|
||||
@ -39,6 +50,9 @@ public class UseApply extends BaseEntity
|
||||
@Excel(name = "申请理由")
|
||||
private String reason;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
|
||||
private BpmClientInputModelBo bpmClientInputModel;
|
||||
|
||||
private String recordStatus;
|
@ -0,0 +1,38 @@
|
||||
package com.rzdata.web.domain;
|
||||
|
||||
import com.rzdata.common.annotation.Excel;
|
||||
import com.rzdata.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* tool_relation对象 t_tool_relation
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-09-08
|
||||
*/
|
||||
@Data
|
||||
public class ToolRelation extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private String id;
|
||||
|
||||
/** 源id */
|
||||
@Excel(name = "源id")
|
||||
private String resourceId;
|
||||
|
||||
/** 目标id */
|
||||
@Excel(name = "目标id")
|
||||
private String targetId;
|
||||
|
||||
/** 文件编号 */
|
||||
private String toolCode;
|
||||
/** 文件名称 */
|
||||
private String toolName;
|
||||
|
||||
/** 资源名称 */
|
||||
private List<String> resourceIds;
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package com.rzdata.web.domain;
|
||||
|
||||
import com.rzdata.common.annotation.Excel;
|
||||
import com.rzdata.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 消息对象 tz_message
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-08-31
|
||||
*/
|
||||
@Data
|
||||
public class TzMessage extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 消息id */
|
||||
private String id;
|
||||
|
||||
/** 消息接收者id */
|
||||
@Excel(name = "消息接收者id")
|
||||
private String receiverId;
|
||||
|
||||
/** 状态(2:已读,1:未读) */
|
||||
@Excel(name = "状态", readConverterExp = "2=:已读,1:未读")
|
||||
private Integer states;
|
||||
|
||||
/** 消息推送内容 */
|
||||
@Excel(name = "消息推送内容")
|
||||
private String content;
|
||||
|
||||
/** 业务id */
|
||||
private String businessId;
|
||||
|
||||
/** 业务类型;(doc:文档,tool:工具) */
|
||||
private String businessType;
|
||||
|
||||
/** 逻辑删除标记:1删除;0未删除 */
|
||||
@Excel(name = "逻辑删除标记:1删除;0未删除")
|
||||
private String deleted;
|
||||
private String createById;
|
||||
private String updateById;
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package com.rzdata.web.mapper;
|
||||
|
||||
import com.rzdata.web.domain.Attachment;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 附件Mapper接口
|
||||
*
|
||||
* @author panchichun
|
||||
* @date 2024-08-28
|
||||
*/
|
||||
public interface AttachmentMapper
|
||||
{
|
||||
/**
|
||||
* 查询附件
|
||||
*
|
||||
* @param id 附件主键
|
||||
* @return 附件
|
||||
*/
|
||||
public Attachment selectAttachmentById(String id);
|
||||
|
||||
/**
|
||||
* 查询附件列表
|
||||
*
|
||||
* @param attachment 附件
|
||||
* @return 附件集合
|
||||
*/
|
||||
public List<Attachment> selectAttachmentList(Attachment attachment);
|
||||
|
||||
/**
|
||||
* 新增附件
|
||||
*
|
||||
* @param attachment 附件
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAttachment(Attachment attachment);
|
||||
|
||||
/**
|
||||
* 修改附件
|
||||
*
|
||||
* @param attachment 附件
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAttachment(Attachment attachment);
|
||||
|
||||
/**
|
||||
* 根据业务id更新附件
|
||||
* @param attachment
|
||||
* @return
|
||||
*/
|
||||
public int updateAttachmentByBusinessId(Attachment attachment);
|
||||
|
||||
/**
|
||||
* 删除附件
|
||||
*
|
||||
* @param id 附件主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAttachmentById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除附件
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAttachmentByIds(String[] ids);
|
||||
|
||||
public int deleteAttachmentByBusinessId(List<String> list);
|
||||
|
||||
int batchInsert(@Param("attachmentList") List<Attachment> attachmentList);
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.rzdata.web.mapper;
|
||||
|
||||
import com.rzdata.web.domain.Discussions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 讨论Mapper接口
|
||||
*
|
||||
* @author panchichun
|
||||
* @date 2024-08-30
|
||||
*/
|
||||
public interface DiscussionsMapper
|
||||
{
|
||||
/**
|
||||
* 查询讨论
|
||||
*
|
||||
* @param id 讨论主键
|
||||
* @return 讨论
|
||||
*/
|
||||
public Discussions selectDiscussionsById(String id);
|
||||
|
||||
/**
|
||||
* 查询讨论列表
|
||||
*
|
||||
* @param discussions 讨论
|
||||
* @return 讨论集合
|
||||
*/
|
||||
public List<Discussions> selectDiscussionsList(Discussions discussions);
|
||||
|
||||
/**
|
||||
* 新增讨论
|
||||
*
|
||||
* @param discussions 讨论
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDiscussions(Discussions discussions);
|
||||
|
||||
/**
|
||||
* 修改讨论
|
||||
*
|
||||
* @param discussions 讨论
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDiscussions(Discussions discussions);
|
||||
|
||||
/**
|
||||
* 删除讨论
|
||||
*
|
||||
* @param id 讨论主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDiscussionsById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除讨论
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDiscussionsByIds(String[] ids);
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.rzdata.web.mapper;
|
||||
|
||||
import com.rzdata.common.core.domain.DocumentCategory;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文档资源分类管理Mapper接口
|
||||
*
|
||||
* @author spongepan
|
||||
* @date 2024-08-27
|
||||
*/
|
||||
public interface DocumentCategoryMapper
|
||||
{
|
||||
/**
|
||||
* 查询文档资源分类管理
|
||||
*
|
||||
* @param id 文档资源分类管理主键
|
||||
* @return 文档资源分类管理
|
||||
*/
|
||||
public DocumentCategory selectDocumentCategoryById(String id);
|
||||
|
||||
/**
|
||||
* 查询文档资源分类管理列表
|
||||
*
|
||||
* @param documentCategory 文档资源分类管理
|
||||
* @return 文档资源分类管理集合
|
||||
*/
|
||||
public List<DocumentCategory> selectDocumentCategoryList(DocumentCategory documentCategory);
|
||||
|
||||
/**
|
||||
* 新增文档资源分类管理
|
||||
*
|
||||
* @param documentCategory 文档资源分类管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDocumentCategory(DocumentCategory documentCategory);
|
||||
|
||||
/**
|
||||
* 修改文档资源分类管理
|
||||
*
|
||||
* @param documentCategory 文档资源分类管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDocumentCategory(DocumentCategory documentCategory);
|
||||
|
||||
/**
|
||||
* 删除文档资源分类管理
|
||||
*
|
||||
* @param id 文档资源分类管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDocumentCategoryById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除文档资源分类管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDocumentCategoryByIds(String[] ids);
|
||||
}
|
@ -3,6 +3,7 @@ package com.rzdata.web.mapper;
|
||||
import com.rzdata.web.domain.Document;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Mapper接口
|
||||
@ -53,10 +54,18 @@ public interface DocumentMapper
|
||||
public int deleteDocumentById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
* 逻辑删除
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @param Document 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDocumentByIds(String[] ids);
|
||||
public int isDeleteDocumentByIds(Document Document);
|
||||
|
||||
public int updatePushDoc(Document doc);
|
||||
|
||||
public int batchDeleteById(List<String> list);
|
||||
|
||||
List<Map<String, Object>> countType();
|
||||
|
||||
List<Map<String, Object>> countSource();
|
||||
}
|
||||
|
@ -0,0 +1,67 @@
|
||||
package com.rzdata.web.mapper;
|
||||
|
||||
import com.rzdata.web.domain.DownloadCount;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工具下载统计Mapper接口
|
||||
*
|
||||
* @author 潘驰春
|
||||
* @date 2024-08-31
|
||||
*/
|
||||
public interface DownloadCountMapper
|
||||
{
|
||||
/**
|
||||
* 查询工具下载统计
|
||||
*
|
||||
* @param id 工具下载统计主键
|
||||
* @return 工具下载统计
|
||||
*/
|
||||
public DownloadCount selectDownloadCountById(String id);
|
||||
|
||||
/**
|
||||
* 查询工具下载统计列表
|
||||
*
|
||||
* @param downloadCount 工具下载统计
|
||||
* @return 工具下载统计集合
|
||||
*/
|
||||
public List<DownloadCount> selectDownloadCountList(DownloadCount downloadCount);
|
||||
|
||||
/**
|
||||
* 新增工具下载统计
|
||||
*
|
||||
* @param downloadCount 工具下载统计
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDownloadCount(DownloadCount downloadCount);
|
||||
|
||||
/**
|
||||
* 修改工具下载统计
|
||||
*
|
||||
* @param downloadCount 工具下载统计
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDownloadCount(DownloadCount downloadCount);
|
||||
|
||||
/**
|
||||
* 删除工具下载统计
|
||||
*
|
||||
* @param id 工具下载统计主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDownloadCountById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除工具下载统计
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDownloadCountByIds(String[] ids);
|
||||
|
||||
List<DownloadCount> userDownList(DownloadCount downloadCount);
|
||||
|
||||
/** 文档下载统计 **/
|
||||
List<DownloadCount> selectDownloadDocCountList(DownloadCount downloadCount);
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.rzdata.web.mapper;
|
||||
|
||||
import com.rzdata.web.domain.Replies;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 回复Mapper接口
|
||||
*
|
||||
* @author panchichun
|
||||
* @date 2024-08-30
|
||||
*/
|
||||
public interface RepliesMapper
|
||||
{
|
||||
/**
|
||||
* 查询回复
|
||||
*
|
||||
* @param id 回复主键
|
||||
* @return 回复
|
||||
*/
|
||||
public Replies selectRepliesById(String id);
|
||||
|
||||
/**
|
||||
* 查询回复列表
|
||||
*
|
||||
* @param replies 回复
|
||||
* @return 回复集合
|
||||
*/
|
||||
public List<Replies> selectRepliesList(Replies replies);
|
||||
|
||||
/**
|
||||
* 新增回复
|
||||
*
|
||||
* @param replies 回复
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertReplies(Replies replies);
|
||||
|
||||
/**
|
||||
* 修改回复
|
||||
*
|
||||
* @param replies 回复
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateReplies(Replies replies);
|
||||
|
||||
/**
|
||||
* 删除回复
|
||||
*
|
||||
* @param id 回复主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRepliesById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除回复
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRepliesByIds(String[] ids);
|
||||
}
|
@ -1,17 +1,17 @@
|
||||
package com.rzdata.web.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.rzdata.web.domain.UseApply;
|
||||
import com.rzdata.web.domain.Tool;
|
||||
import com.rzdata.web.domain.ToolApply;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 使用申请Mapper接口
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
public interface UseApplyMapper
|
||||
public interface ToolApplyMapper
|
||||
{
|
||||
/**
|
||||
* 查询使用申请
|
||||
@ -19,33 +19,33 @@ public interface UseApplyMapper
|
||||
* @param id 使用申请主键
|
||||
* @return 使用申请
|
||||
*/
|
||||
public UseApply selectUseApplyById(String id);
|
||||
public ToolApply selectToolApplyById(String id);
|
||||
|
||||
UseApply getInfoByBpmcId(String bpmcId);
|
||||
ToolApply getInfoByBpmcId(String bpmcId);
|
||||
|
||||
/**
|
||||
* 查询使用申请列表
|
||||
*
|
||||
* @param useApply 使用申请
|
||||
* @param toolApply 使用申请
|
||||
* @return 使用申请集合
|
||||
*/
|
||||
public List<UseApply> selectUseApplyList(UseApply useApply);
|
||||
public List<ToolApply> selectToolApplyList(ToolApply toolApply);
|
||||
|
||||
/**
|
||||
* 新增使用申请
|
||||
*
|
||||
* @param useApply 使用申请
|
||||
* @param toolApply 使用申请
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertUseApply(UseApply useApply);
|
||||
public int insertToolApply(ToolApply toolApply);
|
||||
|
||||
/**
|
||||
* 修改使用申请
|
||||
*
|
||||
* @param useApply 使用申请
|
||||
* @param toolApply 使用申请
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUseApply(UseApply useApply);
|
||||
public int updateToolApply(ToolApply toolApply);
|
||||
|
||||
/**
|
||||
* 删除使用申请
|
||||
@ -53,7 +53,7 @@ public interface UseApplyMapper
|
||||
* @param id 使用申请主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUseApplyById(String id);
|
||||
public int deleteToolApplyById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除使用申请
|
||||
@ -61,7 +61,9 @@ public interface UseApplyMapper
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUseApplyByIds(String[] ids);
|
||||
public int deleteToolApplyByIds(String[] ids);
|
||||
|
||||
int checkUseApply(@Param("toolId") String toolId, @Param("userId") String userId);
|
||||
int hasToolUseApply(@Param("toolId") String toolId, @Param("userId") String userId);
|
||||
|
||||
int checkToolUseApply(@Param("toolId") String toolId, @Param("userId") String userId);
|
||||
}
|
@ -3,6 +3,7 @@ package com.rzdata.web.mapper;
|
||||
import com.rzdata.web.domain.Tool;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 工具信息Mapper接口
|
||||
@ -63,4 +64,8 @@ public interface ToolMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteToolByToolIds(String[] toolIds);
|
||||
|
||||
List<Map<String, Object>> countToolType();
|
||||
List<Map<String, Object>> toolSource();
|
||||
List<Map<String, Object>> recordStatus();
|
||||
}
|
||||
|
@ -0,0 +1,80 @@
|
||||
package com.rzdata.web.mapper;
|
||||
|
||||
import com.rzdata.web.domain.ToolRelation;
|
||||
import com.rzdata.web.domain.TzMessage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* tool_relationMapper接口
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-09-08
|
||||
*/
|
||||
public interface ToolRelationMapper
|
||||
{
|
||||
/**
|
||||
* 查询tool_relation
|
||||
*
|
||||
* @param id tool_relation主键
|
||||
* @return tool_relation
|
||||
*/
|
||||
public ToolRelation selectToolRelationById(String id);
|
||||
|
||||
/**
|
||||
* 查询tool_relation列表
|
||||
*
|
||||
* @param toolRelation tool_relation
|
||||
* @return tool_relation集合
|
||||
*/
|
||||
public List<ToolRelation> selectToolRelationList(ToolRelation toolRelation);
|
||||
|
||||
public List<ToolRelation> selectRelationToolList(ToolRelation toolRelation);
|
||||
|
||||
/**
|
||||
* 新增tool_relation
|
||||
*
|
||||
* @param toolRelation tool_relation
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertToolRelation(ToolRelation toolRelation);
|
||||
|
||||
/**
|
||||
* 修改tool_relation
|
||||
*
|
||||
* @param toolRelation tool_relation
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateToolRelation(ToolRelation toolRelation);
|
||||
|
||||
/**
|
||||
* 删除tool_relation
|
||||
*
|
||||
* @param id tool_relation主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteToolRelationById(String id);
|
||||
|
||||
/** 根据资源id和目标id去删除 **/
|
||||
public int deleteResourceAndTarget(ToolRelation toolRelation);
|
||||
|
||||
/** 根据目标id和源id去删除 **/
|
||||
public int deleteTargetAndResource(ToolRelation toolRelation);
|
||||
|
||||
/**
|
||||
* 批量删除tool_relation
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteToolRelationByIds(String[] ids);
|
||||
|
||||
|
||||
/**
|
||||
* 批量插入
|
||||
* @param toolRelationList
|
||||
* @return
|
||||
*/
|
||||
public int batchInsert(@Param("toolRelationList") List<ToolRelation> toolRelationList);
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
package com.rzdata.web.mapper;
|
||||
|
||||
import com.rzdata.web.domain.TzMessage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 消息Mapper接口
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-08-31
|
||||
*/
|
||||
public interface TzMessageMapper
|
||||
{
|
||||
/**
|
||||
* 查询消息
|
||||
*
|
||||
* @param id 消息主键
|
||||
* @return 消息
|
||||
*/
|
||||
public TzMessage selectTzMessageById(String id);
|
||||
|
||||
/**
|
||||
* 查询消息列表
|
||||
*
|
||||
* @param tzMessage 消息
|
||||
* @return 消息集合
|
||||
*/
|
||||
public List<TzMessage> selectTzMessageList(TzMessage tzMessage);
|
||||
|
||||
/**
|
||||
* 新增消息
|
||||
*
|
||||
* @param tzMessage 消息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTzMessage(TzMessage tzMessage);
|
||||
|
||||
/**
|
||||
* 修改消息
|
||||
*
|
||||
* @param tzMessage 消息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTzMessage(TzMessage tzMessage);
|
||||
|
||||
/**
|
||||
* 删除消息
|
||||
*
|
||||
* @param id 消息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTzMessageById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除消息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTzMessageByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 更新所有的消息为已读
|
||||
* @param tzMessage
|
||||
* @return
|
||||
*/
|
||||
public int updateAllMarkedRead(TzMessage tzMessage);
|
||||
|
||||
/**
|
||||
* 批量插入
|
||||
* @param tzMessageList
|
||||
* @return
|
||||
*/
|
||||
public int batchInsert(@Param("tzMessageList") List<TzMessage> tzMessageList);
|
||||
|
||||
/**
|
||||
* 消息中心未读消息数量查询
|
||||
* **/
|
||||
int selectTzMessageByUserCount(String userId);
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
package com.rzdata.web.service;
|
||||
|
||||
import com.rzdata.web.domain.Attachment;
|
||||
import com.rzdata.web.domain.FileOperationRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 附件Service接口
|
||||
*
|
||||
* @author panchichun
|
||||
* @date 2024-08-28
|
||||
*/
|
||||
public interface IAttachmentService
|
||||
{
|
||||
/**
|
||||
* 查询附件
|
||||
*
|
||||
* @param id 附件主键
|
||||
* @return 附件
|
||||
*/
|
||||
public Attachment selectAttachmentById(String id);
|
||||
|
||||
/**
|
||||
* 查询附件列表
|
||||
*
|
||||
* @param attachment 附件
|
||||
* @return 附件集合
|
||||
*/
|
||||
public List<Attachment> selectAttachmentList(Attachment attachment);
|
||||
|
||||
/**
|
||||
* 新增附件
|
||||
*
|
||||
* @param attachment 附件
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAttachment(Attachment attachment);
|
||||
|
||||
/**
|
||||
* 修改附件
|
||||
*
|
||||
* @param attachment 附件
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAttachment(Attachment attachment);
|
||||
public int updateAttachmentByBusinessId(Attachment attachment);
|
||||
|
||||
/**
|
||||
* 批量删除附件
|
||||
*
|
||||
* @param ids 需要删除的附件主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAttachmentByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 根据业务id批量删除
|
||||
* @param businessIds
|
||||
* @return
|
||||
*/
|
||||
public int deleteAttachmentByBusinessId(List<String> businessIds);
|
||||
|
||||
/**
|
||||
* 删除附件信息
|
||||
*
|
||||
* @param id 附件主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAttachmentById(String id);
|
||||
|
||||
/**
|
||||
* 批量插入
|
||||
* @param batch
|
||||
* @return
|
||||
*/
|
||||
public int batchInsert(List<Attachment> batch);
|
||||
|
||||
byte[] loadFileAsBytes(Attachment attachment);
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.rzdata.web.service;
|
||||
|
||||
import com.rzdata.web.domain.Discussions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 讨论Service接口
|
||||
*
|
||||
* @author panchichun
|
||||
* @date 2024-08-30
|
||||
*/
|
||||
public interface IDiscussionsService
|
||||
{
|
||||
/**
|
||||
* 查询讨论
|
||||
*
|
||||
* @param id 讨论主键
|
||||
* @return 讨论
|
||||
*/
|
||||
public Discussions selectDiscussionsById(String id);
|
||||
|
||||
/**
|
||||
* 查询讨论列表
|
||||
*
|
||||
* @param discussions 讨论
|
||||
* @return 讨论集合
|
||||
*/
|
||||
public List<Discussions> selectDiscussionsList(Discussions discussions);
|
||||
|
||||
/**
|
||||
* 新增讨论
|
||||
*
|
||||
* @param discussions 讨论
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDiscussions(Discussions discussions);
|
||||
|
||||
/**
|
||||
* 修改讨论
|
||||
*
|
||||
* @param discussions 讨论
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDiscussions(Discussions discussions);
|
||||
|
||||
/**
|
||||
* 批量删除讨论
|
||||
*
|
||||
* @param ids 需要删除的讨论主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDiscussionsByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除讨论信息
|
||||
*
|
||||
* @param id 讨论主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDiscussionsById(String id);
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package com.rzdata.web.service;
|
||||
|
||||
import com.rzdata.common.core.domain.ToolTreeSelect;
|
||||
import com.rzdata.common.core.domain.TreeSelect;
|
||||
import com.rzdata.common.core.domain.DocumentCategory;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文档资源分类管理Service接口
|
||||
*
|
||||
* @author spongepan
|
||||
* @date 2024-08-27
|
||||
*/
|
||||
public interface IDocumentCategoryService
|
||||
{
|
||||
/**
|
||||
* 查询文档资源分类管理
|
||||
*
|
||||
* @param id 文档资源分类管理主键
|
||||
* @return 文档资源分类管理
|
||||
*/
|
||||
public DocumentCategory selectDocumentCategoryById(String id);
|
||||
|
||||
/**
|
||||
* 查询文档资源分类管理列表
|
||||
*
|
||||
* @param documentCategory 文档资源分类管理
|
||||
* @return 文档资源分类管理集合
|
||||
*/
|
||||
public List<DocumentCategory> selectDocumentCategoryList(DocumentCategory documentCategory);
|
||||
|
||||
/**
|
||||
* 新增文档资源分类管理
|
||||
*
|
||||
* @param documentCategory 文档资源分类管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDocumentCategory(DocumentCategory documentCategory);
|
||||
|
||||
/**
|
||||
* 修改文档资源分类管理
|
||||
*
|
||||
* @param documentCategory 文档资源分类管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDocumentCategory(DocumentCategory documentCategory);
|
||||
|
||||
/**
|
||||
* 批量删除文档资源分类管理
|
||||
*
|
||||
* @param ids 需要删除的文档资源分类管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDocumentCategoryByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除文档资源分类管理信息
|
||||
*
|
||||
* @param id 文档资源分类管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDocumentCategoryById(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 获取文档资源树
|
||||
* @param documentCategory
|
||||
* @return
|
||||
*/
|
||||
List<ToolTreeSelect> selectDocumentTreeList(DocumentCategory documentCategory);
|
||||
}
|
@ -3,6 +3,7 @@ package com.rzdata.web.service;
|
||||
import com.rzdata.web.domain.Document;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service接口
|
||||
@ -28,6 +29,9 @@ public interface IDocumentService
|
||||
*/
|
||||
public List<Document> selectDocumentList(Document document);
|
||||
|
||||
|
||||
public List<Document> selectDocumentListAll(Document document);
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*
|
||||
@ -62,4 +66,17 @@ public interface IDocumentService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDocumentById(String id);
|
||||
|
||||
/**
|
||||
* 发布文档
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
int pushDoc(String[] ids);
|
||||
|
||||
public int batchDeleteById(List<String> docIds);
|
||||
|
||||
Map<String, Object> statistics();
|
||||
|
||||
List<Document> selectAllList(Document document);
|
||||
}
|
||||
|
@ -0,0 +1,77 @@
|
||||
package com.rzdata.web.service;
|
||||
|
||||
import com.rzdata.web.domain.DownloadCount;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工具下载统计Service接口
|
||||
*
|
||||
* @author 潘驰春
|
||||
* @date 2024-08-31
|
||||
*/
|
||||
public interface IDownloadCountService
|
||||
{
|
||||
/**
|
||||
* 查询工具下载统计
|
||||
*
|
||||
* @param id 工具下载统计主键
|
||||
* @return 工具下载统计
|
||||
*/
|
||||
public DownloadCount selectDownloadCountById(String id);
|
||||
|
||||
/**
|
||||
* 查询工具下载统计列表
|
||||
*
|
||||
* @param downloadCount 工具下载统计
|
||||
* @return 工具下载统计集合
|
||||
*/
|
||||
public List<DownloadCount> selectDownloadCountList(DownloadCount downloadCount);
|
||||
|
||||
/**
|
||||
* 新增工具下载统计
|
||||
*
|
||||
* @param downloadCount 工具下载统计
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDownloadCount(DownloadCount downloadCount);
|
||||
|
||||
/**
|
||||
* 修改工具下载统计
|
||||
*
|
||||
* @param downloadCount 工具下载统计
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDownloadCount(DownloadCount downloadCount);
|
||||
|
||||
/**
|
||||
* 批量删除工具下载统计
|
||||
*
|
||||
* @param ids 需要删除的工具下载统计主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDownloadCountByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除工具下载统计信息
|
||||
*
|
||||
* @param id 工具下载统计主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDownloadCountById(String id);
|
||||
|
||||
/**
|
||||
* 用户下载列表
|
||||
* @param downloadCount
|
||||
* @return
|
||||
*/
|
||||
List<DownloadCount> userDownList(DownloadCount downloadCount);
|
||||
|
||||
/**
|
||||
* 文档下载统计
|
||||
* @param downloadCount
|
||||
* @return
|
||||
*/
|
||||
List<DownloadCount> selectDownloadDocCountList(DownloadCount downloadCount);
|
||||
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.rzdata.web.service;
|
||||
|
||||
import com.rzdata.web.domain.Replies;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 回复Service接口
|
||||
*
|
||||
* @author panchichun
|
||||
* @date 2024-08-30
|
||||
*/
|
||||
public interface IRepliesService
|
||||
{
|
||||
/**
|
||||
* 查询回复
|
||||
*
|
||||
* @param id 回复主键
|
||||
* @return 回复
|
||||
*/
|
||||
public Replies selectRepliesById(String id);
|
||||
|
||||
/**
|
||||
* 查询回复列表
|
||||
*
|
||||
* @param replies 回复
|
||||
* @return 回复集合
|
||||
*/
|
||||
public List<Replies> selectRepliesList(Replies replies);
|
||||
|
||||
/**
|
||||
* 新增回复
|
||||
*
|
||||
* @param replies 回复
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertReplies(Replies replies);
|
||||
|
||||
/**
|
||||
* 修改回复
|
||||
*
|
||||
* @param replies 回复
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateReplies(Replies replies);
|
||||
|
||||
/**
|
||||
* 批量删除回复
|
||||
*
|
||||
* @param ids 需要删除的回复主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRepliesByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除回复信息
|
||||
*
|
||||
* @param id 回复主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRepliesById(String id);
|
||||
}
|
@ -1,8 +1,7 @@
|
||||
package com.rzdata.web.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.rzdata.web.domain.UseApply;
|
||||
import com.rzdata.web.domain.Tool;
|
||||
import com.rzdata.web.domain.ToolApply;
|
||||
|
||||
/**
|
||||
* 使用申请Service接口
|
||||
@ -10,7 +9,7 @@ import com.rzdata.web.domain.Tool;
|
||||
* @author ja
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
public interface IUseApplyService
|
||||
public interface IToolApplyService
|
||||
{
|
||||
/**
|
||||
* 查询使用申请
|
||||
@ -18,33 +17,33 @@ public interface IUseApplyService
|
||||
* @param id 使用申请主键
|
||||
* @return 使用申请
|
||||
*/
|
||||
public UseApply selectUseApplyById(String id);
|
||||
public ToolApply selectToolApplyById(String id);
|
||||
|
||||
UseApply getInfoByBpmcId(String bpmcId);
|
||||
ToolApply getInfoByBpmcId(String bpmcId);
|
||||
|
||||
/**
|
||||
* 查询使用申请列表
|
||||
*
|
||||
* @param useApply 使用申请
|
||||
* @param toolApply 使用申请
|
||||
* @return 使用申请集合
|
||||
*/
|
||||
public List<UseApply> selectUseApplyList(UseApply useApply);
|
||||
public List<ToolApply> selectToolApplyList(ToolApply toolApply);
|
||||
|
||||
/**
|
||||
* 新增使用申请
|
||||
*
|
||||
* @param useApply 使用申请
|
||||
* @param toolApply 使用申请
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertUseApply(UseApply useApply);
|
||||
public int insertToolApply(ToolApply toolApply);
|
||||
|
||||
/**
|
||||
* 修改使用申请
|
||||
*
|
||||
* @param useApply 使用申请
|
||||
* @param toolApply 使用申请
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUseApply(UseApply useApply);
|
||||
public int updateToolApply(ToolApply toolApply);
|
||||
|
||||
/**
|
||||
* 批量删除使用申请
|
||||
@ -52,7 +51,7 @@ public interface IUseApplyService
|
||||
* @param ids 需要删除的使用申请主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUseApplyByIds(String[] ids);
|
||||
public int deleteToolApplyByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除使用申请信息
|
||||
@ -60,7 +59,11 @@ public interface IUseApplyService
|
||||
* @param id 使用申请主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUseApplyById(String id);
|
||||
public int deleteToolApplyById(String id);
|
||||
|
||||
boolean checkUseApply(String toolId, String userId);
|
||||
boolean hasToolUseApply(String toolId, String userId);
|
||||
|
||||
boolean checkToolUseApply(String toolId, String userId);
|
||||
|
||||
void sendTzMessage(ToolApply toolApply);
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
package com.rzdata.web.service;
|
||||
|
||||
import com.rzdata.common.core.domain.ToolTreeSelect;
|
||||
import com.rzdata.web.domain.ToolRelation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* tool_relationService接口
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-09-08
|
||||
*/
|
||||
public interface IToolRelationService
|
||||
{
|
||||
/**
|
||||
* 查询tool_relation
|
||||
*
|
||||
* @param id tool_relation主键
|
||||
* @return tool_relation
|
||||
*/
|
||||
public ToolRelation selectToolRelationById(String id);
|
||||
|
||||
/**
|
||||
* 查询tool_relation列表
|
||||
*
|
||||
* @param toolRelation tool_relation
|
||||
* @return tool_relation集合
|
||||
*/
|
||||
public List<ToolRelation> selectToolRelationList(ToolRelation toolRelation);
|
||||
public List<ToolRelation> selectRelationToolList(ToolRelation toolRelation);
|
||||
|
||||
/**
|
||||
* 新增tool_relation
|
||||
*
|
||||
* @param toolRelation tool_relation
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertToolRelation(ToolRelation toolRelation);
|
||||
|
||||
/**
|
||||
* 修改tool_relation
|
||||
*
|
||||
* @param toolRelation tool_relation
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateToolRelation(ToolRelation toolRelation);
|
||||
|
||||
/**
|
||||
* 批量删除tool_relation
|
||||
*
|
||||
* @param ids 需要删除的tool_relation主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteToolRelationByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除tool_relation信息
|
||||
*
|
||||
* @param id tool_relation主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteToolRelationById(String id);
|
||||
|
||||
/**
|
||||
* 获取数据树
|
||||
* @param toolRelation
|
||||
* @return
|
||||
*/
|
||||
List<ToolTreeSelect> getDataThree(ToolRelation toolRelation);
|
||||
|
||||
public int batchInsert(List<ToolRelation> toolRelationList);
|
||||
|
||||
/**根据资源id和目标id去删除 **/
|
||||
public int deleteResourceAndTarget(ToolRelation toolRelation);
|
||||
/** 根据目标id和源id去删除 **/
|
||||
public int deleteTargetAndResource(ToolRelation toolRelation);
|
||||
}
|
@ -3,6 +3,7 @@ package com.rzdata.web.service;
|
||||
import com.rzdata.web.domain.Tool;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 工具信息Service接口
|
||||
@ -30,6 +31,10 @@ public interface IToolService
|
||||
*/
|
||||
public List<Tool> selectToolList(Tool tool);
|
||||
|
||||
|
||||
/** 查询所有数据 **/
|
||||
public List<Tool> selectAllNotAuthList(Tool tool);
|
||||
|
||||
/**
|
||||
* 新增工具信息
|
||||
*
|
||||
@ -38,6 +43,14 @@ public interface IToolService
|
||||
*/
|
||||
public int insertTool(Tool tool);
|
||||
|
||||
/**
|
||||
* 新增工具关联关系信息
|
||||
*
|
||||
* @param tool 工具信息
|
||||
* @return 结果
|
||||
*/
|
||||
public void saveToolRelation(Tool tool, Boolean isDel);
|
||||
|
||||
public boolean checkToolExist(Tool tTool);
|
||||
|
||||
/**
|
||||
@ -63,4 +76,28 @@ public interface IToolService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteToolByToolId(String toolId);
|
||||
|
||||
/**
|
||||
* 删除文档和附件
|
||||
* @param tool
|
||||
*/
|
||||
public void delFile(Tool tool);
|
||||
|
||||
/**
|
||||
* 新增文档和附件
|
||||
* @param tool
|
||||
*/
|
||||
public void addFileList(Tool tool);
|
||||
|
||||
void recordToolApply(Tool tool);
|
||||
|
||||
void updateDocPushStatus(Tool tTool);
|
||||
|
||||
void sendTzMessage(Tool tTool);
|
||||
|
||||
Map<String, Object> statistics();
|
||||
|
||||
List<Tool> selectAllList(Tool tool);
|
||||
|
||||
boolean isDownloadStatus(String userId, Tool tool);
|
||||
}
|
||||
|
@ -0,0 +1,74 @@
|
||||
package com.rzdata.web.service;
|
||||
|
||||
import com.rzdata.web.domain.TzMessage;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 消息Service接口
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-08-31
|
||||
*/
|
||||
public interface ITzMessageService
|
||||
{
|
||||
/**
|
||||
* 查询消息
|
||||
*
|
||||
* @param id 消息主键
|
||||
* @return 消息
|
||||
*/
|
||||
public TzMessage selectTzMessageById(String id);
|
||||
|
||||
/**
|
||||
* 查询消息列表
|
||||
*
|
||||
* @param tzMessage 消息
|
||||
* @return 消息集合
|
||||
*/
|
||||
public List<TzMessage> selectTzMessageList(TzMessage tzMessage);
|
||||
|
||||
/**
|
||||
* 新增消息
|
||||
*
|
||||
* @param tzMessage 消息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTzMessage(TzMessage tzMessage);
|
||||
|
||||
/**
|
||||
* 修改消息
|
||||
*
|
||||
* @param tzMessage 消息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTzMessage(TzMessage tzMessage);
|
||||
|
||||
/**
|
||||
* 批量删除消息
|
||||
*
|
||||
* @param ids 需要删除的消息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTzMessageByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除消息信息
|
||||
*
|
||||
* @param id 消息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTzMessageById(String id);
|
||||
|
||||
int allMarkedRead(TzMessage tzMessage);
|
||||
|
||||
public int batchInsert(List<TzMessage> tzMessageList);
|
||||
|
||||
/**
|
||||
* 未读消息数量
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
int selectTzMessageByUserCount(String userId);
|
||||
}
|
@ -1,8 +1,6 @@
|
||||
package com.rzdata.web.service;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
@ -10,10 +8,13 @@ import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.blueland.bpmclient.BpmClient;
|
||||
import com.blueland.bpmclient.model.*;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.rzdata.common.core.domain.entity.SysUser;
|
||||
import com.rzdata.common.utils.SecurityUtils;
|
||||
import com.rzdata.common.utils.StringUtils;
|
||||
import com.rzdata.system.service.ISysConfigService;
|
||||
import com.rzdata.system.service.ISysDeptService;
|
||||
import com.rzdata.system.service.ISysUserService;
|
||||
import com.rzdata.web.core.config.BpmcConfig;
|
||||
import com.rzdata.web.domain.WorkFlowInfo;
|
||||
import com.rzdata.web.domain.bo.BpmClientInputModelBo;
|
||||
@ -23,9 +24,10 @@ import org.apache.commons.compress.utils.Lists;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.rmi.ServerException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@Service("workflowService")
|
||||
@ -48,8 +50,15 @@ public class WorkflowService {
|
||||
@Autowired
|
||||
ISysDeptService sysDeptService;
|
||||
|
||||
@Autowired
|
||||
ISysUserService sysUserService;
|
||||
|
||||
@Autowired
|
||||
IWorkflowLogService iWorkflowLogService;
|
||||
|
||||
@Autowired
|
||||
private ITzMessageService tzMessageService;
|
||||
|
||||
private final static String CUR_ACT_DEF_KEY = "curActDef";
|
||||
private final static String CUR_ACT_INST_KEY = "curActInst";
|
||||
private final static String PROC_INST_KEY = "procInst";
|
||||
@ -359,6 +368,16 @@ public class WorkflowService {
|
||||
pageVo.setPageNumber(pageResultModel.getThisPageNumber());
|
||||
pageVo.setTotalCount(pageResultModel.getTotalCount());
|
||||
List<WorkFlowInfo> workFlowInfos = JSONUtil.toList(JSONUtil.toJsonStr(pageResultModel.getResult()), WorkFlowInfo.class);
|
||||
for(WorkFlowInfo workFlowInfo : workFlowInfos){
|
||||
SysUser startSysUser = sysUserService.selectUserByUserName(workFlowInfo.getStartUserId());
|
||||
if(null != startSysUser){
|
||||
workFlowInfo.setStartUserName(startSysUser.getUserName());
|
||||
}
|
||||
SysUser sendSysUser = sysUserService.selectUserByUserName(workFlowInfo.getSendUserId());
|
||||
if(null != sendSysUser){
|
||||
workFlowInfo.setSendUserName(sendSysUser.getUserName());
|
||||
}
|
||||
}
|
||||
pageVo.setResult(workFlowInfos);
|
||||
return pageVo;
|
||||
} catch (Exception ex) {
|
||||
@ -776,4 +795,32 @@ public class WorkflowService {
|
||||
String url = String.format("%s/%s?procInstId=%s", bpmcConfig.getServiceUrl(), workflowConfig.getRecordQueryUrl(), porcInstId);
|
||||
return JSONArray.parseArray(getBpmClient().get(url));
|
||||
}
|
||||
|
||||
public Map<String, Object> selectUserMsgCount(SysUser user) {
|
||||
Map<String, Object> resultMap = Maps.newHashMap();
|
||||
int totalMsgCount = 0;
|
||||
int msgCount = 0;
|
||||
int taskCount = 0;
|
||||
try {
|
||||
msgCount = tzMessageService.selectTzMessageByUserCount(String.valueOf(user.getUserId()));
|
||||
totalMsgCount = msgCount;
|
||||
resultMap.put("msgCount", msgCount);
|
||||
} catch (Exception e){
|
||||
log.error("查询消息中心未读消息数量异常", e);
|
||||
}
|
||||
try {
|
||||
SearchQuery searchQuery = new SearchQuery();
|
||||
searchQuery.setRecUserId(user.getUserName());
|
||||
searchQuery.setStatus(1);
|
||||
Map<String, Integer> resultRecordCount = getRecordCount(searchQuery);
|
||||
taskCount = resultRecordCount.get("count");
|
||||
totalMsgCount += taskCount;
|
||||
} catch (Exception e){
|
||||
log.error("查询待办消息数量异常", e);
|
||||
}
|
||||
resultMap.put("msgCount", msgCount);
|
||||
resultMap.put("taskCount", taskCount);
|
||||
resultMap.put("totalMsgCount", totalMsgCount);
|
||||
return resultMap;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,192 @@
|
||||
package com.rzdata.web.service.impl;
|
||||
|
||||
import com.documents4j.api.DocumentType;
|
||||
import com.documents4j.api.IConverter;
|
||||
import com.documents4j.job.LocalConverter;
|
||||
import com.rzdata.common.config.JaConfig;
|
||||
import com.rzdata.common.constant.Constants;
|
||||
import com.rzdata.common.exception.ServiceException;
|
||||
import com.rzdata.common.utils.StringUtils;
|
||||
import com.rzdata.web.domain.Attachment;
|
||||
import com.rzdata.web.mapper.AttachmentMapper;
|
||||
import com.rzdata.web.service.IAttachmentService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 附件Service业务层处理
|
||||
*
|
||||
* @author panchichun
|
||||
* @date 2024-08-28
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class AttachmentServiceImpl implements IAttachmentService
|
||||
{
|
||||
@Autowired
|
||||
private AttachmentMapper attachmentMapper;
|
||||
|
||||
/**
|
||||
* 查询附件
|
||||
*
|
||||
* @param id 附件主键
|
||||
* @return 附件
|
||||
*/
|
||||
@Override
|
||||
public Attachment selectAttachmentById(String id)
|
||||
{
|
||||
return attachmentMapper.selectAttachmentById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询附件列表
|
||||
*
|
||||
* @param attachment 附件
|
||||
* @return 附件
|
||||
*/
|
||||
@Override
|
||||
public List<Attachment> selectAttachmentList(Attachment attachment)
|
||||
{
|
||||
return attachmentMapper.selectAttachmentList(attachment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增附件
|
||||
*
|
||||
* @param attachment 附件
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAttachment(Attachment attachment)
|
||||
{
|
||||
return attachmentMapper.insertAttachment(attachment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改附件
|
||||
*
|
||||
* @param attachment 附件
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAttachment(Attachment attachment)
|
||||
{
|
||||
return attachmentMapper.updateAttachment(attachment);
|
||||
}
|
||||
/**
|
||||
* 修改附件
|
||||
*
|
||||
* @param attachment 附件
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAttachmentByBusinessId(Attachment attachment)
|
||||
{
|
||||
return attachmentMapper.updateAttachmentByBusinessId(attachment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除附件
|
||||
*
|
||||
* @param ids 需要删除的附件主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAttachmentByIds(String[] ids)
|
||||
{
|
||||
return attachmentMapper.deleteAttachmentByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除附件
|
||||
*
|
||||
* @param businessIds 需要删除的附件主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAttachmentByBusinessId(List<String> businessIds)
|
||||
{
|
||||
return attachmentMapper.deleteAttachmentByBusinessId(businessIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除附件信息
|
||||
*
|
||||
* @param id 附件主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAttachmentById(String id)
|
||||
{
|
||||
return attachmentMapper.deleteAttachmentById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchInsert(List<Attachment> batch) {
|
||||
return attachmentMapper.batchInsert(batch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] loadFileAsBytes(Attachment attachment) {
|
||||
// 本地资源路径
|
||||
String localPath = JaConfig.getProfile();
|
||||
// 全路径
|
||||
String uploadPath = localPath + StringUtils.substringAfter(attachment.getFilePath(), Constants.RESOURCE_PREFIX);
|
||||
String fileName = attachment.getFileOldName();
|
||||
File file = null;
|
||||
|
||||
if (fileName.endsWith(Constants.FILE_TYPE_DOC)) {
|
||||
//获取doc名称转换为pdf名称
|
||||
String fileNameDocx = fileName.substring(0, fileName.lastIndexOf(Constants.SYMBOL_POINT));
|
||||
fileNameDocx += Constants.FILE_TYPE_PDF;
|
||||
//获取转换的路径
|
||||
String pathDocx = uploadPath.substring(0, uploadPath.lastIndexOf('/') + 1) + fileNameDocx;
|
||||
file = new File(pathDocx);
|
||||
if (!file.exists()) {
|
||||
convertDocToPdf(uploadPath,pathDocx);
|
||||
// 再次检查转换后的文件是否存在
|
||||
if (!file.exists()) {
|
||||
throw new ServiceException("转换后的文件不存在");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
file = new File(uploadPath);
|
||||
}
|
||||
|
||||
byte[] result = null;
|
||||
try (FileInputStream fis = new FileInputStream(file);
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream(1000);) {
|
||||
byte[] b = new byte[1000];
|
||||
int n;
|
||||
while ((n = fis.read(b)) != -1) {
|
||||
bos.write(b, 0, n);
|
||||
}
|
||||
result = bos.toByteArray();
|
||||
} catch (Exception ex) {
|
||||
log.error("AttachmentServiceImpl-->loadFileAsBytes----ex###", ex);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* word文件doc格式转换为pdf文件
|
||||
* @param docPath
|
||||
* @param pdfPath
|
||||
*/
|
||||
public static void convertDocToPdf(String docPath, String pdfPath){
|
||||
File file = new File(docPath);
|
||||
File outputFile = new File(pdfPath);
|
||||
try (InputStream docxInputStream = new FileInputStream(file);
|
||||
OutputStream outputStream = new FileOutputStream(outputFile)) {
|
||||
IConverter converter = LocalConverter.builder().build();
|
||||
converter.convert(docxInputStream).as(DocumentType.DOCX).to(outputStream).as(DocumentType.PDF).execute();
|
||||
} catch (IOException e) {
|
||||
log.error("AttachmentServiceImpl-->convertDocToPdf----e###", e);
|
||||
throw new ServiceException("转换异常");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,147 @@
|
||||
package com.rzdata.web.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Snowflake;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.rzdata.common.constant.Constants;
|
||||
import com.rzdata.common.utils.DateUtils;
|
||||
import com.rzdata.common.utils.SecurityUtils;
|
||||
import com.rzdata.web.domain.Discussions;
|
||||
import com.rzdata.web.domain.Replies;
|
||||
import com.rzdata.web.mapper.DiscussionsMapper;
|
||||
import com.rzdata.web.service.IDiscussionsService;
|
||||
import com.rzdata.web.service.IRepliesService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 讨论Service业务层处理
|
||||
*
|
||||
* @author panchichun
|
||||
* @date 2024-08-30
|
||||
*/
|
||||
@Service
|
||||
public class DiscussionsServiceImpl implements IDiscussionsService
|
||||
{
|
||||
@Autowired
|
||||
private DiscussionsMapper discussionsMapper;
|
||||
|
||||
@Autowired
|
||||
private Snowflake snowflake;
|
||||
|
||||
@Autowired
|
||||
private IRepliesService iRepliesService;
|
||||
|
||||
/**
|
||||
* 查询讨论
|
||||
*
|
||||
* @param id 讨论主键
|
||||
* @return 讨论
|
||||
*/
|
||||
@Override
|
||||
public Discussions selectDiscussionsById(String id)
|
||||
{
|
||||
return discussionsMapper.selectDiscussionsById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询讨论列表
|
||||
*
|
||||
* @param discussions 讨论
|
||||
* @return 讨论
|
||||
*/
|
||||
@Override
|
||||
public List<Discussions> selectDiscussionsList(Discussions discussions)
|
||||
{
|
||||
List<Discussions> discussionsList = discussionsMapper.selectDiscussionsList(discussions);
|
||||
//组装回复对象数据
|
||||
assembleReplies(discussionsList);
|
||||
return discussionsList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 组装回复对象数据
|
||||
* @param discussionsList
|
||||
*/
|
||||
private void assembleReplies(List<Discussions> discussionsList) {
|
||||
List<String> idList = discussionsList.stream().map(Discussions::getId).collect(Collectors.toList());
|
||||
Replies replies = new Replies();
|
||||
replies.setDiscussionIdList(idList);
|
||||
List<Replies> repliesList = iRepliesService.selectRepliesList(replies);
|
||||
if(CollUtil.isNotEmpty(repliesList)){
|
||||
for (Discussions disItem : discussionsList) {
|
||||
List<Replies> addList = new ArrayList<>();
|
||||
for (Replies repItem : repliesList) {
|
||||
if(repItem.getDiscussionId().equals(disItem.getId())){
|
||||
if(StrUtil.isNotEmpty(repItem.getRepId())){
|
||||
Replies repliesTarget = iRepliesService.selectRepliesById(repItem.getRepId());
|
||||
repItem.setRepTargetNickName(repliesTarget.getNickName());
|
||||
}
|
||||
addList.add(repItem);
|
||||
}
|
||||
}
|
||||
if(CollUtil.isNotEmpty(addList)){
|
||||
disItem.setRepliesList(addList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增讨论
|
||||
*
|
||||
* @param discussions 讨论
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDiscussions(Discussions discussions)
|
||||
{
|
||||
discussions.setId(String.valueOf(snowflake.nextId()));
|
||||
discussions.setCreateTime(DateUtils.getNowDate());
|
||||
discussions.setCreateBy(SecurityUtils.getLoginUser().getUsername());
|
||||
discussions.setCreateById(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
|
||||
discussions.setIsDelete(Constants.STR_ZERO);
|
||||
return discussionsMapper.insertDiscussions(discussions);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改讨论
|
||||
*
|
||||
* @param discussions 讨论
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDiscussions(Discussions discussions)
|
||||
{
|
||||
discussions.setUpdateTime(DateUtils.getNowDate());
|
||||
return discussionsMapper.updateDiscussions(discussions);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除讨论
|
||||
*
|
||||
* @param ids 需要删除的讨论主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDiscussionsByIds(String[] ids)
|
||||
{
|
||||
return discussionsMapper.deleteDiscussionsByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除讨论信息
|
||||
*
|
||||
* @param id 讨论主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDiscussionsById(String id)
|
||||
{
|
||||
return discussionsMapper.deleteDiscussionsById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,184 @@
|
||||
package com.rzdata.web.service.impl;
|
||||
|
||||
import cn.hutool.core.lang.Snowflake;
|
||||
import com.rzdata.common.core.domain.ToolTreeSelect;
|
||||
import com.rzdata.common.core.domain.TreeSelect;
|
||||
import com.rzdata.common.utils.DateUtils;
|
||||
import com.rzdata.common.utils.SecurityUtils;
|
||||
import com.rzdata.common.utils.StringUtils;
|
||||
import com.rzdata.common.core.domain.DocumentCategory;
|
||||
import com.rzdata.web.mapper.DocumentCategoryMapper;
|
||||
import com.rzdata.web.service.IDocumentCategoryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 文档资源分类管理Service业务层处理
|
||||
*
|
||||
* @author spongepan
|
||||
* @date 2024-08-27
|
||||
*/
|
||||
@Service
|
||||
public class DocumentCategoryServiceImpl implements IDocumentCategoryService
|
||||
{
|
||||
@Autowired
|
||||
private DocumentCategoryMapper documentCategoryMapper;
|
||||
|
||||
@Autowired
|
||||
private Snowflake snowflake;
|
||||
|
||||
/**
|
||||
* 查询文档资源分类管理
|
||||
*
|
||||
* @param id 文档资源分类管理主键
|
||||
* @return 文档资源分类管理
|
||||
*/
|
||||
@Override
|
||||
public DocumentCategory selectDocumentCategoryById(String id)
|
||||
{
|
||||
return documentCategoryMapper.selectDocumentCategoryById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文档资源分类管理列表
|
||||
*
|
||||
* @param documentCategory 文档资源分类管理
|
||||
* @return 文档资源分类管理
|
||||
*/
|
||||
@Override
|
||||
public List<DocumentCategory> selectDocumentCategoryList(DocumentCategory documentCategory)
|
||||
{
|
||||
return documentCategoryMapper.selectDocumentCategoryList(documentCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文档资源分类管理
|
||||
*
|
||||
* @param documentCategory 文档资源分类管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDocumentCategory(DocumentCategory documentCategory)
|
||||
{
|
||||
documentCategory.setId(String.valueOf(snowflake.nextId()));
|
||||
documentCategory.setCreateTime(DateUtils.getNowDate());
|
||||
documentCategory.setCreateBy(SecurityUtils.getLoginUser().getUsername());
|
||||
documentCategory.setCreateById(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
|
||||
return documentCategoryMapper.insertDocumentCategory(documentCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文档资源分类管理
|
||||
*
|
||||
* @param documentCategory 文档资源分类管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDocumentCategory(DocumentCategory documentCategory)
|
||||
{
|
||||
documentCategory.setUpdateTime(DateUtils.getNowDate());
|
||||
return documentCategoryMapper.updateDocumentCategory(documentCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除文档资源分类管理
|
||||
*
|
||||
* @param ids 需要删除的文档资源分类管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDocumentCategoryByIds(String[] ids)
|
||||
{
|
||||
return documentCategoryMapper.deleteDocumentCategoryByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文档资源分类管理信息
|
||||
*
|
||||
* @param id 文档资源分类管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDocumentCategoryById(String id)
|
||||
{
|
||||
return documentCategoryMapper.deleteDocumentCategoryById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ToolTreeSelect> selectDocumentTreeList(DocumentCategory documentCategory) {
|
||||
List<DocumentCategory> documentCategoryList = documentCategoryMapper.selectDocumentCategoryList(documentCategory);
|
||||
return buildDeptTreeSelect(documentCategoryList);
|
||||
}
|
||||
|
||||
public List<ToolTreeSelect> buildDeptTreeSelect(List<DocumentCategory> documentCategory)
|
||||
{
|
||||
List<DocumentCategory> docCategoryTree = buildDeptTree(documentCategory);
|
||||
return docCategoryTree.stream().map(ToolTreeSelect::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public List<DocumentCategory> buildDeptTree(List<DocumentCategory> documentCategoryList)
|
||||
{
|
||||
List<DocumentCategory> returnList = new ArrayList<DocumentCategory>();
|
||||
List<String> tempList = documentCategoryList.stream().map(DocumentCategory::getId).collect(Collectors.toList());
|
||||
for (DocumentCategory documentCategory : documentCategoryList)
|
||||
{
|
||||
// 如果是顶级节点, 遍历该父节点的所有子节点
|
||||
if (!tempList.contains(documentCategory.getParentId()))
|
||||
{
|
||||
recursionFn(documentCategoryList, documentCategory);
|
||||
returnList.add(documentCategory);
|
||||
}
|
||||
}
|
||||
if (returnList.isEmpty())
|
||||
{
|
||||
returnList = documentCategoryList;
|
||||
}
|
||||
return returnList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归列表
|
||||
*/
|
||||
private void recursionFn(List<DocumentCategory> list, DocumentCategory t)
|
||||
{
|
||||
// 得到子节点列表
|
||||
List<DocumentCategory> childList = getChildList(list, t);
|
||||
t.setChildren(childList);
|
||||
for (DocumentCategory tChild : childList)
|
||||
{
|
||||
if (hasChild(list, tChild))
|
||||
{
|
||||
recursionFn(list, tChild);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<DocumentCategory> getChildList(List<DocumentCategory> list, DocumentCategory t)
|
||||
{
|
||||
List<DocumentCategory> tlist = new ArrayList<DocumentCategory>();
|
||||
Iterator<DocumentCategory> it = list.iterator();
|
||||
while (it.hasNext())
|
||||
{
|
||||
DocumentCategory n = (DocumentCategory) it.next();
|
||||
if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().equals(t.getId()))
|
||||
{
|
||||
tlist.add(n);
|
||||
}
|
||||
}
|
||||
return tlist;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断是否有子节点
|
||||
*/
|
||||
private boolean hasChild(List<DocumentCategory> list, DocumentCategory t)
|
||||
{
|
||||
return getChildList(list, t).size() > 0;
|
||||
}
|
||||
}
|
@ -1,14 +1,37 @@
|
||||
package com.rzdata.web.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Snowflake;
|
||||
import cn.hutool.core.util.BooleanUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.rzdata.common.annotation.DataScope;
|
||||
import com.rzdata.common.constant.Constants;
|
||||
import com.rzdata.common.core.domain.entity.SysDictData;
|
||||
import com.rzdata.common.core.domain.entity.SysUser;
|
||||
import com.rzdata.common.exception.ServiceException;
|
||||
import com.rzdata.common.utils.DateUtils;
|
||||
import com.rzdata.common.utils.SecurityUtils;
|
||||
import com.rzdata.system.service.ISysDeptService;
|
||||
import com.rzdata.system.service.ISysDictTypeService;
|
||||
import com.rzdata.system.service.ISysUserService;
|
||||
import com.rzdata.web.domain.Attachment;
|
||||
import com.rzdata.web.domain.Document;
|
||||
import com.rzdata.web.domain.Tool;
|
||||
import com.rzdata.web.domain.TzMessage;
|
||||
import com.rzdata.web.mapper.DocumentMapper;
|
||||
import com.rzdata.web.service.IDocumentService;
|
||||
import com.rzdata.web.service.IToolApplyService;
|
||||
import com.rzdata.web.service.ITzMessageService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service业务层处理
|
||||
@ -16,11 +39,36 @@ import java.util.List;
|
||||
* @author ja
|
||||
* @date 2024-07-09
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class DocumentServiceImpl implements IDocumentService
|
||||
{
|
||||
@Autowired
|
||||
private DocumentMapper documentMapper;
|
||||
@Autowired
|
||||
private AttachmentServiceImpl attachmentService;
|
||||
@Autowired
|
||||
private ToolServiceImpl toolService;
|
||||
|
||||
@Autowired
|
||||
private IToolApplyService iUseApplyService;
|
||||
|
||||
@Autowired
|
||||
private ISysDictTypeService sysDictTypeService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private ISysDeptService sysDeptService;
|
||||
|
||||
@Autowired
|
||||
private Snowflake snowflake;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService iSysUserService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private ITzMessageService tzMessageService;
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
@ -31,19 +79,93 @@ public class DocumentServiceImpl implements IDocumentService
|
||||
@Override
|
||||
public Document selectDocumentById(String docId)
|
||||
{
|
||||
return documentMapper.selectDocumentById(docId);
|
||||
Document document = documentMapper.selectDocumentById(docId);
|
||||
if(StrUtil.isNotBlank(document.getToolId())){
|
||||
Tool tool = toolService.selectToolByToolId(document.getToolId());
|
||||
document.setToolName(tool.getToolName());
|
||||
}
|
||||
document.setDocRespDeptName(sysDeptService.getDeptName(document.getDocRespDept()));
|
||||
Attachment attachment = new Attachment();
|
||||
attachment.setBusinessId(document.getDocId());
|
||||
attachment.setDel(Constants.STR_ZERO);
|
||||
List<Attachment> attachments = attachmentService.selectAttachmentList(attachment);
|
||||
if(CollUtil.isNotEmpty(attachments)){
|
||||
document.setAttachment(attachments.get(0));
|
||||
}
|
||||
String userId = SecurityUtils.getUserId().toString();
|
||||
document.setDownloadStatus(isDownloadStatus(userId, document));
|
||||
return document;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*
|
||||
* @param Document 【请填写功能名称】
|
||||
* @param document 【请填写功能名称】
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
@Override
|
||||
public List<Document> selectDocumentList(Document Document)
|
||||
@DataScope(deptAlias = "sd", userAlias = "su")
|
||||
public List<Document> selectDocumentList(Document document)
|
||||
{
|
||||
return documentMapper.selectDocumentList(Document);
|
||||
if (BooleanUtil.isTrue(document.getPermissionCheck())) {
|
||||
if(!SysUser.isAdmin(SecurityUtils.getUserId())){
|
||||
document.setPermission(SecurityUtils.hasPermi(Constants.DOC_VIEW_PERMISSION));
|
||||
}
|
||||
}
|
||||
List<Document> documents = documentMapper.selectDocumentList(document);
|
||||
if(CollUtil.isEmpty(documents)){
|
||||
return documents;
|
||||
}
|
||||
List<String> docIds = documents.stream().map(Document::getDocId).collect(Collectors.toList());
|
||||
Attachment attachment = new Attachment();
|
||||
attachment.setBusinessIds(docIds);
|
||||
attachment.setDel(Constants.STR_ZERO);
|
||||
List<Attachment> attachments = attachmentService.selectAttachmentList(attachment);
|
||||
if(CollUtil.isEmpty(attachments)){
|
||||
return documents;
|
||||
}
|
||||
for (Document doc : documents) {
|
||||
for (Attachment att : attachments) {
|
||||
if(doc.getDocId().equals(att.getBusinessId())){
|
||||
doc.setAttachment(att);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//前端传传参开启下载权限验证
|
||||
if (BooleanUtil.isTrue(document.getDownloadCheck())) {
|
||||
String userId = SecurityUtils.getUserId().toString();
|
||||
for (Document dc: documents) {
|
||||
dc.setDownloadStatus(isDownloadStatus(userId, dc));
|
||||
}
|
||||
}
|
||||
return documents;
|
||||
}
|
||||
|
||||
private boolean isDownloadStatus(String userId, Document dc){
|
||||
//文档中 是创建人 或者 配置了下载权限
|
||||
boolean downStatus = false;
|
||||
if(SecurityUtils.hasPermi(Constants.DOC_DOWNLOAD_PERMISSION) || userId.equals(dc.getCreateById()) || SysUser.isAdmin(SecurityUtils.getUserId())){
|
||||
downStatus = true;
|
||||
}else if(StrUtil.isNotBlank(dc.getToolId()) && iUseApplyService.checkToolUseApply(dc.getToolId(), userId)){
|
||||
downStatus = true;
|
||||
}
|
||||
return downStatus;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*
|
||||
* @param document 【请填写功能名称】
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
@Override
|
||||
public List<Document> selectDocumentListAll(Document document)
|
||||
{
|
||||
List<Document> documents = documentMapper.selectDocumentList(document);
|
||||
return documents;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -60,28 +182,72 @@ public class DocumentServiceImpl implements IDocumentService
|
||||
return documentMapper.insertDocument(document);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String saveDocument(Document document){
|
||||
document.setCreateTime(DateUtils.getNowDate());
|
||||
String docId = IdUtil.simpleUUID();
|
||||
document.setDocId(docId);
|
||||
document.setCreateBy(SecurityUtils.getLoginUser().getUsername());
|
||||
document.setCreateById(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
|
||||
document.setIsDeleted(Constants.STR_ZERO);
|
||||
document.setCreateTime(new Date());
|
||||
int result = documentMapper.insertDocument(document);
|
||||
addFileList(document);
|
||||
if(result > 0){
|
||||
return docId;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delFile(Document document) {
|
||||
List<String> toolIds = Collections.singletonList(document.getDocId());
|
||||
attachmentService.deleteAttachmentByBusinessId(toolIds);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void addFileList(Document document) {
|
||||
List<Attachment> attachmentList = document.getAttachmentList();
|
||||
if(CollUtil.isEmpty(attachmentList)){
|
||||
return;
|
||||
}
|
||||
for (Attachment attachment : attachmentList) {
|
||||
attachment.setId(String.valueOf(snowflake.nextId()));
|
||||
attachment.setBusinessId(document.getDocId());
|
||||
attachment.setBizType(Constants.DOC_TYPE_DOC);
|
||||
attachment.setDel(Constants.STR_ZERO);
|
||||
attachment.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
|
||||
attachment.setCreateDate(new Date());
|
||||
}
|
||||
// 使用AtomicInteger来跟踪索引
|
||||
AtomicInteger counter = new AtomicInteger(0);
|
||||
// 使用Stream API进行分组
|
||||
Map<Integer, List<Attachment>> grouped = attachmentList.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
e -> counter.getAndIncrement() / 500
|
||||
));
|
||||
// 对每个子列表进行批量插入
|
||||
grouped.values().forEach(batch -> attachmentService.batchInsert(batch));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*
|
||||
* @param Document 【请填写功能名称】
|
||||
* @param document 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDocument(Document Document)
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int updateDocument(Document document)
|
||||
{
|
||||
Document.setUpdateTime(DateUtils.getNowDate());
|
||||
return documentMapper.updateDocument(Document);
|
||||
document.setUpdateBy(SecurityUtils.getLoginUser().getUsername());
|
||||
document.setUpdateById(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
|
||||
document.setUpdateTime(new Date());
|
||||
int result = documentMapper.updateDocument(document);
|
||||
delFile(document);
|
||||
addFileList(document);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -93,7 +259,12 @@ public class DocumentServiceImpl implements IDocumentService
|
||||
@Override
|
||||
public int deleteDocumentByIds(String[] ids)
|
||||
{
|
||||
return documentMapper.deleteDocumentByIds(ids);
|
||||
Document doc = new Document();
|
||||
doc.setIds(Arrays.asList(ids));
|
||||
doc.setUpdateBy(SecurityUtils.getLoginUser().getUsername());
|
||||
doc.setUpdateById(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
|
||||
doc.setUpdateTime(new Date());
|
||||
return documentMapper.isDeleteDocumentByIds(doc);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -107,5 +278,188 @@ public class DocumentServiceImpl implements IDocumentService
|
||||
{
|
||||
return documentMapper.deleteDocumentById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布文档
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int pushDoc(String[] ids) {
|
||||
List<String> docIdList = Arrays.asList(ids);
|
||||
if(CollUtil.isEmpty(docIdList)){
|
||||
throw new ServiceException("请选择需发布的文档");
|
||||
}
|
||||
Document doc = new Document();
|
||||
doc.setIds(docIdList);
|
||||
doc.setUpdateBy(SecurityUtils.getLoginUser().getUsername());
|
||||
doc.setUpdateById(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
|
||||
doc.setDocStatus(Constants.DOC_STATUS_YFB);
|
||||
doc.setUpdateTime(new Date());
|
||||
int result = documentMapper.updatePushDoc(doc);
|
||||
//发送消息
|
||||
Document document = new Document();
|
||||
document.setDocIdList(docIdList);
|
||||
List<Document> documents = documentMapper.selectDocumentList(document);
|
||||
|
||||
SysUser sysUser = new SysUser();
|
||||
sysUser.setStatus("0");
|
||||
sysUser.setDelFlag("0");
|
||||
List<SysUser> sysUsers = iSysUserService.selectUserList(sysUser);
|
||||
for (Document docItem : documents) {
|
||||
sendTzMessage(docItem, sysUsers);
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 给消息中心发送消息
|
||||
*/
|
||||
public void sendTzMessage(Document doc, List<SysUser> sysUsers) {
|
||||
try{
|
||||
String content = doc.getDocName() + "已发布";
|
||||
List<TzMessage> addList = new ArrayList<>();
|
||||
for (SysUser user : sysUsers) {
|
||||
TzMessage tzMessage = new TzMessage();
|
||||
//雪花
|
||||
tzMessage.setId(String.valueOf(snowflake.nextId()));
|
||||
tzMessage.setBusinessId(doc.getDocId());
|
||||
tzMessage.setBusinessType(Constants.DOC_TYPE_DOC);
|
||||
tzMessage.setReceiverId(String.valueOf(user.getUserId()));
|
||||
tzMessage.setStates(1);
|
||||
tzMessage.setContent(content);
|
||||
tzMessage.setDeleted("0");
|
||||
tzMessage.setCreateTime(DateUtils.getNowDate());
|
||||
tzMessage.setCreateBy(SecurityUtils.getLoginUser().getUsername());
|
||||
tzMessage.setCreateById(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
|
||||
addList.add(tzMessage);
|
||||
}
|
||||
// 使用AtomicInteger来跟踪索引
|
||||
AtomicInteger counter = new AtomicInteger(0);
|
||||
// 使用Stream API进行分组
|
||||
Map<Integer, List<TzMessage>> grouped = addList.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
e -> counter.getAndIncrement() / 500
|
||||
));
|
||||
// 对每个子列表进行批量插入
|
||||
grouped.values().forEach(batch -> tzMessageService.batchInsert(batch));
|
||||
}catch (Exception e){
|
||||
log.error("UseApplyServiceImpl-->sendTzMessage--发送消息中心异常--e###", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除附件
|
||||
* @param docIds
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int batchDeleteById(List<String> docIds){
|
||||
return documentMapper.batchDeleteById(docIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> statistics() {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
List<Map<String, Object>> countType = this.documentMapper.countType();
|
||||
List<Map<String, Object>> countSource = this.documentMapper.countSource();
|
||||
//组织数据
|
||||
assembleData(countType, countSource);
|
||||
result.put("countType", countType);
|
||||
result.put("countSource", countSource);
|
||||
return result;
|
||||
}
|
||||
|
||||
private void assembleData(List<Map<String, Object>> countType, List<Map<String, Object>> countSource) {
|
||||
//
|
||||
List<SysDictData> docClassList = sysDictTypeService.selectDictDataByType("doc_class");
|
||||
List<SysDictData> docSourceList = sysDictTypeService.selectDictDataByType("doc_source");
|
||||
|
||||
//初始化数据
|
||||
initDictData(docClassList,countType);
|
||||
initDictData(docSourceList, countSource);
|
||||
|
||||
if(CollUtil.isNotEmpty(countType)){
|
||||
for (Map<String, Object> map : countType) {
|
||||
map.put("value", map.get("statistics"));
|
||||
for (SysDictData sysDictData : docClassList) {
|
||||
if(sysDictData.getDictValue().equals(map.get("types"))){
|
||||
map.put("name", sysDictData.getDictLabel());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(CollUtil.isNotEmpty(countSource)){
|
||||
for (Map<String, Object> map : countSource) {
|
||||
map.put("value", map.get("statistics"));
|
||||
for (SysDictData sysDictData : docSourceList) {
|
||||
if(sysDictData.getDictValue().equals(map.get("types"))){
|
||||
map.put("name", sysDictData.getDictLabel());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void initDictData(List<SysDictData> dictDataList, List<Map<String, Object>> mapTypeList) {
|
||||
for (SysDictData sysDictData : dictDataList) {
|
||||
boolean flag = false;
|
||||
for (Map<String, Object> map : mapTypeList) {
|
||||
if(sysDictData.getDictValue().equals(map.get("types"))){
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!flag){
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("value", "0");
|
||||
map.put("name", sysDictData.getDictLabel());
|
||||
map.put("types", sysDictData.getDictValue());
|
||||
map.put("statistics", "0");
|
||||
mapTypeList.add(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Document> selectAllList(Document document) {
|
||||
List<Document> documents = documentMapper.selectDocumentList(document);
|
||||
List<SysDictData> docClassList = sysDictTypeService.selectDictDataByType("doc_class");
|
||||
List<SysDictData> docSourceList = sysDictTypeService.selectDictDataByType("doc_source");
|
||||
List<SysDictData> docStatusList = sysDictTypeService.selectDictDataByType("doc_upload_status");
|
||||
for (Document item : documents) {
|
||||
for (SysDictData sysDictData : docClassList) {
|
||||
if(sysDictData.getDictValue().equals(item.getDocType())){
|
||||
item.setDocTypeName(sysDictData.getDictLabel());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (SysDictData sysDictData : docSourceList) {
|
||||
if(sysDictData.getDictValue().equals(item.getDocSource())){
|
||||
item.setDocSourceName(sysDictData.getDictLabel());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (SysDictData sysDictData : docStatusList) {
|
||||
if(sysDictData.getDictValue().equals(item.getDocStatus())){
|
||||
item.setStatusName(sysDictData.getDictLabel());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( StrUtil.isNotBlank(item.getDocRespDept())){
|
||||
item.setDocRespDeptName(sysDeptService.getDeptName(item.getDocRespDept()));
|
||||
}
|
||||
item.setCreateNowTime(DateUtil.format(item.getCreateTime(), "yyyy-MM-dd hh:mm"));
|
||||
}
|
||||
return documents;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,115 @@
|
||||
package com.rzdata.web.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.lang.Snowflake;
|
||||
import com.rzdata.common.utils.DateUtils;
|
||||
import com.rzdata.common.utils.SecurityUtils;
|
||||
import com.rzdata.web.domain.DownloadCount;
|
||||
import com.rzdata.web.mapper.DownloadCountMapper;
|
||||
import com.rzdata.web.service.IDownloadCountService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 工具下载统计Service业务层处理
|
||||
*
|
||||
* @author 潘驰春
|
||||
* @date 2024-08-31
|
||||
*/
|
||||
@Service
|
||||
public class DownloadCountServiceImpl implements IDownloadCountService
|
||||
{
|
||||
@Autowired
|
||||
private DownloadCountMapper downloadCountMapper;
|
||||
|
||||
@Autowired
|
||||
private Snowflake snowflake;
|
||||
|
||||
/**
|
||||
* 查询工具下载统计
|
||||
*
|
||||
* @param id 工具下载统计主键
|
||||
* @return 工具下载统计
|
||||
*/
|
||||
@Override
|
||||
public DownloadCount selectDownloadCountById(String id)
|
||||
{
|
||||
return downloadCountMapper.selectDownloadCountById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询工具下载统计列表
|
||||
*
|
||||
* @param downloadCount 工具下载统计
|
||||
* @return 工具下载统计
|
||||
*/
|
||||
@Override
|
||||
public List<DownloadCount> selectDownloadCountList(DownloadCount downloadCount)
|
||||
{
|
||||
return downloadCountMapper.selectDownloadCountList(downloadCount);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增工具下载统计
|
||||
*
|
||||
* @param downloadCount 工具下载统计
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDownloadCount(DownloadCount downloadCount)
|
||||
{
|
||||
downloadCount.setId(String.valueOf(snowflake.nextId()));
|
||||
downloadCount.setCreateTime(DateUtils.getNowDate());
|
||||
downloadCount.setCreateBy(SecurityUtils.getLoginUser().getUsername());
|
||||
downloadCount.setCreateById(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
|
||||
return downloadCountMapper.insertDownloadCount(downloadCount);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改工具下载统计
|
||||
*
|
||||
* @param downloadCount 工具下载统计
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDownloadCount(DownloadCount downloadCount)
|
||||
{
|
||||
downloadCount.setUpdateTime(DateUtils.getNowDate());
|
||||
return downloadCountMapper.updateDownloadCount(downloadCount);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除工具下载统计
|
||||
*
|
||||
* @param ids 需要删除的工具下载统计主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDownloadCountByIds(String[] ids)
|
||||
{
|
||||
return downloadCountMapper.deleteDownloadCountByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除工具下载统计信息
|
||||
*
|
||||
* @param id 工具下载统计主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDownloadCountById(String id)
|
||||
{
|
||||
return downloadCountMapper.deleteDownloadCountById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DownloadCount> userDownList(DownloadCount downloadCount) {
|
||||
return downloadCountMapper.userDownList(downloadCount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DownloadCount> selectDownloadDocCountList(DownloadCount downloadCount) {
|
||||
return downloadCountMapper.selectDownloadDocCountList(downloadCount);
|
||||
}
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
package com.rzdata.web.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.lang.Snowflake;
|
||||
import com.rzdata.common.constant.Constants;
|
||||
import com.rzdata.common.utils.DateUtils;
|
||||
import com.rzdata.common.utils.SecurityUtils;
|
||||
import com.rzdata.web.domain.Replies;
|
||||
import com.rzdata.web.mapper.RepliesMapper;
|
||||
import com.rzdata.web.service.IRepliesService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 回复Service业务层处理
|
||||
*
|
||||
* @author panchichun
|
||||
* @date 2024-08-30
|
||||
*/
|
||||
@Service
|
||||
public class RepliesServiceImpl implements IRepliesService
|
||||
{
|
||||
@Autowired
|
||||
private RepliesMapper repliesMapper;
|
||||
|
||||
@Autowired
|
||||
private Snowflake snowflake;
|
||||
|
||||
/**
|
||||
* 查询回复
|
||||
*
|
||||
* @param id 回复主键
|
||||
* @return 回复
|
||||
*/
|
||||
@Override
|
||||
public Replies selectRepliesById(String id)
|
||||
{
|
||||
return repliesMapper.selectRepliesById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询回复列表
|
||||
*
|
||||
* @param replies 回复
|
||||
* @return 回复
|
||||
*/
|
||||
@Override
|
||||
public List<Replies> selectRepliesList(Replies replies)
|
||||
{
|
||||
return repliesMapper.selectRepliesList(replies);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增回复
|
||||
*
|
||||
* @param replies 回复
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertReplies(Replies replies)
|
||||
{
|
||||
replies.setId(String.valueOf(snowflake.nextId()));
|
||||
replies.setCreateBy(SecurityUtils.getLoginUser().getUsername());
|
||||
replies.setCreateById(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
|
||||
replies.setCreateTime(new Date());
|
||||
replies.setIsDelete(Constants.STR_ZERO);
|
||||
return repliesMapper.insertReplies(replies);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改回复
|
||||
*
|
||||
* @param replies 回复
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateReplies(Replies replies)
|
||||
{
|
||||
replies.setUpdateTime(DateUtils.getNowDate());
|
||||
return repliesMapper.updateReplies(replies);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除回复
|
||||
*
|
||||
* @param ids 需要删除的回复主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRepliesByIds(String[] ids)
|
||||
{
|
||||
return repliesMapper.deleteRepliesByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除回复信息
|
||||
*
|
||||
* @param id 回复主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRepliesById(String id)
|
||||
{
|
||||
return repliesMapper.deleteRepliesById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,166 @@
|
||||
package com.rzdata.web.service.impl;
|
||||
|
||||
import cn.hutool.core.lang.Snowflake;
|
||||
import cn.hutool.core.util.BooleanUtil;
|
||||
import com.rzdata.common.constant.Constants;
|
||||
import com.rzdata.common.core.domain.entity.SysUser;
|
||||
import com.rzdata.common.utils.DateUtils;
|
||||
import com.rzdata.common.utils.SecurityUtils;
|
||||
import com.rzdata.system.service.ISysUserService;
|
||||
import com.rzdata.web.domain.ToolApply;
|
||||
import com.rzdata.web.domain.TzMessage;
|
||||
import com.rzdata.web.domain.UseApplyItem;
|
||||
import com.rzdata.web.mapper.ToolApplyMapper;
|
||||
import com.rzdata.web.service.IToolApplyService;
|
||||
import com.rzdata.web.service.ITzMessageService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 使用申请Service业务层处理
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class ToolApplyServiceImpl implements IToolApplyService
|
||||
{
|
||||
@Autowired
|
||||
private ToolApplyMapper toolApplyMapper;
|
||||
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private Snowflake snowflake;
|
||||
|
||||
@Autowired
|
||||
private ITzMessageService tzMessageService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询使用申请
|
||||
*
|
||||
* @param id 使用申请主键
|
||||
* @return 使用申请
|
||||
*/
|
||||
@Override
|
||||
public ToolApply selectToolApplyById(String id)
|
||||
{
|
||||
return toolApplyMapper.selectToolApplyById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToolApply getInfoByBpmcId(String bpmcId){
|
||||
return toolApplyMapper.getInfoByBpmcId(bpmcId);
|
||||
}
|
||||
/**
|
||||
* 查询使用申请列表
|
||||
*
|
||||
* @param toolApply 使用申请
|
||||
* @return 使用申请
|
||||
*/
|
||||
@Override
|
||||
public List<ToolApply> selectToolApplyList(ToolApply toolApply)
|
||||
{
|
||||
if(!SysUser.isAdmin(SecurityUtils.getUserId())){
|
||||
if(!SecurityUtils.hasPermi(Constants.APPLY_VIEW_ALL_PERMISSION)){
|
||||
toolApply.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
|
||||
}
|
||||
}
|
||||
return toolApplyMapper.selectToolApplyList(toolApply);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增使用申请
|
||||
*
|
||||
* @param toolApply 使用申请
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertToolApply(ToolApply toolApply)
|
||||
{
|
||||
toolApply.setCreateBy(SecurityUtils.getUserId().toString());
|
||||
toolApply.setCreateTime(DateUtils.getNowDate());
|
||||
return toolApplyMapper.insertToolApply(toolApply);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改使用申请
|
||||
*
|
||||
* @param toolApply 使用申请
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateToolApply(ToolApply toolApply)
|
||||
{
|
||||
toolApply.setUpdateBy(SecurityUtils.getUserId().toString());
|
||||
toolApply.setUpdateTime(DateUtils.getNowDate());
|
||||
return toolApplyMapper.updateToolApply(toolApply);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除使用申请
|
||||
*
|
||||
* @param ids 需要删除的使用申请主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteToolApplyByIds(String[] ids)
|
||||
{
|
||||
return toolApplyMapper.deleteToolApplyByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除使用申请信息
|
||||
*
|
||||
* @param id 使用申请主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteToolApplyById(String id)
|
||||
{
|
||||
return toolApplyMapper.deleteToolApplyById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkToolUseApply(String toolId, String userId){
|
||||
return toolApplyMapper.checkToolUseApply(toolId, userId)>0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasToolUseApply(String toolId, String userId){
|
||||
return toolApplyMapper.hasToolUseApply(toolId, userId) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendTzMessage(ToolApply toolApply) {
|
||||
try{
|
||||
SysUser sysUser = sysUserService.selectUserById(Long.valueOf(toolApply.getUserId()));
|
||||
|
||||
UseApplyItem useApplyItem = toolApply.getItemList().get(0);
|
||||
String toolName = useApplyItem.getToolName();
|
||||
|
||||
String content = toolName + "下载权限已通过";
|
||||
|
||||
TzMessage tzMessage = new TzMessage();
|
||||
//雪花
|
||||
tzMessage.setId(String.valueOf(snowflake.nextId()));
|
||||
tzMessage.setBusinessId(toolApply.getToolId());
|
||||
tzMessage.setBusinessType(Constants.ATT_TYPE_TOOL);
|
||||
tzMessage.setReceiverId(String.valueOf(sysUser.getUserId()));
|
||||
tzMessage.setStates(1);
|
||||
tzMessage.setContent(content);
|
||||
tzMessage.setDeleted("0");
|
||||
tzMessageService.insertTzMessage(tzMessage);
|
||||
}catch (Exception e){
|
||||
log.error("UseApplyServiceImpl-->sendTzMessage--发送消息中心异常--e###", e);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,302 @@
|
||||
package com.rzdata.web.service.impl;
|
||||
|
||||
import java.sql.Struct;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.rzdata.common.core.domain.ToolTreeSelect;
|
||||
import com.rzdata.common.core.domain.TreeSelect;
|
||||
import com.rzdata.common.core.domain.entity.SysDept;
|
||||
import com.rzdata.common.utils.StringUtils;
|
||||
import com.rzdata.web.domain.Tool;
|
||||
import com.rzdata.web.domain.ToolRelation;
|
||||
import com.rzdata.web.mapper.ToolRelationMapper;
|
||||
import com.rzdata.web.service.IToolRelationService;
|
||||
import com.rzdata.web.service.IToolService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* tool_relationService业务层处理
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-09-08
|
||||
*/
|
||||
@Service
|
||||
public class ToolRelationServiceImpl implements IToolRelationService
|
||||
{
|
||||
@Autowired
|
||||
private ToolRelationMapper toolRelationMapper;
|
||||
|
||||
@Autowired
|
||||
private IToolService toolService;
|
||||
|
||||
/**
|
||||
* 查询tool_relation
|
||||
*
|
||||
* @param id tool_relation主键
|
||||
* @return tool_relation
|
||||
*/
|
||||
@Override
|
||||
public ToolRelation selectToolRelationById(String id)
|
||||
{
|
||||
return toolRelationMapper.selectToolRelationById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询tool_relation列表
|
||||
*
|
||||
* @param toolRelation tool_relation
|
||||
* @return tool_relation
|
||||
*/
|
||||
@Override
|
||||
public List<ToolRelation> selectToolRelationList(ToolRelation toolRelation)
|
||||
{
|
||||
return toolRelationMapper.selectToolRelationList(toolRelation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ToolRelation> selectRelationToolList(ToolRelation toolRelation)
|
||||
{
|
||||
return toolRelationMapper.selectRelationToolList(toolRelation);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增tool_relation
|
||||
*
|
||||
* @param toolRelation tool_relation
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertToolRelation(ToolRelation toolRelation)
|
||||
{
|
||||
return toolRelationMapper.insertToolRelation(toolRelation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改tool_relation
|
||||
*
|
||||
* @param toolRelation tool_relation
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateToolRelation(ToolRelation toolRelation)
|
||||
{
|
||||
return toolRelationMapper.updateToolRelation(toolRelation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除tool_relation
|
||||
*
|
||||
* @param ids 需要删除的tool_relation主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteToolRelationByIds(String[] ids)
|
||||
{
|
||||
return toolRelationMapper.deleteToolRelationByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
@Override
|
||||
public int batchInsert(List<ToolRelation> toolRelationList)
|
||||
{
|
||||
return toolRelationMapper.batchInsert(toolRelationList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除tool_relation信息
|
||||
*
|
||||
* @param id tool_relation主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteToolRelationById(String id)
|
||||
{
|
||||
return toolRelationMapper.deleteToolRelationById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据树权限
|
||||
* @param toolRelation
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<ToolTreeSelect> getDataThree(ToolRelation toolRelation) {
|
||||
if(CollUtil.isEmpty(toolRelation.getResourceIds())){
|
||||
return null;
|
||||
}
|
||||
|
||||
List<ToolRelation> toolRelations = this.selectRelationToolList(toolRelation);
|
||||
//拿到C的数据
|
||||
ToolRelation toolRelation1 = toolRelations.get(0);
|
||||
// 查询数据库中的所有工具关系
|
||||
List<ToolRelation> allToolRelations = this.selectRelationToolList(null);
|
||||
return getDataThree(toolRelation1.getResourceId());
|
||||
|
||||
/*//查询所有关联的数据,最后在组装起来
|
||||
List<ToolRelation> toolRelations = this.selectRelationToolList(toolRelation);
|
||||
//查询所有数据
|
||||
List<ToolRelation> allToolRelation = this.selectRelationToolList(null);*/
|
||||
|
||||
// 查询所有与 C 相关的工具关系
|
||||
//List<ToolRelation> relatedToolRelations = this.selectRelationToolList(toolRelation);
|
||||
|
||||
/*
|
||||
|
||||
// 从 C 开始构建树形结构
|
||||
List<ToolTreeSelect> treeSelects = relatedToolRelations.stream()
|
||||
.map(tr -> buildChildren(tr, allToolRelations, new HashSet<>()))
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList());
|
||||
*/
|
||||
|
||||
// 构建树形结构(从 C 向上递归查找父节点)
|
||||
/* ToolTreeSelect treeSelect = buildParentTree(toolRelation, allToolRelations, new HashSet<>());
|
||||
|
||||
return treeSelect != null ? Collections.singletonList(treeSelect) : new ArrayList<>();*/
|
||||
}
|
||||
|
||||
public List<ToolTreeSelect> getDataThree(String toolResourceId) {
|
||||
// 创建链条列表用于存储递归结果
|
||||
List<ToolTreeSelect> toolChain = new ArrayList<>();
|
||||
|
||||
// 从工具 resourceId 开始递归查找
|
||||
buildToolChain(toolResourceId, toolChain);
|
||||
|
||||
return toolChain;
|
||||
}
|
||||
|
||||
// 递归构建工具链
|
||||
private void buildToolChain(String resourceId, List<ToolTreeSelect> toolChain) {
|
||||
// 根据 resourceId 查找当前工具关联关系
|
||||
ToolRelation currentToolRelation = this.findToolRelationByResourceId(resourceId);
|
||||
|
||||
if (currentToolRelation != null) {
|
||||
// 将当前工具加入链条
|
||||
ToolTreeSelect currentTool = new ToolTreeSelect();
|
||||
currentTool.setId(currentToolRelation.getId());
|
||||
currentTool.setLabel(currentToolRelation.getToolName()); // 假设有工具名称字段
|
||||
toolChain.add(currentTool);
|
||||
|
||||
// 如果当前工具的 target_id 不为空,则继续向上递归
|
||||
if (currentToolRelation.getTargetId() != null) {
|
||||
buildToolChain(currentToolRelation.getTargetId(), toolChain);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 根据 resourceId 查找 ToolRelation
|
||||
private ToolRelation findToolRelationByResourceId(String resourceId) {
|
||||
// 在数据库中查询 toolRelation 记录
|
||||
ToolRelation queryToolRelation = new ToolRelation();
|
||||
queryToolRelation.setResourceId(resourceId);
|
||||
List<ToolRelation> toolRelations = this.selectRelationToolList(queryToolRelation);
|
||||
return toolRelations.isEmpty() ? null : toolRelations.get(0);
|
||||
}
|
||||
|
||||
|
||||
// 递归向上构建父节点
|
||||
private ToolTreeSelect buildParentTree(ToolRelation currentToolRelation, List<ToolRelation> allToolRelation, Set<String> visited) {
|
||||
// 检查是否已经访问过该节点,避免死循环
|
||||
if (visited.contains(currentToolRelation.getId())) {
|
||||
return null; // 如果已访问,直接返回 null
|
||||
}
|
||||
visited.add(currentToolRelation.getId()); // 记录已访问的节点
|
||||
|
||||
// 构建当前节点的 TreeSelect
|
||||
ToolTreeSelect node = new ToolTreeSelect();
|
||||
node.setId(currentToolRelation.getResourceId()); // 设置节点 ID 为 resourceId
|
||||
node.setLabel(currentToolRelation.getToolName()); // 假设 ToolRelation 中有工具名称
|
||||
|
||||
// 查找父节点(向上递归查找与当前节点的 resource_id 对应的 target_id)
|
||||
List<ToolTreeSelect> parents = allToolRelation.stream()
|
||||
.filter(t -> currentToolRelation.getResourceId().equals(t.getTargetId())) // 找到父节点
|
||||
.map(t -> buildParentTree(t, allToolRelation, visited)) // 递归处理父节点
|
||||
.filter(Objects::nonNull) // 过滤掉 null 的父节点
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 如果有父节点,则将父节点设置为 children
|
||||
node.setChildren(parents);
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
private List<ToolTreeSelect> buildTwoTreeSelect(List<Tool> tools) {
|
||||
List<ToolTreeSelect> treeSelectList = new ArrayList<>();
|
||||
for (Tool tool : tools) {
|
||||
// 构建当前节点的 TreeSelect
|
||||
ToolTreeSelect node = new ToolTreeSelect();
|
||||
node.setId(tool.getToolId());
|
||||
node.setLabel(tool.getToolName()); // 你可能有其他字段,例如 types,可在此处设置
|
||||
node.setChildren(new ArrayList<>()); // 你可能有其他字段,例如 types,可在此处设置
|
||||
treeSelectList.add(node);
|
||||
}
|
||||
return treeSelectList;
|
||||
}
|
||||
|
||||
|
||||
// 递归构建树形结构
|
||||
private List<ToolTreeSelect> buildToolTreeSelect(List<ToolRelation> tools, List<ToolRelation> allToolRelation) {
|
||||
// 找到根节点:没有父节点的工具关系
|
||||
List<ToolTreeSelect> treeSelectList = tools.stream()
|
||||
.filter(t -> allToolRelation.stream().noneMatch(r -> r.getTargetId().equals(t.getResourceId()))) // 根节点判定:targetId 没有匹配 resourceId
|
||||
.map(t -> buildChildren(t, allToolRelation, new HashSet<>()))
|
||||
.filter(Objects::nonNull) // 过滤掉空的节点
|
||||
.collect(Collectors.toList());
|
||||
return treeSelectList;
|
||||
}
|
||||
|
||||
// 构建子节点
|
||||
private ToolTreeSelect buildChildren(ToolRelation toolRelation, List<ToolRelation> allToolRelation, Set<String> visited) {
|
||||
// 检查是否已经访问过该节点,避免死循环
|
||||
if (visited.contains(toolRelation.getId())) {
|
||||
return null; // 如果已访问,直接返回 null
|
||||
}
|
||||
visited.add(toolRelation.getId()); // 记录已访问的节点
|
||||
|
||||
// 构建当前节点的 TreeSelect
|
||||
ToolTreeSelect node = new ToolTreeSelect();
|
||||
node.setId(toolRelation.getResourceId()); // 设置节点 ID 为 resourceId
|
||||
node.setLabel(toolRelation.getToolName()); // 假设 toolName 是工具名称
|
||||
|
||||
// 查找子节点,递归构建
|
||||
List<ToolTreeSelect> children = allToolRelation.stream()
|
||||
.filter(t -> toolRelation.getTargetId().equals(t.getResourceId())) // 找到当前节点的子节点
|
||||
.map(t -> buildChildren(t, allToolRelation, visited)) // 递归处理子节点
|
||||
.filter(Objects::nonNull) // 过滤掉 null 的子节点
|
||||
.collect(Collectors.toList());
|
||||
|
||||
node.setChildren(children); // 设置子节点
|
||||
return node;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据资源id和目标id去删除
|
||||
* @param toolRelation
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int deleteResourceAndTarget(ToolRelation toolRelation)
|
||||
{
|
||||
return toolRelationMapper.deleteResourceAndTarget(toolRelation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据目标id和源id去删除
|
||||
* @param toolRelation
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int deleteTargetAndResource(ToolRelation toolRelation)
|
||||
{
|
||||
return toolRelationMapper.deleteTargetAndResource(toolRelation);
|
||||
}
|
||||
|
||||
}
|
@ -1,17 +1,35 @@
|
||||
package com.rzdata.web.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Snowflake;
|
||||
import cn.hutool.core.util.BooleanUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.blueland.bpmclient.model.BpmClientInputModel;
|
||||
import com.rzdata.common.annotation.DataScope;
|
||||
import com.rzdata.common.constant.Constants;
|
||||
import com.rzdata.common.core.domain.entity.SysDept;
|
||||
import com.rzdata.common.core.domain.entity.SysDictData;
|
||||
import com.rzdata.common.core.domain.entity.SysUser;
|
||||
import com.rzdata.common.enums.RecordStatusEnum;
|
||||
import com.rzdata.common.utils.DateUtils;
|
||||
import com.rzdata.common.utils.SecurityUtils;
|
||||
import com.rzdata.web.domain.Tool;
|
||||
import com.rzdata.system.service.ISysDeptService;
|
||||
import com.rzdata.system.service.ISysDictTypeService;
|
||||
import com.rzdata.system.service.ISysUserService;
|
||||
import com.rzdata.web.domain.*;
|
||||
import com.rzdata.web.domain.bo.BpmClientInputModelBo;
|
||||
import com.rzdata.web.mapper.ToolMapper;
|
||||
import com.rzdata.web.service.IToolService;
|
||||
import com.rzdata.web.service.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 工具信息Service业务层处理
|
||||
@ -19,12 +37,45 @@ import java.util.List;
|
||||
* @author ja
|
||||
* @date 2024-07-15
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class ToolServiceImpl implements IToolService
|
||||
{
|
||||
@Autowired
|
||||
private ToolMapper toolMapper;
|
||||
|
||||
@Autowired
|
||||
private IAttachmentService iAttachmentService;
|
||||
|
||||
@Autowired
|
||||
private IDocumentService documentService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@Autowired
|
||||
private Snowflake snowflake;
|
||||
|
||||
@Autowired
|
||||
private ITzMessageService tzMessageService;
|
||||
|
||||
@Autowired
|
||||
private ISysDictTypeService sysDictTypeService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private IToolApplyService toolApplyService;
|
||||
|
||||
@Autowired
|
||||
private ISysDeptService sysDeptService;
|
||||
|
||||
/** 工具管理表 **/
|
||||
@Autowired
|
||||
private IToolRelationService iToolRelationService;
|
||||
|
||||
@Autowired
|
||||
private IToolApplyService iToolApplyService;
|
||||
|
||||
/**
|
||||
* 查询工具信息
|
||||
*
|
||||
@ -34,7 +85,9 @@ public class ToolServiceImpl implements IToolService
|
||||
@Override
|
||||
public Tool selectToolByToolId(String toolId)
|
||||
{
|
||||
return toolMapper.selectToolByToolId(toolId);
|
||||
Tool tool = toolMapper.selectToolByToolId(toolId);
|
||||
tool.setToolRespDeptName(sysDeptService.getDeptName(tool.getToolRespDept()));
|
||||
return tool;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -49,6 +102,7 @@ public class ToolServiceImpl implements IToolService
|
||||
* @return 工具信息
|
||||
*/
|
||||
@Override
|
||||
@DataScope(deptAlias = "d", userAlias = "su")
|
||||
public List<Tool> selectToolList(Tool tool)
|
||||
{
|
||||
if (BooleanUtil.isTrue(tool.getPermissionCheck())) {
|
||||
@ -57,6 +111,15 @@ public class ToolServiceImpl implements IToolService
|
||||
return toolMapper.selectToolList(tool);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有数据不走任何
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Tool> selectAllNotAuthList(Tool tool){
|
||||
return toolMapper.selectToolList(tool);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增工具信息
|
||||
*
|
||||
@ -71,6 +134,39 @@ public class ToolServiceImpl implements IToolService
|
||||
return toolMapper.insertTool(tool);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存关联关系
|
||||
* @param tool
|
||||
*/
|
||||
@Override
|
||||
public void saveToolRelation(Tool tool, Boolean isDel) {
|
||||
if(StrUtil.isNotBlank(tool.getAssociation())){
|
||||
List<Tool> tools = JSONUtil.toList(tool.getAssociation(), Tool.class);
|
||||
//关联
|
||||
List<ToolRelation> associationToolList = new ArrayList<>();
|
||||
//被关联的数据
|
||||
for (Tool toolItem : tools) {
|
||||
ToolRelation toolRelation = new ToolRelation();
|
||||
toolRelation.setId(String.valueOf(snowflake.nextId()));
|
||||
toolRelation.setResourceId(tool.getToolId());
|
||||
toolRelation.setTargetId(toolItem.getToolId());
|
||||
associationToolList.add(toolRelation);
|
||||
if(isDel){
|
||||
iToolRelationService.deleteResourceAndTarget(toolRelation);
|
||||
}
|
||||
}
|
||||
// 使用AtomicInteger来跟踪索引
|
||||
AtomicInteger counter = new AtomicInteger(0);
|
||||
// 使用Stream API进行分组
|
||||
Map<Integer, List<ToolRelation>> grouped = associationToolList.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
e -> counter.getAndIncrement() / 500
|
||||
));
|
||||
// 对每个子列表进行批量插入
|
||||
grouped.values().forEach(batch -> iToolRelationService.batchInsert(batch));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkToolExist(Tool tTool)
|
||||
{
|
||||
@ -84,11 +180,76 @@ public class ToolServiceImpl implements IToolService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int updateTool(Tool tool)
|
||||
{
|
||||
tool.setUpdateBy(SecurityUtils.getUserId().toString());
|
||||
tool.setUpdateTime(DateUtils.getNowDate());
|
||||
return toolMapper.updateTool(tool);
|
||||
int result = toolMapper.updateTool(tool);
|
||||
/* delFile(tool);
|
||||
addFileList(tool);*/
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delFile(Tool tool) {
|
||||
List<String> toolIds = Collections.singletonList(tool.getToolId());
|
||||
iAttachmentService.deleteAttachmentByBusinessId(toolIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void addFileList(Tool tool) {
|
||||
List<Attachment> attachmentList = tool.getAttachmentList();
|
||||
if(CollUtil.isEmpty(attachmentList)){
|
||||
return;
|
||||
}
|
||||
for (Attachment attachment : attachmentList) {
|
||||
attachment.setId(String.valueOf(snowflake.nextId()));
|
||||
attachment.setBusinessId(tool.getToolId());
|
||||
attachment.setBizType(Constants.ATT_TYPE_TOOL);
|
||||
attachment.setDel(Constants.STR_ZERO);
|
||||
attachment.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
|
||||
attachment.setCreateDate(new Date());
|
||||
}
|
||||
// 使用AtomicInteger来跟踪索引
|
||||
AtomicInteger counter = new AtomicInteger(0);
|
||||
// 使用Stream API进行分组
|
||||
Map<Integer, List<Attachment>> grouped = attachmentList.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
e -> counter.getAndIncrement() / 500
|
||||
));
|
||||
// 对每个子列表进行批量插入
|
||||
grouped.values().forEach(batch -> iAttachmentService.batchInsert(batch));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void recordToolApply(Tool tool) {
|
||||
ToolApply toolApply = new ToolApply();
|
||||
toolApply.setId(IdUtil.simpleUUID());
|
||||
toolApply.setApplyType(Constants.TOOL_APPLY_TYPE_PUBLISH);
|
||||
toolApply.setToolId(tool.getToolId());
|
||||
toolApply.setDeptId(String.valueOf(SecurityUtils.getDeptId()));
|
||||
toolApply.setProcInstId(tool.getProcInstId());
|
||||
toolApply.setRecordStatus(tool.getRecordStatus());
|
||||
toolApply.setUserId(String.valueOf(SecurityUtils.getUserId()));
|
||||
|
||||
BpmClientInputModelBo bpmClientInputModelBo = tool.getBpmClientInputModel();
|
||||
if(null != bpmClientInputModelBo){
|
||||
BpmClientInputModel bpmClientInputModel = bpmClientInputModelBo.getModel();
|
||||
toolApply.setProcTitle(StrUtil.isNotEmpty(bpmClientInputModel.getWf_procTitle()) ? bpmClientInputModel.getWf_procTitle() : "");
|
||||
}
|
||||
SysDept sysDept = sysDeptService.selectDeptById(SecurityUtils.getDeptId());
|
||||
if(null != sysDept){
|
||||
toolApply.setDeptName(sysDept.getDeptName());
|
||||
}
|
||||
SysUser sysUser = sysUserService.selectUserById(SecurityUtils.getUserId());
|
||||
if(null != sysUser){
|
||||
toolApply.setNickName(sysUser.getNickName());
|
||||
}
|
||||
toolApplyService.insertToolApply(toolApply);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -114,4 +275,198 @@ public class ToolServiceImpl implements IToolService
|
||||
{
|
||||
return toolMapper.deleteToolByToolId(toolId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDocPushStatus(Tool tTool) {
|
||||
Document document = new Document();
|
||||
document.setToolId(tTool.getToolId());
|
||||
List<Document> documents = documentService.selectDocumentListAll(document);
|
||||
if(CollUtil.isEmpty(documents)){
|
||||
return;
|
||||
}
|
||||
List<String> ids = documents.stream().map(Document::getDocId).collect(Collectors.toList());
|
||||
String[] idsArray = ids.stream().toArray(String[]::new);
|
||||
documentService.pushDoc(idsArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* 给消息中心发送消息
|
||||
*/
|
||||
@Override
|
||||
public void sendTzMessage(Tool tTool) {
|
||||
try{
|
||||
SysUser sysUser = new SysUser();
|
||||
sysUser.setStatus("0");
|
||||
sysUser.setDelFlag("0");
|
||||
String content = tTool.getToolName() + "已发布";
|
||||
List<SysUser> sysUsers = sysUserService.selectUserList(sysUser);
|
||||
List<TzMessage> addList = new ArrayList<>();
|
||||
for (SysUser user : sysUsers) {
|
||||
TzMessage tzMessage = new TzMessage();
|
||||
//雪花
|
||||
tzMessage.setId(String.valueOf(snowflake.nextId()));
|
||||
tzMessage.setBusinessId(tTool.getToolId());
|
||||
tzMessage.setBusinessType(Constants.ATT_TYPE_TOOL);
|
||||
tzMessage.setReceiverId(String.valueOf(user.getUserId()));
|
||||
tzMessage.setStates(1);
|
||||
tzMessage.setContent(content);
|
||||
tzMessage.setDeleted("0");
|
||||
tzMessage.setCreateTime(DateUtils.getNowDate());
|
||||
tzMessage.setCreateBy(SecurityUtils.getLoginUser().getUsername());
|
||||
tzMessage.setCreateById(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
|
||||
addList.add(tzMessage);
|
||||
}
|
||||
// 使用AtomicInteger来跟踪索引
|
||||
AtomicInteger counter = new AtomicInteger(0);
|
||||
// 使用Stream API进行分组
|
||||
Map<Integer, List<TzMessage>> grouped = addList.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
e -> counter.getAndIncrement() / 500
|
||||
));
|
||||
// 对每个子列表进行批量插入
|
||||
grouped.values().forEach(batch -> tzMessageService.batchInsert(batch));
|
||||
}catch (Exception e){
|
||||
log.error("UseApplyServiceImpl-->sendTzMessage--发送消息中心异常--e###", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> statistics() {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
List<Map<String, Object>> countToolType = toolMapper.countToolType();
|
||||
List<Map<String, Object>> toolSource = toolMapper.toolSource();
|
||||
List<Map<String, Object>> recordStatus = toolMapper.recordStatus();
|
||||
//组装数据
|
||||
assembleData(countToolType, toolSource, recordStatus);
|
||||
|
||||
result.put("countToolType", countToolType);
|
||||
result.put("toolSource", toolSource);
|
||||
result.put("recordStatus", recordStatus);
|
||||
return result;
|
||||
}
|
||||
|
||||
private void assembleData(List<Map<String, Object>> countToolType, List<Map<String, Object>> toolSource, List<Map<String, Object>> recordStatus) {
|
||||
|
||||
List<SysDictData> toolTypeList = sysDictTypeService.selectDictDataByType("tool_type");
|
||||
List<SysDictData> flowStatusList = sysDictTypeService.selectDictDataByType("flow_status").stream().filter(item -> !item.getDictValue().equals("cancel")).collect(Collectors.toList());
|
||||
List<SysDictData> toolSourceList = sysDictTypeService.selectDictDataByType("tool_source");
|
||||
|
||||
//初始化数据
|
||||
initDictData(toolTypeList, countToolType);
|
||||
initDictData(toolSourceList, toolSource);
|
||||
initDictData(flowStatusList, recordStatus);
|
||||
|
||||
if(CollUtil.isNotEmpty(countToolType)){
|
||||
for (Map<String, Object> map : countToolType) {
|
||||
map.put("value", map.get("statistics"));
|
||||
for (SysDictData sysDictData : toolTypeList) {
|
||||
if(sysDictData.getDictValue().equals(map.get("types"))){
|
||||
map.put("name", sysDictData.getDictLabel());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(CollUtil.isNotEmpty(toolSource)){
|
||||
for (Map<String, Object> map : toolSource) {
|
||||
map.put("value", map.get("statistics"));
|
||||
for (SysDictData sysDictData : toolSourceList) {
|
||||
if(sysDictData.getDictValue().equals(map.get("types"))){
|
||||
map.put("name", sysDictData.getDictLabel());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(CollUtil.isNotEmpty(recordStatus)){
|
||||
for (Map<String, Object> map : recordStatus) {
|
||||
map.put("value", map.get("statistics"));
|
||||
for (SysDictData sysDictData : flowStatusList) {
|
||||
if(sysDictData.getDictValue().equals(map.get("types"))){
|
||||
map.put("name", sysDictData.getDictLabel());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void initDictData(List<SysDictData> dictDataList, List<Map<String, Object>> mapTypeList) {
|
||||
for (SysDictData sysDictData : dictDataList) {
|
||||
boolean flag = false;
|
||||
for (Map<String, Object> map : mapTypeList) {
|
||||
if(sysDictData.getDictValue().equals(map.get("types"))){
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!flag){
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("value", "0");
|
||||
map.put("name", sysDictData.getDictLabel());
|
||||
map.put("types", sysDictData.getDictValue());
|
||||
map.put("statistics", "0");
|
||||
mapTypeList.add(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Tool> selectAllList(Tool tool) {
|
||||
List<Tool> tools = toolMapper.selectToolList(tool);
|
||||
List<SysDictData> toolSource = sysDictTypeService.selectDictDataByType("tool_source");
|
||||
List<SysDictData> toolTypeList = sysDictTypeService.selectDictDataByType("tool_type");
|
||||
List<SysDictData> toolStatus = sysDictTypeService.selectDictDataByType("tool_status");
|
||||
List<SysDictData> flowStatusList = sysDictTypeService.selectDictDataByType("flow_status");
|
||||
|
||||
for (Tool item : tools) {
|
||||
for (SysDictData sysDictData : toolSource) {
|
||||
if(sysDictData.getDictValue().equals(item.getToolSource())){
|
||||
item.setToolSourceName(sysDictData.getDictLabel());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (SysDictData sysDictData : toolTypeList) {
|
||||
if(sysDictData.getDictValue().equals(item.getToolType())){
|
||||
item.setToolTypeName(sysDictData.getDictLabel());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (SysDictData sysDictData : toolStatus) {
|
||||
if(sysDictData.getDictValue().equals(item.getStatus())){
|
||||
item.setStatusName(sysDictData.getDictLabel());
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (SysDictData sysDictData : flowStatusList) {
|
||||
if(sysDictData.getDictValue().equals(item.getRecordStatus())){
|
||||
item.setRecordStatusName(sysDictData.getDictLabel());
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( StrUtil.isNotBlank(tool.getToolRespDept())){
|
||||
item.setToolRespDeptName(sysDeptService.getDeptName(tool.getToolRespDept()));
|
||||
}
|
||||
|
||||
}
|
||||
return tools;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDownloadStatus(String userId, Tool tool){
|
||||
//创建人、下载权限、系统管理员
|
||||
//1.已经审核通过、并且有下载权限
|
||||
return userId.equals(tool.getCreateBy()) ||
|
||||
SysUser.isAdmin(SecurityUtils.getUserId()) ||
|
||||
SecurityUtils.hasPermi(Constants.DOWNLOAD_TOOL_PERMISSION) ||
|
||||
( RecordStatusEnum.DONE.getCode().equals(tool.getRecordStatus())&&
|
||||
iToolApplyService.checkToolUseApply(tool.getToolId(), userId));
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,129 @@
|
||||
package com.rzdata.web.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.rzdata.common.utils.DateUtils;
|
||||
import com.rzdata.common.utils.SecurityUtils;
|
||||
import com.rzdata.web.domain.TzMessage;
|
||||
import com.rzdata.web.mapper.TzMessageMapper;
|
||||
import com.rzdata.web.service.ITzMessageService;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* 消息Service业务层处理
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-08-31
|
||||
*/
|
||||
@Service
|
||||
public class TzMessageServiceImpl implements ITzMessageService
|
||||
{
|
||||
@Autowired
|
||||
private TzMessageMapper tzMessageMapper;
|
||||
|
||||
/**
|
||||
* 查询消息
|
||||
*
|
||||
* @param id 消息主键
|
||||
* @return 消息
|
||||
*/
|
||||
@Override
|
||||
public TzMessage selectTzMessageById(String id)
|
||||
{
|
||||
return tzMessageMapper.selectTzMessageById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询消息列表
|
||||
*
|
||||
* @param tzMessage 消息
|
||||
* @return 消息
|
||||
*/
|
||||
@Override
|
||||
public List<TzMessage> selectTzMessageList(TzMessage tzMessage)
|
||||
{
|
||||
return tzMessageMapper.selectTzMessageList(tzMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增消息
|
||||
*
|
||||
* @param tzMessage 消息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTzMessage(TzMessage tzMessage)
|
||||
{
|
||||
tzMessage.setCreateTime(DateUtils.getNowDate());
|
||||
tzMessage.setCreateBy(SecurityUtils.getLoginUser().getUsername());
|
||||
tzMessage.setCreateById(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
|
||||
return tzMessageMapper.insertTzMessage(tzMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改消息
|
||||
*
|
||||
* @param tzMessage 消息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTzMessage(TzMessage tzMessage)
|
||||
{
|
||||
tzMessage.setUpdateTime(DateUtils.getNowDate());
|
||||
tzMessage.setUpdateBy(SecurityUtils.getLoginUser().getUsername());
|
||||
tzMessage.setUpdateById(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
|
||||
return tzMessageMapper.updateTzMessage(tzMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除消息
|
||||
*
|
||||
* @param ids 需要删除的消息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTzMessageByIds(String[] ids)
|
||||
{
|
||||
return tzMessageMapper.deleteTzMessageByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除消息信息
|
||||
*
|
||||
* @param id 消息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTzMessageById(String id)
|
||||
{
|
||||
return tzMessageMapper.deleteTzMessageById(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 全部标记已读
|
||||
* @param tzMessage
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int allMarkedRead( TzMessage tzMessage) {
|
||||
tzMessage.setReceiverId(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
|
||||
tzMessage.setUpdateBy(SecurityUtils.getLoginUser().getUsername());
|
||||
tzMessage.setUpdateById(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
|
||||
tzMessage.setUpdateTime(new Date());
|
||||
return tzMessageMapper.updateAllMarkedRead(tzMessage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchInsert(List<TzMessage> tzMessageList) {
|
||||
return tzMessageMapper.batchInsert(tzMessageList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int selectTzMessageByUserCount(String userId) {
|
||||
return tzMessageMapper.selectTzMessageByUserCount(userId);
|
||||
}
|
||||
}
|
@ -1,109 +0,0 @@
|
||||
package com.rzdata.web.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.rzdata.common.utils.DateUtils;
|
||||
import com.rzdata.common.utils.SecurityUtils;
|
||||
import com.rzdata.web.domain.Tool;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.rzdata.web.mapper.UseApplyMapper;
|
||||
import com.rzdata.web.domain.UseApply;
|
||||
import com.rzdata.web.service.IUseApplyService;
|
||||
|
||||
/**
|
||||
* 使用申请Service业务层处理
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@Service
|
||||
public class UseApplyServiceImpl implements IUseApplyService
|
||||
{
|
||||
@Autowired
|
||||
private UseApplyMapper useApplyMapper;
|
||||
|
||||
/**
|
||||
* 查询使用申请
|
||||
*
|
||||
* @param id 使用申请主键
|
||||
* @return 使用申请
|
||||
*/
|
||||
@Override
|
||||
public UseApply selectUseApplyById(String id)
|
||||
{
|
||||
return useApplyMapper.selectUseApplyById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UseApply getInfoByBpmcId(String bpmcId){
|
||||
return useApplyMapper.getInfoByBpmcId(bpmcId);
|
||||
}
|
||||
/**
|
||||
* 查询使用申请列表
|
||||
*
|
||||
* @param useApply 使用申请
|
||||
* @return 使用申请
|
||||
*/
|
||||
@Override
|
||||
public List<UseApply> selectUseApplyList(UseApply useApply)
|
||||
{
|
||||
return useApplyMapper.selectUseApplyList(useApply);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增使用申请
|
||||
*
|
||||
* @param useApply 使用申请
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertUseApply(UseApply useApply)
|
||||
{
|
||||
useApply.setCreateBy(SecurityUtils.getUserId().toString());
|
||||
useApply.setCreateTime(DateUtils.getNowDate());
|
||||
return useApplyMapper.insertUseApply(useApply);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改使用申请
|
||||
*
|
||||
* @param useApply 使用申请
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateUseApply(UseApply useApply)
|
||||
{
|
||||
useApply.setUpdateBy(SecurityUtils.getUserId().toString());
|
||||
useApply.setUpdateTime(DateUtils.getNowDate());
|
||||
return useApplyMapper.updateUseApply(useApply);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除使用申请
|
||||
*
|
||||
* @param ids 需要删除的使用申请主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteUseApplyByIds(String[] ids)
|
||||
{
|
||||
return useApplyMapper.deleteUseApplyByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除使用申请信息
|
||||
*
|
||||
* @param id 使用申请主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteUseApplyById(String id)
|
||||
{
|
||||
return useApplyMapper.deleteUseApplyById(id);
|
||||
}
|
||||
|
||||
public boolean checkUseApply(String toolId, String userId){
|
||||
return useApplyMapper.checkUseApply(toolId, userId)>0;
|
||||
}
|
||||
}
|
@ -58,4 +58,9 @@ spring:
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
multi-statement-allow: true
|
||||
|
||||
bpmc:
|
||||
tenantId: TLTC_SYS
|
||||
serviceUrl: http://124.223.108.21:9081/ebpm-process-rest/
|
||||
uniteWorkUrl: https://www.rzdata.net/tool-tech/workflowRouter
|
||||
|
@ -15,6 +15,7 @@ ja:
|
||||
|
||||
# 开发环境配置
|
||||
server:
|
||||
address: 0.0.0.0
|
||||
# 服务器的HTTP端口,默认为8080
|
||||
port: 8080
|
||||
servlet:
|
||||
@ -128,7 +129,12 @@ xss:
|
||||
# 匹配链接
|
||||
urlPatterns: /system/*,/monitor/*,/tool/*
|
||||
|
||||
# 用于雪花算法生成id
|
||||
application:
|
||||
datacenterId: 2
|
||||
workerId: 1
|
||||
|
||||
bpmc:
|
||||
tenantId: TLTC_SYS
|
||||
serviceUrl: http://192.168.2.18:8081/ebpm-process-rest/
|
||||
serviceUrl: http://124.223.108.21:9081/ebpm-process-rest/
|
||||
uniteWorkUrl: http://localhost/tool-tech/workflowRouter
|
||||
|
179
tool-tech-admin/src/main/resources/mapper/AttachmentMapper.xml
Normal file
179
tool-tech-admin/src/main/resources/mapper/AttachmentMapper.xml
Normal file
@ -0,0 +1,179 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.rzdata.web.mapper.AttachmentMapper">
|
||||
|
||||
<resultMap type="Attachment" id="AttachmentResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="bizType" column="biz_type" />
|
||||
<result property="fileUrl" column="file_url" />
|
||||
<result property="filePath" column="file_path" />
|
||||
<result property="fileOldName" column="file_old_name" />
|
||||
<result property="fileNewName" column="file_new_name" />
|
||||
<result property="suffixType" column="suffix_type" />
|
||||
<result property="fileSize" column="file_size" />
|
||||
<result property="businessId" column="business_id" />
|
||||
<result property="sorts" column="sorts" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="del" column="del" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createDate" column="create_date" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateDate" column="update_date" />
|
||||
<result property="failureTime" column="failure_time" />
|
||||
<result property="fileName" column="file_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAttachmentVo">
|
||||
select id, biz_type, file_path, file_url, file_old_name, file_new_name, suffix_type,
|
||||
file_size, business_id, sorts, remark, del, create_by, create_date,
|
||||
update_by, update_date, failure_time, file_old_name as file_name
|
||||
from t_attachment
|
||||
</sql>
|
||||
|
||||
<select id="selectAttachmentList" parameterType="Attachment" resultMap="AttachmentResult">
|
||||
<include refid="selectAttachmentVo"/>
|
||||
<where>
|
||||
<if test="bizType != null and bizType != ''"> and biz_type = #{bizType}</if>
|
||||
<if test="filePath != null and filePath != ''"> and file_path = #{filePath}</if>
|
||||
<if test="fileUrl != null and fileUrl != ''"> and file_url = #{fileUrl}</if>
|
||||
<if test="fileOldName != null and fileOldName != ''"> and file_old_name like concat('%', #{fileOldName}, '%')</if>
|
||||
<if test="fileNewName != null and fileNewName != ''"> and file_new_name like concat('%', #{fileNewName}, '%')</if>
|
||||
<if test="suffixType != null and suffixType != ''"> and suffix_type = #{suffixType}</if>
|
||||
<if test="fileSize != null "> and file_size = #{fileSize}</if>
|
||||
<if test="businessId != null and businessId != ''"> and business_id = #{businessId}</if>
|
||||
<if test="sorts != null "> and sorts = #{sorts}</if>
|
||||
<if test="del != null "> and del = #{del}</if>
|
||||
<if test="createDate != null "> and create_date = #{createDate}</if>
|
||||
<if test="updateDate != null "> and update_date = #{updateDate}</if>
|
||||
<if test="failureTime != null "> and failure_time = #{failureTime}</if>
|
||||
<if test="businessIds != null and businessIds.size() > 0">
|
||||
and business_id in
|
||||
<foreach item="id" index="index" collection="businessIds" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAttachmentById" parameterType="String" resultMap="AttachmentResult">
|
||||
<include refid="selectAttachmentVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAttachment" parameterType="Attachment">
|
||||
insert into t_attachment
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="bizType != null">biz_type,</if>
|
||||
<if test="filePath != null">file_path,</if>
|
||||
<if test="fileUrl != null">file_url,</if>
|
||||
<if test="fileOldName != null">file_old_name,</if>
|
||||
<if test="fileNewName != null">file_new_name,</if>
|
||||
<if test="suffixType != null">suffix_type,</if>
|
||||
<if test="fileSize != null">file_size,</if>
|
||||
<if test="businessId != null">business_id,</if>
|
||||
<if test="sorts != null">sorts,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="del != null">del,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createDate != null">create_date,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateDate != null">update_date,</if>
|
||||
<if test="failureTime != null">failure_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="bizType != null">#{bizType},</if>
|
||||
<if test="filePath != null">#{filePath},</if>
|
||||
<if test="fileUrl != null">#{fileUrl},</if>
|
||||
<if test="fileOldName != null">#{fileOldName},</if>
|
||||
<if test="fileNewName != null">#{fileNewName},</if>
|
||||
<if test="suffixType != null">#{suffixType},</if>
|
||||
<if test="fileSize != null">#{fileSize},</if>
|
||||
<if test="businessId != null">#{businessId},</if>
|
||||
<if test="sorts != null">#{sorts},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="del != null">#{del},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createDate != null">#{createDate},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateDate != null">#{updateDate},</if>
|
||||
<if test="failureTime != null">#{failureTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAttachment" parameterType="Attachment">
|
||||
update t_attachment
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="bizType != null">biz_type = #{bizType},</if>
|
||||
<if test="fileUrl != null">file_url = #{fileUrl},</if>
|
||||
<if test="filePath != null">file_path = #{filePath},</if>
|
||||
<if test="fileOldName != null">file_old_name = #{fileOldName},</if>
|
||||
<if test="fileNewName != null">file_new_name = #{fileNewName},</if>
|
||||
<if test="suffixType != null">suffix_type = #{suffixType},</if>
|
||||
<if test="fileSize != null">file_size = #{fileSize},</if>
|
||||
<if test="businessId != null">business_id = #{businessId},</if>
|
||||
<if test="sorts != null">sorts = #{sorts},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="del != null">del = #{del},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createDate != null">create_date = #{createDate},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateDate != null">update_date = #{updateDate},</if>
|
||||
<if test="failureTime != null">failure_time = #{failureTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateAttachmentByBusinessId" parameterType="Attachment">
|
||||
update t_attachment
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="bizType != null">biz_type = #{bizType},</if>
|
||||
<if test="fileUrl != null">file_url = #{fileUrl},</if>
|
||||
<if test="filePath != null">file_path = #{filePath},</if>
|
||||
<if test="fileOldName != null">file_old_name = #{fileOldName},</if>
|
||||
<if test="fileNewName != null">file_new_name = #{fileNewName},</if>
|
||||
<if test="suffixType != null">suffix_type = #{suffixType},</if>
|
||||
<if test="fileSize != null">file_size = #{fileSize},</if>
|
||||
<if test="sorts != null">sorts = #{sorts},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="del != null">del = #{del},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createDate != null">create_date = #{createDate},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateDate != null">update_date = #{updateDate},</if>
|
||||
<if test="failureTime != null">failure_time = #{failureTime},</if>
|
||||
</trim>
|
||||
where business_id = #{businessId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAttachmentById" parameterType="String">
|
||||
delete from t_attachment where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAttachmentByIds" parameterType="String">
|
||||
delete from t_attachment where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAttachmentByBusinessId" parameterType="java.util.List">
|
||||
delete from t_attachment where business_id in
|
||||
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
|
||||
<insert id="batchInsert" parameterType="java.util.List">
|
||||
INSERT INTO t_attachment (id, biz_type, file_path, file_url, file_old_name, file_new_name, suffix_type, file_size, business_id, sorts, remark, del, create_by, create_date)
|
||||
VALUES
|
||||
<foreach item="item" index="index" collection="attachmentList" open="(" separator="),(" close=")">
|
||||
#{item.id}, #{item.bizType}, #{item.filePath}, #{item.fileUrl}, #{item.fileOldName}, #{item.fileNewName}, #{item.suffixType}, #{item.fileSize}, #{item.businessId}, #{item.sorts}, #{item.remark}, #{item.del}, #{item.createBy}, #{item.createDate}
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
103
tool-tech-admin/src/main/resources/mapper/DiscussionsMapper.xml
Normal file
103
tool-tech-admin/src/main/resources/mapper/DiscussionsMapper.xml
Normal file
@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.rzdata.web.mapper.DiscussionsMapper">
|
||||
|
||||
<resultMap type="Discussions" id="DiscussionsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="businessId" column="business_id" />
|
||||
<result property="type" column="type" />
|
||||
<result property="content" column="content" />
|
||||
<result property="isDelete" column="is_delete" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createById" column="create_by_id" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateById" column="update_by_id" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDiscussionsVo">
|
||||
select id, business_id, type, content, is_delete, create_by, create_by_id, create_time, update_by, update_by_id, update_time from t_discussions
|
||||
</sql>
|
||||
|
||||
<select id="selectDiscussionsList" parameterType="Discussions" resultMap="DiscussionsResult">
|
||||
select td.*,su.nick_name
|
||||
from t_discussions td
|
||||
left join sys_user su on su.user_id = td.create_by_id
|
||||
<where>
|
||||
<if test="businessId != null and businessId != ''"> and td.business_id = #{businessId}</if>
|
||||
<if test="type != null and type != ''"> and td.type = #{type}</if>
|
||||
<if test="content != null and content != ''"> and td.content = #{content}</if>
|
||||
<if test="isDelete != null and isDelete != ''"> and td.is_delete = #{isDelete}</if>
|
||||
<if test="createById != null and createById != ''"> and td.create_by_id = #{createById}</if>
|
||||
<if test="updateById != null and updateById != ''"> and td.update_by_id = #{updateById}</if>
|
||||
and td.is_delete = '0'
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDiscussionsById" parameterType="String" resultMap="DiscussionsResult">
|
||||
<include refid="selectDiscussionsVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertDiscussions" parameterType="Discussions">
|
||||
insert into t_discussions
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="businessId != null">business_id,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="content != null">content,</if>
|
||||
<if test="isDelete != null">is_delete,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createById != null">create_by_id,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateById != null">update_by_id,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="businessId != null">#{businessId},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="content != null">#{content},</if>
|
||||
<if test="isDelete != null">#{isDelete},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createById != null">#{createById},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateById != null">#{updateById},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDiscussions" parameterType="Discussions">
|
||||
update t_discussions
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="businessId != null">business_id = #{businessId},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="content != null">content = #{content},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createById != null">create_by_id = #{createById},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateById != null">update_by_id = #{updateById},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDiscussionsById" parameterType="String">
|
||||
delete from t_discussions where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDiscussionsByIds" parameterType="String">
|
||||
delete from t_discussions where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,100 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.rzdata.web.mapper.DocumentCategoryMapper">
|
||||
|
||||
<resultMap type="DocumentCategory" id="DocumentCategoryResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="categoryName" column="category_name" />
|
||||
<result property="categoryDescription" column="category_description" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createById" column="create_by_id" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateById" column="update_by_id" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="types" column="types" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDocumentCategoryVo">
|
||||
select id, category_name, category_description, parent_id, create_by, create_by_id, create_time,
|
||||
update_by, update_by_id, update_time, types from t_document_category
|
||||
</sql>
|
||||
|
||||
<select id="selectDocumentCategoryList" parameterType="DocumentCategory" resultMap="DocumentCategoryResult">
|
||||
<include refid="selectDocumentCategoryVo"/>
|
||||
<where>
|
||||
<if test="categoryName != null and categoryName != ''"> and category_name like concat('%', #{categoryName}, '%')</if>
|
||||
<if test="categoryDescription != null and categoryDescription != ''"> and category_description = #{categoryDescription}</if>
|
||||
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId}</if>
|
||||
<if test="createById != null and createById != ''"> and create_by_id = #{createById}</if>
|
||||
<if test="updateById != null and updateById != ''"> and update_by_id = #{updateById}</if>
|
||||
<if test="types != null and types != ''"> and types = #{types}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDocumentCategoryById" parameterType="String" resultMap="DocumentCategoryResult">
|
||||
<include refid="selectDocumentCategoryVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertDocumentCategory" parameterType="DocumentCategory">
|
||||
insert into t_document_category
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="categoryName != null and categoryName != ''">category_name,</if>
|
||||
<if test="categoryDescription != null">category_description,</if>
|
||||
<if test="parentId != null">parent_id,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="createById != null and createById != ''">create_by_id,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateById != null">update_by_id,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="types != null">types,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="categoryName != null and categoryName != ''">#{categoryName},</if>
|
||||
<if test="categoryDescription != null">#{categoryDescription},</if>
|
||||
<if test="parentId != null">#{parentId},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="createById != null and createById != ''">#{createById},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateById != null">#{updateById},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="types != null">#{types},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDocumentCategory" parameterType="DocumentCategory">
|
||||
update t_document_category
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="categoryName != null and categoryName != ''">category_name = #{categoryName},</if>
|
||||
<if test="categoryDescription != null">category_description = #{categoryDescription},</if>
|
||||
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
<if test="createById != null and createById != ''">create_by_id = #{createById},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateById != null">update_by_id = #{updateById},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="types != null">types = #{types},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDocumentCategoryById" parameterType="String">
|
||||
delete from t_document_category where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDocumentCategoryByIds" parameterType="String">
|
||||
delete from t_document_category where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -10,6 +10,7 @@
|
||||
<result property="docName" column="doc_name" />
|
||||
<result property="docType" column="doc_type" />
|
||||
<result property="docPrincipals" column="doc_principals" />
|
||||
<result property="docPrincipalsName" column="doc_principals_name" />
|
||||
<result property="docRespDept" column="doc_resp_dept" />
|
||||
<result property="docSource" column="doc_source" />
|
||||
<result property="docStatus" column="doc_status" />
|
||||
@ -18,23 +19,59 @@
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="docCategoryId" column="doc_category_id" />
|
||||
<result property="isDeleted" column="is_deleted" />
|
||||
<result property="toolId" column="tool_id" />
|
||||
<result property="toolName" column="tool_name" />
|
||||
<result property="docRespDeptName" column="doc_resp_dept_name" />
|
||||
<result property="createById" column="create_by_id" />
|
||||
<result property="updateById" column="update_by_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDocumentVo">
|
||||
select doc_id, doc_code, doc_name, doc_type, doc_principals, doc_resp_dept, doc_source, doc_status, doc_url, create_by, create_time, update_by, update_time from t_document
|
||||
select doc_id, doc_code, doc_name, doc_type, doc_principals, doc_resp_dept,
|
||||
doc_source, doc_status, doc_url, create_by, create_time,doc_principals_name,
|
||||
update_by, update_time, remark, doc_category_id,is_deleted,tool_id from t_document
|
||||
</sql>
|
||||
|
||||
<select id="selectDocumentList" parameterType="Document" resultMap="DocumentResult">
|
||||
<include refid="selectDocumentVo"/>
|
||||
select td.*, t_tool.tool_name as tool_name,sd.dept_name as doc_resp_dept_name
|
||||
from t_document td
|
||||
left join t_tool on t_tool.tool_id = td.tool_id
|
||||
left join sys_dept sd on sd.dept_id = td.doc_resp_dept
|
||||
left join sys_user su on td.create_by_id = su.user_id
|
||||
<where>
|
||||
<if test="docCode != null and docCode != ''"> and doc_code = #{docCode}</if>
|
||||
<if test="docName != null and docName != ''"> and doc_name like concat('%', #{docName}, '%')</if>
|
||||
<if test="docType != null and docType != ''"> and doc_type = #{docType}</if>
|
||||
<if test="docPrincipals != null and docPrincipals != ''"> and doc_principals = #{docPrincipals}</if>
|
||||
<if test="docRespDept != null and docRespDept != ''"> and doc_resp_dept = #{docRespDept}</if>
|
||||
<if test="docSource != null and docSource != ''"> and doc_source = #{docSource}</if>
|
||||
<if test="docStatus != null and docStatus != ''"> and doc_status = #{docStatus}</if>
|
||||
<if test="docCode != null and docCode != ''"> and td.doc_code like concat('%', #{docCode}, '%')</if>
|
||||
<if test="docName != null and docName != ''"> and td.doc_name like concat('%', #{docName}, '%')</if>
|
||||
<if test="docType != null and docType != ''"> and td.doc_type = #{docType}</if>
|
||||
<if test="docPrincipals != null and docPrincipals != ''"> and td.doc_principals like concat('%', #{docPrincipals}, '%')</if>
|
||||
<if test="docPrincipalsName != null and docPrincipalsName != ''"> and td.doc_principals_name like concat('%', #{docPrincipalsName}, '%')</if>
|
||||
<if test="docRespDept != null and docRespDept != ''"> and td.doc_resp_dept = #{docRespDept}</if>
|
||||
<if test="docSource != null and docSource != ''"> and td.doc_source = #{docSource}</if>
|
||||
<if test="docStatus != null and docStatus != ''"> and td.doc_status = #{docStatus}</if>
|
||||
<if test="toolId != null and toolId != ''"> and td.tool_id = #{toolId}</if>
|
||||
<if test="docCategoryId != null and docCategoryId != ''"> and td.doc_category_id = #{docCategoryId}</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND date_format(td.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND date_format(td.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="createById != null and createById != '' and permission != true">
|
||||
AND (td.create_by_id = #{createById} or td.doc_status = 'yfb')
|
||||
</if>
|
||||
<if test="docIdList != null and docIdList.size() > 0">
|
||||
and td.doc_id in
|
||||
<foreach item="id" index="index" collection="docIdList" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
and td.is_deleted = '0'
|
||||
</where>
|
||||
${params.dataScope}
|
||||
order by td.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectDocumentById" parameterType="String" resultMap="DocumentResult">
|
||||
@ -50,6 +87,7 @@
|
||||
<if test="docName != null">doc_name,</if>
|
||||
<if test="docType != null">doc_type,</if>
|
||||
<if test="docPrincipals != null">doc_principals,</if>
|
||||
<if test="docPrincipalsName != null">doc_principals_name,</if>
|
||||
<if test="docRespDept != null">doc_resp_dept,</if>
|
||||
<if test="docSource != null">doc_source,</if>
|
||||
<if test="docStatus != null">doc_status,</if>
|
||||
@ -58,6 +96,12 @@
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="docCategoryId != null">doc_category_id,</if>
|
||||
<if test="createById != null and createById != ''">create_by_id,</if>
|
||||
<if test="updateById != null">update_by_id,</if>
|
||||
<if test="isDeleted != null">is_deleted,</if>
|
||||
<if test="toolId != null">tool_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="docId != null">#{docId},</if>
|
||||
@ -65,6 +109,7 @@
|
||||
<if test="docName != null">#{docName},</if>
|
||||
<if test="docType != null">#{docType},</if>
|
||||
<if test="docPrincipals != null">#{docPrincipals},</if>
|
||||
<if test="docPrincipalsName != null">#{docPrincipalsName},</if>
|
||||
<if test="docRespDept != null">#{docRespDept},</if>
|
||||
<if test="docSource != null">#{docSource},</if>
|
||||
<if test="docStatus != null">#{docStatus},</if>
|
||||
@ -73,6 +118,12 @@
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="docCategoryId != null">#{docCategoryId},</if>
|
||||
<if test="createById != null and createById != ''">#{createById},</if>
|
||||
<if test="updateById != null">#{updateById},</if>
|
||||
<if test="isDeleted != null">#{isDeleted},</if>
|
||||
<if test="toolId != null">#{toolId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -83,6 +134,7 @@
|
||||
<if test="docName != null">doc_name = #{docName},</if>
|
||||
<if test="docType != null">doc_type = #{docType},</if>
|
||||
<if test="docPrincipals != null">doc_principals = #{docPrincipals},</if>
|
||||
<if test="docPrincipalsName != null">doc_principals_name = #{docPrincipalsName},</if>
|
||||
<if test="docRespDept != null">doc_resp_dept = #{docRespDept},</if>
|
||||
<if test="docSource != null">doc_source = #{docSource},</if>
|
||||
<if test="docStatus != null">doc_status = #{docStatus},</if>
|
||||
@ -91,6 +143,12 @@
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="docCategoryId != null">doc_category_id = #{docCategoryId},</if>
|
||||
<if test="isDeleted != null">is_deleted = #{isDeleted},</if>
|
||||
<if test="updateById != null">update_by_id = #{updateById},</if>
|
||||
<if test="createById != null">create_by_id = #{createById},</if>
|
||||
<if test="toolId != null">tool_id = #{toolId},</if>
|
||||
</trim>
|
||||
where doc_id = #{docId}
|
||||
</update>
|
||||
@ -99,10 +157,39 @@
|
||||
delete from t_document where doc_id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDocumentByIds" parameterType="String">
|
||||
<delete id="isDeleteDocumentByIds" parameterType="Document">
|
||||
<if test="ids != null and ids.size() > 0">
|
||||
update t_document set is_deleted = '1' ,update_by_id = #{updateById},update_by = #{updateBy},update_time = #{updateTime} where doc_id in
|
||||
<foreach item="id" index="index" collection="ids" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</delete>
|
||||
|
||||
<update id="updatePushDoc" parameterType="Document">
|
||||
<if test="ids != null and ids.size() > 0">
|
||||
update t_document set doc_status = #{docStatus} ,update_by_id = #{updateById},update_by = #{updateBy},update_time = #{updateTime} where doc_id in
|
||||
<foreach item="id" index="index" collection="ids" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<delete id="batchDeleteById" parameterType="java.util.List">
|
||||
delete from t_document where doc_id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 文档类型统计-->
|
||||
<select id="countType" resultType="java.util.Map">
|
||||
select t.doc_type as types, sum(1) as statistics from t_document t where t.is_deleted = '0' group by t.doc_type;
|
||||
</select>
|
||||
|
||||
<!-- 文档来源统计-->
|
||||
<select id="countSource" resultType="java.util.Map">
|
||||
select t.doc_source as types, sum(1) as statistics from t_document t where t.is_deleted = '0' group by t.doc_source;
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,157 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.rzdata.web.mapper.DownloadCountMapper">
|
||||
|
||||
<resultMap type="DownloadCount" id="DownloadCountResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="businessId" column="business_id" />
|
||||
<result property="businessType" column="business_type" />
|
||||
<result property="attId" column="att_id" />
|
||||
<result property="attName" column="att_name" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createById" column="create_by_id" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateById" column="update_by_id" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="toolCode" column="tool_code" />
|
||||
<result property="toolName" column="tool_name" />
|
||||
<result property="toolDownNum" column="tool_down_num" />
|
||||
<result property="docCode" column="doc_code" />
|
||||
<result property="docName" column="doc_name" />
|
||||
<result property="docDownNum" column="doc_down_num" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDownloadCountVo">
|
||||
select id, business_id,business_type,att_id,att_name
|
||||
create_by, create_by_id, create_time, update_by, update_by_id, update_time from t_download_count
|
||||
</sql>
|
||||
|
||||
<select id="selectDownloadCountList" parameterType="DownloadCount" resultMap="DownloadCountResult">
|
||||
select
|
||||
tdc.business_id,tl.tool_code,tl.tool_name,sum(1) as tool_down_num
|
||||
from t_download_count tdc
|
||||
left join t_tool tl on tdc.business_id = tl.tool_id
|
||||
<where>
|
||||
and business_type = 'tool' and tl.record_status != 'cancel'
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND date_format(tdc.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND date_format(tdc.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="toolCode != null and toolCode != ''">
|
||||
AND tl.tool_code like concat('%', #{toolCode}, '%')
|
||||
</if>
|
||||
<if test="toolName != null and toolName != ''">
|
||||
AND tl.tool_name like concat('%', #{toolName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
group by tdc.business_id,tl.tool_code,tl.tool_name
|
||||
</select>
|
||||
|
||||
<select id="selectDownloadCountById" parameterType="String" resultMap="DownloadCountResult">
|
||||
<include refid="selectDownloadCountVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertDownloadCount" parameterType="DownloadCount">
|
||||
insert into t_download_count
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="businessId != null">business_id,</if>
|
||||
<if test="businessType != null">business_type,</if>
|
||||
<if test="attId != null">att_id,</if>
|
||||
<if test="attName != null">att_name,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createById != null">create_by_id,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateById != null">update_by_id,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="businessId != null">#{businessId},</if>
|
||||
<if test="businessType != null">#{businessType},</if>
|
||||
<if test="attId != null">#{attId},</if>
|
||||
<if test="attName != null">#{attName},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createById != null">#{createById},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateById != null">#{updateById},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDownloadCount" parameterType="DownloadCount">
|
||||
update t_download_count
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="businessId != null">business_id = #{businessId},</if>
|
||||
<if test="businessType != null">business_type = #{businessType},</if>
|
||||
<if test="attId != null">att_id = #{attId},</if>
|
||||
<if test="attName != null">att_name = #{attName},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createById != null">create_by_id = #{createById},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateById != null">update_by_id = #{updateById},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDownloadCountById" parameterType="String">
|
||||
delete from t_download_count where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDownloadCountByIds" parameterType="String">
|
||||
delete from t_download_count where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
|
||||
<select id="userDownList" parameterType="DownloadCount" resultMap="DownloadCountResult">
|
||||
select
|
||||
tdc.business_id,tdc.att_name,su.nick_name,tdc.create_time,sum(1) as tool_down_num
|
||||
from t_download_count tdc
|
||||
left join sys_user su on tdc.create_by_id = su.user_id
|
||||
<where>
|
||||
<if test="businessId != null and businessId != ''">
|
||||
AND business_id = #{businessId}
|
||||
</if>
|
||||
</where>
|
||||
group by su.nick_name,tdc.business_id,tdc.att_name
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectDownloadDocCountList" parameterType="DownloadCount" resultMap="DownloadCountResult">
|
||||
select
|
||||
tdc.business_id,tl.doc_code,tl.doc_name,sum(1) as doc_down_num
|
||||
from t_download_count tdc
|
||||
left join t_document tl on tdc.business_id = tl.doc_id
|
||||
<where>
|
||||
and business_type = 'doc' and tl.is_deleted != 1
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND date_format(tdc.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND date_format(tdc.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="docCode != null and docCode != ''">
|
||||
AND tl.doc_code like concat('%', #{docCode}, '%')
|
||||
</if>
|
||||
<if test="docName != null and docName != ''">
|
||||
AND tl.doc_name like concat('%', #{docName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
group by tdc.business_id,tl.doc_code,tl.doc_name
|
||||
</select>
|
||||
|
||||
</mapper>
|
109
tool-tech-admin/src/main/resources/mapper/RepliesMapper.xml
Normal file
109
tool-tech-admin/src/main/resources/mapper/RepliesMapper.xml
Normal file
@ -0,0 +1,109 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.rzdata.web.mapper.RepliesMapper">
|
||||
|
||||
<resultMap type="Replies" id="RepliesResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="discussionId" column="discussion_id" />
|
||||
<result property="repId" column="rep_id" />
|
||||
<result property="content" column="content" />
|
||||
<result property="isDelete" column="is_delete" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createById" column="create_by_id" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateById" column="update_by_id" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRepliesVo">
|
||||
select id, discussion_id, rep_id, content, is_delete, create_by, create_by_id, create_time, update_by, update_by_id, update_time from t_replies
|
||||
</sql>
|
||||
|
||||
<select id="selectRepliesList" parameterType="Replies" resultMap="RepliesResult">
|
||||
select tr.*,su.nick_name
|
||||
from t_replies tr
|
||||
left join sys_user su on su.user_id = tr.create_by_id
|
||||
<where>
|
||||
<if test="discussionId != null and discussionId != ''"> and tr.discussion_id = #{discussionId}</if>
|
||||
<if test="content != null and content != ''"> and tr.content = #{content}</if>
|
||||
<if test="createById != null and createById != ''"> and tr.create_by_id = #{createById}</if>
|
||||
<if test="updateById != null and updateById != ''"> and tr.update_by_id = #{updateById}</if>
|
||||
<if test="discussionIdList != null and discussionIdList.size() > 0">
|
||||
and tr.discussion_id in
|
||||
<foreach item="id" index="index" collection="discussionIdList" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
and tr.is_delete = '0'
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRepliesById" parameterType="String" resultMap="RepliesResult">
|
||||
select tr.*,su.nick_name
|
||||
from t_replies tr
|
||||
left join sys_user su on su.user_id = tr.create_by_id
|
||||
where tr.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertReplies" parameterType="Replies">
|
||||
insert into t_replies
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="discussionId != null">discussion_id,</if>
|
||||
<if test="repId != null">rep_id,</if>
|
||||
<if test="content != null">content,</if>
|
||||
<if test="isDelete != null">is_delete,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createById != null">create_by_id,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateById != null">update_by_id,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="discussionId != null">#{discussionId},</if>
|
||||
<if test="repId != null">#{repId},</if>
|
||||
<if test="content != null">#{content},</if>
|
||||
<if test="isDelete != null">#{isDelete},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createById != null">#{createById},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateById != null">#{updateById},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateReplies" parameterType="Replies">
|
||||
update t_replies
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="discussionId != null">discussion_id = #{discussionId},</if>
|
||||
<if test="repId != null">rep_id = #{repId},</if>
|
||||
<if test="content != null">content = #{content},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createById != null">create_by_id = #{createById},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateById != null">update_by_id = #{updateById},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteRepliesById" parameterType="String">
|
||||
delete from t_replies where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRepliesByIds" parameterType="String">
|
||||
delete from t_replies where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -2,11 +2,14 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.rzdata.web.mapper.UseApplyMapper">
|
||||
<mapper namespace="com.rzdata.web.mapper.ToolApplyMapper">
|
||||
|
||||
<resultMap type="UseApply" id="UseApplyResult">
|
||||
<resultMap type="ToolApply" id="ToolApplyResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="toolId" column="tool_id" />
|
||||
<result property="procTitle" column="proc_title" />
|
||||
<result property="applyType" column="apply_type" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
@ -16,37 +19,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="procInstId" column="proc_inst_id" />
|
||||
<result property="endTime" column="end_time" />
|
||||
<result property="recordStatus" column="record_status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectUseApplyVo">
|
||||
select id, user_id, nick_name, dept_id, dept_name, reason, create_by, create_time, update_by, update_time from t_use_apply
|
||||
<sql id="selectToolApplyVo">
|
||||
select id, user_id, nick_name, tool_id, apply_type, proc_title, proc_inst_id, end_time, dept_id, record_status, dept_name, reason, create_by, create_time, update_by, update_time from t_tool_apply
|
||||
</sql>
|
||||
|
||||
<select id="selectUseApplyList" parameterType="UseApply" resultMap="UseApplyResult">
|
||||
<include refid="selectUseApplyVo"/>
|
||||
<select id="selectToolApplyList" parameterType="ToolApply" resultMap="ToolApplyResult">
|
||||
<include refid="selectToolApplyVo"/>
|
||||
<where>
|
||||
<if test="userId != null and userId != ''"> and user_id like concat('%', #{userId}, '%')</if>
|
||||
<if test="deptId != null and deptId != ''"> and dept_id = #{deptId}</if>
|
||||
<if test="applyType != null and applyType != ''"> and apply_type = #{applyType}</if>
|
||||
<if test="reason != null and reason != ''"> and reason = #{reason}</if>
|
||||
<if test="recordStatus != null and recordStatus != ''"> and record_status = #{recordStatus}</if>
|
||||
<if test="procTitle != null and procTitle != ''"> and proc_title like concat('%', #{procTitle}, '%')</if>
|
||||
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectUseApplyById" parameterType="String" resultMap="UseApplyResult">
|
||||
<include refid="selectUseApplyVo"/>
|
||||
<select id="selectToolApplyById" parameterType="String" resultMap="ToolApplyResult">
|
||||
<include refid="selectToolApplyVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getInfoByBpmcId" parameterType="String" resultMap="UseApplyResult">
|
||||
<include refid="selectUseApplyVo"/>
|
||||
<select id="getInfoByBpmcId" parameterType="String" resultMap="ToolApplyResult">
|
||||
<include refid="selectToolApplyVo"/>
|
||||
where proc_inst_id = #{bpmcId}
|
||||
</select>
|
||||
|
||||
<insert id="insertUseApply" parameterType="UseApply">
|
||||
insert into t_use_apply
|
||||
<insert id="insertToolApply" parameterType="ToolApply">
|
||||
insert into t_tool_apply
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="toolId != null">tool_id,</if>
|
||||
<if test="procTitle != null">proc_title,</if>
|
||||
<if test="applyType != null">apply_type,</if>
|
||||
<if test="nickName != null">nick_name,</if>
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="deptName != null">dept_name,</if>
|
||||
@ -56,11 +74,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="procInstId != null">proc_inst_id,</if>
|
||||
<if test="endTime != null">end_time,</if>
|
||||
<if test="recordStatus != null">record_status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="toolId != null">#{toolId},</if>
|
||||
<if test="procTitle != null">#{procTitle},</if>
|
||||
<if test="applyType != null">#{applyType},</if>
|
||||
<if test="nickName != null">#{nickName},</if>
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="deptName != null">#{deptName},</if>
|
||||
@ -69,16 +91,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="endTime != null">#{endTime},</if>
|
||||
<if test="procInstId != null">#{procInstId},</if>
|
||||
<if test="recordStatus != null">#{recordStatus},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateUseApply" parameterType="UseApply">
|
||||
update t_use_apply
|
||||
<update id="updateToolApply" parameterType="ToolApply">
|
||||
update t_tool_apply
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="nickName != null">nick_name = #{nickName},</if>
|
||||
<if test="toolId != null">tool_id = #{toolId},</if>
|
||||
<if test="procTitle != null">proc_title = #{procTitle},</if>
|
||||
<if test="applyType != null">apply_type = #{applyType},</if>
|
||||
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||
<if test="deptName != null">dept_name = #{deptName},</if>
|
||||
<if test="reason != null">reason = #{reason},</if>
|
||||
@ -86,27 +112,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</if>
|
||||
<if test="recordStatus != null">record_status = #{recordStatus},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteUseApplyById" parameterType="String">
|
||||
delete from t_use_apply where id = #{id}
|
||||
<delete id="deleteToolApplyById" parameterType="String">
|
||||
delete from t_tool_apply where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteUseApplyByIds" parameterType="String">
|
||||
delete from t_use_apply where id in
|
||||
<delete id="deleteToolApplyByIds" parameterType="String">
|
||||
delete from t_tool_apply where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="checkUseApply" resultType="int">
|
||||
SELECT count(*) FROM `t_use_apply_item` uai
|
||||
left join `t_use_apply` ua on uai.apply_id = ua.id
|
||||
WHERE ua.record_status = 'done'
|
||||
and uai.tool_id = #{toolId}
|
||||
and ua.user_id = #{userId}
|
||||
<select id="hasToolUseApply" resultType="int">
|
||||
SELECT count(*) FROM t_tool_apply ta
|
||||
WHERE ta.apply_type='use' and ta.record_status != 'cancel' and ta.tool_id = #{toolId} and ta.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="checkToolUseApply" resultType="int">
|
||||
SELECT count(*) FROM t_tool_apply ta
|
||||
WHERE ta.apply_type='use' and ta.record_status = 'done'
|
||||
and ta.tool_id = #{toolId}
|
||||
and ta.user_id = #{userId}
|
||||
</select>
|
||||
</mapper>
|
@ -19,6 +19,10 @@
|
||||
<result property="toolPrincipalsName" column="tool_principals_name" />
|
||||
<result property="toolRespDept" column="tool_resp_dept" />
|
||||
<result property="toolRespDeptName" column="tool_resp_dept_name" />
|
||||
<result property="encryptionMode" column="encryption_mode" />
|
||||
<result property="serviceTime" column="service_time" />
|
||||
<result property="contactPerson" column="contact_person" />
|
||||
<result property="contactPhone" column="contact_phone" />
|
||||
<result property="status" column="status" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
@ -40,7 +44,7 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectToolVo">
|
||||
select tool_id, tool_code, tool_name, tool_type, tool_source, tool_use, test_situation, function_desc, apply_condition, operate_explain, tool_principals, tool_principals_name, tool_resp_dept, status, remark, create_by, create_time, update_by, update_time,proc_inst_id,record_status,association from t_tool
|
||||
select tool_id, tool_code, tool_name, tool_type, tool_source, tool_use, test_situation, function_desc, apply_condition, operate_explain, tool_principals, tool_principals_name, tool_resp_dept, encryption_mode, service_time, contact_person, contact_phone, status, remark, create_by, create_time, update_by, update_time,proc_inst_id,record_status,association from t_tool
|
||||
</sql>
|
||||
|
||||
<select id="selectToolByToolId" parameterType="String" resultMap="ToolResult">
|
||||
@ -69,6 +73,10 @@
|
||||
<if test="toolPrincipals != null">tool_principals,</if>
|
||||
<if test="toolPrincipalsName != null">tool_principals_name,</if>
|
||||
<if test="toolRespDept != null">tool_resp_dept,</if>
|
||||
<if test="encryptionMode != null">encryption_mode,</if>
|
||||
<if test="serviceTime != null">service_time,</if>
|
||||
<if test="contactPerson != null">contact_person,</if>
|
||||
<if test="contactPhone != null">contact_phone,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
@ -93,6 +101,10 @@
|
||||
<if test="toolPrincipals != null">#{toolPrincipals},</if>
|
||||
<if test="toolPrincipalsName != null">#{toolPrincipalsName},</if>
|
||||
<if test="toolRespDept != null">#{toolRespDept},</if>
|
||||
<if test="encryptionMode != null">#{encryptionMode},</if>
|
||||
<if test="serviceTime != null">#{serviceTime},</if>
|
||||
<if test="contactPerson != null">#{contactPerson},</if>
|
||||
<if test="contactPhone != null">#{contactPhone},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
@ -120,6 +132,10 @@
|
||||
<if test="toolPrincipals != null">tool_principals = #{toolPrincipals},</if>
|
||||
<if test="toolPrincipalsName != null">tool_principals_name = #{toolPrincipalsName},</if>
|
||||
<if test="toolRespDept != null">tool_resp_dept = #{toolRespDept},</if>
|
||||
<if test="encryptionMode != null">encryption_mode = #{encryptionMode},</if>
|
||||
<if test="serviceTime != null">service_time = #{serviceTime},</if>
|
||||
<if test="contactPerson != null">contact_person = #{contactPerson},</if>
|
||||
<if test="contactPhone != null">contact_phone = #{contactPhone},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
@ -144,8 +160,10 @@
|
||||
</select>
|
||||
|
||||
<select id="selectToolList" parameterType="Tool" resultMap="ToolResult">
|
||||
select u.tool_id, u.tool_code, u.tool_name, u.tool_type, u.tool_source, u.tool_use, u.test_situation, u.function_desc, u.apply_condition, u.operate_explain,u.record_status,u.proc_inst_id,
|
||||
u.tool_principals, u.tool_principals_name, u.tool_resp_dept, u.status, u.create_by, u.create_time, u.remark, d.dept_name as tool_resp_dept_name,u.association from t_tool u
|
||||
select u.tool_id, u.tool_code, u.tool_name, u.tool_type, u.tool_source, u.encryption_mode, u.service_time, u.contact_person, u.contact_phone, u.tool_use, u.test_situation, u.function_desc, u.apply_condition, u.operate_explain,u.record_status,u.proc_inst_id,
|
||||
u.tool_principals, u.tool_principals_name, u.tool_resp_dept, u.status, u.create_by, u.create_time, u.remark, d.dept_name as tool_resp_dept_name,u.association
|
||||
from t_tool u
|
||||
left join sys_user su on u.create_by = su.user_id
|
||||
left join sys_dept d on u.tool_resp_dept = d.dept_id
|
||||
where 1=1
|
||||
and u.record_status != 'cancel'
|
||||
@ -153,11 +171,20 @@
|
||||
AND u.tool_id = #{toolId}
|
||||
</if>
|
||||
<if test="toolCode != null and toolCode != ''">
|
||||
AND u.tool_code = #{toolCode}
|
||||
AND u.tool_code like concat('%', #{toolCode}, '%')
|
||||
</if>
|
||||
<if test="toolName != null and toolName != ''">
|
||||
AND u.tool_name like concat('%', #{toolName}, '%')
|
||||
</if>
|
||||
<if test="toolPrincipalsName != null and toolPrincipalsName != ''">
|
||||
AND u.tool_principals_name like concat('%', #{toolPrincipalsName}, '%')
|
||||
</if>
|
||||
<if test="toolType != null and toolType != ''">
|
||||
AND u.tool_type = #{toolType}
|
||||
</if>
|
||||
<if test="recordStatus != null and recordStatus != ''">
|
||||
AND u.record_status = #{recordStatus}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND u.status = #{status}
|
||||
</if>
|
||||
@ -176,6 +203,19 @@
|
||||
<if test="recordStatus != null and recordStatus != ''">
|
||||
AND u.record_status = #{recordStatus}
|
||||
</if>
|
||||
<if test="toolIdList != null and toolIdList.size() > 0">
|
||||
and u.tool_id in
|
||||
<foreach item="id" index="index" collection="toolIdList" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="filterToolIds != null and filterToolIds.size() > 0">
|
||||
and u.tool_id not in
|
||||
<foreach item="id" index="index" collection="filterToolIds" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
${params.dataScope}
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
@ -189,4 +229,14 @@
|
||||
#{toolId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="countToolType" resultType="java.util.Map">
|
||||
select tool_type as types,sum(1) as statistics from t_tool where record_status != 'cancel' group by tool_type;
|
||||
</select>
|
||||
<select id="toolSource" resultType="java.util.Map">
|
||||
select tool_source as types,sum(1) as statistics from t_tool where record_status != 'cancel' group by tool_source;
|
||||
</select>
|
||||
<select id="recordStatus" resultType="java.util.Map">
|
||||
select record_status as types,sum(1) as statistics from t_tool where record_status != 'cancel' group by record_status;
|
||||
</select>
|
||||
</mapper>
|
||||
|
101
tool-tech-admin/src/main/resources/mapper/ToolRelationMapper.xml
Normal file
101
tool-tech-admin/src/main/resources/mapper/ToolRelationMapper.xml
Normal file
@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.rzdata.web.mapper.ToolRelationMapper">
|
||||
|
||||
<resultMap type="ToolRelation" id="ToolRelationResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="resourceId" column="resource_id" />
|
||||
<result property="targetId" column="target_id" />
|
||||
<result property="toolCode" column="tool_code" />
|
||||
<result property="toolName" column="tool_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectToolRelationVo">
|
||||
select id, resource_id, target_id from t_tool_relation
|
||||
</sql>
|
||||
|
||||
<select id="selectToolRelationList" parameterType="ToolRelation" resultMap="ToolRelationResult">
|
||||
<include refid="selectToolRelationVo"/>
|
||||
<where>
|
||||
<if test="resourceId != null and resourceId != ''"> and resource_id = #{resourceId}</if>
|
||||
<if test="targetId != null and targetId != ''"> and target_id = #{targetId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectRelationToolList" parameterType="ToolRelation" resultMap="ToolRelationResult">
|
||||
select
|
||||
tr.id, tr.resource_id, tr.target_id,tl.tool_code,tl.tool_name
|
||||
from t_tool_relation tr
|
||||
left join t_tool tl on tr.target_id = tl.tool_id
|
||||
<where>
|
||||
<if test="resourceId != null and resourceId != ''"> and tr.resource_id = #{resourceId}</if>
|
||||
<if test="targetId != null and targetId != ''"> and tr.target_id = #{targetId}</if>
|
||||
<if test="resourceIds != null and resourceIds.size() > 0">
|
||||
and tr.resource_id in
|
||||
<foreach item="id" index="index" collection="resourceIds" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectToolRelationById" parameterType="String" resultMap="ToolRelationResult">
|
||||
<include refid="selectToolRelationVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertToolRelation" parameterType="ToolRelation">
|
||||
insert into t_tool_relation
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="resourceId != null">resource_id,</if>
|
||||
<if test="targetId != null">target_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="resourceId != null">#{resourceId},</if>
|
||||
<if test="targetId != null">#{targetId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateToolRelation" parameterType="ToolRelation">
|
||||
update t_tool_relation
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="resourceId != null">resource_id = #{resourceId},</if>
|
||||
<if test="targetId != null">target_id = #{targetId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteToolRelationById" parameterType="String">
|
||||
delete from t_tool_relation where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteResourceAndTarget" parameterType="String">
|
||||
delete from t_tool_relation where resource_id = #{resourceId} and target_id = #{targetId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTargetAndResource" parameterType="String">
|
||||
delete from t_tool_relation where target_id = #{targetId} and resource_id = #{resourceId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteToolRelationByIds" parameterType="String">
|
||||
delete from t_tool_relation where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
|
||||
<!-- 批量插入 -->
|
||||
<insert id="batchInsert" parameterType="java.util.List">
|
||||
insert into t_tool_relation (id, resource_id, target_id)
|
||||
values
|
||||
<foreach item="item" index="index" collection="toolRelationList" open="(" separator="),(" close=")">
|
||||
#{item.id}, #{item.resourceId}, #{item.targetId}
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
131
tool-tech-admin/src/main/resources/mapper/TzMessageMapper.xml
Normal file
131
tool-tech-admin/src/main/resources/mapper/TzMessageMapper.xml
Normal file
@ -0,0 +1,131 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.rzdata.web.mapper.TzMessageMapper">
|
||||
|
||||
<resultMap type="TzMessage" id="TzMessageResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="receiverId" column="receiver_id" />
|
||||
<result property="businessId" column="business_id" />
|
||||
<result property="businessType" column="business_type" />
|
||||
<result property="states" column="states" />
|
||||
<result property="content" column="content" />
|
||||
<result property="deleted" column="deleted" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createById" column="create_by_id" />
|
||||
<result property="updateById" column="update_by_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTzMessageVo">
|
||||
select id, business_id, business_type, receiver_id, states, content, deleted, create_by,
|
||||
create_time, update_by, update_time,
|
||||
remark,create_by_id,update_by_id from tz_message
|
||||
</sql>
|
||||
|
||||
<select id="selectTzMessageList" parameterType="TzMessage" resultMap="TzMessageResult">
|
||||
<include refid="selectTzMessageVo"/>
|
||||
<where>
|
||||
<if test="receiverId != null and receiverId != ''"> and receiver_id = #{receiverId}</if>
|
||||
<if test="states != null "> and states = #{states}</if>
|
||||
<if test="content != null and content != ''"> and content like concat('%', #{content}, '%')</if>
|
||||
<if test="createById != null and deleted != ''"> and create_by_id = #{createById}</if>
|
||||
<if test="businessType != null and businessType != ''"> and business_type = #{businessType}</if>
|
||||
and deleted = '0'
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectTzMessageById" parameterType="String" resultMap="TzMessageResult">
|
||||
<include refid="selectTzMessageVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertTzMessage" parameterType="TzMessage">
|
||||
insert into tz_message
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="receiverId != null">receiver_id,</if>
|
||||
<if test="businessId != null">business_id,</if>
|
||||
<if test="businessType != null">business_type,</if>
|
||||
<if test="states != null">states,</if>
|
||||
<if test="content != null and content != ''">content,</if>
|
||||
<if test="deleted != null and deleted != ''">deleted,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createById != null">create_by_id,</if>
|
||||
<if test="updateById != null">update_by_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="receiverId != null">#{receiverId},</if>
|
||||
<if test="businessId != null">#{businessId},</if>
|
||||
<if test="businessType != null">#{businessType},</if>
|
||||
<if test="states != null">#{states},</if>
|
||||
<if test="content != null and content != ''">#{content},</if>
|
||||
<if test="deleted != null and deleted != ''">#{deleted},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createById != null">#{createById},</if>
|
||||
<if test="updateById != null">#{updateById},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTzMessage" parameterType="TzMessage">
|
||||
update tz_message
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="receiverId != null">receiver_id = #{receiverId},</if>
|
||||
<if test="businessId != null">business_id = #{businessId},</if>
|
||||
<if test="businessType != null">business_type = #{businessType},</if>
|
||||
<if test="states != null">states = #{states},</if>
|
||||
<if test="content != null and content != ''">content = #{content},</if>
|
||||
<if test="deleted != null and deleted != ''">deleted = #{deleted},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createById != null">create_by_id = #{createById},</if>
|
||||
<if test="updateById != null">update_by_id = #{updateById},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteTzMessageById" parameterType="String">
|
||||
delete from tz_message where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTzMessageByIds" parameterType="String">
|
||||
delete from tz_message where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateAllMarkedRead" parameterType="TzMessage">
|
||||
update tz_message set states = '2',update_by = #{updateBy},update_time = #{updateTime},update_by_id = #{updateById} where receiver_id = #{receiverId}
|
||||
</update>
|
||||
|
||||
<!-- 批量插入 -->
|
||||
<insert id="batchInsert" parameterType="java.util.List">
|
||||
insert into tz_message (id, business_id, business_type, receiver_id, states, content, deleted, create_by, create_by_id, create_time)
|
||||
values
|
||||
<foreach item="item" index="index" collection="tzMessageList" open="(" separator="),(" close=")">
|
||||
#{item.id}, #{item.businessId}, #{item.businessType}, #{item.receiverId}, #{item.states}, #{item.content}, #{item.deleted}, #{item.createBy},#{item.createById}, #{item.createTime}
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="selectTzMessageByUserCount" resultType="java.lang.Integer">
|
||||
select count(1) from tz_message where receiver_id = #{userId} and states = '1' and deleted = '0'
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,26 @@
|
||||
package com.rzdata.common.config;
|
||||
|
||||
import cn.hutool.core.lang.Snowflake;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* 雪花算法订单号生成
|
||||
* @author lanhai
|
||||
*/
|
||||
@Configuration
|
||||
public class SnowflakeConfig {
|
||||
|
||||
@Value("${application.datacenterId}")
|
||||
private Long datacenterId;
|
||||
|
||||
@Value("${application.workerId}")
|
||||
private Long workerId;
|
||||
|
||||
@Bean
|
||||
public Snowflake snowflake() {
|
||||
return new Snowflake(workerId, datacenterId);
|
||||
}
|
||||
|
||||
}
|
@ -10,7 +10,7 @@ public class CacheConstants
|
||||
/**
|
||||
* 登录用户 redis key
|
||||
*/
|
||||
public static final String LOGIN_TOKEN_KEY = "ja_login_tokens:";
|
||||
public static final String LOGIN_TOKEN_KEY = "ja_tool_login_tokens:";
|
||||
|
||||
/**
|
||||
* 验证码 redis key
|
||||
|
@ -182,4 +182,46 @@ public class Constants
|
||||
public static final String DOWNLOAD_TOOL_PERMISSION = "download:done:tool";
|
||||
|
||||
|
||||
|
||||
/** 文档-状态-已发布 **/
|
||||
public static final String DOC_STATUS_YFB = "yfb";
|
||||
/** 文档-状态-已上传 **/
|
||||
public static final String DOC_STATUS_YSC = "ysc";
|
||||
/** 文档-状态-审核中 **/
|
||||
public static final String DOC_STATUS_SHZ = "shz";
|
||||
|
||||
/** 文档-doc **/
|
||||
public static final String DOC_TYPE_DOC = "doc";
|
||||
/** 工具状态 **/
|
||||
public static final String ATT_TYPE_TOOL = "tool";
|
||||
|
||||
|
||||
public static final String STR_ZERO = "0";
|
||||
public static final String STR_ONE = "1";
|
||||
|
||||
/**
|
||||
* 申请类型-发布申请
|
||||
*/
|
||||
public static final String TOOL_APPLY_TYPE_PUBLISH = "publish";
|
||||
|
||||
/**
|
||||
* 申请类型-使用申请
|
||||
*/
|
||||
public static final String TOOL_APPLY_TYPE_USE = "use";
|
||||
|
||||
public static final String DOC_DOWNLOAD_PERMISSION = "document:download";
|
||||
public static final String DOC_VIEW_PERMISSION = "document:query:data:all";
|
||||
|
||||
/** 申请查看素哟偶数据 **/
|
||||
public static final String APPLY_VIEW_ALL_PERMISSION = "system:apply:all:view";
|
||||
|
||||
public static final String FILE_DOWNLOAD = "download";
|
||||
public static final String FILE_PREVIEW = "preview";
|
||||
public static final String FILE_TYPE_DOC = ".doc";
|
||||
public static final String FILE_TYPE_PDF = ".pdf";
|
||||
public static final String SYMBOL_POINT = ".";
|
||||
/**
|
||||
* URL路径符
|
||||
*/
|
||||
public final static String SEPARATOR ="/";
|
||||
}
|
||||
|
@ -0,0 +1,54 @@
|
||||
package com.rzdata.common.core.domain;
|
||||
|
||||
import com.rzdata.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文档资源分类管理对象 t_document_category
|
||||
*
|
||||
* @author spongepan
|
||||
* @date 2024-08-27
|
||||
*/
|
||||
@Data
|
||||
public class DocumentCategory extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private String id;
|
||||
|
||||
/** 分类名称 */
|
||||
@Excel(name = "分类名称")
|
||||
private String categoryName;
|
||||
|
||||
/** 分类描述 */
|
||||
@Excel(name = "分类描述")
|
||||
private String categoryDescription;
|
||||
|
||||
/** 父分类ID,如果是一级分类,则为空 */
|
||||
@Excel(name = "父分类ID,如果是一级分类,则为空")
|
||||
private String parentId;
|
||||
|
||||
/** 创建人id */
|
||||
@Excel(name = "创建人id")
|
||||
private String createById;
|
||||
|
||||
/** 更新人id */
|
||||
@Excel(name = "更新人id")
|
||||
private String updateById;
|
||||
|
||||
/** 类型(system:系统,user:用户创建) */
|
||||
@Excel(name = "类型")
|
||||
private String types;
|
||||
|
||||
/** 文档分类id */
|
||||
@Excel(name = "文档分类id")
|
||||
private String docCategoryId;
|
||||
|
||||
/** 子分类 */
|
||||
private List<DocumentCategory> children = new ArrayList<DocumentCategory>();
|
||||
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package com.rzdata.common.core.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.rzdata.common.core.domain.entity.SysDept;
|
||||
import com.rzdata.common.core.domain.entity.SysMenu;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Treeselect树结构实体类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Data
|
||||
public class ToolTreeSelect implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 节点ID */
|
||||
private String id;
|
||||
|
||||
/** 节点名称 */
|
||||
private String label;
|
||||
|
||||
/** 类型 */
|
||||
private String types;
|
||||
|
||||
/** 子节点 */
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
private List<ToolTreeSelect> children;
|
||||
|
||||
public ToolTreeSelect()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public ToolTreeSelect(DocumentCategory docCategory)
|
||||
{
|
||||
this.id = docCategory.getId();
|
||||
this.label = docCategory.getCategoryName();
|
||||
this.types = docCategory.getTypes();
|
||||
this.children = docCategory.getChildren().stream().map(ToolTreeSelect::new).collect(Collectors.toList());
|
||||
}
|
||||
}
|
@ -6,22 +6,27 @@ import java.util.stream.Collectors;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.rzdata.common.core.domain.entity.SysDept;
|
||||
import com.rzdata.common.core.domain.entity.SysMenu;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Treeselect树结构实体类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Data
|
||||
public class TreeSelect implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 节点ID */
|
||||
private Long id;
|
||||
|
||||
private String categoryId;
|
||||
/** 节点名称 */
|
||||
private String label;
|
||||
|
||||
/** 类型 */
|
||||
private String types;
|
||||
|
||||
/** 子节点 */
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
private List<TreeSelect> children;
|
||||
@ -45,33 +50,15 @@ public class TreeSelect implements Serializable
|
||||
this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
|
||||
public TreeSelect(DocumentCategory docCategory)
|
||||
{
|
||||
return id;
|
||||
this.id = Long.valueOf(docCategory.getId());
|
||||
this.categoryId = docCategory.getId();
|
||||
this.label = docCategory.getCategoryName();
|
||||
this.types = docCategory.getTypes();
|
||||
this.children = docCategory.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getLabel()
|
||||
{
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label)
|
||||
{
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public List<TreeSelect> getChildren()
|
||||
{
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<TreeSelect> children)
|
||||
{
|
||||
this.children = children;
|
||||
}
|
||||
}
|
||||
|
@ -31,6 +31,8 @@ public class SysDept extends BaseEntity
|
||||
/** 部门名称 */
|
||||
private String deptName;
|
||||
|
||||
private String deptType;
|
||||
|
||||
/** 显示顺序 */
|
||||
private Integer orderNum;
|
||||
|
||||
@ -97,6 +99,16 @@ public class SysDept extends BaseEntity
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
public String getDeptType()
|
||||
{
|
||||
return deptType;
|
||||
}
|
||||
|
||||
public void setDeptType(String deptType)
|
||||
{
|
||||
this.deptType = deptType;
|
||||
}
|
||||
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
public Integer getOrderNum()
|
||||
{
|
||||
|
@ -5,6 +5,8 @@ import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Objects;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.rzdata.common.listener.PutObjectProgressListener;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.springframework.util.Assert;
|
||||
@ -280,4 +282,58 @@ public class FileUploadUtils
|
||||
}
|
||||
return extension;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成合并后的文件路径
|
||||
*
|
||||
* @param baseDir 文件存储根目录
|
||||
* @param fileName 上传的文件名
|
||||
* @return 合并后文件的完整路径
|
||||
*/
|
||||
public static String generateMergedFilePath(String baseDir, String fileName) {
|
||||
// 获取当前日期路径
|
||||
String datePath = DateUtil.today().replace("-", "/");
|
||||
|
||||
// 获取文件的基本名称和扩展名
|
||||
String baseName = StrUtil.subBefore(fileName, ".", true);
|
||||
String extension = StrUtil.subAfter(fileName, ".", true);
|
||||
|
||||
// 生成唯一文件名,使用时间戳
|
||||
String uniqueFileName = baseName + "_" + System.currentTimeMillis() + "." + extension;
|
||||
|
||||
// 合并文件路径: baseDir/yyyy/MM/dd/uploadId/uniqueFileName
|
||||
String mergedFilePath = Paths.get(baseDir, datePath, uniqueFileName).toString();
|
||||
|
||||
return mergedFilePath;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取文件名称
|
||||
*
|
||||
* @param baseDir 文件存储根目录
|
||||
* @param fileNames 上传的文件名
|
||||
* @return 合并后文件的完整路径
|
||||
*/
|
||||
public static String getFilePath(String baseDir, String fileNames) {
|
||||
String extension = StrUtil.subAfter(fileNames, ".", true);
|
||||
|
||||
String fileName = StringUtils.format("{}/{}_{}.{}", DateUtils.datePath(),
|
||||
FilenameUtils.getBaseName(fileNames), Seq.getId(Seq.uploadSeqType), extension);;
|
||||
|
||||
try {
|
||||
return getPathFileName(baseDir, fileName);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String extractSuffix(String filePath) {
|
||||
int lastDotIndex = filePath.lastIndexOf('.');
|
||||
if (lastDotIndex == -1) {
|
||||
return ""; // 没有后缀
|
||||
}
|
||||
return filePath.substring(lastDotIndex + 1); // 去掉点(.)
|
||||
}
|
||||
}
|
||||
|
@ -22,9 +22,9 @@ public class MimeTypeUtils
|
||||
public static final String[] FLASH_EXTENSION = { "swf", "flv" };
|
||||
|
||||
public static final String[] MEDIA_EXTENSION = { "swf", "flv", "mp3", "wav", "wma", "wmv", "mid", "avi", "mpg",
|
||||
"asf", "rm", "rmvb" };
|
||||
"asf", "rm", "webm" };
|
||||
|
||||
public static final String[] VIDEO_EXTENSION = { "mp4", "avi", "rmvb" };
|
||||
public static final String[] VIDEO_EXTENSION = { "mp4", "avi", "webm" };
|
||||
|
||||
public static final String[] DEFAULT_ALLOWED_EXTENSION = {
|
||||
// 图片
|
||||
@ -34,7 +34,7 @@ public class MimeTypeUtils
|
||||
// 压缩文件
|
||||
"rar", "zip", "gz", "bz2",
|
||||
// 视频格式
|
||||
"mp4", "avi", "rmvb",
|
||||
"mp4", "avi", "webm",
|
||||
// pdf
|
||||
"pdf" };
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
#!/bin/bash
|
||||
tail -fn 300 ../log/kkFileView.log
|
||||
tail -fn 300 ../log/toolTechFileView.log
|
@ -1,21 +1,13 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
#
|
||||
#############################
|
||||
# Author: sanxi
|
||||
# Version: 1.0
|
||||
# Date: 2021/09/17
|
||||
# Description: v1.0:修改kkFileView关闭进程机制
|
||||
#############################
|
||||
#
|
||||
KKFILEVIEW_BIN_FOLDER=$(cd "$(dirname "$0")" || exit 1 ;pwd)
|
||||
PID_FILE_NAME="kkFileView.pid"
|
||||
PID_FILE="${KKFILEVIEW_BIN_FOLDER}/${PID_FILE_NAME}"
|
||||
export KKFILEVIEW_BIN_FOLDER=$KKFILEVIEW_BIN_FOLDER
|
||||
|
||||
TTFILEVIEW_BIN_FOLDER=$(cd "$(dirname "$0")" || exit 1 ;pwd)
|
||||
PID_FILE_NAME="toolTechFileView.pid"
|
||||
PID_FILE="${TTFILEVIEW_BIN_FOLDER}/${PID_FILE_NAME}"
|
||||
export TTFILEVIEW_BIN_FOLDER=$TTFILEVIEW_BIN_FOLDER
|
||||
#
|
||||
## pid文件是否存在
|
||||
if [ ! -e "$PID_FILE" ]; then
|
||||
echo "kkFileView.pid文件不存在!"
|
||||
echo "toolTechFileView.pid文件不存在!"
|
||||
exit 1
|
||||
else
|
||||
## 文件不为空代表程序正在运行,则循环关闭进程。
|
||||
@ -31,6 +23,6 @@ else
|
||||
# 关闭所有进程后,重置pid。
|
||||
cat /dev/null > "$PID_FILE"
|
||||
else
|
||||
echo "kkFileView进程尚未运行!"
|
||||
echo "toolTechFileView进程尚未运行!"
|
||||
fi
|
||||
fi
|
||||
|
@ -1,10 +1,7 @@
|
||||
@echo off
|
||||
set "KKFILEVIEW_BIN_FOLDER=%cd%"
|
||||
cd "%KKFILEVIEW_BIN_FOLDER%"
|
||||
echo Using KKFILEVIEW_BIN_FOLDER %KKFILEVIEW_BIN_FOLDER%
|
||||
echo Starting kkFileView...
|
||||
echo Please check log file in ../log/kkFileView.log for more information
|
||||
echo You can get help in our official home site: https://kkview.cn
|
||||
echo If you need further help, please join our kk opensource community: https://t.zsxq.com/09ZHSXbsQ
|
||||
echo If this project is helpful to you, please star it on https://gitee.com/kekingcn/file-online-preview/stargazers
|
||||
java -Dspring.config.location=..\config\application.properties -jar kkFileView-4.4.0-beta.jar -> ..\log\kkFileView.log
|
||||
set "TTFILEVIEW_BIN_FOLDER=%cd%"
|
||||
cd "%TTFILEVIEW_BIN_FOLDER%"
|
||||
echo Using TTFILEVIEW_BIN_FOLDER %TTFILEVIEW_BIN_FOLDER%
|
||||
echo Starting toolTechFileView...
|
||||
echo Please check log file in ../log/toolTechFileView.log for more information
|
||||
java -Dspring.config.location=..\config\application.properties -jar tool-tech-file-view-4.4.0.jar -> ..\log\toolTechFileView.log
|
||||
|
@ -1,25 +1,16 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
#
|
||||
#############################
|
||||
# First_Author: 凯京科技
|
||||
# Second_Author: sanxi
|
||||
# Version: 1.1
|
||||
# Date: 2021/09/17
|
||||
# Description: v1.1:修改进程启动机制为pid形式。
|
||||
#############################
|
||||
#
|
||||
|
||||
DIR_HOME=("/opt/openoffice.org3" "/opt/libreoffice" "/opt/libreoffice6.1" "/opt/libreoffice7.0" "/opt/libreoffice7.1" "/opt/libreoffice7.2" "/opt/libreoffice7.3" "/opt/libreoffice7.4" "/opt/libreoffice7.5" "/opt/libreoffice7.6" "/opt/openoffice4" "/usr/lib/openoffice" "/usr/lib/libreoffice")
|
||||
FLAG=
|
||||
OFFICE_HOME=
|
||||
KKFILEVIEW_BIN_FOLDER=$(cd "$(dirname "$0")" || exit 1 ;pwd)
|
||||
PID_FILE_NAME="kkFileView.pid"
|
||||
PID_FILE="${KKFILEVIEW_BIN_FOLDER}/${PID_FILE_NAME}"
|
||||
export KKFILEVIEW_BIN_FOLDER=$KKFILEVIEW_BIN_FOLDER
|
||||
TTFILEVIEW_BIN_FOLDER=$(cd "$(dirname "$0")" || exit 1 ;pwd)
|
||||
PID_FILE_NAME="toolTechFileView.pid"
|
||||
PID_FILE="${TTFILEVIEW_BIN_FOLDER}/${PID_FILE_NAME}"
|
||||
export TTFILEVIEW_BIN_FOLDER=$TTFILEVIEW_BIN_FOLDER
|
||||
#
|
||||
## 如pid文件不存在则自动创建
|
||||
if [ ! -f ${PID_FILE_NAME} ]; then
|
||||
touch "${KKFILEVIEW_BIN_FOLDER}/${PID_FILE_NAME}"
|
||||
touch "${TTFILEVIEW_BIN_FOLDER}/${PID_FILE_NAME}"
|
||||
fi
|
||||
## 判断当前是否有进程处于运行状态
|
||||
if [ -s "${PID_FILE}" ]; then
|
||||
@ -27,8 +18,8 @@ if [ -s "${PID_FILE}" ]; then
|
||||
echo "进程已处于运行状态,进程号为:${PID}"
|
||||
exit 1
|
||||
else
|
||||
cd "$KKFILEVIEW_BIN_FOLDER" || exit 1
|
||||
echo "Using KKFILEVIEW_BIN_FOLDER $KKFILEVIEW_BIN_FOLDER"
|
||||
cd "$TTFILEVIEW_BIN_FOLDER" || exit 1
|
||||
echo "Using TTFILEVIEW_BIN_FOLDER $TTFILEVIEW_BIN_FOLDER"
|
||||
grep 'office\.home' ../config/application.properties | grep '!^#'
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Using customized office.home"
|
||||
@ -50,12 +41,9 @@ else
|
||||
fi
|
||||
|
||||
## 启动kkFileView
|
||||
echo "Starting kkFileView..."
|
||||
nohup java -Dfile.encoding=UTF-8 -Dspring.config.location=../config/application.properties -jar kkFileView-4.4.0-beta.jar > ../log/kkFileView.log 2>&1 &
|
||||
echo "Starting ToolTechFileView..."
|
||||
nohup java -Dfile.encoding=UTF-8 -Dspring.config.location=../config/application.properties -jar tool-tech-file-view-4.4.0.jar > ../log/toolTechFileView.log 2>&1 &
|
||||
echo "Please execute ./showlog.sh to check log for more information"
|
||||
echo "You can get help in our official home site: https://kkview.cn"
|
||||
echo "If you need further help, please join our kk opensource community: https://t.zsxq.com/09ZHSXbsQ"
|
||||
echo "If this project is helpful to you, please star it on https://gitee.com/kekingcn/file-online-preview/stargazers"
|
||||
PROCESS=$(ps -ef | grep -v grep | grep java | grep kkFileView | awk 'NR==1{print $2}')
|
||||
# 启动成功后将进程号写入pid文件
|
||||
echo "$PROCESS" > "$PID_FILE"
|
||||
|
@ -1,14 +1,9 @@
|
||||
|
||||
_ _ ______ _ _ __ __ _
|
||||
| | | | | ____| (_) | | \ \ / / (_)
|
||||
| | __ | | __ | |__ _ | | ___ \ \ / / _ ___ __ __
|
||||
| |/ / | |/ / | __| | | | | / _ \ \ \/ / | | / _ \ \ \ /\ / /
|
||||
| < | < | | | | | | | __/ \ / | | | __/ \ V V /
|
||||
|_|\_\ |_|\_\ |_| |_| |_| \___| \/ |_| \___| \_/\_/
|
||||
______ _ _ __ __ _
|
||||
| ____| (_) | | \ \ / / (_)
|
||||
| |__ _ | | ___ \ \ / / _ ___ __ __
|
||||
| __| | | | | / _ \ \ \/ / | | / _ \ \ \ /\ / /
|
||||
| | | | | | | __/ \ / | | | __/ \ V V /
|
||||
|_| |_| |_| \___| \/ |_| \___| \_/\_/
|
||||
|
||||
=> Spring Boot :: ${spring-boot.version}
|
||||
=> kkFileView :: 4.4.0-beta
|
||||
=> Home site :: https://kkview.cn
|
||||
=> Github :: https://github.com/kekingcn/kkFileView
|
||||
=> Gitee :: https://gitee.com/kekingcn/file-online-preview
|
||||
=> kk opensource community :: https://t.zsxq.com/09ZHSXbsQ
|
||||
|
@ -44,7 +44,7 @@
|
||||
* 初始化
|
||||
*/
|
||||
window.onload = function () {
|
||||
initWaterMark();
|
||||
//initWaterMark();
|
||||
loadText();
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ reader.readAsArrayBuffer(file);
|
||||
if (!!window.ActiveXObject || "ActiveXObject" in window)
|
||||
{
|
||||
}else{
|
||||
initWaterMark();
|
||||
//initWaterMark();
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -96,7 +96,7 @@
|
||||
);
|
||||
/*初始化水印*/
|
||||
window.onload = function () {
|
||||
initWaterMark();
|
||||
//initWaterMark();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
/*初始化水印*/
|
||||
window.onload = function () {
|
||||
initWaterMark();
|
||||
//initWaterMark();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
@ -38,7 +38,7 @@
|
||||
if (!!window.ActiveXObject || "ActiveXObject" in window)
|
||||
{
|
||||
}else{
|
||||
initWaterMark();
|
||||
//initWaterMark();
|
||||
}
|
||||
</script>
|
||||
</html>
|
@ -153,7 +153,7 @@ function blobToArrayBuffer(blob) {
|
||||
if (!!window.ActiveXObject || "ActiveXObject" in window)
|
||||
{
|
||||
}else{
|
||||
initWaterMark();
|
||||
//initWaterMark();
|
||||
}
|
||||
</script>
|
||||
</html>
|
@ -38,7 +38,6 @@
|
||||
该(${fileType})文件,系统暂不支持在线预览,具体原因如下:
|
||||
<p style="color: red;">${msg}</p>
|
||||
</span>
|
||||
<p>有任何疑问,请加入kk开源社区知识星球咨询:<a href="https://t.zsxq.com/09ZHSXbsQ">https://t.zsxq.com/09ZHSXbsQ</a><br></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -27,7 +27,7 @@
|
||||
}
|
||||
/*初始化水印*/
|
||||
window.onload = function () {
|
||||
initWaterMark();
|
||||
//initWaterMark();
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<title>kkFileView演示首页</title>
|
||||
<title>tool-tech-file-view演示首页</title>
|
||||
<link rel="icon" href="./favicon.ico" type="image/x-icon">
|
||||
<link rel="stylesheet" href="css/loading.css"/>
|
||||
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css"/>
|
||||
@ -64,13 +64,11 @@
|
||||
<nav class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<a class="navbar-brand" href="https://kkview.cn" target='_blank'>kkFileView</a>
|
||||
<a class="navbar-brand" href="#" target='_blank'>ToolTechFileView</a>
|
||||
</div>
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="active"><a href="./index">首页</a></li>
|
||||
<li><a href="./integrated">接入说明</a></li>
|
||||
<li><a href="./record">版本发布记录</a></li>
|
||||
<li><a href="./sponsor">赞助开源</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
@ -79,7 +77,6 @@
|
||||
<#-- 接入说明 -->
|
||||
<div class="page-header">
|
||||
<h1>支持的文件类型</h1>
|
||||
我们一直在扩展支持的文件类型,不断优化预览的效果,如果您有什么建议,欢迎在kk开源社区留意反馈:<a target='_blank' href="https://t.zsxq.com/09ZHSXbsQ">https://t.zsxq.com/09ZHSXbsQ</a>。
|
||||
</div>
|
||||
<div >
|
||||
<ol>
|
||||
|
@ -17,13 +17,11 @@
|
||||
<nav class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<a class="navbar-brand" href="https://kkview.cn" target='_blank'>kkFileView</a>
|
||||
<a class="navbar-brand" href="#" target='_blank'>ToolTechFileView</a>
|
||||
</div>
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a href="./index">首页</a></li>
|
||||
<li class="active"><a href="./integrated">接入说明</a></li>
|
||||
<li><a href="./record">版本发布记录</a></li>
|
||||
<li><a href="./sponsor">赞助开源</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
@ -32,7 +30,7 @@
|
||||
<#-- 接入说明 -->
|
||||
<div class="page-header">
|
||||
<h1>接入说明</h1>
|
||||
本文档针对前端项目接入 kkFileView 的说明,并假设 kkFileView 的服务地址为:http://127.0.0.1:8012。
|
||||
本文档针对前端项目接入 ToolTechFileView 的说明,并假设 ToolTechFileView 的服务地址为:http://127.0.0.1:8012。
|
||||
</div>
|
||||
<div class="well">
|
||||
|
||||
|
@ -42,7 +42,7 @@
|
||||
*/
|
||||
window.onload = function () {
|
||||
$("#markdown_btn").hide()
|
||||
initWaterMark();
|
||||
//initWaterMark();
|
||||
loadMarkdown();
|
||||
}
|
||||
function htmlEscape(str){
|
||||
|
@ -102,7 +102,7 @@
|
||||
if (!!window.ActiveXObject || "ActiveXObject" in window)
|
||||
{
|
||||
}else{
|
||||
initWaterMark();
|
||||
//initWaterMark();
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -35,7 +35,6 @@
|
||||
<img src="images/sorry.jpg" />
|
||||
<p>
|
||||
预览源文件来自未授信的目录,请停止访问!<br>
|
||||
有任何疑问,请加入kk开源社区知识星球咨询:<a href="https://t.zsxq.com/09ZHSXbsQ">https://t.zsxq.com/09ZHSXbsQ</a><br>
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
|
@ -33,10 +33,6 @@
|
||||
<body>
|
||||
<div class="container">
|
||||
<img src="images/sorry.jpg" />
|
||||
<p>
|
||||
预览源文件来自不受信任的站点:<span style="color: red; display: inline;">${current_host}</span> 请联系管理员!<br>
|
||||
有任何疑问,请加入kk开源社区知识星球咨询:<a href="https://t.zsxq.com/09ZHSXbsQ">https://t.zsxq.com/09ZHSXbsQ</a><br>
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user