diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitratorController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitratorController.java new file mode 100644 index 0000000..8b9f249 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitratorController.java @@ -0,0 +1,41 @@ +package com.ruoyi.web.controller.wisdomarbitrate; + +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.wisdomarbitrate.domain.Arbitrator; +import com.ruoyi.wisdomarbitrate.service.IArbitratorService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RestController +@RequestMapping("/arbitrator") +public class ArbitratorController extends BaseController { + @Autowired + private IArbitratorService arbitratorService; + + /** + * 查询仲裁员信息 + */ + @PreAuthorize("@ss.hasPermi('arbitrator:list')") + @GetMapping("/list") + public TableDataInfo list(Arbitrator arbitrator) + { + startPage(); + List list = arbitratorService.selectArbitratorList(arbitrator); + return getDataTable(list); + } + + + + + + + + + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index d120476..2658de5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -14,7 +14,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import com.ruoyi.common.utils.poi.ExcelUtil; +import org.springframework.web.multipart.MultipartFile; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.List; @@ -25,12 +29,13 @@ public class CaseApplicationController extends BaseController { @Autowired private ICaseApplicationService caseApplicationService; + /** * 查询立案数据 */ @PreAuthorize("@ss.hasPermi('caseApplication:list')") - @PostMapping("/list") - public TableDataInfo list(@Validated @RequestBody CaseApplication caseApplication) + @GetMapping("/list") + public TableDataInfo list(CaseApplication caseApplication) { startPage(); List list = caseApplicationService.selectCaseApplicationList(caseApplication); @@ -100,6 +105,49 @@ public class CaseApplicationController extends BaseController { return success(caseApplicationselect); } + /** + * 立案申请导入模板下载 + */ + @PostMapping("/importTemplate") + public void importTemplate(HttpServletResponse response) + { + ExcelUtil util = new ExcelUtil(CaseApplication.class); + util.importTemplateExcel(response, "立案申请数据"); + } + + @Log(title = "立案信息导入", businessType = BusinessType.IMPORT) + @PreAuthorize("@ss.hasPermi('caseApplication:import')") + @PostMapping("/importData") + public AjaxResult importData(MultipartFile file) throws Exception { + ExcelUtil util = new ExcelUtil(CaseApplication.class); + List caseApplicationList = util.importExcel(file.getInputStream()); + String operName = getUsername(); + String message = caseApplicationService.importCaseApplication(caseApplicationList,operName); + return success(message); + } + + /** + * 组庭 + */ + @PreAuthorize("@ss.hasPermi('caseApplication:pendTral')") + @Log(title = "组庭", businessType = BusinessType.UPDATE) + @PostMapping("/pendTral") + public AjaxResult pendTral(@Validated @RequestBody CaseApplication caseApplication) + { + return toAjax(caseApplicationService.pendTral(caseApplication)); + } + + /** + * 是否指派仲裁员 + */ + @PreAuthorize("@ss.hasPermi('caseApplication:pendingAppointArbotrar')") + @Log(title = "是否指派仲裁员", businessType = BusinessType.UPDATE) + @PostMapping("/pendingAppointArbotrar") + public AjaxResult pendingAppointArbotrar(@Validated @RequestBody CaseApplication caseApplication) + { + return toAjax(caseApplicationService.pendingAppointArbotrar(caseApplication)); + } + diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java new file mode 100644 index 0000000..b5a9f49 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java @@ -0,0 +1,37 @@ +package com.ruoyi.web.controller.wisdomarbitrate; + +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication; +import com.ruoyi.wisdomarbitrate.service.IdentityAuthenticationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/identityAuthentication") +public class IdentityAuthenticationController extends BaseController { + @Autowired + private IdentityAuthenticationService identityAuthenticationService; + + /** + * 查询身份证信息 + */ + @PostMapping("/selectIdentityInformation") + public AjaxResult selectIdentityInformation() + { + IdentityAuthentication identityAuthentication = identityAuthenticationService.selectIdentityInformation(); + return success(identityAuthentication); + } + + + + + + + +} diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 598f780..2ace626 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -143,4 +143,7 @@ elegent: callback: domain: http://121.40.189.20:9000/ watch: false - cycle: 10 \ No newline at end of file + cycle: 10 +identityAuthentication: + credentialSecretId: 123 + credentialSecretKey: 367 \ No newline at end of file diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index 00240c2..35fdb8c 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -139,6 +139,13 @@ 3.1.270 + + com.tencentcloudapi + tencentcloud-sdk-java-ocr + 3.1.701 + + + \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java index 8f338f3..23f4e7c 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java @@ -10,10 +10,35 @@ public class CaseApplicationConstants { public static final int PENDING_PAYMENT = 1; /** 待缴费确认 */ public static final int PENDING_PAYMENT_CONFIRM = 2; + /** 待确认是否应诉 */ + public static final int CONFIRMDED_RESPOND = 3; /** 待确认证据 */ - public static final int EVIDENCE_CONFREMED = 3; + public static final int CONFIRMDED_EVIDENCE = 4; + /** 待确定是否指派仲裁员 */ + public static final int PENDING_APPOINT_ARBOTRATAR = 5; /** 待组庭 */ - public static final int PENDING_TRIAL = 4; + public static final int PENDING_TRIAL = 6; + /** 待组庭确定 */ + public static final int CONFIRMDED_PENDING_TRIAL = 7; + /** 待组庭审核 */ + public static final int CONFIRMDED_PENDING_TRIAL_SUBMMIT = 8; + /** 待选择仲裁方式 */ + public static final int SELECTED_ARBITRATION_METHOD = 9; + /** 待开庭 */ + public static final int PENDING_OPENCOURT = 10; + /** 待生成仲裁文书 */ + public static final int GENERATED_ARBITRATION = 11; + /** 待确认仲裁文书 */ + public static final int CONFIRMED_ARBITRATION = 12; + /** 待仲裁文书用印 */ + public static final int ARBITRATED_SEAL = 13; + /** 待仲裁文书用印审核 */ + public static final int ARBITRATED_SEAL_REVIEW = 14; + /** 待仲裁文书送达 */ + public static final int ARBITRATION_DELIVERY = 15; + /** 待案件归档*/ + public static final int CASE_FILING = 16; + diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/Arbitrator.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/Arbitrator.java new file mode 100644 index 0000000..b35d5aa --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/Arbitrator.java @@ -0,0 +1,111 @@ +package com.ruoyi.wisdomarbitrate.domain; + +import com.ruoyi.common.core.domain.BaseEntity; + +public class Arbitrator extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** ID */ + private Long id; + /** 仲裁员姓名 */ + private String arbitratorName; + /** 职称 */ + private String title; + /** 职业 */ + private String career; + /** 专业分类 */ + private String professiClassifi; + /** 学历 */ + private String education; + /** 所在地区 */ + private String area; + /** 联系电话 */ + private String telephone; + + public String getArbitratorName() { + return arbitratorName; + } + + public void setArbitratorName(String arbitratorName) { + this.arbitratorName = arbitratorName; + } + + /** 当前案件数量 */ + private int currentCaseNum; + /** 已结案数量 */ + private int closedCaseNum; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getCareer() { + return career; + } + + public void setCareer(String career) { + this.career = career; + } + + public String getProfessiClassifi() { + return professiClassifi; + } + + public void setProfessiClassifi(String professiClassifi) { + this.professiClassifi = professiClassifi; + } + + public String getEducation() { + return education; + } + + public void setEducation(String education) { + this.education = education; + } + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getTelephone() { + return telephone; + } + + public void setTelephone(String telephone) { + this.telephone = telephone; + } + + public int getCurrentCaseNum() { + return currentCaseNum; + } + + public void setCurrentCaseNum(int currentCaseNum) { + this.currentCaseNum = currentCaseNum; + } + + public int getClosedCaseNum() { + return closedCaseNum; + } + + public void setClosedCaseNum(int closedCaseNum) { + this.closedCaseNum = closedCaseNum; + } +} 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 91976d3..a26f262 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 @@ -2,6 +2,7 @@ package com.ruoyi.wisdomarbitrate.domain; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.annotation.Excels; import com.ruoyi.common.core.domain.BaseEntity; import java.math.BigDecimal; import java.util.Date; @@ -11,17 +12,15 @@ public class CaseApplication extends BaseEntity { private static final long serialVersionUID = 1L; /** ID */ - @Excel(name = "ID", cellType = Excel.ColumnType.NUMERIC, prompt = "ID") private Long id; /** 案件编号 */ @Excel(name = "案件编号") private String caseNum; - /** 合同编号 */ - @Excel(name = "合同编号") - private String contractNumber; /** 案件标的 */ @Excel(name = "案件标的") private BigDecimal caseSubjectAmount; + + /** 立案日期 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date registerDate; @@ -36,10 +35,15 @@ public class CaseApplication extends BaseEntity { private String arbitratClaims; /** 借款开始日期 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "借款开始日期") private Date loanStartDate; /** 借款结束日期 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "借款结束日期") private Date loanEndDate; + /** 合同编号 */ + @Excel(name = "合同编号") + private String contractNumber; /** 申请人主张欠本金 */ @Excel(name = "申请人主张欠本金") private BigDecimal claimPrinciOwed; @@ -59,9 +63,179 @@ public class CaseApplication extends BaseEntity { /** 在线视频人员 */ private String onlineVideoPerson; + /** 仲裁员id */ + private String arbitratorId; + /** 仲裁员名称 */ + private String arbitratorName; + + 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; + /** 案件仲裁员 */ + private List arbitrators; + + public List getArbitrators() { + return arbitrators; + } + + public void setArbitrators(List arbitrators) { + this.arbitrators = arbitrators; + } + + /** 身份类型 */ + @Excel(name = "身份类型") + private int identityType; + /** 姓名 */ + @Excel(name = "姓名") + private String name; + /** 身份证号 */ + @Excel(name = "身份证号") + private String identityNum; + /** 单位电话 */ + @Excel(name = "单位电话") + private String workTelphone; + /** 联系电话 */ + @Excel(name = "联系电话") + private String contactTelphone; + /** 联系地址 */ + @Excel(name = "联系地址") + private String contactAddress; + /** 单位地址 */ + @Excel(name = "单位地址") + private String workAddress; + + /** 代理人姓名 */ + @Excel(name = "代理人姓名") + private String nameAgent; + /** 身份证号 */ + @Excel(name = "代理人身份证号") + private String identityNumAgent; + /** 联系电话 */ + @Excel(name = "代理人联系电话") + private String contactTelphoneAgent; + + 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 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; + } + + /** 联系地址 */ + @Excel(name = "代理人联系地址") + private String contactAddressAgent; + + public Long getId() { @@ -215,4 +389,11 @@ public class CaseApplication extends BaseEntity { public void setCaseAffiliates(List caseAffiliates) { this.caseAffiliates = caseAffiliates; } + + + + + + + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/IdentityAuthentication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/IdentityAuthentication.java new file mode 100644 index 0000000..f279419 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/IdentityAuthentication.java @@ -0,0 +1,63 @@ +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 java.util.Date; + +public class IdentityAuthentication extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** ID */ + private Long id; + /** 姓名 */ + private String name; + /** 身份证号 */ + private String identityNo; + /** 认证时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date certificationTime; + /** 认证状态 */ + private int certificationStatus; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getIdentityNo() { + return identityNo; + } + + public void setIdentityNo(String identityNo) { + this.identityNo = identityNo; + } + + public Date getCertificationTime() { + return certificationTime; + } + + public void setCertificationTime(Date certificationTime) { + this.certificationTime = certificationTime; + } + + public int getCertificationStatus() { + return certificationStatus; + } + + public void setCertificationStatus(int certificationStatus) { + this.certificationStatus = certificationStatus; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ArbitratorMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ArbitratorMapper.java new file mode 100644 index 0000000..b3bcbaf --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ArbitratorMapper.java @@ -0,0 +1,10 @@ +package com.ruoyi.wisdomarbitrate.mapper; + +import com.ruoyi.wisdomarbitrate.domain.Arbitrator; + +import java.util.List; + +public interface ArbitratorMapper { + List selectArbitratorList(Arbitrator arbitrator); + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/IdentityAuthenticationMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/IdentityAuthenticationMapper.java new file mode 100644 index 0000000..20e5f6f --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/IdentityAuthenticationMapper.java @@ -0,0 +1,4 @@ +package com.ruoyi.wisdomarbitrate.mapper; + +public interface IdentityAuthenticationMapper { +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IArbitratorService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IArbitratorService.java new file mode 100644 index 0000000..ee7a8ab --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IArbitratorService.java @@ -0,0 +1,12 @@ +package com.ruoyi.wisdomarbitrate.service; + +import com.ruoyi.wisdomarbitrate.domain.Arbitrator; + +import java.util.List; + +public interface IArbitratorService { + List selectArbitratorList(Arbitrator arbitrator); + + + +} 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 97dfe2f..2ccdf87 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 @@ -19,4 +19,10 @@ public interface ICaseApplicationService { int deletecaseApplicationByIds(CaseApplication caseApplication); CaseApplication selectCaseApplication(CaseApplication caseApplication); + + String importCaseApplication(List caseApplicationList, String operName); + + int pendTral(CaseApplication caseApplication); + + int pendingAppointArbotrar(CaseApplication caseApplication); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java new file mode 100644 index 0000000..fdab196 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IdentityAuthenticationService.java @@ -0,0 +1,9 @@ +package com.ruoyi.wisdomarbitrate.service; + +import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication; + +public interface IdentityAuthenticationService { + + + IdentityAuthentication selectIdentityInformation(); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/ArbitratorServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/ArbitratorServiceImpl.java new file mode 100644 index 0000000..78f9e4b --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/ArbitratorServiceImpl.java @@ -0,0 +1,28 @@ +package com.ruoyi.wisdomarbitrate.service.impl; + +import com.ruoyi.wisdomarbitrate.domain.Arbitrator; +import com.ruoyi.wisdomarbitrate.mapper.ArbitratorMapper; +import com.ruoyi.wisdomarbitrate.service.IArbitratorService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class ArbitratorServiceImpl implements IArbitratorService { + @Autowired + private ArbitratorMapper arbitratorMapper; + + + @Override + public List selectArbitratorList(Arbitrator arbitrator) { + return arbitratorMapper.selectArbitratorList(arbitrator); + + } + + + + + + +} 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 75980b1..b37aefd 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 @@ -1,6 +1,10 @@ package com.ruoyi.wisdomarbitrate.service.impl; import com.ruoyi.common.constant.CaseApplicationConstants; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.bean.BeanUtils; +import com.ruoyi.wisdomarbitrate.domain.Arbitrator; import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper; @@ -11,9 +15,15 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Comparator; import java.util.List; +import java.util.TreeSet; +import java.util.stream.Collectors; import static com.ruoyi.common.core.domain.AjaxResult.error; +import static java.util.stream.Collectors.collectingAndThen; +import static java.util.stream.Collectors.toCollection; @Service public class CaseApplicationServiceImpl implements ICaseApplicationService { @@ -89,10 +99,162 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { CaseAffiliate caseAffiliate = new CaseAffiliate(); caseAffiliate.setCaseAppliId(caseApplication.getId()); List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - caseApplicationselect.setCaseAffiliates(caseAffiliatListeselect); - + if(caseApplicationselect!=null){ + caseApplicationselect.setCaseAffiliates(caseAffiliatListeselect); + } return caseApplicationselect; } + @Override + @Transactional + public String importCaseApplication(List caseApplicationList, String operName) { + StringBuilder successMsg = new StringBuilder(); + StringBuilder failureMsg = new StringBuilder(); + int successNum = 0; + int failureNum = 0; + if(caseApplicationList!=null&&caseApplicationList.size()>0){ + List caseApplicationListinsert = new ArrayList<>(); + for (int i = 0; i < caseApplicationList.size(); i++){ + CaseApplication caseApplication = caseApplicationList.get(i); + //赋值CaseApplication的案件关联人信息 + List caseAffiliatesnew = new ArrayList<>(); + assignmentCaseAffiliates(caseApplication,caseAffiliatesnew); + + int caseApplicationCount = selectCaseApplicationCount(caseApplication); + if(caseApplicationCount>0){ + failureNum++; + failureMsg.append("
" + failureNum + "、立案编号 " + caseApplication.getCaseNum() + " 已存在"); + }else { + caseApplicationListinsert.add(caseApplication); + } + } + if(caseApplicationListinsert!=null&&caseApplicationListinsert.size()>0){ + List caseApplicationListinsertDiffer = caseApplicationListinsert.stream().collect( + collectingAndThen( + toCollection(() -> new TreeSet<>(Comparator.comparing(CaseApplication::getCaseNum))), + ArrayList::new)); + + + //对不重复的立案对象集合的立案对象重新组装对应的案件关联人信息 + if(caseApplicationListinsertDiffer!=null&&caseApplicationListinsertDiffer.size()>0){ + List caseApplicationNewList = new ArrayList<>(); + for (int i = 0; i < caseApplicationListinsertDiffer.size(); i++){ + CaseApplication caseApplicationinsertDiffer = caseApplicationListinsertDiffer.get(i); + List caseAffiliatesnew = new ArrayList<>(); + CaseApplication caseApplicationNew = new CaseApplication(); + copyCaseApplication(caseApplicationinsertDiffer,caseApplicationNew); + if(caseApplicationListinsert!=null&&caseApplicationListinsert.size()>0){ + for (int j = 0; j < caseApplicationListinsert.size(); j++){ + CaseApplication caseApplicationinsert = caseApplicationListinsert.get(j); + + if(StringUtils.isNotEmpty(caseApplicationinsert.getCaseNum())&& + caseApplicationinsert.getCaseNum().equals(caseApplicationinsertDiffer.getCaseNum())){ + + caseAffiliatesnew.addAll(caseApplicationinsert.getCaseAffiliates()); + } + } + caseApplicationNew.setCaseAffiliates(caseAffiliatesnew); + caseApplicationNewList.add(caseApplicationNew); + } + + for (int k = 0; k < caseApplicationNewList.size(); k++){ + CaseApplication caseApplicationItera = caseApplicationNewList.get(k); + // 新增立案信息 + caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); + int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera); + List caseAffiliates = caseApplicationItera.getCaseAffiliates(); + if(caseAffiliates!=null&&caseAffiliates.size()>0){ + for (CaseAffiliate caseAffiliate : caseAffiliates){ + caseAffiliate.setCaseAppliId(caseApplicationItera.getId()); + } + caseAffiliateMapper.batchCaseAffiliate(caseAffiliates); + } + successNum++; + successMsg.append("
" + successNum + "、立案编号 " + caseApplicationItera.getCaseNum() + " 导入成功"); + } + + } + + } + + } + + }else { + throw new ServiceException("导入立案申请数据不能为空!"); + } + + return successMsg.toString(); + } + + @Override + @Transactional + public int pendTral(CaseApplication caseApplication) { + List arbitrators = caseApplication.getArbitrators(); + int rows = 0; + if(arbitrators!=null&&arbitrators.size()>0){ + List ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList()); + List arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList()); + String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(",")); + String arbitratorNamestr = arbitratorNames.stream().map(Object::toString).collect(Collectors.joining(",")); + caseApplication.setArbitratorId(idstr); + caseApplication.setArbitratorName(arbitratorNamestr); + caseApplication.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); + rows = caseApplicationMapper.submitCaseApplication(caseApplication); + } + + + return rows; + } + + @Override + @Transactional + public int pendingAppointArbotrar(CaseApplication caseApplication) { + int pendingAppointArbotrar = caseApplication.getPendingAppointArbotrar(); + List arbitrators = caseApplication.getArbitrators(); + int rows = 0; + if(pendingAppointArbotrar==1){ + if(arbitrators!=null&&arbitrators.size()>0){ + List ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList()); + List arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList()); + String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(",")); + String arbitratorNamestr = arbitratorNames.stream().map(Object::toString).collect(Collectors.joining(",")); + caseApplication.setArbitratorId(idstr); + caseApplication.setArbitratorName(arbitratorNamestr); + caseApplication.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); + caseApplication.setPendingAppointArbotrar(1); + rows = caseApplicationMapper.submitCaseApplication(caseApplication); + } + + }else { + caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_TRIAL); + caseApplication.setPendingAppointArbotrar(2); + rows = caseApplicationMapper.submitCaseApplication(caseApplication); + + } + + return rows; + + } + + private void assignmentCaseAffiliates(CaseApplication caseApplication, List caseAffiliatesnew) { + CaseAffiliate caseAffiliate = new CaseAffiliate(); +// BeanUtils.copyBeanProp(caseApplication,caseAffiliate); + BeanUtils.copyBeanProp(caseAffiliate,caseApplication); + caseAffiliatesnew.add(caseAffiliate); + caseApplication.setCaseAffiliates(caseAffiliatesnew); + } + + private void copyCaseApplication(CaseApplication caseApplicationinsertDiffer, CaseApplication caseApplicationNew) { + caseApplicationNew.setArbitratClaims(caseApplicationinsertDiffer.getArbitratClaims()); + caseApplicationNew.setCaseNum(caseApplicationinsertDiffer.getCaseNum()); + caseApplicationNew.setCaseSubjectAmount(caseApplicationinsertDiffer.getCaseSubjectAmount()); + caseApplicationNew.setLoanStartDate(caseApplicationinsertDiffer.getLoanStartDate()); + caseApplicationNew.setLoanEndDate(caseApplicationinsertDiffer.getLoanEndDate()); + caseApplicationNew.setContractNumber(caseApplicationinsertDiffer.getContractNumber()); + caseApplicationNew.setClaimInterestOwed(caseApplicationinsertDiffer.getClaimInterestOwed()); + caseApplicationNew.setClaimPrinciOwed(caseApplicationinsertDiffer.getClaimPrinciOwed()); + caseApplicationNew.setClaimLiquidDamag(caseApplicationinsertDiffer.getClaimLiquidDamag()); + } + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java index 2161e97..e183f34 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java @@ -88,7 +88,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { } @Override public AjaxResult confirmPayment(CaseApplication caseApplication) { - caseApplication.setCaseStatus(CaseApplicationConstants.EVIDENCE_CONFREMED); + caseApplication.setCaseStatus(CaseApplicationConstants.CONFIRMDED_RESPOND); int i = caseApplicationMapper.submitCaseApplication(caseApplication); if (i > 0) { //发送短信通知 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java new file mode 100644 index 0000000..3940c49 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java @@ -0,0 +1,99 @@ +package com.ruoyi.wisdomarbitrate.service.impl; + +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication; +import com.ruoyi.wisdomarbitrate.mapper.IdentityAuthenticationMapper; +import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; +import com.ruoyi.wisdomarbitrate.service.IdentityAuthenticationService; +import com.tencentcloudapi.common.Credential; +import com.tencentcloudapi.common.exception.TencentCloudSDKException; +import com.tencentcloudapi.common.profile.ClientProfile; +import com.tencentcloudapi.common.profile.HttpProfile; +import com.tencentcloudapi.ocr.v20181119.OcrClient; +import com.tencentcloudapi.ocr.v20181119.models.RecognizeTableAccurateOCRRequest; +import com.tencentcloudapi.ocr.v20181119.models.RecognizeTableAccurateOCRResponse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Base64; + +@Service +public class IdentityAuthenticationServiceImpl implements IdentityAuthenticationService { + + @Value("${identityAuthentication.credentialSecretId}") + private String credentialSecretId; + @Value("${identityAuthentication.credentialSecretKey}") + private String credentialSecretKey; + + @Autowired + private IdentityAuthenticationMapper identityAuthenticationMapper; + + private static final Logger log = LoggerFactory.getLogger(IdentityAuthenticationServiceImpl.class); + + @Override + public IdentityAuthentication selectIdentityInformation() { + /* IdentityAuthentication identityAuthentication = new IdentityAuthentication(); + try{ + Credential credIdentityAuthentication = new Credential(credentialSecretId, credentialSecretKey); + HttpProfile httpProfileIdentityAuthentication = new HttpProfile(); + httpProfileIdentityAuthentication.setEndpoint("ocr.tencentcloudapi.com"); + String imagePathIdentityAuthentication = "本地png/jpg文件的绝对地址"; + InputStream inputStreamIdentityAuthentication = null; + byte[] buffer = null; + //读取图片字节数组 + try { + inputStreamIdentityAuthentication = new FileInputStream(imagePathIdentityAuthentication); + int count = 0; + while (count == 0) { + count = inputStreamIdentityAuthentication.available(); + } + buffer = new byte[count]; + inputStreamIdentityAuthentication.read(buffer); + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (inputStreamIdentityAuthentication != null) { + try { + // 关闭inputStream流 + inputStreamIdentityAuthentication.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + String imageBase64IdentityAuthentication = Base64.getEncoder().encodeToString(buffer); + + ClientProfile clientProfileIdentityAuthentication = new ClientProfile(); + clientProfileIdentityAuthentication.setHttpProfile(httpProfileIdentityAuthentication); + OcrClient clientIdentityAuthentication = new OcrClient(credIdentityAuthentication, "ap-shanghai", clientProfileIdentityAuthentication); + RecognizeTableAccurateOCRRequest reqIdentityAuthentication = new RecognizeTableAccurateOCRRequest(); + reqIdentityAuthentication.setImageBase64(imageBase64IdentityAuthentication); + RecognizeTableAccurateOCRResponse respIdentityAuthentication = clientIdentityAuthentication.RecognizeTableAccurateOCR(reqIdentityAuthentication); + String stringRes = RecognizeTableAccurateOCRResponse.toJsonString(respIdentityAuthentication); + JSONObject stringObjectRes = (JSONObject) JSON.parse(stringRes); + JSONObject stringres = (JSONObject) stringObjectRes.get("Response"); + + + identityAuthentication.setName(stringres.get("name").toString()); + identityAuthentication.setIdentityNo(stringres.get("IdNum").toString()); + +// System.out.println(RecognizeTableAccurateOCRResponse.toJsonString(respIdentityAuthentication); + + } catch (TencentCloudSDKException e) { + log.error("身份认证失败", e); + } + + return identityAuthentication;*/ + return null; + } + +} diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitratorMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitratorMapper.xml new file mode 100644 index 0000000..d184338 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitratorMapper.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index c2f7aba..a2d082c 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -135,7 +135,10 @@ update case_application - case_status = #{caseStatus} + case_status = #{caseStatus}, + arbitrator_id = #{arbitratorId}, + arbitrator_name = #{arbitratorName}, + pending_appoint_arbotrar = #{pendingAppointArbotrar}, where id = #{id} diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml new file mode 100644 index 0000000..12c23e6 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + \ No newline at end of file