From 8cb846c8b33ba8472eb45d4c2717d5cd6df48712 Mon Sep 17 00:00:00 2001 From: chuanxingchao Date: Thu, 15 May 2025 18:06:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81=EF=BC=8C?= =?UTF-8?q?=E6=A1=88=E4=BB=B6=E6=B7=BB=E5=8A=A0=E4=BF=AE=E6=94=B9=EF=BC=8C?= =?UTF-8?q?=E6=94=B6=E6=AC=BE=E8=AE=B0=E5=BD=95=E5=B1=95=E7=A4=BA=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/system/SysLoginController.java | 9 +- .../tcctlo/common/utils/sign/RsaUtils.java | 158 ++++++++++++++++++ .../controller/CaseInformationController.java | 24 +++ .../tcctlo/law/entity/CaseInformation.java | 4 +- .../com/tcctlo/law/entity/CaseTransfer.java | 84 ++++++++++ .../tcctlo/law/mapper/CaseTransferMapper.java | 21 +++ .../law/service/ICaseTransferService.java | 28 ++++ .../impl/CaseInformationServiceImpl.java | 13 +- .../service/impl/CaseLawyerServiceImpl.java | 69 ++++++-- .../service/impl/CaseTransferServiceImpl.java | 81 +++++++++ .../impl/CollectionRecordServiceImpl.java | 24 ++- .../impl/ContractTemplateServiceImpl.java | 5 +- .../CaseInformationMapper.xml | 38 ++--- .../tcctlo-law-office/CaseTransferMapper.xml | 5 + .../CollectionRecordMapper.xml | 2 +- .../ContractTemplateMapper.xml | 11 +- 16 files changed, 519 insertions(+), 57 deletions(-) create mode 100644 tcctlo-common/src/main/java/com/tcctlo/common/utils/sign/RsaUtils.java create mode 100644 tcctlo-law-office/src/main/java/com/tcctlo/law/entity/CaseTransfer.java create mode 100644 tcctlo-law-office/src/main/java/com/tcctlo/law/mapper/CaseTransferMapper.java create mode 100644 tcctlo-law-office/src/main/java/com/tcctlo/law/service/ICaseTransferService.java create mode 100644 tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/CaseTransferServiceImpl.java create mode 100644 tcctlo-law-office/src/main/resources/mapper/tcctlo-law-office/CaseTransferMapper.xml diff --git a/tcctlo-admin/src/main/java/com/tcctlo/web/controller/system/SysLoginController.java b/tcctlo-admin/src/main/java/com/tcctlo/web/controller/system/SysLoginController.java index 9952942d..f79489ed 100644 --- a/tcctlo-admin/src/main/java/com/tcctlo/web/controller/system/SysLoginController.java +++ b/tcctlo-admin/src/main/java/com/tcctlo/web/controller/system/SysLoginController.java @@ -2,6 +2,8 @@ package com.tcctlo.web.controller.system; import java.util.List; import java.util.Set; + +import com.tcctlo.common.utils.sign.RsaUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -46,12 +48,11 @@ public class SysLoginController * @return 结果 */ @PostMapping("/login") - public AjaxResult login(@RequestBody LoginBody loginBody) - { + public AjaxResult login(@RequestBody LoginBody loginBody) throws Exception { AjaxResult ajax = AjaxResult.success(); // 生成令牌 - String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(), - loginBody.getUuid()); + String token = loginService.login(loginBody.getUsername(), + RsaUtils.decryptByPrivateKey(loginBody.getPassword()), loginBody.getCode(), loginBody.getUuid()); ajax.put(Constants.TOKEN, token); return ajax; } diff --git a/tcctlo-common/src/main/java/com/tcctlo/common/utils/sign/RsaUtils.java b/tcctlo-common/src/main/java/com/tcctlo/common/utils/sign/RsaUtils.java new file mode 100644 index 00000000..96c23c8c --- /dev/null +++ b/tcctlo-common/src/main/java/com/tcctlo/common/utils/sign/RsaUtils.java @@ -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); + } +} \ No newline at end of file diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/controller/CaseInformationController.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/controller/CaseInformationController.java index 4dcf7fd3..7ddf6689 100644 --- a/tcctlo-law-office/src/main/java/com/tcctlo/law/controller/CaseInformationController.java +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/controller/CaseInformationController.java @@ -6,9 +6,11 @@ import com.tcctlo.common.core.controller.BaseController; import com.tcctlo.common.core.domain.AjaxResult; import com.tcctlo.law.entity.CaseInformation; import com.tcctlo.law.entity.FileManager; +import com.tcctlo.law.entity.TransferParam; import com.tcctlo.law.searcher.CaseCloseSearcher; import com.tcctlo.law.searcher.CaseInformationEnterSearcher; import com.tcctlo.law.service.ICaseInformationService; +import com.tcctlo.law.service.ICaseTransferService; import com.tcctlo.law.vo.CaseArchivedVO; import com.tcctlo.law.vo.CaseInformationEnterOverrideVO; import com.tcctlo.law.vo.CaseInformationEnterVO; @@ -34,6 +36,9 @@ public class CaseInformationController extends BaseController { @Autowired private ICaseInformationService iCaseInformationService; + @Autowired + private ICaseTransferService iCaseTransferService; + /** * 案件审核 @@ -249,4 +254,23 @@ public class CaseInformationController extends BaseController { 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; + } + + } diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/entity/CaseInformation.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/entity/CaseInformation.java index 15676f06..8ed5bf0d 100644 --- a/tcctlo-law-office/src/main/java/com/tcctlo/law/entity/CaseInformation.java +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/entity/CaseInformation.java @@ -24,7 +24,7 @@ import lombok.EqualsAndHashCode; */ @Data @EqualsAndHashCode(callSuper = false) -@TableName("case_information") +@TableName(value = "case_information", autoResultMap = true) public class CaseInformation implements Serializable { private static final long serialVersionUID = 1L; @@ -158,7 +158,7 @@ public class CaseInformation implements Serializable { * 案件涉及律师ID集合 * FIXME 关联的地方进行修改后,将该字段删除 */ -// private String caseLawyerIds; + private String caseLawyerIds; /** * 委托律师 diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/entity/CaseTransfer.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/entity/CaseTransfer.java new file mode 100644 index 00000000..02f5c923 --- /dev/null +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/entity/CaseTransfer.java @@ -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; + +/** + *

+ * 案件律师表 + *

+ * + * @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; + +} diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/mapper/CaseTransferMapper.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/mapper/CaseTransferMapper.java new file mode 100644 index 00000000..fad65fb2 --- /dev/null +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/mapper/CaseTransferMapper.java @@ -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; + +/** + *

+ * 案件律师表 Mapper 接口 + *

+ * + * @author 张世琪 + * @since 2025-02-06 + */ +public interface CaseTransferMapper extends BaseMapper { + +} diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/service/ICaseTransferService.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/ICaseTransferService.java new file mode 100644 index 00000000..e8d3183d --- /dev/null +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/ICaseTransferService.java @@ -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; + +/** + *

+ * 案件律师表 服务类 + *

+ * + * @author 张世琪 + * @since 2025-02-06 + */ +public interface ICaseTransferService extends IService{ + + /** + * 案件律师转移 + * @param params 参数 + * @return 结果集 + */ + boolean transferLawyer(TransferParam params); +} diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/CaseInformationServiceImpl.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/CaseInformationServiceImpl.java index fa02c799..85255386 100644 --- a/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/CaseInformationServiceImpl.java +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/CaseInformationServiceImpl.java @@ -744,9 +744,9 @@ public class CaseInformationServiceImpl extends ServiceImpl -* 案件律师表 服务实现类 -*

-* -* @author 张世琪 -* @since 2025-02-06 -*/ + *

+ * 案件律师表 服务实现类 + *

+ * + * @author 张世琪 + * @since 2025-02-06 + */ @Service -public class CaseLawyerServiceImpl extends ServiceImpl implements ICaseLawyerService { +public class CaseLawyerServiceImpl extends ServiceImpl implements ICaseLawyerService { @Resource @@ -75,9 +81,10 @@ public class CaseLawyerServiceImpl extends ServiceImpl caseIdList = StrUtil.split(params.getCaseIds(), ",").stream().map(Long::parseLong).collect(Collectors.toList()); //获取要转移的案件ID + + caseInformationMapper.selectList(new QueryWrapper().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().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(); throw new RuntimeException("转接失败"); } diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/CaseTransferServiceImpl.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/CaseTransferServiceImpl.java new file mode 100644 index 00000000..f83f0aa5 --- /dev/null +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/CaseTransferServiceImpl.java @@ -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; + +/** + *

+ * 案件律师表 服务实现类 + *

+ * + * @author 张世琪 + * @since 2025-02-06 + */ +@Service +public class CaseTransferServiceImpl extends ServiceImpl 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 caseIdList = StrUtil.split(params.getCaseIds(), ",").stream().map(Long::parseLong).collect(Collectors.toList()); //获取要转移的案件ID + + caseInformationMapper.selectList(new QueryWrapper().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().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("转接失败"); + } + } + +} diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/CollectionRecordServiceImpl.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/CollectionRecordServiceImpl.java index 4122fa57..0d970d6c 100644 --- a/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/CollectionRecordServiceImpl.java +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/CollectionRecordServiceImpl.java @@ -202,20 +202,16 @@ public class CollectionRecordServiceImpl extends ServiceImpl selectByCaseId(Long caseId) { List lists = collectionRecordMapper.selectByCaseId(caseId); -// for (CollectionRecordEnterVO item : lists) { -// if (StrUtil.isNotBlank(item.getCollectionUrlId())){ //排除用户只进行缴费没有上传收费凭证的情况 -// List collect = Arrays.stream(item.getCollectionUrlId().split(",")).map(Long::parseLong).collect(Collectors.toList()); -// item.setFileManager(fileManagerMapper.selectByCRid(collect)); -// } -// Long userId = item.getUserId(); -// String roleKey = sysUserMapper.selectUserRoleByUserId(userId); -// if ("CAIWU".equals(roleKey)){ -// item.setIsEdit(item.getAuditStatus() == 1); -// }else { -// item.setIsEdit(item.getAuditStatus() == 0); -// } -// -// } + for (CollectionRecordEnterVO item : lists) { + Long userId = item.getUserId(); + String roleKey = sysUserMapper.selectUserRoleByUserId(userId); + if ("CAIWU".equals(roleKey)){ + item.setIsEdit(item.getAuditStatus() != 1); + }else { + item.setIsEdit(item.getAuditStatus() == 0); + } + + } return lists; } diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/ContractTemplateServiceImpl.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/ContractTemplateServiceImpl.java index 85a15819..e1ec800d 100644 --- a/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/ContractTemplateServiceImpl.java +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/ContractTemplateServiceImpl.java @@ -130,6 +130,7 @@ public class ContractTemplateServiceImpl extends ServiceImpl list = contractTemplateMapper.selectWordParam(caseId); System.out.println(list); 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.setSolicitor(list.get(0).getSolicitor()); baseWordEntity.setSocialCreditCode(list.get(0).getSocialCreditCode()); 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); FileOutputStream out = new FileOutputStream(savePath); template.write(out); diff --git a/tcctlo-law-office/src/main/resources/mapper/tcctlo-law-office/CaseInformationMapper.xml b/tcctlo-law-office/src/main/resources/mapper/tcctlo-law-office/CaseInformationMapper.xml index eecf9c85..f90291cb 100644 --- a/tcctlo-law-office/src/main/resources/mapper/tcctlo-law-office/CaseInformationMapper.xml +++ b/tcctlo-law-office/src/main/resources/mapper/tcctlo-law-office/CaseInformationMapper.xml @@ -116,7 +116,7 @@ update case_information ci - ci.case_lawyer_ids = #{lawIds}, + ci.co_lawyer_ids = #{lawIds}, where ci.id = #{caseId} @@ -190,10 +190,10 @@ and find_in_set(#{condition.opposite},ci.impulse_information_ids) - and find_in_set(#{condition.lawyerId},ci.case_lawyer_ids) + and find_in_set(#{condition.lawyerId},ci.co_lawyer_ids) - and find_in_set(#{condition.userId},ci.case_lawyer_ids) + and find_in_set(#{condition.userId},ci.entrusted_lawyer_id) and ci.status = 0 and ci.del_flag = 0 order by ci.create_time desc @@ -216,7 +216,7 @@ - select from case_information ci @@ -266,9 +266,9 @@ - select - + * from case_information ci 1 = 1 @@ -286,7 +286,7 @@ and ci.business_classify = #{type} - and find_in_set(#{userId},ci.case_lawyer_ids) + and find_in_set(#{userId},ci.entrusted_lawyer_id) and ci.create_time between #{startTime} and #{endTime} @@ -305,7 +305,7 @@ and ci.case_status = #{caseStatus} - and find_in_set(#{userId},ci.case_lawyer_ids) + and find_in_set(#{userId},ci.entrusted_lawyer_id) and ci.create_time between #{startTime} and #{endTime} @@ -323,7 +323,7 @@ 1 = 1 and ci.amount_received_sum = 0 - and find_in_set(#{userId},ci.case_lawyer_ids) + and find_in_set(#{userId},ci.entrusted_lawyer_id) and ci.create_time between #{startTime} and #{endTime} @@ -368,7 +368,7 @@ 1 = 1 and ci.collection_status = 1 - and find_in_set(#{userId},ci.case_lawyer_ids) + and find_in_set(#{userId},ci.entrusted_lawyer_id) and ci.create_time between #{startTime} and #{endTime} @@ -416,7 +416,7 @@ 1 = 1 and ci.collection_status = 3 - and find_in_set(#{userId},ci.case_lawyer_ids) + and find_in_set(#{userId},ci.entrusted_lawyer_id) and ci.create_time between #{startTime} and #{endTime} @@ -434,7 +434,7 @@ 1 = 1 - and find_in_set(#{userId},ci.case_lawyer_ids) + and find_in_set(#{userId},ci.entrusted_lawyer_id) and ci.case_status = #{caseStatus} @@ -450,7 +450,7 @@ 1 = 1 - and find_in_set(#{userId},ci.case_lawyer_ids) + and find_in_set(#{userId},ci.entrusted_lawyer_id) and ci.collection_status = #{collectionStatus} @@ -466,7 +466,7 @@ 1 = 1 - and find_in_set(#{userId},ci.case_lawyer_ids) + and find_in_set(#{userId},ci.entrusted_lawyer_id) and ci.audit_status = #{auditStatus} @@ -482,7 +482,7 @@ 1 = 1 - and find_in_set(#{userId},ci.case_lawyer_ids) + and find_in_set(#{userId},ci.entrusted_lawyer_id) and ci.archive_status = #{archiveStatus} @@ -498,7 +498,7 @@ 1 = 1 - and find_in_set(#{userId},ci.case_lawyer_ids) + and find_in_set(#{userId},ci.entrusted_lawyer_id) and ci.is_finish_case = #{finishStatus} @@ -514,7 +514,7 @@ 1 = 1 - and find_in_set(#{userId},ci.case_lawyer_ids) + and find_in_set(#{userId},ci.entrusted_lawyer_id) and ci.impulse_state = #{impulseStatus} @@ -532,11 +532,11 @@ + +