[UPDATE]:修改、完善相关业务

This commit is contained in:
张世琪 2025-03-04 15:16:50 +08:00
parent 50bb132190
commit f2773f3ea8
36 changed files with 1387 additions and 77 deletions

View File

@ -7,7 +7,12 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
@AllArgsConstructor
public enum CaseEnum {
LAWYER("律师", "LAWYER");
LAWYER("律师", "LAWYER"),
ADMIN("管理员","admin"),
ASSISTING_LAWYER("协办律师","ASSISTING_LAWYER"),
RISK_CONTROL_PERSONNEL("风控人员","RISK_CONTROL_PERSONNEL"),
INDOOR_STAFF("内勤","INDOOR_STAFF"),
CAIWU("财务","CAIWU");
private String roleName;
private String roleKey;

View File

@ -32,6 +32,8 @@ public class CaseInformationController extends BaseController {
private ICaseInformationService iCaseInformationService;
/**
* 案件审核
* @param params 参数案件编号审核状态审核意见idauditStatusauditOpinion
@ -196,4 +198,6 @@ public class CaseInformationController extends BaseController {
Integer result = iCaseInformationService.update(params);
return AjaxResult.success(result);
}
}

View File

@ -3,10 +3,13 @@ package com.tcctlo.law.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tcctlo.common.core.domain.AjaxResult;
import com.tcctlo.law.entity.CaseLawyer;
import com.tcctlo.law.entity.TransferParam;
import com.tcctlo.law.service.ICaseLawyerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* <p>
* 案件律师表 前端控制器
@ -24,6 +27,25 @@ public class CaseLawyerController {
@Autowired
private ICaseLawyerService iCaseLawyerService;
/**
* 案件转移
* @param params 参数新律师旧律师要转移的案件IDS
* @return
*/
@PostMapping("/transferLawyer")
public AjaxResult transferLawyer(@RequestBody TransferParam params) {
AjaxResult ajaxResult = new AjaxResult();
if (iCaseLawyerService.transferLawyer(params)) {
ajaxResult.put("msg", "设置成功!");
ajaxResult.put("code", 200);
}else {
ajaxResult.put("msg", "设置失败!");
ajaxResult.put("code", 500);
}
return ajaxResult;
}
@GetMapping(value = "/list")
public AjaxResult list(@RequestParam(required = false) Integer current, @RequestParam(required = false) Integer size) {
if (current == null) {

View File

@ -0,0 +1,103 @@
package com.tcctlo.law.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tcctlo.common.core.domain.AjaxResult;
import com.tcctlo.law.entity.DemandPaymentRecord;
import com.tcctlo.law.service.IDemandPaymentRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* <p>
* 金额催收记录 前端控制器
* </p>
*
* @author
* @since 2025-02-27
*/
@RestController
@RequestMapping("/demandPaymentRecord")
public class DemandPaymentRecordController {
@Autowired
private IDemandPaymentRecordService iDemandPaymentRecordService;
/**
* 根据案件ID对案件进行催收
*
* @param params 参数
* @return 结果集
*/
@PostMapping(value = "/caseCollection")
public AjaxResult caseCollection(@RequestBody Map<String, Long> params) {
AjaxResult ajaxResult = new AjaxResult();
if (iDemandPaymentRecordService.caseCollection(params)) {
ajaxResult.put("msg", "催费成功!");
ajaxResult.put("code", 200);
}else {
ajaxResult.put("msg", "催费失败!");
ajaxResult.put("code", 500);
}
return ajaxResult;
}
/**
* 设置催收消息已读
* @param params 参数
* @return 结果集
*/
@PostMapping("/setRead")
public AjaxResult setRead(@RequestBody Map<String, Object> params) {
AjaxResult ajaxResult = new AjaxResult();
if (iDemandPaymentRecordService.setRead(params)) {
ajaxResult.put("msg", "设置成功!");
ajaxResult.put("code", 200);
}else {
ajaxResult.put("msg", "设置失败!");
ajaxResult.put("code", 500);
}
return ajaxResult;
}
@GetMapping(value = "/list")
public AjaxResult list(@RequestParam(required = false) Integer current, @RequestParam(required = false) Integer size) {
if (current == null) {
current = 1;
}
if (size == null) {
size = 10;
}
Page<DemandPaymentRecord> pageList = iDemandPaymentRecordService.list(current, size);
return AjaxResult.success(pageList);
}
@GetMapping(value = "/{id}")
public AjaxResult getById(@PathVariable("id") Long id) {
DemandPaymentRecord demandPaymentRecord = iDemandPaymentRecordService.getById(id);
return AjaxResult.success(demandPaymentRecord);
}
@PostMapping(value = "/create")
public AjaxResult create(@RequestBody DemandPaymentRecord params) {
Integer result = iDemandPaymentRecordService.create(params);
return AjaxResult.success(result);
}
@PostMapping(value = "/delete/{id}")
public AjaxResult delete(@PathVariable("id") Long id) {
Integer result = iDemandPaymentRecordService.delete(id);
return AjaxResult.success(result);
}
@PostMapping(value = "/update")
public AjaxResult update(@RequestBody DemandPaymentRecord params) {
Integer result = iDemandPaymentRecordService.update(params);
return AjaxResult.success(result);
}
}

View File

@ -2,6 +2,7 @@ package com.tcctlo.law.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tcctlo.common.core.domain.AjaxResult;
import com.tcctlo.law.entity.ClashMsg;
import com.tcctlo.law.entity.ImpulseInformation;
import com.tcctlo.law.service.IImpulseInformationService;
import com.tcctlo.law.vo.ImpulseInformationVO;
@ -36,6 +37,26 @@ public class ImpulseInformationController {
return AjaxResult.success(pageList);
}
/**
* 审核时利冲消息提示
* @param caseId 案件ID
* @return 结果集
*/
@GetMapping("/auditClashMsg/{caseId}")
public AjaxResult auditClashMsg(@PathVariable("caseId") Long caseId) {
return iImpulseInformationService.auditClashMsg(caseId);
}
/**
* 利冲信息检测-批量
* @param impulseInformation 要检测的利冲信息
* @return 结果集
*/
@PostMapping(value = "/ClashMsgBatch")
public AjaxResult ClashMsgBatch(@RequestBody List<ImpulseInformation> impulseInformation) {
return iImpulseInformationService.ClashMsgBatch(impulseInformation);
}
/*@GetMapping(value = "/list")
public AjaxResult list(@RequestParam(required = false) Integer current, @RequestParam(required = false) Integer size) {

View File

@ -29,8 +29,8 @@ public class IndexController {
* @return 结果集
*/
@GetMapping("/caseTypeStatistics")
public AjaxResult caseTypeStatistics(@RequestParam("startTime") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date startTime,
@RequestParam("endTime") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endTime) {
public AjaxResult caseTypeStatistics(@RequestParam(value = "startTime", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date startTime,
@RequestParam(value = "endTime", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endTime) {
List<IndexStatistics> integerIntegerMap = iIndexService.caseTypeStatistics(startTime, endTime);
return AjaxResult.success(integerIntegerMap);
}

View File

@ -0,0 +1,17 @@
package com.tcctlo.law.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ClashMsg {
private String msgMain;
private List<String> msgSub;
}

View File

@ -0,0 +1,19 @@
package com.tcctlo.law.entity;
import com.tcctlo.law.entity.wordTemplateEntity.ClashMsgCaseInfoItem;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
import java.util.Map;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ClashMsgWithCaseInfo {
private String msgMain;
private List<ClashMsgCaseInfoItem> msgSub;
}

View File

@ -0,0 +1,92 @@
package com.tcctlo.law.entity;
import com.baomidou.mybatisplus.annotation.*;
import java.util.Date;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 金额催收记录
* </p>
*
* @author
* @since 2025-02-27
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("demand_payment_record")
public class DemandPaymentRecord implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 关联案件ID催收哪一个案件的消息
*/
private Long caseId;
/**
* 催收内容
*/
private String collectionContent;
/**
* 是否已读0已读1未读
*/
private Integer isRead;
/**
* 催收人ID关联系统用户ID
*/
private Long collectionUserId;
/**
* 催收人名称
*/
private String collectionUserName;
/**
* 状态0正常1停用
*/
private Integer status;
/**
* 删除标志0未删除1已删除
*/
@TableLogic
private Integer delFlag;
/**
* 创建者
*/
private String createBy;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 修改者
*/
private String updateBy;
/**
* 修改时间
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
/**
* 备注
*/
private String remake;
}

View File

@ -0,0 +1,29 @@
package com.tcctlo.law.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 案件转移参数
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class TransferParam {
/**
* 新律师ID
*/
private Long oldLawyerId;
/**
* 旧律师ID
*/
private Long newLawyerId;
/**
* 要转移的案件IDS
*/
private String caseIds;
}

View File

@ -0,0 +1,15 @@
package com.tcctlo.law.entity.wordTemplateEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ClashMsgCaseInfoItem {
private Long caseId;
private String msg;
}

View File

@ -106,7 +106,8 @@ public interface CaseInformationMapper extends BaseMapper<CaseInformation> {
* @param type 业务类型
* @return 结果集
*/
Integer selectCountByBusinessType(@Param("type") Integer type,
Integer selectCountByBusinessType(@Param("userId") String userId,
@Param("type") Integer type,
@Param("startTime")Date startTime,
@Param("endTime")Date endTime);
@ -115,7 +116,8 @@ public interface CaseInformationMapper extends BaseMapper<CaseInformation> {
* @param caseStatus 收案状态
* @return 结果集
*/
Integer conflictStatistics(@Param("caseStatus") Integer caseStatus,
Integer conflictStatistics(@Param("userId") String userId,
@Param("caseStatus") Integer caseStatus,
@Param("startTime")Date startTime,
@Param("endTime")Date endTime);
@ -123,20 +125,32 @@ public interface CaseInformationMapper extends BaseMapper<CaseInformation> {
* 未收款统计
* @return 结果集
*/
Integer outstandingPayment(@Param("startTime")Date startTime,
Integer outstandingPayment(@Param("userId") String userId,
@Param("startTime")Date startTime,
@Param("endTime")Date endTime);
/**
* 部分收费统计
* @return 结果集
*/
Integer partialCharge(@Param("startTime")Date startTime,
Integer partialCharge(@Param("userId") String userId,
@Param("startTime")Date startTime,
@Param("endTime")Date endTime);
/**
* 逾期未收费
* @return 结果集
*/
Integer overdue(@Param("startTime")Date startTime,
Integer overdue(@Param("userId") String userId,
@Param("startTime")Date startTime,
@Param("endTime")Date endTime);
/**
* 修改案件涉及律师
* @param id 案件ID
* @param ids 涉及律师IDS
* @return 结果集
*/
Integer updateLawyerIds(@Param("caseId") Long caseId, @Param("lawIds") String lawIds);
}

View File

@ -59,4 +59,25 @@ public interface CaseLawyerMapper extends BaseMapper<CaseLawyer> {
* @return 受影响行数
*/
int deleteLawyerByCaseId(@Param("caseIds") List<Long> caseId);
/**
* 根据律师ID查询改律师担任主板律师的案件ID
*/
List<CaseLawyer> selectPrimeLawyerByLayerId(@Param("lawId") Long lawId);
/**
* 根据案件ID 查询这些案件的主办律师
* @param caseIds 案件IDS
* @return 结果集
*/
List<CaseLawyer> selectByCaseIdPrime(@Param("caseIds") List<Long> caseIds);
/**
* 根据律师ID案件ID查询
* @param lawId 律师ID
* @param caseIds 案件ID集合
* @return 结果集
*/
List<CaseLawyer> selectPrimeLawyerByLayerIdAndCaseId(@Param("lawId") Long lawId, @Param("caseIds") List<Long> caseIds);
}

View File

@ -54,7 +54,7 @@ public interface CollectionRecordMapper extends BaseMapper<CollectionRecord> {
* @param endTime 结束时间
* @return 结果集
*/
List<CollectionRecord> earningsTrend(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
List<CollectionRecord> earningsTrend(@Param("userId") String userId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
/**
* 收费记录审核

View File

@ -0,0 +1,33 @@
package com.tcctlo.law.mapper;
import com.tcctlo.law.entity.DemandPaymentRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 金额催收记录 Mapper 接口
* </p>
*
* @author
* @since 2025-02-27
*/
public interface DemandPaymentRecordMapper extends BaseMapper<DemandPaymentRecord> {
/**
* 根据案件ID查询催收记录
* @param caseId 案件ID
* @return 催收记录
*/
List<DemandPaymentRecord> selectByCaseId(@Param("caseId") Long caseId);
/**
* 设置催费消息已读
* @param caseId 案件ID
* @param ids 消息ID集合
* @return 结果集
*/
int setRead(@Param("caseId") Long caseId, @Param("ids") List<Long> ids);
}

View File

@ -71,4 +71,11 @@ public interface ImpulseInformationMapper extends BaseMapper<ImpulseInformation>
* @return 结果集
*/
Page<ImpulseInformation> selectCondition(@Param("page") Page<ImpulseInformation> page, @Param("condition") Map<String, Object> condition);
/**
* 根据案件ID查询利冲信息在审核时做利冲消息提示
* @param caseId 案件ID
* @return 结果集
*/
List<ImpulseInformation> auditClashMsg(Long caseId);
}

View File

@ -3,6 +3,7 @@ package com.tcctlo.law.service;
import com.tcctlo.law.entity.CaseLawyer;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tcctlo.law.entity.TransferParam;
import java.util.List;
import java.util.Map;
@ -69,4 +70,11 @@ public interface ICaseLawyerService extends IService<CaseLawyer>{
* @return 结果几
*/
List<CaseLawyer> selectByCondition(Map params);
/**
* 案件律师转移
* @param params 参数
* @return 结果集
*/
boolean transferLawyer(TransferParam params);
}

View File

@ -0,0 +1,79 @@
package com.tcctlo.law.service;
import com.tcctlo.law.entity.DemandPaymentRecord;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.Map;
/**
* <p>
* 金额催收记录 服务类
* </p>
*
* @author
* @since 2025-02-27
*/
public interface IDemandPaymentRecordService {
/**
* <p>
* 分页列表查询
* </p>
* @param pageNo
* @param pageSize
* @return
*/
Page<DemandPaymentRecord> list(Integer pageNo, Integer pageSize);
/**
* <p>
* 详情接口
* </p>
* @param id
* @return
*/
DemandPaymentRecord getById(Long id);
/**
* <p>
* 新增接口
* </p>
* @param demandPaymentRecord
* @return
*/
Integer create(DemandPaymentRecord demandPaymentRecord);
/**
* <p>
* 删除接口
* </p>
* @param id
* @return
*/
Integer delete(Long id);
/**
* <p>
* 更新接口
* </p>
* @param demandPaymentRecord
* @return
*/
Integer update(DemandPaymentRecord demandPaymentRecord);
/**
* 根据案件ID对案件进行催收功能
* @param params 参数
* @return 是否成功
*/
Boolean caseCollection(Map<String, Long> params);
/**
* 设置催收消息已读
* @param params 参数
* @return 结果集
*/
boolean setRead(Map<String, Object> params);
}

View File

@ -1,6 +1,8 @@
package com.tcctlo.law.service;
import com.tcctlo.common.core.domain.AjaxResult;
import com.tcctlo.law.entity.ClashInfoVO;
import com.tcctlo.law.entity.ClashMsg;
import com.tcctlo.law.entity.ImpulseInformation;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -85,4 +87,17 @@ public interface IImpulseInformationService extends IService<ImpulseInformation>
* @return 结果集
*/
Map<String, Object> retrievalConflictBatch(List<ImpulseInformation> impulseInformation);
/**
* 审核时利冲消息提示
* @param caseId 案件ID
*/
AjaxResult auditClashMsg(Long caseId);
/**
* 利冲信息检测-批量
* @param impulseInformation 要检测的利冲信息
* @return 结果集
*/
AjaxResult ClashMsgBatch(List<ImpulseInformation> impulseInformation);
}

View File

@ -4,7 +4,6 @@ import com.tcctlo.law.entity.IndexStatistics;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 首页service
@ -34,9 +33,9 @@ public interface IIndexService {
/**
* 收益走势
* @param startTime 其实
* @param endTime
* @return
* @param startTime 起始时间
* @param endTime 结束时间
* @return 数据集
*/
List<IndexStatistics> earningsTrend(Date startTime, Date endTime);
}

View File

@ -13,22 +13,20 @@ import com.tcctlo.law.CaseEnum;
import com.tcctlo.law.entity.*;
import com.tcctlo.law.mapper.*;
import com.tcctlo.law.service.*;
import com.tcctlo.law.tools.GenerateCaseNo;
import com.tcctlo.law.tools.RedisGenerateCaseNo;
import com.tcctlo.law.tools.RichTextToWordSimple;
import com.tcctlo.law.vo.CaseArchivedVO;
import com.tcctlo.law.vo.CaseInformationEnterVO;
import com.tcctlo.law.vo.CaseInformationListVO;
import com.tcctlo.law.vo.CollectionRecordEnterVO;
import com.tcctlo.system.mapper.SysUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
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.*;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
@ -54,6 +52,12 @@ public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMappe
@Resource
private ImpulseInformationMapper impulseInformationMapper;
@Resource
private DemandPaymentRecordMapper demandPaymentRecordMapper;
@Autowired
private RedisGenerateCaseNo redisGenerateCaseNo;
/**
* 系统用户mapper
*/
@ -196,6 +200,8 @@ public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMappe
int fileNum = caseInformationMapper.selectCaseFileNum(item.getId());
item.setFileFlag(fileNum > 0);
item.setFileList(fileManagerMapper.selectFileByCaseId(item.getId()));
item.setDemandPaymentRecordList(demandPaymentRecordMapper.selectByCaseId(item.getId()));
}
return caseInformationPage;
}
@ -314,7 +320,7 @@ public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMappe
String nickName = loginUser.getUser().getNickName();
try {
CaseInformation caseInformation = caseInfo.getCaseInformation(); //案件信息
caseInformation.setCaseNo(GenerateCaseNo.generateRecordNumber()); //生成案件编号
caseInformation.setCaseNo(redisGenerateCaseNo.generateCaseNo(caseInformation.getBusinessClassify())); //生成案件编号
caseInformationMapper.insert(caseInfo.getCaseInformation()); //插入案件信息
Long caseId = caseInformation.getId(); //获取案件ID
@ -417,10 +423,12 @@ public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMappe
List<CollectionRecordEnterVO> records = collectionRecordMapper.selectByCaseId(id);
result.setCollectionRecordList(records);
records.stream().peek(item -> {
if (StringUtils.isNotBlank(item.getCollectionUrlId())){
List<Long> fileIds = Arrays.stream(item.getCollectionUrlId().split(","))
.map(Long::parseLong)
.collect(Collectors.toList());
item.setFileManager(fileManagerMapper.selectBatchIds(fileIds));
}
}).collect(Collectors.toList());
return result;
}
@ -486,14 +494,15 @@ public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMappe
List<FileManager> fileManager = item.getFileManager().stream().peek(i -> i.setCaseId(caseId)).collect(Collectors.toList());
fileManagerService.saveBatch(fileManager);
item.setCollectionUrlId(fileManager.stream().map(i -> i.getId().toString()).collect(Collectors.joining(",")));
/*item.setUserId(userId);
item.setUserId(userId);
item.setUserName(nickName);
String collect = loginUser.getUser().getRoles().stream().map(SysRole::getRoleKey).collect(Collectors.joining(","));
if (!collect.contains("FINANCE")){
if (!collect.contains("FINANCE")) {
item.setAuditStatus(0);
}else {
} else {
item.setAuditStatus(1);
}*/
}
});
List<CollectionRecord> list = BeanUtil.copyToList(insert, CollectionRecord.class);
collectionRecordService.saveBatch(list);

View File

@ -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;
/**
* <p>
@ -28,6 +38,12 @@ public class CaseLawyerServiceImpl extends ServiceImpl<CaseLawyerMapper,CaseLawy
@Resource
private CaseLawyerMapper caseLawyerMapper;
@Resource
private SysUserMapper sysUserMapper;
@Resource
private CaseInformationMapper caseInformationMapper;
@Override
public Page<CaseLawyer> list(Integer pageNo, Integer pageSize) {
return caseLawyerMapper.selectPage(new Page<>(pageNo, pageSize), new QueryWrapper<>());
@ -59,4 +75,46 @@ public class CaseLawyerServiceImpl extends ServiceImpl<CaseLawyerMapper,CaseLawy
return caseLawyerMapper.selectByMap(params);
}
@Override
@Transactional(isolation = Isolation.DEFAULT, rollbackFor = Exception.class)
public boolean transferLawyer(TransferParam params) {
try {
Long newLawyerId = params.getNewLawyerId(); //新的律师
LawUserVO newLawyer = sysUserMapper.getLawUserById(newLawyerId); //查找新的律师
String transferCaseIds = params.getCaseIds(); //要转移的案件IDS
List<Long> caseIdList = StrUtil.split(transferCaseIds, ",").stream().map(Long::parseLong).collect(Collectors.toList()); //获取要转移的案件ID
//根据案件ID去查询case_lawyer表中原来的主办律师信息
List<CaseLawyer> caseLawyers = caseLawyerMapper.selectByCaseIdPrime(caseIdList);
//case_lawyer表中原来的主办律师信息设置为原承办律师1
List<Long> clIds = caseLawyers.stream().map(CaseLawyer::getId).collect(Collectors.toList());
caseLawyerMapper.updateByIds(clIds);
//组装新的主办律师信息并插入到case_lawyer表中
ArrayList<CaseLawyer> 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<CaseLawyer> 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("转接失败");
}
}
}

View File

@ -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<CollectionRecordMap
public List<CollectionRecordEnterVO> selectByCaseId(Long caseId) {
List<CollectionRecordEnterVO> lists = collectionRecordMapper.selectByCaseId(caseId);
for (CollectionRecordEnterVO item : lists) {
if (StrUtil.isNotBlank(item.getCollectionUrlId())){ //排除用户只进行缴费没有上传收费凭证的情况
List<Long> collect = Arrays.stream(item.getCollectionUrlId().split(",")).map(Long::parseLong).collect(Collectors.toList());
item.setFileManager(fileManagerMapper.selectByCRid(collect));
}
item.setIsEdit(item.getAuditStatus() == 0);
}
return lists;

View File

@ -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;
/**
* <p>
* 金额催收记录 服务实现类
* </p>
*
* @author
* @since 2025-02-27
*/
@Service
public class DemandPaymentRecordServiceImpl extends ServiceImpl<DemandPaymentRecordMapper,DemandPaymentRecord> implements IDemandPaymentRecordService {
@Resource
private DemandPaymentRecordMapper demandPaymentRecordMapper;
@Resource
private CaseInformationMapper caseInformationMapper;
@Override
public Page<DemandPaymentRecord> 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<String, Long> 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<String, Object> params) {
try {
Long caseId = Long.parseLong(params.get("caseId").toString());
String idsStr = (String) params.get("ids");
List<Long> 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("设置已读失败");
}
}
}

View File

@ -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<IndexStatistics> 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<IndexStatistics> 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<IndexStatistics> 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<IndexStatistics> 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<IndexStatistics> 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<IndexStatistics> 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<IndexStatistics> earningsTrend(Date startTime, Date endTime) {
List<CollectionRecord> 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<CollectionRecord> list = recordMapper.earningsTrend(userId, startTime, endTime);
Map<Date, List<CollectionRecord>> map = list.stream().collect(Collectors.groupingBy(item -> DateUtil.parse(DateUtil.format(item.getCreateTime(), "yyyy-MM-dd"))));
TreeMap<Date, List<CollectionRecord>> treeMap = new TreeMap<>(map);
List<IndexStatistics> res = new ArrayList<>();

View File

@ -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<ImpulseInformatio
public Page<ImpulseInformationVO> list(Map<String, Object> params) {
Page<ImpulseInformationVO> resPage = new Page<>();
Page<ImpulseInformation> page = impulseInformationMapper.selectCondition(new Page<>((Integer) params.get("current"), (Integer) params.get("size")), params);
if (page.getRecords() != null){
if (page.getRecords() != null) {
List<ImpulseInformationVO> 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());
@ -94,6 +95,53 @@ public class ImpulseInformationServiceImpl extends ServiceImpl<ImpulseInformatio
return resList.isEmpty();
}*/
/*@Override
public Map<String, Object> retrievalConflict(ImpulseInformation impulseInformation) {
*/
/**
* impulseInformation.getIsClient() 的值为 0 1 - 0 结果为 1 impulseInformation.getIsClient() 的值为 1 1 - 1 结果为 0
* 注意
* 1如果是委托方就去检索相对方中有没有
* 2如果是相对方就去检索委托方中有没有
* 3委托方不能是律所中任何一个案件的被告方====被告方不能是律所中任何一个案件的委托方
*//*
TreeMap<String, Object> resMap = new TreeMap<>();
Long id = impulseInformation.getId();
if (id != null){
resMap.put("result", true);
resMap.put("clashInfo", null);
return resMap;
}
List<ClashInfoVO> clashInfoVOS = new ArrayList<>();
*//*impulseInformation.setIsClient(1 - impulseInformation.getIsClient());*//*
if (impulseInformation.getIsClient() == 0){
impulseInformation.setIsClient(1);
}
if (impulseInformation.getIsClient() == 1){
impulseInformation.setIsClient(0);
}
List<ImpulseInformation> 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<String, Object> retrievalConflict(ImpulseInformation impulseInformation) {
/**
@ -105,9 +153,54 @@ public class ImpulseInformationServiceImpl extends ServiceImpl<ImpulseInformatio
*/
TreeMap<String, Object> resMap = new TreeMap<>();
List<ClashInfoVO> 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<ImpulseInformation> 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<ImpulseInformation> 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<ImpulseInformatio
return Collections.emptyMap();
}
/*@Override
public List<String> auditClashMsg(Long caseId) {
//去利冲信息库查询信息现将疑似利冲的数据获取出来去查询这些利冲的数据和哪些案件的数据有利冲
List<String> resMsg = new ArrayList<>();
HashMap<ImpulseInformation, List<ImpulseInformation>> map = new HashMap<>(); //如果前端需要
List<ImpulseInformation> clashInfo = impulseInformationMapper.auditClashMsg(caseId);
for (ImpulseInformation item : clashInfo) {
item.setIsClient(1 - item.getIsClient());
List<ImpulseInformation> 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<ClashMsg> auditClashMsg(Long caseId) {
//去利冲信息库查询信息现将疑似利冲的数据获取出来去查询这些利冲的数据和哪些案件的数据有利冲
List<ClashMsg> clashMsgList = new ArrayList<>();
List<ImpulseInformation> clashInfo = impulseInformationMapper.auditClashMsg(caseId);
for (ImpulseInformation item : clashInfo) {
ClashMsg clashMsg = new ClashMsg();
item.setIsClient(1 - item.getIsClient());
List<ImpulseInformation> 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<String> 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<ClashMsgWithCaseInfo> clashMsgWithCaseInfos = new ArrayList<>();
List<ImpulseInformation> clashInfo = impulseInformationMapper.auditClashMsg(caseId);
for (ImpulseInformation item : clashInfo) {
ClashMsgWithCaseInfo clashMsgWithCaseInfo = new ClashMsgWithCaseInfo();
item.setIsClient(1 - item.getIsClient());
List<ImpulseInformation> 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<ClashMsgCaseInfoItem> 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> impulseInformation) {
AjaxResult ajaxResult = new AjaxResult();
List<ClashMsgWithCaseInfo> clashMsgWithCaseInfos = new ArrayList<>();
for (ImpulseInformation item : impulseInformation) {
ClashMsg clashMsg = new ClashMsg();
ClashMsgWithCaseInfo clashMsgWithCaseInfo = new ClashMsgWithCaseInfo();
item.setIsClient(1 - item.getIsClient());
List<ImpulseInformation> 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<ClashMsgCaseInfoItem> 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> impulseInformation) {
List<ClashMsg> clashMsgList = new ArrayList<>();
for (ImpulseInformation item : impulseInformation) {
ClashMsg clashMsg = new ClashMsg();
item.setIsClient(1 - item.getIsClient());
List<ImpulseInformation> 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<String> 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);

View File

@ -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);
}
}

View File

@ -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<FileManager> fileList;
/**
* 催款记录
*/
private List<DemandPaymentRecord> demandPaymentRecordList;
}

View File

@ -83,6 +83,15 @@
</set>
where ci.id = #{caseId}
</update>
<update id="updateLawyerIds">
update case_information ci
<set>
<if test="lawIds != null">
ci.case_lawyer_ids = #{lawIds},
</if>
</set>
where ci.id = #{caseId}
</update>
<select id="selectCondition" resultType="com.tcctlo.law.vo.CaseInformationListVO" parameterType="map">
@ -152,6 +161,8 @@
and ci.status = 0 and ci.del_flag = 0
</where>
</select>
<!-- 案件类型统计 -->
<select id="selectCountByBusinessType" resultType="java.lang.Integer">
select count(id) as sumNum from case_information ci
<where>
@ -159,11 +170,18 @@
<if test="type != null">
and ci.business_classify = #{type}
</if>
<if test="userId != null and userId != ''">
and find_in_set(#{userId},ci.case_lawyer_ids)
</if>
<if test="startTime != null and endTime != null">
and ci.create_time between #{startTime} and #{endTime}
</if>
and ci.status = 0
and ci.del_flag =0
</where>
</select>
<!-- 利冲统计 -->
<select id="conflictStatistics" resultType="java.lang.Integer">
select count(id) as sumNum from case_information ci
<where>
@ -171,34 +189,107 @@
<if test="caseStatus != null">
and ci.case_status = #{caseStatus}
</if>
<if test="userId != null and userId != ''">
and find_in_set(#{userId},ci.case_lawyer_ids)
</if>
<if test="startTime != null and endTime != null">
and ci.create_time between #{startTime} and #{endTime}
</if>
and ci.status = 0
and ci.del_flag =0
</where>
</select>
<!-- 费用统计-未收款统计 -->
<select id="outstandingPayment" resultType="java.lang.Integer">
select count(ci.id) as sumNum from case_information ci where
ci.amount_received_sum = 0
select count(ci.id) as sumNum
from case_information ci
<where>
1 = 1
and ci.amount_received_sum = 0
<if test="userId != null and userId != ''">
and find_in_set(#{userId},ci.case_lawyer_ids)
</if>
<if test="startTime != null and endTime != null">
and ci.create_time between #{startTime} and #{endTime}
and ci.del_flag =0 and ci.status = 0
</if>
and ci.del_flag = 0
and ci.status = 0
</where>
</select>
<!-- 费用统计-未收款统计 -->
<!--<select id="outstandingPayment" resultType="java.lang.Integer">
select count(ci.id) as sumNum
from case_information ci
where ci.amount_received_sum = 0
and ci.create_time between #{startTime} and #{endTime}
and ci.del_flag = 0
and ci.status = 0
</select>-->
<!-- 费用统计-部分收费统计 -->
<select id="partialCharge" resultType="java.lang.Integer">
select count(ci.id) as sumNum from case_information ci where
ci.amount_receivable &gt; 0
select count(ci.id) as sumNum
from case_information ci
<where>
1 = 1
and ci.amount_receivable &gt; 0
<if test="userId != null and userId != ''">
and find_in_set(#{userId},ci.case_lawyer_ids)
</if>
and ci.amount_received_sum &lt; ci.amount_receivable
<if test="startTime != null and endTime != null">
and ci.create_time between #{startTime} and #{endTime}
</if>
and ci.del_flag = 0
and ci.status = 0
</where>
</select>
<!-- 费用统计-部分收费统计 -->
<!--<select id="partialCharge" resultType="java.lang.Integer">
select count(ci.id) as sumNum
from case_information ci
where ci.amount_receivable &gt; 0
and ci.amount_received_sum &lt; ci.amount_receivable
and ci.create_time between #{startTime} and #{endTime}
and ci.del_flag =0
and ci.del_flag = 0
and ci.status = 0
</select>
</select>-->
<!-- 费用统计-逾期未收费 -->
<select id="overdue" resultType="java.lang.Integer">
select count(ci.id) as sumNum from case_information ci where
ci.amount_receivable = 0
select count(ci.id) as sumNum
from case_information ci
<where>
1 = 1
and ci.amount_receivable = 0
or ci.amount_received_sum &lt; ci.amount_receivable
and ci.payment_deadline &lt; now()
<if test="userId != null and userId != ''">
and find_in_set(#{userId},ci.case_lawyer_ids)
</if>
<if test="startTime != null and endTime != null">
and ci.create_time between #{startTime} and #{endTime}
</if>
and ci.del_flag = 0
and ci.status = 0
</where>
</select>
<!-- 费用统计-逾期未收费 -->
<!--<select id="overdue" resultType="java.lang.Integer">
select count(ci.id) as sumNum
from case_information ci
where ci.amount_receivable = 0
or ci.amount_received_sum &lt; ci.amount_receivable
and ci.payment_deadline &lt; now()
and ci.create_time between #{startTime} and #{endTime}
and ci.del_flag =0
and ci.del_flag = 0
and ci.status = 0
</select>
</select>-->
<!--<select id="overdue" resultType="java.lang.Integer">
select count(ci.id) as sumNum from case_information ci where

View File

@ -12,7 +12,7 @@
<update id="updateByIds">
update case_lawyer cl
set cl.is_prime = 1
where id in
where cl.id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
@ -64,4 +64,36 @@
and cl.del_flag = 0
</where>
</select>
<select id="selectPrimeLawyerByLayerId" resultType="com.tcctlo.law.entity.CaseLawyer">
select * from case_lawyer cl
where cl.is_prime = 0
and cl.lawyer_type = 0
and cl.lawyer_id = #{lawId}
and cl.status = 0
and cl.del_flag = 0
</select>
<select id="selectPrimeLawyerByLayerIdAndCaseId" resultType="com.tcctlo.law.entity.CaseLawyer">
select * from case_lawyer cl
where cl.is_prime = 0
and cl.lawyer_type = 0
and cl.lawyer_id = #{lawId}
and cl.status = 0
and cl.del_flag = 0
and cl.case_id in
<foreach collection="caseIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<select id="selectByCaseIdPrime" resultType="com.tcctlo.law.entity.CaseLawyer">
select * from case_lawyer cl
where cl.is_prime = 0
and cl.lawyer_type = 0
and cl.case_id in
<foreach collection="caseIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
and cl.status = 0
and cl.del_flag = 0
</select>
</mapper>

View File

@ -56,7 +56,9 @@
order by cr.create_time asc
</where>
</select>
<select id="earningsTrend" resultType="com.tcctlo.law.entity.CollectionRecord">
<!-- 收益走势 -->
<!--<select id="earningsTrend" resultType="com.tcctlo.law.entity.CollectionRecord">
select * from collection_record cr
<where>
1 = 1
@ -70,5 +72,35 @@
and cr.status = 0
order by cr.create_time asc
</where>
</select>-->
<!--select ci.id from case_information ci where
find_in_set(#{userId},ci.case_lawyer_ids) and
ci.del_flag = 0 and ci.status = 0-->
<!-- 收益走势 -->
<select id="earningsTrend" resultType="com.tcctlo.law.entity.CollectionRecord">
select * from collection_record cr
<where>
cr.case_id in (
select ci.id from case_information ci
<where>
1 = 1
<if test="userId != null and userId != ''">
and find_in_set(#{userId},ci.case_lawyer_ids)
</if>
and ci.del_flag = 0 and ci.status = 0
</where>
)
<if test="startTime != null">
and cr.create_time &gt;= #{startTime}
</if>
<if test="endTime != null">
and cr.create_time &lt;= #{endTime}
</if>
and cr.del_flag = 0
and cr.status = 0
order by cr.create_time asc
</where>
</select>
</mapper>

View File

@ -0,0 +1,30 @@
<?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.DemandPaymentRecordMapper">
<update id="setRead">
update demand_payment_record dpr
set is_read = 0
<where>
<if test="caseId != null and caseId != ''">
dpr.case_id = #{caseId}
</if>
and dpr.id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</where>
</update>
<select id="selectByCaseId" resultType="com.tcctlo.law.entity.DemandPaymentRecord">
select * from demand_payment_record dpr
<where>
1 = 1
<if test="caseId != null and caseId != ''">
and dpr.case_id = #{caseId}
</if>
and dpr.is_read = 1
and dpr.status = 0
and dpr.del_flag = 0
order by dpr.create_time desc
</where>
</select>
</mapper>

View File

@ -54,7 +54,7 @@
and ii.status = 0
</where>
</select>
<select id="retrievalConflict" resultType="com.tcctlo.law.entity.ImpulseInformation">
<!--<select id="retrievalConflict" resultType="com.tcctlo.law.entity.ImpulseInformation">
select * from impulse_information ii
<trim prefix="where" prefixOverrides="and | or">
<if test="info.caseName != null and info.caseName != ''">
@ -72,16 +72,40 @@
<if test="info.caseEmail != null and info.caseEmail != ''">
and ii.case_email = #{info.caseEmail}
</if>
<if test="info.isClient != null and info.isClient != ''">
<if test="info.isClient != null">
and ii.is_client = #{info.isClient}
</if>
and ii.check_flag = 1
and ii.del_flag = 0
and ii.status = 0
</trim>
</select>-->
<select id="retrievalConflict" resultType="com.tcctlo.law.entity.ImpulseInformation">
select * from impulse_information a where a.id in
(
select ii.id from impulse_information ii
<trim prefix="where" prefixOverrides="and | or">
<if test="info.caseName != null and info.caseName != ''">
ii.case_name = #{info.caseName}
</if>
<if test="info.caseNo != null and info.caseNo != ''">
or ii.case_no = #{info.caseNo}
</if>
<if test="info.caseAddress != null and info.caseAddress != ''">
or ii.case_address = #{info.caseAddress}
</if>
<if test="info.casePhone != null and info.casePhone != ''">
or ii.case_phone = #{info.casePhone}
</if>
<if test="info.caseEmail != null and info.caseEmail != ''">
or ii.case_email = #{info.caseEmail}
</if>
</trim>
) and a.is_client = #{info.isClient} and a.check_flag = 1 and a.del_flag = 0 and a.status = 0
</select>
<select id="selectCondition" resultType="com.tcctlo.law.entity.ImpulseInformation">
select * from impulse_information ii
<trim prefix="where" prefixOverrides="and | or">
@ -109,5 +133,12 @@
</trim>
order by ii.create_time desc
</select>
<select id="auditClashMsg" resultType="com.tcctlo.law.entity.ImpulseInformation">
select * from impulse_information ii
where ii.case_id = #{caseId}
and ii.check_flag = 0
and ii.del_flag = 0
and ii.status = 0
</select>
</mapper>

View File

@ -2,16 +2,30 @@ package com.tcctlo.law;
import com.deepoove.poi.XWPFTemplate;
import com.tcctlo.law.entity.wordTemplateEntity.BaseWordEntity;
import com.tcctlo.law.tools.RedisGenerateCaseNo;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import java.io.FileOutputStream;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.HashMap;
@SpringBootTest(classes = LawApplication.class)
public class WordTest {
/*@Autowired
private StringRedisTemplate stringRedisTemplate;*/
@Test
void caseNo(){
/*Long caseNo = stringRedisTemplate.opsForValue().increment("caseNo");
System.out.println(caseNo);*/
String replace = LocalDate.now().toString().replace("-", "");
System.out.println(replace);
}
@Test
void word() throws Exception{
HashMap<String, String> map = new HashMap<>();

View File

@ -141,6 +141,12 @@ public interface SysUserMapper
*/
List<LawUserVO> getLawUser();
/**
* 根据用户ID获取用户信息
* @return 用户信息
*/
LawUserVO getLawUserById(@Param("id") Long id);
/**
* 根据条件分页查询未分配用户角色列表
* @return 结果集

View File

@ -225,6 +225,22 @@
</if>
</where>
</select>
<select id="getLawUserById" resultType="com.tcctlo.common.core.domain.LawUserVO">
select su.user_id userId,
su.user_name userName,
su.nick_name nickName,
su.avatar avatar,
su.email email,
sr.role_id roleId,
sr.role_name roleName,
sr.role_key roleKey
from sys_user su
left join sys_user_role sur on su.user_id = sur.user_id
left join sys_role sr on sur.role_id = sr.role_id
where (sr.role_name = '律师' AND sr.role_key = 'LAWYER')
and su.user_id = #{id}
and sr.status = '0' and sr.del_flag = '0' and su.status = '0' and su.del_flag = '0'
</select>
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
insert into sys_user(