[UPDATE]:案件以及相关信息修改
This commit is contained in:
parent
9213f8b199
commit
71f931b6d7
|
@ -1,20 +1,17 @@
|
||||||
package com.tcctlo.web.controller.system;
|
package com.tcctlo.web.controller.system;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.tcctlo.common.annotation.Anonymous;
|
||||||
|
import com.tcctlo.common.core.domain.LawUserVO;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import com.tcctlo.common.annotation.Log;
|
import com.tcctlo.common.annotation.Log;
|
||||||
import com.tcctlo.common.core.controller.BaseController;
|
import com.tcctlo.common.core.controller.BaseController;
|
||||||
|
@ -65,6 +62,17 @@ public class SysUserController extends BaseController
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据角色名称获取用户信息【主要用来在案件查询时,查询代理律师作为查询条件】
|
||||||
|
* @param params 查询条件
|
||||||
|
* @return 结果集
|
||||||
|
*/
|
||||||
|
@GetMapping("/getUserByRole")
|
||||||
|
public AjaxResult getUserByRole(@RequestParam("lawName") String lawName)
|
||||||
|
{
|
||||||
|
return AjaxResult.success(userService.getUserByRole(lawName));
|
||||||
|
}
|
||||||
|
|
||||||
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
||||||
@PreAuthorize("@ss.hasPermi('system:user:export')")
|
@PreAuthorize("@ss.hasPermi('system:user:export')")
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
|
@ -253,4 +261,16 @@ public class SysUserController extends BaseController
|
||||||
{
|
{
|
||||||
return success(deptService.selectDeptTreeList(dept));
|
return success(deptService.selectDeptTreeList(dept));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取律师信息
|
||||||
|
* @return 律师信息
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@GetMapping("/getLawUser")
|
||||||
|
public AjaxResult getLawUser()
|
||||||
|
{
|
||||||
|
List<LawUserVO> lawUser = userService.getLawUser();
|
||||||
|
return success(lawUser);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,10 +5,17 @@ spring:
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
druid:
|
druid:
|
||||||
# 主库数据源
|
# 主库数据源
|
||||||
|
#本地环境
|
||||||
master:
|
master:
|
||||||
url: jdbc:mysql://localhost:3306/low-office-oa?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
url: jdbc:mysql://127.0.0.1:3306/law-firm?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
username: root
|
username: root
|
||||||
password: root
|
password: root
|
||||||
|
|
||||||
|
#线上环境
|
||||||
|
#master:
|
||||||
|
# url: jdbc:mysql://47.109.202.121:3306/law-firm?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
|
# username: root
|
||||||
|
# password: TCCT3.1415926
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
slave:
|
slave:
|
||||||
# 从数据源开关/默认关闭
|
# 从数据源开关/默认关闭
|
||||||
|
|
|
@ -16,7 +16,7 @@ ruoyi:
|
||||||
# 开发环境配置
|
# 开发环境配置
|
||||||
server:
|
server:
|
||||||
# 服务器的HTTP端口,默认为8080
|
# 服务器的HTTP端口,默认为8080
|
||||||
port: 8080
|
port: 8088
|
||||||
servlet:
|
servlet:
|
||||||
# 应用的访问路径
|
# 应用的访问路径
|
||||||
context-path: /
|
context-path: /
|
||||||
|
@ -57,9 +57,9 @@ spring:
|
||||||
servlet:
|
servlet:
|
||||||
multipart:
|
multipart:
|
||||||
# 单个文件大小
|
# 单个文件大小
|
||||||
max-file-size: 10MB
|
max-file-size: 2GB
|
||||||
# 设置总上传的文件大小
|
# 设置总上传的文件大小
|
||||||
max-request-size: 20MB
|
max-request-size: 2GB
|
||||||
# 服务模块
|
# 服务模块
|
||||||
devtools:
|
devtools:
|
||||||
restart:
|
restart:
|
||||||
|
@ -68,13 +68,14 @@ spring:
|
||||||
# redis 配置
|
# redis 配置
|
||||||
redis:
|
redis:
|
||||||
# 地址
|
# 地址
|
||||||
|
# host: 47.109.202.121
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
# 端口,默认为6379
|
# 端口,默认为6379
|
||||||
port: 6379
|
port: 6379
|
||||||
# 数据库索引
|
# 数据库索引
|
||||||
database: 0
|
database: 2
|
||||||
# 密码
|
# 密码
|
||||||
password: zsqCoCo0806
|
password:
|
||||||
# 连接超时时间
|
# 连接超时时间
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
lettuce:
|
lettuce:
|
||||||
|
@ -95,7 +96,7 @@ token:
|
||||||
# 令牌密钥
|
# 令牌密钥
|
||||||
secret: abcdefghijklmnopqrstuvwxyz
|
secret: abcdefghijklmnopqrstuvwxyz
|
||||||
# 令牌有效期(默认30分钟)
|
# 令牌有效期(默认30分钟)
|
||||||
expireTime: 60
|
expireTime: 300
|
||||||
|
|
||||||
mybatis-plus:
|
mybatis-plus:
|
||||||
# 搜索指定包别名
|
# 搜索指定包别名
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.tcctlo.common.config;
|
||||||
|
|
||||||
|
import org.apache.ibatis.reflection.MetaObject;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class MetaObjectHandler implements com.baomidou.mybatisplus.core.handlers.MetaObjectHandler {
|
||||||
|
@Override
|
||||||
|
public void insertFill(MetaObject metaObject) {
|
||||||
|
|
||||||
|
this.setFieldValByName("createTime", Date.from(LocalDateTime.now().toInstant(java.time.ZoneOffset.of("+8"))), metaObject);
|
||||||
|
this.setFieldValByName("updateTime", Date.from(LocalDateTime.now().toInstant(java.time.ZoneOffset.of("+8"))), metaObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateFill(MetaObject metaObject) {
|
||||||
|
this.setFieldValByName("updateTime", Date.from(LocalDateTime.now().toInstant(java.time.ZoneOffset.of("+8"))), metaObject);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,54 @@
|
||||||
|
package com.tcctlo.common.core.domain;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 律师实体类
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class LawUserVO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户名
|
||||||
|
*/
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 昵称
|
||||||
|
*/
|
||||||
|
private String nickName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 头像地址
|
||||||
|
*/
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 邮箱
|
||||||
|
*/
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色id
|
||||||
|
*/
|
||||||
|
private String roleId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色名称
|
||||||
|
*/
|
||||||
|
private String roleName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色权限字符
|
||||||
|
*/
|
||||||
|
private String roleKey;
|
||||||
|
}
|
|
@ -45,18 +45,28 @@ public class SysUser extends BaseEntity
|
||||||
@Excel(name = "手机号码", cellType = ColumnType.TEXT)
|
@Excel(name = "手机号码", cellType = ColumnType.TEXT)
|
||||||
private String phonenumber;
|
private String phonenumber;
|
||||||
|
|
||||||
|
/** 身份证 */
|
||||||
|
@Excel(name = "身份证号码", cellType = ColumnType.TEXT)
|
||||||
|
private String idCardNo;
|
||||||
|
|
||||||
/** 用户性别 */
|
/** 用户性别 */
|
||||||
@Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
|
@Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
|
||||||
private String sex;
|
private String sex;
|
||||||
|
|
||||||
|
public String getIdCardNo() {
|
||||||
|
return idCardNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIdCardNo(String idCardNo) {
|
||||||
|
this.idCardNo = idCardNo;
|
||||||
|
}
|
||||||
|
|
||||||
/** 用户头像 */
|
/** 用户头像 */
|
||||||
private String avatar;
|
private String avatar;
|
||||||
|
|
||||||
/** 密码 */
|
/** 密码 */
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
/** 职工在职状态(0正常,1离职) */
|
|
||||||
private Integer employedStatus;
|
|
||||||
|
|
||||||
/** 帐号状态(0正常 1停用) */
|
/** 帐号状态(0正常 1停用) */
|
||||||
@Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
|
@Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
|
||||||
|
@ -65,13 +75,6 @@ public class SysUser extends BaseEntity
|
||||||
/** 删除标志(0代表存在 2代表删除) */
|
/** 删除标志(0代表存在 2代表删除) */
|
||||||
private String delFlag;
|
private String delFlag;
|
||||||
|
|
||||||
public Integer getEmployedStatus() {
|
|
||||||
return employedStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEmployedStatus(Integer employedStatus) {
|
|
||||||
this.employedStatus = employedStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 最后登录IP */
|
/** 最后登录IP */
|
||||||
@Excel(name = "最后登录IP", type = Type.EXPORT)
|
@Excel(name = "最后登录IP", type = Type.EXPORT)
|
||||||
|
@ -317,6 +320,7 @@ public class SysUser extends BaseEntity
|
||||||
.append("nickName", getNickName())
|
.append("nickName", getNickName())
|
||||||
.append("email", getEmail())
|
.append("email", getEmail())
|
||||||
.append("phonenumber", getPhonenumber())
|
.append("phonenumber", getPhonenumber())
|
||||||
|
.append("idCardNo", getIdCardNo())
|
||||||
.append("sex", getSex())
|
.append("sex", getSex())
|
||||||
.append("avatar", getAvatar())
|
.append("avatar", getAvatar())
|
||||||
.append("password", getPassword())
|
.append("password", getPassword())
|
||||||
|
|
|
@ -12,6 +12,7 @@ import java.io.InputStream;
|
||||||
|
|
||||||
public class Demo {
|
public class Demo {
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
// Endpoint以华东1(杭州)为例,其它Region请按实际情况填写。
|
// Endpoint以华东1(杭州)为例,其它Region请按实际情况填写。
|
||||||
String endpoint = "https://oss-cn-beijing.aliyuncs.com";
|
String endpoint = "https://oss-cn-beijing.aliyuncs.com";
|
||||||
|
|
|
@ -5,22 +5,17 @@ import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.inner.BlockAttackInnerInterceptor;
|
import com.baomidou.mybatisplus.extension.plugins.inner.BlockAttackInnerInterceptor;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
|
import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||||
|
import com.tcctlo.framework.interceptor.EasySqlInjector;
|
||||||
|
import com.tcctlo.system.handler.JsonTypeHandler;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
|
|
||||||
/**
|
|
||||||
* Mybatis Plus 配置
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@EnableTransactionManagement(proxyTargetClass = true)
|
@EnableTransactionManagement(proxyTargetClass = true)
|
||||||
@Configuration
|
@Configuration
|
||||||
public class MybatisPlusConfig
|
public class MybatisPlusConfig {
|
||||||
{
|
|
||||||
@Bean
|
@Bean
|
||||||
public MybatisPlusInterceptor mybatisPlusInterceptor()
|
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||||
{
|
|
||||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||||
// 分页插件
|
// 分页插件
|
||||||
interceptor.addInnerInterceptor(paginationInnerInterceptor());
|
interceptor.addInnerInterceptor(paginationInnerInterceptor());
|
||||||
|
@ -34,8 +29,7 @@ public class MybatisPlusConfig
|
||||||
/**
|
/**
|
||||||
* 分页插件,自动识别数据库类型 https://baomidou.com/guide/interceptor-pagination.html
|
* 分页插件,自动识别数据库类型 https://baomidou.com/guide/interceptor-pagination.html
|
||||||
*/
|
*/
|
||||||
public PaginationInnerInterceptor paginationInnerInterceptor()
|
public PaginationInnerInterceptor paginationInnerInterceptor() {
|
||||||
{
|
|
||||||
PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor();
|
PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor();
|
||||||
// 设置数据库类型为mysql
|
// 设置数据库类型为mysql
|
||||||
paginationInnerInterceptor.setDbType(DbType.MYSQL);
|
paginationInnerInterceptor.setDbType(DbType.MYSQL);
|
||||||
|
@ -47,16 +41,33 @@ public class MybatisPlusConfig
|
||||||
/**
|
/**
|
||||||
* 乐观锁插件 https://baomidou.com/guide/interceptor-optimistic-locker.html
|
* 乐观锁插件 https://baomidou.com/guide/interceptor-optimistic-locker.html
|
||||||
*/
|
*/
|
||||||
public OptimisticLockerInnerInterceptor optimisticLockerInnerInterceptor()
|
public OptimisticLockerInnerInterceptor optimisticLockerInnerInterceptor() {
|
||||||
{
|
|
||||||
return new OptimisticLockerInnerInterceptor();
|
return new OptimisticLockerInnerInterceptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 如果是对全表的删除或更新操作,就会终止该操作 https://baomidou.com/guide/interceptor-block-attack.html
|
* 如果是对全表的删除或更新操作,就会终止该操作 https://baomidou.com/guide/interceptor-block-attack.html
|
||||||
*/
|
*/
|
||||||
public BlockAttackInnerInterceptor blockAttackInnerInterceptor()
|
public BlockAttackInnerInterceptor blockAttackInnerInterceptor() {
|
||||||
{
|
|
||||||
return new BlockAttackInnerInterceptor();
|
return new BlockAttackInnerInterceptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注入自定义方法
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public EasySqlInjector easySqlInjector() {
|
||||||
|
return new EasySqlInjector();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理json类型的字段
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public JsonTypeHandler jsonTypeHandler() {
|
||||||
|
return new JsonTypeHandler();
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.tcctlo.framework.interceptor;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.injector.AbstractMethod;
|
||||||
|
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.TableInfo;
|
||||||
|
import com.baomidou.mybatisplus.extension.injector.methods.InsertBatchSomeColumn;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义sql注入器
|
||||||
|
*/
|
||||||
|
public class EasySqlInjector extends DefaultSqlInjector {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AbstractMethod> getMethodList(Class<?> mapperClass, TableInfo tableInfo) {
|
||||||
|
List<AbstractMethod> methodList = super.getMethodList(mapperClass, tableInfo);
|
||||||
|
methodList.add(new InsertBatchSomeColumn());
|
||||||
|
return methodList;
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,12 +5,12 @@ import com.github.davidfantasy.mybatisplus.generatorui.mbp.NameConverter;
|
||||||
|
|
||||||
public class GeneratorUIServer {
|
public class GeneratorUIServer {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
GeneratorConfig config = GeneratorConfig.builder().jdbcUrl("jdbc:mysql://localhost:3306/low-office-oa?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8")
|
GeneratorConfig config = GeneratorConfig.builder().jdbcUrl("jdbc:mysql://localhost:3306/low-office?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8")
|
||||||
.userName("root")
|
.userName("root")
|
||||||
.password("root")
|
.password("root")
|
||||||
.driverClassName("com.mysql.cj.jdbc.Driver")
|
.driverClassName("com.mysql.cj.jdbc.Driver")
|
||||||
//数据库schema,MSSQL,PGSQL,ORACLE,DB2类型的数据库需要指定
|
//数据库schema,MSSQL,PGSQL,ORACLE,DB2类型的数据库需要指定
|
||||||
.schemaName("low-office-oa")
|
.schemaName("low-office")
|
||||||
//数据库表前缀,生成entity名称时会去掉(v2.0.3新增)
|
//数据库表前缀,生成entity名称时会去掉(v2.0.3新增)
|
||||||
// .tablePrefix("t_")
|
// .tablePrefix("t_")
|
||||||
//如果需要修改entity及其属性的命名规则,以及自定义各类生成文件的命名规则,可自定义一个NameConverter实例,覆盖相应的名称转换方法,详细可查看该接口的说明:
|
//如果需要修改entity及其属性的命名规则,以及自定义各类生成文件的命名规则,可自定义一个NameConverter实例,覆盖相应的名称转换方法,详细可查看该接口的说明:
|
||||||
|
|
|
@ -23,5 +23,21 @@
|
||||||
<groupId>com.tcctlo</groupId>
|
<groupId>com.tcctlo</groupId>
|
||||||
<artifactId>tcctlo-framework</artifactId>
|
<artifactId>tcctlo-framework</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.junit.jupiter</groupId>
|
||||||
|
<artifactId>junit-jupiter</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
|
@ -0,0 +1,30 @@
|
||||||
|
package com.tcctlo.law;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum CaseEnum {
|
||||||
|
LAWYER("律师", "LAWYER");
|
||||||
|
|
||||||
|
private String roleName;
|
||||||
|
private String roleKey;
|
||||||
|
|
||||||
|
public String getRoleName() {
|
||||||
|
return roleName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoleName(String roleName) {
|
||||||
|
this.roleName = roleName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRoleKey() {
|
||||||
|
return roleKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoleKey(String roleKey) {
|
||||||
|
this.roleKey = roleKey;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,112 @@
|
||||||
|
package com.tcctlo.law.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.tcctlo.common.core.controller.BaseController;
|
||||||
|
import com.tcctlo.common.core.domain.AjaxResult;
|
||||||
|
import com.tcctlo.law.entity.CaseInformation;
|
||||||
|
import com.tcctlo.law.service.ICaseInformationService;
|
||||||
|
import com.tcctlo.law.vo.CaseInformationEnterVO;
|
||||||
|
import com.tcctlo.law.vo.CaseInformationListVO;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 案件信息表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 张世琪
|
||||||
|
* @since 2025-02-06
|
||||||
|
*/
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/caseInformation")
|
||||||
|
public class CaseInformationController extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ICaseInformationService iCaseInformationService;
|
||||||
|
|
||||||
|
@PostMapping(value = "/list")
|
||||||
|
public AjaxResult list(@RequestParam(required = false) Integer current, @RequestParam(required = false) Integer size, @RequestBody(required = false) Map<String, Object> params) {
|
||||||
|
if (current == null) {
|
||||||
|
current = 1;
|
||||||
|
}
|
||||||
|
if (size == null) {
|
||||||
|
size = 10;
|
||||||
|
}
|
||||||
|
Page<CaseInformationListVO> pageList = iCaseInformationService.list((Integer) params.get("current"), (Integer) params.get("size"), params);
|
||||||
|
return AjaxResult.success(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据案件ID查询案件详细信息
|
||||||
|
* @param id 案件ID
|
||||||
|
* @return 结果集
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/selectCaseInfoById/{id}")
|
||||||
|
public AjaxResult selectCaseInfoById(@PathVariable("id") Long id) {
|
||||||
|
CaseInformationEnterVO caseInformationEnterVO = iCaseInformationService.selectCaseInfoById(id);
|
||||||
|
return AjaxResult.success(caseInformationEnterVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件信息修改
|
||||||
|
* @param params 入参
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
@PostMapping(value = "/updateCaseInfo")
|
||||||
|
public AjaxResult updateCaseInfo(@RequestBody CaseInformationEnterVO params) {
|
||||||
|
Integer result = iCaseInformationService.updateCaseInfo(params);
|
||||||
|
return AjaxResult.success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getById(@PathVariable("id") Long id) {
|
||||||
|
CaseInformation caseInformation = iCaseInformationService.getById(id);
|
||||||
|
return AjaxResult.success(caseInformation);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/create")
|
||||||
|
public AjaxResult create(@RequestBody CaseInformation caseInformation) {
|
||||||
|
Integer result = iCaseInformationService.create(caseInformation);
|
||||||
|
return AjaxResult.success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/delete/{id}")
|
||||||
|
public AjaxResult delete(@PathVariable("id") Long id) {
|
||||||
|
Integer result = iCaseInformationService.delete(id);
|
||||||
|
return AjaxResult.success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/deleteCase")
|
||||||
|
public AjaxResult deleteCase(@RequestParam("ids") String ids) {
|
||||||
|
return AjaxResult.success(iCaseInformationService.deleteCase(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/update")
|
||||||
|
public AjaxResult update(@RequestBody CaseInformation params) {
|
||||||
|
Integer result = iCaseInformationService.update(params);
|
||||||
|
return AjaxResult.success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件信息录入
|
||||||
|
*
|
||||||
|
* @param caseInfo 案件信息
|
||||||
|
* @return 是否录入成功
|
||||||
|
*/
|
||||||
|
@PostMapping(value = "/enterCaseInfo")
|
||||||
|
public AjaxResult enterCaseInfo(@RequestBody CaseInformationEnterVO caseInfo) {
|
||||||
|
Boolean result = iCaseInformationService.enterCaseInfo(caseInfo);
|
||||||
|
if (result) {
|
||||||
|
return AjaxResult.success("案件信息录入成功");
|
||||||
|
} else {
|
||||||
|
return AjaxResult.error("案件信息录入失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
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.CaseLawyer;
|
||||||
|
import com.tcctlo.law.service.ICaseLawyerService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 案件律师表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 张世琪
|
||||||
|
* @since 2025-02-06
|
||||||
|
*/
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/caseLawyer")
|
||||||
|
public class CaseLawyerController {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ICaseLawyerService iCaseLawyerService;
|
||||||
|
|
||||||
|
@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<CaseLawyer> pageList = iCaseLawyerService.list(current,size);
|
||||||
|
return AjaxResult.success(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getById(@PathVariable("id") Long id) {
|
||||||
|
CaseLawyer caseLawyer = iCaseLawyerService.getById(id);
|
||||||
|
return AjaxResult.success(caseLawyer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/create")
|
||||||
|
public AjaxResult create(@RequestBody CaseLawyer params) {
|
||||||
|
Integer result = iCaseLawyerService.create(params);
|
||||||
|
return AjaxResult.success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/delete/{id}")
|
||||||
|
public AjaxResult delete(@PathVariable("id") Long id) {
|
||||||
|
Integer result = iCaseLawyerService.delete(id);
|
||||||
|
return AjaxResult.success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/update")
|
||||||
|
public AjaxResult update(@RequestBody CaseLawyer params) {
|
||||||
|
Integer result = iCaseLawyerService.update(params);
|
||||||
|
return AjaxResult.success(result);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
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.CollectionRecord;
|
||||||
|
import com.tcctlo.law.service.ICollectionRecordService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 收款记录表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 张世琪
|
||||||
|
* @since 2025-02-06
|
||||||
|
*/
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/collectionRecord")
|
||||||
|
public class CollectionRecordController {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ICollectionRecordService iCollectionRecordService;
|
||||||
|
|
||||||
|
@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<CollectionRecord> pageList = iCollectionRecordService.list(current,size);
|
||||||
|
return AjaxResult.success(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getById(@PathVariable("id") Long id) {
|
||||||
|
CollectionRecord collectionRecord = iCollectionRecordService.getById(id);
|
||||||
|
return AjaxResult.success(collectionRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/create")
|
||||||
|
public AjaxResult create(@RequestBody CollectionRecord params) {
|
||||||
|
Integer result = iCollectionRecordService.create(params);
|
||||||
|
return AjaxResult.success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/delete/{id}")
|
||||||
|
public AjaxResult delete(@PathVariable("id") Long id) {
|
||||||
|
Integer result = iCollectionRecordService.delete(id);
|
||||||
|
return AjaxResult.success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/update")
|
||||||
|
public AjaxResult update(@RequestBody CollectionRecord params) {
|
||||||
|
Integer result = iCollectionRecordService.update(params);
|
||||||
|
return AjaxResult.success(result);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
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.FileManager;
|
||||||
|
import com.tcctlo.law.service.IFileManagerService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 文件管理 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 张世琪
|
||||||
|
* @since 2025-02-06
|
||||||
|
*/
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/fileManager")
|
||||||
|
public class FileManagerController {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IFileManagerService iFileManagerService;
|
||||||
|
|
||||||
|
@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<FileManager> pageList = iFileManagerService.list(current,size);
|
||||||
|
return AjaxResult.success(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getById(@PathVariable("id") Long id) {
|
||||||
|
FileManager fileManager = iFileManagerService.getById(id);
|
||||||
|
return AjaxResult.success(fileManager);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/create")
|
||||||
|
public AjaxResult create(@RequestBody FileManager params) {
|
||||||
|
Integer result = iFileManagerService.create(params);
|
||||||
|
return AjaxResult.success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/delete/{id}")
|
||||||
|
public AjaxResult delete(@PathVariable("id") Long id) {
|
||||||
|
Integer result = iFileManagerService.delete(id);
|
||||||
|
return AjaxResult.success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/update")
|
||||||
|
public AjaxResult update(@RequestBody FileManager params) {
|
||||||
|
Integer result = iFileManagerService.update(params);
|
||||||
|
return AjaxResult.success(result);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,92 @@
|
||||||
|
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.ImpulseInformation;
|
||||||
|
import com.tcctlo.law.service.IImpulseInformationService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 利冲信息表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 张世琪
|
||||||
|
* @since 2025-02-06
|
||||||
|
*/
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/impulseInformation")
|
||||||
|
public class ImpulseInformationController {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IImpulseInformationService iImpulseInformationService;
|
||||||
|
|
||||||
|
@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<ImpulseInformation> pageList = iImpulseInformationService.list(current, size);
|
||||||
|
return AjaxResult.success(pageList);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 模糊查询【用于搜索条件查询】
|
||||||
|
*
|
||||||
|
* @param caseName 【委托方】/【相对方】名称
|
||||||
|
* @param isClient 是否是委托方
|
||||||
|
* @return 结果集
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/getAllByParam")
|
||||||
|
public AjaxResult selectLikeByParam(@RequestParam("caseName") String caseName, @RequestParam("isClient") Integer isClient) {
|
||||||
|
return AjaxResult.success(iImpulseInformationService.selectLikeByParam(caseName, isClient));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 利冲检索
|
||||||
|
* @param impulseInformation 利冲信息
|
||||||
|
* @return 检索结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/retrievalConflict")
|
||||||
|
public AjaxResult retrievalConflict(@RequestBody ImpulseInformation impulseInformation) {
|
||||||
|
AjaxResult ajaxResult = new AjaxResult();
|
||||||
|
Boolean res = iImpulseInformationService.retrievalConflict(impulseInformation);
|
||||||
|
if (res){
|
||||||
|
ajaxResult.put("code", 200);
|
||||||
|
ajaxResult.put("msg", "检索通过");
|
||||||
|
}else {
|
||||||
|
ajaxResult.put("code", 401);
|
||||||
|
ajaxResult.put("msg", "检索不通过");
|
||||||
|
}
|
||||||
|
return ajaxResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getById(@PathVariable("id") Long id) {
|
||||||
|
ImpulseInformation impulseInformation = iImpulseInformationService.getById(id);
|
||||||
|
return AjaxResult.success(impulseInformation);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/create")
|
||||||
|
public AjaxResult create(@RequestBody ImpulseInformation params) {
|
||||||
|
Integer result = iImpulseInformationService.create(params);
|
||||||
|
return AjaxResult.success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/delete/{id}")
|
||||||
|
public AjaxResult delete(@PathVariable("id") Long id) {
|
||||||
|
Integer result = iImpulseInformationService.delete(id);
|
||||||
|
return AjaxResult.success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/update")
|
||||||
|
public AjaxResult update(@RequestBody ImpulseInformation params) {
|
||||||
|
Integer result = iImpulseInformationService.update(params);
|
||||||
|
return AjaxResult.success(result);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,183 @@
|
||||||
|
package com.tcctlo.law.entity;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 案件信息表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 张世琪
|
||||||
|
* @since 2025-02-06
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("case_information")
|
||||||
|
public class CaseInformation implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件编号【自动生成UUID】
|
||||||
|
*/
|
||||||
|
private String caseNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件名称
|
||||||
|
*/
|
||||||
|
private String caseName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件内容
|
||||||
|
*/
|
||||||
|
private String caseContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务类型【0:诉讼业务,1:非诉讼业务】
|
||||||
|
*/
|
||||||
|
private Integer businessType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务分类【0:民商事业务、1:刑事辩护业务、2:行政复议及诉讼业务、3:企业常年法律顾问、4:企业专项法律顾问】
|
||||||
|
*/
|
||||||
|
private Integer businessClassify;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件类型
|
||||||
|
*/
|
||||||
|
private String caseType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理阶段
|
||||||
|
*/
|
||||||
|
private String agencyStage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件来源【0:市场案源,1:律师独立案源】
|
||||||
|
*/
|
||||||
|
private Integer caseSource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应收金额
|
||||||
|
*/
|
||||||
|
private BigDecimal amountReceivable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已收金额总计
|
||||||
|
*/
|
||||||
|
private BigDecimal amountReceivedSum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 付款期限
|
||||||
|
*/
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date paymentDeadline;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预留款
|
||||||
|
*/
|
||||||
|
private BigDecimal reserveMoney;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 顾问期限
|
||||||
|
*/
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date termOfConsultancy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收款状态【0:未付款、1:部分付款,2:已结清】
|
||||||
|
*/
|
||||||
|
private Integer collectionStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 利冲状态【0:未检索,1:疑似利冲,2:检索通过】
|
||||||
|
*/
|
||||||
|
private Integer impulseState;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收案状态【0:利冲收案、1:正常收案、2:终止收案】
|
||||||
|
*/
|
||||||
|
private Integer caseStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核状态【0:未审核,1:已审核,2:审核不通过】
|
||||||
|
*/
|
||||||
|
private Integer auditStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 归档状态【0:未归档,1:已归档】
|
||||||
|
*/
|
||||||
|
private Integer archiveStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否结案【0:未结案,1:已结案】
|
||||||
|
*/
|
||||||
|
private Integer isFinishCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核意见
|
||||||
|
*/
|
||||||
|
private String auditOpinion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件涉及委托方/相对方ID集合
|
||||||
|
*/
|
||||||
|
private String impulseInformationIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件涉及律师ID集合
|
||||||
|
*/
|
||||||
|
private String caseLawyerIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态【0:正常,1:停用】
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除标志【0:未删除,1:已删除】
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建者
|
||||||
|
*/
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新者
|
||||||
|
*/
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remake;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,92 @@
|
||||||
|
package com.tcctlo.law.entity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 案件律师表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 张世琪
|
||||||
|
* @since 2025-02-06
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("case_lawyer")
|
||||||
|
public class CaseLawyer implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联案件表中的id
|
||||||
|
*/
|
||||||
|
private Long caseId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 律师id【关联系统用户中律师id】
|
||||||
|
*/
|
||||||
|
private Long lawyerId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 律师名称
|
||||||
|
*/
|
||||||
|
private String lawyerName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 律师类型【0:代理律师,1:协办律师】
|
||||||
|
*/
|
||||||
|
private Integer lawyerType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否是原承办律师【0:现任律师,1:原承办律师】
|
||||||
|
*/
|
||||||
|
private Integer isPrime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态【0:正常,1:停用】
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除标志【0:未删除,1:已删除】
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建者
|
||||||
|
*/
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新者
|
||||||
|
*/
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remake;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,89 @@
|
||||||
|
package com.tcctlo.law.entity;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 收款记录表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 张世琪
|
||||||
|
* @since 2025-02-06
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("collection_record")
|
||||||
|
public class CollectionRecord implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联案件表id
|
||||||
|
*/
|
||||||
|
private Long caseId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收款方式
|
||||||
|
*/
|
||||||
|
private String collectionType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已收金额
|
||||||
|
*/
|
||||||
|
private BigDecimal amountReceived;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收款相关凭证【关联文件管理表ID】
|
||||||
|
*/
|
||||||
|
private String collectionUrlId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态【0:正常,1:停用】
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除标志【0:未删除,1:已删除】
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建者
|
||||||
|
*/
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新者
|
||||||
|
*/
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remake;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,87 @@
|
||||||
|
package com.tcctlo.law.entity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 文件管理
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 张世琪
|
||||||
|
* @since 2025-02-06
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("file_manager")
|
||||||
|
public class FileManager implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联案件ID
|
||||||
|
*/
|
||||||
|
private Long caseId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成的新文件名
|
||||||
|
*/
|
||||||
|
private String newFileName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 原文件名称
|
||||||
|
*/
|
||||||
|
private String oldFileName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件存储路径【OSS】
|
||||||
|
*/
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态【0:正常,1::停用】
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除标志【0:未删除,1:已删除】
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建者
|
||||||
|
*/
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新者
|
||||||
|
*/
|
||||||
|
private Date updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remake;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,112 @@
|
||||||
|
package com.tcctlo.law.entity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 利冲信息表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 张世琪
|
||||||
|
* @since 2025-02-06
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("impulse_information")
|
||||||
|
public class ImpulseInformation implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联案件ID
|
||||||
|
*/
|
||||||
|
private Long caseId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件涉及(人/企业)--名称
|
||||||
|
*/
|
||||||
|
private String caseName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件涉及(人/企业)--[身份证/信用代码]
|
||||||
|
*/
|
||||||
|
private String caseNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件涉及(人/企业)--登记地址
|
||||||
|
*/
|
||||||
|
private String caseAddress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件涉及(人/企业)--电话
|
||||||
|
*/
|
||||||
|
private String casePhone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件涉及(人/企业)--邮箱
|
||||||
|
*/
|
||||||
|
private String caseEmail;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型【0:个人,1:企业】
|
||||||
|
*/
|
||||||
|
private Integer caseType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否是委托方【0:是,1:否】
|
||||||
|
*/
|
||||||
|
private Integer isClient;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检索标志【1:需要检索,0:无需检索】
|
||||||
|
*/
|
||||||
|
private Integer checkFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态【0:正常,1:停用】
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除标志【0:未删除,1:已删除】
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建者
|
||||||
|
*/
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新者
|
||||||
|
*/
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remake;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.tcctlo.law.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.tcctlo.law.entity.CaseInformation;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.tcctlo.law.vo.CaseInformationListVO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 案件信息表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 张世琪
|
||||||
|
* @since 2025-02-06
|
||||||
|
*/
|
||||||
|
public interface CaseInformationMapper extends BaseMapper<CaseInformation> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页条件查询
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param condition 条件参数
|
||||||
|
* @return 结果集
|
||||||
|
*/
|
||||||
|
Page<CaseInformationListVO> selectCondition(@Param("page") Page<CaseInformationListVO> page, @Param("condition") Map<String, Object> condition);
|
||||||
|
}
|
|
@ -0,0 +1,55 @@
|
||||||
|
package com.tcctlo.law.mapper;
|
||||||
|
|
||||||
|
import com.tcctlo.law.entity.CaseLawyer;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.tcctlo.law.entity.ImpulseInformation;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 案件律师表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 张世琪
|
||||||
|
* @since 2025-02-06
|
||||||
|
*/
|
||||||
|
public interface CaseLawyerMapper extends BaseMapper<CaseLawyer> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入
|
||||||
|
* @param list 数据集
|
||||||
|
* @return 受影响行数
|
||||||
|
*/
|
||||||
|
int insertBatch(List<CaseLawyer> list);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据案件ID查询代理律师
|
||||||
|
* @param caseId 案件ID
|
||||||
|
* @return 结果集
|
||||||
|
*/
|
||||||
|
CaseLawyer selectAttorneyAgentLawByCaseId(@Param("caseId") Long caseId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据案件ID查询协办律师
|
||||||
|
* @param caseId 案件ID
|
||||||
|
* @return 结果集
|
||||||
|
*/
|
||||||
|
List<CaseLawyer> selectAssistingLawyerByCaseId(@Param("caseId") Long caseId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据案件ID查询所有现任律师
|
||||||
|
* @param caseId 案件ID
|
||||||
|
* @return 结果集
|
||||||
|
*/
|
||||||
|
List<CaseLawyer> selectAllPrimeLawyerByCaseId(@Param("caseId") Long caseId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据案件律师表的id集合修改律师状态为【原承办律师】
|
||||||
|
* @param ids id集合
|
||||||
|
* @return 受影响行数
|
||||||
|
*/
|
||||||
|
int updateByIds(@Param("ids") List<Long> ids);
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.tcctlo.law.mapper;
|
||||||
|
|
||||||
|
import com.tcctlo.law.entity.CollectionRecord;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.tcctlo.law.vo.CollectionRecordEnterVO;
|
||||||
|
import io.lettuce.core.dynamic.annotation.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 收款记录表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 张世琪
|
||||||
|
* @since 2025-02-06
|
||||||
|
*/
|
||||||
|
public interface CollectionRecordMapper extends BaseMapper<CollectionRecord> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据案件ID查询收款记录
|
||||||
|
* @param caseId 案件ID
|
||||||
|
* @return 结果集
|
||||||
|
*/
|
||||||
|
List<CollectionRecordEnterVO> selectByCaseId(@Param("caseId") Long caseId);
|
||||||
|
}
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.tcctlo.law.mapper;
|
||||||
|
|
||||||
|
import com.tcctlo.law.entity.CaseLawyer;
|
||||||
|
import com.tcctlo.law.entity.FileManager;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 文件管理 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 张世琪
|
||||||
|
* @since 2025-02-06
|
||||||
|
*/
|
||||||
|
public interface FileManagerMapper extends BaseMapper<FileManager> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入
|
||||||
|
* @param list 数据集
|
||||||
|
* @return 受影响行数
|
||||||
|
*/
|
||||||
|
int insertBatch(List<FileManager> list);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据案件ID和收款记录表中存储的文件ID查询文件管理信息
|
||||||
|
* @param caseId 案件ID
|
||||||
|
* @param fileId 收款记录表中存储的文件ID
|
||||||
|
* @return 结果集
|
||||||
|
*/
|
||||||
|
FileManager selectByCaseIdAndFileId(@Param("caseId") Long caseId, @Param("fileId") Long fileId);
|
||||||
|
}
|
|
@ -0,0 +1,55 @@
|
||||||
|
package com.tcctlo.law.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.tcctlo.law.entity.ImpulseInformation;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 利冲信息表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 张世琪
|
||||||
|
* @since 2025-02-06
|
||||||
|
*/
|
||||||
|
public interface ImpulseInformationMapper extends BaseMapper<ImpulseInformation> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入
|
||||||
|
* @param list 数据集
|
||||||
|
* @return 受影响行数
|
||||||
|
*/
|
||||||
|
int insertBatch(List<ImpulseInformation> list);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量软删除
|
||||||
|
* @param list 参数
|
||||||
|
* @return 结果集
|
||||||
|
*/
|
||||||
|
int deleteBatchLogic(List<ImpulseInformation> list);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据案件id查询
|
||||||
|
* @param caseId 案件ID
|
||||||
|
* @param clientFlag 是否委托方标志
|
||||||
|
* @return 结果集
|
||||||
|
*/
|
||||||
|
List<ImpulseInformation> selectByCaseId(@Param("caseId") Long caseId, @Param("clientFlag") Integer clientFlag);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询修改后的【委托方】+【相对方】信息
|
||||||
|
* @param caseId 案件ID
|
||||||
|
* @return 结果集
|
||||||
|
*/
|
||||||
|
List<ImpulseInformation> selectByCaseIdAdnDelFlag(@Param("caseId") Long caseId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 利冲检索
|
||||||
|
* @param impulseInformation 检索数据
|
||||||
|
* @return 结果集
|
||||||
|
*/
|
||||||
|
List<ImpulseInformation> retrievalConflict(@Param("info") ImpulseInformation impulseInformation);
|
||||||
|
}
|
|
@ -0,0 +1,102 @@
|
||||||
|
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.tcctlo.law.vo.CaseInformationEnterVO;
|
||||||
|
import com.tcctlo.law.vo.CaseInformationListVO;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 案件信息表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 张世琪
|
||||||
|
* @since 2025-02-06
|
||||||
|
*/
|
||||||
|
public interface ICaseInformationService extends IService<CaseInformation>{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 分页列表查询
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @param pageNo 页码
|
||||||
|
* @param pageSize 每页大小
|
||||||
|
* @param params 查询条件
|
||||||
|
* @return 结果集
|
||||||
|
*/
|
||||||
|
Page<CaseInformationListVO> list(Integer pageNo, Integer pageSize, Map<String, Object> params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 详情接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
CaseInformation getById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 新增接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @param caseInformation
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer create(CaseInformation caseInformation);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 删除接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer delete(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 更新接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @param caseInformation
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer update(CaseInformation caseInformation);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件信息录入
|
||||||
|
*
|
||||||
|
* @param caseInfo 案件信息
|
||||||
|
* @return 是否录入成功
|
||||||
|
*/
|
||||||
|
Boolean enterCaseInfo(CaseInformationEnterVO caseInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据案件ID查询案件详细信息
|
||||||
|
* @param id 案件ID
|
||||||
|
* @return 结果集
|
||||||
|
*/
|
||||||
|
CaseInformationEnterVO selectCaseInfoById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件信息修改
|
||||||
|
* @param params 案件信息
|
||||||
|
* @return 受影响行数
|
||||||
|
*/
|
||||||
|
Integer updateCaseInfo(CaseInformationEnterVO params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除案件信息
|
||||||
|
* @param ids 案件id集合
|
||||||
|
* @return 结果集
|
||||||
|
*/
|
||||||
|
Boolean deleteCase(String ids);
|
||||||
|
}
|
|
@ -0,0 +1,72 @@
|
||||||
|
package com.tcctlo.law.service;
|
||||||
|
|
||||||
|
import com.tcctlo.law.entity.CaseLawyer;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 案件律师表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 张世琪
|
||||||
|
* @since 2025-02-06
|
||||||
|
*/
|
||||||
|
public interface ICaseLawyerService extends IService<CaseLawyer>{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 分页列表查询
|
||||||
|
* </p>
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Page<CaseLawyer> list(Integer pageNo, Integer pageSize);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 详情接口
|
||||||
|
* </p>
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
CaseLawyer getById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 新增接口
|
||||||
|
* </p>
|
||||||
|
* @param caseLawyer
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer create(CaseLawyer caseLawyer);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 删除接口
|
||||||
|
* </p>
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer delete(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 更新接口
|
||||||
|
* </p>
|
||||||
|
* @param caseLawyer
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer update(CaseLawyer caseLawyer);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 条件查询
|
||||||
|
* @return 结果几
|
||||||
|
*/
|
||||||
|
List<CaseLawyer> selectByCondition(Map params);
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
package com.tcctlo.law.service;
|
||||||
|
|
||||||
|
import com.tcctlo.law.entity.CollectionRecord;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 收款记录表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 张世琪
|
||||||
|
* @since 2025-02-06
|
||||||
|
*/
|
||||||
|
public interface ICollectionRecordService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 分页列表查询
|
||||||
|
* </p>
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Page<CollectionRecord> list(Integer pageNo, Integer pageSize);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 详情接口
|
||||||
|
* </p>
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
CollectionRecord getById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 新增接口
|
||||||
|
* </p>
|
||||||
|
* @param collectionRecord
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer create(CollectionRecord collectionRecord);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 删除接口
|
||||||
|
* </p>
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer delete(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 更新接口
|
||||||
|
* </p>
|
||||||
|
* @param collectionRecord
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer update(CollectionRecord collectionRecord);
|
||||||
|
}
|
|
@ -0,0 +1,64 @@
|
||||||
|
package com.tcctlo.law.service;
|
||||||
|
|
||||||
|
import com.tcctlo.law.entity.CaseLawyer;
|
||||||
|
import com.tcctlo.law.entity.FileManager;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 文件管理 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 张世琪
|
||||||
|
* @since 2025-02-06
|
||||||
|
*/
|
||||||
|
public interface IFileManagerService extends IService<FileManager>{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 分页列表查询
|
||||||
|
* </p>
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Page<FileManager> list(Integer pageNo, Integer pageSize);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 详情接口
|
||||||
|
* </p>
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
FileManager getById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 新增接口
|
||||||
|
* </p>
|
||||||
|
* @param fileManager
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer create(FileManager fileManager);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 删除接口
|
||||||
|
* </p>
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer delete(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 更新接口
|
||||||
|
* </p>
|
||||||
|
* @param fileManager
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer update(FileManager fileManager);
|
||||||
|
}
|
|
@ -0,0 +1,81 @@
|
||||||
|
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 org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 利冲信息表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 张世琪
|
||||||
|
* @since 2025-02-06
|
||||||
|
*/
|
||||||
|
public interface IImpulseInformationService extends IService<ImpulseInformation> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 分页列表查询
|
||||||
|
* </p>
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Page<ImpulseInformation> list(Integer pageNo, Integer pageSize);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 详情接口
|
||||||
|
* </p>
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ImpulseInformation getById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 新增接口
|
||||||
|
* </p>
|
||||||
|
* @param impulseInformation
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer create(ImpulseInformation impulseInformation);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 删除接口
|
||||||
|
* </p>
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer delete(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 更新接口
|
||||||
|
* </p>
|
||||||
|
* @param impulseInformation
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer update(ImpulseInformation impulseInformation);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模糊查询【用于搜索条件查询】
|
||||||
|
* @param params 查询条件
|
||||||
|
* @return 结果集
|
||||||
|
*/
|
||||||
|
List<ImpulseInformation> selectLikeByParam(String caseName, Integer isClient);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 利冲检索
|
||||||
|
* @param impulseInformation 利冲信息
|
||||||
|
* @return 是否利冲
|
||||||
|
*/
|
||||||
|
Boolean retrievalConflict(ImpulseInformation impulseInformation);
|
||||||
|
}
|
|
@ -0,0 +1,380 @@
|
||||||
|
package com.tcctlo.law.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.tcctlo.common.core.domain.model.LoginUser;
|
||||||
|
import com.tcctlo.common.utils.SecurityUtils;
|
||||||
|
import com.tcctlo.common.utils.StringUtils;
|
||||||
|
import com.tcctlo.law.CaseEnum;
|
||||||
|
import com.tcctlo.law.entity.CaseInformation;
|
||||||
|
import com.tcctlo.law.entity.CaseLawyer;
|
||||||
|
import com.tcctlo.law.entity.FileManager;
|
||||||
|
import com.tcctlo.law.entity.ImpulseInformation;
|
||||||
|
import com.tcctlo.law.mapper.*;
|
||||||
|
import com.tcctlo.law.service.ICaseInformationService;
|
||||||
|
import com.tcctlo.law.service.ICaseLawyerService;
|
||||||
|
import com.tcctlo.law.service.IFileManagerService;
|
||||||
|
import com.tcctlo.law.service.IImpulseInformationService;
|
||||||
|
import com.tcctlo.law.tools.GenerateCaseNo;
|
||||||
|
import com.tcctlo.law.vo.CaseInformationEnterVO;
|
||||||
|
import com.tcctlo.law.vo.CaseInformationListVO;
|
||||||
|
import com.tcctlo.law.vo.CollectionRecordEnterVO;
|
||||||
|
import com.tcctlo.system.mapper.SysUserMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Isolation;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 案件信息表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 张世琪
|
||||||
|
* @since 2025-02-06
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMapper, CaseInformation> implements ICaseInformationService {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CaseInformationMapper caseInformationMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ICaseInformationService caseInformationService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统用户mapper
|
||||||
|
*/
|
||||||
|
@Resource
|
||||||
|
private SysUserMapper sysUserMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 利冲信息mapper
|
||||||
|
*/
|
||||||
|
@Resource
|
||||||
|
private ImpulseInformationMapper informationMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 利冲信息service
|
||||||
|
*/
|
||||||
|
@Resource
|
||||||
|
private IImpulseInformationService informationService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件关联律师mapper
|
||||||
|
*/
|
||||||
|
@Resource
|
||||||
|
private CaseLawyerMapper caseLawyerMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件关联律师service
|
||||||
|
*/
|
||||||
|
@Resource
|
||||||
|
private ICaseLawyerService caseLawyerService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件管理mapper
|
||||||
|
*/
|
||||||
|
@Resource
|
||||||
|
private FileManagerMapper fileManagerMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件管理service
|
||||||
|
*/
|
||||||
|
@Resource
|
||||||
|
private IFileManagerService fileManagerService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收款记录mapper
|
||||||
|
*/
|
||||||
|
@Resource
|
||||||
|
private CollectionRecordMapper collectionRecordMapper;
|
||||||
|
|
||||||
|
/*@Override
|
||||||
|
public Page<CaseInformation> list(Integer pageNo, Integer pageSize, Map<String, Object> params) {
|
||||||
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
|
String roleKey = sysUserMapper.selectUserRoleByUserId(loginUser.getUserId());
|
||||||
|
|
||||||
|
//如果当前登录用户的角色是【代理律师】或【协办律师】,则查询当前登录律师的案件信息,否则查询全部案件信息
|
||||||
|
if ("ATTORNEY_AGENT".equals(roleKey) || "ASSISTING_LAWYER".equals(roleKey)){
|
||||||
|
params.put("userId", loginUser.getUserId().toString());
|
||||||
|
}
|
||||||
|
Page<CaseInformation> page = new Page<>(pageNo, pageSize);
|
||||||
|
return caseInformationMapper.selectCondition(page, params);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
/*@Override
|
||||||
|
public Page<CaseInformationEnterVO> list(Integer pageNo, Integer pageSize, Map<String, Object> params) {
|
||||||
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
|
String roleKey = sysUserMapper.selectUserRoleByUserId(loginUser.getUserId());
|
||||||
|
|
||||||
|
//如果当前登录用户的角色是【代理律师】或【协办律师】,则查询当前登录律师的案件信息,否则查询全部案件信息
|
||||||
|
if ("ATTORNEY_AGENT".equals(roleKey) || "ASSISTING_LAWYER".equals(roleKey)){
|
||||||
|
params.put("userId", loginUser.getUserId().toString());
|
||||||
|
}
|
||||||
|
Page<CaseInformation> page = new Page<>(pageNo, pageSize);
|
||||||
|
List<CaseInformation> entityLists = caseInformationMapper.selectCondition(page, params).getRecords();
|
||||||
|
Page<CaseInformationEnterVO> resPage = new Page<>();
|
||||||
|
List<CaseInformationEnterVO> caseInfoVO = new ArrayList<>();
|
||||||
|
for (CaseInformation item : entityLists) {
|
||||||
|
CaseInformationEnterVO itemVO = new CaseInformationEnterVO();
|
||||||
|
itemVO.setCaseInformation(item);
|
||||||
|
itemVO.setEntrustingParty(informationMapper.selectByCaseId(item.getId(), 0)); //利冲信息-委托方信息--list
|
||||||
|
itemVO.setOpposite(informationMapper.selectByCaseId(item.getId(), 1)); //利冲信息-相对方--list
|
||||||
|
itemVO.setAttorneyAgent(caseLawyerMapper.selectAttorneyAgentLawByCaseId(item.getId())); //代理律师--entity
|
||||||
|
itemVO.setAssistingLawyer(caseLawyerMapper.selectAssistingLawyerByCaseId(item.getId())); //协办律师--list
|
||||||
|
caseInfoVO.add(itemVO);
|
||||||
|
}
|
||||||
|
resPage.setRecords(caseInfoVO);
|
||||||
|
return resPage;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<CaseInformationListVO> list(Integer pageNo, Integer pageSize, Map<String, Object> params) {
|
||||||
|
if (params == null) {
|
||||||
|
params = new HashMap<>();
|
||||||
|
}
|
||||||
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
|
String roleKey = sysUserMapper.selectUserRoleByUserId(loginUser.getUserId());
|
||||||
|
|
||||||
|
//如果当前登录用户的角色【律师】,则查询当前登录律师的案件信息,否则查询全部案件信息
|
||||||
|
if (CaseEnum.LAWYER.getRoleKey().equals(roleKey)) {
|
||||||
|
params.put("userId", loginUser.getUserId().toString());
|
||||||
|
}
|
||||||
|
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.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(","))); //协办律师
|
||||||
|
}
|
||||||
|
return caseInformationPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CaseInformation getById(Long id) {
|
||||||
|
return caseInformationMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer create(CaseInformation caseInformation) {
|
||||||
|
return caseInformationMapper.insert(caseInformation);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer delete(Long id) {
|
||||||
|
return caseInformationMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer update(CaseInformation caseInformation) {
|
||||||
|
return caseInformationMapper.updateById(caseInformation);
|
||||||
|
}
|
||||||
|
|
||||||
|
@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<>();
|
||||||
|
impulseInformationList.addAll(caseInfo.getEntrustingParty().stream().peek(item -> {
|
||||||
|
item.setCaseId(caseId);
|
||||||
|
item.setIsClient(0);
|
||||||
|
}).collect(Collectors.toList()));
|
||||||
|
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();
|
||||||
|
attorneyAgent.setLawyerType(0);
|
||||||
|
attorneyAgent.setCaseId(caseId);
|
||||||
|
caseLawyerList.add(attorneyAgent); //代理律师
|
||||||
|
|
||||||
|
caseLawyerList.addAll(caseInfo.getAssistingLawyer().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();
|
||||||
|
collectionRecordList.forEach(item -> {
|
||||||
|
item.setCaseId(caseId);
|
||||||
|
List<FileManager> fileManagerList = item.getFileManager().stream().peek(i -> i.setCaseId(caseId)).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
|
||||||
|
public CaseInformationEnterVO selectCaseInfoById(Long id) {
|
||||||
|
CaseInformationEnterVO result = new CaseInformationEnterVO();
|
||||||
|
//案件信息表----caseInformation
|
||||||
|
CaseInformation caseInformation = caseInformationMapper.selectById(id);
|
||||||
|
result.setCaseInformation(caseInformation);
|
||||||
|
|
||||||
|
//案件关联【委托方】----entrustingParty
|
||||||
|
result.setEntrustingParty(informationMapper.selectByCaseId(id, 0));
|
||||||
|
|
||||||
|
//案件关联【相对方】----opposite
|
||||||
|
result.setOpposite(informationMapper.selectByCaseId(id, 1));
|
||||||
|
|
||||||
|
//代理律师----attorneyAgent
|
||||||
|
result.setAttorneyAgent(caseLawyerMapper.selectAttorneyAgentLawByCaseId(id));
|
||||||
|
|
||||||
|
//协办律师----assistingLawyer
|
||||||
|
result.setAssistingLawyer(caseLawyerMapper.selectAssistingLawyerByCaseId(id));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收款记录----collectionRecordList
|
||||||
|
* 收款记录基本信息
|
||||||
|
* 收款记录文件
|
||||||
|
*/
|
||||||
|
List<CollectionRecordEnterVO> records = collectionRecordMapper.selectByCaseId(id);
|
||||||
|
result.setCollectionRecordList(records);
|
||||||
|
records.stream().peek(item -> {
|
||||||
|
List<Long> fileIds = Arrays.stream(item.getCollectionUrlId().split(","))
|
||||||
|
.map(Long::parseLong)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
item.setFileManager(fileManagerMapper.selectBatchIds(fileIds));
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(isolation = Isolation.DEFAULT, rollbackFor = Exception.class)
|
||||||
|
public Integer updateCaseInfo(CaseInformationEnterVO params) {
|
||||||
|
//案件信息表----caseInformation
|
||||||
|
CaseInformation caseInformation = params.getCaseInformation();
|
||||||
|
Long caseId = caseInformation.getId();
|
||||||
|
|
||||||
|
//案件关联【委托方】----entrustingParty--从数据库获取出原来的委托方信息与通过接口传入的进行比对
|
||||||
|
List<ImpulseInformation> oldImpulse = informationMapper.selectByCaseId(params.getCaseInformation().getId(), 0);
|
||||||
|
List<ImpulseInformation> newImpulse = params.getEntrustingParty();
|
||||||
|
editImpulseInformation(oldImpulse, newImpulse, caseId);
|
||||||
|
|
||||||
|
//案件关联【相对方】----opposite
|
||||||
|
List<ImpulseInformation> oldOpposite = informationMapper.selectByCaseId(params.getCaseInformation().getId(), 1);
|
||||||
|
List<ImpulseInformation> newOpposite = params.getOpposite();
|
||||||
|
editImpulseInformation(oldOpposite, newOpposite, caseId);
|
||||||
|
caseInformation.setImpulseInformationIds(informationMapper.selectByCaseIdAdnDelFlag(params.getCaseInformation().getId()).stream().map(i -> i.getId().toString()).collect(Collectors.joining(",")));
|
||||||
|
|
||||||
|
|
||||||
|
//代理律师----attorneyAgent----修改原来的律师信息
|
||||||
|
|
||||||
|
CaseLawyer newAttorneyAgent = params.getAttorneyAgent();
|
||||||
|
if (newAttorneyAgent.getId() == null) {
|
||||||
|
CaseLawyer oldCaseLawyer = caseLawyerMapper.selectAttorneyAgentLawByCaseId(params.getCaseInformation().getId());
|
||||||
|
oldCaseLawyer.setIsPrime(1);
|
||||||
|
caseLawyerMapper.updateById(oldCaseLawyer);
|
||||||
|
newAttorneyAgent.setCaseId(params.getCaseInformation().getId());
|
||||||
|
caseLawyerMapper.insert(newAttorneyAgent);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//协办律师----assistingLawyer
|
||||||
|
List<CaseLawyer> newAssistingLawyer = params.getAssistingLawyer(); //协办律师
|
||||||
|
List<CaseLawyer> oldAssistingLawyer = caseLawyerMapper.selectAssistingLawyerByCaseId(params.getCaseInformation().getId());
|
||||||
|
editAssistingLawyer(oldAssistingLawyer, newAssistingLawyer, caseId);
|
||||||
|
caseInformation.setCaseLawyerIds(caseLawyerMapper.selectAllPrimeLawyerByCaseId(params.getCaseInformation().getId()).stream().map(c -> c.getLawyerId().toString()).collect(Collectors.joining(",")));
|
||||||
|
caseInformationMapper.updateById(caseInformation);
|
||||||
|
/**
|
||||||
|
* 收款记录----collectionRecordList
|
||||||
|
* 收款记录基本信息----collectionRecord
|
||||||
|
* 收款记录文件----fileManager
|
||||||
|
*/
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deleteCase(String ids) {
|
||||||
|
List<Long> longList = Arrays.stream(ids.split(","))
|
||||||
|
.map(Long::parseLong)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
return caseInformationService.removeBatchByIds(longList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑协办律师
|
||||||
|
*
|
||||||
|
* @param oldData 旧的数据
|
||||||
|
* @param newData 新的数据
|
||||||
|
*/
|
||||||
|
public void editAssistingLawyer(List<CaseLawyer> oldData, List<CaseLawyer> newData, Long caseId) {
|
||||||
|
List<CaseLawyer> insert = newData.stream().filter(c -> c.getId() == null).peek(c -> c.setCaseId(caseId)).collect(Collectors.toList());
|
||||||
|
List<Long> oldIds = oldData.stream().map(c -> c.getId()).collect(Collectors.toList());
|
||||||
|
List<Long> newIds = newData.stream().map(c -> c.getId()).collect(Collectors.toList());
|
||||||
|
List<Long> deleteIds = (List<Long>) CollUtil.subtract(oldIds, newIds); //将原来的数据与现在数据进行比较,得到需要删除的ID
|
||||||
|
if (CollUtil.isNotEmpty(insert)) {
|
||||||
|
caseLawyerService.saveBatch(insert);
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(deleteIds)) {
|
||||||
|
caseLawyerMapper.updateByIds(deleteIds);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑利冲信息
|
||||||
|
*
|
||||||
|
* @param oldData 旧的数据
|
||||||
|
* @param newData 新的数据
|
||||||
|
*/
|
||||||
|
public void editImpulseInformation(List<ImpulseInformation> oldData, List<ImpulseInformation> newData, Long caseId) {
|
||||||
|
List<ImpulseInformation> insert = newData.stream().filter(item -> item.getId() == null).peek(item -> item.setCaseId(caseId)).collect(Collectors.toList());
|
||||||
|
List<Long> oldIds = oldData.stream().map(item -> item.getId()).collect(Collectors.toList());
|
||||||
|
List<Long> newIds = newData.stream().map(item -> item.getId()).collect(Collectors.toList());
|
||||||
|
Collection<Long> updateIds = CollUtil.intersection(oldIds, newIds); //交集【UPDATE】
|
||||||
|
Collection<Long> deleteIds = CollUtil.subtract(oldIds, newIds); //差集【DELETE】
|
||||||
|
|
||||||
|
List<ImpulseInformation> updateDate = newData.stream().filter(item -> CollUtil.contains(updateIds, item.getId())).collect(Collectors.toList());
|
||||||
|
List<ImpulseInformation> deleteData = oldData.stream().filter(item -> CollUtil.contains(deleteIds, item.getId())).collect(Collectors.toList());
|
||||||
|
|
||||||
|
/*if (!StringUtils.isEmpty(insert)){
|
||||||
|
informationService.saveBatch(insert);
|
||||||
|
}
|
||||||
|
if (!StringUtils.isEmpty(updateDate)){
|
||||||
|
informationService.updateBatchById(updateDate);
|
||||||
|
}
|
||||||
|
if (!StringUtils.isEmpty(deleteData)){
|
||||||
|
informationMapper.deleteBatchLogic(deleteData);
|
||||||
|
}*/
|
||||||
|
if (CollUtil.isNotEmpty(insert)) {
|
||||||
|
informationService.saveBatch(insert);
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(updateDate)) {
|
||||||
|
informationService.updateBatchById(updateDate);
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(deleteData)) {
|
||||||
|
informationMapper.deleteBatchLogic(deleteData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,62 @@
|
||||||
|
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.tcctlo.law.entity.CaseLawyer;
|
||||||
|
import com.tcctlo.law.mapper.CaseLawyerMapper;
|
||||||
|
import com.tcctlo.law.service.ICaseLawyerService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 案件律师表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 张世琪
|
||||||
|
* @since 2025-02-06
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CaseLawyerServiceImpl extends ServiceImpl<CaseLawyerMapper,CaseLawyer> implements ICaseLawyerService {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CaseLawyerMapper caseLawyerMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<CaseLawyer> list(Integer pageNo, Integer pageSize) {
|
||||||
|
return caseLawyerMapper.selectPage(new Page<>(pageNo, pageSize), new QueryWrapper<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CaseLawyer getById(Long id) {
|
||||||
|
CaseLawyer caseLawyer = caseLawyerMapper.selectById(id);
|
||||||
|
return caseLawyer;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer create(CaseLawyer caseLawyer) {
|
||||||
|
return caseLawyerMapper.insert(caseLawyer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer delete(Long id) {
|
||||||
|
return caseLawyerMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer update(CaseLawyer caseLawyer) {
|
||||||
|
return caseLawyerMapper.updateById(caseLawyer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CaseLawyer> selectByCondition(Map params) {
|
||||||
|
return caseLawyerMapper.selectByMap(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,55 @@
|
||||||
|
package com.tcctlo.law.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.tcctlo.law.entity.CollectionRecord;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.tcctlo.law.mapper.CollectionRecordMapper;
|
||||||
|
import com.tcctlo.law.service.ICollectionRecordService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 收款记录表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 张世琪
|
||||||
|
* @since 2025-02-06
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CollectionRecordServiceImpl extends ServiceImpl<CollectionRecordMapper,CollectionRecord> implements ICollectionRecordService {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CollectionRecordMapper collectionRecordMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<CollectionRecord> list(Integer pageNo, Integer pageSize) {
|
||||||
|
return collectionRecordMapper.selectPage(new Page<>(pageNo, pageSize), new QueryWrapper<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CollectionRecord getById(Long id) {
|
||||||
|
CollectionRecord collectionRecord = collectionRecordMapper.selectById(id);
|
||||||
|
return collectionRecord;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer create(CollectionRecord collectionRecord) {
|
||||||
|
return collectionRecordMapper.insert(collectionRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer delete(Long id) {
|
||||||
|
return collectionRecordMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer update(CollectionRecord collectionRecord) {
|
||||||
|
return collectionRecordMapper.updateById(collectionRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,55 @@
|
||||||
|
package com.tcctlo.law.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.tcctlo.law.entity.FileManager;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.tcctlo.law.mapper.FileManagerMapper;
|
||||||
|
import com.tcctlo.law.service.IFileManagerService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 文件管理 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 张世琪
|
||||||
|
* @since 2025-02-06
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class FileManagerServiceImpl extends ServiceImpl<FileManagerMapper,FileManager> implements IFileManagerService {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private FileManagerMapper fileManagerMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<FileManager> list(Integer pageNo, Integer pageSize) {
|
||||||
|
return fileManagerMapper.selectPage(new Page<>(pageNo, pageSize), new QueryWrapper<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FileManager getById(Long id) {
|
||||||
|
FileManager fileManager = fileManagerMapper.selectById(id);
|
||||||
|
return fileManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer create(FileManager fileManager) {
|
||||||
|
return fileManagerMapper.insert(fileManager);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer delete(Long id) {
|
||||||
|
return fileManagerMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer update(FileManager fileManager) {
|
||||||
|
return fileManagerMapper.updateById(fileManager);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,86 @@
|
||||||
|
package com.tcctlo.law.service.impl;
|
||||||
|
|
||||||
|
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.ImpulseInformation;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.tcctlo.law.mapper.ImpulseInformationMapper;
|
||||||
|
import com.tcctlo.law.service.IImpulseInformationService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 利冲信息表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 张世琪
|
||||||
|
* @since 2025-02-06
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ImpulseInformationServiceImpl extends ServiceImpl<ImpulseInformationMapper, ImpulseInformation> implements IImpulseInformationService {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ImpulseInformationMapper impulseInformationMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<ImpulseInformation> list(Integer pageNo, Integer pageSize) {
|
||||||
|
return impulseInformationMapper.selectPage(new Page<>(pageNo, pageSize), new QueryWrapper<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ImpulseInformation> selectLikeByParam(String caseName, Integer isClient) {
|
||||||
|
LambdaQueryWrapper<ImpulseInformation> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.like(StringUtils.isNotNull(caseName), ImpulseInformation::getCaseName, caseName)
|
||||||
|
.eq(StringUtils.isNotNull(isClient), ImpulseInformation::getIsClient, isClient)
|
||||||
|
.eq(ImpulseInformation::getDelFlag, 0)
|
||||||
|
.eq(ImpulseInformation::getStatus, 0)
|
||||||
|
.orderByDesc(ImpulseInformation::getCreateTime);
|
||||||
|
return impulseInformationMapper.selectList(wrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean retrievalConflict(ImpulseInformation impulseInformation) {
|
||||||
|
/**
|
||||||
|
* 当 impulseInformation.getIsClient() 的值为 0 时,1 - 0 结果为 1;当 impulseInformation.getIsClient() 的值为 1 时,1 - 1 结果为 0
|
||||||
|
* 注意:
|
||||||
|
* 1、如果是【委托方】就去检索【相对方】中有没有
|
||||||
|
* 2、如果是【相对方】就去检索【委托方】中有没有
|
||||||
|
* 3、【委托方】不能是律所中任何一个案件的被告方====【被告方】不能是律所中任何一个案件的【委托方】
|
||||||
|
*/
|
||||||
|
impulseInformation.setIsClient(1 - impulseInformation.getIsClient());
|
||||||
|
List<ImpulseInformation> resList = impulseInformationMapper.retrievalConflict(impulseInformation);
|
||||||
|
return resList.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ImpulseInformation getById(Long id) {
|
||||||
|
ImpulseInformation impulseInformation = impulseInformationMapper.selectById(id);
|
||||||
|
return impulseInformation;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer create(ImpulseInformation impulseInformation) {
|
||||||
|
return impulseInformationMapper.insert(impulseInformation);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer delete(Long id) {
|
||||||
|
return impulseInformationMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer update(ImpulseInformation impulseInformation) {
|
||||||
|
return impulseInformationMapper.updateById(impulseInformation);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.tcctlo.law.tools;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class GenerateCaseNo {
|
||||||
|
public String generateCaseNo() {
|
||||||
|
// 获取当前日期和时间(精确到秒)
|
||||||
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||||
|
String currentDateTime = dateFormat.format(new Date());
|
||||||
|
|
||||||
|
// 生成4位随机数
|
||||||
|
String strRandom = IdUtil.fastSimpleUUID();
|
||||||
|
|
||||||
|
// 组合成订单编号
|
||||||
|
return currentDateTime + "-" + strRandom;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
package com.tcctlo.law.vo;
|
||||||
|
|
||||||
|
import com.tcctlo.law.entity.*;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户案件录入时的VO
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class CaseInformationEnterVO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件信息
|
||||||
|
*/
|
||||||
|
private CaseInformation caseInformation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 利冲信息-委托方信息
|
||||||
|
*/
|
||||||
|
private List<ImpulseInformation> entrustingParty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 利冲信息-相对方
|
||||||
|
*/
|
||||||
|
private List<ImpulseInformation> opposite;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理律师
|
||||||
|
*/
|
||||||
|
private CaseLawyer attorneyAgent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 协办律师
|
||||||
|
*/
|
||||||
|
private List<CaseLawyer> assistingLawyer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件收款记录信息
|
||||||
|
*/
|
||||||
|
private List<CollectionRecordEnterVO> collectionRecordList;
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.tcctlo.law.vo;
|
||||||
|
|
||||||
|
import com.tcctlo.law.entity.CaseInformation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件列表VO
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class CaseInformationListVO extends CaseInformation {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 委托方
|
||||||
|
*/
|
||||||
|
private String entrustingParty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相对方
|
||||||
|
*/
|
||||||
|
private String opposite;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理律师
|
||||||
|
*/
|
||||||
|
private String attorneyAgent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 协办律师
|
||||||
|
*/
|
||||||
|
private String assistingLawyer;
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.tcctlo.law.vo;
|
||||||
|
|
||||||
|
import com.tcctlo.law.entity.CollectionRecord;
|
||||||
|
import com.tcctlo.law.entity.FileManager;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class CollectionRecordEnterVO extends CollectionRecord {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件管理
|
||||||
|
*/
|
||||||
|
private List<FileManager> fileManager;
|
||||||
|
}
|
|
@ -0,0 +1,42 @@
|
||||||
|
<?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.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
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectByCondition" resultType="com.tcctlo.law.entity.CaseInformation">
|
||||||
|
select * from case_information
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectCondition" resultType="com.tcctlo.law.vo.CaseInformationListVO" parameterType="map">
|
||||||
|
select <include refid="baseColumn" /> from case_information ci
|
||||||
|
<where>
|
||||||
|
1 = 1
|
||||||
|
<if test="condition.caseName != null">
|
||||||
|
and ci.case_name like concat('%',#{condition.caseName},'%')
|
||||||
|
</if>
|
||||||
|
<if test="condition.businessType != null">
|
||||||
|
and ci.business_type = #{condition.businessType}
|
||||||
|
</if>
|
||||||
|
<if test="condition.entrustingParty != null">
|
||||||
|
and find_in_set(#{condition.entrustingParty},ci.impulse_information_ids)
|
||||||
|
</if>
|
||||||
|
<if test="condition.opposite != null">
|
||||||
|
and find_in_set(#{condition.opposite},ci.impulse_information_ids)
|
||||||
|
</if>
|
||||||
|
<if test="condition.lawyerId != null">
|
||||||
|
and find_in_set(#{condition.lawyerId},ci.case_lawyer_ids)
|
||||||
|
</if>
|
||||||
|
<if test="condition.userId != null">
|
||||||
|
and find_in_set(#{condition.userId},ci.case_lawyer_ids)
|
||||||
|
</if>
|
||||||
|
and ci.status = 0 and ci.del_flag = 0
|
||||||
|
order by ci.create_time desc
|
||||||
|
</where>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,58 @@
|
||||||
|
<?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.CaseLawyerMapper">
|
||||||
|
|
||||||
|
<insert id="insertBatch">
|
||||||
|
INSERT INTO case_lawyer (case_id, lawyer_id, lawyer_name, lawyer_type, is_prime)
|
||||||
|
VALUES
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(#{item.caseId}, #{item.lawyerId}, #{item.lawyerName}, #{item.lawyerType},#{item.isPrime})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
<update id="updateByIds">
|
||||||
|
update case_lawyer cl
|
||||||
|
set cl.is_prime = 1
|
||||||
|
where id in
|
||||||
|
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</update>
|
||||||
|
<select id="selectAttorneyAgentLawByCaseId" resultType="com.tcctlo.law.entity.CaseLawyer">
|
||||||
|
select * from case_lawyer cl
|
||||||
|
<where>
|
||||||
|
1 = 1
|
||||||
|
<if test="caseId != null">
|
||||||
|
and cl.case_id = #{caseId}
|
||||||
|
</if>
|
||||||
|
and cl.lawyer_type = 0
|
||||||
|
and cl.is_prime = 0
|
||||||
|
and cl.status = 0
|
||||||
|
and cl.del_flag = 0
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="selectAssistingLawyerByCaseId" resultType="com.tcctlo.law.entity.CaseLawyer">
|
||||||
|
select * from case_lawyer cl
|
||||||
|
<where>
|
||||||
|
1 = 1
|
||||||
|
<if test="caseId != null">
|
||||||
|
and cl.case_id = #{caseId}
|
||||||
|
</if>
|
||||||
|
and cl.lawyer_type = 1
|
||||||
|
and cl.is_prime = 0
|
||||||
|
and cl.status = 0
|
||||||
|
and cl.del_flag = 0
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="selectAllPrimeLawyerByCaseId" resultType="com.tcctlo.law.entity.CaseLawyer">
|
||||||
|
select * from case_lawyer cl
|
||||||
|
<where>
|
||||||
|
1 = 1
|
||||||
|
<if test="caseId != null">
|
||||||
|
and cl.case_id = #{caseId}
|
||||||
|
</if>
|
||||||
|
and cl.is_prime = 0
|
||||||
|
and cl.status = 0
|
||||||
|
and cl.del_flag = 0
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?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.CollectionRecordMapper">
|
||||||
|
|
||||||
|
<sql id="baseColumn">
|
||||||
|
cr.id id,
|
||||||
|
cr.case_id caseId,
|
||||||
|
cr.collection_type collectionType,
|
||||||
|
cr.amount_received amountReceived,
|
||||||
|
cr.collection_url_id collectionUrlId,
|
||||||
|
cr.status status,
|
||||||
|
cr.del_flag delFlag,
|
||||||
|
cr.create_by createBy,
|
||||||
|
cr.create_time createTime,
|
||||||
|
cr.update_by updateBy,
|
||||||
|
cr.update_time updateTime,
|
||||||
|
cr.remake remake
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectByCaseId" resultType="com.tcctlo.law.vo.CollectionRecordEnterVO">
|
||||||
|
select <include refid="baseColumn"/> from collection_record cr
|
||||||
|
<where>
|
||||||
|
1 = 1
|
||||||
|
<if test="caseId != null">
|
||||||
|
and cr.case_id = #{caseId}
|
||||||
|
</if>
|
||||||
|
and cr.del_flag = 0
|
||||||
|
and cr.status = 0
|
||||||
|
order by cr.create_time asc
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?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.FileManagerMapper">
|
||||||
|
|
||||||
|
<insert id="insertBatch">
|
||||||
|
INSERT INTO file_manager (case_id, new_file_name, old_file_name, file_url)
|
||||||
|
VALUES
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(#{item.caseId}, #{item.newFileName}, #{item.oldFileName}, #{item.fileurl})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
<select id="selectByCaseIdAndFileId" resultType="com.tcctlo.law.entity.FileManager">
|
||||||
|
select * from file_manager fm
|
||||||
|
<where>
|
||||||
|
1 = 1
|
||||||
|
<if test="caseId != null">
|
||||||
|
and fm.case_id = #{caseId}
|
||||||
|
</if>
|
||||||
|
<if test="fileId != null">
|
||||||
|
and fm.id = #{fileId}
|
||||||
|
</if>
|
||||||
|
and fm.status = 0
|
||||||
|
and fm.del_flag = 0
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,76 @@
|
||||||
|
<?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.ImpulseInformationMapper">
|
||||||
|
|
||||||
|
<insert id="insertBatch">
|
||||||
|
INSERT INTO impulse_information (case_id, case_name, case_no, case_address, case_phone, case_email, case_type, is_client, check_flag)
|
||||||
|
VALUES
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(#{item.caseId}, #{item.caseName}, #{item.caseNo}, #{item.caseAddress}, #{item.casePhone},#{item.caseEmail},#{item.caseType},#{item.isClient},#{item.checkFlag})
|
||||||
|
</foreach>
|
||||||
|
|
||||||
|
</insert>
|
||||||
|
<update id="deleteBatchLogic">
|
||||||
|
update impulse_information ii
|
||||||
|
set ii.del_flag = 1,
|
||||||
|
ii.update_time = now()
|
||||||
|
where ii.id in
|
||||||
|
<foreach collection="list" item="item" open="(" close=")" separator=",">
|
||||||
|
#{item.id}
|
||||||
|
</foreach>
|
||||||
|
</update>
|
||||||
|
<select id="selectByCaseId" resultType="com.tcctlo.law.entity.ImpulseInformation">
|
||||||
|
select * from impulse_information ii
|
||||||
|
<where>
|
||||||
|
1 = 1
|
||||||
|
<if test="caseId != null">
|
||||||
|
and ii.case_id = #{caseId}
|
||||||
|
</if>
|
||||||
|
<if test="clientFlag != null">
|
||||||
|
and ii.is_client = #{clientFlag}
|
||||||
|
</if>
|
||||||
|
and ii.del_flag = 0
|
||||||
|
and ii.status = 0
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="selectByCaseIdAdnDelFlag" resultType="com.tcctlo.law.entity.ImpulseInformation">
|
||||||
|
select * from impulse_information ii
|
||||||
|
<where>
|
||||||
|
1 = 1
|
||||||
|
<if test="caseId != null">
|
||||||
|
and ii.case_id = #{caseId}
|
||||||
|
</if>
|
||||||
|
and ii.del_flag = 0
|
||||||
|
and ii.status = 0
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="retrievalConflict" resultType="com.tcctlo.law.entity.ImpulseInformation">
|
||||||
|
select * from impulse_information ii
|
||||||
|
<trim prefix="where" prefixOverrides="and | or">
|
||||||
|
<if test="info.caseName != null and info.caseName != ''">
|
||||||
|
ii.case_name = #{info.caseName}
|
||||||
|
</if>
|
||||||
|
<if test="info.caseNo != null and info.caseNo != ''">
|
||||||
|
and ii.case_no = #{info.caseNo}
|
||||||
|
</if>
|
||||||
|
<if test="info.caseAddress != null and info.caseAddress != ''">
|
||||||
|
and ii.case_address = #{info.caseAddress}
|
||||||
|
</if>
|
||||||
|
<if test="info.casePhone != null and info.casePhone != ''">
|
||||||
|
and ii.case_phone = #{info.casePhone}
|
||||||
|
</if>
|
||||||
|
<if test="info.caseEmail != null and info.caseEmail != ''">
|
||||||
|
and ii.case_email = #{info.caseEmail}
|
||||||
|
</if>
|
||||||
|
<if test="info.isClient != null and info.isClient != ''">
|
||||||
|
and ii.is_client = #{info.isClient}
|
||||||
|
</if>
|
||||||
|
and ii.check_flag = 1
|
||||||
|
and ii.del_flag = 0
|
||||||
|
and ii.status = 0
|
||||||
|
</trim>
|
||||||
|
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -0,0 +1,28 @@
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -23,6 +23,22 @@
|
||||||
<artifactId>tcctlo-common</artifactId>
|
<artifactId>tcctlo-common</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.junit.jupiter</groupId>
|
||||||
|
<artifactId>junit-jupiter</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.tcctlo.system.handler;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.baomidou.mybatisplus.extension.handlers.AbstractJsonTypeHandler;
|
||||||
|
import org.apache.ibatis.type.JdbcType;
|
||||||
|
import org.apache.ibatis.type.MappedJdbcTypes;
|
||||||
|
import org.apache.ibatis.type.MappedTypes;
|
||||||
|
|
||||||
|
@MappedJdbcTypes(JdbcType.VARCHAR)
|
||||||
|
@MappedTypes(Object.class)
|
||||||
|
public class JsonTypeHandler extends AbstractJsonTypeHandler<Object> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Object parse(String json) {
|
||||||
|
return JSON.parse(json);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String toJson(Object obj) {
|
||||||
|
return JSON.toJSONString(obj);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,9 @@
|
||||||
package com.tcctlo.system.mapper;
|
package com.tcctlo.system.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.tcctlo.common.core.domain.LawUserVO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import com.tcctlo.common.core.domain.entity.SysUser;
|
import com.tcctlo.common.core.domain.entity.SysUser;
|
||||||
|
|
||||||
|
@ -19,6 +22,13 @@ public interface SysUserMapper
|
||||||
*/
|
*/
|
||||||
public List<SysUser> selectUserList(SysUser sysUser);
|
public List<SysUser> selectUserList(SysUser sysUser);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户id查询用户角色信息【角色key】
|
||||||
|
* @param userId 用户id
|
||||||
|
* @return 结果集
|
||||||
|
*/
|
||||||
|
public String selectUserRoleByUserId(@Param("userId") Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据条件分页查询已配用户角色列表
|
* 根据条件分页查询已配用户角色列表
|
||||||
*
|
*
|
||||||
|
@ -124,4 +134,17 @@ public interface SysUserMapper
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public SysUser checkEmailUnique(String email);
|
public SysUser checkEmailUnique(String email);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取律师信息
|
||||||
|
* @return 律师信息
|
||||||
|
*/
|
||||||
|
List<LawUserVO> getLawUser();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据条件分页查询未分配用户角色列表
|
||||||
|
* @param params 查询条件
|
||||||
|
* @return 结果集
|
||||||
|
*/
|
||||||
|
List<LawUserVO> getUserByRole(@Param("lawName") String lawName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
package com.tcctlo.system.service;
|
package com.tcctlo.system.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.tcctlo.common.core.domain.LawUserVO;
|
||||||
import com.tcctlo.common.core.domain.entity.SysUser;
|
import com.tcctlo.common.core.domain.entity.SysUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -203,4 +206,18 @@ public interface ISysUserService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
|
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取律师信息
|
||||||
|
* @return 律师信息
|
||||||
|
*/
|
||||||
|
List<LawUserVO> getLawUser();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据角色名称获取用户信息【主要用来在案件查询时,查询代理律师作为查询条件】
|
||||||
|
* @param lawName 查询条件
|
||||||
|
* @return 结果集
|
||||||
|
*/
|
||||||
|
List<LawUserVO> getUserByRole(String lawName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
package com.tcctlo.system.service.impl;
|
package com.tcctlo.system.service.impl;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import javax.validation.Validator;
|
import javax.validation.Validator;
|
||||||
|
|
||||||
|
import com.tcctlo.common.core.domain.LawUserVO;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -37,8 +41,7 @@ import com.tcctlo.system.service.ISysUserService;
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysUserServiceImpl implements ISysUserService
|
public class SysUserServiceImpl implements ISysUserService {
|
||||||
{
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
|
private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -65,6 +68,9 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
@Autowired
|
@Autowired
|
||||||
protected Validator validator;
|
protected Validator validator;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysUserMapper sysUserMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据条件分页查询用户列表
|
* 根据条件分页查询用户列表
|
||||||
*
|
*
|
||||||
|
@ -73,8 +79,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@DataScope(deptAlias = "d", userAlias = "u")
|
@DataScope(deptAlias = "d", userAlias = "u")
|
||||||
public List<SysUser> selectUserList(SysUser user)
|
public List<SysUser> selectUserList(SysUser user) {
|
||||||
{
|
|
||||||
return userMapper.selectUserList(user);
|
return userMapper.selectUserList(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,8 +91,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@DataScope(deptAlias = "d", userAlias = "u")
|
@DataScope(deptAlias = "d", userAlias = "u")
|
||||||
public List<SysUser> selectAllocatedList(SysUser user)
|
public List<SysUser> selectAllocatedList(SysUser user) {
|
||||||
{
|
|
||||||
return userMapper.selectAllocatedList(user);
|
return userMapper.selectAllocatedList(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,8 +103,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@DataScope(deptAlias = "d", userAlias = "u")
|
@DataScope(deptAlias = "d", userAlias = "u")
|
||||||
public List<SysUser> selectUnallocatedList(SysUser user)
|
public List<SysUser> selectUnallocatedList(SysUser user) {
|
||||||
{
|
|
||||||
return userMapper.selectUnallocatedList(user);
|
return userMapper.selectUnallocatedList(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,8 +114,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
* @return 用户对象信息
|
* @return 用户对象信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SysUser selectUserByUserName(String userName)
|
public SysUser selectUserByUserName(String userName) {
|
||||||
{
|
|
||||||
return userMapper.selectUserByUserName(userName);
|
return userMapper.selectUserByUserName(userName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,8 +125,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
* @return 用户对象信息
|
* @return 用户对象信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SysUser selectUserById(Long userId)
|
public SysUser selectUserById(Long userId) {
|
||||||
{
|
|
||||||
return userMapper.selectUserById(userId);
|
return userMapper.selectUserById(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,11 +136,9 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String selectUserRoleGroup(String userName)
|
public String selectUserRoleGroup(String userName) {
|
||||||
{
|
|
||||||
List<SysRole> list = roleMapper.selectRolesByUserName(userName);
|
List<SysRole> list = roleMapper.selectRolesByUserName(userName);
|
||||||
if (CollectionUtils.isEmpty(list))
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
{
|
|
||||||
return StringUtils.EMPTY;
|
return StringUtils.EMPTY;
|
||||||
}
|
}
|
||||||
return list.stream().map(SysRole::getRoleName).collect(Collectors.joining(","));
|
return list.stream().map(SysRole::getRoleName).collect(Collectors.joining(","));
|
||||||
|
@ -152,11 +151,9 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String selectUserPostGroup(String userName)
|
public String selectUserPostGroup(String userName) {
|
||||||
{
|
|
||||||
List<SysPost> list = postMapper.selectPostsByUserName(userName);
|
List<SysPost> list = postMapper.selectPostsByUserName(userName);
|
||||||
if (CollectionUtils.isEmpty(list))
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
{
|
|
||||||
return StringUtils.EMPTY;
|
return StringUtils.EMPTY;
|
||||||
}
|
}
|
||||||
return list.stream().map(SysPost::getPostName).collect(Collectors.joining(","));
|
return list.stream().map(SysPost::getPostName).collect(Collectors.joining(","));
|
||||||
|
@ -169,12 +166,10 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean checkUserNameUnique(SysUser user)
|
public boolean checkUserNameUnique(SysUser user) {
|
||||||
{
|
|
||||||
Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
|
Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
|
||||||
SysUser info = userMapper.checkUserNameUnique(user.getUserName());
|
SysUser info = userMapper.checkUserNameUnique(user.getUserName());
|
||||||
if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
|
if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
|
||||||
{
|
|
||||||
return UserConstants.NOT_UNIQUE;
|
return UserConstants.NOT_UNIQUE;
|
||||||
}
|
}
|
||||||
return UserConstants.UNIQUE;
|
return UserConstants.UNIQUE;
|
||||||
|
@ -187,12 +182,10 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean checkPhoneUnique(SysUser user)
|
public boolean checkPhoneUnique(SysUser user) {
|
||||||
{
|
|
||||||
Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
|
Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
|
||||||
SysUser info = userMapper.checkPhoneUnique(user.getPhonenumber());
|
SysUser info = userMapper.checkPhoneUnique(user.getPhonenumber());
|
||||||
if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
|
if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
|
||||||
{
|
|
||||||
return UserConstants.NOT_UNIQUE;
|
return UserConstants.NOT_UNIQUE;
|
||||||
}
|
}
|
||||||
return UserConstants.UNIQUE;
|
return UserConstants.UNIQUE;
|
||||||
|
@ -205,12 +198,10 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEmailUnique(SysUser user)
|
public boolean checkEmailUnique(SysUser user) {
|
||||||
{
|
|
||||||
Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
|
Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
|
||||||
SysUser info = userMapper.checkEmailUnique(user.getEmail());
|
SysUser info = userMapper.checkEmailUnique(user.getEmail());
|
||||||
if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
|
if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
|
||||||
{
|
|
||||||
return UserConstants.NOT_UNIQUE;
|
return UserConstants.NOT_UNIQUE;
|
||||||
}
|
}
|
||||||
return UserConstants.UNIQUE;
|
return UserConstants.UNIQUE;
|
||||||
|
@ -222,10 +213,8 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void checkUserAllowed(SysUser user)
|
public void checkUserAllowed(SysUser user) {
|
||||||
{
|
if (StringUtils.isNotNull(user.getUserId()) && user.isAdmin()) {
|
||||||
if (StringUtils.isNotNull(user.getUserId()) && user.isAdmin())
|
|
||||||
{
|
|
||||||
throw new ServiceException("不允许操作超级管理员用户");
|
throw new ServiceException("不允许操作超级管理员用户");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -236,15 +225,12 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
* @param userId 用户id
|
* @param userId 用户id
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void checkUserDataScope(Long userId)
|
public void checkUserDataScope(Long userId) {
|
||||||
{
|
if (!SysUser.isAdmin(SecurityUtils.getUserId())) {
|
||||||
if (!SysUser.isAdmin(SecurityUtils.getUserId()))
|
|
||||||
{
|
|
||||||
SysUser user = new SysUser();
|
SysUser user = new SysUser();
|
||||||
user.setUserId(userId);
|
user.setUserId(userId);
|
||||||
List<SysUser> users = SpringUtils.getAopProxy(this).selectUserList(user);
|
List<SysUser> users = SpringUtils.getAopProxy(this).selectUserList(user);
|
||||||
if (StringUtils.isEmpty(users))
|
if (StringUtils.isEmpty(users)) {
|
||||||
{
|
|
||||||
throw new ServiceException("没有权限访问用户数据!");
|
throw new ServiceException("没有权限访问用户数据!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -258,8 +244,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public int insertUser(SysUser user)
|
public int insertUser(SysUser user) {
|
||||||
{
|
|
||||||
// 新增用户信息
|
// 新增用户信息
|
||||||
int rows = userMapper.insertUser(user);
|
int rows = userMapper.insertUser(user);
|
||||||
// 新增用户岗位关联
|
// 新增用户岗位关联
|
||||||
|
@ -276,8 +261,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean registerUser(SysUser user)
|
public boolean registerUser(SysUser user) {
|
||||||
{
|
|
||||||
return userMapper.insertUser(user) > 0;
|
return userMapper.insertUser(user) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -289,8 +273,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public int updateUser(SysUser user)
|
public int updateUser(SysUser user) {
|
||||||
{
|
|
||||||
Long userId = user.getUserId();
|
Long userId = user.getUserId();
|
||||||
// 删除用户与角色关联
|
// 删除用户与角色关联
|
||||||
userRoleMapper.deleteUserRoleByUserId(userId);
|
userRoleMapper.deleteUserRoleByUserId(userId);
|
||||||
|
@ -311,8 +294,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void insertUserAuth(Long userId, Long[] roleIds)
|
public void insertUserAuth(Long userId, Long[] roleIds) {
|
||||||
{
|
|
||||||
userRoleMapper.deleteUserRoleByUserId(userId);
|
userRoleMapper.deleteUserRoleByUserId(userId);
|
||||||
insertUserRole(userId, roleIds);
|
insertUserRole(userId, roleIds);
|
||||||
}
|
}
|
||||||
|
@ -324,8 +306,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateUserStatus(SysUser user)
|
public int updateUserStatus(SysUser user) {
|
||||||
{
|
|
||||||
return userMapper.updateUser(user);
|
return userMapper.updateUser(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -336,8 +317,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateUserProfile(SysUser user)
|
public int updateUserProfile(SysUser user) {
|
||||||
{
|
|
||||||
return userMapper.updateUser(user);
|
return userMapper.updateUser(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -349,8 +329,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean updateUserAvatar(String userName, String avatar)
|
public boolean updateUserAvatar(String userName, String avatar) {
|
||||||
{
|
|
||||||
return userMapper.updateUserAvatar(userName, avatar) > 0;
|
return userMapper.updateUserAvatar(userName, avatar) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -361,8 +340,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int resetPwd(SysUser user)
|
public int resetPwd(SysUser user) {
|
||||||
{
|
|
||||||
return userMapper.updateUser(user);
|
return userMapper.updateUser(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -374,8 +352,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int resetUserPwd(String userName, String password)
|
public int resetUserPwd(String userName, String password) {
|
||||||
{
|
|
||||||
return userMapper.resetUserPwd(userName, password);
|
return userMapper.resetUserPwd(userName, password);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -384,8 +361,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
*
|
*
|
||||||
* @param user 用户对象
|
* @param user 用户对象
|
||||||
*/
|
*/
|
||||||
public void insertUserRole(SysUser user)
|
public void insertUserRole(SysUser user) {
|
||||||
{
|
|
||||||
this.insertUserRole(user.getUserId(), user.getRoleIds());
|
this.insertUserRole(user.getUserId(), user.getRoleIds());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -394,15 +370,12 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
*
|
*
|
||||||
* @param user 用户对象
|
* @param user 用户对象
|
||||||
*/
|
*/
|
||||||
public void insertUserPost(SysUser user)
|
public void insertUserPost(SysUser user) {
|
||||||
{
|
|
||||||
Long[] posts = user.getPostIds();
|
Long[] posts = user.getPostIds();
|
||||||
if (StringUtils.isNotEmpty(posts))
|
if (StringUtils.isNotEmpty(posts)) {
|
||||||
{
|
|
||||||
// 新增用户与岗位管理
|
// 新增用户与岗位管理
|
||||||
List<SysUserPost> list = new ArrayList<SysUserPost>(posts.length);
|
List<SysUserPost> list = new ArrayList<SysUserPost>(posts.length);
|
||||||
for (Long postId : posts)
|
for (Long postId : posts) {
|
||||||
{
|
|
||||||
SysUserPost up = new SysUserPost();
|
SysUserPost up = new SysUserPost();
|
||||||
up.setUserId(user.getUserId());
|
up.setUserId(user.getUserId());
|
||||||
up.setPostId(postId);
|
up.setPostId(postId);
|
||||||
|
@ -418,14 +391,11 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @param roleIds 角色组
|
* @param roleIds 角色组
|
||||||
*/
|
*/
|
||||||
public void insertUserRole(Long userId, Long[] roleIds)
|
public void insertUserRole(Long userId, Long[] roleIds) {
|
||||||
{
|
if (StringUtils.isNotEmpty(roleIds)) {
|
||||||
if (StringUtils.isNotEmpty(roleIds))
|
|
||||||
{
|
|
||||||
// 新增用户与角色管理
|
// 新增用户与角色管理
|
||||||
List<SysUserRole> list = new ArrayList<SysUserRole>(roleIds.length);
|
List<SysUserRole> list = new ArrayList<SysUserRole>(roleIds.length);
|
||||||
for (Long roleId : roleIds)
|
for (Long roleId : roleIds) {
|
||||||
{
|
|
||||||
SysUserRole ur = new SysUserRole();
|
SysUserRole ur = new SysUserRole();
|
||||||
ur.setUserId(userId);
|
ur.setUserId(userId);
|
||||||
ur.setRoleId(roleId);
|
ur.setRoleId(roleId);
|
||||||
|
@ -443,8 +413,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public int deleteUserById(Long userId)
|
public int deleteUserById(Long userId) {
|
||||||
{
|
|
||||||
// 删除用户与角色关联
|
// 删除用户与角色关联
|
||||||
userRoleMapper.deleteUserRoleByUserId(userId);
|
userRoleMapper.deleteUserRoleByUserId(userId);
|
||||||
// 删除用户与岗位表
|
// 删除用户与岗位表
|
||||||
|
@ -460,10 +429,8 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public int deleteUserByIds(Long[] userIds)
|
public int deleteUserByIds(Long[] userIds) {
|
||||||
{
|
for (Long userId : userIds) {
|
||||||
for (Long userId : userIds)
|
|
||||||
{
|
|
||||||
checkUserAllowed(new SysUser(userId));
|
checkUserAllowed(new SysUser(userId));
|
||||||
checkUserDataScope(userId);
|
checkUserDataScope(userId);
|
||||||
}
|
}
|
||||||
|
@ -483,24 +450,19 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName)
|
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName) {
|
||||||
{
|
if (StringUtils.isNull(userList) || userList.size() == 0) {
|
||||||
if (StringUtils.isNull(userList) || userList.size() == 0)
|
|
||||||
{
|
|
||||||
throw new ServiceException("导入用户数据不能为空!");
|
throw new ServiceException("导入用户数据不能为空!");
|
||||||
}
|
}
|
||||||
int successNum = 0;
|
int successNum = 0;
|
||||||
int failureNum = 0;
|
int failureNum = 0;
|
||||||
StringBuilder successMsg = new StringBuilder();
|
StringBuilder successMsg = new StringBuilder();
|
||||||
StringBuilder failureMsg = new StringBuilder();
|
StringBuilder failureMsg = new StringBuilder();
|
||||||
for (SysUser user : userList)
|
for (SysUser user : userList) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
// 验证是否存在这个用户
|
// 验证是否存在这个用户
|
||||||
SysUser u = userMapper.selectUserByUserName(user.getUserName());
|
SysUser u = userMapper.selectUserByUserName(user.getUserName());
|
||||||
if (StringUtils.isNull(u))
|
if (StringUtils.isNull(u)) {
|
||||||
{
|
|
||||||
BeanValidators.validateWithException(validator, user);
|
BeanValidators.validateWithException(validator, user);
|
||||||
deptService.checkDeptDataScope(user.getDeptId());
|
deptService.checkDeptDataScope(user.getDeptId());
|
||||||
String password = configService.selectConfigByKey("sys.user.initPassword");
|
String password = configService.selectConfigByKey("sys.user.initPassword");
|
||||||
|
@ -509,9 +471,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
userMapper.insertUser(user);
|
userMapper.insertUser(user);
|
||||||
successNum++;
|
successNum++;
|
||||||
successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 导入成功");
|
successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 导入成功");
|
||||||
}
|
} else if (isUpdateSupport) {
|
||||||
else if (isUpdateSupport)
|
|
||||||
{
|
|
||||||
BeanValidators.validateWithException(validator, user);
|
BeanValidators.validateWithException(validator, user);
|
||||||
checkUserAllowed(u);
|
checkUserAllowed(u);
|
||||||
checkUserDataScope(u.getUserId());
|
checkUserDataScope(u.getUserId());
|
||||||
|
@ -521,30 +481,33 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
userMapper.updateUser(user);
|
userMapper.updateUser(user);
|
||||||
successNum++;
|
successNum++;
|
||||||
successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 更新成功");
|
successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 更新成功");
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
failureNum++;
|
failureNum++;
|
||||||
failureMsg.append("<br/>" + failureNum + "、账号 " + user.getUserName() + " 已存在");
|
failureMsg.append("<br/>" + failureNum + "、账号 " + user.getUserName() + " 已存在");
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
failureNum++;
|
failureNum++;
|
||||||
String msg = "<br/>" + failureNum + "、账号 " + user.getUserName() + " 导入失败:";
|
String msg = "<br/>" + failureNum + "、账号 " + user.getUserName() + " 导入失败:";
|
||||||
failureMsg.append(msg + e.getMessage());
|
failureMsg.append(msg + e.getMessage());
|
||||||
log.error(msg, e);
|
log.error(msg, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (failureNum > 0)
|
if (failureNum > 0) {
|
||||||
{
|
|
||||||
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
|
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
|
||||||
throw new ServiceException(failureMsg.toString());
|
throw new ServiceException(failureMsg.toString());
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
||||||
}
|
}
|
||||||
return successMsg.toString();
|
return successMsg.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<LawUserVO> getLawUser() {
|
||||||
|
return sysUserMapper.getLawUser();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<LawUserVO> getUserByRole(String lawName) {
|
||||||
|
return sysUserMapper.getUserByRole(lawName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,56 +1,83 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.tcctlo.system.mapper.SysUserMapper">
|
<mapper namespace="com.tcctlo.system.mapper.SysUserMapper">
|
||||||
|
|
||||||
<resultMap type="SysUser" id="SysUserResult">
|
<resultMap type="SysUser" id="SysUserResult">
|
||||||
<id property="userId" column="user_id" />
|
<id property="userId" column="user_id"/>
|
||||||
<result property="deptId" column="dept_id" />
|
<result property="deptId" column="dept_id"/>
|
||||||
<result property="userName" column="user_name" />
|
<result property="userName" column="user_name"/>
|
||||||
<result property="nickName" column="nick_name" />
|
<result property="nickName" column="nick_name"/>
|
||||||
<result property="email" column="email" />
|
<result property="email" column="email"/>
|
||||||
<result property="phonenumber" column="phonenumber" />
|
<result property="phonenumber" column="phonenumber"/>
|
||||||
<result property="sex" column="sex" />
|
<result property="idCardNo" column="id_card_no"/>
|
||||||
<result property="avatar" column="avatar" />
|
<result property="sex" column="sex"/>
|
||||||
<result property="password" column="password" />
|
<result property="avatar" column="avatar"/>
|
||||||
<result property="employedStatus" column="employed_status" />
|
<result property="password" column="password"/>
|
||||||
<result property="status" column="status" />
|
<result property="employedStatus" column="employed_status"/>
|
||||||
<result property="delFlag" column="del_flag" />
|
<result property="status" column="status"/>
|
||||||
<result property="loginIp" column="login_ip" />
|
<result property="delFlag" column="del_flag"/>
|
||||||
<result property="loginDate" column="login_date" />
|
<result property="loginIp" column="login_ip"/>
|
||||||
<result property="createBy" column="create_by" />
|
<result property="loginDate" column="login_date"/>
|
||||||
<result property="createTime" column="create_time" />
|
<result property="createBy" column="create_by"/>
|
||||||
<result property="updateBy" column="update_by" />
|
<result property="createTime" column="create_time"/>
|
||||||
<result property="updateTime" column="update_time" />
|
<result property="updateBy" column="update_by"/>
|
||||||
<result property="remark" column="remark" />
|
<result property="updateTime" column="update_time"/>
|
||||||
<association property="dept" javaType="SysDept" resultMap="deptResult" />
|
<result property="remark" column="remark"/>
|
||||||
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
|
<association property="dept" javaType="SysDept" resultMap="deptResult"/>
|
||||||
|
<collection property="roles" javaType="java.util.List" resultMap="RoleResult"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<resultMap id="deptResult" type="SysDept">
|
<resultMap id="deptResult" type="SysDept">
|
||||||
<id property="deptId" column="dept_id" />
|
<id property="deptId" column="dept_id"/>
|
||||||
<result property="parentId" column="parent_id" />
|
<result property="parentId" column="parent_id"/>
|
||||||
<result property="deptName" column="dept_name" />
|
<result property="deptName" column="dept_name"/>
|
||||||
<result property="ancestors" column="ancestors" />
|
<result property="ancestors" column="ancestors"/>
|
||||||
<result property="orderNum" column="order_num" />
|
<result property="orderNum" column="order_num"/>
|
||||||
<result property="leader" column="leader" />
|
<result property="leader" column="leader"/>
|
||||||
<result property="status" column="dept_status" />
|
<result property="status" column="dept_status"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<resultMap id="RoleResult" type="SysRole">
|
<resultMap id="RoleResult" type="SysRole">
|
||||||
<id property="roleId" column="role_id" />
|
<id property="roleId" column="role_id"/>
|
||||||
<result property="roleName" column="role_name" />
|
<result property="roleName" column="role_name"/>
|
||||||
<result property="roleKey" column="role_key" />
|
<result property="roleKey" column="role_key"/>
|
||||||
<result property="roleSort" column="role_sort" />
|
<result property="roleSort" column="role_sort"/>
|
||||||
<result property="dataScope" column="data_scope" />
|
<result property="dataScope" column="data_scope"/>
|
||||||
<result property="status" column="role_status" />
|
<result property="status" column="role_status"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectUserVo">
|
<sql id="selectUserVo">
|
||||||
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
select u.user_id,
|
||||||
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
|
u.dept_id,
|
||||||
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
|
u.user_name,
|
||||||
|
u.nick_name,
|
||||||
|
u.email,
|
||||||
|
u.avatar,
|
||||||
|
u.phonenumber,
|
||||||
|
u.password,
|
||||||
|
u.sex,
|
||||||
|
u.status,
|
||||||
|
u.del_flag,
|
||||||
|
u.login_ip,
|
||||||
|
u.login_date,
|
||||||
|
u.create_by,
|
||||||
|
u.create_time,
|
||||||
|
u.remark,
|
||||||
|
d.dept_id,
|
||||||
|
d.parent_id,
|
||||||
|
d.ancestors,
|
||||||
|
d.dept_name,
|
||||||
|
d.order_num,
|
||||||
|
d.leader,
|
||||||
|
d.status as dept_status,
|
||||||
|
r.role_id,
|
||||||
|
r.role_name,
|
||||||
|
r.role_key,
|
||||||
|
r.role_sort,
|
||||||
|
r.data_scope,
|
||||||
|
r.status as role_status
|
||||||
from sys_user u
|
from sys_user u
|
||||||
left join sys_dept d on u.dept_id = d.dept_id
|
left join sys_dept d on u.dept_id = d.dept_id
|
||||||
left join sys_user_role ur on u.user_id = ur.user_id
|
left join sys_user_role ur on u.user_id = ur.user_id
|
||||||
|
@ -58,7 +85,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
||||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.employed_status, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
|
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.id_card_no ,u.sex,
|
||||||
|
u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from
|
||||||
|
sys_user u
|
||||||
left join sys_dept d on u.dept_id = d.dept_id
|
left join sys_dept d on u.dept_id = d.dept_id
|
||||||
where u.del_flag = '0'
|
where u.del_flag = '0'
|
||||||
<if test="userId != null and userId != 0">
|
<if test="userId != null and userId != 0">
|
||||||
|
@ -80,7 +109,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
AND date_format(u.create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d')
|
AND date_format(u.create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d')
|
||||||
</if>
|
</if>
|
||||||
<if test="deptId != null and deptId != 0">
|
<if test="deptId != null and deptId != 0">
|
||||||
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
|
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId},
|
||||||
|
ancestors) ))
|
||||||
</if>
|
</if>
|
||||||
<!-- 数据范围过滤 -->
|
<!-- 数据范围过滤 -->
|
||||||
${params.dataScope}
|
${params.dataScope}
|
||||||
|
@ -110,7 +140,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
left join sys_user_role ur on u.user_id = ur.user_id
|
left join sys_user_role ur on u.user_id = ur.user_id
|
||||||
left join sys_role r on r.role_id = ur.role_id
|
left join sys_role r on r.role_id = ur.role_id
|
||||||
where u.del_flag = '0' and (r.role_id != #{roleId} or r.role_id IS NULL)
|
where u.del_flag = '0' and (r.role_id != #{roleId} or r.role_id IS NULL)
|
||||||
and u.user_id not in (select u.user_id from sys_user u inner join sys_user_role ur on u.user_id = ur.user_id and ur.role_id = #{roleId})
|
and u.user_id not in (select u.user_id from sys_user u inner join sys_user_role ur on u.user_id = ur.user_id and
|
||||||
|
ur.role_id = #{roleId})
|
||||||
<if test="userName != null and userName != ''">
|
<if test="userName != null and userName != ''">
|
||||||
AND u.user_name like concat('%', #{userName}, '%')
|
AND u.user_name like concat('%', #{userName}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
@ -132,15 +163,65 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult">
|
<select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult">
|
||||||
select user_id, user_name from sys_user where user_name = #{userName} and del_flag = '0' limit 1
|
select user_id, user_name
|
||||||
|
from sys_user
|
||||||
|
where user_name = #{userName}
|
||||||
|
and del_flag = '0' limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
|
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
|
||||||
select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and del_flag = '0' limit 1
|
select user_id, phonenumber
|
||||||
|
from sys_user
|
||||||
|
where phonenumber = #{phonenumber}
|
||||||
|
and del_flag = '0' limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
|
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
|
||||||
select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1
|
select user_id, email
|
||||||
|
from sys_user
|
||||||
|
where email = #{email}
|
||||||
|
and del_flag = '0' limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 获取律师信息 -->
|
||||||
|
<select id="getLawUser" resultType="com.tcctlo.common.core.domain.LawUserVO">
|
||||||
|
select su.user_id userId,
|
||||||
|
su.user_name userName,
|
||||||
|
su.nick_name nickName,
|
||||||
|
su.avatar avatar,
|
||||||
|
su.email email,
|
||||||
|
sr.role_id roleId,
|
||||||
|
sr.role_name roleName,
|
||||||
|
sr.role_key roleKey
|
||||||
|
from sys_user su
|
||||||
|
left join sys_user_role sur on su.user_id = sur.user_id
|
||||||
|
left join sys_role sr on sur.role_id = sr.role_id
|
||||||
|
where (sr.role_name = '律师' AND sr.role_key = 'LAWYER')
|
||||||
|
and sr.status = '0' and sr.del_flag = '0' and su.status = '0' and su.del_flag = '0'
|
||||||
|
</select>
|
||||||
|
<select id="selectUserRoleByUserId" resultType="java.lang.String">
|
||||||
|
select sr.role_key
|
||||||
|
from sys_user su
|
||||||
|
left join sys_user_role sur on su.user_id = sur.user_id
|
||||||
|
left join sys_role sr on sr.role_id = sur.role_id
|
||||||
|
<where>
|
||||||
|
1 = 1
|
||||||
|
<if test="userId != null">
|
||||||
|
and su.user_id = #{userId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="getUserByRole" resultType="com.tcctlo.common.core.domain.LawUserVO">
|
||||||
|
select su.user_id userId, su.user_name userName, su.nick_name nickName, su.avatar avatar, su.email email, sr.role_name roleName, sr.role_key roleKey from sys_user su
|
||||||
|
left join sys_user_role sur on su.user_id = sur.user_id
|
||||||
|
left join sys_role sr on sr.role_id = sur.role_id
|
||||||
|
<where>
|
||||||
|
1 = 1
|
||||||
|
and sr.role_name = '律师' and sr.role_key = 'LAWYER'
|
||||||
|
<if test="lawName != null and lawName != ''">
|
||||||
|
and su.nick_name like concat('%', #{lawName}, '%')
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
|
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
|
||||||
|
@ -197,19 +278,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<update id="updateUserStatus" parameterType="SysUser">
|
<update id="updateUserStatus" parameterType="SysUser">
|
||||||
update sys_user set status = #{status} where user_id = #{userId}
|
update sys_user
|
||||||
|
set status = #{status}
|
||||||
|
where user_id = #{userId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<update id="updateUserAvatar" parameterType="SysUser">
|
<update id="updateUserAvatar" parameterType="SysUser">
|
||||||
update sys_user set avatar = #{avatar} where user_name = #{userName}
|
update sys_user
|
||||||
|
set avatar = #{avatar}
|
||||||
|
where user_name = #{userName}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<update id="resetUserPwd" parameterType="SysUser">
|
<update id="resetUserPwd" parameterType="SysUser">
|
||||||
update sys_user set password = #{password} where user_name = #{userName}
|
update sys_user
|
||||||
|
set password = #{password}
|
||||||
|
where user_name = #{userName}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteUserById" parameterType="Long">
|
<delete id="deleteUserById" parameterType="Long">
|
||||||
update sys_user set del_flag = '2' where user_id = #{userId}
|
update sys_user
|
||||||
|
set del_flag = '2'
|
||||||
|
where user_id = #{userId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteUserByIds" parameterType="Long">
|
<delete id="deleteUserByIds" parameterType="Long">
|
||||||
|
|
Loading…
Reference in New Issue