diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/CaseEnum.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/CaseEnum.java index 53b6e151..f3210b88 100644 --- a/tcctlo-law-office/src/main/java/com/tcctlo/law/CaseEnum.java +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/CaseEnum.java @@ -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; diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/controller/CaseInformationController.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/controller/CaseInformationController.java index f6678396..78da951d 100644 --- a/tcctlo-law-office/src/main/java/com/tcctlo/law/controller/CaseInformationController.java +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/controller/CaseInformationController.java @@ -32,6 +32,8 @@ public class CaseInformationController extends BaseController { private ICaseInformationService iCaseInformationService; + + /** * 案件审核 * @param params 参数:案件编号、审核状态、审核意见【id、auditStatus、auditOpinion】 @@ -196,4 +198,6 @@ public class CaseInformationController extends BaseController { Integer result = iCaseInformationService.update(params); return AjaxResult.success(result); } + + } diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/controller/CaseLawyerController.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/controller/CaseLawyerController.java index 751f1fa1..2d5f40d5 100644 --- a/tcctlo-law-office/src/main/java/com/tcctlo/law/controller/CaseLawyerController.java +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/controller/CaseLawyerController.java @@ -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; + /** *

* 案件律师表 前端控制器 @@ -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) { diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/controller/DemandPaymentRecordController.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/controller/DemandPaymentRecordController.java new file mode 100644 index 00000000..a371b1dd --- /dev/null +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/controller/DemandPaymentRecordController.java @@ -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; + +/** + *

+ * 金额催收记录 前端控制器 + *

+ * + * @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 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 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 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); + } +} diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/controller/ImpulseInformationController.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/controller/ImpulseInformationController.java index cdf39571..752c2c18 100644 --- a/tcctlo-law-office/src/main/java/com/tcctlo/law/controller/ImpulseInformationController.java +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/controller/ImpulseInformationController.java @@ -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) { + return iImpulseInformationService.ClashMsgBatch(impulseInformation); + } + /*@GetMapping(value = "/list") public AjaxResult list(@RequestParam(required = false) Integer current, @RequestParam(required = false) Integer size) { diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/controller/IndexController.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/controller/IndexController.java index 5635c2de..4e2b5046 100644 --- a/tcctlo-law-office/src/main/java/com/tcctlo/law/controller/IndexController.java +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/controller/IndexController.java @@ -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 integerIntegerMap = iIndexService.caseTypeStatistics(startTime, endTime); return AjaxResult.success(integerIntegerMap); } @@ -66,7 +66,7 @@ public class IndexController { */ @GetMapping("/earningsTrend") public AjaxResult earningsTrend(@RequestParam("startTime") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date startTime, - @RequestParam("endTime") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endTime) { + @RequestParam("endTime") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endTime) { List integerIntegerMap = iIndexService.earningsTrend(startTime, endTime); return AjaxResult.success(integerIntegerMap); } diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/entity/ClashMsg.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/entity/ClashMsg.java new file mode 100644 index 00000000..21ee7573 --- /dev/null +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/entity/ClashMsg.java @@ -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 msgSub; +} diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/entity/ClashMsgWithCaseInfo.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/entity/ClashMsgWithCaseInfo.java new file mode 100644 index 00000000..ec73677d --- /dev/null +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/entity/ClashMsgWithCaseInfo.java @@ -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 msgSub; +} diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/entity/DemandPaymentRecord.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/entity/DemandPaymentRecord.java new file mode 100644 index 00000000..12c6d29c --- /dev/null +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/entity/DemandPaymentRecord.java @@ -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; +/** + *

+ * 金额催收记录 + *

+ * + * @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; + +} diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/entity/TransferParam.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/entity/TransferParam.java new file mode 100644 index 00000000..b1d57612 --- /dev/null +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/entity/TransferParam.java @@ -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; +} diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/entity/wordTemplateEntity/ClashMsgCaseInfoItem.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/entity/wordTemplateEntity/ClashMsgCaseInfoItem.java new file mode 100644 index 00000000..0d9e09bd --- /dev/null +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/entity/wordTemplateEntity/ClashMsgCaseInfoItem.java @@ -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; +} diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/mapper/CaseInformationMapper.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/mapper/CaseInformationMapper.java index 54911824..38752e8c 100644 --- a/tcctlo-law-office/src/main/java/com/tcctlo/law/mapper/CaseInformationMapper.java +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/mapper/CaseInformationMapper.java @@ -106,7 +106,8 @@ public interface CaseInformationMapper extends BaseMapper { * @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 { * @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 { * 未收款统计 * @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); } diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/mapper/CaseLawyerMapper.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/mapper/CaseLawyerMapper.java index c2b47d4a..3b7a919d 100644 --- a/tcctlo-law-office/src/main/java/com/tcctlo/law/mapper/CaseLawyerMapper.java +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/mapper/CaseLawyerMapper.java @@ -59,4 +59,25 @@ public interface CaseLawyerMapper extends BaseMapper { * @return 受影响行数 */ int deleteLawyerByCaseId(@Param("caseIds") List caseId); + + /** + * 根据律师ID查询改律师担任主板律师的案件ID + */ + List selectPrimeLawyerByLayerId(@Param("lawId") Long lawId); + + + /** + * 根据案件ID 查询这些案件的主办律师 + * @param caseIds 案件IDS + * @return 结果集 + */ + List selectByCaseIdPrime(@Param("caseIds") List caseIds); + + /** + * 根据律师ID、案件ID查询 + * @param lawId 律师ID + * @param caseIds 案件ID集合 + * @return 结果集 + */ + List selectPrimeLawyerByLayerIdAndCaseId(@Param("lawId") Long lawId, @Param("caseIds") List caseIds); } diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/mapper/CollectionRecordMapper.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/mapper/CollectionRecordMapper.java index ca20492a..084ca271 100644 --- a/tcctlo-law-office/src/main/java/com/tcctlo/law/mapper/CollectionRecordMapper.java +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/mapper/CollectionRecordMapper.java @@ -54,7 +54,7 @@ public interface CollectionRecordMapper extends BaseMapper { * @param endTime 结束时间 * @return 结果集 */ - List earningsTrend(@Param("startTime") Date startTime, @Param("endTime") Date endTime); + List earningsTrend(@Param("userId") String userId, @Param("startTime") Date startTime, @Param("endTime") Date endTime); /** * 收费记录审核 diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/mapper/DemandPaymentRecordMapper.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/mapper/DemandPaymentRecordMapper.java new file mode 100644 index 00000000..7dd536f3 --- /dev/null +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/mapper/DemandPaymentRecordMapper.java @@ -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; + +/** + *

+ * 金额催收记录 Mapper 接口 + *

+ * + * @author + * @since 2025-02-27 + */ +public interface DemandPaymentRecordMapper extends BaseMapper { + + /** + * 根据案件ID查询催收记录 + * @param caseId 案件ID + * @return 催收记录 + */ + List selectByCaseId(@Param("caseId") Long caseId); + + /** + * 设置催费消息已读 + * @param caseId 案件ID + * @param ids 消息ID集合 + * @return 结果集 + */ + int setRead(@Param("caseId") Long caseId, @Param("ids") List ids); +} diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/mapper/ImpulseInformationMapper.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/mapper/ImpulseInformationMapper.java index a4ae3079..96eb3ae5 100644 --- a/tcctlo-law-office/src/main/java/com/tcctlo/law/mapper/ImpulseInformationMapper.java +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/mapper/ImpulseInformationMapper.java @@ -71,4 +71,11 @@ public interface ImpulseInformationMapper extends BaseMapper * @return 结果集 */ Page selectCondition(@Param("page") Page page, @Param("condition") Map condition); + + /** + * 根据案件ID查询利冲信息,在审核时做利冲消息提示 + * @param caseId 案件ID + * @return 结果集 + */ + List auditClashMsg(Long caseId); } diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/service/ICaseLawyerService.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/ICaseLawyerService.java index da71ba94..a0bb3561 100644 --- a/tcctlo-law-office/src/main/java/com/tcctlo/law/service/ICaseLawyerService.java +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/ICaseLawyerService.java @@ -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{ * @return 结果几 */ List selectByCondition(Map params); + + /** + * 案件律师转移 + * @param params 参数 + * @return 结果集 + */ + boolean transferLawyer(TransferParam params); } diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/service/IDemandPaymentRecordService.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/IDemandPaymentRecordService.java new file mode 100644 index 00000000..b0541b5c --- /dev/null +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/IDemandPaymentRecordService.java @@ -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; + +/** + *

+ * 金额催收记录 服务类 + *

+ * + * @author + * @since 2025-02-27 + */ +public interface IDemandPaymentRecordService { + + /** + *

+ * 分页列表查询 + *

+ * @param pageNo + * @param pageSize + * @return + */ + Page list(Integer pageNo, Integer pageSize); + + /** + *

+ * 详情接口 + *

+ * @param id + * @return + */ + DemandPaymentRecord getById(Long id); + + /** + *

+ * 新增接口 + *

+ * @param demandPaymentRecord + * @return + */ + Integer create(DemandPaymentRecord demandPaymentRecord); + + + /** + *

+ * 删除接口 + *

+ * @param id + * @return + */ + Integer delete(Long id); + + /** + *

+ * 更新接口 + *

+ * @param demandPaymentRecord + * @return + */ + Integer update(DemandPaymentRecord demandPaymentRecord); + + /** + * 根据案件ID对案件进行催收功能 + * @param params 参数 + * @return 是否成功 + */ + Boolean caseCollection(Map params); + + /** + * 设置催收消息已读 + * @param params 参数 + * @return 结果集 + */ + boolean setRead(Map params); +} diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/service/IImpulseInformationService.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/IImpulseInformationService.java index 404e115a..a7ab0369 100644 --- a/tcctlo-law-office/src/main/java/com/tcctlo/law/service/IImpulseInformationService.java +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/IImpulseInformationService.java @@ -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 * @return 结果集 */ Map retrievalConflictBatch(List impulseInformation); + + /** + * 审核时利冲消息提示 + * @param caseId 案件ID + */ + AjaxResult auditClashMsg(Long caseId); + + /** + * 利冲信息检测-批量 + * @param impulseInformation 要检测的利冲信息 + * @return 结果集 + */ + AjaxResult ClashMsgBatch(List impulseInformation); } diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/service/IIndexService.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/IIndexService.java index eeed3e4b..4085ea37 100644 --- a/tcctlo-law-office/src/main/java/com/tcctlo/law/service/IIndexService.java +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/IIndexService.java @@ -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 earningsTrend(Date startTime, Date endTime); } diff --git a/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/CaseInformationServiceImpl.java b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/CaseInformationServiceImpl.java index c965fabc..fbfd5cce 100644 --- a/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/CaseInformationServiceImpl.java +++ b/tcctlo-law-office/src/main/java/com/tcctlo/law/service/impl/CaseInformationServiceImpl.java @@ -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 0); item.setFileList(fileManagerMapper.selectFileByCaseId(item.getId())); + + item.setDemandPaymentRecordList(demandPaymentRecordMapper.selectByCaseId(item.getId())); } return caseInformationPage; } @@ -314,7 +320,7 @@ public class CaseInformationServiceImpl extends ServiceImpl records = collectionRecordMapper.selectByCaseId(id); result.setCollectionRecordList(records); records.stream().peek(item -> { - List fileIds = Arrays.stream(item.getCollectionUrlId().split(",")) - .map(Long::parseLong) - .collect(Collectors.toList()); - item.setFileManager(fileManagerMapper.selectBatchIds(fileIds)); + if (StringUtils.isNotBlank(item.getCollectionUrlId())){ + List 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 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 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 * from impulse_information a where a.id in + ( + select ii.id from impulse_information ii + + + ii.case_name = #{info.caseName} + + + or ii.case_no = #{info.caseNo} + + + or ii.case_address = #{info.caseAddress} + + + or ii.case_phone = #{info.casePhone} + + + or ii.case_email = #{info.caseEmail} + + + ) and a.is_client = #{info.isClient} and a.check_flag = 1 and a.del_flag = 0 and a.status = 0 + + diff --git a/tcctlo-law-office/src/test/java/com/tcctlo/law/WordTest.java b/tcctlo-law-office/src/test/java/com/tcctlo/law/WordTest.java index 6b8b54c9..b7996d62 100644 --- a/tcctlo-law-office/src/test/java/com/tcctlo/law/WordTest.java +++ b/tcctlo-law-office/src/test/java/com/tcctlo/law/WordTest.java @@ -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 map = new HashMap<>(); diff --git a/tcctlo-system/src/main/java/com/tcctlo/system/mapper/SysUserMapper.java b/tcctlo-system/src/main/java/com/tcctlo/system/mapper/SysUserMapper.java index 95c088c4..1bfeff59 100644 --- a/tcctlo-system/src/main/java/com/tcctlo/system/mapper/SysUserMapper.java +++ b/tcctlo-system/src/main/java/com/tcctlo/system/mapper/SysUserMapper.java @@ -141,6 +141,12 @@ public interface SysUserMapper */ List getLawUser(); + /** + * 根据用户ID获取用户信息 + * @return 用户信息 + */ + LawUserVO getLawUserById(@Param("id") Long id); + /** * 根据条件分页查询未分配用户角色列表 * @return 结果集 diff --git a/tcctlo-system/src/main/resources/mapper/system/SysUserMapper.xml b/tcctlo-system/src/main/resources/mapper/system/SysUserMapper.xml index 43a4848b..af4f56fb 100644 --- a/tcctlo-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/tcctlo-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -225,6 +225,22 @@ + insert into sys_user(