diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java index 29317b5..7af5a47 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java @@ -32,6 +32,9 @@ public class AdjudicationController extends BaseController { */ @PostMapping("/document") public AjaxResult createDocument(@Validated @RequestBody CaseApplication caseApplication){ + if (caseApplication.getId() == null) { + return AjaxResult.error("案件id不能为空"); + } return adjudicationService.createDocument(caseApplication); } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/ObjectFieldUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ObjectFieldUtils.java index 1b99745..5b469c6 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/ObjectFieldUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ObjectFieldUtils.java @@ -1,5 +1,7 @@ package com.ruoyi.common.utils; +import cn.hutool.core.util.StrUtil; + import java.lang.reflect.Field; /** @@ -7,6 +9,9 @@ import java.lang.reflect.Field; */ public class ObjectFieldUtils { public static String getValue(Object obj,String fieldName){ + if(obj==null || StrUtil.isEmpty(fieldName)){ + return ""; + } Field field=null; try{ field=obj.getClass().getDeclaredField(fieldName); @@ -28,6 +33,9 @@ public class ObjectFieldUtils { } public static void setValue(Object obj,String fieldName,Object value){ + if(obj==null || StrUtil.isEmpty(fieldName)||value==null){ + return; + } Field field=null; try{ field=obj.getClass().getDeclaredField(fieldName); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index 7276d54..cf5d739 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -3,12 +3,14 @@ package com.ruoyi.wisdomarbitrate.domain; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; +import lombok.Data; + import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue; import java.math.BigDecimal; import java.util.Date; import java.util.List; - +@Data public class CaseApplication extends BaseEntity { private static final long serialVersionUID = 1L; /** @@ -43,70 +45,14 @@ public class CaseApplication extends BaseEntity { * 是否导入,0手动录入,1导入,默认0 */ private Integer importFlag; - - public Long getTemplateId() { - return templateId; - } - - public void setTemplateId(Long templateId) { - this.templateId = templateId; - } - - public Integer getImportFlag() { - return importFlag; - } - - public void setImportFlag(Integer importFlag) { - this.importFlag = importFlag; - } - - public String getSelectCaseStatus() { - return selectCaseStatus; - } - - public void setSelectCaseStatus(String selectCaseStatus) { - this.selectCaseStatus = selectCaseStatus; - } - - public Integer getArbitratMethod() { - return arbitratMethod; - } - - public void setArbitratMethod(Integer arbitratMethod) { - this.arbitratMethod = arbitratMethod; - } /** 仲裁方式名称 */ private String arbitratMethodName; - public String getArbitratMethodName() { - return arbitratMethodName; - } - - public void setArbitratMethodName(String arbitratMethodName) { - this.arbitratMethodName = arbitratMethodName; - } - /** 案件状态 */ private Integer caseStatus; /** 案件申请表ID */ private Long caseAppliId; - public Long getCaseAppliId() { - return caseAppliId; - } - - public void setCaseAppliId(Long caseAppliId) { - this.caseAppliId = caseAppliId; - } - - public Integer getCaseStatus() { - return caseStatus; - } - - public void setCaseStatus(Integer caseStatus) { - this.caseStatus = caseStatus; - } - /** 开庭日期 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date hearDate; @@ -155,21 +101,11 @@ public class CaseApplication extends BaseEntity { /** 仲裁员名称 */ private String arbitratorName; - - /** 案件描述 */ private String caseDescribe; /** 裁决书URL */ private String filearbitraUrl; - public String getFilearbitraUrl() { - return filearbitraUrl; - } - - public void setFilearbitraUrl(String filearbitraUrl) { - this.filearbitraUrl = filearbitraUrl; - } - /** 是否同意组庭 */ private Integer isAgreePendTral; @@ -178,7 +114,6 @@ public class CaseApplication extends BaseEntity { /** 是否需要开庭审理 */ private Integer openCourtHear; - /** 是否仲裁反请求 */ private Integer adjudicaCounter; /** @@ -197,90 +132,9 @@ public class CaseApplication extends BaseEntity { /** 申请人是否缺席 */ private Integer appliIsAbsen; - public String getAdjudicaCounterReason() { - return adjudicaCounterReason; - } - - public void setAdjudicaCounterReason(String adjudicaCounterReason) { - this.adjudicaCounterReason = adjudicaCounterReason; - } - - public Integer getAppliIsAbsen() { - return appliIsAbsen; - } - - public void setAppliIsAbsen(Integer appliIsAbsen) { - this.appliIsAbsen = appliIsAbsen; - } - - public String getResponDefenOpini() { - return responDefenOpini; - } - - public void setResponDefenOpini(String responDefenOpini) { - this.responDefenOpini = responDefenOpini; - } - - public String getRequestRule() { - return requestRule; - } - - public void setRequestRule(String requestRule) { - this.requestRule = requestRule; - } - - public Integer getAdjudicaCounter() { - return adjudicaCounter; - } - - public void setAdjudicaCounter(Integer adjudicaCounter) { - this.adjudicaCounter = adjudicaCounter; - } - - public Integer getProperPreser() { - return properPreser; - } - - public void setProperPreser(Integer properPreser) { - this.properPreser = properPreser; - } - - public Integer getIsAbsence() { - return isAbsence; - } - - public void setIsAbsence(Integer isAbsence) { - this.isAbsence = isAbsence; - } - - public Integer getObjectiJuris() { - return objectiJuris; - } - - public void setObjectiJuris(Integer objectiJuris) { - this.objectiJuris = objectiJuris; - } - - public String getResponCrossOpin() { - return responCrossOpin; - } - - public void setResponCrossOpin(String responCrossOpin) { - this.responCrossOpin = responCrossOpin; - } - - public String getApplicaCrossOpin() { - return applicaCrossOpin; - } - - public void setApplicaCrossOpin(String applicaCrossOpin) { - this.applicaCrossOpin = applicaCrossOpin; - } - /** 申请人质证意见 */ private String applicaCrossOpin; - /** 支付状态 */ private Integer paymentStatus; @@ -306,110 +160,10 @@ public class CaseApplication extends BaseEntity { * 是否锁定,0-否,1-是 */ private Integer lockStatus; - - public Integer getLockStatus() { - return lockStatus; - } - - public void setLockStatus(Integer lockStatus) { - this.lockStatus = lockStatus; - } - - public Integer getPayTypeCode() { - return payTypeCode; - } - - public void setPayTypeCode(Integer payTypeCode) { - this.payTypeCode = payTypeCode; - } - - public String getPayTypeName() { - return payTypeName; - } - - public void setPayTypeName(String payTypeName) { - this.payTypeName = payTypeName; - } - - public List getPayOrderList() { - return payOrderList; - } - - public void setPayOrderList(List payOrderList) { - this.payOrderList = payOrderList; - } - - public StringBuilder getErrorMsg() { - return errorMsg; - } - - public void setErrorMsg(StringBuilder errorMsg) { - this.errorMsg = errorMsg; - } - - public Integer getPaymentStatus() { - return paymentStatus; - } - - public void setPaymentStatus(Integer paymentStatus) { - this.paymentStatus = paymentStatus; - } - - public String getPaymentStatusName() { - return paymentStatusName; - } - - public void setPaymentStatusName(String paymentStatusName) { - this.paymentStatusName = paymentStatusName; - } - - public Integer getIsAgreePendTral() { - return isAgreePendTral; - } - - public void setIsAgreePendTral(Integer isAgreePendTral) { - this.isAgreePendTral = isAgreePendTral; - } - - public Integer getObjectionAddEviden() { - return objectionAddEviden; - } - - public void setObjectionAddEviden(Integer objectionAddEviden) { - this.objectionAddEviden = objectionAddEviden; - } - - public Integer getOpenCourtHear() { - return openCourtHear; - } - - public void setOpenCourtHear(Integer openCourtHear) { - this.openCourtHear = openCourtHear; - } - /** 案件状态名称 */ private String caseStatusName; /** 是否同意审核 */ private Integer agreeOrNotCheck; - - - - public Integer getAgreeOrNotCheck() { - return agreeOrNotCheck; - } - - public void setAgreeOrNotCheck(Integer agreeOrNotCheck) { - this.agreeOrNotCheck = agreeOrNotCheck; - } - - public String getCaseStatusName() { - return caseStatusName; - } - - public void setCaseStatusName(String caseStatusName) { - this.caseStatusName = caseStatusName; - } - /** 申请人名称 */ private String applicantName; /** 被申请人名称 */ @@ -447,155 +201,10 @@ public class CaseApplication extends BaseEntity { * 案件日志id */ private Long caseLogId; - - public Long getCaseLogId() { - return caseLogId; - } - - public void setCaseLogId(Long caseLogId) { - this.caseLogId = caseLogId; - } - - public Integer getIsOtherRole() { - return isOtherRole; - } - - public void setIsOtherRole(Integer isOtherRole) { - this.isOtherRole = isOtherRole; - } - - public List getAgentDeptIds() { - return agentDeptIds; - } - - public void setAgentDeptIds(List agentDeptIds) { - this.agentDeptIds = agentDeptIds; - } - - public String getLoginUserName() { - return loginUserName; - } - - public void setLoginUserName(String loginUserName) { - this.loginUserName = loginUserName; - } - - public Integer getFinanceStatus() { - return financeStatus; - } - - public void setFinanceStatus(Integer financeStatus) { - this.financeStatus = financeStatus; - } - - public List getDeptHeadStatus() { - return deptHeadStatus; - } - - public void setDeptHeadStatus(List deptHeadStatus) { - this.deptHeadStatus = deptHeadStatus; - } - - public List getDeptIds() { - return deptIds; - } - - public void setDeptIds(List deptIds) { - this.deptIds = deptIds; - } - - public String getUserId() { - return userId; - } - - public void setUserId(String userId) { - this.userId = userId; - } - - public String getIdCard() { - return idCard; - } - - public void setIdCard(String idCard) { - this.idCard = idCard; - } - - public String getApplicantName() { - return applicantName; - } - - public void setApplicantName(String applicantName) { - this.applicantName = applicantName; - } - - public String getRespondentName() { - return respondentName; - } - - public void setRespondentName(String respondentName) { - this.respondentName = respondentName; - } - - - - public String getCaseName() { - return caseName; - } - - public void setCaseName(String caseName) { - this.caseName = caseName; - } - - public String getCaseDescribe() { - return caseDescribe; - } - - public void setCaseDescribe(String caseDescribe) { - this.caseDescribe = caseDescribe; - } - - public String getCaseResult() { - return caseResult; - } - - public void setCaseResult(String caseResult) { - this.caseResult = caseResult; - } - /** 仲裁结果 */ private String caseResult; - - - - public String getArbitratorName() { - return arbitratorName; - } - - public void setArbitratorName(String arbitratorName) { - this.arbitratorName = arbitratorName; - } - /** 是否指派仲裁员 */ private int pendingAppointArbotrar; - - public int getPendingAppointArbotrar() { - return pendingAppointArbotrar; - } - - public void setPendingAppointArbotrar(int pendingAppointArbotrar) { - this.pendingAppointArbotrar = pendingAppointArbotrar; - } - - public String getArbitratorId() { - return arbitratorId; - } - - public void setArbitratorId(String arbitratorId) { - this.arbitratorId = arbitratorId; - } - - - /** 案件关联人信息 */ private List caseAffiliates; @@ -607,73 +216,14 @@ public class CaseApplication extends BaseEntity { private List annexTypeList; private Integer annexType; - - public Integer getAnnexType() { - return annexType; - } - - public void setAnnexType(Integer annexType) { - this.annexType = annexType; - } - - public List getAnnexTypeList() { - return annexTypeList; - } - - public void setAnnexTypeList(List annexTypeList) { - this.annexTypeList = annexTypeList; - } - - private List columnValues; - - public List getColumnValues() { - return columnValues; - } - - public void setColumnValues(List columnValues) { - this.columnValues = columnValues; - } - /** * 案件附件列表 */ private List caseAttachList; - public List getCaseAttachList() { - return caseAttachList; - } - - public void setCaseAttachList(List caseAttachList) { - this.caseAttachList = caseAttachList; - } - - public List getCaseStatusList() { - return caseStatusList; - } - - public void setCaseStatusList(List caseStatusList) { - this.caseStatusList = caseStatusList; - } - /** 仲裁记录 */ private ArbitrateRecord arbitrateRecord; - public ArbitrateRecord getArbitrateRecord() { - return arbitrateRecord; - } - - public void setArbitrateRecord(ArbitrateRecord arbitrateRecord) { - this.arbitrateRecord = arbitrateRecord; - } - - public List getArbitrators() { - return arbitrators; - } - - public void setArbitrators(List arbitrators) { - this.arbitrators = arbitrators; - } - /** 身份类型 */ // @Excel(name = "身份类型") private int identityType; @@ -717,8 +267,6 @@ public class CaseApplication extends BaseEntity { /** 申请人邮箱 */ @Excel(name = "申请人主体信息-邮箱",width = 26) private String email; - - /** 代理人姓名 */ @Excel(name = "申请人主体信息-代理人姓名",width = 26) private String nameAgent; @@ -735,31 +283,7 @@ public class CaseApplication extends BaseEntity { /** 申请人代理人职称 */ @Excel(name = "申请人主体信息-代理人职称",width = 26) private String appliAgentTitle; - - public String getResidenAffiliAppli() { - return residenAffiliAppli; - } - - public void setResidenAffiliAppli(String residenAffiliAppli) { - this.residenAffiliAppli = residenAffiliAppli; - } - - public String getAppliAgentTitle() { - return appliAgentTitle; - } - - public void setAppliAgentTitle(String appliAgentTitle) { - this.appliAgentTitle = appliAgentTitle; - } - - public String getResidenAffiliRespon() { - return residenAffiliRespon; - } - - public void setResidenAffiliRespon(String residenAffiliRespon) { - this.residenAffiliRespon = residenAffiliRespon; - } -/** + /** * 被申请人主体信息 */ /** 姓名 */ @@ -771,46 +295,10 @@ public class CaseApplication extends BaseEntity { /** 被申请人主体信息-性别 */ @Excel(name = "被申请人主体信息-性别",width = 26,combo= {"男","女"},readConverterExp = "0=男,1=女") private String responSex; - - public Date getResponBirth() { - return responBirth; - } - - public void setResponBirth(Date responBirth) { - this.responBirth = responBirth; - } - /** 被申请人主体信息-出生年月日 */ @Excel(name = "被申请人主体信息-出生年月日",width = 26) @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date responBirth; - - public String getCompLegalPerson() { - return compLegalPerson; - } - - public void setCompLegalPerson(String compLegalPerson) { - this.compLegalPerson = compLegalPerson; - } - - public String getCompLegalperPost() { - return compLegalperPost; - } - - public void setCompLegalperPost(String compLegalperPost) { - this.compLegalperPost = compLegalperPost; - } - - public String getResponSex() { - return responSex; - } - - public void setResponSex(String responSex) { - this.responSex = responSex; - } - - - /** 联系电话 */ @Excel(name = "被申请人主体信息-联系电话",width = 26) private String debtorContactTelphone; @@ -856,365 +344,6 @@ public class CaseApplication extends BaseEntity { private Integer updateSubmitStatus; /** 合同名称 */ private String contractName; - - public String getContractName() { - return contractName; - } - - public void setContractName(String contractName) { - this.contractName = contractName; - } - - public Integer getVersion() { - return version; - } - - public void setVersion(Integer version) { - this.version = version; - } - - public Integer getUpdateSubmitStatus() { - return updateSubmitStatus; - } - - public void setUpdateSubmitStatus(Integer updateSubmitStatus) { - this.updateSubmitStatus = updateSubmitStatus; - } - - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public String getDebtorEmail() { - return debtorEmail; - } - - public void setDebtorEmail(String debtorEmail) { - this.debtorEmail = debtorEmail; - } - - public String getApplicationOrganId() { - return applicationOrganId; - } - - public void setApplicationOrganId(String applicationOrganId) { - this.applicationOrganId = applicationOrganId; - } - - public int getIdentityType() { - return identityType; - } - - public void setIdentityType(int identityType) { - this.identityType = identityType; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getNameId() { - return nameId; - } - - public void setNameId(String nameId) { - this.nameId = nameId; - } - - public String getIdentityNum() { - return identityNum; - } - - public void setIdentityNum(String identityNum) { - this.identityNum = identityNum; - } - - public String getWorkTelphone() { - return workTelphone; - } - - public void setWorkTelphone(String workTelphone) { - this.workTelphone = workTelphone; - } - - public String getContactTelphone() { - return contactTelphone; - } - - public void setContactTelphone(String contactTelphone) { - this.contactTelphone = contactTelphone; - } - - public String getContactAddress() { - return contactAddress; - } - - public void setContactAddress(String contactAddress) { - this.contactAddress = contactAddress; - } - - public String getWorkAddress() { - return workAddress; - } - - public void setWorkAddress(String workAddress) { - this.workAddress = workAddress; - } - - public String getNameAgent() { - return nameAgent; - } - - public void setNameAgent(String nameAgent) { - this.nameAgent = nameAgent; - } - - public String getIdentityNumAgent() { - return identityNumAgent; - } - - public void setIdentityNumAgent(String identityNumAgent) { - this.identityNumAgent = identityNumAgent; - } - - public String getContactTelphoneAgent() { - return contactTelphoneAgent; - } - - public void setContactTelphoneAgent(String contactTelphoneAgent) { - this.contactTelphoneAgent = contactTelphoneAgent; - } - - public String getContactAddressAgent() { - return contactAddressAgent; - } - - public void setContactAddressAgent(String contactAddressAgent) { - this.contactAddressAgent = contactAddressAgent; - } - - - public String getDebtorName() { - return debtorName; - } - - public void setDebtorName(String debtorName) { - this.debtorName = debtorName; - } - - public String getDebtorIdentityNum() { - return debtorIdentityNum; - } - - public void setDebtorIdentityNum(String debtorIdentityNum) { - this.debtorIdentityNum = debtorIdentityNum; - } - - public String getDebtorContactTelphone() { - return debtorContactTelphone; - } - - public void setDebtorContactTelphone(String debtorContactTelphone) { - this.debtorContactTelphone = debtorContactTelphone; - } - - public String getDebtorContactAddress() { - return debtorContactAddress; - } - - public void setDebtorContactAddress(String debtorContactAddress) { - this.debtorContactAddress = debtorContactAddress; - } - - public String getDebtorWorkTelphone() { - return debtorWorkTelphone; - } - - public void setDebtorWorkTelphone(String debtorWorkTelphone) { - this.debtorWorkTelphone = debtorWorkTelphone; - } - - public String getDebtorWorkAddress() { - return debtorWorkAddress; - } - - public void setDebtorWorkAddress(String debtorWorkAddress) { - this.debtorWorkAddress = debtorWorkAddress; - } - - public String getDebtorNameAgent() { - return debtorNameAgent; - } - - public void setDebtorNameAgent(String debtorNameAgent) { - this.debtorNameAgent = debtorNameAgent; - } - - public String getDebtorIdentityNumAgent() { - return debtorIdentityNumAgent; - } - - public void setDebtorIdentityNumAgent(String debtorIdentityNumAgent) { - this.debtorIdentityNumAgent = debtorIdentityNumAgent; - } - - public String getDebtorContactTelphoneAgent() { - return debtorContactTelphoneAgent; - } - - public void setDebtorContactTelphoneAgent(String debtorContactTelphoneAgent) { - this.debtorContactTelphoneAgent = debtorContactTelphoneAgent; - } - - public String getDebtorContactAddressAgent() { - return debtorContactAddressAgent; - } - - public void setDebtorContactAddressAgent(String debtorContactAddressAgent) { - this.debtorContactAddressAgent = debtorContactAddressAgent; - } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getCaseNum() { - return caseNum; - } - - public void setCaseNum(String caseNum) { - this.caseNum = caseNum; - } - - public String getContractNumber() { - return contractNumber; - } - - public void setContractNumber(String contractNumber) { - this.contractNumber = contractNumber; - } - - public BigDecimal getCaseSubjectAmount() { - return caseSubjectAmount; - } - - public void setCaseSubjectAmount(BigDecimal caseSubjectAmount) { - this.caseSubjectAmount = caseSubjectAmount; - } - - public Date getRegisterDate() { - return registerDate; - } - - public void setRegisterDate(Date registerDate) { - this.registerDate = registerDate; - } - - - - - public Date getHearDate() { - return hearDate; - } - - public void setHearDate(Date hearDate) { - this.hearDate = hearDate; - } - - public String getArbitratClaims() { - return arbitratClaims; - } - - public void setArbitratClaims(String arbitratClaims) { - this.arbitratClaims = arbitratClaims; - } - - public Date getLoanStartDate() { - return loanStartDate; - } - - public void setLoanStartDate(Date loanStartDate) { - this.loanStartDate = loanStartDate; - } - - public Date getLoanEndDate() { - return loanEndDate; - } - - public void setLoanEndDate(Date loanEndDate) { - this.loanEndDate = loanEndDate; - } - - public BigDecimal getClaimPrinciOwed() { - return claimPrinciOwed; - } - - public void setClaimPrinciOwed(BigDecimal claimPrinciOwed) { - this.claimPrinciOwed = claimPrinciOwed; - } - - public BigDecimal getClaimInterestOwed() { - return claimInterestOwed; - } - - public void setClaimInterestOwed(BigDecimal claimInterestOwed) { - this.claimInterestOwed = claimInterestOwed; - } - - public BigDecimal getClaimLiquidDamag() { - return claimLiquidDamag; - } - - public void setClaimLiquidDamag(BigDecimal claimLiquidDamag) { - this.claimLiquidDamag = claimLiquidDamag; - } - - public BigDecimal getFeePayable() { - return feePayable; - } - - public void setFeePayable(BigDecimal feePayable) { - this.feePayable = feePayable; - } - - - - public Date getBeginVideoDate() { - return beginVideoDate; - } - - public void setBeginVideoDate(Date beginVideoDate) { - this.beginVideoDate = beginVideoDate; - } - - public String getOnlineVideoPerson() { - return onlineVideoPerson; - } - - public void setOnlineVideoPerson(String onlineVideoPerson) { - this.onlineVideoPerson = onlineVideoPerson; - } - - public List getCaseAffiliates() { - return caseAffiliates; - } - - public void setCaseAffiliates(List caseAffiliates) { - this.caseAffiliates = caseAffiliates; - } - /** * 事实和理由 */ @@ -1263,104 +392,12 @@ public class CaseApplication extends BaseEntity { * 申请人对上述材料的质证意见 */ private String applicantOpinion; - - public String getCaseFocus() { - return caseFocus; - } - - public void setCaseFocus(String caseFocus) { - this.caseFocus = caseFocus; - } - - public String getCaseFacts() { - return caseFacts; - } - - public void setCaseFacts(String caseFacts) { - this.caseFacts = caseFacts; - } - - public String getRespondentOpinion() { - return respondentOpinion; - } - - public void setRespondentOpinion(String respondentOpinion) { - this.respondentOpinion = respondentOpinion; - } - - public String getApplicantOpinion() { - return applicantOpinion; - } - - public void setApplicantOpinion(String applicantOpinion) { - this.applicantOpinion = applicantOpinion; - } - - public String getDisputes() { - return disputes; - } - - public void setDisputes(String disputes) { - this.disputes = disputes; - } - - public String getLoanType() { - return loanType; - } - - public void setLoanType(String loanType) { - this.loanType = loanType; - } - - public String getLoanTerm() { - return loanTerm; - } - - public void setLoanTerm(String loanTerm) { - this.loanTerm = loanTerm; - } - - public String getMediationAgreement() { - return mediationAgreement; - } - - public void setMediationAgreement(String mediationAgreement) { - this.mediationAgreement = mediationAgreement; - } - - public static long getSerialVersionUID() { - return serialVersionUID; - } - - public String getFacts() { - return facts; - } - - public void setFacts(String facts) { - this.facts = facts; - } - - public String getPartyA() { - return partyA; - } - - public void setPartyA(String partyA) { - this.partyA = partyA; - } - - public String getInterestRate() { - return interestRate; - } - - public void setInterestRate(String interestRate) { - this.interestRate = interestRate; - } - - public String getOutstandingMoney() { - return outstandingMoney; - } - - public void setOutstandingMoney(String outstandingMoney) { - this.outstandingMoney = outstandingMoney; - } + /** + * 批号 + */ + private String batchNumber; + /** + * 自定义字段 + */ + private List columnValues; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ColumnValue.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ColumnValue.java index 09a247d..16bb0c1 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ColumnValue.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ColumnValue.java @@ -33,7 +33,13 @@ public class ColumnValue { * 案件id */ private Long caseId; - + /** + * 是否为自定义字段,0-否,1-是 + */ private Integer isDefault; + /** + * 案件日志表id + */ + private Long caseAppliLogId; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CompareCaseVO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CompareCaseVO.java index bb6a505..496318f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CompareCaseVO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CompareCaseVO.java @@ -29,6 +29,9 @@ public class CompareCaseVO { * 变化字段,多个用,拼接 */ private String changeColumn; - + /** + * 自定义字段变化字段,多个用,拼接 + */ + private String columnValueChangeColumn; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java index 9933452..d5bd37b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java @@ -118,17 +118,11 @@ public interface CaseApplicationMapper { */ void updateVersionById(@Param("id")Long id, @Param("version")Integer version); - /** - * 查询秘书案件 - * @param caseApplication - * @return - */ - List selectSecretaryCase(CaseApplication caseApplication); /** - * 查询申请人案件 - * @param caseApplication + * 查询最大批号 * @return */ - List selectApplicationCase(CaseApplication caseApplication); + Integer selectBatchNumberLike(); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ColumnValueLogMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ColumnValueLogMapper.java new file mode 100644 index 0000000..a9c268f --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ColumnValueLogMapper.java @@ -0,0 +1,29 @@ +package com.ruoyi.wisdomarbitrate.mapper; + +import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 动态配置字段表 + */ +@Repository +public interface ColumnValueLogMapper { + + /** + * 批量新增 + */ + void batchSave(@Param("list") List list); + void batchUpdate(@Param("list") List list); + + /** + * 根据案件id查询字段及值 + * @param caseId + * @return + */ + List listBycaseAppliLogId(@Param("caseId") Long caseId); + + List queryColumnValueList(ColumnValue columnValue); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ColumnValueMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ColumnValueMapper.java index 592665a..8febd46 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ColumnValueMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ColumnValueMapper.java @@ -27,4 +27,9 @@ public interface ColumnValueMapper { List listByCaseId(@Param("caseId") Long caseId); List queryColumnValueList(ColumnValue columnValue); + /** + * 批量修改 + */ + void batchUpdate(@Param("list") List list); + } 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 09f3708..478e2ea 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 @@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.service; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.wisdomarbitrate.domain.*; +import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue; import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO; import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO; import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount; @@ -18,7 +19,7 @@ public interface ICaseApplicationService { List selectCaseApplicationListByRole(CaseApplication caseApplication); - int insertcaseApplication(CaseApplication caseApplication, Map fatchMap); + int insertcaseApplication(CaseApplication caseApplication, List columnValueList); int selectCaseApplicationCount(CaseApplication caseApplication); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index 035456f..a338270 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -7,15 +7,14 @@ import com.alibaba.fastjson.JSONObject; import com.deepoove.poi.data.PictureRenderData; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysDictData; import com.ruoyi.common.core.redis.RedisCache; -import com.ruoyi.common.utils.DateUtils; -import com.ruoyi.common.utils.SmsUtils; +import com.ruoyi.common.utils.*; +import com.ruoyi.system.mapper.SysDictDataMapper; import com.ruoyi.wisdomarbitrate.domain.vo.BookSendVO; import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue; import com.ruoyi.wisdomarbitrate.mapper.*; import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; -import com.ruoyi.common.utils.EmailOutUtil; -import com.ruoyi.common.utils.WordUtil; import com.ruoyi.wisdomarbitrate.domain.*; import com.ruoyi.wisdomarbitrate.domain.vo.ArchivesDetailVO; import com.ruoyi.wisdomarbitrate.domain.vo.LogisticsInfoVO; @@ -49,6 +48,7 @@ import java.text.NumberFormat; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.util.*; +import java.util.function.Function; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -84,6 +84,11 @@ public class AdjudicationServiceImpl implements IAdjudicationService { private TemplateManageMapper templateManageMapper; @Autowired private ColumnValueMapper columnValueMapper; + @Autowired + private FatchRuleMapper fatchRuleMapper; + @Autowired + private SysDictDataMapper dictDataMapper; + // 仲裁反请求模板内容 private final String counterclaim= "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" + "《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" + @@ -123,246 +128,105 @@ public class AdjudicationServiceImpl implements IAdjudicationService { // 被申请人缺席 String resAbsent="(二)当事人提供的证据材料\n" + "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:\n{{applicantFile}}"; + // 日期格式化年月日 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日"); @Override @Transactional public AjaxResult createDocument(CaseApplication caseApplicationReq) { - String templatePath=""; - String templateName=""; - String agentName=""; - String resName=""; + String templatePath = ""; + String templateName = ""; + String agentName = ""; + String resName = ""; try { Map datas = new HashMap<>(); Long id = caseApplicationReq.getId(); - if (id == null) { - return AjaxResult.error("案件id不能为空"); - } - //获取案件详细信息 CaseApplication caseApplicationById = caseApplicationService.selectCaseApplication(caseApplicationReq); - - if(caseApplicationById==null){ + if (caseApplicationById == null) { return AjaxResult.error("案件不存在"); } - // 根据模板id查找对应的模板 - if(caseApplicationById.getTemplateId()!=null) { - TemplateManage templateManage = new TemplateManage(); - templateManage.setId(caseApplicationById.getTemplateId()); - List templateManages = templateManageMapper.selectTemplateList(templateManage); - if(CollectionUtil.isEmpty(templateManages)){ - return AjaxResult.error("请先指定裁决书模板"); - } - templatePath=templateManages.get(0).getTemOrigPath(); - templateName=templateManages.get(0).getFileName(); + + if (caseApplicationById.getTemplateId() == null) { + return AjaxResult.error("请先指定裁决书模板"); } + // 根据模板id查找对应的模板 + TemplateManage templateManage = new TemplateManage(); + templateManage.setId(caseApplicationById.getTemplateId()); + List templateManages = templateManageMapper.selectTemplateList(templateManage); + if (CollectionUtil.isEmpty(templateManages)) { + return AjaxResult.error("请先指定裁决书模板"); + } + templatePath = templateManages.get(0).getTemOrigPath(); + templateName = templateManages.get(0).getFileName(); + // 查询案件相关表信息 + CaseAffiliate caseAffiliate = new CaseAffiliate(); + caseAffiliate.setCaseAppliId(id); + List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); //获取仲裁记录表里的相关信息 ArbitrateRecord arbitrateRecord = new ArbitrateRecord(); arbitrateRecord.setCaseAppliId(id); ArbitrateRecord arbitrateRecordSelect = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord); + // 在系统表中查询案件内置字段 + SysDictData sysDictData = new SysDictData(); + sysDictData.setDictType("case_built_type"); + List dictDataList = dictDataMapper.selectDictDataList(sysDictData); + // 根据模板id查询抓取规则,判断从主表取值还是从columnValue值取 + List fatchRuleList = fatchRuleMapper.listByTemplateId(caseApplicationById.getTemplateId()); + // 抓取规则,0-内置字段,1-自定义字段 + Map> fatchRuleMap = new HashMap<>(); + // 裁决书需要的字段和内容,占位符需要配置成中文 + Map valueMap = new HashMap<>(); + // 如果未设置抓取规则,则从主表取数据,设置内置字段值 + if (CollectionUtil.isNotEmpty(fatchRuleList)) { + fatchRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getIsDefault)); + } + // 自定义字段,从columnValue值取 + if (fatchRuleMap.size()>0&&fatchRuleMap.containsKey(1)) { + // 根据案件id查询key-value表 + List columnValueList = columnValueMapper.listByCaseId(caseApplicationReq.getId()); + if (CollectionUtil.isNotEmpty(columnValueList)) { + columnValueList.forEach(columnValue -> valueMap.put(columnValue.getName(), columnValue.getValue())); + } + } + // 组装内置字段,在主表中查出内容 + buildDefaultColumnValue(dictDataList,caseAffiliates,valueMap,caseApplicationById); - // todo 获取模板中的所有占位符,该占位符字段必须和抓取字段一致,暂时写死 - // todo 生成裁决书的内容从key-value表中取,不从案件基本信息表取,会有问题,如果修改的话会有问题,暂不考虑该情况 - - // 根据案件id查询key-value表 - List columnValueList = columnValueMapper.listByCaseId(caseApplicationReq.getId()); // 获取模板中的占位符key List bookmarkList = getBookmarkByDocx(templatePath); - if(CollectionUtil.isEmpty(bookmarkList)){ + if (CollectionUtil.isEmpty(bookmarkList)) { // 直接保存模板为裁决书 - saveArbitorFile(id,templateName,templatePath,caseApplicationById,arbitrateRecordSelect); + saveArbitorFile(id, templateName, templatePath, caseApplicationById, arbitrateRecordSelect); return AjaxResult.success("生成裁决书成功"); } - // 如果该表没值,在从主表填充裁决书模板 - if(CollectionUtil.isNotEmpty(columnValueList)){ - Map columnValueMap = columnValueList.stream().collect(Collectors.toMap(ColumnValue::getColumn, ColumnValue::getValue)); - agentName=columnValueMap.get("agentName"); - resName=columnValueMap.get("respondentName"); - // 懒得if,暂时这样 - // - for (String bookmark : bookmarkList) { - if(columnValueMap.containsKey(bookmark)){ - if(bookmark.equals("resSex")){ - String responSex = columnValueMap.get(bookmark); - if (responSex.equals("0")) { - datas.put(bookmark, "男"); - } else { - datas.put(bookmark, "女"); - } - }else if(bookmark.equals("arbitratClaims")){ - // 请求仲裁庭裁决 - String arbitratClaims = columnValueMap.get(bookmark); - if(StrUtil.isNotEmpty(arbitratClaims)){ - String replace = arbitratClaims.replace("甲方", "被申请人").replace("乙方", "申请人"); - datas.put("arbitratClaims", replace); - - }else { - datas.put("arbitratClaims", ""); - } - }else if(bookmark.equals("mediationAgreement")){ - // 查询本案事实如下 - String mediationAgreement = columnValueMap.get(bookmark); - if(StrUtil.isNotEmpty(mediationAgreement)){ - String replace = mediationAgreement.replace("甲方", "被申请人").replace("乙方", "申请人"); - datas.put("mediationAgreement", replace); - - }else { - datas.put("mediationAgreement", ""); - } - } - else { - datas.put(bookmark, columnValueMap.get(bookmark)); - } - } - } - }else { - - } - + // 遍历书签,给书签赋值 + replaceBookmark(bookmarkList,datas,valueMap); + // 根据条件替换书签 + conditionReplaceBookmark(caseApplicationById,datas,agentName,resName,arbitrateRecordSelect); // 裁决书生成时间 LocalDate now = LocalDate.now(); String year = Integer.toString(now.getYear()); - datas.put("year", year); + datas.put("裁决书生成时间", year); //生成编码 String equipmentNo = getNewEquipmentNo(); // 裁决书编号 - datas.put("num", equipmentNo); + datas.put("裁决书编号", equipmentNo); // 仲裁费 - datas.put("arbitrationFee", caseApplicationById.getFeePayable().toString()); + datas.put("仲裁费", caseApplicationById.getFeePayable().toString()); // 案件创建时间 Date createTime = caseApplicationById.getCreateTime(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日"); // 将日期格式化为字符串 String createTimeStr = sdf.format(createTime); - datas.put("submissionDate", createTimeStr); + datas.put("案件创建时间", createTimeStr); // 立案日期 Date registerDate = caseApplicationById.getRegisterDate(); String registerDateStr = sdf.format(registerDate); - datas.put("acceptDate", registerDateStr); - - // 如果有仲裁反请求,该字段设置值 - Integer adjudicaCounter = caseApplicationById.getAdjudicaCounter(); - if (adjudicaCounter!=null&&adjudicaCounter == 1) { - datas.put("counterclaim", counterclaim); - } - //财产保全 - Integer properPreser = caseApplicationById.getProperPreser(); - if (properPreser!=null&&properPreser == 1) { - datas.put("preservation", preservation); - } - //管辖权异议 - Integer objectiJuris = caseApplicationById.getObjectiJuris(); - if (objectiJuris!=null&&objectiJuris == 1) { - datas.put("jurisdictionalObjection", jurisdictionalObjection); - } - - // 出席庭审人员角色名称 - String attendName="秘书、"; - boolean isAbsenceFlag = caseApplicationById.getIsAbsence() != null && caseApplicationById.getIsAbsence().equals(0); - boolean appIsAbsenceFlag = caseApplicationById.getAppliIsAbsen() != null && caseApplicationById.getAppliIsAbsen().equals(0); - if(isAbsenceFlag||appIsAbsenceFlag){ - if(isAbsenceFlag) { - attendName += "申请代理人" + agentName+"、"; - } - if(appIsAbsenceFlag) { - attendName += "被申请人" + resName; - } - if(attendName.endsWith("、")){ - attendName=attendName.replace("、",""); - } - datas.put("attendName", attendName); - } - - // 仲裁员名称 - datas.put("arbitratorName", caseApplicationById.getArbitratorName()); - // 审理方式 - Integer arbitratMethod = caseApplicationById.getArbitratMethod(); - Date hearDate = caseApplicationById.getHearDate(); - if (hearDate != null) { - // 审理日期 - String hearDateStr = sdf.format(hearDate); - datas.put("hearDate",hearDateStr); - // todo 线上仲裁/线下仲裁方式未选择 - //线上开庭时 - if (arbitratMethod == 1) { - String replace = onLine.replace(onLineDate, Optional.ofNullable(hearDateStr).orElse("")); - datas.put("onLine", replace); - - } else { - //书面仲裁时 - String replace = written.replace(writtenDate, Optional.ofNullable(hearDateStr).orElse("")); - datas.put("written", replace); - - } - } - // 所有附件 - List caseAttachList = caseApplicationById.getCaseAttachList(); - Map> caseAttachMap=new HashMap<>(); - if(caseAttachList!=null&&caseAttachList.size()>0){ - caseAttachMap = caseAttachList.stream().collect(Collectors.groupingBy(CaseAttach::getAnnexType)); - } - // 被申请人是否缺席 - Integer isAbsence = caseApplicationById.getIsAbsence(); - // 线上开庭 - if (arbitratMethod == 1) { - if (isAbsence != null && isAbsence == 1) { - // 被申请人缺席 - String absentReplace = absent.replace("{{agentName}}", Optional.ofNullable(agentName).orElse("")); - datas.put("absent",absentReplace); - // 被申请人缺席 - String resAbsentReplace=resAbsent; - if(caseAttachMap!=null && CollectionUtil.isNotEmpty(caseAttachMap.get(2))){ - List caseAttaches = caseAttachMap.get(2); - StringBuilder stringBuilder = new StringBuilder(); - for (CaseAttach caseAttach : caseAttaches) { - stringBuilder.append(caseAttach.getAnnexName()).append("\n"); - } - resAbsentReplace = resAttendOpinion.replace("{{applicantFile}}", stringBuilder.toString()); - } - datas.put("resAbsent",resAbsentReplace); - } else { - // 出席 - String attendReplace = attend.replace("{{agentName}}", Optional.ofNullable(agentName).orElse("")); - datas.put("attend",attendReplace); - // 被申请人证据 - if(caseAttachMap!=null && CollectionUtil.isNotEmpty(caseAttachMap.get(6))){ - // 开庭+出席+被申提供证据 - datas.put("onLineAttendFile",onLineAttendFile); - // 被申请人出席+被申请人提供了资料 - String resFileRplace=resFile; - if(caseAttachMap!=null && CollectionUtil.isNotEmpty(caseAttachMap.get(6))){ - List caseAttaches = caseAttachMap.get(6); - StringBuilder stringBuilder = new StringBuilder(); - for (CaseAttach caseAttach : caseAttaches) { - stringBuilder.append(caseAttach.getAnnexName()).append("\n"); - } - resFileRplace = resFile.replace("{{resFile}}", stringBuilder.toString()).replace("{{applicantOpinion}}", (arbitrateRecordSelect==null||arbitrateRecordSelect.getApplicantOpinion()==null?"":arbitrateRecordSelect.getApplicantOpinion())); - } - datas.put("resFile",resFileRplace); - }else { - // 开庭+出席+被申未提供证据 - datas.put("onLineAttend",onLineAttend); - } - // 被申请人出席答辩意见 - String resAttendOpinionReplace=resAttendOpinion; - if(caseAttachMap!=null && CollectionUtil.isNotEmpty(caseAttachMap.get(2))){ - List caseAttaches = caseAttachMap.get(2); - StringBuilder stringBuilder = new StringBuilder(); - for (CaseAttach caseAttach : caseAttaches) { - stringBuilder.append(caseAttach.getAnnexName()).append("\n"); - } - resAttendOpinionReplace = resAttendOpinion.replace("{{applicantFile}}", stringBuilder.toString()).replace("{{respondentOpinion}}", (arbitrateRecordSelect==null||arbitrateRecordSelect.getRespondentOpinion()==null)?"":arbitrateRecordSelect.getRespondentOpinion()); - } - - datas.put("resAttendOpinion",resAttendOpinionReplace); - } - } - + datas.put("立案日期", registerDateStr); String month = String.format("%02d", now.getMonthValue()); String day = String.format("%02d", now.getDayOfMonth()); // todo // String modalFilePath = "/data/arbitrate-document/template/新裁决书模板.docx"; - String modalFilePath = templatePath; // todo // String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; String saveFolderPath = "D:/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; @@ -370,25 +234,12 @@ public class AdjudicationServiceImpl implements IAdjudicationService { // todo // String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; String saveName = "D:/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day + "/" + fileName; - String resultFilePath = saveFolderPath + "/" + fileName; - // 创建日期目录 - File saveFolder = new File(saveFolderPath); - if (!saveFolder.exists()) { - saveFolder.mkdirs(); - } - Path sourcePath = new File(modalFilePath).toPath(); - Path destinationPath = new File(resultFilePath).toPath(); - Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING); - String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath); - File file = new File(docFilePath); - if (file.exists()) { - InputStream in = new FileInputStream(file); - XWPFDocument xwpfDocument = new XWPFDocument(in); - WordUtil.changeText(xwpfDocument); - } + // 将word中的标签替换掉,生成新的word + String docFilePath = wordChangeText(templatePath,datas,saveFolderPath,fileName); + String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8); // 保存裁决书附件 - saveArbitorFile(id,saveName,savePath,caseApplicationById,arbitrateRecordSelect); + saveArbitorFile(id, saveName, savePath, caseApplicationById, arbitrateRecordSelect); return AjaxResult.success("裁决书已生成"); } catch (IOException e) { @@ -396,6 +247,302 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } } + /** + * 将word中的标签替换掉,生成新的word + * @param modalFilePath 裁决书模板路径 + * @param datas 替换标签的内容 + * @param saveFolderPath 保存路径 + * @param fileName 保存文件名 + * @return + * @throws IOException + */ + private String wordChangeText(String modalFilePath, Map datas, String saveFolderPath,String fileName) throws IOException { + String resultFilePath = saveFolderPath + "/" + fileName; + // 创建日期目录 + File saveFolder = new File(saveFolderPath); + if (!saveFolder.exists()) { + saveFolder.mkdirs(); + } + Path sourcePath = new File(modalFilePath).toPath(); + Path destinationPath = new File(resultFilePath).toPath(); + Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING); + String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath); + File file = new File(docFilePath); + if (file.exists()) { + InputStream in = new FileInputStream(file); + XWPFDocument xwpfDocument = new XWPFDocument(in); + WordUtil.changeText(xwpfDocument); + } + return docFilePath; + } + + /** + * 根据条件判断裁决书中是否需要该内容 + * @param caseApplicationById 案件信息 + * @param datas 替换标签值 + * @param agentName 代理人名称 + * @param resName 被申请人名称 + * @param arbitrateRecordSelect 仲裁记录 + */ + private void conditionReplaceBookmark(CaseApplication caseApplicationById, Map datas,String agentName,String resName, ArbitrateRecord arbitrateRecordSelect ) { + // 如果有仲裁反请求,该字段设置值 + Integer adjudicaCounter = caseApplicationById.getAdjudicaCounter(); + if (adjudicaCounter != null && adjudicaCounter == 1) { + datas.put("仲裁反请求", counterclaim); + } + //财产保全 + Integer properPreser = caseApplicationById.getProperPreser(); + if (properPreser != null && properPreser == 1) { + datas.put("财产保全", preservation); + } + //管辖权异议 + Integer objectiJuris = caseApplicationById.getObjectiJuris(); + if (objectiJuris != null && objectiJuris == 1) { + datas.put("管辖权异议", jurisdictionalObjection); + } + + // 出席庭审人员角色名称 + String attendName = "秘书、"; + boolean isAbsenceFlag = caseApplicationById.getIsAbsence() != null && caseApplicationById.getIsAbsence().equals(0); + boolean appIsAbsenceFlag = caseApplicationById.getAppliIsAbsen() != null && caseApplicationById.getAppliIsAbsen().equals(0); + if (isAbsenceFlag || appIsAbsenceFlag) { + if (isAbsenceFlag) { + attendName += "申请代理人" + agentName + "、"; + } + if (appIsAbsenceFlag) { + attendName += "被申请人" + resName; + } + if (attendName.endsWith("、")) { + attendName = attendName.replace("、", ""); + } + datas.put("出席庭审人员", attendName); + } + + // 仲裁员名称 + datas.put("仲裁员姓名", caseApplicationById.getArbitratorName()); + // 审理方式 + Integer arbitratMethod = caseApplicationById.getArbitratMethod(); + Date hearDate = caseApplicationById.getHearDate(); + String hearDateStr = ""; + if (hearDate != null) { + // 审理日期 + hearDateStr = sdf.format(hearDate); + datas.put("审理日期", hearDateStr); + } + // todo 线上仲裁/线下仲裁方式未选择 + //线上开庭时+线上仲裁 + if (arbitratMethod!=null&&arbitratMethod == 1) { + String replace = onLine.replace(onLineDate, Optional.of(hearDateStr).orElse("")); + datas.put("线上开庭并线上仲裁", replace); + // 所有附件 + List caseAttachList = caseApplicationById.getCaseAttachList(); + Map> caseAttachMap = new HashMap<>(); + if (caseAttachList != null && caseAttachList.size() > 0) { + caseAttachMap = caseAttachList.stream().collect(Collectors.groupingBy(CaseAttach::getAnnexType)); + } + // 被申请人是否缺席 + Integer isAbsence = caseApplicationById.getIsAbsence(); + if (isAbsence != null && isAbsence == 1) { + // 被申请人缺席,开庭+缺席审理 + String absentReplace = absent.replace("{{agentName}}", Optional.of(agentName).orElse("")); + + // 被申请人缺席 + String resAbsentReplace = resAbsent; + if (caseAttachMap != null && CollectionUtil.isNotEmpty(caseAttachMap.get(2))) { + List caseAttaches = caseAttachMap.get(2); + StringBuilder stringBuilder = new StringBuilder(); + for (CaseAttach caseAttach : caseAttaches) { + stringBuilder.append(caseAttach.getAnnexName()).append("\n"); + } + resAbsentReplace = resAttendOpinion.replace("{{applicantFile}}", stringBuilder.toString()); + } + datas.put("开庭并缺席", absentReplace + resAbsentReplace); + } else { + // 被申出席 + String attendReplace = attend.replace("{{agentName}}", Optional.ofNullable(agentName).orElse("")); + datas.put("开庭并出席", attendReplace); + // 被申请人证据 + if (caseAttachMap != null && CollectionUtil.isNotEmpty(caseAttachMap.get(6))) { + // 开庭+出席+被申提供证据 + + // 开庭+出席+被申提供证据 + String resFileReplace = resFile; + if (CollectionUtil.isNotEmpty(caseAttachMap.get(6))) { + List caseAttaches = caseAttachMap.get(6); + StringBuilder stringBuilder = new StringBuilder(); + for (CaseAttach caseAttach : caseAttaches) { + stringBuilder.append(caseAttach.getAnnexName()).append("\n"); + } + resFileReplace = resFile.replace("{{resFile}}", stringBuilder.toString()).replace("{{applicantOpinion}}", (arbitrateRecordSelect == null || arbitrateRecordSelect.getApplicantOpinion() == null ? "" : arbitrateRecordSelect.getApplicantOpinion())); + } + datas.put("开庭并出席并被申提供证据", onLineAttendFile + resFileReplace); + } else { + // 开庭+出席+被申未提供证据 + datas.put("开庭并出席并被申未提供证据", onLineAttend); + } + // 被申请人出席答辩意见 + String resAttendOpinionReplace = resAttendOpinion; + if (caseAttachMap != null && CollectionUtil.isNotEmpty(caseAttachMap.get(2))) { + List caseAttaches = caseAttachMap.get(2); + StringBuilder stringBuilder = new StringBuilder(); + for (CaseAttach caseAttach : caseAttaches) { + stringBuilder.append(caseAttach.getAnnexName()).append("\n"); + } + resAttendOpinionReplace = resAttendOpinion.replace("{{applicantFile}}", stringBuilder.toString()).replace("{{respondentOpinion}}", (arbitrateRecordSelect == null || arbitrateRecordSelect.getRespondentOpinion() == null) ? "" : arbitrateRecordSelect.getRespondentOpinion()); + } + + datas.put("被申请人出席答辩意见", resAttendOpinionReplace); + } + + } else { + //书面仲裁时 + String replace = written.replace(writtenDate, Optional.of(hearDateStr).orElse("")); + datas.put("书面仲裁", replace); + + } + + } + + /** + * 给模板中的占位符赋值 + * @param bookmarkList 书签 + * @param datas 书签赋值 + * @param valueMap 案件内容 + */ + private void replaceBookmark(List bookmarkList, Map datas, Map valueMap) { + for (String bookmark : bookmarkList) { + if (valueMap.containsKey(bookmark)) { + if (bookmark.equals("仲裁请求")) { + // 请求仲裁庭裁决 + String arbitratClaims = valueMap.get(bookmark); + if (StrUtil.isNotEmpty(arbitratClaims)) { + String replace = arbitratClaims.replace("甲方", "被申请人").replace("乙方", "申请人"); + datas.put(bookmark, replace); + + } else { + datas.put(bookmark, ""); + } + } else if (bookmark.equals("本案事实")) { + // 查询本案事实如下 + String mediationAgreement = valueMap.get(bookmark); + if (StrUtil.isNotEmpty(mediationAgreement)) { + String replace = mediationAgreement.replace("甲方", "被申请人").replace("乙方", "申请人"); + datas.put(bookmark, replace); + + } else { + datas.put(bookmark, ""); + } + } else { + datas.put(bookmark, valueMap.get(bookmark)); + } + } + } + } + + /** + * 组装案件内置字段值,即主表和相关人员表信息 + * @param dictDataList 内置字段 + * @param caseAffiliates 关联人员 + * @param valueMap 组装的值 + */ + private void buildDefaultColumnValue(List dictDataList, List caseAffiliates, Map valueMap, CaseApplication caseApplication) { + if (CollectionUtil.isNotEmpty(dictDataList)) { + Map affiliateMap = caseAffiliates.stream().collect(Collectors.toMap(CaseAffiliate::getIdentityType, Function.identity(), (n1, n2) -> n2)); + for (SysDictData dictData : dictDataList) { + if (StrUtil.isNotEmpty(dictData.getDictLabel())) { + if (dictData.getDictLabel().contains("被申请人")) { + CaseAffiliate affiliate = affiliateMap.get(2); + if (affiliate == null) { + continue; + } + // 被申请人 + switch (dictData.getDictLabel()) { + case "被申请人姓名": + valueMap.put(dictData.getDictLabel(), affiliate.getName()); + break; + case "被申请人身份证号": + valueMap.put(dictData.getDictLabel(), affiliate.getIdentityNum()); + break; + case "被申请人住所": + valueMap.put(dictData.getDictLabel(), affiliate.getResidenAffili()); + break; + case "被申请人联系电话": + valueMap.put(dictData.getDictLabel(), affiliate.getContactTelphone()); + break; + case "被申请人电子邮件": + valueMap.put(dictData.getDictLabel(), affiliate.getEmail()); + break; + case "被申请人性别": + if (dictData.getDictLabel().equals("被申请人性别")) { + String responSex = affiliate.getResponSex(); + if (responSex.equals("0")) { + valueMap.put(dictData.getDictLabel(), "男"); + } else { + valueMap.put(dictData.getDictLabel(), "女"); + } + } + break; + case "被申请人出生年月日": + Date responBirth = affiliate.getResponBirth(); + if (responBirth != null) { + valueMap.put(dictData.getDictLabel(), sdf.format(responBirth)); + } else { + valueMap.put(dictData.getDictLabel(), ""); + } + break; + default: + break; + } + } else if (dictData.getDictLabel().contains("申请人") || dictData.getDictLabel().contains("统一社会信用代码") + || dictData.getDictLabel().contains("法定代表人") || dictData.getDictLabel().contains("法定代表人职位") + || dictData.getDictLabel().contains("代理人")) { + CaseAffiliate affiliate = affiliateMap.get(1); + if (affiliate == null) { + continue; + } + // 申请人 + switch (dictData.getDictLabel()) { + case "申请人姓名": + valueMap.put(dictData.getDictLabel(), affiliate.getName()); + break; + case "统一社会信用代码": + valueMap.put(dictData.getDictLabel(), affiliate.getIdentityNum()); + break; + case "法定代表人": + valueMap.put(dictData.getDictLabel(), affiliate.getCompLegalPerson()); + break; + case "法定代表人职位": + valueMap.put(dictData.getDictLabel(), affiliate.getCompLegalperPost()); + break; + case "申请人住所": + valueMap.put(dictData.getDictLabel(), affiliate.getResidenAffili()); + break; + case "申请人联系地址": + valueMap.put(dictData.getDictLabel(), affiliate.getContactAddress()); + break; + case "委托代理人姓名": + valueMap.put(dictData.getDictLabel(), affiliate.getNameAgent()); + break; + case "委托代理人联系电话": + valueMap.put(dictData.getDictLabel(), affiliate.getContactTelphoneAgent()); + break; + case "委托代理人电子邮件": + valueMap.put(dictData.getDictLabel(), affiliate.getAgentEmail()); + break; + default: + break; + } + }else { + valueMap.put(dictData.getDictLabel(), ObjectFieldUtils.getValue(caseApplication, dictData.getDictValue())); + } + }else { + valueMap.put(dictData.getDictLabel(), ObjectFieldUtils.getValue(caseApplication, dictData.getDictValue())); + } + + } + } + } + /** * 保存裁决书附件 * @param id 案件id diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java index 0b6ae71..ccb58e3 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java @@ -12,6 +12,7 @@ import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseAttach; import com.ruoyi.wisdomarbitrate.domain.SmsSendRecord; +import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue; import com.ruoyi.wisdomarbitrate.domain.vo.CompareCaseVO; import com.ruoyi.wisdomarbitrate.domain.vo.UpdateSubmitVO; import com.ruoyi.wisdomarbitrate.mapper.*; @@ -50,6 +51,8 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService private SmsRecordMapper smsRecordMapper; @Autowired private ICaseApplicationService caseApplicationService; + @Autowired + private ColumnValueLogMapper columnValueLogMapper; // 对比两个版本修改的字段,基本字段对比 private static final String[] columns = {"caseName","caseSubjectAmount","loanStartDate", "loanEndDate","contractNumber","claimInterestOwed","claimLiquidDamag", "claimPrinciOwed","arbitratClaims","properPreser","requestRule"}; @@ -158,6 +161,16 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService caseAttachMapper.updateCaseAttach(caseAttach); } } + // 更新自定义字段表 + // 根据caseLogId查询自定义字段表 + List columnValueList = columnValueLogMapper.listBycaseAppliLogId(caseApplicationLog.getCaseLogId()); + if(CollectionUtil.isNotEmpty(columnValueList)){ + for (ColumnValue columnValue : columnValueList) { + columnValue.setCaseAppliLogId(vo.getCaseId()); + + } + columnValueLogMapper.batchUpdate(columnValueList); + } } else { // 拒绝,将日志表改版本的状态改为拒绝 vo.setUpdateSubmitStatus(UpdateSubmitStatus.REFUSE.getCode()); @@ -231,10 +244,12 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService CaseApplication caseApplication = new CaseApplication(); caseApplication.setCaseAppliId(vo.getCaseId()); caseApplication.setId(vo.getCaseId()); - CaseApplication beforeCase= caseApplicationService.selectCaseApplication(caseApplication); + CaseApplication beforeCase = caseApplicationService.selectCaseApplication(caseApplication); // 查询案件关联人员 afterCase.setCaseAffiliates(caseAffiliateLogMapper.selectCaseAffiliate(afterCase.getCaseLogId())); + // 查询自定义字段表 + afterCase.setColumnValues(columnValueLogMapper.listBycaseAppliLogId(afterCase.getCaseLogId())); // 查询附件 CaseAttach caseAttach = new CaseAttach(); caseAttach.setCaseAppliLogId(beforeCase.getCaseLogId()); @@ -242,7 +257,7 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService caseAttachLogMapper.getCaseAttachByCaseIdAndType(caseAttach); caseAttach.setCaseAppliLogId(afterCase.getCaseLogId()); List afterAttachList = caseAttachLogMapper.getCaseAttachByCaseIdAndType(caseAttach); - if(CollectionUtil.isNotEmpty(afterAttachList)){ + if (CollectionUtil.isNotEmpty(afterAttachList)) { for (CaseAttach attach : afterAttachList) { String annexName = attach.getAnnexName(); String prefix = "/profile"; @@ -284,9 +299,49 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService } // 对比案件人员字段 - compareAffilate(beforeCase,afterCase); + compareAffilate(beforeCase, afterCase); // 对比申请人证据资料 - compareCaseVO.setChangeColumn(compareApplicantFile(beforeCase,afterCase,changeColumn).toString()); + compareCaseVO.setChangeColumn(compareApplicantFile(beforeCase, afterCase, changeColumn).toString()); + // 对比自定义字段 + // + List beforeColumnValues = beforeCase.getColumnValues(); + List afterColumnValues = afterCase.getColumnValues(); + StringBuilder columnValueChange = new StringBuilder(); + + if (CollectionUtil.isNotEmpty(beforeColumnValues) && CollectionUtil.isNotEmpty(afterColumnValues)) { + Map beforeColumnValueMap = beforeColumnValues.stream().collect(Collectors.toMap(ColumnValue::getColumn, ColumnValue::getValue, (n1, n2) -> n2)); + for (ColumnValue afterColumnValue : afterColumnValues) { + // 改变前字段不包含改变后字段 + if (!beforeColumnValueMap.containsKey(afterColumnValue.getColumn())) { + columnValueChange.append(afterColumnValue.getColumn()).append(","); + } else { + // 都有这个字段,比较内容是否相同 + // 修改后为空,修改前不为空 + if (StrUtil.isEmpty(afterColumnValue.getValue()) && StrUtil.isNotEmpty(beforeColumnValueMap.get(afterColumnValue.getColumn()))) { + columnValueChange.append(afterColumnValue.getColumn()).append(","); + } else if (StrUtil.isNotEmpty(afterColumnValue.getValue()) && StrUtil.isEmpty(beforeColumnValueMap.get(afterColumnValue.getColumn()))) { + // 修改前为空,修改后不为空 + columnValueChange.append(afterColumnValue.getColumn()).append(","); + } else if (StrUtil.isNotEmpty(afterColumnValue.getValue()) && StrUtil.isNotEmpty(beforeColumnValueMap.get(afterColumnValue.getColumn())) + && !afterColumnValue.getValue().equals(beforeColumnValueMap.get(afterColumnValue.getColumn()))) { + // 修改前不为空,修改后不为空,内容不同 + columnValueChange.append(afterColumnValue.getColumn()).append(","); + } + } + } + + } else if (CollectionUtil.isEmpty(beforeColumnValues) && CollectionUtil.isNotEmpty(afterColumnValues)) { + for (ColumnValue afterColumnValue : afterColumnValues) { + columnValueChange.append(afterColumnValue.getColumn()).append(","); + } + + } else if (CollectionUtil.isNotEmpty(beforeColumnValues) && CollectionUtil.isEmpty(afterColumnValues)) { + for (ColumnValue beforeColumn : beforeColumnValues) { + columnValueChange.append(beforeColumn.getColumn()).append(","); + } + + } + compareCaseVO.setColumnValueChangeColumn(columnValueChange.toString()); return AjaxResult.success(compareCaseVO); } @@ -442,5 +497,16 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService caseAttachMapper.updateCaseAttach(caseAttach); } } + // 根据caseLogId查询自定义字段表 + List columnValueList = columnValueLogMapper.listBycaseAppliLogId(caseApplicationLog.getCaseLogId()); + + // 更新相关人员主表 + if(CollectionUtil.isNotEmpty(columnValueList)){ + for (ColumnValue columnValue : columnValueList) { + columnValue.setCaseAppliLogId(vo.getCaseId()); + + } + columnValueLogMapper.batchUpdate(columnValueList); + } } } 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 08e016e..302e3e1 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 @@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.IdcardUtil; +import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.ZipUtil; import com.alibaba.fastjson.JSON; @@ -31,10 +32,7 @@ import com.ruoyi.common.utils.file.SaaSAPIFileUtils; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.utils.thread.ThreadPoolUtil; import com.ruoyi.system.domain.SysUserRole; -import com.ruoyi.system.mapper.SysDeptMapper; -import com.ruoyi.system.mapper.SysRoleMapper; -import com.ruoyi.system.mapper.SysUserMapper; -import com.ruoyi.system.mapper.SysUserRoleMapper; +import com.ruoyi.system.mapper.*; import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue; import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO; import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount; @@ -67,6 +65,7 @@ import java.math.RoundingMode; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; +import java.text.NumberFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.LocalDate; @@ -140,7 +139,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { private FatchRuleMapper fatchRuleMapper; @Autowired private ColumnValueMapper columnValueMapper; - + @Autowired + private ColumnValueLogMapper columnValueLogMapper; + @Autowired + private SysDictDataMapper dictDataMapper; // 手机号正则 private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$"); // 邮箱正则 @@ -938,7 +940,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { */ @Override @Transactional - public int insertcaseApplication(CaseApplication caseApplication,Map fatchMap) { + public int insertcaseApplication(CaseApplication caseApplication, List columnValueList) { caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); //根据仲裁费用计费规则计算应缴费用 @@ -949,6 +951,15 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 获取自动编码 String caseNum = generateCaseNum(); caseApplication.setCaseNum(caseNum); + // 设置批号 + if(StrUtil.isEmpty(caseApplication.getBatchNumber())){ + Integer maxBatchNumber = caseApplicationMapper.selectBatchNumberLike(); + if(maxBatchNumber==null){ + caseApplication.setBatchNumber("1"); + }else { + caseApplication.setBatchNumber(maxBatchNumber+1+""); + } + } caseApplication.setCreateBy(getUsername()); caseApplication.setVersion(1); // 新增立案信息 @@ -1016,29 +1027,42 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, ""); // 异步新增案件日志 ThreadPoolUtil.execute(() -> { + // 批量新增columnValue自定义字段 + if(CollectionUtil.isNotEmpty(columnValueList)) { + columnValueList.forEach(columnValue -> columnValue.setCaseId(caseApplication.getId())); + columnValueMapper.batchSave(columnValueList); + } + // 新增案件日志表 caseApplication.setCaseAppliId(caseApplication.getId()); caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode()); int insertRow = caseApplicationLogMapper.insert(caseApplication); + // 插入案件相关人员表日志 if (insertRow != 0 && CollectionUtil.isNotEmpty(caseAffiliates)) { caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId())); - // 插入案件日志人员相关表 - 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.getId()); - caseAttachLogMapper.save(attach); - } - } - } caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates); } - // 新增动态配置字段值表 - insertColumnValue(fatchMap,caseApplication.getCaseAppliId()); + // 插入附件表日志 + 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.getId()); + caseAttachLogMapper.save(attach); + } + } + + } + // 插入columnValueLog自定义字段日志表 + if (CollectionUtil.isNotEmpty(columnValueList)) { + columnValueList.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId())); + columnValueLogMapper.batchSave(columnValueList); + + } + }); @@ -1082,8 +1106,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplication.setUpdateBy(getUsername()); // 立案申请状态直接修改主表信息 if (caseApplication.getCaseStatus() != null && caseApplication.getCaseStatus().equals(CaseApplicationConstants.CASE_APPLICATION)) { - - caseApplicationMapper.updataCaseApplication(caseApplication); + // 修改内置字段 + if(CollectionUtil.isNotEmpty(caseApplication.getColumnValues())) { + caseApplicationMapper.updataCaseApplication(caseApplication); + }else { + // 修改自定义字段 + columnValueMapper.batchUpdate(caseApplication.getColumnValues()); + } // 修改记录表状态为同意提交修改的内容 caseApplication.setUpdateSubmitStatus(0); } else { @@ -1193,6 +1222,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } } + // 插入案件columnValueLog自定义字段表 + if (CollectionUtil.isNotEmpty(caseApplication.getColumnValues())) { + caseApplication.getColumnValues().forEach(columnValue -> columnValue.setCaseAppliLogId(caseApplication.getId())); + + columnValueLogMapper.batchSave(caseApplication.getColumnValues()); + } } } catch (Exception e) { throw new RuntimeException(e); @@ -3042,185 +3077,55 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } } if (fatchMap.size() <= 0) { - return error("从压缩包中未抓取到内容,请检查抓取字段配置"); + return error("从压缩包中未抓取到内容,请检查抓取字段配置"); } - - // todo 从压缩包中识别各字段填充到数据库 - //调用新增案件的接口 + // 组装案件内置字段主表内容 CaseApplication caseApplication = new CaseApplication(); caseApplication.setTemplateId(templateId); //默认案件标的 todo 案件标的是什么,默认写死 caseApplication.setCaseSubjectAmount(new BigDecimal(10000)); - // todo 这些以后要去掉,不在案件基本信息表维护,现在往基本信息表设置字段是因为修改以及查询详情的时候页面中字段是固定的,以后也要动态维护字段 - // 仲裁请求 - caseApplication.setArbitratClaims(fatchMap.get("arbitrationClaims")); - // 事实和理由 - caseApplication.setFacts(fatchMap.get("factsAndReason")); - // 合同编号 - String contractNumber = fatchMap.get("contractNumber"); - if (StrUtil.isNotEmpty(contractNumber)) { - // 提取字母和数字 - String regx = "[^a-zA-Z0-9]"; - String replaceAll = contractNumber.replaceAll(regx, ""); - - caseApplication.setContractNumber(replaceAll.toUpperCase()); - } + // todo 从抓取规则表取字段和字典表取基本字段,字典表的字段名塞到基本表,is_default=1自定义字段塞到columnValue + // 抓取规则,0-内置字段,1-自定义字段 + Map> fatchRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getIsDefault)); + // 自定义字段,组装columnValue表 + List columnValueList = new ArrayList<>(); + if (fatchRuleMap.size() > 0 && fatchRuleMap.containsKey(1)) { + List columnRules = fatchRuleMap.get(1); + columnRules.forEach(columnRule -> { + ColumnValue columnValue = new ColumnValue(); + columnValue.setColumn(columnRule.getColumn()); + columnValue.setName(columnRule.getColumnName()); + columnValue.setValue(fatchMap.get(columnRule.getColumnName())); columnValue.setIsDefault(columnRule.getIsDefault()); + columnValueList.add(columnValue); + }); + } + // 在系统表中查询案件内置字段 + SysDictData sysDictData = new SysDictData(); + sysDictData.setDictType("case_built_type"); + List dictDataList = dictDataMapper.selectDictDataList(sysDictData); + // 组装内置字段 + buildDefaultColumn(caseApplication,dictDataList,fatchMap); // 借款开始日期 - String lonStartDate = fatchMap.get("lonStartDate:"); - SimpleDateFormat sdf = new SimpleDateFormat(); - sdf.applyPattern("yyyy年MM月dd日"); - if (StrUtil.isNotEmpty(lonStartDate)) { - try { - caseApplication.setLoanStartDate(sdf.parse(lonStartDate)); - } catch (ParseException e) { - e.printStackTrace(); - } - } - // todo 查询同一批号的模板 - // 金融消费纠纷基本情况 - String disputes = fatchMap.get("disputes"); - caseApplication.setDisputes(disputes); -// String disputesTemplate="本案当事人甲{1}(下称“甲方”)于{2}向本案当事人乙{3}(下称“乙方”)申请{3}贷款,贷款金额人民币{4}元,贷款期限{5}期。截至{6},甲方尚欠乙方金额总计人民币{7}元。因甲方诉求与乙方进行协商还款。乙方为妥善解决纠纷,故申请调解中心进行调解。"; -// List disputeList = getReplaceList(disputesTemplate, disputes); -// if(CollectionUtil.isNotEmpty(disputeList)){ -// if(disputeList.size()>3){ -// caseApplication.setLoanType(disputeList.get(3)); -// } -// if(disputeList.size()>4) { -// String claimPrinciOwed = disputeList.get(4); -// // 金额格式化 -// try { -// Double.parseDouble(claimPrinciOwed); -// -// caseApplication.setClaimPrinciOwed(new BigDecimal(claimPrinciOwed)); -// } catch (NumberFormatException e) { -// -// String regEx = "[^0-9]"; -// Pattern p = Pattern.compile(regEx); -// Matcher m = p.matcher(claimPrinciOwed); -// String result = m.replaceAll("").trim(); -// BigDecimal bigDecimal = null; -// if (claimPrinciOwed.contains("百")) { -// bigDecimal = new BigDecimal(result).multiply(new BigDecimal("100")); -// } else if (claimPrinciOwed.contains("千")) { -// bigDecimal = new BigDecimal(result).multiply(new BigDecimal("1000")); -// } else if (claimPrinciOwed.contains("万")) { -// bigDecimal = new BigDecimal(result).multiply(new BigDecimal("10000")); -// } else if (claimPrinciOwed.contains("百万")) { -// bigDecimal = new BigDecimal(result).multiply(new BigDecimal("1000000")); -// } else if (claimPrinciOwed.contains("千万")) { -// bigDecimal = new BigDecimal(result).multiply(new BigDecimal("10000000")); -// } else if (claimPrinciOwed.contains("亿")) { -// bigDecimal = new BigDecimal(result).multiply(new BigDecimal("100000000")); -// } -// // todo 生产裁决书时金额格式增加千分位 -// // NumberFormat format = NumberFormat.getInstance(); -// // String format1 = format.format(bigDecimal); -// -// caseApplication.setClaimPrinciOwed(bigDecimal); -// } -// } -// -// if(disputeList.size()>5){ -// caseApplication.setLoanTerm(disputeList.get(5)); -// } -// } - // 调解协议内容 - String mediationAgreement = fatchMap.get("mediationAgreement"); - caseApplication.setMediationAgreement(mediationAgreement); -// String mediationAgreementTemplate="1、乙方从维系客户的角度出发,同意为甲方申请停催至{1},停催期间正常计息,且征信影响由甲方自行承担。2、甲方应于{2}停催到期前向乙方申请费息减免业务,并按人民币{3}元一次性结清剩余贷款。3、今后双方无涉,就此结案。"; -// // 对比模板和pdf识别的内容,取出占位符对应的值 -// List mediationAgreementList = getReplaceList(mediationAgreementTemplate, mediationAgreement); -// if(CollectionUtil.isNotEmpty(mediationAgreementList)){ -// // 截止日期 -// String lonEndDate = mediationAgreementList.get(0); +// String lonStartDate = fatchMap.get("借款开始日期:"); +// SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日"); +// if (StrUtil.isNotEmpty(lonStartDate)) { // try { -// caseApplication.setLoanEndDate( sdf.parse(lonEndDate)); +// caseApplication.setLoanStartDate(sdf.parse(lonStartDate)); // } catch (ParseException e) { // e.printStackTrace(); // } -// if(mediationAgreementList.size()>2){ -// // 待还金额 -// caseApplication.setOutstandingMoney(mediationAgreementList.get(2)); -// } // } - // 合同甲方(贷款人) - caseApplication.setPartyA(fatchMap.get("partyA")); - List caseAffiliates = new ArrayList<>(); - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setIdentityType(1); - // 申请人 - caseAffiliate.setName(fatchMap.get("applicantName")); - // 统一社会信用代码 - caseAffiliate.setIdentityNum(fatchMap.get("creditCode")); - // 法定代表人 - caseAffiliate.setCompLegalPerson(fatchMap.get("legalRepresentative")); - // 申请人联系电话 - caseAffiliate.setContactTelphone(fatchMap.get("applicantPhone")); - // 申请人住所 - caseAffiliate.setResidenAffili(fatchMap.get("applicantHome")); - // 申请人联系地址 - caseAffiliate.setContactAddress(fatchMap.get("applicantAddress")); -// // 法定代表人职务 - caseAffiliate.setCompLegalperPost(fatchMap.get("compLegalperPost")); - // 委托代理人 - caseAffiliate.setNameAgent(fatchMap.get("agentName")); - // 委托代理人联系电话 - caseAffiliate.setContactTelphoneAgent(fatchMap.get("agentPhone")); - - // 代理人电子邮件 - caseAffiliate.setAgentEmail(StrUtil.isNotEmpty(fatchMap.get("agentEmail")) ? fatchMap.get("agentEmail").replaceAll("\\s", "") : null); - - - //设置默认代理人的身份证号码,暂时写死 要不然新增方法报错 - // caseAffiliate.setIdentityNumAgent("610423199603171716"); - caseAffiliates.add(caseAffiliate); - // 被申请人信息 - CaseAffiliate respondentAffiliate = new CaseAffiliate(); - respondentAffiliate.setIdentityType(2); - // 被申请人名称 - respondentAffiliate.setName(fatchMap.get("respondentName")); - // 被申请人身份证 - String identityNum = fatchMap.get("respondentCard"); - // 出生年月日,从身份证抓取 - if (StrUtil.isNotEmpty(identityNum)) { - Map identityNumMap = getBirAgeSex(identityNum); - String birthday = identityNumMap.get("birthday"); - if (StrUtil.isNotEmpty(birthday)) { - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); - Date birthdayDate = null; - try { - birthdayDate = simpleDateFormat.parse(birthday); - } catch (Exception e) { - e.printStackTrace(); - } - fatchMap.put("resDateOfBirth", sdf.format(birthdayDate)); - respondentAffiliate.setResponBirth(birthdayDate); - } - //从身份证抓取性别 - fatchMap.put("resSex", identityNumMap.get("sexCode")); - respondentAffiliate.setResponSex(identityNumMap.get("sexCode")); + // 设置批号 + if(StrUtil.isEmpty(caseApplication.getBatchNumber())){ + Integer maxBatchNumber = caseApplicationMapper.selectBatchNumberLike(); + if(maxBatchNumber==null){ + caseApplication.setBatchNumber("1"); + }else { + caseApplication.setBatchNumber(maxBatchNumber+1+""); } - respondentAffiliate.setIdentityNum(identityNum); - // 被申请人电子邮件 -// if(map.get("乙方确认有效的电子信箱地址为").size()>1) { -// if(map.get("乙方确认有效的电子信箱地址为").get(0).contains("/")) { -// respondentAffiliate.setEmail(map.get("乙方确认有效的电子信箱地址为").get(1).replaceAll("\\s", "")); -// }else { -// respondentAffiliate.setEmail(map.get("乙方确认有效的电子信箱地址为").get(0).replaceAll("\\s", "")); -// } -// } - // 被申请人电子邮件 - respondentAffiliate.setEmail(StrUtil.isNotEmpty(fatchMap.get("respondentEmail")) ? fatchMap.get("respondentEmail").replaceAll("\\s", "") : null); - // 被申请人联系电话 - respondentAffiliate.setContactTelphone(fatchMap.get("respondentPhone")); - // 被申请人住所 - respondentAffiliate.setResidenAffili(fatchMap.get("respondentHome")); - - caseAffiliates.add(respondentAffiliate); - caseApplication.setCaseAffiliates(caseAffiliates); + } // 新增案件基本信息表 - this.insertcaseApplication(caseApplication, fatchMap); + this.insertcaseApplication(caseApplication, columnValueList); if (null != caseApplication.getId()) { List caseAttachs = new ArrayList<>(); for (Map.Entry entry : andConvertPDF.entrySet()) { @@ -3254,6 +3159,195 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return null; } + /** + * 组装内置字段 + * @param caseApplication 案件信息 + * @param dictDataList 内置字段 + * @param fatchMap 抓取字段内容 + */ + private void buildDefaultColumn(CaseApplication caseApplication, List dictDataList, Map fatchMap) { + // 组装内置字段 + if (CollectionUtil.isEmpty(dictDataList)) { + return; + } + List caseAffiliates = new ArrayList<>(); + CaseAffiliate debtorAffiliate = new CaseAffiliate(); + CaseAffiliate affiliate = new CaseAffiliate(); + for (SysDictData dictData : dictDataList) { + if (StrUtil.isNotEmpty(dictData.getDictLabel())) { + if(dictData.getDictLabel().contains("被申请人")) { + // 组装被申请人内置自段 + buildDebtorColumn(dictData, fatchMap, debtorAffiliate); + }else if( dictData.getDictLabel().contains("申请人")|| dictData.getDictLabel().contains("统一社会信用代码") + || dictData.getDictLabel().contains("法定代表人")|| dictData.getDictLabel().contains("委托代理人")) { + // 组装申请人内置自段 + buildAffilcateColumn(dictData, fatchMap, affiliate); + }else if( dictData.getDictLabel().contains("合同编号")) { + // 合同编号 + String contractNumber = fatchMap.get("合同编号"); + if (StrUtil.isNotEmpty(contractNumber)) { + // 提取字母和数字 + String regx = "[^a-zA-Z0-9]"; + String replaceAll = contractNumber.replaceAll(regx, ""); + caseApplication.setContractNumber(replaceAll.toUpperCase()); + } + }else { + ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel())); + } + + } else { + ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel())); + + } + + } + if(ObjectUtil.isNotEmpty(debtorAffiliate)){ + caseAffiliates.add(debtorAffiliate); + } + if(ObjectUtil.isNotEmpty(affiliate)){ + caseAffiliates.add(affiliate); + } + caseApplication.setCaseAffiliates(caseAffiliates); + + } + /** + * 组装申请人内置字段 + * @param dictData 内置字段 + * @param fatchMap 抓取内容 + * @param affiliate 案件人员 + */ + private void buildAffilcateColumn(SysDictData dictData, Map fatchMap, CaseAffiliate affiliate) { + + affiliate.setIdentityType(1); + + // 申请人 + switch (dictData.getDictLabel()) { + case "申请人姓名": + affiliate.setName((fatchMap.get(dictData.getDictLabel()))); + break; + case "统一社会信用代码": + affiliate.setIdentityNum((fatchMap.get(dictData.getDictLabel()))); + break; + case "法定代表人": + affiliate.setCompLegalPerson(fatchMap.get(dictData.getDictLabel())); + break; + case "法定代表人职位": + affiliate.setCompLegalperPost((fatchMap.get(dictData.getDictLabel()))); + break; + case "申请人住所": + affiliate.setResidenAffili((fatchMap.get(dictData.getDictLabel()))); + break; + case "申请人联系地址": + affiliate.setContactAddress(fatchMap.get(dictData.getDictLabel())); + break; + case "委托代理人姓名": + affiliate.setNameAgent(fatchMap.get(dictData.getDictLabel())); + break; + case "委托代理人联系电话": + affiliate.setContactTelphoneAgent(fatchMap.get(dictData.getDictLabel())); + break; + case "委托代理人电子邮件": + affiliate.setAgentEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel())) ? fatchMap.get(dictData.getDictLabel()).replace("\n","").replaceAll("\\s", "") : null); + + break; + default: + break; + } + } + + /** + * 组装被申请人内置字段 + * @param dictData 内置字段 + * @param fatchMap 抓取内容 + * @param debtorAffiliate 被申请人 + */ + private void buildDebtorColumn(SysDictData dictData, Map fatchMap, CaseAffiliate debtorAffiliate) { + + debtorAffiliate.setIdentityType(2); + // 被申请人 + switch (dictData.getDictLabel()) { + case "被申请人姓名": + debtorAffiliate.setName(fatchMap.get(dictData.getDictLabel())); + break; + case "被申请人身份证号": + String identityNum = fatchMap.get(dictData.getDictLabel()); + debtorAffiliate.setIdentityNum(fatchMap.get(dictData.getDictLabel())); + // 出生年月日,从身份证抓取 + if (StrUtil.isNotEmpty(identityNum)) { + identityNum=identityNum.replace("\n",""); + Map identityNumMap = getBirAgeSex(identityNum); + String birthday = identityNumMap.get("birthday"); + if (StrUtil.isNotEmpty(birthday)) { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); + Date birthdayDate = null; + try { + birthdayDate = simpleDateFormat.parse(birthday); + } catch (Exception e) { + e.printStackTrace(); + } + debtorAffiliate.setResponBirth(birthdayDate); + } + //从身份证抓取性别 + debtorAffiliate.setResponSex(identityNumMap.get("sexCode")); + } + + break; + case "被申请人住所": + debtorAffiliate.setResidenAffili(fatchMap.get(dictData.getDictLabel())); + break; + case "被申请人联系电话": + debtorAffiliate.setContactTelphone(fatchMap.get(dictData.getDictLabel())); + break; + case "被申请人电子邮件": + debtorAffiliate.setEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel())) ? fatchMap.get(dictData.getDictLabel()).replace("\n","").replaceAll("\\s", "") : null); + + break; + default: + break; + } + + } + + /** + * 金额格式化,增加千分位 + * @param money + * @return + */ + private String moneyFormat(String money) { + // 金额格式化 + try { + Double.parseDouble(money); + + } catch (NumberFormatException e) { + + String regEx = "[^0-9]"; + Pattern p = Pattern.compile(regEx); + Matcher m = p.matcher(money); + String result = m.replaceAll("").trim(); + BigDecimal bigDecimal = null; + if (money.contains("百")) { + bigDecimal = new BigDecimal(result).multiply(new BigDecimal("100")); + } else if (money.contains("千")) { + bigDecimal = new BigDecimal(result).multiply(new BigDecimal("1000")); + } else if (money.contains("万")) { + bigDecimal = new BigDecimal(result).multiply(new BigDecimal("10000")); + } else if (money.contains("百万")) { + bigDecimal = new BigDecimal(result).multiply(new BigDecimal("1000000")); + } else if (money.contains("千万")) { + bigDecimal = new BigDecimal(result).multiply(new BigDecimal("10000000")); + } else if (money.contains("亿")) { + bigDecimal = new BigDecimal(result).multiply(new BigDecimal("100000000")); + } + + NumberFormat format = NumberFormat.getInstance(); + return format.format(bigDecimal); + + } + return ""; + } + + + /** * 新增动态配置字段值表 * @param fatchMap @@ -3327,19 +3421,19 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { XWPFDocument xdoc = new XWPFDocument(fis); XWPFWordExtractor extractor = new XWPFWordExtractor(xdoc); buffer = extractor.getText(); - + sb.append(buffer!=null?buffer:""); // OPCPackage opcPackage = POIXMLDocument.openPackage(filePath); // XWPFWordExtractor extractor = new XWPFWordExtractor(opcPackage); // buffer = extractor.getText(); - if(buffer.length() > 0){ - //使用换行符分割字符串 - String [] arry = buffer.split("\r\n"); - for (String string : arry) { - sb.append(string.trim()); - } - } +// if(buffer.length() > 0){ +// //使用换行符分割字符串 +// String [] arry = buffer.split("\n"); +// for (String string : arry) { +// sb.append(string.trim()); +// } +// } } else { return null; } @@ -3379,7 +3473,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //文件转成base64 String base64 = OCRUtils.pdfConvertBase64(pdfUrl); if (base64 == null) { - throw new ServiceException("文件转成base64,转码失败"); + throw new ServiceException("pdf转base64失败"); // return false; } StringBuilder ocrText = new StringBuilder(); // 创建一个StringBuilder对象 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/OCRUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/OCRUtils.java index 2aaebe5..5e4200b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/OCRUtils.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/OCRUtils.java @@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; import com.ruoyi.common.constant.Constants; import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.StringUtils; import com.ruoyi.wisdomarbitrate.domain.FatchRule; import com.tencentcloudapi.bsca.v20210811.models.LicenseSummary; import com.tencentcloudapi.common.Credential; @@ -218,27 +219,26 @@ public class OCRUtils { if (StrUtil.isEmpty(fatchRule.getStartContent())) { continue; } - // 开始截取字符串 申请人:赵会 - // String[] startContentSplit = ocrText.split(fatchRule.getStartContent()); - int startFirstIndex = ocrText.indexOf(fatchRule.getStartContent()) + fatchRule.getStartContent().length(); - if(startFirstIndex<0){ - continue; - } - if (ocrText.length() >= startFirstIndex) { - ocrText = ocrText.substring(startFirstIndex); - } - if (StrUtil.isNotEmpty(fatchRule.getEndContent())) { - if(ocrText.indexOf(fatchRule.getEndContent())>=0) { - int endFirstIndex = ocrText.indexOf(fatchRule.getEndContent()) + fatchRule.getEndContent().length(); - if (ocrText.length() >= (endFirstIndex - fatchRule.getEndContent().length())) { - fatchMap.put(fatchRule.getColumn(), ocrText.substring(0, endFirstIndex - fatchRule.getEndContent().length())); - ocrText = ocrText.substring(endFirstIndex - fatchRule.getEndContent().length()); - } + if (StrUtil.isNotEmpty(fatchRule.getStartContent()) && StrUtil.isNotEmpty(fatchRule.getEndContent())) { + String s = StringUtils.substringBetween(ocrText, fatchRule.getStartContent(), fatchRule.getEndContent()); + if(StrUtil.isNotEmpty(s)){ + fatchMap.put(fatchRule.getColumnName(), StrUtil.trim(s)); + }else { + fatchMap.put(fatchRule.getColumnName(),""); + } + + }else if(StrUtil.isNotEmpty(fatchRule.getStartContent()) && StrUtil.isEmpty(fatchRule.getEndContent())){ + String s = StringUtils.substringAfter(ocrText,fatchRule.getStartContent()); + if(StrUtil.isNotEmpty(s)){ + fatchMap.put(fatchRule.getColumnName(), StrUtil.trim(s)); + }else { + fatchMap.put(fatchRule.getColumnName(),""); } } } - } + + } } diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index cb81905..b65e14f 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -46,13 +46,9 @@ - - - - - - + + @@ -63,7 +59,7 @@ t1.loan_start_date,t1.loan_end_date,t1.claim_princi_owed,t1.claim_interest_owed,t1.claim_liquid_damag,t1.fee_payable, t1.begin_video_date,t1.online_video_person,t1.contract_number,t1.create_by,t1.create_time,t1.update_by,t1.update_time, t1.arbitrator_name,t1.name,t1.application_organ_id,t1.applicantName,t1.arbitrator_id,t1.identity_num,t1.identity_type, - t1.filearbitra_url,t1.lock_status,t1.version,t1.updateSubmitStatus + t1.filearbitra_url,t1.lock_status,t1.version,t1.updateSubmitStatus,t1.batch_number from( @@ -76,7 +72,7 @@ t.begin_video_date ,t.online_video_person ,t.contract_number ,t.create_by ,t.create_time , t.update_by ,t.update_time , t.arbitrator_name,t.name,t.application_organ_id,t.applicantName, t.arbitrator_id,t.identity_num , - t.identity_type,t.filearbitra_url,t.lock_status,t.version,t.updateSubmitStatus + t.identity_type,t.filearbitra_url,t.lock_status,t.version,t.updateSubmitStatus,t.batch_number from( select c.id ,'' AS caseLogId,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method , CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理' @@ -100,7 +96,7 @@ c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name as applicantName, c.arbitrator_id,ca.identity_num ,ca.identity_type,c.filearbitra_url,c.lock_status,c.version,null as - updateSubmitStatus + updateSubmitStatus,c.batch_number from case_application c JOIN case_affiliate ca ON ca.case_appli_id = c.id @@ -207,7 +203,7 @@ c.arbitrator_id,ca.identity_num , ca.identity_type,c.filearbitra_url,c.lock_status,(select version from case_application_log where case_appli_id=c.id order by version desc limit 1) as version,(select update_submit_status from case_application_log where case_appli_id=c.id order by version desc limit 1) - as updateSubmitStatus + as updateSubmitStatus,c.batch_number from case_application c JOIN case_affiliate ca ON ca.case_appli_id =c.id AND ca.identity_type = 1 @@ -287,7 +283,8 @@ c.arbitrator_id,ca.identity_num ,ca.identity_type, c.filearbitra_url, c.lock_status,c.version, - null as updateSubmitStatus + null as updateSubmitStatus, + c.batch_number FROM case_application c JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type = 1 @@ -382,7 +379,7 @@ ca.application_organ_id , ca.application_organ_name AS applicantName, c.arbitrator_id,ca.identity_num ,ca.identity_type, - c.filearbitra_url,c.lock_status,l.version,l.update_submit_status as updateSubmitStatus + c.filearbitra_url,c.lock_status,l.version,l.update_submit_status as updateSubmitStatus,c.batch_number FROM case_application c JOIN case_application_log l ON c.id = l.case_appli_id @@ -814,7 +811,7 @@ c.update_by ,c.update_time , c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName,c.filearbitra_url,(select version from case_application_log where case_appli_id=c.id order by version desc limit 1) as version,(select update_submit_status from case_application_log where case_appli_id=c.id order by version desc limit 1) - as updateSubmitStatus + as updateSubmitStatus,c.batch_number from case_application c JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1 JOIN case_application_log l ON c.id = l.case_appli_id and c.version=l.version @@ -902,328 +899,6 @@ - - insert into case_application( case_name , @@ -1254,14 +929,9 @@ import_flag, version, template_id, - interest_rate, - outstanding_money, facts, - party_a, - disputes, - loan_type, - loan_term, mediation_agreement, + batch_number, create_time )values( #{caseName}, @@ -1292,14 +962,10 @@ #{importFlag}, #{version}, #{templateId}, - #{interestRate}, - #{outstandingMoney}, + #{facts}, - #{partyA}, - #{disputes}, - #{loanType}, - #{loanTerm}, #{mediationAgreement}, + #{batchNumber}, sysdate() ) @@ -1333,13 +999,7 @@ update_by = #{updateBy}, case_num = #{caseNum}, version = #{version}, - interest_rate = #{interestRate}, - outstanding_money = #{outstandingMoney}, - facts = #{facts}, - party_a = #{partyA}, - disputes = #{disputes}, - loan_type = #{loanType}, - loan_term = #{loanTerm}, + facts = #{facts}, mediation_agreement = #{mediationAgreement}, update_time = sysdate() @@ -1425,13 +1085,8 @@ c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,c.request_rule,c.adjudica_counter,c.proper_preser, c.is_absence ,c.respon_cross_opin ,c.applica_cross_opin ,c.respon_defen_opini , c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName, - c.interest_rate, - c.outstanding_money, + c.batch_number, c.facts, - c.party_a, - c.disputes, - c.loan_type, - c.loan_term, c.mediation_agreement,c.template_id templateId from case_application c LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1 @@ -1463,7 +1118,10 @@ c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable , c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,c.request_rule,c.adjudica_counter,c.proper_preser, c.is_absence ,c.respon_cross_opin ,c.applica_cross_opin ,c.respon_defen_opini , - c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName + c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName, + c.batch_number, + c.facts, + c.mediation_agreement,c.template_id templateId from case_application c LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1 @@ -1492,7 +1150,7 @@ when 31 then '待修改开庭时间' ELSE '无案件状态' END caseStatusName, - c.hear_date ,c.arbitrat_claims , + c.hear_date ,c.arbitrat_claims , c.batch_number,c.facts,c.mediation_agreement,c.template_id templateId, c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable , c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time , c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name, @@ -1521,7 +1179,10 @@ select max(room_id+1) as maxRoomId from reserved_conference ; - + diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ColumnValueLogMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ColumnValueLogMapper.xml new file mode 100644 index 0000000..c9aa630 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ColumnValueLogMapper.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + INSERT INTO column_value_log ( `COLUMN`, `NAME`, `VALUE`, case_appli_log_id ) + values + + + (#{item.column},#{item.name},#{item.value},#{item.caseAppliLogId}) + + + + + + update column_value_log + + + `VALUE` = #{item.value}, + + `id`=#{item.id} + + where `COLUMN`=#{item.column} and `NAME`=#{item.name} and case_appli_log_id=#{item.caseAppliLogId}; + + + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ColumnValueMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ColumnValueMapper.xml index 919d8f7..d9d25e8 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ColumnValueMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ColumnValueMapper.xml @@ -18,6 +18,18 @@ (#{item.column},#{item.name},#{item.value},#{item.caseId}) + + + update column_value + + + `VALUE` = #{item.value}, + + `id`=#{item.id} + + where id=#{item.id}; + + diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/FatchRuleMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/FatchRuleMapper.xml index 9ec73a1..3212156 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/FatchRuleMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/FatchRuleMapper.xml @@ -11,6 +11,7 @@ +