From abb96916e35e0af9fa099e7e60dbf6c1750487e1 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Tue, 6 Feb 2024 15:56:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=96=B0=E5=A2=9E=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ArbitrateApplicationController.java | 54 +++ .../CaseApplicationController.java | 8 - .../common/utils/CheckSignatuerUtils.java | 65 +++ .../domain/vo/CaseApplicationVO.java | 419 ++++++++++++++++++ .../service/ICaseApplicationService.java | 2 + .../impl/CaseApplicationServiceImpl.java | 115 +++++ 6 files changed, 655 insertions(+), 8 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitrateApplicationController.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/utils/CheckSignatuerUtils.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseApplicationVO.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitrateApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitrateApplicationController.java new file mode 100644 index 0000000..993d31c --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitrateApplicationController.java @@ -0,0 +1,54 @@ +package com.ruoyi.web.controller.wisdomarbitrate; + +import cn.hutool.json.JSONUtil; +import com.ruoyi.common.annotation.Anonymous; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.CheckSignatuerUtils; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.vo.CaseApplicationVO; +import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/callArbitrateCaseApplication") +public class ArbitrateApplicationController extends BaseController { + @Autowired + private ICaseApplicationService caseApplicationService; + + + /** + * 新增立案数据 + */ + @Anonymous + @PostMapping("/generateCaseApplication") + public AjaxResult generateCaseApplication(@Validated @RequestBody CaseApplicationVO caseApplicationVO) throws Exception { + String paramsbody = JSONUtil.toJsonStr(caseApplicationVO); + boolean checkResult= CheckSignatuerUtils.checkSignuter(paramsbody); + if(checkResult){ + CaseApplication caseApplication = new CaseApplication(); + BeanUtils.copyProperties(caseApplicationVO,caseApplication); + caseApplication.setCreateBy(getUsername()); + return toAjax(caseApplicationService.insertcaseApplication1(caseApplication)); + }else { + return AjaxResult.error("签名验证失败"); + } + + } + + + + + + + + + + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index 4ab8ac6..45b4352 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -2,20 +2,15 @@ package com.ruoyi.web.controller.wisdomarbitrate; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; -import com.alipay.api.internal.util.file.IOUtils; import com.ruoyi.common.annotation.Anonymous; import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.constant.FileTransformation; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.exception.EsignDemoException; -import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.WxAppletNotifyUtils; -import com.ruoyi.util.FileUtil; -import com.ruoyi.wisdomarbitrate.StringIdsReq; import com.ruoyi.wisdomarbitrate.domain.*; import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO; import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO; @@ -23,14 +18,11 @@ import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount; import com.ruoyi.wisdomarbitrate.service.IAdjudicationService; import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import com.ruoyi.common.utils.poi.ExcelUtil; import org.springframework.web.multipart.MultipartFile; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.*; import java.net.URL; diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/CheckSignatuerUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/CheckSignatuerUtils.java new file mode 100644 index 0000000..69252dc --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/CheckSignatuerUtils.java @@ -0,0 +1,65 @@ +package com.ruoyi.common.utils; + +import cn.hutool.core.io.IoUtil; +import cn.hutool.crypto.digest.HMac; +import cn.hutool.crypto.digest.HmacAlgorithm; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; +import java.nio.charset.StandardCharsets; + +public class CheckSignatuerUtils { + + public static String getSign(String paramsbody, String accessSec, long timestamp) { + String paramsStr = getParamsStr(paramsbody, timestamp); + return generateSign(paramsStr, accessSec); + } + + public static String getParamsStr(String paramsbody,long timestamp) { + StringBuilder strbuild = new StringBuilder(); + if (StringUtils.isNotBlank(paramsbody)) { + strbuild.append(paramsbody).append('#'); + } + strbuild.append("#timestamp=").append(timestamp); + return strbuild.toString(); + } + + public static String generateSign(String paramsStr, String accessSec) { + HMac hMac = new HMac(HmacAlgorithm.HmacSHA256, accessSec.getBytes(StandardCharsets.UTF_8)); + return hMac.digestHex(paramsStr); + } + + public static boolean checkSignuter(String paramsbody) throws Exception { + HttpServletRequest reqParam = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest(); + String timestampstr = reqParam.getHeader("timestampstr"); + String signstr = reqParam.getHeader("signstr"); + String accessSec = "mCFMA6ffe938v79m"; +// String bodyParams = getRequestBodyStr(reqParam); + String newSignuter = getSign(paramsbody, accessSec,Long.parseLong(timestampstr)); + if (StringUtils.equals(signstr, newSignuter)) { + return true; + }else { + return false; + } + + } + +// private static String getRequestBodyStr(HttpServletRequest request) throws IOException { +// String body = null; +// if (request instanceof BodyReaderRequestWrapper) { +// body = IoUtil.readUtf8(request.getInputStream()); +// } +// return body; +// } + + + + + + + + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseApplicationVO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseApplicationVO.java new file mode 100644 index 0000000..cb11f90 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseApplicationVO.java @@ -0,0 +1,419 @@ +package com.ruoyi.wisdomarbitrate.domain.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; +import com.ruoyi.wisdomarbitrate.domain.CaseAttach; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +@Data +public class CaseApplicationVO { + private static final long serialVersionUID = 1L; + /** + * 查询案件时区分是否待办案件,0待办案件,1已办案件 + */ + private String selectCaseStatus; + + /** ID */ + private Long id; + /** 案件名称 */ + @Excel(name = "案件名称") + private String caseName; + /** 案件编号 */ +// @Excel(name = "案件编号") + private String caseNum; + /** 案件标的 */ + @Excel(name = "案件标的") + private BigDecimal caseSubjectAmount; + /** + * 模板id + */ + private Long templateId; + + + + /** 立案日期 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date registerDate; + /** 仲裁方式 */ + private Integer arbitratMethod; + /** + * 是否导入,0手动录入,1导入,默认0 + */ + private Integer importFlag; + /** 仲裁方式名称 */ + private String arbitratMethodName; + + /** 案件状态 */ + private Integer caseStatus; + private String caseStatusstr; + + /** 申请人是否书面审理 */ + private Integer applicantIsWrittenHear; + + /** 被申请人是否书面审理 */ + private Integer respondentIsWrittenHear; + /** 开庭方式是否一致 */ + private Integer arbitraMethodIssame; + /** 仲裁方式说明 */ + private String arbitratMethodIllustrate; + + + /** 案件申请表ID */ + private Long caseAppliId; + + /** 开庭日期 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date hearDate; + + /** 借款开始日期 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "借款开始日期") + private Date loanStartDate; + /** 借款结束日期 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "借款结束日期") + private Date loanEndDate; + /** 合同编号 */ + @Excel(name = "合同编号") + private String contractNumber; + /** 申请人主张欠本金 */ + @Excel(name = "申请人主张欠本金") + private BigDecimal claimPrinciOwed; + /** 申请人主张欠利息 */ + @Excel(name = "申请人主张欠利息") + private BigDecimal claimInterestOwed; + /** 申请人主张违约金 */ + @Excel(name = "申请人主张违约金") + private BigDecimal claimLiquidDamag; + /** 申请人请求仲裁庭裁决 */ + @Excel(name = "申请人请求仲裁庭裁决",width = 36) + private String requestRule; + + /** 是否财产保全申请 */ + @Excel(name = "是否财产保全申请",width = 26,combo= {"是","否"},readConverterExp = "0=否,1=是") + private Integer properPreser; + /** 申请人仲裁请求及事实和理由 */ + @Excel(name = "申请人仲裁请求及事实和理由",width = 36) + private String arbitratClaims; + /** 仲裁应缴费用 */ + private BigDecimal feePayable; + + /** 开始在线视频时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date beginVideoDate; + /** 在线视频人员 */ + private String onlineVideoPerson; + + /** 仲裁员id */ + private String arbitratorId; + /** 仲裁员名称 */ + private String arbitratorName; + + /** 案件描述 */ + private String caseDescribe; + /** 裁决书URL */ + private String filearbitraUrl; + + /** 是否同意组庭 */ + private Integer isAgreePendTral; + + /** 是否有异议需要举证 */ + private Integer objectionAddEviden; + /** 是否需要开庭审理 */ + private Integer openCourtHear; + + /** 是否仲裁反请求 */ + private Integer adjudicaCounter; + /** + * 仲裁反请求原因 + */ + private String adjudicaCounterReason; + + /** 被申请人是否缺席 */ + private Integer isAbsence; + /** 是否管辖异议申请 */ + private Integer objectiJuris; + /** 被申请人质证意见 */ + private String responCrossOpin; + /** 被申请人的答辩意见 */ + private String responDefenOpini; + /** 申请人是否缺席 */ + private Integer appliIsAbsen; + + /** 申请人质证意见 */ + private String applicaCrossOpin; + + /** 支付状态 */ + private Integer paymentStatus; + + /** 支付状态描述 */ + private String paymentStatusName; + /** + * 支付方式code,0线上支付,1线下支付 + */ + private Integer payTypeCode; + /** + * 支付方式name,0线上支付,1线下支付 + */ + private String payTypeName; + + + + // 导入校验失败信息 + private StringBuilder errorMsg; + /** + * 是否锁定,0-否,1-是 + */ + private Integer lockStatus; + /** 案件状态名称 */ + private String caseStatusName; + /** 是否同意审核 */ + private Integer agreeOrNotCheck; + /** 申请人名称 */ + private String applicantName; + /** 被申请人名称 */ + private String respondentName; + /** + * 用户身份证号 + */ + private String idCard; + /** + * 用户id + */ + private String userId; + /** + * 登录用户用户名 + */ + private String loginUserName; + private List deptIds; + /** + * 部门长状态 + */ + private List deptHeadStatus; + /** + * 代理人角色有关部门 + */ + private List agentDeptIds; + /** + * 财务状态 + */ + private Integer financeStatus; + /** + * 是否是被申请人,仲裁员,部门长,财务,代理人,0-否,1-是 + */ + private Integer isOtherRole; + /** + * 案件日志id + */ + private Long caseLogId; + /** 仲裁结果 */ + private String caseResult; + + /** 案件关联人信息 */ + private List caseAffiliates; + + + + private List caseStatusList; + + private List annexTypeList; + + private Integer annexType; + /** + * 案件附件列表 + */ + private List caseAttachList; + + + + + /** + * 申请人主体信息 + */ + /** 姓名 */ + @Excel(name = "申请人主体信息-申请人(机构)",width = 26) + private String name; + /** 身份证号 */ + @Excel(name = "申请人主体信息-代码",width = 26) + private String identityNum; + /** 申请人主体信息-法定代表人 */ + @Excel(name = "申请人主体信息-法定代表人",width = 26) + private String compLegalPerson; + /** 申请人主体信息-法定代表人 */ + @Excel(name = "申请人主体信息-法定代表人职位",width = 26) + private String compLegalperPost; + /** + * 申请人主体信息-申请人(机构)id + */ + private String nameId; + + /** 联系电话 */ + @Excel(name = "申请人主体信息-联系电话",width = 26) + private String contactTelphone; + /** 联系地址 */ + @Excel(name = "申请人主体信息-联系地址",width = 26) + private String contactAddress; + /** 单位电话 */ + @Excel(name = "申请人主体信息-单位电话",width = 26) + private String workTelphone; + /** 单位地址 */ + @Excel(name = "申请人主体信息-单位地址",width = 26) + private String workAddress; + + /** 申请人住所 */ + @Excel(name = "申请人主体信息-住所",width = 26) + private String residenAffiliAppli; + + /** 申请人邮箱 */ + @Excel(name = "申请人主体信息-邮箱",width = 26) + private String email; + /** 代理人姓名 */ + @Excel(name = "申请人主体信息-代理人姓名",width = 26) + private String nameAgent; + /** 身份证号 */ + @Excel(name = "申请人主体信息-代理人身份证号",width = 26) + private String identityNumAgent; + + /** 联系电话 */ + @Excel(name = "申请人主体信息-代理人联系电话",width = 26) + private String contactTelphoneAgent; + /** 联系地址 */ + @Excel(name = "申请人主体信息-代理人联系地址",width = 26) + private String contactAddressAgent; + /** 申请人代理人职称 */ + @Excel(name = "申请人主体信息-代理人职称",width = 26) + private String appliAgentTitle; + /** + * 被申请人主体信息 + */ + /** 姓名 */ + @Excel(name = "被申请人主体信息-申请人姓名",width = 26) + private String debtorName; + /** 身份证号 */ + @Excel(name = "被申请人主体信息-身份证号",width = 26) + private String debtorIdentityNum; + /** 被申请人主体信息-性别 */ + @Excel(name = "被申请人主体信息-性别",width = 26,combo= {"男","女"},readConverterExp = "0=男,1=女") + private String responSex; + /** 被申请人主体信息-出生年月日 */ + @Excel(name = "被申请人主体信息-出生年月日",width = 26) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date responBirth; + /** 联系电话 */ + @Excel(name = "被申请人主体信息-联系电话",width = 26) + private String debtorContactTelphone; + /** 联系地址 */ + @Excel(name = "被申请人主体信息-联系地址",width = 26) + private String debtorContactAddress; + /** 被申请人住所 */ + @Excel(name = "被申请人主体信息-住所",width = 26) + private String residenAffiliRespon; + /** 单位电话 */ + @Excel(name = "被申请人主体信息-单位电话",width = 26) + private String debtorWorkTelphone; + /** 单位地址 */ + @Excel(name = "被申请人主体信息-单位地址",width = 26) + private String debtorWorkAddress; + /** 邮箱 */ + @Excel(name = "被申请人主体信息-邮箱",width = 26) + private String debtorEmail; + + /** 代理人姓名 */ + @Excel(name = "被申请人主体信息-代理人姓名",width = 26) + private String debtorNameAgent; + /** 身份证号 */ + @Excel(name = "被申请人主体信息-代理人身份证号",width = 26) + private String debtorIdentityNumAgent; + /** 联系电话 */ + @Excel(name = "被申请人主体信息-代理人联系电话",width = 26) + private String debtorContactTelphoneAgent; + /** 联系地址 */ + @Excel(name = "被申请人主体信息-代理人联系地址",width = 26) + private String debtorContactAddressAgent; + /** + * 申请机构id + */ + private String applicationOrganId; + /** + * 版本号 + */ + private Integer version; + /** + * 修改案件的提交状态,0-未提交,1-已提交,2-同意,3-拒绝,4-撤销 + */ + private Integer updateSubmitStatus; + /** 合同名称 */ + private String contractName; + /** + * 事实和理由 + */ + private String facts; + /** + * 合同甲方 + */ + private String partyA; + /** + * 利率 + */ + private String interestRate; + /** + * 待还金额 + */ + private String outstandingMoney; + /** + * 调解达成协议内容 + */ + private String mediationAgreement; + /** + * 金融消费纠纷基本情况 + */ + private String disputes; + /** + * 贷款类型 + */ + private String loanType; + /** + * 贷款期限 + */ + private String loanTerm; + /** + * 本案争议焦点 + */ + private String caseFocus; + /** + * 本案事实 + */ + private String caseFacts; + /** + * 被申请人对上述材料的质证意见 + */ + private String respondentOpinion; + /** + * 申请人对上述材料的质证意见 + */ + private String applicantOpinion; + /** + * 批号 + */ + private Integer batchNumber; + + /** + * 待办状态,0待办,1已办 + */ + private Integer pendingStatus; + /** e签宝流程id */ + private String signFlowId; + + + + + + + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java index 03c5eec..7c399a0 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java @@ -21,6 +21,8 @@ public interface ICaseApplicationService { int insertcaseApplication(CaseApplication caseApplication); + int insertcaseApplication1(CaseApplication caseApplication); + int selectCaseApplicationCount(CaseApplication caseApplication); AjaxResult editCaseApplication(CaseApplication caseApplication); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 35b7aca..62bc728 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -1113,6 +1113,121 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return rows; } + /** + * 新增案件 + * + * @param caseApplication + * @return + */ + @Override + @Transactional + public int insertcaseApplication1(CaseApplication caseApplication) { + caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); + //根据仲裁费用计费规则计算应缴费用 + //暂时设置计费比率为0.01 + BigDecimal feeRate = new BigDecimal(0.01); + BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP); + caseApplication.setFeePayable(feePayable); + // 获取自动编码 + String caseNum = generateCaseNum(); + caseApplication.setCaseNum(caseNum); + + caseApplication.setCreateBy(getUsername()); + caseApplication.setVersion(1); + caseApplication.setId(IdWorkerUtil.getId()); + // 新增立案信息 + int rows = caseApplicationMapper.insertCaseApplication(caseApplication); + if (rows == 0) { + return rows; + } + List caseAffiliates = caseApplication.getCaseAffiliates(); + Map deptMap = new HashMap<>(); + // 判断申请机构 + if (caseAffiliates != null && caseAffiliates.size() > 0) { + // 查询所有的组织机构,组装成map + List deptList = sysDeptMapper.selectDeptList(new SysDept()); + if (CollectionUtil.isEmpty(deptList)) { + deptList = new ArrayList<>(); + } + deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV)); + // 查询申请人角色id + Long roleId = roleMapper.selectRoleIdByName("申请人"); + for (CaseAffiliate caseAffiliate : caseAffiliates) { + caseAffiliate.setCaseAppliId(caseApplication.getId()); + // caseAffiliate.setCaseAppliLogId(caseApplication.getId()); + if (caseAffiliate.getIdentityType() == 1 && StrUtil.isNotEmpty(caseAffiliate.getName())) { + // 将组织机构id设为申请人名称 + if (deptMap.containsKey(caseAffiliate.getName())) { + caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseAffiliate.getName()))); + caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); + } else { + // 如果不存在则新增 + SysDept dept = new SysDept(); + dept.setParentId(0L); + dept.setDeptName(caseAffiliate.getName()); + dept.setAncestors("0"); + dept.setOrderNum(1); + dept.setStatus("0"); + dept.setDelFlag("0"); + dept.setCreateBy(getUsername()); + dept.setUpdateBy(getUsername()); + sysDeptMapper.insertDept(dept); + deptMap.put(dept.getDeptName(), dept.getDeptId()); + caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId())); + caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); + + } + // 组装申请代理人信息 + String agentInfoFlag = buildAgentInfo(caseAffiliate, roleId); + if (StrUtil.isNotEmpty(agentInfoFlag)) { + throw new ServiceException(agentInfoFlag); + } + } + } + // 新增案件关联人 + caseAffiliateMapper.batchCaseAffiliate(caseAffiliates); + } + + List caseAttachList = caseApplication.getCaseAttachList(); + if (caseAttachList != null && caseAttachList.size() > 0 ) { + for (CaseAttach caseAttach : caseAttachList) { + caseAttach.setCaseAppliId(caseApplication.getId()); + } + caseAttachMapper.batchSave(caseAttachList); + } + // 新增日志 + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, ""); + + // 新增案件日志表 + caseApplication.setCaseAppliId(caseApplication.getId()); + caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode()); + caseApplication.setCaseLogId(IdWorkerUtil.getId()); + int insertRow = caseApplicationLogMapper.insert(caseApplication); + // 插入案件相关人员表日志 + if (insertRow != 0 && CollectionUtil.isNotEmpty(caseAffiliates)) { + caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getCaseLogId())); + + caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates); + } + // 插入附件表日志 + if (CollectionUtil.isNotEmpty(caseAttachList)) { + List filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList()); + // 插入日志附件表 + if (CollectionUtil.isNotEmpty(filterList)) { + for (CaseAttach caseAttach : filterList) { + // 查询附件表 + CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId()); + attach.setCaseAppliLogId(caseApplication.getCaseLogId()); + caseAttachLogMapper.save(attach); + } + } + + } + + return rows; + } + + /** * 获取自动编码 * -- 2.54.0