[UPDATE]:合同模板初始功能
This commit is contained in:
parent
cce498a5f5
commit
94c7f9ddd3
2
pom.xml
2
pom.xml
|
@ -27,7 +27,7 @@
|
|||
<fastjson.version>2.0.53</fastjson.version>
|
||||
<oshi.version>6.6.5</oshi.version>
|
||||
<commons.io.version>2.13.0</commons.io.version>
|
||||
<poi.version>4.1.2</poi.version>
|
||||
<poi.version>4.1.0</poi.version>
|
||||
<velocity.version>2.3</velocity.version>
|
||||
<jwt.version>0.9.1</jwt.version>
|
||||
<!-- override dependency version -->
|
||||
|
|
|
@ -1,22 +1,13 @@
|
|||
package com.tcctlo.web.controller.common;
|
||||
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.tcctlo.common.annotation.Anonymous;
|
||||
import org.apache.http.HttpResponse;
|
||||
import com.tcctlo.common.config.RuoYiConfig;
|
||||
import com.tcctlo.common.constant.Constants;
|
||||
import com.tcctlo.common.core.domain.AjaxResult;
|
||||
import com.tcctlo.common.utils.StringUtils;
|
||||
import com.tcctlo.common.utils.file.FileUploadUtils;
|
||||
import com.tcctlo.common.utils.file.FileUtils;
|
||||
import com.tcctlo.framework.config.ServerConfig;
|
||||
import org.dromara.x.file.storage.core.FileInfo;
|
||||
import org.dromara.x.file.storage.core.FileStorageService;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -25,13 +16,18 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.tcctlo.common.config.RuoYiConfig;
|
||||
import com.tcctlo.common.constant.Constants;
|
||||
import com.tcctlo.common.core.domain.AjaxResult;
|
||||
import com.tcctlo.common.utils.StringUtils;
|
||||
import com.tcctlo.common.utils.file.FileUploadUtils;
|
||||
import com.tcctlo.common.utils.file.FileUtils;
|
||||
import com.tcctlo.framework.config.ServerConfig;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 通用请求处理
|
||||
|
@ -96,6 +92,7 @@ public class CommonController {
|
|||
//上传图片,返回文件信息
|
||||
FileInfo fileInfo = fileStorageService.of(file)
|
||||
.setPath(objectName) //保存到相对路径下,为了方便管理,不需要可以不写
|
||||
.setContentType(file.getContentType())
|
||||
.upload(); //将文件上传到对应地方
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("url", fileInfo.getUrl());
|
||||
|
@ -110,6 +107,7 @@ public class CommonController {
|
|||
|
||||
/**
|
||||
* 下载文件至本地
|
||||
*
|
||||
* @param response 响应
|
||||
*/
|
||||
@GetMapping("/downloadFileOnLocal")
|
||||
|
|
|
@ -16,7 +16,7 @@ ruoyi:
|
|||
# 开发环境配置
|
||||
server:
|
||||
# 服务器的HTTP端口,默认为8080
|
||||
port: 8088
|
||||
port: 8096
|
||||
servlet:
|
||||
# 应用的访问路径
|
||||
context-path: /
|
||||
|
@ -131,7 +131,7 @@ xss:
|
|||
# 文件上传
|
||||
dromara:
|
||||
x-file-storage: #文件存储配置
|
||||
default-platform: aliyun-oss-1 #默认使用的存储平台
|
||||
default-platform: minio-1 #默认使用的存储平台
|
||||
thumbnail-suffix: ".min.jpg" #缩略图后缀,例如【.min.jpg】【.png】
|
||||
#对应平台的配置写在这里,注意缩进要对齐
|
||||
aliyun-oss:
|
||||
|
@ -143,5 +143,19 @@ dromara:
|
|||
bucket-name: low-office
|
||||
domain: https://low-office.oss-cn-beijing.aliyuncs.com/ # 访问域名,注意“/”结尾,例如:https://abc.oss-cn-shanghai.aliyuncs.com/
|
||||
base-path: low-office-images/ # 基础路径
|
||||
minio:
|
||||
- platform: minio-1 # 存储平台标识
|
||||
enable-storage: true # 启用存储
|
||||
access-key: Xz7M7YncjbZZcLaHnHtB
|
||||
secret-key: TdyM7bJ6WSfjPKOA3srAuugQxIS2PRL96IBrLoZu
|
||||
# end-point: http://124.222.218.34:9000
|
||||
end-point: http://47.109.202.121:9000
|
||||
bucket-name: law-firm
|
||||
domain: http://47.109.202.121:9000/law-firm/ # 访问域名,注意“/”结尾,例如:http://minio.abc.com/abc/
|
||||
base-path: law/ # 基础路径
|
||||
serviceFilePath: D:\templeteWordDownload\
|
||||
#serviceFilePath: /backitems/lawFirm/wordTemplate/
|
||||
generatedWordPath: D:/word/
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,15 +1,30 @@
|
|||
import com.tcctlo.TCCTLawOfficeApplication;
|
||||
import com.tcctlo.common.utils.uuid.UUID;
|
||||
import io.minio.MinioClient;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.File;
|
||||
|
||||
@SpringBootTest(classes = TCCTLawOfficeApplication.class)
|
||||
public class FileTest {
|
||||
|
||||
@Resource
|
||||
private MinioClient minioClient;
|
||||
|
||||
@Test
|
||||
@DisplayName("测试:截取文件后缀名")
|
||||
public void testFileName(){
|
||||
String fileName = "https://low-office.oss-cn-beijing.aliyuncs.com/low-office-images/2025/01/25/67948d96229fc1a67923a564.xlsx";
|
||||
System.out.println(fileName.substring(fileName.lastIndexOf(".")));
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@DisplayName("测试:截取文件后缀名")
|
||||
public void testMinio(){
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -126,6 +126,12 @@
|
|||
<version>3.17.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.minio</groupId>
|
||||
<artifactId>minio</artifactId>
|
||||
<version>8.2.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 文件上传 -->
|
||||
<dependency>
|
||||
<groupId>org.dromara.x-file-storage</groupId>
|
||||
|
@ -147,6 +153,14 @@
|
|||
<version>3.5.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.3.7</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
|
|
@ -5,12 +5,12 @@ import com.github.davidfantasy.mybatisplus.generatorui.mbp.NameConverter;
|
|||
|
||||
public class GeneratorUIServer {
|
||||
public static void main(String[] args) {
|
||||
GeneratorConfig config = GeneratorConfig.builder().jdbcUrl("jdbc:mysql://localhost:3306/low-office?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8")
|
||||
GeneratorConfig config = GeneratorConfig.builder().jdbcUrl("jdbc:mysql://localhost:3306/law-firm?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8")
|
||||
.userName("root")
|
||||
.password("root")
|
||||
.driverClassName("com.mysql.cj.jdbc.Driver")
|
||||
//数据库schema,MSSQL,PGSQL,ORACLE,DB2类型的数据库需要指定
|
||||
.schemaName("low-office")
|
||||
.schemaName("law-firm")
|
||||
//数据库表前缀,生成entity名称时会去掉(v2.0.3新增)
|
||||
// .tablePrefix("t_")
|
||||
//如果需要修改entity及其属性的命名规则,以及自定义各类生成文件的命名规则,可自定义一个NameConverter实例,覆盖相应的名称转换方法,详细可查看该接口的说明:
|
||||
|
|
|
@ -39,5 +39,13 @@
|
|||
<artifactId>spring-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.deepoove</groupId>
|
||||
<artifactId>poi-tl</artifactId>
|
||||
<version>1.6.0</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
</project>
|
|
@ -29,6 +29,37 @@ public class CaseInformationController extends BaseController {
|
|||
@Autowired
|
||||
private ICaseInformationService iCaseInformationService;
|
||||
|
||||
|
||||
/**
|
||||
* 案件审核
|
||||
* @param params 参数:案件编号、审核状态、审核意见【id、auditStatus、auditOpinion】
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/caseReview")
|
||||
public AjaxResult caseReview(@RequestBody Map<String,Object> params) {
|
||||
return AjaxResult.success(iCaseInformationService.caseReview(params));
|
||||
}
|
||||
|
||||
/**
|
||||
* 案件撤销
|
||||
* @param params 参数:案件编号、收案状态【id、caseStatus】
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/claimWithdrawal")
|
||||
public AjaxResult claimWithdrawal(@RequestBody Map<String,Object> params) {
|
||||
return AjaxResult.success(iCaseInformationService.claimWithdrawal(params));
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置案件结案
|
||||
* @param params 参数:案件编号、审核状态、审核意见【id、auditStatus、auditOpinion】
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/caseClosed")
|
||||
public AjaxResult caseClosed(@RequestBody Map<String,Object> params) {
|
||||
return AjaxResult.success(iCaseInformationService.caseClosed(params));
|
||||
}
|
||||
|
||||
/**
|
||||
* 案件信息录入
|
||||
*
|
||||
|
@ -57,8 +88,20 @@ public class CaseInformationController extends BaseController {
|
|||
return AjaxResult.success(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 案件查询【利冲信息库页面展示利冲信息对应的案件信息】
|
||||
* @param id 案件ID
|
||||
* @return 案件信息
|
||||
*/
|
||||
@GetMapping(value = "/selectCaseById/{id}")
|
||||
public AjaxResult selectCaseById(@PathVariable("id") Long id) {
|
||||
CaseInformationListVO caseInformationListVO = iCaseInformationService.selectCaseById(id);
|
||||
return AjaxResult.success(caseInformationListVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据案件ID查询案件详细信息
|
||||
*
|
||||
* @param id 案件ID
|
||||
* @return 结果集
|
||||
*/
|
||||
|
@ -70,17 +113,23 @@ public class CaseInformationController extends BaseController {
|
|||
|
||||
/**
|
||||
* 案件信息修改
|
||||
*
|
||||
* @param params 入参
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@PostMapping(value = "/updateCaseInfo")
|
||||
public AjaxResult updateCaseInfo(@RequestBody CaseInformationEnterVO params) {
|
||||
Integer result = iCaseInformationService.updateCaseInfo(params);
|
||||
return AjaxResult.success(result);
|
||||
Boolean res = iCaseInformationService.updateCaseInfo(params);
|
||||
if (res) {
|
||||
return AjaxResult.success("案件信息录入成功");
|
||||
} else {
|
||||
return AjaxResult.error("案件信息录入失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 案件归档【单个案件】
|
||||
*
|
||||
* @param caseArchivedVO 要归档的案件
|
||||
* @return 是否归档成功
|
||||
*/
|
||||
|
@ -111,6 +160,7 @@ public class CaseInformationController extends BaseController {
|
|||
|
||||
/**
|
||||
* 案件删除【批量删除+单个删除】
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
|
@ -124,6 +174,4 @@ public class CaseInformationController extends BaseController {
|
|||
Integer result = iCaseInformationService.update(params);
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,95 @@
|
|||
package com.tcctlo.law.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.tcctlo.common.core.domain.AjaxResult;
|
||||
import com.tcctlo.law.entity.ContractTemplate;
|
||||
import com.tcctlo.law.service.IContractTemplateService;
|
||||
import com.tcctlo.law.vo.ImpulseInformationVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 合同模板 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author
|
||||
* @since 2025-02-18
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/contractTemplate")
|
||||
public class ContractTemplateController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IContractTemplateService iContractTemplateService;
|
||||
|
||||
/*@PostMapping(value = "/list")
|
||||
public AjaxResult list(@RequestBody Map<String, Object> params) {
|
||||
params.putIfAbsent("current", 1);
|
||||
params.putIfAbsent("size", 10);
|
||||
Page<ImpulseInformationVO> pageList = iImpulseInformationService.list(params);
|
||||
return AjaxResult.success(pageList);
|
||||
}*/
|
||||
|
||||
@PostMapping(value = "/list")
|
||||
public AjaxResult list(@RequestBody Map<String, Object> params) {
|
||||
params.putIfAbsent("current", 1);
|
||||
params.putIfAbsent("size", 10);
|
||||
Page<ContractTemplate> pageList = iContractTemplateService.list(params);
|
||||
return AjaxResult.success(pageList);
|
||||
}
|
||||
|
||||
/*@GetMapping(value = "/list")
|
||||
public AjaxResult list(@RequestParam(required = false) Integer current, @RequestParam(required = false) Integer size) {
|
||||
if (current == null) {
|
||||
current = 1;
|
||||
}
|
||||
if (size == null) {
|
||||
size = 10;
|
||||
}
|
||||
Page<ContractTemplate> pageList = iContractTemplateService.list(current,size);
|
||||
return AjaxResult.success(pageList);
|
||||
}*/
|
||||
|
||||
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getById(@PathVariable("id") Long id) {
|
||||
ContractTemplate contractTemplate = iContractTemplateService.getById(id);
|
||||
return AjaxResult.success(contractTemplate);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/create")
|
||||
public AjaxResult create(@RequestBody ContractTemplate params) {
|
||||
Integer result = iContractTemplateService.create(params);
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/delete/{id}")
|
||||
public AjaxResult delete(@PathVariable("id") Long id) {
|
||||
Integer result = iContractTemplateService.delete(id);
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/deleteTemplate")
|
||||
public AjaxResult deleteTemplate(@RequestBody Map<String, String> param) {
|
||||
|
||||
return AjaxResult.success(iContractTemplateService.deleteTemplate(param));
|
||||
}
|
||||
|
||||
@PostMapping(value = "/update")
|
||||
public AjaxResult update(@RequestBody ContractTemplate params) {
|
||||
Integer result = iContractTemplateService.update(params);
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/getWord/{id}")
|
||||
public AjaxResult getWord(@PathVariable("id") Long id) throws Exception {
|
||||
iContractTemplateService.getWord(id);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
|
@ -4,9 +4,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||
import com.tcctlo.common.core.domain.AjaxResult;
|
||||
import com.tcctlo.law.entity.ImpulseInformation;
|
||||
import com.tcctlo.law.service.IImpulseInformationService;
|
||||
import com.tcctlo.law.vo.ImpulseInformationVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 利冲信息表 前端控制器
|
||||
|
@ -24,7 +27,16 @@ public class ImpulseInformationController {
|
|||
@Autowired
|
||||
private IImpulseInformationService iImpulseInformationService;
|
||||
|
||||
@GetMapping(value = "/list")
|
||||
@PostMapping(value = "/list")
|
||||
public AjaxResult list(@RequestBody Map<String, Object> params) {
|
||||
params.putIfAbsent("current", 1);
|
||||
params.putIfAbsent("size", 10);
|
||||
Page<ImpulseInformationVO> pageList = iImpulseInformationService.list(params);
|
||||
return AjaxResult.success(pageList);
|
||||
}
|
||||
|
||||
|
||||
/*@GetMapping(value = "/list")
|
||||
public AjaxResult list(@RequestParam(required = false) Integer current, @RequestParam(required = false) Integer size) {
|
||||
if (current == null) {
|
||||
current = 1;
|
||||
|
@ -34,7 +46,7 @@ public class ImpulseInformationController {
|
|||
}
|
||||
Page<ImpulseInformation> pageList = iImpulseInformationService.list(current, size);
|
||||
return AjaxResult.success(pageList);
|
||||
}
|
||||
}*/
|
||||
/**
|
||||
* 模糊查询【用于搜索条件查询】
|
||||
*
|
||||
|
@ -81,4 +93,6 @@ public class ImpulseInformationController {
|
|||
Integer result = iImpulseInformationService.update(params);
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,115 @@
|
|||
package com.tcctlo.law.entity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
/**
|
||||
* <p>
|
||||
* 合同模板
|
||||
* </p>
|
||||
*
|
||||
* @author
|
||||
* @since 2025-02-18
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("contract_template")
|
||||
public class ContractTemplate implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 合同模板名称
|
||||
*/
|
||||
private String templateName;
|
||||
|
||||
/**
|
||||
* 合同描述
|
||||
*/
|
||||
private String templateContext;
|
||||
|
||||
/**
|
||||
* 存储路径(服务器)
|
||||
*/
|
||||
private String filePath;
|
||||
|
||||
/**
|
||||
* 阿里云OSS访问地址
|
||||
*/
|
||||
private String fileUrl;
|
||||
|
||||
/**
|
||||
* 生成的新文件名
|
||||
*/
|
||||
private String newFileName;
|
||||
|
||||
/**
|
||||
* 电子签章位置(X轴)
|
||||
*/
|
||||
private Double locationX;
|
||||
|
||||
/**
|
||||
* 电子签章位置(Y轴)
|
||||
*/
|
||||
private Double locationY;
|
||||
|
||||
/**
|
||||
* 电子签章位置页码
|
||||
*/
|
||||
private Integer pageNumber;
|
||||
|
||||
/**
|
||||
* 动态表单参数
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private JsonNode formParameter;
|
||||
|
||||
/**
|
||||
* 状态【0:正常,1:停用】
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 删除标志【0:未删除,1:已删除】
|
||||
*/
|
||||
private Integer delFlag;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
private Date updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remake;
|
||||
|
||||
}
|
|
@ -28,6 +28,14 @@ public interface CaseInformationMapper extends BaseMapper<CaseInformation> {
|
|||
Page<CaseInformationListVO> selectCondition(@Param("page") Page<CaseInformationListVO> page, @Param("condition") Map<String, Object> condition);
|
||||
|
||||
|
||||
/**
|
||||
* 根据案件ID查询案件信息
|
||||
* @param id 案件ID
|
||||
* @return 结果集
|
||||
*/
|
||||
CaseInformationListVO selectCaseById(@Param("id") Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 案件归档
|
||||
* @param caseId 要归档的案件ID
|
||||
|
@ -40,4 +48,39 @@ public interface CaseInformationMapper extends BaseMapper<CaseInformation> {
|
|||
* @param longList 案件ID集合
|
||||
*/
|
||||
int removeByIds(@Param("ids") List<Long> longList);
|
||||
|
||||
/**
|
||||
* 判断案件是否有相关文件
|
||||
* @param id 案件id
|
||||
* @return 结果集
|
||||
*/
|
||||
int selectCaseFileNum(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 根据案件ID查询案件信息
|
||||
* @param id 案件ID
|
||||
* @return 结果集
|
||||
*/
|
||||
CaseInformation selectCaseInfoById(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 案件审核
|
||||
* @param params 参数
|
||||
* @return 是否审核成功
|
||||
*/
|
||||
boolean caseReview(@Param("params") Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 案件撤销
|
||||
* @param params 参数
|
||||
* @return 是否撤销成功
|
||||
*/
|
||||
Boolean claimWithdrawal(@Param("params") Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 案件结案
|
||||
* @param params 参数
|
||||
* @return 结案结果
|
||||
*/
|
||||
Boolean caseClosed(@Param("params") Map<String, Object> params);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
package com.tcctlo.law.mapper;
|
||||
|
||||
import com.tcctlo.law.entity.ContractTemplate;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 合同模板 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author
|
||||
* @since 2025-02-18
|
||||
*/
|
||||
public interface ContractTemplateMapper extends BaseMapper<ContractTemplate> {
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param ids ids
|
||||
* @return 结果集
|
||||
*/
|
||||
Integer deleteTemplate(@Param("ids") List<Long> ids);
|
||||
}
|
|
@ -15,6 +15,7 @@ import java.util.List;
|
|||
* @author 张世琪
|
||||
* @since 2025-02-06
|
||||
*/
|
||||
|
||||
public interface FileManagerMapper extends BaseMapper<FileManager> {
|
||||
|
||||
/**
|
||||
|
@ -45,4 +46,11 @@ public interface FileManagerMapper extends BaseMapper<FileManager> {
|
|||
* @param fileIds 收款记录表中存储的文件ID
|
||||
*/
|
||||
int removeByCaseIdAndFileIds(@Param("caseId") Long caseId, @Param("fileIds") List<Long> fileIds);
|
||||
|
||||
/**
|
||||
* 查询案件相关的所有文件
|
||||
* @param caseId 案件ID
|
||||
* @return 结果集
|
||||
*/
|
||||
List<FileManager> selectFileByCaseId(@Param("caseId") Long caseId);
|
||||
}
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
package com.tcctlo.law.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.tcctlo.law.entity.ImpulseInformation;
|
||||
import com.tcctlo.law.vo.CaseInformationListVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -59,4 +62,13 @@ public interface ImpulseInformationMapper extends BaseMapper<ImpulseInformation>
|
|||
* @return 结果集
|
||||
*/
|
||||
int removeByCaseId(@Param("caseId") List<Long> caseId);
|
||||
|
||||
|
||||
/**
|
||||
* 分页条件查询
|
||||
* @param page 分页
|
||||
* @param condition 条件
|
||||
* @return 结果集
|
||||
*/
|
||||
Page<ImpulseInformation> selectCondition(@Param("page") Page<ImpulseInformation> page, @Param("condition") Map<String, Object> condition);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package com.tcctlo.law.service;
|
||||
|
||||
import com.tcctlo.law.entity.CaseInformation;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.tcctlo.law.entity.CaseInformation;
|
||||
import com.tcctlo.law.vo.CaseArchivedVO;
|
||||
import com.tcctlo.law.vo.CaseInformationEnterVO;
|
||||
import com.tcctlo.law.vo.CaseInformationListVO;
|
||||
|
@ -41,6 +41,13 @@ public interface ICaseInformationService extends IService<CaseInformation>{
|
|||
*/
|
||||
CaseInformation getById(Long id);
|
||||
|
||||
/**
|
||||
* 根据案件ID查询案件信息
|
||||
* @param id 案件id
|
||||
* @return 结果集
|
||||
*/
|
||||
CaseInformationListVO selectCaseById(Long id);
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 新增接口
|
||||
|
@ -92,7 +99,7 @@ public interface ICaseInformationService extends IService<CaseInformation>{
|
|||
* @param params 案件信息
|
||||
* @return 受影响行数
|
||||
*/
|
||||
Integer updateCaseInfo(CaseInformationEnterVO params);
|
||||
Boolean updateCaseInfo(CaseInformationEnterVO params);
|
||||
|
||||
/**
|
||||
* 删除案件信息
|
||||
|
@ -107,4 +114,25 @@ public interface ICaseInformationService extends IService<CaseInformation>{
|
|||
* @return 是否归档成功
|
||||
*/
|
||||
Boolean caseArchived(CaseArchivedVO caseArchivedVO);
|
||||
|
||||
/**
|
||||
* 案件审核
|
||||
* @param params 参数
|
||||
* @return 是否审核成功
|
||||
*/
|
||||
Boolean caseReview(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 案件撤销
|
||||
* @param params 参数
|
||||
* @return 是否撤销成功
|
||||
*/
|
||||
Boolean claimWithdrawal(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 案件结案
|
||||
* @param params 参数
|
||||
* @return 是否结案成功
|
||||
*/
|
||||
Boolean caseClosed(Map<String, Object> params);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,95 @@
|
|||
package com.tcctlo.law.service;
|
||||
|
||||
import com.tcctlo.law.entity.ContractTemplate;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 合同模板 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author
|
||||
* @since 2025-02-18
|
||||
*/
|
||||
public interface IContractTemplateService {
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 分页列表查询
|
||||
* </p>
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
/*Page<ContractTemplate> list(Integer pageNo, Integer pageSize);*/
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 分页列表查询
|
||||
* </p>
|
||||
*
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
Page<ContractTemplate> list(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 详情接口
|
||||
* </p>
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
ContractTemplate getById(Long id);
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 新增接口
|
||||
* </p>
|
||||
*
|
||||
* @param contractTemplate
|
||||
* @return
|
||||
*/
|
||||
Integer create(ContractTemplate contractTemplate);
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 删除接口
|
||||
* </p>
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
Integer delete(Long id);
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 更新接口
|
||||
* </p>
|
||||
*
|
||||
* @param contractTemplate
|
||||
* @return
|
||||
*/
|
||||
Integer update(ContractTemplate contractTemplate);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids ids
|
||||
* @return 结果集
|
||||
*/
|
||||
Integer deleteTemplate(Map<String, String> param);
|
||||
|
||||
/**
|
||||
* 根据word模板生成word
|
||||
* @param id 模板id
|
||||
*/
|
||||
void getWord(Long id) throws Exception;
|
||||
}
|
|
@ -3,6 +3,7 @@ package com.tcctlo.law.service;
|
|||
import com.tcctlo.law.entity.ImpulseInformation;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.tcctlo.law.vo.ImpulseInformationVO;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -22,11 +23,10 @@ public interface IImpulseInformationService extends IService<ImpulseInformation>
|
|||
* <p>
|
||||
* 分页列表查询
|
||||
* </p>
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @return
|
||||
* @param params 查询条件
|
||||
* @return 结果集
|
||||
*/
|
||||
Page<ImpulseInformation> list(Integer pageNo, Integer pageSize);
|
||||
Page<ImpulseInformationVO> list(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
|
|
@ -12,6 +12,7 @@ import com.tcctlo.law.entity.*;
|
|||
import com.tcctlo.law.mapper.*;
|
||||
import com.tcctlo.law.service.*;
|
||||
import com.tcctlo.law.tools.GenerateCaseNo;
|
||||
import com.tcctlo.law.tools.RichTextToWordSimple;
|
||||
import com.tcctlo.law.vo.CaseArchivedVO;
|
||||
import com.tcctlo.law.vo.CaseInformationEnterVO;
|
||||
import com.tcctlo.law.vo.CaseInformationListVO;
|
||||
|
@ -22,11 +23,7 @@ import org.springframework.transaction.annotation.Isolation;
|
|||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
@ -40,6 +37,8 @@ import java.util.stream.Collectors;
|
|||
@Service
|
||||
public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMapper, CaseInformation> implements ICaseInformationService {
|
||||
|
||||
@Resource
|
||||
private RichTextToWordSimple richTextToWordSimple;
|
||||
|
||||
@Resource
|
||||
private CaseInformationMapper caseInformationMapper;
|
||||
|
@ -156,19 +155,57 @@ public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMappe
|
|||
Page<CaseInformationListVO> page = new Page<>(pageNo, pageSize);
|
||||
Page<CaseInformationListVO> caseInformationPage = caseInformationMapper.selectCondition(page, params);
|
||||
for (CaseInformationListVO item : caseInformationPage.getRecords()) {
|
||||
item.setEntrustingParty(informationMapper.selectByCaseId(item.getId(), 0).stream().map(ImpulseInformation::getCaseName).collect(Collectors.joining(","))); //委托方
|
||||
/*item.setEntrustingParty(informationMapper.selectByCaseId(item.getId(), 0).stream().map(ImpulseInformation::getCaseName).collect(Collectors.joining(","))); //委托方
|
||||
item.setOpposite(informationMapper.selectByCaseId(item.getId(), 1).stream().map(ImpulseInformation::getCaseName).collect(Collectors.joining(","))); //相对方
|
||||
item.setAttorneyAgent(caseLawyerMapper.selectAttorneyAgentLawByCaseId(item.getId()).getLawyerName()); //代理律师
|
||||
item.setAssistingLawyer(caseLawyerMapper.selectAssistingLawyerByCaseId(item.getId()).stream().map(CaseLawyer::getLawyerName).collect(Collectors.joining(","))); //协办律师
|
||||
int fileNum = caseInformationMapper.selectCaseFileNum(item.getId());
|
||||
item.setFileFlag(fileNum > 0);
|
||||
item.setFileList(fileManagerMapper.selectFileByCaseId(item.getId()));*/
|
||||
|
||||
List<ImpulseInformation> entrustingParty = informationMapper.selectByCaseId(item.getId(), 0);
|
||||
if (CollUtil.isNotEmpty(entrustingParty)){
|
||||
item.setEntrustingParty(entrustingParty.stream().map(ImpulseInformation::getCaseName).collect(Collectors.joining(",")));
|
||||
}
|
||||
|
||||
List<ImpulseInformation> opposite = informationMapper.selectByCaseId(item.getId(), 1);
|
||||
if (CollUtil.isNotEmpty(opposite)){
|
||||
item.setOpposite(opposite.stream().map(ImpulseInformation::getCaseName).collect(Collectors.joining(",")));
|
||||
}
|
||||
|
||||
CaseLawyer attorneyAgent = caseLawyerMapper.selectAttorneyAgentLawByCaseId(item.getId());
|
||||
if (BeanUtil.isNotEmpty(attorneyAgent)){
|
||||
item.setAttorneyAgent(attorneyAgent.getLawyerName());
|
||||
}
|
||||
|
||||
List<CaseLawyer> assistingLawyer = caseLawyerMapper.selectAssistingLawyerByCaseId(item.getId());
|
||||
if (CollUtil.isNotEmpty(assistingLawyer)){
|
||||
item.setAssistingLawyer(assistingLawyer.stream().map(CaseLawyer::getLawyerName).collect(Collectors.joining(",")));
|
||||
}
|
||||
|
||||
int fileNum = caseInformationMapper.selectCaseFileNum(item.getId());
|
||||
item.setFileFlag(fileNum > 0);
|
||||
item.setFileList(fileManagerMapper.selectFileByCaseId(item.getId()));
|
||||
}
|
||||
return caseInformationPage;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public CaseInformationListVO selectCaseById(Long id) {
|
||||
CaseInformationListVO item = caseInformationMapper.selectCaseById(id);
|
||||
item.setAttorneyAgent(caseLawyerMapper.selectAttorneyAgentLawByCaseId(item.getId()).getLawyerName()); //代理律师
|
||||
item.setAssistingLawyer(caseLawyerMapper.selectAssistingLawyerByCaseId(item.getId()).stream().map(CaseLawyer::getLawyerName).collect(Collectors.joining(","))); //协办律师
|
||||
return item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CaseInformation getById(Long id) {
|
||||
return caseInformationMapper.selectById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Integer create(CaseInformation caseInformation) {
|
||||
return caseInformationMapper.insert(caseInformation);
|
||||
|
@ -184,7 +221,7 @@ public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMappe
|
|||
return caseInformationMapper.updateById(caseInformation);
|
||||
}
|
||||
|
||||
@Override
|
||||
/*@Override
|
||||
@Transactional(isolation = Isolation.DEFAULT, rollbackFor = Exception.class)
|
||||
public Boolean enterCaseInfo(CaseInformationEnterVO caseInfo) {
|
||||
try {
|
||||
|
@ -240,6 +277,76 @@ public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMappe
|
|||
throw new RuntimeException("案件录入失败");
|
||||
}
|
||||
return true;
|
||||
}*/
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(isolation = Isolation.DEFAULT, rollbackFor = Exception.class)
|
||||
public Boolean enterCaseInfo(CaseInformationEnterVO caseInfo) {
|
||||
try {
|
||||
CaseInformation caseInformation = caseInfo.getCaseInformation(); //案件信息
|
||||
caseInformation.setCaseNo(new GenerateCaseNo().generateCaseNo()); //生成案件编号
|
||||
caseInformationMapper.insert(caseInfo.getCaseInformation()); //插入案件信息
|
||||
Long caseId = caseInformation.getId(); //获取案件ID
|
||||
|
||||
//插入案件关联利冲信息【设置委托方和相对方】
|
||||
List<ImpulseInformation> impulseInformationList = new ArrayList<>();
|
||||
List<ImpulseInformation> entrustingParty = caseInfo.getEntrustingParty();
|
||||
if (CollUtil.isNotEmpty(entrustingParty)){
|
||||
impulseInformationList.addAll(caseInfo.getEntrustingParty().stream().peek(item -> {
|
||||
item.setCaseId(caseId);
|
||||
item.setIsClient(0);
|
||||
}).collect(Collectors.toList()));
|
||||
}
|
||||
List<ImpulseInformation> opposite = caseInfo.getOpposite();
|
||||
if (CollUtil.isNotEmpty(opposite)){
|
||||
impulseInformationList.addAll(caseInfo.getOpposite().stream().peek(item -> {
|
||||
item.setCaseId(caseId);
|
||||
item.setIsClient(1);
|
||||
}).collect(Collectors.toList()));
|
||||
informationService.saveBatch(impulseInformationList);
|
||||
List<Long> impulseInformationIds = impulseInformationList.stream().map(item -> item.getId()).collect(Collectors.toList());
|
||||
caseInformation.setImpulseInformationIds(StringUtils.join(impulseInformationIds, ","));
|
||||
}
|
||||
//插入案件关联律师数据
|
||||
List<CaseLawyer> caseLawyerList = new ArrayList<>();
|
||||
CaseLawyer attorneyAgent = caseInfo.getAttorneyAgent();
|
||||
if (BeanUtil.isNotEmpty(attorneyAgent)){
|
||||
attorneyAgent.setLawyerType(0);
|
||||
attorneyAgent.setCaseId(caseId);
|
||||
caseLawyerList.add(attorneyAgent); //代理律师
|
||||
}
|
||||
List<CaseLawyer> assistingLawyer = caseInfo.getAssistingLawyer();
|
||||
if (CollUtil.isNotEmpty(assistingLawyer)){
|
||||
caseLawyerList.addAll(assistingLawyer.stream().peek(item -> {
|
||||
item.setCaseId(caseId);
|
||||
item.setLawyerType(1);
|
||||
}).collect(Collectors.toList())); //协办律师
|
||||
caseLawyerService.saveBatch(caseLawyerList);
|
||||
List<Long> caseLawyerIds = caseLawyerList.stream().map(item -> item.getLawyerId()).collect(Collectors.toList());
|
||||
caseInformation.setCaseLawyerIds(StringUtils.join(caseLawyerIds, ","));
|
||||
caseInformationMapper.updateById(caseInformation); //更新案件表中的律师IDS和利冲信息IDS
|
||||
}
|
||||
|
||||
//插入案件关联收款记录信息【收款记录文件插入】
|
||||
List<CollectionRecordEnterVO> collectionRecordList = caseInfo.getCollectionRecordList();
|
||||
if (CollUtil.isNotEmpty(collectionRecordList)){
|
||||
collectionRecordList.forEach(item -> {
|
||||
item.setCaseId(caseId);
|
||||
List<FileManager> fileManagerList = item.getFileManager().stream().peek(i -> {
|
||||
i.setCaseId(caseId);
|
||||
i.setFileType(1); //设置文件类型为【收款记录文件】
|
||||
}).collect(Collectors.toList());
|
||||
fileManagerService.saveBatch(fileManagerList);
|
||||
List<Long> fileIds = fileManagerList.stream().map(FileManager::getId).collect(Collectors.toList());
|
||||
item.setCollectionUrlId(StringUtils.join(fileIds, ","));
|
||||
collectionRecordMapper.insert(item);
|
||||
});
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("案件录入失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -279,7 +386,8 @@ public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMappe
|
|||
|
||||
@Override
|
||||
@Transactional(isolation = Isolation.DEFAULT, rollbackFor = Exception.class)
|
||||
public Integer updateCaseInfo(CaseInformationEnterVO params) {
|
||||
public Boolean updateCaseInfo(CaseInformationEnterVO params) {
|
||||
try {
|
||||
//案件信息表----caseInformation
|
||||
CaseInformation caseInformation = params.getCaseInformation();
|
||||
Long caseId = caseInformation.getId();
|
||||
|
@ -298,13 +406,18 @@ public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMappe
|
|||
|
||||
//代理律师----attorneyAgent----修改原来的律师信息
|
||||
CaseLawyer newAttorneyAgent = params.getAttorneyAgent();
|
||||
if (BeanUtil.isNotEmpty(newAttorneyAgent)){
|
||||
if (newAttorneyAgent.getId() == null) {
|
||||
CaseLawyer oldCaseLawyer = caseLawyerMapper.selectAttorneyAgentLawByCaseId(params.getCaseInformation().getId());
|
||||
if (oldCaseLawyer != null){
|
||||
oldCaseLawyer.setIsPrime(1);
|
||||
caseLawyerMapper.updateById(oldCaseLawyer);
|
||||
}
|
||||
newAttorneyAgent.setCaseId(params.getCaseInformation().getId());
|
||||
caseLawyerMapper.insert(newAttorneyAgent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//协办律师----assistingLawyer
|
||||
|
@ -352,7 +465,10 @@ public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMappe
|
|||
fileManagerMapper.removeByCaseIdAndFileIds(caseId, fileIds);
|
||||
}
|
||||
caseInformationMapper.updateById(caseInformation);
|
||||
return 0;
|
||||
}catch (Exception e){
|
||||
throw new RuntimeException("保存失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -396,6 +512,21 @@ public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMappe
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean caseReview(Map<String, Object> params) {
|
||||
return caseInformationMapper.caseReview(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean claimWithdrawal(Map<String, Object> params) {
|
||||
return caseInformationMapper.claimWithdrawal(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean caseClosed(Map<String, Object> params) {
|
||||
return caseInformationMapper.caseClosed(params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑协办律师
|
||||
*
|
||||
|
|
|
@ -0,0 +1,170 @@
|
|||
package com.tcctlo.law.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.tcctlo.common.core.domain.AjaxResult;
|
||||
import com.tcctlo.law.entity.ContractTemplate;
|
||||
import com.tcctlo.law.mapper.ContractTemplateMapper;
|
||||
import com.tcctlo.law.service.IContractTemplateService;
|
||||
import com.tcctlo.law.tools.FileUpload;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 合同模板 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author
|
||||
* @since 2025-02-18
|
||||
*/
|
||||
@Service
|
||||
public class ContractTemplateServiceImpl extends ServiceImpl<ContractTemplateMapper, ContractTemplate> implements IContractTemplateService {
|
||||
|
||||
|
||||
@Resource
|
||||
private ContractTemplateMapper contractTemplateMapper;
|
||||
|
||||
@Resource
|
||||
private FileUpload fileUpload;
|
||||
|
||||
@Value("${serviceFilePath}")
|
||||
private String serviceFilePath;
|
||||
|
||||
@Value("${generatedWordPath}")
|
||||
private String generatedWordPath;
|
||||
|
||||
/*@Override
|
||||
public Page<ContractTemplate> list(Integer pageNo, Integer pageSize) {
|
||||
return contractTemplateMapper.selectPage(new Page<>(pageNo, pageSize), new QueryWrapper<>());
|
||||
}*/
|
||||
|
||||
|
||||
@Override
|
||||
public Page<ContractTemplate> list(Map<String, Object> params) {
|
||||
return contractTemplateMapper.selectPage(new Page<>((Integer) params.get("current"), (Integer) params.get("size")), new QueryWrapper<>());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContractTemplate getById(Long id) {
|
||||
ContractTemplate contractTemplate = contractTemplateMapper.selectById(id);
|
||||
return contractTemplate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载文件至本地
|
||||
*
|
||||
* @param response 响应
|
||||
*/
|
||||
@GetMapping("/downloadFileOnLocal")
|
||||
public AjaxResult downloadFile(HttpServletResponse response, @RequestParam("urlPath") String urlPath, @RequestParam("path") String path) {
|
||||
try {
|
||||
URL url = new URL(urlPath);
|
||||
String filePath = "F:\\fileDownload\\" + UUID.randomUUID() + urlPath.substring(urlPath.lastIndexOf("."));
|
||||
URLConnection conn = url.openConnection();
|
||||
InputStream inputStream = conn.getInputStream();
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(filePath);
|
||||
int bytesum = 0;
|
||||
int byteread;
|
||||
byte[] buffer = new byte[1024];
|
||||
while ((byteread = inputStream.read(buffer)) != -1) {
|
||||
bytesum += byteread;
|
||||
fileOutputStream.write(buffer, 0, byteread);
|
||||
}
|
||||
fileOutputStream.close();
|
||||
return AjaxResult.success("下载成功");
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("下载失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer create(ContractTemplate contractTemplate) {
|
||||
try {
|
||||
URL url = new URL(contractTemplate.getFileUrl());
|
||||
String filePath = serviceFilePath + UUID.randomUUID() + contractTemplate.getFileUrl().substring(contractTemplate.getFileUrl().lastIndexOf("."));
|
||||
// String filePath = "/backitems/lawFirm/wordTemplate/" + UUID.randomUUID() + contractTemplate.getFileUrl().substring(contractTemplate.getFileUrl().lastIndexOf("."));
|
||||
contractTemplate.setFilePath(filePath);
|
||||
URLConnection conn = url.openConnection();
|
||||
InputStream inputStream = conn.getInputStream();
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(filePath);
|
||||
int bytesum = 0;
|
||||
int byteread;
|
||||
byte[] buffer = new byte[1024];
|
||||
while ((byteread = inputStream.read(buffer)) != -1) {
|
||||
bytesum += byteread;
|
||||
fileOutputStream.write(buffer, 0, byteread);
|
||||
}
|
||||
fileOutputStream.close();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("存储至服务器失败");
|
||||
}
|
||||
|
||||
return contractTemplateMapper.insert(contractTemplate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer delete(Long id) {
|
||||
return contractTemplateMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer update(ContractTemplate contractTemplate) {
|
||||
return contractTemplateMapper.updateById(contractTemplate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer deleteTemplate(Map<String, String> param) {
|
||||
List<Long> ids = Arrays.stream(param.get("ids").split(","))
|
||||
.mapToLong(Long::parseLong)
|
||||
.boxed()
|
||||
.collect(Collectors.toList());
|
||||
return contractTemplateMapper.deleteTemplate(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getWord(Long id) throws Exception {
|
||||
ContractTemplate contractTemplate = contractTemplateMapper.selectById(id);
|
||||
String filePath = contractTemplate.getFilePath();
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("firstParty","甲方名称");
|
||||
map.put("secondParty","乙方名称");
|
||||
map.put("solicitor","张三、李四、王五");
|
||||
map.put("commitment","委托事项委托事项委托事项委托事项");
|
||||
map.put("signDate", LocalDateTime.now().toString());
|
||||
map.put("legalRepresentative","法定代表人");
|
||||
map.put("idNo","620121199708060011");
|
||||
map.put("creditCode","52031001156477894");
|
||||
map.put("bankName","中国建设银行");
|
||||
map.put("accountNum","4561112557894411");
|
||||
map.put("address","云南省昆明市");
|
||||
map.put("phone","13359490766");
|
||||
map.put("facsimile","0931-6554211");
|
||||
map.put("postcode","730300");
|
||||
XWPFTemplate template = XWPFTemplate.compile(filePath).render(map);
|
||||
String savePath = generatedWordPath + UUID.randomUUID().toString() + ".docx";
|
||||
FileOutputStream out = new FileOutputStream(savePath);
|
||||
template.write(out);
|
||||
out.flush();
|
||||
out.close();
|
||||
template.close();
|
||||
File file = new File(savePath);
|
||||
System.out.println(fileUpload.uploadFile(file));
|
||||
}
|
||||
|
||||
}
|
|
@ -1,20 +1,28 @@
|
|||
package com.tcctlo.law.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.tcctlo.common.utils.StringUtils;
|
||||
import com.tcctlo.law.entity.CaseInformation;
|
||||
import com.tcctlo.law.entity.ImpulseInformation;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.tcctlo.law.mapper.CaseInformationMapper;
|
||||
import com.tcctlo.law.mapper.ImpulseInformationMapper;
|
||||
import com.tcctlo.law.service.IImpulseInformationService;
|
||||
import com.tcctlo.law.vo.ImpulseInformationVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -31,10 +39,36 @@ public class ImpulseInformationServiceImpl extends ServiceImpl<ImpulseInformatio
|
|||
@Resource
|
||||
private ImpulseInformationMapper impulseInformationMapper;
|
||||
|
||||
@Resource
|
||||
private CaseInformationMapper caseInformationMapper;
|
||||
|
||||
@Override
|
||||
public Page<ImpulseInformation> list(Integer pageNo, Integer pageSize) {
|
||||
return impulseInformationMapper.selectPage(new Page<>(pageNo, pageSize), new QueryWrapper<>());
|
||||
public Page<ImpulseInformationVO> list(Map<String, Object> params) {
|
||||
Page<ImpulseInformationVO> resPage = new Page<>();
|
||||
Page<ImpulseInformation> page = impulseInformationMapper.selectCondition(new Page<>((Integer) params.get("current"), (Integer) params.get("size")), params);
|
||||
if (page.getRecords() != null){
|
||||
List<ImpulseInformationVO> list = BeanUtil.copyToList(page.getRecords(), ImpulseInformationVO.class);
|
||||
list.stream().peek(item -> {
|
||||
if (item.getCaseId() != null){
|
||||
CaseInformation caseInformation = caseInformationMapper.selectById(item.getCaseId());
|
||||
item.setCaseInfoName(caseInformation.getCaseName());
|
||||
item.setTermOfConsultancy(caseInformation.getTermOfConsultancy());
|
||||
item.setArchiveStatus(caseInformation.getArchiveStatus());
|
||||
item.setIsFinishCase(caseInformation.getIsFinishCase());
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
resPage.setRecords(list);
|
||||
resPage.setTotal(page.getTotal());
|
||||
resPage.setSize(page.getSize());
|
||||
resPage.setCurrent(page.getCurrent());
|
||||
}
|
||||
return resPage;
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public Page<ImpulseInformation> list(Map<String, Object> params) {
|
||||
return impulseInformationMapper.selectPage(new Page<>((Integer) params.get("current"), (Integer) params.get("size")), new QueryWrapper<>());
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public List<ImpulseInformation> selectLikeByParam(String caseName, Integer isClient) {
|
||||
|
@ -63,8 +97,7 @@ public class ImpulseInformationServiceImpl extends ServiceImpl<ImpulseInformatio
|
|||
|
||||
@Override
|
||||
public ImpulseInformation getById(Long id) {
|
||||
ImpulseInformation impulseInformation = impulseInformationMapper.selectById(id);
|
||||
return impulseInformation;
|
||||
return impulseInformationMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
package com.tcctlo.law.tools;
|
||||
|
||||
import org.dromara.x.file.storage.core.FileInfo;
|
||||
import org.dromara.x.file.storage.core.FileStorageService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.File;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
/**
|
||||
* 文件上传工具类
|
||||
*/
|
||||
@Component
|
||||
public class FileUpload {
|
||||
|
||||
@Autowired
|
||||
private FileStorageService fileStorageService;//注入实列
|
||||
|
||||
public FileInfo uploadFile(File file){
|
||||
String objectName = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy/MM/dd")) + "/";
|
||||
|
||||
//上传图片,返回文件信息
|
||||
return fileStorageService.of(file)
|
||||
.setPath(objectName) //保存到相对路径下,为了方便管理,不需要可以不写
|
||||
.upload();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
package com.tcctlo.law.tools;
|
||||
|
||||
//import com.aspose.words.Document;
|
||||
//import com.aspose.words.HtmlLoadOptions;
|
||||
//import com.aspose.words.SaveFormat;
|
||||
import com.tcctlo.common.core.domain.AjaxResult;
|
||||
import com.tcctlo.common.utils.file.FileUtils;
|
||||
import org.dromara.x.file.storage.core.FileInfo;
|
||||
import org.dromara.x.file.storage.core.FileStorageService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
@Component
|
||||
public class RichTextToWordSimple {
|
||||
|
||||
@Autowired
|
||||
private FileStorageService fileStorageService;//注入实列
|
||||
/**
|
||||
* 将 HTML 富文本转换为 Word 文档并保存到指定路径
|
||||
*
|
||||
* @param html 富文本数据(HTML 格式)
|
||||
* @throws Exception 如果转换或保存失败
|
||||
*/
|
||||
public AjaxResult convertHtmlToWord(String html) throws Exception {
|
||||
// 将 HTML 内容加载到 Aspose.Words 的 Document 对象中
|
||||
// HtmlLoadOptions loadOptions = new HtmlLoadOptions();
|
||||
// InputStream inputStream = new ByteArrayInputStream(html.getBytes("UTF-8"));
|
||||
// com.aspose.words.Document doc = new Document(inputStream, loadOptions);
|
||||
|
||||
// 将 Document 保存为 Word 文档到指定路径
|
||||
/*Path path = Paths.get("D:/word/合同模板.docx");
|
||||
Files.createDirectories(path.getParent()); // 创建父目录(如果不存在)*/
|
||||
// doc.save("D:/test/xx.docx", SaveFormat.DOCX);
|
||||
File file = new File("D:/test/xx.docx");
|
||||
try {
|
||||
/*// 上传文件路径
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String url = serverConfig.getUrl() + fileName;*/
|
||||
|
||||
//指定OSS保存文件路径 格式:
|
||||
String objectName = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy/MM/dd")) + "/";
|
||||
|
||||
//上传图片,返回文件信息
|
||||
FileInfo fileInfo = fileStorageService.of(file)
|
||||
.setPath(objectName) //保存到相对路径下,为了方便管理,不需要可以不写
|
||||
.upload(); //将文件上传到对应地方
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("url", fileInfo.getUrl());
|
||||
ajax.put("fileName", fileInfo.getUrl()); //此处的值需要改为url,因为前端的访问地址会做一个判断,如果以http开头就直接显示此图片
|
||||
ajax.put("newFileName", FileUtils.getName(fileInfo.getUrl()));
|
||||
// ajax.put("originalFilename", file.getOriginalFilename());
|
||||
return ajax;
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,10 +1,13 @@
|
|||
package com.tcctlo.law.vo;
|
||||
|
||||
import com.tcctlo.law.entity.CaseInformation;
|
||||
import com.tcctlo.law.entity.FileManager;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 案件列表VO
|
||||
*/
|
||||
|
@ -32,4 +35,17 @@ public class CaseInformationListVO extends CaseInformation {
|
|||
* 协办律师
|
||||
*/
|
||||
private String assistingLawyer;
|
||||
|
||||
/**
|
||||
* 当前案件是否包含相关文件
|
||||
* 主要用于前端来判断是否显示下载按钮
|
||||
*/
|
||||
private Boolean fileFlag;
|
||||
|
||||
/**
|
||||
* 案件相关文件列表
|
||||
*/
|
||||
private List<FileManager> fileList;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
package com.tcctlo.law.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.tcctlo.law.entity.CaseInformation;
|
||||
import com.tcctlo.law.entity.ImpulseInformation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ImpulseInformationVO extends ImpulseInformation {
|
||||
/**
|
||||
* 案件名称
|
||||
*/
|
||||
private String caseInfoName;
|
||||
|
||||
/**
|
||||
* 顾问期限
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date termOfConsultancy;
|
||||
|
||||
/**
|
||||
* 归档状态【0:未归档,1:已归档】
|
||||
*/
|
||||
private Integer archiveStatus;
|
||||
|
||||
/**
|
||||
* 是否结案【0:未结案,1:已结案】
|
||||
*/
|
||||
private Integer isFinishCase;
|
||||
|
||||
|
||||
}
|
|
@ -5,7 +5,10 @@
|
|||
<mapper namespace="com.tcctlo.law.mapper.CaseInformationMapper">
|
||||
|
||||
<sql id="baseColumn">
|
||||
ci.id,ci.case_no,ci.case_name,ci.case_context,ci.business_type,ci.business_classify,ci.case_type,ci.agency_stage,ci.case_source,ci.amount_receivable,ci.amount_received_sum,ci.payment_deadline,ci.reserve_money,ci.term_of_consultancy,ci.collection_status,ci.impulse_state,ci.case_status,ci.audit_status,ci.archive_status,ci.is_finish_case,ci.audit_opinion,ci.impulse_information_ids,ci.case_lawyer_ids,ci.status,ci.del_flag,ci.create_by,ci.create_time,ci.update_by,ci.update_time,ci.remake
|
||||
ci
|
||||
.
|
||||
id
|
||||
,ci.case_no,ci.case_name,ci.case_context,ci.business_type,ci.business_classify,ci.case_type,ci.agency_stage,ci.case_source,ci.amount_receivable,ci.amount_received_sum,ci.payment_deadline,ci.reserve_money,ci.term_of_consultancy,ci.collection_status,ci.impulse_state,ci.case_status,ci.audit_status,ci.archive_status,ci.is_finish_case,ci.audit_opinion,ci.impulse_information_ids,ci.case_lawyer_ids,ci.status,ci.del_flag,ci.create_by,ci.create_time,ci.update_by,ci.update_time,ci.remake
|
||||
</sql>
|
||||
<update id="caseArchived">
|
||||
update case_information ci
|
||||
|
@ -20,11 +23,54 @@
|
|||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="caseReview">
|
||||
update case_information ci
|
||||
<set>
|
||||
<if test="params.auditStatus != null">
|
||||
ci.audit_status = #{params.auditStatus},
|
||||
</if>
|
||||
<if test="params.auditOpinion != null">
|
||||
ci.audit_opinion = #{params.auditOpinion}
|
||||
</if>
|
||||
</set>
|
||||
<where>
|
||||
<if test="params.id != null">
|
||||
and ci.id = #{params.id}
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
<update id="claimWithdrawal">
|
||||
update case_information ci
|
||||
<set>
|
||||
<if test="params.caseStatus != null">
|
||||
ci.case_status = #{params.caseStatus},
|
||||
</if>
|
||||
</set>
|
||||
<where>
|
||||
<if test="params.id != null">
|
||||
and ci.id = #{params.id}
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
<update id="caseClosed">
|
||||
update case_information ci
|
||||
<set>
|
||||
<if test="params.isFinishCase != null">
|
||||
ci.is_finish_case = #{params.isFinishCase}
|
||||
</if>
|
||||
</set>
|
||||
<where>
|
||||
<if test="params.id != null">
|
||||
and ci.id = #{params.id}
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
|
||||
<select id="selectCondition" resultType="com.tcctlo.law.vo.CaseInformationListVO" parameterType="map">
|
||||
select <include refid="baseColumn" /> from case_information ci
|
||||
select
|
||||
<include refid="baseColumn"/>
|
||||
from case_information ci
|
||||
<where>
|
||||
1 = 1
|
||||
<if test="condition.caseName != null">
|
||||
|
@ -50,4 +96,39 @@
|
|||
</where>
|
||||
|
||||
</select>
|
||||
<select id="selectCaseFileNum" resultType="java.lang.Integer">
|
||||
select count(fm.id) from file_manager fm
|
||||
<where>
|
||||
1 = 1
|
||||
<if test="id != null">
|
||||
and fm.case_id = #{id}
|
||||
</if>
|
||||
and fm.del_flag = 0
|
||||
and fm.status = 0
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectCaseInfoById" resultType="com.tcctlo.law.entity.CaseInformation">
|
||||
select
|
||||
<include refid="baseColumn"/>
|
||||
from case_information ci
|
||||
<where>
|
||||
1 = 1
|
||||
<if test="id != null">
|
||||
and ci.id = #{id}
|
||||
</if>
|
||||
and ci.status = 0 and ci.del_flag = 0
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectCaseById" resultType="com.tcctlo.law.vo.CaseInformationListVO">
|
||||
select
|
||||
<include refid="baseColumn"/>
|
||||
from case_information ci
|
||||
<where>
|
||||
1 = 1
|
||||
<if test="id != null">
|
||||
and ci.id = #{id}
|
||||
</if>
|
||||
and ci.status = 0 and ci.del_flag = 0
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
<?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.tcctlo.law.mapper.ContractTemplateMapper">
|
||||
|
||||
<update id="deleteTemplate">
|
||||
update contract_template ct set ct.del_flag = 1, ct.status = 1 where ct.id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
|
@ -40,4 +40,15 @@
|
|||
and fm.del_flag = 0
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectFileByCaseId" resultType="com.tcctlo.law.entity.FileManager">
|
||||
select * from file_manager fm
|
||||
<where>
|
||||
1 = 1
|
||||
<if test="caseId != null">
|
||||
and fm.case_id = #{caseId}
|
||||
</if>
|
||||
and fm.status = 0
|
||||
and fm.del_flag = 0
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
update impulse_information ii
|
||||
set ii.del_flag = 1,
|
||||
ii.status = 1,
|
||||
ii.check_flag = 1
|
||||
ii.check_flag = 0
|
||||
where ii.case_id in
|
||||
<foreach collection="caseId" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
|
@ -82,5 +82,32 @@
|
|||
|
||||
|
||||
</select>
|
||||
<select id="selectCondition" resultType="com.tcctlo.law.entity.ImpulseInformation">
|
||||
select * from impulse_information ii
|
||||
<trim prefix="where" prefixOverrides="and | or">
|
||||
<if test="condition.caseName != null and condition.caseName != ''">
|
||||
ii.case_name = #{condition.caseName}
|
||||
</if>
|
||||
<if test="condition.caseNo != null and condition.caseNo != ''">
|
||||
and ii.case_no = #{condition.caseNo}
|
||||
</if>
|
||||
<if test="condition.caseAddress != null and condition.caseAddress != ''">
|
||||
and ii.case_address = #{condition.caseAddress}
|
||||
</if>
|
||||
<if test="condition.casePhone != null and condition.casePhone != ''">
|
||||
and ii.case_phone = #{condition.casePhone}
|
||||
</if>
|
||||
<if test="condition.caseEmail != null and condition.caseEmail != ''">
|
||||
and ii.case_email = #{condition.caseEmail}
|
||||
</if>
|
||||
<if test="condition.isClient != null and condition.isClient != ''">
|
||||
and ii.is_client = #{condition.isClient}
|
||||
</if>
|
||||
and ii.check_flag = 1
|
||||
and ii.del_flag = 0
|
||||
and ii.status = 0
|
||||
</trim>
|
||||
order by ii.create_time desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
package com.tcctlo.law;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
@SpringBootTest(classes = LawApplication.class)
|
||||
public class LawApplicationTest {
|
||||
|
||||
@Test
|
||||
public void caseNo() {
|
||||
// 获取当前日期和时间(精确到秒)
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
String currentDateTime = dateFormat.format(new Date());
|
||||
|
||||
// 生成4位随机数
|
||||
String strRandom = IdUtil.fastSimpleUUID();
|
||||
|
||||
// 组合成订单编号
|
||||
String orderNumber = currentDateTime + "-" + strRandom;
|
||||
|
||||
// 输出订单编号
|
||||
System.out.println("生成的订单编号为: " + orderNumber);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.tcctlo.law;
|
||||
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import java.io.FileOutputStream;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
|
||||
@SpringBootTest(classes = LawApplication.class)
|
||||
public class WordTest {
|
||||
|
||||
@Test
|
||||
void word() throws Exception{
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("firstParty","甲方名称");
|
||||
map.put("secondParty","乙方名称");
|
||||
map.put("solicitor","张三、李四、王五");
|
||||
map.put("commitment","委托事项委托事项委托事项委托事项");
|
||||
map.put("signDate", LocalDateTime.now().toString());
|
||||
map.put("legalRepresentative","法定代表人");
|
||||
map.put("idNo","620121199708060011");
|
||||
map.put("creditCode","52031001156477894");
|
||||
map.put("bankName","中国建设银行");
|
||||
map.put("accountNum","4561112557894411");
|
||||
map.put("address","云南省昆明市");
|
||||
map.put("phone","13359490766");
|
||||
map.put("facsimile","0931-6554211");
|
||||
map.put("postcode","730300");
|
||||
XWPFTemplate template = XWPFTemplate.compile("D:/templeteWord/常年法律顾问合同(2023.12版).docx").render(map);
|
||||
FileOutputStream out = new FileOutputStream("D:/word/常年法律顾问合同.docx");
|
||||
template.write(out);
|
||||
out.flush();
|
||||
out.close();
|
||||
template.close();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue