[UPDATE]:修改相关业务

This commit is contained in:
张世琪 2025-02-26 15:27:03 +08:00
parent 94c7f9ddd3
commit 50bb132190
55 changed files with 1958 additions and 159 deletions

View File

@ -64,6 +64,16 @@ public class SysRoleController extends BaseController
return getDataTable(list);
}
@GetMapping("/getAll")
public AjaxResult getAll(SysRole role)
{
AjaxResult ajaxResult = new AjaxResult();
ajaxResult.put("msg","查询成功");
ajaxResult.put("code", 200);
ajaxResult.put("data", roleService.selectRoleList(role));
return ajaxResult;
}
@Log(title = "角色管理", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:role:export')")
@PostMapping("/export")

View File

@ -154,8 +154,9 @@ dromara:
domain: http://47.109.202.121:9000/law-firm/ # 访问域名,注意“/”结尾例如http://minio.abc.com/abc/
base-path: law/ # 基础路径
serviceFilePath: D:\templeteWordDownload\
#serviceFilePath: /backitems/lawFirm/wordTemplate/
#serviceFilePath: /backitems/lawFirm/wordTemplate/template/
generatedWordPath: D:/word/
#generatedWordPath: /backitems/lawFirm/wordTemplate/generateWord/

View File

@ -64,6 +64,14 @@ public class SysUser extends BaseEntity
/** 用户头像 */
private String avatar;
public List<String> getRolesName() {
return rolesName;
}
public void setRolesName(List<String> rolesName) {
this.rolesName = rolesName;
}
/** 密码 */
private String password;
@ -94,6 +102,8 @@ public class SysUser extends BaseEntity
/** 角色对象 */
private List<SysRole> roles;
List<String> rolesName;
/** 角色组 */
private Long[] roleIds;

View File

@ -0,0 +1,87 @@
package com.tcctlo.law.controller;
import com.tcctlo.common.core.domain.AjaxResult;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import com.tcctlo.law.service.IAuditRecordService;
import com.tcctlo.law.entity.AuditRecord;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* <p>
* 审核记录表 前端控制器
* </p>
*
* @author
* @since 2025-02-25
*/
@RestController
@RequestMapping("/auditRecord")
public class AuditRecordController {
@Autowired
private IAuditRecordService iAuditRecordService;
@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<AuditRecord> pageList = iAuditRecordService.list(current, size);
return AjaxResult.success(pageList);
}
@GetMapping(value = "/{id}")
public AjaxResult getById(@PathVariable("id") Long id) {
AuditRecord auditRecord = iAuditRecordService.getById(id);
return AjaxResult.success(auditRecord);
}
@PostMapping(value = "/create")
public AjaxResult create(@RequestBody AuditRecord params) {
AjaxResult ajaxResult = new AjaxResult();
if (iAuditRecordService.create(params)) {
ajaxResult.put("msg", "添加成功");
ajaxResult.put("code", 200);
}else {
ajaxResult.put("msg", "添加失败");
ajaxResult.put("code", 500);
}
return ajaxResult;
}
/**
* 根据案件ID获取案件审核记录
* @param caseId 案件ID
* @return 生和记录
*/
@GetMapping(value = "selectByCaseId/{caseId}")
public AjaxResult selectByCaseId(@PathVariable("caseId") Long caseId) {
List<AuditRecord> list = iAuditRecordService.selectByCaseId(caseId);
return AjaxResult.success(list);
}
@PostMapping(value = "/delete/{id}")
public AjaxResult delete(@PathVariable("id") Long id) {
Integer result = iAuditRecordService.delete(id);
return AjaxResult.success(result);
}
@PostMapping(value = "/update")
public AjaxResult update(@RequestBody AuditRecord params) {
Integer result = iAuditRecordService.update(params);
return AjaxResult.success(result);
}
}

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tcctlo.common.core.controller.BaseController;
import com.tcctlo.common.core.domain.AjaxResult;
import com.tcctlo.law.entity.CaseInformation;
import com.tcctlo.law.entity.FileManager;
import com.tcctlo.law.service.ICaseInformationService;
import com.tcctlo.law.vo.CaseArchivedVO;
import com.tcctlo.law.vo.CaseInformationEnterVO;
@ -11,6 +12,7 @@ import com.tcctlo.law.vo.CaseInformationListVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
@ -40,6 +42,16 @@ public class CaseInformationController extends BaseController {
return AjaxResult.success(iCaseInformationService.caseReview(params));
}
/**
* 案件相关文件上传
* @param fileManager 案件相关文件
* @return
*/
@PostMapping(value = "/caseInfoUpload")
public AjaxResult caseInfoUpload(@RequestBody List<FileManager> fileManager) {
return AjaxResult.success(iCaseInformationService.caseInfoUpload(fileManager));
}
/**
* 案件撤销
* @param params 参数案件编号收案状态idcaseStatus
@ -50,6 +62,16 @@ public class CaseInformationController extends BaseController {
return AjaxResult.success(iCaseInformationService.claimWithdrawal(params));
}
/**
* 案件终止
* @param params 参数案件编号收案状态idcaseStatus
* @return
*/
@PostMapping(value = "/closeCase")
public AjaxResult closeCase(@RequestBody Map<String,Object> params) {
return AjaxResult.success(iCaseInformationService.closeCase(params));
}
/**
* 设置案件结案
* @param params 参数案件编号审核状态审核意见idauditStatusauditOpinion

View File

@ -4,9 +4,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tcctlo.common.core.domain.AjaxResult;
import com.tcctlo.law.entity.CollectionRecord;
import com.tcctlo.law.service.ICollectionRecordService;
import com.tcctlo.law.vo.CollectionRecordEnterVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* <p>
* 收款记录表 前端控制器
@ -43,12 +47,91 @@ public class CollectionRecordController {
return AjaxResult.success(collectionRecord);
}
/**
* 收费记录审核
* @param map 参数
* @return 数据集
*/
@PostMapping(value = "/audit")
public AjaxResult audit(@RequestBody Map<String, Long> map) {
AjaxResult ajaxResult = null;
Boolean res = iCollectionRecordService.audit(map);
if (res){
ajaxResult = AjaxResult.success();
return ajaxResult;
}else {
ajaxResult = AjaxResult.error();
return ajaxResult;
}
}
/**
* 缴费记录删除
* @param params 案件ID缴费记录ID关联缴费记录文件ID
* @return 是否删除成功
*/
@PostMapping(value = "/deleteLogic")
public AjaxResult deleteLogic(@RequestBody Map<String, Long> params) {
AjaxResult ajaxResult = null;
Boolean res = iCollectionRecordService.deleteLogic(params);
if (res){
ajaxResult = AjaxResult.success();
return ajaxResult;
}else {
ajaxResult = AjaxResult.error();
return ajaxResult;
}
}
/**
* 根据案件ID查询缴费记录
* @param caseId 案件ID
* @return 缴费记录
*/
@GetMapping(value = "selectByCaseId/{caseId}")
public AjaxResult selectByCaseId(@PathVariable("caseId") Long caseId) {
List<CollectionRecordEnterVO> collectionRecordEnterVOS = iCollectionRecordService.selectByCaseId(caseId);
return AjaxResult.success(collectionRecordEnterVOS);
}
@PostMapping(value = "/create")
public AjaxResult create(@RequestBody CollectionRecord params) {
Integer result = iCollectionRecordService.create(params);
return AjaxResult.success(result);
}
/**
* 批量缴费
* @param params 参数
* @return 结果集
*/
@PostMapping(value = "/casePaymentBatch")
public AjaxResult casePaymentBatch(@RequestBody List<CollectionRecordEnterVO> params) {
AjaxResult ajaxResult = null;
Boolean res = iCollectionRecordService.casePaymentBatch(params);
if (res){
ajaxResult = AjaxResult.success();
return ajaxResult;
}else {
ajaxResult = AjaxResult.error();
return ajaxResult;
}
}
/**
* 案件缴费
* @param params 参数
* @return 缴费结果
*/
@PostMapping(value = "/casePayment")
public AjaxResult casePayment(@RequestBody CollectionRecordEnterVO params) {
iCollectionRecordService.casePayment(params);
return AjaxResult.success();
}
@PostMapping(value = "/delete/{id}")
public AjaxResult delete(@PathVariable("id") Long id) {
Integer result = iCollectionRecordService.delete(id);

View File

@ -0,0 +1,63 @@
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.ContractFormParameter;
import com.tcctlo.law.service.IContractFormParameterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* <p>
* 合同表单参数 前端控制器
* </p>
*
* @author
* @since 2025-02-21
*/
@RestController
@RequestMapping("/contractFormParameter")
public class ContractFormParameterController {
@Autowired
private IContractFormParameterService iContractFormParameterService;
@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<ContractFormParameter> pageList = iContractFormParameterService.list(current,size);
return AjaxResult.success(pageList);
}
@GetMapping(value = "/{id}")
public AjaxResult getById(@PathVariable("id") Long id) {
ContractFormParameter contractFormParameter = iContractFormParameterService.getById(id);
return AjaxResult.success(contractFormParameter);
}
@PostMapping(value = "/create")
public AjaxResult create(@RequestBody ContractFormParameter params) {
Integer result = iContractFormParameterService.create(params);
return AjaxResult.success(result);
}
@PostMapping(value = "/delete/{id}")
public AjaxResult delete(@PathVariable("id") Long id) {
Integer result = iContractFormParameterService.delete(id);
return AjaxResult.success(result);
}
@PostMapping(value = "/update")
public AjaxResult update(@RequestBody ContractFormParameter params) {
Integer result = iContractFormParameterService.update(params);
return AjaxResult.success(result);
}
}

View File

@ -4,10 +4,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tcctlo.common.core.domain.AjaxResult;
import com.tcctlo.law.entity.ContractTemplate;
import com.tcctlo.law.service.IContractTemplateService;
import com.tcctlo.law.vo.ImpulseInformationVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.net.MalformedURLException;
import java.util.Map;
/**
@ -63,7 +63,7 @@ public class ContractTemplateController {
}
@PostMapping(value = "/create")
public AjaxResult create(@RequestBody ContractTemplate params) {
public AjaxResult create(@RequestBody ContractTemplate params){
Integer result = iContractTemplateService.create(params);
return AjaxResult.success(result);
}
@ -87,9 +87,13 @@ public class ContractTemplateController {
}
@GetMapping(value = "/getWord/{id}")
public AjaxResult getWord(@PathVariable("id") Long id) throws Exception {
iContractTemplateService.getWord(id);
return AjaxResult.success();
@PostMapping(value = "/getWord")
public AjaxResult getWord(@RequestBody Map<String, Long> param) throws Exception {
String downloadUrl = iContractTemplateService.getWord(param);
AjaxResult ajaxResult = new AjaxResult();
ajaxResult.put("msg", "word生成成功");
ajaxResult.put("code", 200);
ajaxResult.put("downloadUrl", downloadUrl);
return ajaxResult;
}
}

View File

@ -8,6 +8,7 @@ import com.tcctlo.law.vo.ImpulseInformationVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
@ -66,7 +67,18 @@ public class ImpulseInformationController {
*/
@PostMapping("/retrievalConflict")
public AjaxResult retrievalConflict(@RequestBody ImpulseInformation impulseInformation) {
Boolean res = iImpulseInformationService.retrievalConflict(impulseInformation);
Map<String, Object> res = iImpulseInformationService.retrievalConflict(impulseInformation);
return AjaxResult.success(res);
}
/**
* 利冲检索-批量检索
* @param impulseInformation 利冲信息
* @return 检索结果
*/
@PostMapping("/retrievalConflictBatch")
public AjaxResult retrievalConflictBatch(@RequestBody List<ImpulseInformation> impulseInformation) {
Map<String, Object> res = iImpulseInformationService.retrievalConflictBatch(impulseInformation);
return AjaxResult.success(res);
}

View File

@ -0,0 +1,75 @@
package com.tcctlo.law.controller;
import com.tcctlo.common.core.domain.AjaxResult;
import com.tcctlo.law.entity.IndexStatistics;
import com.tcctlo.law.service.IIndexService;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
* 首页控制器
*/
@RestController
@RequestMapping("/caseIndex")
public class IndexController {
@Resource
private IIndexService iIndexService;
/**
* 案件类型统计 conflictStatistics
*
* @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) {
List<IndexStatistics> integerIntegerMap = iIndexService.caseTypeStatistics(startTime, endTime);
return AjaxResult.success(integerIntegerMap);
}
/**
* 利冲统计
*
* @return 结果集
*/
@GetMapping("/conflictStatistics")
public AjaxResult conflictStatistics(@RequestParam("startTime") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date startTime,
@RequestParam("endTime") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endTime) {
List<IndexStatistics> integerIntegerMap = iIndexService.conflictStatistics(startTime, endTime);
return AjaxResult.success(integerIntegerMap);
}
/**
* 费用统计
*
* @return 结果集
*/
@GetMapping("/costStatistics")
public AjaxResult costStatistics(@RequestParam("startTime") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date startTime,
@RequestParam("endTime") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endTime) {
List<IndexStatistics> integerIntegerMap = iIndexService.costStatistics(startTime, endTime);
return AjaxResult.success(integerIntegerMap);
}
/**
* 收益走势
*
* @return 结果集
*/
@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) {
List<IndexStatistics> integerIntegerMap = iIndexService.earningsTrend(startTime, endTime);
return AjaxResult.success(integerIntegerMap);
}
}

View File

@ -0,0 +1,93 @@
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-25
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("audit_record")
public class AuditRecord implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 关联案件ID
*/
private Long caseId;
/**
* 审核人ID关联系统用户表
*/
private Long userId;
/**
* 审核人名称
*/
private String userName;
/**
* 审核内容
*/
private String auditContent;
/**
* 审核状态0未审核1审核通过2审核不通过
*/
private Integer auditResult;
/**
* 状态0正常1停用
*/
private Integer status;
/**
* 删除标志0未删除1已删除
*/
@TableLogic
private Integer delFag;
/**
* 创建者
*/
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

@ -130,7 +130,7 @@ public class CaseInformation implements Serializable {
/**
* 审核意见
*/
private String auditOpinion;
/*private String auditOpinion;*/
/**
* 案件涉及委托方/相对方ID集合

View File

@ -0,0 +1,49 @@
package com.tcctlo.law.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 案件利冲提示信息
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ClashInfoVO {
/**
* 案件id
*/
private Long caseId;
/**
* 涉及案件名称
*/
private String caseInfoName;
/**
* 案件编号
*/
private String caseInfoNo;
/**
* 案件涉及(/企业)--名称
*/
private String caseName;
/**
* 案件涉及(/企业)--[身份证/信用代码]
*/
private String caseNo;
/**
* 类型0:个人1:企业
*/
private Integer caseType;
/**
* 是否是委托方0:1:
*/
private Integer isClient;
}

View File

@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotation.*;
import java.util.Date;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
@ -48,6 +50,27 @@ public class CollectionRecord implements Serializable {
*/
private String collectionUrlId;
/**
* 收款时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date collectionDate;
/**
* 收款人ID
*/
private Long userId;
/**
* 收款人名称
*/
private String userName;
/**
* 审核状态0需要审核1不需要审核2未审核
*/
private Integer auditStatus;
/**
* 状态0正常1停用
*/

View File

@ -0,0 +1,91 @@
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-21
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("contract_form_parameter")
public class ContractFormParameter implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 关联合同模板ID
*/
private Long contractId;
/**
* 表单属性名英文
*/
private String formAttrName;
/**
* 表单属性名释义
*/
private String formAttrExplain;
/**
* 表单属性类型
*/
private String formAttrType;
/**
* 是否必填0必填1
*/
private Integer isRequire;
/**
* 状态0正常1停用
*/
private Integer status;
/**
* 删除标志0未删除1已删除
*/
private Integer delFag;
/**
* 创建者
*/
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

@ -44,16 +44,31 @@ public class ContractTemplate implements Serializable {
*/
private String filePath;
/**
* 原始模版路径
*/
private String filePathSource;
/**
* 阿里云OSS访问地址
*/
private String fileUrl;
/**
* 原始模版阿里云OSS访问地址
*/
private String fileUrlSource;
/**
* 生成的新文件名
*/
private String newFileName;
/**
* 生成的原始模板文件新名称
*/
private String newFileNameSource;
/**
* 电子签章位置X轴
*/

View File

@ -3,8 +3,12 @@ import com.baomidou.mybatisplus.annotation.*;
import java.util.Date;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* <p>
* 文件管理
@ -14,6 +18,8 @@ import lombok.EqualsAndHashCode;
* @since 2025-02-06
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName("file_manager")
public class FileManager implements Serializable {
@ -47,7 +53,7 @@ public class FileManager implements Serializable {
private String fileUrl;
/**
* 文件类型0归档文件1收款记录文件
* 文件类型0归档文件1收款记录文件2案件相关文件
*/
private Integer fileType;

View File

@ -0,0 +1,16 @@
package com.tcctlo.law.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 首页统计实体类
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class IndexStatistics {
private String name;
private Double value;
}

View File

@ -0,0 +1,36 @@
package com.tcctlo.law.entity.wordTemplateEntity;
import com.deepoove.poi.config.Name;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class BaseWordEntity {
/**
* 甲方
*/
@Name("firstParty")
private String firstParty;
/**
* 承办律师
*/
@Name("solicitor")
private String solicitor;
/**
* 统一社会信用代码或身份证号码
*/
@Name("socialCreditCode")
private String socialCreditCode;
/**
* 地址
*/
@Name("address")
private String address;
}

View File

@ -0,0 +1,25 @@
package com.tcctlo.law.mapper;
import com.tcctlo.law.entity.AuditRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 审核记录表 Mapper 接口
* </p>
*
* @author
* @since 2025-02-25
*/
public interface AuditRecordMapper extends BaseMapper<AuditRecord> {
/**
* 根据案件ID查询审核记录
* @param caseId 案件ID
* @return 结果集
*/
List<AuditRecord> selectByCaseId(@Param("caseId") Long caseId);
}

View File

@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tcctlo.law.vo.CaseInformationListVO;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -27,6 +29,21 @@ public interface CaseInformationMapper extends BaseMapper<CaseInformation> {
*/
Page<CaseInformationListVO> selectCondition(@Param("page") Page<CaseInformationListVO> page, @Param("condition") Map<String, Object> condition);
/**
* 修改案件审核状态
* @param caseId 案件Id
* @param auditStatus 审核状态吗
* @return 结果集
*/
int updateAuditStatusInt(@Param("caseId") Long caseId, @Param("auditStatus") Integer auditStatus);
/**
*
* @param caseId 案件ID
* @param amountReceived 收款金额
* @return 结果集
*/
int updateCaseAmount(@Param("caseId") Long caseId, @Param("amountReceived") BigDecimal amountReceived);
/**
* 根据案件ID查询案件信息
@ -83,4 +100,43 @@ public interface CaseInformationMapper extends BaseMapper<CaseInformation> {
* @return 结案结果
*/
Boolean caseClosed(@Param("params") Map<String, Object> params);
/**
* 根据业务类型查询案件数量
* @param type 业务类型
* @return 结果集
*/
Integer selectCountByBusinessType(@Param("type") Integer type,
@Param("startTime")Date startTime,
@Param("endTime")Date endTime);
/**
* 利冲统计
* @param caseStatus 收案状态
* @return 结果集
*/
Integer conflictStatistics(@Param("caseStatus") Integer caseStatus,
@Param("startTime")Date startTime,
@Param("endTime")Date endTime);
/**
* 未收款统计
* @return 结果集
*/
Integer outstandingPayment(@Param("startTime")Date startTime,
@Param("endTime")Date endTime);
/**
* 部分收费统计
* @return 结果集
*/
Integer partialCharge(@Param("startTime")Date startTime,
@Param("endTime")Date endTime);
/**
* 逾期未收费
* @return 结果集
*/
Integer overdue(@Param("startTime")Date startTime,
@Param("endTime")Date endTime);
}

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tcctlo.law.vo.CollectionRecordEnterVO;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
@ -31,6 +32,13 @@ public interface CollectionRecordMapper extends BaseMapper<CollectionRecord> {
*/
int removeByCaseId(@Param("caseIds") List<Long> caseIds);
/**
* 根据缴费记录ID删除缴费记录
* @param id 缴费记录ID
* @return 删除结果
*/
Boolean deleteLogic(@Param("id") Long id);
/**
* 根据案件ID和收款记录ID删除收款记录
* @param id 收款记录ID
@ -38,4 +46,20 @@ public interface CollectionRecordMapper extends BaseMapper<CollectionRecord> {
* @return 结果集
*/
int removeByCaseIdAdnRecordId(@Param("id") Long id, @Param("caseId") Long caseId);
/**
* 收益记录趋势
* @param startTime 开始时间
* @param endTime 结束时间
* @return 结果集
*/
List<CollectionRecord> earningsTrend(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
/**
* 收费记录审核
* @param id id
* @return 结果集
*/
int audit(@Param("id") Long id);
}

View File

@ -0,0 +1,16 @@
package com.tcctlo.law.mapper;
import com.tcctlo.law.entity.ContractFormParameter;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 合同表单参数 Mapper 接口
* </p>
*
* @author
* @since 2025-02-21
*/
public interface ContractFormParameterMapper extends BaseMapper<ContractFormParameter> {
}

View File

@ -1,10 +1,13 @@
package com.tcctlo.law.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tcctlo.law.entity.ContractTemplate;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tcctlo.law.entity.wordTemplateEntity.BaseWordEntity;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* <p>
@ -22,4 +25,19 @@ public interface ContractTemplateMapper extends BaseMapper<ContractTemplate> {
* @return 结果集
*/
Integer deleteTemplate(@Param("ids") List<Long> ids);
/**
* 根据案件编号查询合同模板参数
* @param caseId 案件ID
* @return 结果集
*/
List<BaseWordEntity> selectWordParam(@Param("caseId") Long caseId);
/**
* 条件分页查询
* @param page 分页
* @param condition 条件
* @return 结果集
*/
Page<ContractTemplate> selectCondition(@Param("page") Page<ContractTemplate> page, @Param("condition") Map<String, Object> condition);
}

View File

@ -53,4 +53,11 @@ public interface FileManagerMapper extends BaseMapper<FileManager> {
* @return 结果集
*/
List<FileManager> selectFileByCaseId(@Param("caseId") Long caseId);
/**
* 根据收款记录表中记录的文件ID查询文件
* @param ids ids
* @return 数据集
*/
List<FileManager> selectByCRid(@Param("ids") List<Long> ids);
}

View File

@ -0,0 +1,5 @@
package com.tcctlo.law.mapper;
public interface IndexMapper {
}

View File

@ -0,0 +1,72 @@
package com.tcctlo.law.service;
import com.tcctlo.law.entity.AuditRecord;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* <p>
* 审核记录表 服务类
* </p>
*
* @author
* @since 2025-02-25
*/
public interface IAuditRecordService {
/**
* <p>
* 分页列表查询
* </p>
* @param pageNo
* @param pageSize
* @return
*/
Page<AuditRecord> list(Integer pageNo, Integer pageSize);
/**
* <p>
* 详情接口
* </p>
* @param id
* @return
*/
AuditRecord getById(Long id);
/**
* <p>
* 新增接口
* </p>
* @param auditRecord
* @return
*/
Boolean create(AuditRecord auditRecord);
/**
* <p>
* 删除接口
* </p>
* @param id
* @return
*/
Integer delete(Long id);
/**
* <p>
* 更新接口
* </p>
* @param auditRecord
* @return
*/
Integer update(AuditRecord auditRecord);
/**
* 根据案件ID查询审核记录
* @param caseId 案件ID
* @return 结果集
*/
List<AuditRecord> selectByCaseId(Long caseId);
}

View File

@ -3,10 +3,12 @@ package com.tcctlo.law.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tcctlo.law.entity.CaseInformation;
import com.tcctlo.law.entity.FileManager;
import com.tcctlo.law.vo.CaseArchivedVO;
import com.tcctlo.law.vo.CaseInformationEnterVO;
import com.tcctlo.law.vo.CaseInformationListVO;
import java.util.List;
import java.util.Map;
/**
@ -129,10 +131,25 @@ public interface ICaseInformationService extends IService<CaseInformation>{
*/
Boolean claimWithdrawal(Map<String, Object> params);
/**
* 案件终止
* @param params 参数
* @return 是否终止成功
*/
Boolean closeCase(Map<String, Object> params);
/**
* 案件结案
* @param params 参数
* @return 是否结案成功
*/
Boolean caseClosed(Map<String, Object> params);
/**
* 案件相关文件上传
* @param fileManager 案件相关文件
* @return 是否上传成功
*/
Boolean caseInfoUpload(List<FileManager> fileManager);
}

View File

@ -3,6 +3,10 @@ package com.tcctlo.law.service;
import com.tcctlo.law.entity.CollectionRecord;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tcctlo.law.vo.CollectionRecordEnterVO;
import java.util.List;
import java.util.Map;
/**
* <p>
@ -12,12 +16,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
* @author 张世琪
* @since 2025-02-06
*/
public interface ICollectionRecordService extends IService<CollectionRecord>{
public interface ICollectionRecordService extends IService<CollectionRecord> {
/**
* <p>
* 分页列表查询
* </p>
*
* @param pageNo
* @param pageSize
* @return
@ -28,6 +33,7 @@ public interface ICollectionRecordService extends IService<CollectionRecord>{
* <p>
* 详情接口
* </p>
*
* @param id
* @return
*/
@ -37,6 +43,7 @@ public interface ICollectionRecordService extends IService<CollectionRecord>{
* <p>
* 新增接口
* </p>
*
* @param collectionRecord
* @return
*/
@ -47,6 +54,7 @@ public interface ICollectionRecordService extends IService<CollectionRecord>{
* <p>
* 删除接口
* </p>
*
* @param id
* @return
*/
@ -56,8 +64,45 @@ public interface ICollectionRecordService extends IService<CollectionRecord>{
* <p>
* 更新接口
* </p>
*
* @param collectionRecord
* @return
*/
Integer update(CollectionRecord collectionRecord);
/**
* 案件缴费
*
* @param params 参数
*/
void casePayment(CollectionRecordEnterVO params);
/**
* 批量案件缴费
*
* @param params 参数
*/
Boolean casePaymentBatch(List<CollectionRecordEnterVO> params);
/**
* 逻辑删除缴费记录
*
* @param id 缴费记录ID
* @return 是否删除成功
*/
Boolean deleteLogic(Map<String, Long> params);
/**
* 根据案件ID查询缴费记录
* @param caseId 案件ID
* @return 结果集
*/
List<CollectionRecordEnterVO> selectByCaseId(Long caseId);
/**
* 收费记录审核
* @param map 参数
* @return 结果集
*/
Boolean audit(Map<String, Long> map);
}

View File

@ -0,0 +1,63 @@
package com.tcctlo.law.service;
import com.tcctlo.law.entity.ContractFormParameter;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/**
* <p>
* 合同表单参数 服务类
* </p>
*
* @author
* @since 2025-02-21
*/
public interface IContractFormParameterService {
/**
* <p>
* 分页列表查询
* </p>
* @param pageNo
* @param pageSize
* @return
*/
Page<ContractFormParameter> list(Integer pageNo, Integer pageSize);
/**
* <p>
* 详情接口
* </p>
* @param id
* @return
*/
ContractFormParameter getById(Long id);
/**
* <p>
* 新增接口
* </p>
* @param contractFormParameter
* @return
*/
Integer create(ContractFormParameter contractFormParameter);
/**
* <p>
* 删除接口
* </p>
* @param id
* @return
*/
Integer delete(Long id);
/**
* <p>
* 更新接口
* </p>
* @param contractFormParameter
* @return
*/
Integer update(ContractFormParameter contractFormParameter);
}

View File

@ -1,9 +1,9 @@
package com.tcctlo.law.service;
import com.tcctlo.law.entity.ContractTemplate;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tcctlo.law.entity.ContractTemplate;
import java.io.FileNotFoundException;
import java.net.MalformedURLException;
import java.util.Map;
/**
@ -82,7 +82,7 @@ public interface IContractTemplateService {
/**
* 批量删除
*
* @param ids ids
* @param param ids
* @return 结果集
*/
Integer deleteTemplate(Map<String, String> param);
@ -91,5 +91,5 @@ public interface IContractTemplateService {
* 根据word模板生成word
* @param id 模板id
*/
void getWord(Long id) throws Exception;
String getWord(Map<String, Long> param) throws Exception;
}

View File

@ -1,5 +1,6 @@
package com.tcctlo.law.service;
import com.tcctlo.law.entity.ClashInfoVO;
import com.tcctlo.law.entity.ImpulseInformation;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -76,5 +77,12 @@ public interface IImpulseInformationService extends IService<ImpulseInformation>
* @param impulseInformation 利冲信息
* @return 是否利冲
*/
Boolean retrievalConflict(ImpulseInformation impulseInformation);
Map<String, Object> retrievalConflict(ImpulseInformation impulseInformation);
/**
* 利冲检索-批量
* @param impulseInformation 利冲信息
* @return 结果集
*/
Map<String, Object> retrievalConflictBatch(List<ImpulseInformation> impulseInformation);
}

View File

@ -0,0 +1,42 @@
package com.tcctlo.law.service;
import com.tcctlo.law.entity.IndexStatistics;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 首页service
*/
public interface IIndexService {
/**
* 案件类型统计
*
* @return 结果集
*/
List<IndexStatistics> caseTypeStatistics(Date startTime, Date endTime);
/**
* 利冲统计
*
* @return 结果集
*/
List<IndexStatistics> conflictStatistics(Date startTime, Date endTime);
/**
* 费用统计
*
* @return 结果集
*/
List<IndexStatistics> costStatistics(Date startTime, Date endTime);
/**
* 收益走势
* @param startTime 其实
* @param endTime
* @return
*/
List<IndexStatistics> earningsTrend(Date startTime, Date endTime);
}

View File

@ -0,0 +1,74 @@
package com.tcctlo.law.service.impl;
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.AuditRecord;
import com.tcctlo.law.mapper.AuditRecordMapper;
import com.tcctlo.law.mapper.CaseInformationMapper;
import com.tcctlo.law.service.IAuditRecordService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
/**
* <p>
* 审核记录表 服务实现类
* </p>
*
* @author
* @since 2025-02-25
*/
@Service
public class AuditRecordServiceImpl extends ServiceImpl<AuditRecordMapper,AuditRecord> implements IAuditRecordService {
@Resource
private AuditRecordMapper auditRecordMapper;
@Resource
private CaseInformationMapper caseInformationMapper;
@Override
public Page<AuditRecord> list(Integer pageNo, Integer pageSize) {
return auditRecordMapper.selectPage(new Page<>(pageNo, pageSize), new QueryWrapper<>());
}
@Override
public AuditRecord getById(Long id) {
AuditRecord auditRecord = auditRecordMapper.selectById(id);
return auditRecord;
}
@Override
public Boolean create(AuditRecord auditRecord) {
LoginUser loginUser = SecurityUtils.getLoginUser();
Long userId = loginUser.getUserId();
String username = loginUser.getUsername();
String nickName = loginUser.getUser().getNickName();
auditRecord.setUserId(userId);
auditRecord.setUserName(nickName);
caseInformationMapper.updateAuditStatusInt(auditRecord.getCaseId(), auditRecord.getAuditResult());
return auditRecordMapper.insert(auditRecord) > 0;
}
@Override
public Integer delete(Long id) {
return auditRecordMapper.deleteById(id);
}
@Override
public Integer update(AuditRecord auditRecord) {
return auditRecordMapper.updateById(auditRecord);
}
@Override
public List<AuditRecord> selectByCaseId(Long caseId) {
return auditRecordMapper.selectByCaseId(caseId);
}
}

View File

@ -2,8 +2,10 @@ 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.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tcctlo.common.core.domain.entity.SysRole;
import com.tcctlo.common.core.domain.model.LoginUser;
import com.tcctlo.common.utils.SecurityUtils;
import com.tcctlo.common.utils.StringUtils;
@ -23,7 +25,10 @@ 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;
/**
@ -46,6 +51,9 @@ public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMappe
@Resource
private ICaseInformationService caseInformationService;
@Resource
private ImpulseInformationMapper impulseInformationMapper;
/**
* 系统用户mapper
*/
@ -155,34 +163,36 @@ public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMappe
Page<CaseInformationListVO> page = new Page<>(pageNo, pageSize);
Page<CaseInformationListVO> caseInformationPage = caseInformationMapper.selectCondition(page, params);
for (CaseInformationListVO item : caseInformationPage.getRecords()) {
/*item.setEntrustingParty(informationMapper.selectByCaseId(item.getId(), 0).stream().map(ImpulseInformation::getCaseName).collect(Collectors.joining(","))); //委托方
item.setOpposite(informationMapper.selectByCaseId(item.getId(), 1).stream().map(ImpulseInformation::getCaseName).collect(Collectors.joining(","))); //相对方
item.setAttorneyAgent(caseLawyerMapper.selectAttorneyAgentLawByCaseId(item.getId()).getLawyerName()); //代理律师
item.setAssistingLawyer(caseLawyerMapper.selectAssistingLawyerByCaseId(item.getId()).stream().map(CaseLawyer::getLawyerName).collect(Collectors.joining(","))); //协办律师
int fileNum = caseInformationMapper.selectCaseFileNum(item.getId());
item.setFileFlag(fileNum > 0);
item.setFileList(fileManagerMapper.selectFileByCaseId(item.getId()));*/
Date paymentDeadline = item.getPaymentDeadline();
if (paymentDeadline != null) {
if (DateUtil.compare(paymentDeadline, new Date()) < 0 && item.getAmountReceivedSum().compareTo(item.getAmountReceivable()) < 0) {
item.setCollectionStatus(3);
}
}
List<ImpulseInformation> entrustingParty = informationMapper.selectByCaseId(item.getId(), 0);
if (CollUtil.isNotEmpty(entrustingParty)){
if (CollUtil.isNotEmpty(entrustingParty)) {
item.setEntrustingParty(entrustingParty.stream().map(ImpulseInformation::getCaseName).collect(Collectors.joining(",")));
}
List<ImpulseInformation> opposite = informationMapper.selectByCaseId(item.getId(), 1);
if (CollUtil.isNotEmpty(opposite)){
if (CollUtil.isNotEmpty(opposite)) {
item.setOpposite(opposite.stream().map(ImpulseInformation::getCaseName).collect(Collectors.joining(",")));
}
CaseLawyer attorneyAgent = caseLawyerMapper.selectAttorneyAgentLawByCaseId(item.getId());
if (BeanUtil.isNotEmpty(attorneyAgent)){
if (BeanUtil.isNotEmpty(attorneyAgent)) {
item.setAttorneyAgent(attorneyAgent.getLawyerName());
}
List<CaseLawyer> assistingLawyer = caseLawyerMapper.selectAssistingLawyerByCaseId(item.getId());
if (CollUtil.isNotEmpty(assistingLawyer)){
if (CollUtil.isNotEmpty(assistingLawyer)) {
item.setAssistingLawyer(assistingLawyer.stream().map(CaseLawyer::getLawyerName).collect(Collectors.joining(",")));
}
item.setUncollectedMoney(item.getAmountReceivable().subtract(item.getAmountReceivedSum()));
int fileNum = caseInformationMapper.selectCaseFileNum(item.getId());
item.setFileFlag(fileNum > 0);
item.setFileList(fileManagerMapper.selectFileByCaseId(item.getId()));
@ -205,7 +215,6 @@ public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMappe
}
@Override
public Integer create(CaseInformation caseInformation) {
return caseInformationMapper.insert(caseInformation);
@ -279,58 +288,79 @@ public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMappe
return true;
}*/
public String getCaseClashInfo(List<ImpulseInformation> list) {
List<ImpulseInformation> resList = new ArrayList<>();
ArrayList<ClashInfoVO> clashInfoVOS = new ArrayList<>();
for (ImpulseInformation item : list) {
item.setIsClient(1 - item.getIsClient());
resList.addAll(impulseInformationMapper.retrievalConflict(item));
}
for (ImpulseInformation item : resList) {
//案件名称委托人\相对方名称类型个人/企业
ClashInfoVO clashInfoVO = new ClashInfoVO();
clashInfoVO.setCaseInfoName(item.getCaseName());
}
return "null";
}
@Override
@Transactional(isolation = Isolation.DEFAULT, rollbackFor = Exception.class)
public Boolean enterCaseInfo(CaseInformationEnterVO caseInfo) {
LoginUser loginUser = SecurityUtils.getLoginUser();
Long userId = loginUser.getUserId();
String username = loginUser.getUsername();
String nickName = loginUser.getUser().getNickName();
try {
CaseInformation caseInformation = caseInfo.getCaseInformation(); //案件信息
caseInformation.setCaseNo(new GenerateCaseNo().generateCaseNo()); //生成案件编号
caseInformation.setCaseNo(GenerateCaseNo.generateRecordNumber()); //生成案件编号
caseInformationMapper.insert(caseInfo.getCaseInformation()); //插入案件信息
Long caseId = caseInformation.getId(); //获取案件ID
//插入案件关联利冲信息设置委托方和相对方
List<ImpulseInformation> impulseInformationList = new ArrayList<>();
List<ImpulseInformation> entrustingParty = caseInfo.getEntrustingParty();
if (CollUtil.isNotEmpty(entrustingParty)){
if (CollUtil.isNotEmpty(entrustingParty)) {
impulseInformationList.addAll(caseInfo.getEntrustingParty().stream().peek(item -> {
item.setCaseId(caseId);
item.setIsClient(0);
}).collect(Collectors.toList()));
}
List<ImpulseInformation> opposite = caseInfo.getOpposite();
if (CollUtil.isNotEmpty(opposite)){
if (CollUtil.isNotEmpty(opposite)) {
impulseInformationList.addAll(caseInfo.getOpposite().stream().peek(item -> {
item.setCaseId(caseId);
item.setIsClient(1);
}).collect(Collectors.toList()));
}
informationService.saveBatch(impulseInformationList);
List<Long> impulseInformationIds = impulseInformationList.stream().map(item -> item.getId()).collect(Collectors.toList());
caseInformation.setImpulseInformationIds(StringUtils.join(impulseInformationIds, ","));
}
//插入案件关联律师数据
List<CaseLawyer> caseLawyerList = new ArrayList<>();
CaseLawyer attorneyAgent = caseInfo.getAttorneyAgent();
if (BeanUtil.isNotEmpty(attorneyAgent)){
if (BeanUtil.isNotEmpty(attorneyAgent)) {
attorneyAgent.setLawyerType(0);
attorneyAgent.setCaseId(caseId);
caseLawyerList.add(attorneyAgent); //代理律师
}
List<CaseLawyer> assistingLawyer = caseInfo.getAssistingLawyer();
if (CollUtil.isNotEmpty(assistingLawyer)){
if (CollUtil.isNotEmpty(assistingLawyer)) {
caseLawyerList.addAll(assistingLawyer.stream().peek(item -> {
item.setCaseId(caseId);
item.setLawyerType(1);
}).collect(Collectors.toList())); //协办律师
}
caseLawyerService.saveBatch(caseLawyerList);
List<Long> caseLawyerIds = caseLawyerList.stream().map(item -> item.getLawyerId()).collect(Collectors.toList());
caseInformation.setCaseLawyerIds(StringUtils.join(caseLawyerIds, ","));
caseInformationMapper.updateById(caseInformation); //更新案件表中的律师IDS和利冲信息IDS
}
//插入案件关联收款记录信息收款记录文件插入
List<CollectionRecordEnterVO> collectionRecordList = caseInfo.getCollectionRecordList();
if (CollUtil.isNotEmpty(collectionRecordList)){
if (CollUtil.isNotEmpty(collectionRecordList)) {
collectionRecordList.forEach(item -> {
item.setCaseId(caseId);
List<FileManager> fileManagerList = item.getFileManager().stream().peek(i -> {
@ -340,6 +370,14 @@ public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMappe
fileManagerService.saveBatch(fileManagerList);
List<Long> fileIds = fileManagerList.stream().map(FileManager::getId).collect(Collectors.toList());
item.setCollectionUrlId(StringUtils.join(fileIds, ","));
item.setUserId(userId);
item.setUserName(nickName);
String collect = loginUser.getUser().getRoles().stream().map(SysRole::getRoleKey).collect(Collectors.joining(","));
if (!collect.contains("FINANCE")){
item.setAuditStatus(0);
}else {
item.setAuditStatus(1);
}
collectionRecordMapper.insert(item);
});
}
@ -356,6 +394,9 @@ public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMappe
CaseInformation caseInformation = caseInformationMapper.selectById(id);
result.setCaseInformation(caseInformation);
//设置案件未收金额
result.setUncollectedMoney(caseInformation.getAmountReceivable().subtract(caseInformation.getAmountReceivedSum()));
//案件关联委托方----entrustingParty
result.setEntrustingParty(informationMapper.selectByCaseId(id, 0));
@ -387,6 +428,11 @@ public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMappe
@Override
@Transactional(isolation = Isolation.DEFAULT, rollbackFor = Exception.class)
public Boolean updateCaseInfo(CaseInformationEnterVO params) {
LoginUser loginUser = SecurityUtils.getLoginUser();
Long userId = loginUser.getUserId();
String username = loginUser.getUsername();
String nickName = loginUser.getUser().getNickName();
try {
//案件信息表----caseInformation
CaseInformation caseInformation = params.getCaseInformation();
@ -406,10 +452,10 @@ public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMappe
//代理律师----attorneyAgent----修改原来的律师信息
CaseLawyer newAttorneyAgent = params.getAttorneyAgent();
if (BeanUtil.isNotEmpty(newAttorneyAgent)){
if (BeanUtil.isNotEmpty(newAttorneyAgent)) {
if (newAttorneyAgent.getId() == null) {
CaseLawyer oldCaseLawyer = caseLawyerMapper.selectAttorneyAgentLawByCaseId(params.getCaseInformation().getId());
if (oldCaseLawyer != null){
if (oldCaseLawyer != null) {
oldCaseLawyer.setIsPrime(1);
caseLawyerMapper.updateById(oldCaseLawyer);
}
@ -419,7 +465,6 @@ public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMappe
}
//协办律师----assistingLawyer
List<CaseLawyer> newAssistingLawyer = params.getAssistingLawyer(); //协办律师
List<CaseLawyer> oldAssistingLawyer = caseLawyerMapper.selectAssistingLawyerByCaseId(params.getCaseInformation().getId());
@ -441,10 +486,17 @@ 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.setUserName(nickName);
String collect = loginUser.getUser().getRoles().stream().map(SysRole::getRoleKey).collect(Collectors.joining(","));
if (!collect.contains("FINANCE")){
item.setAuditStatus(0);
}else {
item.setAuditStatus(1);
}*/
});
List<CollectionRecord> list = BeanUtil.copyToList(insert, CollectionRecord.class);
collectionRecordService.saveBatch(list);
/*BigDecimal addSum = BigDecimal.valueOf(insert.stream().mapToDouble(item -> item.getAmountReceived().doubleValue()).sum());*/
//获取删除的收款记录,计算出删除的收款记录的金额在总金额中减去
List<Long> deleteIds = (List<Long>) CollUtil.subtract(oldIds, newIds);
@ -452,12 +504,11 @@ public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMappe
item.setDelFlag(1);
item.setStatus(1);
}).collect(Collectors.toList());
/*BigDecimal delSum = BigDecimal.valueOf(deleteData.stream().mapToDouble(item -> item.getAmountReceived().doubleValue()).sum());*/
for (CollectionRecordEnterVO item : deleteData) {
//根据caseId和收款记录ID删除收款记录
collectionRecordMapper.removeByCaseIdAdnRecordId(item.getId(),caseId);
collectionRecordMapper.removeByCaseIdAdnRecordId(item.getId(), caseId);
//根据caseId和收款记录ID删除收款记录文件
List<Long> fileIds = Arrays.stream(item.getCollectionUrlId().split(","))
.map(Long::parseLong)
@ -465,7 +516,7 @@ public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMappe
fileManagerMapper.removeByCaseIdAndFileIds(caseId, fileIds);
}
caseInformationMapper.updateById(caseInformation);
}catch (Exception e){
} catch (Exception e) {
throw new RuntimeException("保存失败");
}
return true;
@ -522,11 +573,22 @@ public class CaseInformationServiceImpl extends ServiceImpl<CaseInformationMappe
return caseInformationMapper.claimWithdrawal(params);
}
@Override
public Boolean closeCase(Map<String, Object> params) {
return caseInformationMapper.claimWithdrawal(params);
}
@Override
public Boolean caseClosed(Map<String, Object> params) {
return caseInformationMapper.caseClosed(params);
}
@Override
public Boolean caseInfoUpload(List<FileManager> fileManager) {
fileManager.forEach(item -> item.setFileType(2));
return fileManagerService.saveBatch(fileManager);
}
/**
* 编辑协办律师
*

View File

@ -1,31 +1,61 @@
package com.tcctlo.law.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tcctlo.common.core.domain.entity.SysRole;
import com.tcctlo.common.core.domain.model.LoginUser;
import com.tcctlo.common.utils.SecurityUtils;
import com.tcctlo.law.entity.CollectionRecord;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tcctlo.law.entity.FileManager;
import com.tcctlo.law.mapper.CaseInformationMapper;
import com.tcctlo.law.mapper.CollectionRecordMapper;
import com.tcctlo.law.mapper.FileManagerMapper;
import com.tcctlo.law.service.ICollectionRecordService;
import com.tcctlo.law.service.IFileManagerService;
import com.tcctlo.law.vo.CollectionRecordEnterVO;
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.Collections;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* <p>
* 收款记录表 服务实现类
* </p>
*
* @author 张世琪
* @since 2025-02-06
*/
* <p>
* 收款记录表 服务实现类
* </p>
*
* @author 张世琪
* @since 2025-02-06
*/
@Service
public class CollectionRecordServiceImpl extends ServiceImpl<CollectionRecordMapper,CollectionRecord> implements ICollectionRecordService {
public class CollectionRecordServiceImpl extends ServiceImpl<CollectionRecordMapper, CollectionRecord> implements ICollectionRecordService {
@Resource
private CollectionRecordMapper collectionRecordMapper;
@Resource
private IFileManagerService fileManagerService;
@Resource
private FileManagerMapper fileManagerMapper;
@Resource
private CaseInformationMapper caseInformationMapper;
@Override
public Page<CollectionRecord> list(Integer pageNo, Integer pageSize) {
return collectionRecordMapper.selectPage(new Page<>(pageNo, pageSize), new QueryWrapper<>());
@ -52,4 +82,117 @@ public class CollectionRecordServiceImpl extends ServiceImpl<CollectionRecordMap
return collectionRecordMapper.updateById(collectionRecord);
}
@Override
@Transactional(isolation = Isolation.DEFAULT, rollbackFor = Exception.class)
public void casePayment(CollectionRecordEnterVO params) {
try {
LoginUser loginUser = SecurityUtils.getLoginUser();
Long userId = loginUser.getUserId();
String nickName = loginUser.getUser().getNickName();
CollectionRecord collectionRecord = BeanUtil.copyProperties(params, CollectionRecord.class);
collectionRecord.setUserId(userId);
collectionRecord.setUserName(nickName);
String collect = loginUser.getUser().getRoles().stream().map(SysRole::getRoleKey).collect(Collectors.joining(","));
if (!collect.contains("FINANCE")) {
collectionRecord.setAuditStatus(0);
} else {
collectionRecord.setAuditStatus(1);
}
List<FileManager> fileManagerList = params.getFileManager().stream().peek(item -> item.setFileType(1)).collect(Collectors.toList());
fileManagerService.saveBatch(fileManagerList);
String fileIds = fileManagerList.stream().map(fileManager -> fileManager.getId().toString()).collect(Collectors.joining(","));
collectionRecord.setCollectionUrlId(fileIds);
collectionRecordMapper.insert(collectionRecord);
//修改案件信息表中的已收金额-----根据案件ID查询缴费记录做一个累加
List<CollectionRecord> lists = BeanUtil.copyToList(collectionRecordMapper.selectByCaseId(params.getCaseId()), CollectionRecord.class);
BigDecimal reduce = lists.stream().map(CollectionRecord::getAmountReceived).reduce(BigDecimal.ZERO, BigDecimal::add);
caseInformationMapper.updateCaseAmount(params.getCaseId(), reduce); //修改案件信息表中已收金额总计
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("缴费失败");
}
}
@Override
@Transactional(isolation = Isolation.DEFAULT, rollbackFor = Exception.class)
public Boolean casePaymentBatch(List<CollectionRecordEnterVO> params) {
try {
LoginUser loginUser = SecurityUtils.getLoginUser();
Long userId = loginUser.getUserId();
String nickName = loginUser.getUser().getNickName();
if (CollUtil.isNotEmpty(params)) {
List<CollectionRecordEnterVO> newData = params; //收款记录信息
//获取新添加的收款记录计算出新的收款记录金额在总金额中加上
List<CollectionRecordEnterVO> insert = newData.stream().filter(item -> item.getId() == null).collect(Collectors.toList());
insert.forEach(item -> {
List<FileManager> fileManager = item.getFileManager().stream().peek(item1 -> item1.setFileType(1)).collect(Collectors.toList());
fileManagerService.saveBatch(fileManager);
item.setCollectionUrlId(fileManager.stream().map(i -> i.getId().toString()).collect(Collectors.joining(",")));
item.setUserId(userId);
item.setUserName(nickName);
String collect = loginUser.getUser().getRoles().stream().map(SysRole::getRoleKey).collect(Collectors.joining(","));
if (!collect.contains("FINANCE")) {
item.setAuditStatus(0);
} else {
item.setAuditStatus(1);
}
});
List<CollectionRecord> list = BeanUtil.copyToList(insert, CollectionRecord.class);
BigDecimal addMoney = list.stream().map(CollectionRecord::getAmountReceived).reduce(BigDecimal.ZERO, BigDecimal::add); //新增收款记录金额
this.saveBatch(list);
Long caseId = list.get(0).getCaseId();
caseInformationMapper.updateCaseAmount(caseId, caseInformationMapper.selectCaseById(caseId).getAmountReceivedSum().add(addMoney));
}
return true;
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("批量收款失败");
}
}
@Override
@Transactional(isolation = Isolation.DEFAULT, rollbackFor = Exception.class)
public Boolean deleteLogic(Map<String, Long> params) {
try {
Long id = params.get("id");
Long caseId = params.get("caseId");
CollectionRecord collectionRecord = collectionRecordMapper.selectById(id);
BigDecimal delMoney = collectionRecord.getAmountReceived(); //要减去的金额
collectionRecordMapper.removeByCaseIdAdnRecordId(id, caseId); //从收款记录中删除
caseInformationMapper.updateCaseAmount(caseId, caseInformationMapper.selectCaseById(caseId).getAmountReceivedSum().subtract(delMoney));
List<Long> fileIds = Arrays.stream(collectionRecord.getCollectionUrlId().split(",")).map(Long::parseLong).collect(Collectors.toList());
fileManagerMapper.removeByCaseIdAndFileIds(caseId, fileIds);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("删除失败");
}
return true;
}
@Override
public List<CollectionRecordEnterVO> selectByCaseId(Long caseId) {
List<CollectionRecordEnterVO> lists = collectionRecordMapper.selectByCaseId(caseId);
for (CollectionRecordEnterVO item : lists) {
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;
}
@Override
public Boolean audit(Map<String, Long> map) {
Long id = map.get("id");
return collectionRecordMapper.audit(id) > 0;
}
}

View File

@ -0,0 +1,54 @@
package com.tcctlo.law.service.impl;
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.law.entity.ContractFormParameter;
import com.tcctlo.law.mapper.ContractFormParameterMapper;
import com.tcctlo.law.service.IContractFormParameterService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* <p>
* 合同表单参数 服务实现类
* </p>
*
* @author
* @since 2025-02-21
*/
@Service
public class ContractFormParameterServiceImpl extends ServiceImpl<ContractFormParameterMapper,ContractFormParameter> implements IContractFormParameterService {
@Resource
private ContractFormParameterMapper contractFormParameterMapper;
@Override
public Page<ContractFormParameter> list(Integer pageNo, Integer pageSize) {
return contractFormParameterMapper.selectPage(new Page<>(pageNo, pageSize), new QueryWrapper<>());
}
@Override
public ContractFormParameter getById(Long id) {
ContractFormParameter contractFormParameter = contractFormParameterMapper.selectById(id);
return contractFormParameter;
}
@Override
public Integer create(ContractFormParameter contractFormParameter) {
return contractFormParameterMapper.insert(contractFormParameter);
}
@Override
public Integer delete(Long id) {
return contractFormParameterMapper.deleteById(id);
}
@Override
public Integer update(ContractFormParameter contractFormParameter) {
return contractFormParameterMapper.updateById(contractFormParameter);
}
}

View File

@ -1,28 +1,28 @@
package com.tcctlo.law.service.impl;
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.deepoove.poi.XWPFTemplate;
import com.tcctlo.common.core.domain.AjaxResult;
import com.tcctlo.common.utils.StringUtils;
import com.tcctlo.law.entity.ContractTemplate;
import com.tcctlo.law.entity.wordTemplateEntity.BaseWordEntity;
import com.tcctlo.law.mapper.ContractTemplateMapper;
import com.tcctlo.law.service.IContractTemplateService;
import com.tcctlo.law.tools.FileUpload;
import org.dromara.x.file.storage.core.FileInfo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import java.time.LocalDateTime;
import java.util.*;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
/**
@ -57,7 +57,8 @@ public class ContractTemplateServiceImpl extends ServiceImpl<ContractTemplateMap
@Override
public Page<ContractTemplate> list(Map<String, Object> params) {
return contractTemplateMapper.selectPage(new Page<>((Integer) params.get("current"), (Integer) params.get("size")), new QueryWrapper<>());
// return contractTemplateMapper.selectPage(new Page<>((Integer) params.get("current"), (Integer) params.get("size")), new QueryWrapper<>());
return contractTemplateMapper.selectCondition(new Page<>((Integer) params.get("current"), (Integer) params.get("size")), params);
}
@Override
@ -66,40 +67,16 @@ public class ContractTemplateServiceImpl extends ServiceImpl<ContractTemplateMap
return contractTemplate;
}
/**
* 下载文件至本地
*
* @param response 响应
*/
@GetMapping("/downloadFileOnLocal")
public AjaxResult downloadFile(HttpServletResponse response, @RequestParam("urlPath") String urlPath, @RequestParam("path") String path) {
try {
URL url = new URL(urlPath);
String filePath = "F:\\fileDownload\\" + UUID.randomUUID() + urlPath.substring(urlPath.lastIndexOf("."));
URLConnection conn = url.openConnection();
InputStream inputStream = conn.getInputStream();
FileOutputStream fileOutputStream = new FileOutputStream(filePath);
int bytesum = 0;
int byteread;
byte[] buffer = new byte[1024];
while ((byteread = inputStream.read(buffer)) != -1) {
bytesum += byteread;
fileOutputStream.write(buffer, 0, byteread);
}
fileOutputStream.close();
return AjaxResult.success("下载成功");
} catch (Exception e) {
throw new RuntimeException("下载失败");
}
}
@Override
/*@Override
public Integer create(ContractTemplate contractTemplate) {
try {
URL url = new URL(contractTemplate.getFileUrl());
String filePath = serviceFilePath + UUID.randomUUID() + contractTemplate.getFileUrl().substring(contractTemplate.getFileUrl().lastIndexOf("."));
String filePathSource = serviceFilePath + UUID.randomUUID() + "_source" + contractTemplate.getFileUrl().substring(contractTemplate.getFilePathSource().lastIndexOf("."));
// String filePath = "/backitems/lawFirm/wordTemplate/" + UUID.randomUUID() + contractTemplate.getFileUrl().substring(contractTemplate.getFileUrl().lastIndexOf("."));
contractTemplate.setFilePath(filePath);
contractTemplate.setFilePathSource(filePathSource);
URLConnection conn = url.openConnection();
InputStream inputStream = conn.getInputStream();
FileOutputStream fileOutputStream = new FileOutputStream(filePath);
@ -114,10 +91,49 @@ public class ContractTemplateServiceImpl extends ServiceImpl<ContractTemplateMap
} catch (Exception e) {
throw new RuntimeException("存储至服务器失败");
}
return contractTemplateMapper.insert(contractTemplate);
}*/
@Override
public Integer create(ContractTemplate contractTemplate){
try {
if (StringUtils.isNotBlank(contractTemplate.getFileUrl())){
URL url = new URL(contractTemplate.getFileUrl());
String filePath = serviceFilePath + UUID.randomUUID() + contractTemplate.getFileUrl().substring(contractTemplate.getFileUrl().lastIndexOf("."));
contractTemplate.setFilePath(filePath);
uploadOnService(url, filePath);
}
if (StringUtils.isNotBlank(contractTemplate.getFileUrlSource())){
URL fileUrlSource = new URL(contractTemplate.getFileUrlSource());
String filePathSource = serviceFilePath + UUID.randomUUID() + "_source" + contractTemplate.getFileUrlSource().substring(contractTemplate.getFileUrlSource().lastIndexOf("."));
contractTemplate.setFilePathSource(filePathSource);
uploadOnService(fileUrlSource, filePathSource);
}
} catch (Exception e) {
throw new RuntimeException("存储至服务器失败");
}
return contractTemplateMapper.insert(contractTemplate);
}
public void uploadOnService(URL url, String filePath) {
try {
URLConnection conn = url.openConnection();
InputStream inputStream = conn.getInputStream();
FileOutputStream fileOutputStream = new FileOutputStream(filePath);
int bytesum = 0;
int byteread;
byte[] buffer = new byte[1024];
while ((byteread = inputStream.read(buffer)) != -1) {
bytesum += byteread;
fileOutputStream.write(buffer, 0, byteread);
}
fileOutputStream.close();
} catch (Exception e) {
throw new RuntimeException("存储至服务器失败");
}
}
@Override
public Integer delete(Long id) {
return contractTemplateMapper.deleteById(id);
@ -138,33 +154,36 @@ public class ContractTemplateServiceImpl extends ServiceImpl<ContractTemplateMap
}
@Override
public void getWord(Long id) throws Exception {
ContractTemplate contractTemplate = contractTemplateMapper.selectById(id);
String filePath = contractTemplate.getFilePath();
HashMap<String, String> map = new HashMap<>();
map.put("firstParty","甲方名称");
map.put("secondParty","乙方名称");
map.put("solicitor","张三、李四、王五");
map.put("commitment","委托事项委托事项委托事项委托事项");
map.put("signDate", LocalDateTime.now().toString());
map.put("legalRepresentative","法定代表人");
map.put("idNo","620121199708060011");
map.put("creditCode","52031001156477894");
map.put("bankName","中国建设银行");
map.put("accountNum","4561112557894411");
map.put("address","云南省昆明市");
map.put("phone","13359490766");
map.put("facsimile","0931-6554211");
map.put("postcode","730300");
XWPFTemplate template = XWPFTemplate.compile(filePath).render(map);
public String getWord(Map<String, Long> param) throws Exception {
Long wordId = param.get("wordId");
Long caseId = param.get("caseId");
ContractTemplate contractTemplate = contractTemplateMapper.selectById(wordId);
if (caseId == null) {
return contractTemplate.getFileUrlSource();
}
if (StringUtils.isBlank(contractTemplate.getFilePath())){
return contractTemplate.getFileUrlSource();
}
List<BaseWordEntity> list = contractTemplateMapper.selectWordParam(caseId);
System.out.println(list);
BaseWordEntity baseWordEntity = new BaseWordEntity();
String firstParty = list.stream().map(item -> item.getFirstParty()).collect(Collectors.joining(""));
baseWordEntity.setFirstParty(firstParty);
baseWordEntity.setSolicitor(list.get(0).getSolicitor());
baseWordEntity.setSocialCreditCode(list.get(0).getSocialCreditCode());
baseWordEntity.setAddress(list.get(0).getAddress());
String savePath = generatedWordPath + UUID.randomUUID().toString() + ".docx";
XWPFTemplate template = XWPFTemplate.compile(contractTemplate.getFilePath()).render(baseWordEntity);
FileOutputStream out = new FileOutputStream(savePath);
template.write(out);
out.flush();
out.close();
template.close();
File file = new File(savePath);
System.out.println(fileUpload.uploadFile(file));
FileInfo fileInfo = fileUpload.uploadFile(file);
String url = fileInfo.getUrl();
System.out.println(url);
return url;
}
}

View File

@ -0,0 +1,73 @@
package com.tcctlo.law.service.impl;
import cn.hutool.core.date.DateUtil;
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 org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
import java.util.function.BiConsumer;
import java.util.function.Function;
import java.util.stream.Collectors;
@Service
public class IIndexServiceImpl implements IIndexService {
@Resource
private CaseInformationMapper caseInformationMapper;
@Resource
private CollectionRecordMapper recordMapper;
@Override
public List<IndexStatistics> caseTypeStatistics(Date startTime, Date endTime) {
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))));
return res;
}
@Override
public List<IndexStatistics> conflictStatistics(Date startTime, Date endTime) {
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))));
return res;
}
@Override
public List<IndexStatistics> costStatistics(Date startTime, Date endTime) {
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))));
return res;
}
@Override
public List<IndexStatistics> earningsTrend(Date startTime, Date endTime) {
List<CollectionRecord> list = recordMapper.earningsTrend(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<>();
TreeMap<String, List<CollectionRecord>> itemMap = new TreeMap<>();
treeMap.forEach((date, collectionRecords) -> itemMap.put(DateUtil.format(date, "yyyy-MM-dd"), collectionRecords));
itemMap.forEach((s, collectionRecords) -> {
IndexStatistics indexStatistics = new IndexStatistics();
indexStatistics.setName(s);
indexStatistics.setValue(collectionRecords.stream().mapToDouble(item -> item.getAmountReceived().doubleValue()).sum());
res.add(indexStatistics);
});
return res;
}
}

View File

@ -7,20 +7,19 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
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.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tcctlo.law.mapper.CaseInformationMapper;
import com.tcctlo.law.mapper.ImpulseInformationMapper;
import com.tcctlo.law.service.IImpulseInformationService;
import com.tcctlo.law.vo.CaseInformationListVO;
import com.tcctlo.law.vo.ImpulseInformationVO;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.function.Consumer;
import java.util.stream.Collectors;
@ -81,8 +80,22 @@ public class ImpulseInformationServiceImpl extends ServiceImpl<ImpulseInformatio
return impulseInformationMapper.selectList(wrapper);
}
@Override
/*@Override
public Boolean retrievalConflict(ImpulseInformation impulseInformation) {
*//**
* impulseInformation.getIsClient() 的值为 0 1 - 0 结果为 1 impulseInformation.getIsClient() 的值为 1 1 - 1 结果为 0
* 注意
* 1如果是委托方就去检索相对方中有没有
* 2如果是相对方就去检索委托方中有没有
* 3委托方不能是律所中任何一个案件的被告方====被告方不能是律所中任何一个案件的委托方
*//*
impulseInformation.setIsClient(1 - impulseInformation.getIsClient());
List<ImpulseInformation> resList = impulseInformationMapper.retrievalConflict(impulseInformation);
return resList.isEmpty();
}*/
@Override
public Map<String, Object> retrievalConflict(ImpulseInformation impulseInformation) {
/**
* impulseInformation.getIsClient() 的值为 0 1 - 0 结果为 1 impulseInformation.getIsClient() 的值为 1 1 - 1 结果为 0
* 注意
@ -90,9 +103,35 @@ public class ImpulseInformationServiceImpl extends ServiceImpl<ImpulseInformatio
* 2如果是相对方就去检索委托方中有没有
* 3委托方不能是律所中任何一个案件的被告方====被告方不能是律所中任何一个案件的委托方
*/
TreeMap<String, Object> resMap = new TreeMap<>();
List<ClashInfoVO> clashInfoVOS = new ArrayList<>();
impulseInformation.setIsClient(1 - impulseInformation.getIsClient());
List<ImpulseInformation> resList = impulseInformationMapper.retrievalConflict(impulseInformation);
return resList.isEmpty();
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> retrievalConflictBatch(List<ImpulseInformation> impulseInformation) {
for (ImpulseInformation info : impulseInformation) {
info.setIsClient(1 - info.getIsClient());
List<ImpulseInformation> resList = impulseInformationMapper.retrievalConflict(info);
}
return Collections.emptyMap();
}
@Override

View File

@ -6,6 +6,28 @@ import java.text.SimpleDateFormat;
import java.util.Date;
public class GenerateCaseNo {
private static int dailyCounter = 0;
private static String lastDate = "";
public static synchronized String generateRecordNumber() {
// 获取当前日期
String currentDate = java.time.LocalDate.now().toString();
// 如果日期变化重置计数器
if (!currentDate.equals(lastDate)) {
dailyCounter = 0;
lastDate = currentDate;
}
// 增加计数器
dailyCounter++;
// 格式化编号假设编号前缀为 "REC-"后跟日期和三位计数器
String recordNumber = String.format("REC-%s-%03d", currentDate.replace("-", ""), dailyCounter);
return recordNumber;
}
public String generateCaseNo() {
// 获取当前日期和时间精确到秒
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
@ -17,4 +39,6 @@ public class GenerateCaseNo {
// 组合成订单编号
return currentDateTime + "-" + strRandom;
}
}

View File

@ -5,6 +5,7 @@ import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.List;
/**
@ -15,6 +16,11 @@ import java.util.List;
@AllArgsConstructor
public class CaseInformationEnterVO {
/**
* 案件未收款的金额
*/
private BigDecimal uncollectedMoney;
/**
* 案件信息
*/

View File

@ -6,6 +6,7 @@ import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.List;
/**
@ -16,6 +17,11 @@ import java.util.List;
@AllArgsConstructor
public class CaseInformationListVO extends CaseInformation {
/**
* 案件未收款的金额
*/
private BigDecimal uncollectedMoney;
/**
* 委托方
*/
@ -48,4 +54,5 @@ public class CaseInformationListVO extends CaseInformation {
private List<FileManager> fileList;
}

View File

@ -13,6 +13,11 @@ import java.util.List;
@AllArgsConstructor
public class CollectionRecordEnterVO extends CollectionRecord {
/**
* 是否审核
*/
private Boolean isEdit;
/**
* 文件管理
*/

View File

@ -0,0 +1,17 @@
<?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.AuditRecordMapper">
<select id="selectByCaseId" resultType="com.tcctlo.law.entity.AuditRecord">
select * from audit_record ar
<where>
1 = 1
<if test="caseId != null and caseId != ''">
and ar.case_id = #{caseId}
</if>
and ar.status = 0
and ar.del_fag = 0
order by ar.create_time desc
</where>
</select>
</mapper>

View File

@ -8,7 +8,7 @@
ci
.
id
,ci.case_no,ci.case_name,ci.case_context,ci.business_type,ci.business_classify,ci.case_type,ci.agency_stage,ci.case_source,ci.amount_receivable,ci.amount_received_sum,ci.payment_deadline,ci.reserve_money,ci.term_of_consultancy,ci.collection_status,ci.impulse_state,ci.case_status,ci.audit_status,ci.archive_status,ci.is_finish_case,ci.audit_opinion,ci.impulse_information_ids,ci.case_lawyer_ids,ci.status,ci.del_flag,ci.create_by,ci.create_time,ci.update_by,ci.update_time,ci.remake
,ci.case_no,ci.case_name,ci.case_context,ci.business_type,ci.business_classify,ci.case_type,ci.agency_stage,ci.case_source,ci.amount_receivable,ci.amount_received_sum,ci.payment_deadline,ci.reserve_money,ci.term_of_consultancy,ci.collection_status,ci.impulse_state,ci.case_status,ci.audit_status,ci.archive_status,ci.is_finish_case,ci.impulse_information_ids,ci.case_lawyer_ids,ci.status,ci.del_flag,ci.create_by,ci.create_time,ci.update_by,ci.update_time,ci.remake
</sql>
<update id="caseArchived">
update case_information ci
@ -65,17 +65,38 @@
</if>
</where>
</update>
<update id="updateAuditStatusInt">
update case_information ci
<set>
<if test="auditStatus != null">
ci.audit_status = #{auditStatus},
</if>
</set>
where ci.id = #{caseId}
</update>
<update id="updateCaseAmount">
update case_information ci
<set>
<if test="amountReceived != null">
ci.amount_received_sum = #{amountReceived},
</if>
</set>
where ci.id = #{caseId}
</update>
<select id="selectCondition" resultType="com.tcctlo.law.vo.CaseInformationListVO" parameterType="map">
select
<include refid="baseColumn"/>
*
from case_information ci
<where>
1 = 1
<if test="condition.caseName != null">
and ci.case_name like concat('%',#{condition.caseName},'%')
</if>
<if test="condition.caseNo != null and condition.caseNo != ''">
and ci.case_no like concat('%',#{condition.caseNo},'%')
</if>
<if test="condition.businessType != null">
and ci.business_type = #{condition.businessType}
</if>
@ -131,4 +152,59 @@
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>
1 = 1
<if test="type != null">
and ci.business_classify = #{type}
</if>
and ci.create_time between #{startTime} and #{endTime}
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>
1 = 1
<if test="caseStatus != null">
and ci.case_status = #{caseStatus}
</if>
and ci.create_time between #{startTime} and #{endTime}
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
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
and ci.amount_received_sum &lt; ci.amount_receivable
and ci.create_time between #{startTime} and #{endTime}
and ci.del_flag =0
and ci.status = 0
</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.status = 0
</select>
<!--<select id="overdue" resultType="java.lang.Integer">
select count(ci.id) as sumNum from case_information ci where
and ci.payment_deadline &lt; now()
and ci.create_time between #{startTime} and #{endTime}
and ci.del_flag =0
and ci.status = 0
</select>-->
</mapper>

View File

@ -8,6 +8,10 @@
cr.collection_type collectionType,
cr.amount_received amountReceived,
cr.collection_url_id collectionUrlId,
cr.collection_date collectionDate,
cr.user_id userId,
cr.user_name userName,
cr.audit_status auditStatus,
cr.status status,
cr.del_flag delFlag,
cr.create_by createBy,
@ -29,6 +33,16 @@
set cr.del_flag = 1, cr.status = 1
where case_id = #{caseId} and id = #{id}
</update>
<update id="deleteLogic">
update collection_record cr
set cr.del_flag = 1, cr.status = 1
where cr.id = #{id}
</update>
<update id="audit">
update collection_record cr
set cr.audit_status = 1
where cr.id = #{id}
</update>
<select id="selectByCaseId" resultType="com.tcctlo.law.vo.CollectionRecordEnterVO">
select <include refid="baseColumn"/> from collection_record cr
@ -42,4 +56,19 @@
order by cr.create_time asc
</where>
</select>
<select id="earningsTrend" resultType="com.tcctlo.law.entity.CollectionRecord">
select * from collection_record cr
<where>
1 = 1
<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,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.tcctlo.law.mapper.ContractFormParameterMapper">
</mapper>

View File

@ -8,4 +8,24 @@
#{id}
</foreach>
</update>
<select id="selectWordParam" resultType="com.tcctlo.law.entity.wordTemplateEntity.BaseWordEntity">
select ci.case_name,
ii.case_name as firstParty,
ii.case_no as socialCreditCode,
ii.case_address as address,
cl.lawyer_name as solicitor
from case_information ci, impulse_information ii, case_lawyer cl
where ci.id = #{caseId} and ci.id = ii.case_id and ii.is_client = 0 and ci.id = cl.case_id and cl.is_prime = 0 and cl.lawyer_type = 0;
</select>
<select id="selectCondition" resultType="com.tcctlo.law.entity.ContractTemplate">
select * from contract_template ct
<where>
1 = 1
<if test="condition.templateName != null">
and ct.template_name like concat('%',#{condition.templateName},'%')
</if>
and ct.status = 0 and ct.del_flag = 0
</where>
order by ct.create_time desc
</select>
</mapper>

View File

@ -6,7 +6,7 @@
INSERT INTO file_manager (case_id, new_file_name, old_file_name, file_url, file_type)
VALUES
<foreach collection="list" item="item" separator=",">
(#{item.caseId}, #{item.newFileName}, #{item.oldFileName}, #{item.fileurl}, #{item.fileType})
(#{item.caseId}, #{item.newFileName}, #{item.oldFileName}, #{item.fileUrl}, #{item.fileType})
</foreach>
</insert>
<update id="removeByCaseId">
@ -26,6 +26,19 @@
#{id}
</foreach>
</update>
<select id="selectByCRid" resultType="com.tcctlo.law.entity.FileManager">
select * from file_manager fm
<where>
1 = 1
and fm.id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
and fm.status = 0
and fm.del_flag = 0
</where>
</select>
<select id="selectByCaseIdAndFileId" resultType="com.tcctlo.law.entity.FileManager">
select * from file_manager fm
<where>
@ -51,4 +64,5 @@
and fm.del_flag = 0
</where>
</select>
</mapper>

View File

@ -1,6 +1,7 @@
package com.tcctlo.law;
import com.deepoove.poi.XWPFTemplate;
import com.tcctlo.law.entity.wordTemplateEntity.BaseWordEntity;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@ -16,7 +17,7 @@ public class WordTest {
HashMap<String, String> map = new HashMap<>();
map.put("firstParty","甲方名称");
map.put("secondParty","乙方名称");
map.put("solicitor","张三、李四、王五");
// map.put("solicitor","张三、李四、王五");
map.put("commitment","委托事项委托事项委托事项委托事项");
map.put("signDate", LocalDateTime.now().toString());
map.put("legalRepresentative","法定代表人");
@ -28,7 +29,22 @@ public class WordTest {
map.put("phone","13359490766");
map.put("facsimile","0931-6554211");
map.put("postcode","730300");
XWPFTemplate template = XWPFTemplate.compile("D:/templeteWord/常年法律顾问合同2023.12版).docx").render(map);
XWPFTemplate template = XWPFTemplate.compile("D:/templeteWord/法律顾问合同/常年法律顾问合同2023.12版).docx").render(map);
FileOutputStream out = new FileOutputStream("D:/word/常年法律顾问合同.docx");
template.write(out);
out.flush();
out.close();
template.close();
}
@Test
void wordTest() throws Exception{
BaseWordEntity baseWordEntity = new BaseWordEntity();
baseWordEntity.setFirstParty("甲方名称");
baseWordEntity.setSolicitor("承办律师");
baseWordEntity.setSocialCreditCode("620121199708060011");
baseWordEntity.setAddress("云南省昆明市城关区");
XWPFTemplate template = XWPFTemplate.compile("D:/templeteWord/法律顾问合同/常年法律顾问合同2023.12版).docx").render(baseWordEntity);
FileOutputStream out = new FileOutputStream("D:/word/常年法律顾问合同.docx");
template.write(out);
out.flush();

View File

@ -1,6 +1,8 @@
package com.tcctlo.system.mapper;
import java.util.List;
import com.tcctlo.common.core.domain.entity.SysRole;
import org.apache.ibatis.annotations.Param;
import com.tcctlo.system.domain.SysUserRole;
@ -59,4 +61,11 @@ public interface SysUserRoleMapper
* @return 结果
*/
public int deleteUserRoleInfos(@Param("roleId") Long roleId, @Param("userIds") Long[] userIds);
/**
*
* @param userId 用户ID
* @return 结果集
*/
List<String> selectByUserId(@Param("userId") Long userId);
}

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import javax.validation.Validator;
@ -80,7 +81,12 @@ public class SysUserServiceImpl implements ISysUserService {
@Override
@DataScope(deptAlias = "d", userAlias = "u")
public List<SysUser> selectUserList(SysUser user) {
return userMapper.selectUserList(user);
List<SysUser> sysUsers = userMapper.selectUserList(user);
sysUsers.stream().peek(item -> {
List<String> strings = userRoleMapper.selectByUserId(item.getUserId());
item.setRolesName(strings);
}).collect(Collectors.toList());
return sysUsers;
}
/**

View File

@ -92,6 +92,9 @@
<if test="userId != null and userId != 0">
AND u.user_id = #{userId}
</if>
<if test="roleId != null and roleId != 0">
AND u.user_id in (select sur.user_id from sys_user_role sur where sur.role_id = #{roleId})
</if>
<if test="userName != null and userName != ''">
AND u.user_name like concat('%', #{userName}, '%')
</if>

View File

@ -16,6 +16,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="countUserRoleByRoleId" resultType="Integer">
select count(1) from sys_user_role where role_id=#{roleId}
</select>
<select id="selectByUserId" resultType="string">
select sr.role_name from sys_role sr where sr.role_id in (select role_id from sys_user_role where user_id=#{userId})
</select>
<delete id="deleteUserRole" parameterType="Long">
delete from sys_user_role where user_id in