list = BeanUtil.copyToList(insert, CollectionRecord.class);
collectionRecordService.saveBatch(list);
diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/CaseLawyerServiceImpl.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/CaseLawyerServiceImpl.java
index 0267532b..342e8b7a 100644
--- a/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/CaseLawyerServiceImpl.java
+++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/CaseLawyerServiceImpl.java
@@ -1,17 +1,27 @@
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.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.tcctlo.common.core.domain.LawUserVO;
import com.tcctlo.law.entity.CaseLawyer;
+import com.tcctlo.law.entity.TransferParam;
+import com.tcctlo.law.mapper.CaseInformationMapper;
import com.tcctlo.law.mapper.CaseLawyerMapper;
import com.tcctlo.law.service.ICaseLawyerService;
+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.Collections;
+import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import java.util.function.Consumer;
+import java.util.function.Function;
+import java.util.stream.Collectors;
/**
*
@@ -28,6 +38,12 @@ public class CaseLawyerServiceImpl extends ServiceImpl list(Integer pageNo, Integer pageSize) {
return caseLawyerMapper.selectPage(new Page<>(pageNo, pageSize), new QueryWrapper<>());
@@ -59,4 +75,46 @@ public class CaseLawyerServiceImpl extends ServiceImpl caseIdList = StrUtil.split(transferCaseIds, ",").stream().map(Long::parseLong).collect(Collectors.toList()); //获取要转移的案件ID
+ //根据案件ID去查询【case_lawyer】表中原来的主办律师信息
+ List caseLawyers = caseLawyerMapper.selectByCaseIdPrime(caseIdList);
+ //将【case_lawyer】表中原来的主办律师信息设置为【原承办律师1】
+ List clIds = caseLawyers.stream().map(CaseLawyer::getId).collect(Collectors.toList());
+ caseLawyerMapper.updateByIds(clIds);
+
+ //组装新的主办律师信息并插入到【case_lawyer】表中
+ ArrayList insert = new ArrayList<>();
+ for (Long item : caseIdList) {
+ CaseLawyer caseLawyer = new CaseLawyer();
+ caseLawyer.setCaseId(item);
+ caseLawyer.setLawyerId(newLawyerId);
+ caseLawyer.setLawyerName(newLawyer.getNickName());
+ caseLawyer.setLawyerType(0);
+ caseLawyer.setIsPrime(0);
+ insert.add(caseLawyer);
+ }
+ this.saveBatch(insert);
+
+ //修改案件信息表中的【案件涉及律师ID】
+ for (Long id : caseIdList) {
+ List caseLawyersNow = caseLawyerMapper.selectAllPrimeLawyerByCaseId(id); //查询【case_lawyer】表新的案件主办律师信息
+ String lawIdsStr = caseLawyersNow.stream().map(item -> item.getLawyerId().toString()).collect(Collectors.joining(","));
+ System.out.println(caseLawyersNow);
+ caseInformationMapper.updateLawyerIds(id, lawIdsStr); //修改案件信息表中的【案件涉及律师ID】为转移后的律师ID
+ }
+
+ 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 f7669081..71fc75f6 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
@@ -2,6 +2,7 @@ package com.tcctlo.law.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
+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.core.domain.entity.SysRole;
@@ -182,8 +183,10 @@ public class CollectionRecordServiceImpl extends ServiceImpl selectByCaseId(Long caseId) {
List lists = collectionRecordMapper.selectByCaseId(caseId);
for (CollectionRecordEnterVO item : lists) {
- List collect = Arrays.stream(item.getCollectionUrlId().split(",")).map(Long::parseLong).collect(Collectors.toList());
- item.setFileManager(fileManagerMapper.selectByCRid(collect));
+ if (StrUtil.isNotBlank(item.getCollectionUrlId())){ //排除用户只进行缴费没有上传收费凭证的情况
+ List collect = Arrays.stream(item.getCollectionUrlId().split(",")).map(Long::parseLong).collect(Collectors.toList());
+ item.setFileManager(fileManagerMapper.selectByCRid(collect));
+ }
item.setIsEdit(item.getAuditStatus() == 0);
}
return lists;
diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/DemandPaymentRecordServiceImpl.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/DemandPaymentRecordServiceImpl.java
new file mode 100644
index 00000000..dc8ee415
--- /dev/null
+++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/DemandPaymentRecordServiceImpl.java
@@ -0,0 +1,118 @@
+package com.tcctlo.law.service.impl;
+
+import cn.hutool.core.date.DateUtil;
+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.common.core.domain.model.LoginUser;
+import com.tcctlo.common.utils.SecurityUtils;
+import com.tcctlo.law.entity.CaseInformation;
+import com.tcctlo.law.entity.DemandPaymentRecord;
+import com.tcctlo.law.mapper.CaseInformationMapper;
+import com.tcctlo.law.mapper.DemandPaymentRecordMapper;
+import com.tcctlo.law.service.IDemandPaymentRecordService;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Isolation;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+*
+* 金额催收记录 服务实现类
+*
+*
+* @author
+* @since 2025-02-27
+*/
+@Service
+public class DemandPaymentRecordServiceImpl extends ServiceImpl implements IDemandPaymentRecordService {
+
+
+ @Resource
+ private DemandPaymentRecordMapper demandPaymentRecordMapper;
+
+ @Resource
+ private CaseInformationMapper caseInformationMapper;
+
+ @Override
+ public Page list(Integer pageNo, Integer pageSize) {
+ return demandPaymentRecordMapper.selectPage(new Page<>(pageNo, pageSize), new QueryWrapper<>());
+ }
+
+ @Override
+ public DemandPaymentRecord getById(Long id) {
+ DemandPaymentRecord demandPaymentRecord = demandPaymentRecordMapper.selectById(id);
+ return demandPaymentRecord;
+ }
+
+ @Override
+ public Integer create(DemandPaymentRecord demandPaymentRecord) {
+ return demandPaymentRecordMapper.insert(demandPaymentRecord);
+ }
+
+ @Override
+ public Integer delete(Long id) {
+ return demandPaymentRecordMapper.deleteById(id);
+ }
+
+ @Override
+ public Integer update(DemandPaymentRecord demandPaymentRecord) {
+ return demandPaymentRecordMapper.updateById(demandPaymentRecord);
+ }
+
+ @Override
+ @Transactional(isolation = Isolation.DEFAULT, rollbackFor = Exception.class)
+ public Boolean caseCollection(Map params) {
+ LoginUser loginUser = SecurityUtils.getLoginUser();
+ Long userId = loginUser.getUserId();
+ String username = loginUser.getUsername();
+ String nickName = loginUser.getUser().getNickName();
+ try {
+ Long caseId = params.get("caseId"); // 案件ID
+ //查询案件信息
+ CaseInformation caseInformation = caseInformationMapper.selectById(caseId);
+ String caseName = caseInformation.getCaseName(); //案件名称
+ String caseNo = caseInformation.getCaseNo(); //案件编号
+ BigDecimal amountReceivable = caseInformation.getAmountReceivable(); //案件应收金额
+ BigDecimal amountReceivedSum = caseInformation.getAmountReceivedSum(); //案件已收金额
+ Date paymentDeadline = caseInformation.getPaymentDeadline(); //付款期限 DateUtil.format(paymentDeadline,"yyyy-MM-dd")
+ BigDecimal reserveMoney = caseInformation.getReserveMoney(); //预留款
+ Date termOfConsultancy = caseInformation.getTermOfConsultancy(); //顾问期限
+
+ String msg = caseName + "[" + caseNo + "],应收金额为:" + amountReceivable + ",已收金额为:" + amountReceivedSum + ",付款期限:" + (paymentDeadline == null ? "无" : DateUtil.format(paymentDeadline, "yyyy-MM-dd")) + ",预留款:" + reserveMoney + ",顾问期限:" + (termOfConsultancy == null ? "无" : DateUtil.format(termOfConsultancy, "yyyy-MM-dd")) + ",剩余:" + amountReceivable.subtract(amountReceivedSum) + "未缴费,请尽快缴费";
+
+ DemandPaymentRecord demandPaymentRecord = new DemandPaymentRecord();
+ demandPaymentRecord.setCaseId(caseId);
+ demandPaymentRecord.setCollectionContent(msg);
+ demandPaymentRecord.setCollectionUserId(userId);
+ demandPaymentRecord.setCollectionUserName(nickName);
+ demandPaymentRecordMapper.insert(demandPaymentRecord);
+ return true;
+ }catch (Exception e){
+ e.printStackTrace();
+ throw new RuntimeException("催费失败");
+ }
+ }
+
+ @Override
+ public boolean setRead(Map params) {
+ try {
+ Long caseId = Long.parseLong(params.get("caseId").toString());
+ String idsStr = (String) params.get("ids");
+ List ids = Arrays.stream(idsStr.split(",")).map(Long::parseLong).collect(Collectors.toList());
+ demandPaymentRecordMapper.setRead(caseId, ids);
+ return true;
+ }catch (Exception e){
+ e.printStackTrace();
+ throw new RuntimeException("设置已读失败");
+ }
+ }
+
+}
diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/IIndexServiceImpl.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/IIndexServiceImpl.java
index c4012dea..647e41bf 100644
--- a/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/IIndexServiceImpl.java
+++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/IIndexServiceImpl.java
@@ -1,12 +1,16 @@
package com.tcctlo.law.service.impl;
import cn.hutool.core.date.DateUtil;
+import com.tcctlo.common.core.domain.model.LoginUser;
+import com.tcctlo.common.utils.SecurityUtils;
+import com.tcctlo.law.CaseEnum;
import com.tcctlo.law.entity.CollectionRecord;
import com.tcctlo.law.entity.IndexStatistics;
import com.tcctlo.law.mapper.CaseInformationMapper;
import com.tcctlo.law.mapper.CollectionRecordMapper;
import com.tcctlo.law.service.ICollectionRecordService;
import com.tcctlo.law.service.IIndexService;
+import com.tcctlo.system.mapper.SysUserMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -24,39 +28,82 @@ public class IIndexServiceImpl implements IIndexService {
@Resource
private CollectionRecordMapper recordMapper;
+ /**
+ * 系统用户mapper
+ */
+ @Resource
+ private SysUserMapper sysUserMapper;
+
@Override
public List caseTypeStatistics(Date startTime, Date endTime) {
+ LoginUser loginUser = SecurityUtils.getLoginUser();
+ String roleKey = sysUserMapper.selectUserRoleByUserId(loginUser.getUserId());
+
+ //如果当前登录用户的角色【律师】,则查询当前登录律师的案件信息,否则查询全部案件信息
+ String userId = "";
+ if (CaseEnum.LAWYER.getRoleKey().equals(roleKey)) {
+ userId = loginUser.getUserId().toString();
+ }
List res = new ArrayList<>();
- res.add(new IndexStatistics("民商事业务", Double.valueOf(caseInformationMapper.selectCountByBusinessType(0, startTime, endTime))));
- res.add(new IndexStatistics("刑事辩护业务", Double.valueOf(caseInformationMapper.selectCountByBusinessType(1, startTime, endTime))));
- res.add(new IndexStatistics("行政复议及诉讼业务", Double.valueOf(caseInformationMapper.selectCountByBusinessType(2, startTime, endTime))));
- res.add(new IndexStatistics("企业常年法律顾问", Double.valueOf(caseInformationMapper.selectCountByBusinessType(3, startTime, endTime))));
- res.add(new IndexStatistics("企业专项法律顾问", Double.valueOf(caseInformationMapper.selectCountByBusinessType(4, startTime, endTime))));
+ res.add(new IndexStatistics("民商事业务", Double.valueOf(caseInformationMapper.selectCountByBusinessType(userId, 0, startTime, endTime))));
+ res.add(new IndexStatistics("刑事辩护业务", Double.valueOf(caseInformationMapper.selectCountByBusinessType(userId, 1, startTime, endTime))));
+ res.add(new IndexStatistics("行政复议及诉讼业务", Double.valueOf(caseInformationMapper.selectCountByBusinessType(userId, 2, startTime, endTime))));
+ res.add(new IndexStatistics("企业常年法律顾问", Double.valueOf(caseInformationMapper.selectCountByBusinessType(userId, 3, startTime, endTime))));
+ res.add(new IndexStatistics("企业专项法律顾问", Double.valueOf(caseInformationMapper.selectCountByBusinessType(userId, 4, startTime, endTime))));
return res;
}
@Override
public List conflictStatistics(Date startTime, Date endTime) {
+ LoginUser loginUser = SecurityUtils.getLoginUser();
+ String roleKey = sysUserMapper.selectUserRoleByUserId(loginUser.getUserId());
+
+ //如果当前登录用户的角色【律师】,则查询当前登录律师的案件信息,否则查询全部案件信息
+ String userId = "";
+ if (CaseEnum.LAWYER.getRoleKey().equals(roleKey)) {
+ userId = loginUser.getUserId().toString();
+ }
+
List res = new ArrayList<>();
- res.add(new IndexStatistics("利冲收案", Double.valueOf(caseInformationMapper.conflictStatistics(0, startTime, endTime))));
- res.add(new IndexStatistics("正常收案", Double.valueOf(caseInformationMapper.conflictStatistics(1, startTime, endTime))));
- res.add(new IndexStatistics("终止收案", Double.valueOf(caseInformationMapper.conflictStatistics(2, startTime, endTime))));
- res.add(new IndexStatistics("案件撤销", Double.valueOf(caseInformationMapper.conflictStatistics(3, startTime, endTime))));
+
+ res.add(new IndexStatistics("利冲收案", Double.valueOf(caseInformationMapper.conflictStatistics(userId, 0, startTime, endTime))));
+ res.add(new IndexStatistics("正常收案", Double.valueOf(caseInformationMapper.conflictStatistics(userId, 1, startTime, endTime))));
+ res.add(new IndexStatistics("终止收案", Double.valueOf(caseInformationMapper.conflictStatistics(userId, 2, startTime, endTime))));
+ res.add(new IndexStatistics("案件撤销", Double.valueOf(caseInformationMapper.conflictStatistics(userId, 3, startTime, endTime))));
return res;
}
@Override
public List costStatistics(Date startTime, Date endTime) {
+ LoginUser loginUser = SecurityUtils.getLoginUser();
+ String roleKey = sysUserMapper.selectUserRoleByUserId(loginUser.getUserId());
+
+ //如果当前登录用户的角色【律师】,则查询当前登录律师的案件信息,否则查询全部案件信息
+ String userId = "";
+ if (CaseEnum.LAWYER.getRoleKey().equals(roleKey)) {
+ userId = loginUser.getUserId().toString();
+ }
+
List res = new ArrayList<>();
- res.add(new IndexStatistics("未收款", Double.valueOf(caseInformationMapper.outstandingPayment(startTime, endTime))));
- res.add(new IndexStatistics("部分收费", Double.valueOf(caseInformationMapper.partialCharge(startTime, endTime))));
- res.add(new IndexStatistics("付款逾期", Double.valueOf(caseInformationMapper.overdue(startTime, endTime))));
+ res.add(new IndexStatistics("未收款", Double.valueOf(caseInformationMapper.outstandingPayment(userId, startTime, endTime))));
+ res.add(new IndexStatistics("部分收费", Double.valueOf(caseInformationMapper.partialCharge(userId, startTime, endTime))));
+ res.add(new IndexStatistics("付款逾期", Double.valueOf(caseInformationMapper.overdue(userId, startTime, endTime))));
return res;
}
@Override
public List earningsTrend(Date startTime, Date endTime) {
- List list = recordMapper.earningsTrend(startTime, endTime);
+
+ LoginUser loginUser = SecurityUtils.getLoginUser();
+ String roleKey = sysUserMapper.selectUserRoleByUserId(loginUser.getUserId());
+
+ //如果当前登录用户的角色【律师】,则查询当前登录律师的案件信息,否则查询全部案件信息
+ String userId = "";
+ if (CaseEnum.LAWYER.getRoleKey().equals(roleKey)) {
+ userId = loginUser.getUserId().toString();
+ }
+
+ List list = recordMapper.earningsTrend(userId, startTime, endTime);
Map> map = list.stream().collect(Collectors.groupingBy(item -> DateUtil.parse(DateUtil.format(item.getCreateTime(), "yyyy-MM-dd"))));
TreeMap> treeMap = new TreeMap<>(map);
List res = new ArrayList<>();
diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/ImpulseInformationServiceImpl.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/ImpulseInformationServiceImpl.java
index bbd10a0e..0c2a856c 100644
--- a/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/ImpulseInformationServiceImpl.java
+++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/ImpulseInformationServiceImpl.java
@@ -1,16 +1,17 @@
package com.tcctlo.law.service.impl;
import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.tcctlo.common.core.domain.AjaxResult;
import com.tcctlo.common.utils.StringUtils;
-import com.tcctlo.law.entity.CaseInformation;
-import com.tcctlo.law.entity.ClashInfoVO;
-import com.tcctlo.law.entity.ImpulseInformation;
+import com.tcctlo.law.entity.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.tcctlo.law.entity.wordTemplateEntity.ClashMsgCaseInfoItem;
import com.tcctlo.law.mapper.CaseInformationMapper;
import com.tcctlo.law.mapper.ImpulseInformationMapper;
import com.tcctlo.law.service.IImpulseInformationService;
@@ -45,10 +46,10 @@ public class ImpulseInformationServiceImpl extends ServiceImpl list(Map params) {
Page resPage = new Page<>();
Page page = impulseInformationMapper.selectCondition(new Page<>((Integer) params.get("current"), (Integer) params.get("size")), params);
- if (page.getRecords() != null){
+ if (page.getRecords() != null) {
List list = BeanUtil.copyToList(page.getRecords(), ImpulseInformationVO.class);
list.stream().peek(item -> {
- if (item.getCaseId() != null){
+ if (item.getCaseId() != null) {
CaseInformation caseInformation = caseInformationMapper.selectById(item.getCaseId());
item.setCaseInfoName(caseInformation.getCaseName());
item.setTermOfConsultancy(caseInformation.getTermOfConsultancy());
@@ -83,17 +84,64 @@ public class ImpulseInformationServiceImpl extends ServiceImpl resList = impulseInformationMapper.retrievalConflict(impulseInformation);
return resList.isEmpty();
}*/
+ /*@Override
+ public Map retrievalConflict(ImpulseInformation impulseInformation) {
+ */
+
+ /**
+ * 当 impulseInformation.getIsClient() 的值为 0 时,1 - 0 结果为 1;当 impulseInformation.getIsClient() 的值为 1 时,1 - 1 结果为 0
+ * 注意:
+ * 1、如果是【委托方】就去检索【相对方】中有没有
+ * 2、如果是【相对方】就去检索【委托方】中有没有
+ * 3、【委托方】不能是律所中任何一个案件的被告方====【被告方】不能是律所中任何一个案件的【委托方】
+ *//*
+ TreeMap resMap = new TreeMap<>();
+ Long id = impulseInformation.getId();
+ if (id != null){
+ resMap.put("result", true);
+ resMap.put("clashInfo", null);
+ return resMap;
+ }
+
+ List clashInfoVOS = new ArrayList<>();
+ *//*impulseInformation.setIsClient(1 - impulseInformation.getIsClient());*//*
+
+ if (impulseInformation.getIsClient() == 0){
+ impulseInformation.setIsClient(1);
+ }
+ if (impulseInformation.getIsClient() == 1){
+ impulseInformation.setIsClient(0);
+ }
+
+ List resList = impulseInformationMapper.retrievalConflict(impulseInformation);
+ resMap.put("result", resList.isEmpty());
+
+ for (ImpulseInformation item : resList) {
+ ClashInfoVO clashInfoVO = new ClashInfoVO();
+ CaseInformationListVO caseInformationListVO = caseInformationMapper.selectCaseById(item.getCaseId());
+ clashInfoVO.setCaseId(item.getCaseId());
+ clashInfoVO.setCaseInfoName(caseInformationListVO.getCaseName());
+ clashInfoVO.setCaseInfoNo(caseInformationListVO.getCaseNo());
+ clashInfoVO.setCaseName(item.getCaseName());
+ clashInfoVO.setCaseNo(item.getCaseNo());
+ clashInfoVO.setCaseType(item.getCaseType());
+ clashInfoVO.setIsClient(item.getIsClient());
+ clashInfoVOS.add(clashInfoVO);
+ }
+ resMap.put("clashInfo", clashInfoVOS);
+ return resMap;
+ }*/
@Override
public Map retrievalConflict(ImpulseInformation impulseInformation) {
/**
@@ -105,9 +153,54 @@ public class ImpulseInformationServiceImpl extends ServiceImpl resMap = new TreeMap<>();
List clashInfoVOS = new ArrayList<>();
+ Long id = impulseInformation.getId();
+ /*if (id != null){
+ ImpulseInformation item = impulseInformationMapper.selectById(id);
+ if (item.getCheckFlag() == 0){
+ resMap.put("result", false);
+ ClashInfoVO clashInfoVO = BeanUtil.copyProperties(item, ClashInfoVO.class);
+ clashInfoVOS.add(clashInfoVO);
+ resMap.put("clashInfo", clashInfoVOS);
+ return resMap;
+ }else {
+ resMap.put("result", true);
+ resMap.put("clashInfo", null);
+ return resMap;
+ }
+ }*/
+
+
+ if (id != null) {
+ ImpulseInformation info = impulseInformationMapper.selectById(id);
+ if (info.getCheckFlag() == 0) {
+ impulseInformation.setIsClient(1 - impulseInformation.getIsClient());
+ List resList = impulseInformationMapper.retrievalConflict(impulseInformation);
+ resMap.put("result", resList.isEmpty());
+ for (ImpulseInformation item : resList) {
+ ClashInfoVO clashInfoVO = new ClashInfoVO();
+ CaseInformationListVO caseInformationListVO = caseInformationMapper.selectCaseById(item.getCaseId());
+ clashInfoVO.setCaseId(item.getCaseId());
+ clashInfoVO.setCaseInfoName(caseInformationListVO.getCaseName());
+ clashInfoVO.setCaseInfoNo(caseInformationListVO.getCaseNo());
+ clashInfoVO.setCaseName(item.getCaseName());
+ clashInfoVO.setCaseNo(item.getCaseNo());
+ clashInfoVO.setCaseType(item.getCaseType());
+ clashInfoVO.setIsClient(item.getIsClient());
+ clashInfoVOS.add(clashInfoVO);
+ }
+ resMap.put("clashInfo", clashInfoVOS);
+ return resMap;
+ } else {
+ resMap.put("result", true);
+ resMap.put("clashInfo", null);
+ return resMap;
+ }
+ }
+
impulseInformation.setIsClient(1 - impulseInformation.getIsClient());
List resList = impulseInformationMapper.retrievalConflict(impulseInformation);
resMap.put("result", resList.isEmpty());
+
for (ImpulseInformation item : resList) {
ClashInfoVO clashInfoVO = new ClashInfoVO();
CaseInformationListVO caseInformationListVO = caseInformationMapper.selectCaseById(item.getCaseId());
@@ -134,6 +227,181 @@ public class ImpulseInformationServiceImpl extends ServiceImpl auditClashMsg(Long caseId) {
+ //去利冲信息库查询信息,现将疑似利冲的数据获取出来,去查询这些利冲的数据和哪些案件的数据有利冲
+ List resMsg = new ArrayList<>();
+ HashMap> map = new HashMap<>(); //如果前端需要
+ List clashInfo = impulseInformationMapper.auditClashMsg(caseId);
+ for (ImpulseInformation item : clashInfo) {
+ item.setIsClient(1 - item.getIsClient());
+ List resList = impulseInformationMapper.retrievalConflict(item);
+ item.setIsClient(1 - item.getIsClient());
+ map.put(item, resList);
+ CaseInformation caseItem = caseInformationMapper.selectById(item.getCaseId());
+ StringBuilder msg = new StringBuilder("当前案件中:" + (item.getIsClient() == 0 ? "【委托方】->" : "【相对方】->") + item.getCaseName() + "[" + item.getCaseNo() + "]" + "与以下案件中的委托方/相对方有利冲嫌疑:");
+ for (ImpulseInformation in : resList) {
+ CaseInformation ci = caseInformationMapper.selectById(in.getCaseId());
+ //String msg = caseItem.getCaseName() + "【" + caseItem.getCaseNo() + "】案件中的" + (item.getIsClient() == 0 ? "【委托方】" : "【相对方】") + item.getCaseName() + "[" + item.getCaseNo() + "]" + "与" + ci.getCaseName() + "【" + ci.getCaseNo() + "】案件中的" + (in.getIsClient() == 0 ? "【委托方】" : "【相对方】") + in.getCaseName() + "[" + in.getCaseNo() + "]" + "有疑似利冲信息";
+ msg.append(ci.getCaseName()).append("【").append(ci.getCaseNo()).append("】案件中的").append(in.getIsClient() == 0 ? "【委托方】" : "【相对方】").append(in.getCaseName()).append("[").append(in.getCaseNo()).append("]").append("有疑似利冲信息;");
+
+ }
+ resMsg.add(msg.toString());
+ msg.setLength(0);
+ }
+ return resMsg;
+
+ }*/
+
+
+ /*@Override
+ public List auditClashMsg(Long caseId) {
+ //去利冲信息库查询信息,现将疑似利冲的数据获取出来,去查询这些利冲的数据和哪些案件的数据有利冲
+ List clashMsgList = new ArrayList<>();
+ List clashInfo = impulseInformationMapper.auditClashMsg(caseId);
+
+ for (ImpulseInformation item : clashInfo) {
+ ClashMsg clashMsg = new ClashMsg();
+ item.setIsClient(1 - item.getIsClient());
+ List resList = impulseInformationMapper.retrievalConflict(item);
+ item.setIsClient(1 - item.getIsClient());
+ CaseInformation caseItem = caseInformationMapper.selectById(item.getCaseId()); //查询当前案件信息【暂时不需要】
+ clashMsg.setMsgMain("当前案件中:" + (item.getIsClient() == 0 ? "【委托方】->" : "【相对方】->") + item.getCaseName() + "[" + item.getCaseNo() + "]" + "与以下案件中的委托方/相对方有利冲嫌疑:");
+ ArrayList strings = new ArrayList<>();
+ for (ImpulseInformation in : resList) {
+ CaseInformation ci = caseInformationMapper.selectById(in.getCaseId());
+ strings.add(ci.getCaseName() + "【" + ci.getCaseNo() + "】案件中的" + (in.getIsClient() == 0 ? "【委托方】" : "【相对方】") + in.getCaseName() + "[" + in.getCaseNo() + "]" + "有疑似利冲信息");
+ }
+ clashMsg.setMsgSub(strings);
+ clashMsgList.add(clashMsg);
+ }
+ return clashMsgList;
+
+ }*/
+
+ @Override
+ public AjaxResult auditClashMsg(Long caseId) {
+ AjaxResult ajaxResult = new AjaxResult();
+ //去利冲信息库查询信息,现将疑似利冲的数据获取出来,去查询这些利冲的数据和哪些案件的数据有利冲
+ List clashMsgWithCaseInfos = new ArrayList<>();
+ List clashInfo = impulseInformationMapper.auditClashMsg(caseId);
+ for (ImpulseInformation item : clashInfo) {
+ ClashMsgWithCaseInfo clashMsgWithCaseInfo = new ClashMsgWithCaseInfo();
+ item.setIsClient(1 - item.getIsClient());
+ List resList = impulseInformationMapper.retrievalConflict(item);
+ item.setIsClient(1 - item.getIsClient());
+ CaseInformation caseItem = caseInformationMapper.selectById(item.getCaseId()); //查询当前案件信息【暂时不需要】
+ clashMsgWithCaseInfo.setMsgMain("当前案件中:" + (item.getIsClient() == 0 ? "【委托方】->" : "【相对方】->") + item.getCaseName() + "[" + item.getCaseNo() + "]" + "与以下案件中的委托方/相对方有利冲嫌疑:");
+ List list = new ArrayList<>();
+ for (ImpulseInformation in : resList) {
+ CaseInformation ci = caseInformationMapper.selectById(in.getCaseId());
+ ClashMsgCaseInfoItem clashMsgCaseInfoItem = new ClashMsgCaseInfoItem();
+ clashMsgCaseInfoItem.setCaseId(ci.getId());
+ clashMsgCaseInfoItem.setMsg(ci.getCaseName() + "【" + ci.getCaseNo() + "】案件中的" + (in.getIsClient() == 0 ? "【委托方】" : "【相对方】") + in.getCaseName() + "[" + in.getCaseNo() + "]" + "有疑似利冲信息");
+ list.add(clashMsgCaseInfoItem);
+ }
+ clashMsgWithCaseInfo.setMsgSub(list);
+ clashMsgWithCaseInfos.add(clashMsgWithCaseInfo);
+ }
+ boolean flag = true;
+
+ for (ClashMsgWithCaseInfo item : clashMsgWithCaseInfos) {
+ if (item.getMsgSub().size() > 0){
+ flag = false;
+ break;
+ }
+ }
+ if (flag){
+ ajaxResult.put("code", 200);
+ ajaxResult.put("msg", "操作成功");
+ ajaxResult.put("data", "noClashInfo");
+ }else {
+ ajaxResult.put("code", 200);
+ ajaxResult.put("msg", "操作成功");
+ ajaxResult.put("data", clashMsgWithCaseInfos);
+ }
+ return ajaxResult;
+
+ }
+
+
+
+ @Override
+ public AjaxResult ClashMsgBatch(List impulseInformation) {
+ AjaxResult ajaxResult = new AjaxResult();
+ List clashMsgWithCaseInfos = new ArrayList<>();
+ for (ImpulseInformation item : impulseInformation) {
+ ClashMsg clashMsg = new ClashMsg();
+ ClashMsgWithCaseInfo clashMsgWithCaseInfo = new ClashMsgWithCaseInfo();
+
+ item.setIsClient(1 - item.getIsClient());
+ List resList = impulseInformationMapper.retrievalConflict(item);
+ item.setIsClient(1 - item.getIsClient());
+ CaseInformation caseItem = caseInformationMapper.selectById(item.getCaseId()); //查询当前案件信息【暂时不需要】
+
+ clashMsgWithCaseInfo.setMsgMain("当前案件中:" + (item.getIsClient() == 0 ? "【委托方】->" : "【相对方】->") + item.getCaseName() + "[" + item.getCaseNo() + "]" + "与以下案件中的委托方/相对方有利冲嫌疑:");
+
+ if (resList.size() > 0){
+ List list = new ArrayList<>();
+ for (ImpulseInformation in : resList) {
+ CaseInformation ci = caseInformationMapper.selectById(in.getCaseId());
+ ClashMsgCaseInfoItem clashMsgCaseInfoItem = new ClashMsgCaseInfoItem();
+ clashMsgCaseInfoItem.setCaseId(ci.getId());
+ clashMsgCaseInfoItem.setMsg(ci.getCaseName() + "【" + ci.getCaseNo() + "】案件中的" + (in.getIsClient() == 0 ? "【委托方】" : "【相对方】") + in.getCaseName() + "[" + in.getCaseNo() + "]" + "有疑似利冲信息");
+ list.add(clashMsgCaseInfoItem);
+ }
+ clashMsgWithCaseInfo.setMsgSub(list);
+ clashMsgWithCaseInfos.add(clashMsgWithCaseInfo);
+ }
+ }
+
+ System.out.println(impulseInformation);
+
+ boolean flag = true;
+
+ for (ClashMsgWithCaseInfo item : clashMsgWithCaseInfos) {
+ if (item.getMsgSub().size() > 0){
+ flag = false;
+ break;
+ }
+ }
+ if (flag){
+ ajaxResult.put("code", 200);
+ ajaxResult.put("msg", "操作成功");
+ ajaxResult.put("data", "noClashInfo");
+ }else {
+ ajaxResult.put("code", 200);
+ ajaxResult.put("msg", "操作成功");
+ ajaxResult.put("data", clashMsgWithCaseInfos);
+ }
+ return ajaxResult;
+ }
+
+
+ /*@Override
+ public Object ClashMsgBatch(List impulseInformation) {
+ List clashMsgList = new ArrayList<>();
+ for (ImpulseInformation item : impulseInformation) {
+ ClashMsg clashMsg = new ClashMsg();
+ item.setIsClient(1 - item.getIsClient());
+ List resList = impulseInformationMapper.retrievalConflict(item);
+ item.setIsClient(1 - item.getIsClient());
+ CaseInformation caseItem = caseInformationMapper.selectById(item.getCaseId()); //查询当前案件信息【暂时不需要】
+ clashMsg.setMsgMain("当前案件中:" + (item.getIsClient() == 0 ? "【委托方】->" : "【相对方】->") + item.getCaseName() + "[" + item.getCaseNo() + "]" + "与以下案件中的委托方/相对方有利冲嫌疑:");
+ ArrayList strings = new ArrayList<>();
+ for (ImpulseInformation in : resList) {
+ CaseInformation ci = caseInformationMapper.selectById(in.getCaseId());
+ strings.add(ci.getCaseName() + "【" + ci.getCaseNo() + "】案件中的" + (in.getIsClient() == 0 ? "【委托方】" : "【相对方】") + in.getCaseName() + "[" + in.getCaseNo() + "]" + "有疑似利冲信息");
+ }
+ clashMsg.setMsgSub(strings);
+ clashMsgList.add(clashMsg);
+ }
+
+ System.out.println(impulseInformation);
+
+ return clashMsgList;
+ }*/
+
@Override
public ImpulseInformation getById(Long id) {
return impulseInformationMapper.selectById(id);
diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/tools/RedisGenerateCaseNo.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/tools/RedisGenerateCaseNo.java
new file mode 100644
index 00000000..3ee4f6bf
--- /dev/null
+++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/tools/RedisGenerateCaseNo.java
@@ -0,0 +1,46 @@
+package com.tcctlo.law.tools;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.StringRedisTemplate;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.time.LocalDate;
+
+@Component
+public class RedisGenerateCaseNo {
+
+ @Autowired
+ private StringRedisTemplate stringRedisTemplate;
+
+ private static final String COUNTER_KEY_PREFIX = "DAILY_COUNTER:"; // Redis键前缀
+
+
+ /**
+ * 生成案件编号
+ * @return 案件编号
+ */
+ public String generateCaseNo(Integer businessClassify) {
+
+ String currentDate = LocalDate.now().toString().replace("-", ""); //获取当前日期
+
+ String counterKey = COUNTER_KEY_PREFIX + currentDate; //组装Redis的Key
+
+ Long counter = stringRedisTemplate.opsForValue().increment(counterKey);
+
+ switch (businessClassify){
+ case 0:
+ return String.format("MS-%s-%03d", currentDate, counter);
+ case 1:
+ return String.format("XS-%s-%03d", currentDate, counter);
+ case 2:
+ return String.format("XZ-%s-%03d", currentDate, counter);
+ case 3:
+ return String.format("CN-%s-%03d", currentDate, counter);
+ case 4:
+ return String.format("ZX-%s-%03d", currentDate, counter);
+ }
+
+ return String.format("DEFAULT-%s-%03d", currentDate, counter);
+ }
+}
diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/vo/CaseInformationListVO.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/vo/CaseInformationListVO.java
index dafeb750..541dcb3a 100644
--- a/tcctlo-law-office/src/main/java/com/tcctlo/law/vo/CaseInformationListVO.java
+++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/vo/CaseInformationListVO.java
@@ -1,6 +1,7 @@
package com.tcctlo.law.vo;
import com.tcctlo.law.entity.CaseInformation;
+import com.tcctlo.law.entity.DemandPaymentRecord;
import com.tcctlo.law.entity.FileManager;
import lombok.AllArgsConstructor;
import lombok.Data;
@@ -53,6 +54,11 @@ public class CaseInformationListVO extends CaseInformation {
*/
private List fileList;
+ /**
+ * 催款记录
+ */
+ private List demandPaymentRecordList;
+
}
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 e2da03ed..82eb05d3 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
@@ -83,6 +83,15 @@
where ci.id = #{caseId}
+
+ update case_information ci
+
+
+ ci.case_lawyer_ids = #{lawIds},
+
+
+ where ci.id = #{caseId}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tcctlo-law-office/src/main/resources/mapper/tcctlo-law-office/DemandPaymentRecordMapper.xml b/tcctlo-law-office/src/main/resources/mapper/tcctlo-law-office/DemandPaymentRecordMapper.xml
new file mode 100644
index 00000000..6448712d
--- /dev/null
+++ b/tcctlo-law-office/src/main/resources/mapper/tcctlo-law-office/DemandPaymentRecordMapper.xml
@@ -0,0 +1,30 @@
+
+
+
+
+ update demand_payment_record dpr
+ set is_read = 0
+
+
+ dpr.case_id = #{caseId}
+
+ and dpr.id in
+
+ #{id}
+
+
+
+
+
diff --git a/tcctlo-law-office/src/main/resources/mapper/tcctlo-law-office/ImpulseInformationMapper.xml b/tcctlo-law-office/src/main/resources/mapper/tcctlo-law-office/ImpulseInformationMapper.xml
index eaf97a25..2eb485a9 100644
--- a/tcctlo-law-office/src/main/resources/mapper/tcctlo-law-office/ImpulseInformationMapper.xml
+++ b/tcctlo-law-office/src/main/resources/mapper/tcctlo-law-office/ImpulseInformationMapper.xml
@@ -54,7 +54,7 @@
and ii.status = 0
-
+
+ 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 su.user_id = #{id}
+ and sr.status = '0' and sr.del_flag = '0' and su.status = '0' and su.del_flag = '0'
+
insert into sys_user(