修改代码,案件添加修改,收款记录展示等

This commit is contained in:
chuanxingchao 2025-05-15 18:06:03 +08:00
parent 3ac2f906c6
commit 8cb846c8b3
16 changed files with 519 additions and 57 deletions

View File

@ -2,6 +2,8 @@ package com.tcctlo.web.controller.system;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import com.tcctlo.common.utils.sign.RsaUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -46,12 +48,11 @@ public class SysLoginController
* @return 结果 * @return 结果
*/ */
@PostMapping("/login") @PostMapping("/login")
public AjaxResult login(@RequestBody LoginBody loginBody) public AjaxResult login(@RequestBody LoginBody loginBody) throws Exception {
{
AjaxResult ajax = AjaxResult.success(); AjaxResult ajax = AjaxResult.success();
// 生成令牌 // 生成令牌
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(), String token = loginService.login(loginBody.getUsername(),
loginBody.getUuid()); RsaUtils.decryptByPrivateKey(loginBody.getPassword()), loginBody.getCode(), loginBody.getUuid());
ajax.put(Constants.TOKEN, token); ajax.put(Constants.TOKEN, token);
return ajax; return ajax;
} }

View File

@ -0,0 +1,158 @@
package com.tcctlo.common.utils.sign;
import org.apache.commons.codec.binary.Base64;
import javax.crypto.Cipher;
import java.security.*;
import java.security.interfaces.RSAPrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
/**
* RSA加密解密
*
* @author ruoyi
**/
public class RsaUtils {
// Rsa 私钥
public static String privateKey = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAJw/GH72/RD1TgVmPWSwX1av/U33uRTDgieO7agb8mDTfM06IIGGQuEUEzybplvKm2E5rXP1Te+jJE6PC3EoPaGsJY3oU49VuqbMwxfBHXOIHQbi9z3Xcb3C5IQNO3qpUhhYt+Cg9r0EPxUwFVKd6Oo9WPVjAb46UnIHKjpyUWSrAgMBAAECgYB1nBzhPSNCh5OCBvKBfy1UgEaIUMa1NXEcO77ygo7QiYDwridXt+tRpx3Pyk3P3FNXPOYuWeCfWEr1A0GWnLa+dENTsiZSn2A0XaKawY11epeUGexNMhtLq7LAAuYVb3aMqrCt8w9+7qGGWEXoO+mt1nIouPeWF01N05eK2sokUQJBANl8BJrfDUD9bUfYfYoMrJoFVRhwYHPDriyv//HEexHE7eMd0ZXcFYYiPK9re9DucgRejzQtoJiET/xjJdoHdQMCQQC36sM21D522KhJ3F2iAMsfcu/NYQCHtSabaxhHINTQCdtfA/zEfTpFGrfaCi2kQeH6N5TrFttVGR6gxBbJzR05AkBK8RBJKalQhsN8aV5BDsL/Q+0hwb+KxJglL/SbI+BgrCJpC6Jn6HHGSc/thrUgtrm1RbxE96AKTjWdu7CUY9NvAkEAsX5Ph8qtveS6BQ43DvHVFjTGWV8UM+QPrk5cz8hPmbbpj3k5qCdy5N40MKlCAxPSErkxbvBQHIBxnpWfqIHbgQJALpxFA2CvfRMV1n0rvcxWL5iELB/MS+BNJqQuoOIr4N20T9eISucni56LOtGLq6RHazu69r5Ny/CoQ8KEAVLYiA==";
// Rsa 公钥
public static String publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCcPxh+9v0Q9U4FZj1ksF9Wr/1N97kUw4Inju2oG/Jg03zNOiCBhkLhFBM8m6ZbypthOa1z9U3voyROjwtxKD2hrCWN6FOPVbqmzMMXwR1ziB0G4vc913G9wuSEDTt6qVIYWLfgoPa9BD8VMBVSnejqPVj1YwG+OlJyByo6clFkqwIDAQAB";
/**
* 私钥解密
*
* @param text 待解密的文本
* @return 解密后的文本
*/
public static String decryptByPrivateKey(String text) throws Exception {
return decryptByPrivateKey(privateKey, text);
}
/**
* 公钥解密
*
* @param publicKeyString 公钥
* @param text 待解密的信息
* @return 解密后的文本
*/
public static String decryptByPublicKey(String publicKeyString, String text) throws Exception {
X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec(Base64.decodeBase64(publicKeyString));
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
PublicKey publicKey = keyFactory.generatePublic(x509EncodedKeySpec);
Cipher cipher = Cipher.getInstance("RSA");
cipher.init(Cipher.DECRYPT_MODE, publicKey);
byte[] result = cipher.doFinal(Base64.decodeBase64(text));
return new String(result);
}
/**
* 私钥加密
*
* @param privateKeyString 私钥
* @param text 待加密的信息
* @return 加密后的文本
*/
public static String encryptByPrivateKey(String privateKeyString, String text) throws Exception {
PKCS8EncodedKeySpec pkcs8EncodedKeySpec = new PKCS8EncodedKeySpec(Base64.decodeBase64(privateKeyString));
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
PrivateKey privateKey = keyFactory.generatePrivate(pkcs8EncodedKeySpec);
Cipher cipher = Cipher.getInstance("RSA");
cipher.init(Cipher.ENCRYPT_MODE, privateKey);
byte[] result = cipher.doFinal(text.getBytes());
return Base64.encodeBase64String(result);
}
/**
* 私钥解密
*
* @param privateKeyString 私钥
* @param text 待解密的文本
* @return 解密后的文本
*/
public static String decryptByPrivateKey(String privateKeyString, String text) throws Exception {
PKCS8EncodedKeySpec pkcs8EncodedKeySpec5 = new PKCS8EncodedKeySpec(Base64.decodeBase64(privateKeyString));
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
PrivateKey privateKey = keyFactory.generatePrivate(pkcs8EncodedKeySpec5);
Cipher cipher = Cipher.getInstance("RSA");
cipher.init(Cipher.DECRYPT_MODE, privateKey);
byte[] result = cipher.doFinal(Base64.decodeBase64(text));
return new String(result);
}
/**
* 公钥加密
*
* @param publicKeyString 公钥
* @param text 待加密的文本
* @return 加密后的文本
*/
public static String encryptByPublicKey(String publicKeyString, String text) throws Exception {
X509EncodedKeySpec x509EncodedKeySpec2 = new X509EncodedKeySpec(Base64.decodeBase64(publicKeyString));
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
PublicKey publicKey = keyFactory.generatePublic(x509EncodedKeySpec2);
Cipher cipher = Cipher.getInstance("RSA");
cipher.init(Cipher.ENCRYPT_MODE, publicKey);
byte[] result = cipher.doFinal(text.getBytes());
return Base64.encodeBase64String(result);
}
/**
* 构建RSA密钥对
*
* @return 生成后的公私钥信息
*/
public static RsaKeyPair generateKeyPair() throws NoSuchAlgorithmException {
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA");
keyPairGenerator.initialize(1024);
KeyPair keyPair = keyPairGenerator.generateKeyPair();
RSAPublicKey rsaPublicKey = (RSAPublicKey) keyPair.getPublic();
RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) keyPair.getPrivate();
String publicKeyString = Base64.encodeBase64String(rsaPublicKey.getEncoded());
String privateKeyString = Base64.encodeBase64String(rsaPrivateKey.getEncoded());
return new RsaKeyPair(publicKeyString, privateKeyString);
}
/**
* RSA密钥对对象
*/
public static class RsaKeyPair {
private final String publicKey;
private final String privateKey;
public RsaKeyPair(String publicKey, String privateKey) {
this.publicKey = publicKey;
this.privateKey = privateKey;
}
public String getPublicKey() {
return publicKey;
}
public String getPrivateKey() {
return privateKey;
}
}
public static void main(String[] args) throws Exception {
// 获取公钥私钥
RsaKeyPair rsaKeyPair = generateKeyPair();
System.out.println(rsaKeyPair.getPublicKey());
System.out.println(rsaKeyPair.getPrivateKey());
// 私钥加密
String encrypt = encryptByPrivateKey( rsaKeyPair.getPrivateKey(),"123456");
System.out.println(encrypt);
// 公钥解密
String decrypt = decryptByPublicKey(rsaKeyPair.getPublicKey(), encrypt);
System.out.println(decrypt);
// 公钥加密
// String encrypt = encryptByPublicKey(rsaKeyPair.getPublicKey(), "123456");
// System.out.println(encrypt);
// // 私钥解密
// String decrypt = decryptByPrivateKey(rsaKeyPair.getPrivateKey(), encrypt);
// System.out.println(decrypt);
}
}

View File

@ -6,9 +6,11 @@ import com.tcctlo.common.core.controller.BaseController;
import com.tcctlo.common.core.domain.AjaxResult; import com.tcctlo.common.core.domain.AjaxResult;
import com.tcctlo.law.entity.CaseInformation; import com.tcctlo.law.entity.CaseInformation;
import com.tcctlo.law.entity.FileManager; import com.tcctlo.law.entity.FileManager;
import com.tcctlo.law.entity.TransferParam;
import com.tcctlo.law.searcher.CaseCloseSearcher; import com.tcctlo.law.searcher.CaseCloseSearcher;
import com.tcctlo.law.searcher.CaseInformationEnterSearcher; import com.tcctlo.law.searcher.CaseInformationEnterSearcher;
import com.tcctlo.law.service.ICaseInformationService; import com.tcctlo.law.service.ICaseInformationService;
import com.tcctlo.law.service.ICaseTransferService;
import com.tcctlo.law.vo.CaseArchivedVO; import com.tcctlo.law.vo.CaseArchivedVO;
import com.tcctlo.law.vo.CaseInformationEnterOverrideVO; import com.tcctlo.law.vo.CaseInformationEnterOverrideVO;
import com.tcctlo.law.vo.CaseInformationEnterVO; import com.tcctlo.law.vo.CaseInformationEnterVO;
@ -34,6 +36,9 @@ public class CaseInformationController extends BaseController {
@Autowired @Autowired
private ICaseInformationService iCaseInformationService; private ICaseInformationService iCaseInformationService;
@Autowired
private ICaseTransferService iCaseTransferService;
/** /**
* 案件审核 * 案件审核
@ -249,4 +254,23 @@ public class CaseInformationController extends BaseController {
return AjaxResult.success(result); return AjaxResult.success(result);
} }
/**
* 案件转移
* @param params 参数新律师旧律师要转移的案件IDS
* @return
*/
@PostMapping("/transferLawyer")
public AjaxResult transferLawyer(@RequestBody TransferParam params) {
AjaxResult ajaxResult = new AjaxResult();
if (iCaseTransferService.transferLawyer(params)) {
ajaxResult.put("msg", "设置成功!");
ajaxResult.put("code", 200);
}else {
ajaxResult.put("msg", "设置失败!");
ajaxResult.put("code", 500);
}
return ajaxResult;
}
} }

View File

@ -24,7 +24,7 @@ import lombok.EqualsAndHashCode;
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@TableName("case_information") @TableName(value = "case_information", autoResultMap = true)
public class CaseInformation implements Serializable { public class CaseInformation implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -158,7 +158,7 @@ public class CaseInformation implements Serializable {
* 案件涉及律师ID集合 * 案件涉及律师ID集合
* FIXME 关联的地方进行修改后将该字段删除 * FIXME 关联的地方进行修改后将该字段删除
*/ */
// private String caseLawyerIds; private String caseLawyerIds;
/** /**
* 委托律师 * 委托律师

View File

@ -0,0 +1,84 @@
package com.tcctlo.law.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
* 案件律师表
* </p>
*
* @author 张世琪
* @since 2025-02-06
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("case_transfer")
public class CaseTransfer 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;
/**
* 是否是原承办律师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 remark;
}

View File

@ -0,0 +1,21 @@
package com.tcctlo.law.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tcctlo.law.entity.CaseLawyer;
import com.tcctlo.law.entity.CaseTransfer;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 案件律师表 Mapper 接口
* </p>
*
* @author 张世琪
* @since 2025-02-06
*/
public interface CaseTransferMapper extends BaseMapper<CaseTransfer> {
}

View File

@ -0,0 +1,28 @@
package com.tcctlo.law.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tcctlo.law.entity.CaseLawyer;
import com.tcctlo.law.entity.CaseTransfer;
import com.tcctlo.law.entity.TransferParam;
import java.util.List;
import java.util.Map;
/**
* <p>
* 案件律师表 服务类
* </p>
*
* @author 张世琪
* @since 2025-02-06
*/
public interface ICaseTransferService extends IService<CaseTransfer>{
/**
* 案件律师转移
* @param params 参数
* @return 结果集
*/
boolean transferLawyer(TransferParam params);
}

View File

@ -744,9 +744,9 @@ public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMappe
if (CollUtil.isNotEmpty(insert)) { if (CollUtil.isNotEmpty(insert)) {
caseLawyerService.saveBatch(insert); caseLawyerService.saveBatch(insert);
} }
if (CollUtil.isNotEmpty(deleteIds)) { // if (CollUtil.isNotEmpty(deleteIds)) {
caseLawyerMapper.updateByIds(deleteIds); // caseLawyerMapper.updateByIds(deleteIds);
} // }
} }
/** /**
@ -834,6 +834,7 @@ public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMappe
item.setUserName(nickName); item.setUserName(nickName);
CollectionRecord collectionRecord = new CollectionRecord(); CollectionRecord collectionRecord = new CollectionRecord();
BeanUtils.copyProperties(item, collectionRecord); BeanUtils.copyProperties(item, collectionRecord);
collectionRecord.setAuditStatus(0);// 添加审核状态
collectionRecordListNew.add(collectionRecord); collectionRecordListNew.add(collectionRecord);
} }
} }
@ -936,6 +937,12 @@ public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMappe
item.setCaseId(caseId); item.setCaseId(caseId);
item.setUserId(userId); item.setUserId(userId);
item.setUserName(nickName); item.setUserName(nickName);
String roleKey = sysUserMapper.selectUserRoleByUserId(userId);
if ("CAIWU".equals(roleKey)) {
item.setAuditStatus(1);
} else {
item.setAuditStatus(0);
}
addCollectionRecordList.add(item); addCollectionRecordList.add(item);
} else if (currentCollectionRecordIdList.contains(item.getId())) { } else if (currentCollectionRecordIdList.contains(item.getId())) {
updateCollectionRecordList.add(item); updateCollectionRecordList.add(item);

View File

@ -2,9 +2,13 @@ package com.tcctlo.law.service.impl;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tcctlo.common.core.domain.LawUserVO; import com.tcctlo.common.core.domain.LawUserVO;
import com.tcctlo.common.core.domain.model.LoginUser;
import com.tcctlo.common.utils.SecurityUtils;
import com.tcctlo.law.entity.CaseInformation;
import com.tcctlo.law.entity.CaseLawyer; import com.tcctlo.law.entity.CaseLawyer;
import com.tcctlo.law.entity.TransferParam; import com.tcctlo.law.entity.TransferParam;
import com.tcctlo.law.mapper.CaseInformationMapper; import com.tcctlo.law.mapper.CaseInformationMapper;
@ -16,7 +20,9 @@ import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.function.Consumer; import java.util.function.Consumer;
@ -24,15 +30,15 @@ import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
* <p> * <p>
* 案件律师表 服务实现类 * 案件律师表 服务实现类
* </p> * </p>
* *
* @author 张世琪 * @author 张世琪
* @since 2025-02-06 * @since 2025-02-06
*/ */
@Service @Service
public class CaseLawyerServiceImpl extends ServiceImpl<CaseLawyerMapper,CaseLawyer> implements ICaseLawyerService { public class CaseLawyerServiceImpl extends ServiceImpl<CaseLawyerMapper, CaseLawyer> implements ICaseLawyerService {
@Resource @Resource
@ -75,9 +81,10 @@ public class CaseLawyerServiceImpl extends ServiceImpl<CaseLawyerMapper,CaseLawy
return caseLawyerMapper.selectByMap(params); return caseLawyerMapper.selectByMap(params);
} }
@Override // @Override
@Transactional(isolation = Isolation.DEFAULT, rollbackFor = Exception.class) @Transactional(isolation = Isolation.DEFAULT, rollbackFor = Exception.class)
public boolean transferLawyer(TransferParam params) { @Deprecated
public boolean transferLawyer_old(TransferParam params) {
try { try {
Long newLawyerId = params.getNewLawyerId(); //新的律师 Long newLawyerId = params.getNewLawyerId(); //新的律师
LawUserVO newLawyer = sysUserMapper.getLawUserById(newLawyerId); //查找新的律师 LawUserVO newLawyer = sysUserMapper.getLawUserById(newLawyerId); //查找新的律师
@ -111,7 +118,47 @@ public class CaseLawyerServiceImpl extends ServiceImpl<CaseLawyerMapper,CaseLawy
} }
return true; return true;
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("转接失败");
}
}
@Transactional(isolation = Isolation.DEFAULT, rollbackFor = Exception.class)
@Deprecated
public boolean transferLawyer(TransferParam params) {
try {
// 获取新的主板律师ID
Long new_entrusted_lawyer_id = params.getNewLawyerId();
//获取要转移的案件IDS
List<Long> caseIdList = StrUtil.split(params.getCaseIds(), ",").stream().map(Long::parseLong).collect(Collectors.toList()); //获取要转移的案件ID
caseInformationMapper.selectList(new QueryWrapper<CaseInformation>().in("id", caseIdList)).forEach(item -> {
//获取案件信息表中的案件涉及律师ID
Long old_entrusted_lawyer_id = item.getEntrustedLawyerId();
// 就案件信息写入caseLawyer表
CaseLawyer caseLawyer = new CaseLawyer();
caseLawyer.setCaseId(item.getId());
caseLawyer.setLawyerId(old_entrusted_lawyer_id);
caseLawyer.setCreateTime(new Date());
caseLawyer.setDelFlag(0);
// 查看是否是原律师不存在则为原律师
if (Math.toIntExact(caseLawyerMapper.selectCount(new QueryWrapper<CaseLawyer>().eq("case_id", item.getId()).eq("lawyer_id", old_entrusted_lawyer_id))) == 0) {
caseLawyer.setIsPrime(1);
} else {
caseLawyer.setIsPrime(0);
}
caseLawyer.setCreateBy(SecurityUtils.getLoginUser().getUserId().toString());
caseLawyerMapper.insert(caseLawyer);
// 更新案件信息表中的案件涉及律师ID
item.setEntrustedLawyerId(new_entrusted_lawyer_id);
item.setUpdateTime(new Date());
item.setUpdateBy(SecurityUtils.getLoginUser().getUserId().toString());
caseInformationMapper.updateById(item);
});
return true;
} catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new RuntimeException("转接失败"); throw new RuntimeException("转接失败");
} }

View File

@ -0,0 +1,81 @@
package com.tcctlo.law.service.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tcctlo.common.utils.SecurityUtils;
import com.tcctlo.law.entity.CaseInformation;
import com.tcctlo.law.entity.CaseTransfer;
import com.tcctlo.law.entity.TransferParam;
import com.tcctlo.law.mapper.CaseInformationMapper;
import com.tcctlo.law.mapper.CaseTransferMapper;
import com.tcctlo.law.service.ICaseTransferService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* <p>
* 案件律师表 服务实现类
* </p>
*
* @author 张世琪
* @since 2025-02-06
*/
@Service
public class CaseTransferServiceImpl extends ServiceImpl<CaseTransferMapper, CaseTransfer> implements ICaseTransferService {
@Resource
private CaseTransferMapper transferMapper;
@Resource
private CaseInformationMapper caseInformationMapper;
@Transactional(isolation = Isolation.DEFAULT, rollbackFor = Exception.class)
@Deprecated
public boolean transferLawyer(TransferParam params) {
try {
// 获取新的主板律师ID
Long new_entrusted_lawyer_id = params.getNewLawyerId();
//获取要转移的案件IDS
List<Long> caseIdList = StrUtil.split(params.getCaseIds(), ",").stream().map(Long::parseLong).collect(Collectors.toList()); //获取要转移的案件ID
caseInformationMapper.selectList(new QueryWrapper<CaseInformation>().in("id", caseIdList)).forEach(item -> {
//获取案件信息表中的案件涉及律师ID
Long old_entrusted_lawyer_id = item.getEntrustedLawyerId();
// 就案件信息写入caseLawyer表
CaseTransfer caseTransfer = new CaseTransfer();
caseTransfer.setCaseId(item.getId());
caseTransfer.setLawyerId(old_entrusted_lawyer_id);
caseTransfer.setDelFlag(0);
// 查看是否是原律师不存在则为原律师,插入旧数据新数据不变
if (Math.toIntExact(transferMapper.selectCount(new QueryWrapper<CaseTransfer>().eq("case_id", item.getId()).eq("lawyer_id", old_entrusted_lawyer_id))) > 0) {
caseTransfer.setIsPrime(1);
} else {
caseTransfer.setIsPrime(0);
}
caseTransfer.setCreateTime(new Date());
caseTransfer.setCreateBy(SecurityUtils.getLoginUser().getUserId().toString());
transferMapper.insert(caseTransfer);
// 更新案件信息表中的案件涉及律师ID
item.setEntrustedLawyerId(new_entrusted_lawyer_id);
item.setUpdateTime(new Date());
item.setUpdateBy(SecurityUtils.getLoginUser().getUserId().toString());
caseInformationMapper.updateById(item);
});
return true;
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("转接失败");
}
}
}

View File

@ -202,20 +202,16 @@ public class CollectionRecordServiceImpl extends ServiceImpl<CollectionRecordMap
@Override @Override
public List<CollectionRecordEnterVO> selectByCaseId(Long caseId) { public List<CollectionRecordEnterVO> selectByCaseId(Long caseId) {
List<CollectionRecordEnterVO> lists = collectionRecordMapper.selectByCaseId(caseId); List<CollectionRecordEnterVO> lists = collectionRecordMapper.selectByCaseId(caseId);
// for (CollectionRecordEnterVO item : lists) { for (CollectionRecordEnterVO item : lists) {
// if (StrUtil.isNotBlank(item.getCollectionUrlId())){ //排除用户只进行缴费没有上传收费凭证的情况 Long userId = item.getUserId();
// List<Long> collect = Arrays.stream(item.getCollectionUrlId().split(",")).map(Long::parseLong).collect(Collectors.toList()); String roleKey = sysUserMapper.selectUserRoleByUserId(userId);
// item.setFileManager(fileManagerMapper.selectByCRid(collect)); if ("CAIWU".equals(roleKey)){
// } item.setIsEdit(item.getAuditStatus() != 1);
// Long userId = item.getUserId(); }else {
// String roleKey = sysUserMapper.selectUserRoleByUserId(userId); item.setIsEdit(item.getAuditStatus() == 0);
// if ("CAIWU".equals(roleKey)){ }
// item.setIsEdit(item.getAuditStatus() == 1);
// }else { }
// item.setIsEdit(item.getAuditStatus() == 0);
// }
//
// }
return lists; return lists;
} }

View File

@ -130,6 +130,7 @@ public class ContractTemplateServiceImpl extends ServiceImpl<ContractTemplateMap
} }
fileOutputStream.close(); fileOutputStream.close();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("存储至服务器失败"); throw new RuntimeException("存储至服务器失败");
} }
} }
@ -167,12 +168,12 @@ public class ContractTemplateServiceImpl extends ServiceImpl<ContractTemplateMap
List<BaseWordEntity> list = contractTemplateMapper.selectWordParam(caseId); List<BaseWordEntity> list = contractTemplateMapper.selectWordParam(caseId);
System.out.println(list); System.out.println(list);
BaseWordEntity baseWordEntity = new BaseWordEntity(); BaseWordEntity baseWordEntity = new BaseWordEntity();
String firstParty = list.stream().map(item -> item.getFirstParty()).collect(Collectors.joining("")); String firstParty = list.stream().map(BaseWordEntity::getFirstParty).collect(Collectors.joining(""));
baseWordEntity.setFirstParty(firstParty); baseWordEntity.setFirstParty(firstParty);
baseWordEntity.setSolicitor(list.get(0).getSolicitor()); baseWordEntity.setSolicitor(list.get(0).getSolicitor());
baseWordEntity.setSocialCreditCode(list.get(0).getSocialCreditCode()); baseWordEntity.setSocialCreditCode(list.get(0).getSocialCreditCode());
baseWordEntity.setAddress(list.get(0).getAddress()); baseWordEntity.setAddress(list.get(0).getAddress());
String savePath = generatedWordPath + UUID.randomUUID().toString() + ".docx"; String savePath = generatedWordPath + UUID.randomUUID() + ".docx";
XWPFTemplate template = XWPFTemplate.compile(contractTemplate.getFilePath()).render(baseWordEntity); XWPFTemplate template = XWPFTemplate.compile(contractTemplate.getFilePath()).render(baseWordEntity);
FileOutputStream out = new FileOutputStream(savePath); FileOutputStream out = new FileOutputStream(savePath);
template.write(out); template.write(out);

View File

@ -116,7 +116,7 @@
update case_information ci update case_information ci
<set> <set>
<if test="lawIds != null"> <if test="lawIds != null">
ci.case_lawyer_ids = #{lawIds}, ci.co_lawyer_ids = #{lawIds},
</if> </if>
</set> </set>
where ci.id = #{caseId} where ci.id = #{caseId}
@ -190,10 +190,10 @@
and find_in_set(#{condition.opposite},ci.impulse_information_ids) and find_in_set(#{condition.opposite},ci.impulse_information_ids)
</if> </if>
<if test="condition.lawyerId != null"> <if test="condition.lawyerId != null">
and find_in_set(#{condition.lawyerId},ci.case_lawyer_ids) and find_in_set(#{condition.lawyerId},ci.co_lawyer_ids)
</if> </if>
<if test="condition.userId != null"> <if test="condition.userId != null">
and find_in_set(#{condition.userId},ci.case_lawyer_ids) and find_in_set(#{condition.userId},ci.entrusted_lawyer_id)
</if> </if>
and ci.status = 0 and ci.del_flag = 0 and ci.status = 0 and ci.del_flag = 0
order by ci.create_time desc order by ci.create_time desc
@ -216,7 +216,7 @@
<select id="selectCaseInfoById" resultMap="selectCaseInfoByIdResult"> <select id="selectCaseInfoById" resultType="com.tcctlo.law.vo.CaseInformationListVO" resultMap="selectConditionResult">
select select
<include refid="baseColumn"/> <include refid="baseColumn"/>
from case_information ci from case_information ci
@ -266,9 +266,9 @@
<select id="selectCaseById" resultType="com.tcctlo.law.vo.CaseInformationListVO"> <select id="selectCaseById" resultType="com.tcctlo.law.vo.CaseInformationListVO" resultMap="selectConditionResult">
select select
<include refid="baseColumn"/> *
from case_information ci from case_information ci
<where> <where>
1 = 1 1 = 1
@ -286,7 +286,7 @@
and ci.business_classify = #{type} and ci.business_classify = #{type}
</if> </if>
<if test="userId != null and userId != ''"> <if test="userId != null and userId != ''">
and find_in_set(#{userId},ci.case_lawyer_ids) and find_in_set(#{userId},ci.entrusted_lawyer_id)
</if> </if>
<if test="startTime != null and endTime != null"> <if test="startTime != null and endTime != null">
and ci.create_time between #{startTime} and #{endTime} and ci.create_time between #{startTime} and #{endTime}
@ -305,7 +305,7 @@
and ci.case_status = #{caseStatus} and ci.case_status = #{caseStatus}
</if> </if>
<if test="userId != null and userId != ''"> <if test="userId != null and userId != ''">
and find_in_set(#{userId},ci.case_lawyer_ids) and find_in_set(#{userId},ci.entrusted_lawyer_id)
</if> </if>
<if test="startTime != null and endTime != null"> <if test="startTime != null and endTime != null">
and ci.create_time between #{startTime} and #{endTime} and ci.create_time between #{startTime} and #{endTime}
@ -323,7 +323,7 @@
1 = 1 1 = 1
and ci.amount_received_sum = 0 and ci.amount_received_sum = 0
<if test="userId != null and userId != ''"> <if test="userId != null and userId != ''">
and find_in_set(#{userId},ci.case_lawyer_ids) and find_in_set(#{userId},ci.entrusted_lawyer_id)
</if> </if>
<if test="startTime != null and endTime != null"> <if test="startTime != null and endTime != null">
and ci.create_time between #{startTime} and #{endTime} and ci.create_time between #{startTime} and #{endTime}
@ -368,7 +368,7 @@
1 = 1 1 = 1
and ci.collection_status = 1 and ci.collection_status = 1
<if test="userId != null and userId != ''"> <if test="userId != null and userId != ''">
and find_in_set(#{userId},ci.case_lawyer_ids) and find_in_set(#{userId},ci.entrusted_lawyer_id)
</if> </if>
<if test="startTime != null and endTime != null"> <if test="startTime != null and endTime != null">
and ci.create_time between #{startTime} and #{endTime} and ci.create_time between #{startTime} and #{endTime}
@ -416,7 +416,7 @@
1 = 1 1 = 1
and ci.collection_status = 3 and ci.collection_status = 3
<if test="userId != null and userId != ''"> <if test="userId != null and userId != ''">
and find_in_set(#{userId},ci.case_lawyer_ids) and find_in_set(#{userId},ci.entrusted_lawyer_id)
</if> </if>
<if test="startTime != null and endTime != null"> <if test="startTime != null and endTime != null">
and ci.create_time between #{startTime} and #{endTime} and ci.create_time between #{startTime} and #{endTime}
@ -434,7 +434,7 @@
<where> <where>
1 = 1 1 = 1
<if test="userId != null and userId != ''"> <if test="userId != null and userId != ''">
and find_in_set(#{userId},ci.case_lawyer_ids) and find_in_set(#{userId},ci.entrusted_lawyer_id)
</if> </if>
<if test="caseStatus != null"> <if test="caseStatus != null">
and ci.case_status = #{caseStatus} and ci.case_status = #{caseStatus}
@ -450,7 +450,7 @@
<where> <where>
1 = 1 1 = 1
<if test="userId != null and userId != ''"> <if test="userId != null and userId != ''">
and find_in_set(#{userId},ci.case_lawyer_ids) and find_in_set(#{userId},ci.entrusted_lawyer_id)
</if> </if>
<if test="collectionStatus != null"> <if test="collectionStatus != null">
and ci.collection_status = #{collectionStatus} and ci.collection_status = #{collectionStatus}
@ -466,7 +466,7 @@
<where> <where>
1 = 1 1 = 1
<if test="userId != null and userId != ''"> <if test="userId != null and userId != ''">
and find_in_set(#{userId},ci.case_lawyer_ids) and find_in_set(#{userId},ci.entrusted_lawyer_id)
</if> </if>
<if test="auditStatus != null"> <if test="auditStatus != null">
and ci.audit_status = #{auditStatus} and ci.audit_status = #{auditStatus}
@ -482,7 +482,7 @@
<where> <where>
1 = 1 1 = 1
<if test="userId != null and userId != ''"> <if test="userId != null and userId != ''">
and find_in_set(#{userId},ci.case_lawyer_ids) and find_in_set(#{userId},ci.entrusted_lawyer_id)
</if> </if>
<if test="archiveStatus != null"> <if test="archiveStatus != null">
and ci.archive_status = #{archiveStatus} and ci.archive_status = #{archiveStatus}
@ -498,7 +498,7 @@
<where> <where>
1 = 1 1 = 1
<if test="userId != null and userId != ''"> <if test="userId != null and userId != ''">
and find_in_set(#{userId},ci.case_lawyer_ids) and find_in_set(#{userId},ci.entrusted_lawyer_id)
</if> </if>
<if test="finishStatus != null"> <if test="finishStatus != null">
and ci.is_finish_case = #{finishStatus} and ci.is_finish_case = #{finishStatus}
@ -514,7 +514,7 @@
<where> <where>
1 = 1 1 = 1
<if test="userId != null and userId != ''"> <if test="userId != null and userId != ''">
and find_in_set(#{userId},ci.case_lawyer_ids) and find_in_set(#{userId},ci.entrusted_lawyer_id)
</if> </if>
<if test="impulseStatus != null"> <if test="impulseStatus != null">
and ci.impulse_state = #{impulseStatus} and ci.impulse_state = #{impulseStatus}
@ -532,11 +532,11 @@
<select id="selectLawCaseCount" resultType="java.lang.Integer"> <select id="selectLawCaseCount" resultType="java.lang.Integer">
select count(id) from case_information ci select count(id) from case_information ci
where find_in_set(#{lawId}, ci.case_lawyer_ids) and ci.status = 0 and ci.del_flag = 0 where find_in_set(#{lawId}, ci.co_lawyer_ids) and ci.status = 0 and ci.del_flag = 0
</select> </select>
<select id="selectLawCaseMoneyCount" resultType="java.math.BigDecimal"> <select id="selectLawCaseMoneyCount" resultType="java.math.BigDecimal">
select sum(ci.amount_received_sum) from case_information ci select sum(ci.amount_received_sum) from case_information ci
where find_in_set(#{lawId}, ci.case_lawyer_ids) and ci.status = 0 and ci.del_flag = 0 where find_in_set(#{lawId}, ci.co_lawyer_ids) and ci.status = 0 and ci.del_flag = 0
</select> </select>
<select id="staticCaseNumAndMoney" resultType="com.tcctlo.law.vo.IndexLawCaseMoneyInfo"> <select id="staticCaseNumAndMoney" resultType="com.tcctlo.law.vo.IndexLawCaseMoneyInfo">

View File

@ -0,0 +1,5 @@
<?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.CaseTransferMapper">
</mapper>

View File

@ -88,7 +88,7 @@
<where> <where>
1 = 1 1 = 1
<if test="userId != null and userId != ''"> <if test="userId != null and userId != ''">
and find_in_set(#{userId},ci.case_lawyer_ids) and find_in_set(#{userId},ci.entrusted_lawyer_id)
</if> </if>
and ci.del_flag = 0 and ci.status = 0 and ci.del_flag = 0 and ci.status = 0
</where> </where>

View File

@ -8,7 +8,7 @@
#{id} #{id}
</foreach> </foreach>
</update> </update>
<select id="selectWordParam" resultType="com.tcctlo.law.entity.wordTemplateEntity.BaseWordEntity"> <select id="selectWordParam_old" resultType="com.tcctlo.law.entity.wordTemplateEntity.BaseWordEntity">
select ci.case_name, select ci.case_name,
ii.case_name as firstParty, ii.case_name as firstParty,
ii.case_no as socialCreditCode, ii.case_no as socialCreditCode,
@ -17,6 +17,15 @@
from case_information ci, impulse_information ii, case_lawyer cl from case_information ci, impulse_information ii, case_lawyer cl
where ci.id = #{caseId} and ci.id = ii.case_id and ii.is_client = 0 and ci.id = cl.case_id and cl.is_prime = 0 and cl.lawyer_type = 0 where ci.id = #{caseId} and ci.id = ii.case_id and ii.is_client = 0 and ci.id = cl.case_id and cl.is_prime = 0 and cl.lawyer_type = 0
</select> </select>
<select id="selectWordParam" resultType="com.tcctlo.law.entity.wordTemplateEntity.BaseWordEntity">
select ci.case_name,
ii.case_name as firstParty,
ii.case_no as socialCreditCode,
ii.case_address as address,
cl.user_name as solicitor
from case_information ci, impulse_information ii, sys_user cl
where ci.id = #{caseId} and ci.id = ii.case_id and ii.is_client = 0 and ci.entrusted_lawyer_id = cl.user_id and cl.status = 0 and cl.del_flag = 0
</select>
<select id="selectCondition" resultType="com.tcctlo.law.entity.ContractTemplate"> <select id="selectCondition" resultType="com.tcctlo.law.entity.ContractTemplate">
select * from contract_template ct select * from contract_template ct
<where> <where>