Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz
This commit is contained in:
@@ -22,7 +22,11 @@
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>pay</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -2,7 +2,6 @@ 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;
|
||||
@@ -25,7 +24,7 @@ public class CaseApplication extends BaseEntity {
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date registerDate;
|
||||
/** 仲裁方式 */
|
||||
private String arbitratMethod;
|
||||
private int arbitratMethod;
|
||||
/** 案件状态 */
|
||||
private int caseStatus;
|
||||
/** 开庭日期 */
|
||||
@@ -324,11 +323,11 @@ public class CaseApplication extends BaseEntity {
|
||||
this.registerDate = registerDate;
|
||||
}
|
||||
|
||||
public String getArbitratMethod() {
|
||||
public int getArbitratMethod() {
|
||||
return arbitratMethod;
|
||||
}
|
||||
|
||||
public void setArbitratMethod(String arbitratMethod) {
|
||||
public void setArbitratMethod(int arbitratMethod) {
|
||||
this.arbitratMethod = arbitratMethod;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class CaseAttach {
|
||||
/**
|
||||
* 附件id
|
||||
*/
|
||||
private Integer annexId;
|
||||
/**
|
||||
* 案件申请id
|
||||
*/
|
||||
private Long caseAppliId;
|
||||
/**
|
||||
* 附件名称
|
||||
*/
|
||||
private String annexName;
|
||||
/**
|
||||
* 附件路径
|
||||
*/
|
||||
private String annexPath;
|
||||
/**
|
||||
* 附件类型,立案申请书(1)、证据材料(2)、仲裁文书(3)、案件视频(4)、身份证件(5)
|
||||
*/
|
||||
private Integer annexType;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String note;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 用户账户
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
}
|
||||
@@ -14,7 +14,7 @@ public class CaseLogRecord extends BaseEntity {
|
||||
/** 案件申请id */
|
||||
private Long caseAppliId;
|
||||
/** 案件节点 */
|
||||
private String caseNode;
|
||||
private Integer caseNode;
|
||||
|
||||
/** 案件节点时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@@ -50,11 +50,11 @@ public class CaseLogRecord extends BaseEntity {
|
||||
this.caseAppliId = caseAppliId;
|
||||
}
|
||||
|
||||
public String getCaseNode() {
|
||||
public int getCaseNode() {
|
||||
return caseNode;
|
||||
}
|
||||
|
||||
public void setCaseNode(String caseNode) {
|
||||
public void setCaseNode(int caseNode) {
|
||||
this.caseNode = caseNode;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class CasePaymentRecord {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 案件id
|
||||
*/
|
||||
private Long caseId;
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
private String orderNumber;
|
||||
/**
|
||||
* 支付状态(0未支付,1已支付)
|
||||
*/
|
||||
private Integer paymentStatus;
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date paymentTime;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
/**
|
||||
* 案件缴费传入参数
|
||||
*/
|
||||
@Data
|
||||
public class CasePayDTO {
|
||||
/**
|
||||
* 案件id
|
||||
*/
|
||||
private Long caseId;
|
||||
|
||||
/**
|
||||
* 订单金额 单位:分
|
||||
*/
|
||||
private int totalFee;
|
||||
/**
|
||||
* 交易类型 native(扫码) / jsapi(小程序) / app / h5
|
||||
*/
|
||||
private String tradeType;
|
||||
/**
|
||||
* 支付方式 wxpay(微信) alipay(支付宝)
|
||||
*/
|
||||
private String platform;
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.vo;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CaseDetailVO {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 案件编号
|
||||
*/
|
||||
private String caseNum;
|
||||
/**
|
||||
* 申请人姓名
|
||||
*/
|
||||
private String applicantName;
|
||||
/**
|
||||
* 被申请人姓名
|
||||
*/
|
||||
private String respondentName;
|
||||
/**
|
||||
* 借款开始日期
|
||||
*/
|
||||
private Date loanStartDate;
|
||||
/**
|
||||
* 借款结束日期
|
||||
*/
|
||||
private Date loanEndDate;
|
||||
/**
|
||||
* 案件标的
|
||||
*/
|
||||
private BigDecimal caseSubjectAmount;
|
||||
/**
|
||||
* 申请人主张欠本金
|
||||
*/
|
||||
private BigDecimal claimPrinciOwed;
|
||||
/**
|
||||
* 申请人主张欠利息
|
||||
*/
|
||||
private BigDecimal claimInterestOwed;
|
||||
/**
|
||||
* 申请人主张违约金
|
||||
*/
|
||||
private BigDecimal claimLiquidDamag;
|
||||
|
||||
/**
|
||||
* 证据材料
|
||||
*/
|
||||
private List<CaseAttach> evidenceMaterialList;
|
||||
/**
|
||||
* 当前登录人身份类型
|
||||
*/
|
||||
private Integer identityType;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.vo;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CaseEvidenceVO {
|
||||
/**
|
||||
* 案件id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 案件编号
|
||||
*/
|
||||
private String caseNum;
|
||||
/**
|
||||
* 申请人姓名
|
||||
*/
|
||||
private String applicantName;
|
||||
/**
|
||||
* 被申请人姓名
|
||||
*/
|
||||
private String respondentName;
|
||||
/**
|
||||
* 案件状态
|
||||
*/
|
||||
private Integer caseStatus;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.ruoyi.wisdomarbitrate.mapper;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CaseAttachMapper {
|
||||
int save(CaseAttach caseAttach);
|
||||
|
||||
List<CaseAttach> queryAnnexPathByCaseId(Long id);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.ruoyi.wisdomarbitrate.mapper;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface CaseEvidenceMapper {
|
||||
List<CaseEvidenceVO> getCaseListByRespondent(@Param(value = "identityNum" ) String identityNum
|
||||
, @Param(value = "caseStatusList") List<Integer> caseStatusList
|
||||
, @Param(value = "identityType" ) Integer identityType);
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.ruoyi.wisdomarbitrate.mapper;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.CasePaymentRecord;
|
||||
|
||||
public interface CasePaymentRecordMapper {
|
||||
int saveRecord(CasePaymentRecord casePaymentRecord);
|
||||
|
||||
CasePaymentRecord queryRecord(String orderNumber);
|
||||
|
||||
void update(CasePaymentRecord casePaymentRecord);
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package com.ruoyi.wisdomarbitrate.service;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
|
||||
public interface ICaseArbitrateService {
|
||||
AjaxResult chooseArbitrateMethod(CaseApplication caseApplication,Integer arbitratMethod);
|
||||
|
||||
AjaxResult writtenHear(CaseApplication caseApplication, String accidentDescription, String arbitrationResult);
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.ruoyi.wisdomarbitrate.service;
|
||||
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ICaseEvidenceService {
|
||||
|
||||
AjaxResult getCaseDetailsById(Long id,String userName);
|
||||
|
||||
AjaxResult uploadEvidence(MultipartFile file, Integer annexType, Long id,String userName,Long userId);
|
||||
|
||||
List<CaseEvidenceVO> getCaseListAll(String identityNum);
|
||||
|
||||
AjaxResult evidenceConfirmation(CaseApplication caseApplication);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.ruoyi.wisdomarbitrate.service;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.dto.PayRequest;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO;
|
||||
|
||||
public interface ICasePaymentService {
|
||||
/**
|
||||
* 案件缴费
|
||||
*/
|
||||
AjaxResult casePay(CasePayDTO casePayDTO);
|
||||
|
||||
AjaxResult confirmPayment(CaseApplication caseApplication);
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.ruoyi.wisdomarbitrate.service.impl;
|
||||
|
||||
import com.ruoyi.CallBackService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 业务回调处理
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class CallBackHandleServiceImpl implements CallBackService {
|
||||
@Autowired
|
||||
private CasePaymentServiceImpl casePaymentService;
|
||||
@Override
|
||||
public void successPay(String orderSn) {
|
||||
casePaymentService.callback(orderSn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void failPay(String orderSn) {
|
||||
log.info("支付失败回调!"+orderSn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void successRefund(String orderSn) {
|
||||
log.info("退款成功回调!"+orderSn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void failRefund(String orderSn) {
|
||||
log.info("退款失败回调!"+orderSn);
|
||||
}
|
||||
}
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
package com.ruoyi.wisdomarbitrate.service.impl;
|
||||
|
||||
import com.ruoyi.common.constant.CaseApplicationConstants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.SmsUtils;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.CaseLogRecordMapper;
|
||||
import com.ruoyi.wisdomarbitrate.service.ICaseArbitrateService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
|
||||
@Autowired
|
||||
private CaseApplicationMapper caseApplicationMapper;
|
||||
@Autowired
|
||||
private CaseAffiliateMapper caseAffiliateMapper;
|
||||
@Autowired
|
||||
private CaseLogRecordMapper caseLogRecordMapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public AjaxResult chooseArbitrateMethod(CaseApplication caseApplication, Integer arbitratMethod) {
|
||||
if (arbitratMethod != null) {
|
||||
String arbitratMethodStr = arbitratMethod == 1 ? "开庭审理" : "书面审理";
|
||||
//查询案件详细信息
|
||||
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
||||
if (caseApplication1 == null) {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
String caseNum = caseApplication1.getCaseNum();
|
||||
//选择仲裁方式
|
||||
caseApplication.setArbitratMethod(arbitratMethod);
|
||||
//修改案件状态为待开庭
|
||||
caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT);
|
||||
int i = caseApplicationMapper.submitCaseApplication(caseApplication);
|
||||
if (i > 0) {
|
||||
//发送短信通知
|
||||
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
||||
request.setTemplateId("1931000");
|
||||
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
||||
caseAffiliate.setCaseAppliId(caseApplication1.getId());
|
||||
List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); //获取案件关联人信息
|
||||
if (caseAffiliates != null && caseAffiliates.size() > 0) {
|
||||
for (CaseAffiliate affiliate : caseAffiliates) {
|
||||
//获取身份类型
|
||||
int identityType = affiliate.getIdentityType();
|
||||
if (identityType == 1) { //申请人
|
||||
request.setPhone(affiliate.getContactTelphone());
|
||||
// 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置
|
||||
// 1931000 普通短信 确定仲裁方式通知 尊敬的{1}用户,您的{2}仲裁案件,仲裁方式已确定为{3},请知晓,如非本人操作,请忽略本短信。
|
||||
String name = affiliate.getName();
|
||||
request.setTemplateParamSet(new String[]{name, caseNum, arbitratMethodStr});
|
||||
SmsUtils.sendSms(request);
|
||||
} else { //被申请人
|
||||
request.setPhone(affiliate.getContactTelphone());
|
||||
// 模板id1928006 普通短信 案件应诉通知 尊敬的{1}用户,您的{2}案件{3}已成功受理,请点击https://phmapp.xayunmei.com选择是否应诉。
|
||||
String name = affiliate.getName();
|
||||
request.setTemplateParamSet(new String[]{name, caseNum, arbitratMethodStr});
|
||||
SmsUtils.sendSms(request);
|
||||
}
|
||||
}
|
||||
}
|
||||
return AjaxResult.success("选择成功");
|
||||
}
|
||||
|
||||
}
|
||||
return AjaxResult.error("请选择开庭方式");
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult writtenHear(CaseApplication caseApplication, String accidentDescription, String arbitrationResult) {
|
||||
//提交仲裁结果
|
||||
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
||||
caseApplication1.setCaseDescribe(accidentDescription); //案情描述
|
||||
caseApplication1.setCaseResult(arbitrationResult); //仲裁结果
|
||||
int i = caseApplicationMapper.updataCaseApplication(caseApplication1);
|
||||
if (i>0){
|
||||
//案件日志表里添加数据
|
||||
CaseLogRecord caseLogRecord = new CaseLogRecord();
|
||||
caseLogRecord.setCaseAppliId(caseApplication1.getId());
|
||||
caseLogRecord.setCaseNode(caseApplication1.getCaseStatus());
|
||||
String createBy = caseApplication1.getCreateBy();
|
||||
if (createBy!=null){
|
||||
caseLogRecord.setCreateBy(createBy);
|
||||
}
|
||||
caseLogRecordMapper.insertCaseLogRecord(caseLogRecord);
|
||||
//修改案件状态
|
||||
caseApplication.setCaseStatus(CaseApplicationConstants.GENERATED_ARBITRATION);
|
||||
caseApplicationMapper.submitCaseApplication(caseApplication);
|
||||
return AjaxResult.success("提交成功");
|
||||
}
|
||||
return AjaxResult.error("暂无需要提交仲裁结果的案件");
|
||||
}
|
||||
}
|
||||
+145
@@ -0,0 +1,145 @@
|
||||
package com.ruoyi.wisdomarbitrate.service.impl;
|
||||
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.constant.CaseApplicationConstants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.CaseDetailVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.CaseEvidenceMapper;
|
||||
import com.ruoyi.wisdomarbitrate.service.ICaseEvidenceService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
|
||||
@Autowired
|
||||
private CaseEvidenceMapper caseEvidenceMapper;
|
||||
@Autowired
|
||||
private CaseAffiliateMapper caseAffiliateMapper;
|
||||
@Autowired
|
||||
private CaseApplicationMapper caseApplicationMapper;
|
||||
@Autowired
|
||||
private CaseAttachMapper caseAttachMapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public AjaxResult getCaseDetailsById(Long id,String userName) {
|
||||
CaseApplication caseApplication = new CaseApplication();
|
||||
caseApplication.setId(id);
|
||||
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
||||
if (caseApplication1 != null) {
|
||||
CaseDetailVO caseDetailVO = new CaseDetailVO();
|
||||
BeanUtils.copyProperties(caseApplication1, caseDetailVO);
|
||||
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
||||
caseAffiliate.setCaseAppliId(id);
|
||||
List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
||||
for (CaseAffiliate affiliate : caseAffiliates) {
|
||||
String name = affiliate.getName();
|
||||
//判断当前登录人和案件关联人姓名是否一致
|
||||
if (name.equals(userName)) { //一致,将案件关联人的身份类型赋给当前登录人
|
||||
caseDetailVO.setIdentityType(affiliate.getIdentityType());
|
||||
}
|
||||
if (affiliate.getIdentityType() == 1) { //申请人
|
||||
caseDetailVO.setApplicantName(affiliate.getName());
|
||||
} else {
|
||||
caseDetailVO.setRespondentName(affiliate.getName());
|
||||
}
|
||||
//根据案件id查询案件证据材料
|
||||
List<CaseAttach> evidenceMaterialList = caseAttachMapper.queryAnnexPathByCaseId(id);
|
||||
caseDetailVO.setEvidenceMaterialList(evidenceMaterialList);
|
||||
}
|
||||
return AjaxResult.success(caseDetailVO);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public AjaxResult uploadEvidence(MultipartFile file, Integer annexType, Long id, String userName, Long userId) {
|
||||
|
||||
if (file.isEmpty()) {
|
||||
return AjaxResult.error("请选择要上传的文件");
|
||||
}
|
||||
try {
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
// 上传
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id)
|
||||
.annexName(fileName)
|
||||
.annexPath(filePath)
|
||||
.annexType(annexType)
|
||||
.userId(userId)
|
||||
.userName(userName)
|
||||
.build();
|
||||
int count = caseAttachMapper.save(caseAttach);
|
||||
if (count > 0) {
|
||||
//修改案件状态
|
||||
CaseApplication caseApplication = new CaseApplication();
|
||||
caseApplication.setId(id);
|
||||
caseApplication.setCaseStatus(4);
|
||||
caseApplicationMapper.submitCaseApplication(caseApplication);
|
||||
return AjaxResult.success("上传成功");
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return AjaxResult.error("上传失败");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public List<CaseEvidenceVO> getCaseListAll(String identityNum) {
|
||||
List<Integer> caseStatusList = Arrays.asList(3, 4, 5, 9);
|
||||
return getCaseEvidenceVOList(identityNum, caseStatusList, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult evidenceConfirmation(CaseApplication caseApplication) {
|
||||
caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_APPOINT_ARBOTRATAR);
|
||||
int i = caseApplicationMapper.submitCaseApplication(caseApplication);
|
||||
if (i>0){
|
||||
return AjaxResult.success("证据确认成功");
|
||||
}
|
||||
return AjaxResult.error("暂无需要确认的证据");
|
||||
}
|
||||
|
||||
private List<CaseEvidenceVO> getCaseEvidenceVOList(String identityNum, List<Integer> caseStatusList, Integer identityType) {
|
||||
List<CaseEvidenceVO> caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatusList, identityType);
|
||||
if (caseListByRespondent != null && caseListByRespondent.size() > 0) {
|
||||
for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) {
|
||||
//根据案件id查询姓名
|
||||
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
||||
caseAffiliate.setCaseAppliId(caseEvidenceVO.getId());
|
||||
List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
||||
for (CaseAffiliate affiliate : caseAffiliates) {
|
||||
if (affiliate.getIdentityType() == 1) { //申请人
|
||||
caseEvidenceVO.setApplicantName(affiliate.getName());
|
||||
} else {
|
||||
caseEvidenceVO.setRespondentName(affiliate.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return caseListByRespondent;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
-1
@@ -17,7 +17,6 @@ public class CaseLogRecordServiceImpl implements ICaseLogRecordService {
|
||||
@Override
|
||||
public List<CaseLogRecord> selectCaseLogRecordList(CaseLogRecord caseLogRecord) {
|
||||
return caseLogRecordMapper.selectCaseLogRecordList(caseLogRecord);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
+135
@@ -0,0 +1,135 @@
|
||||
package com.ruoyi.wisdomarbitrate.service.impl;
|
||||
|
||||
|
||||
import com.ruoyi.ElegentPay;
|
||||
import com.ruoyi.common.constant.CaseApplicationConstants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.SmsUtils;
|
||||
import com.ruoyi.dto.PayRequest;
|
||||
import com.ruoyi.dto.PayResponse;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CasePaymentRecord;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.CasePaymentRecordMapper;
|
||||
import com.ruoyi.wisdomarbitrate.service.ICasePaymentService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class CasePaymentServiceImpl implements ICasePaymentService {
|
||||
private final ElegentPay elegentPay;
|
||||
private final CaseApplicationMapper caseApplicationMapper;
|
||||
private final CasePaymentRecordMapper casePaymentRecordMapper;
|
||||
private final CaseAffiliateMapper caseAffiliateMapper;
|
||||
|
||||
@Autowired
|
||||
public CasePaymentServiceImpl(ElegentPay elegentPay
|
||||
, CaseApplicationMapper caseApplicationMapper
|
||||
, CasePaymentRecordMapper casePaymentRecordMapper
|
||||
, CaseAffiliateMapper caseAffiliateMapper) {
|
||||
this.elegentPay = elegentPay;
|
||||
this.caseApplicationMapper = caseApplicationMapper;
|
||||
this.casePaymentRecordMapper = casePaymentRecordMapper;
|
||||
this.caseAffiliateMapper = caseAffiliateMapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public AjaxResult casePay(CasePayDTO casePayDTO) {
|
||||
PayRequest payRequest = new PayRequest();
|
||||
payRequest.setBody("案件缴费");
|
||||
payRequest.setOrderSn(System.currentTimeMillis() + "");
|
||||
payRequest.setTotalFee(casePayDTO.getTotalFee());
|
||||
PayResponse response = elegentPay.requestPay(payRequest, casePayDTO.getTradeType(), casePayDTO.getPlatform());
|
||||
if (response.getCode_url() == null) {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
//缴费记录表里新增数据
|
||||
CasePaymentRecord casePaymentRecord = new CasePaymentRecord();
|
||||
casePaymentRecord.setCaseId(casePayDTO.getCaseId());
|
||||
casePaymentRecord.setOrderNumber(payRequest.getOrderSn());
|
||||
casePaymentRecord.setPaymentStatus(0);
|
||||
casePaymentRecord.setCreateTime(new Date());
|
||||
int count = casePaymentRecordMapper.saveRecord(casePaymentRecord);
|
||||
if (count < 1) {
|
||||
return AjaxResult.error("请检查参数是否有误");
|
||||
}
|
||||
return AjaxResult.success(response);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public AjaxResult callback(String orderNumber) {
|
||||
//查询记录
|
||||
CasePaymentRecord casePaymentRecord = casePaymentRecordMapper.queryRecord(orderNumber);
|
||||
if (casePaymentRecord == null) {
|
||||
return AjaxResult.error("未查询到相关记录");
|
||||
}
|
||||
Long caseId = casePaymentRecord.getCaseId();
|
||||
//更改记录表里的支付状态和支付时间
|
||||
casePaymentRecord.setPaymentStatus(1);
|
||||
casePaymentRecord.setPaymentTime(new Date());
|
||||
casePaymentRecord.setUpdateTime(new Date());
|
||||
casePaymentRecordMapper.update(casePaymentRecord);
|
||||
//根据案件id查询案件信息
|
||||
CaseApplication caseApplication = new CaseApplication();
|
||||
caseApplication.setId(caseId);
|
||||
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
||||
caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
|
||||
//修改案件状态
|
||||
caseApplicationMapper.submitCaseApplication(caseApplication1);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public AjaxResult confirmPayment(CaseApplication caseApplication) {
|
||||
caseApplication.setCaseStatus(CaseApplicationConstants.CONFIRMDED_RESPOND);
|
||||
int i = caseApplicationMapper.submitCaseApplication(caseApplication);
|
||||
if (i > 0) {
|
||||
//发送短信通知
|
||||
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
||||
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
||||
caseAffiliate.setCaseAppliId(caseApplication.getId());
|
||||
List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); //获取案件关联人信息
|
||||
if (caseAffiliates != null && caseAffiliates.size() > 0) {
|
||||
for (CaseAffiliate affiliate : caseAffiliates) {
|
||||
//获取身份类型
|
||||
int identityType = affiliate.getIdentityType();
|
||||
//查询案件详细信息
|
||||
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
||||
if (caseApplication1 == null) {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
String caseName = "仲裁"; //这里案件名称表里未定义,暂时写死
|
||||
String caseNum = caseApplication1.getCaseNum();
|
||||
if (identityType == 1) { //申请人
|
||||
request.setPhone(affiliate.getContactTelphone());
|
||||
request.setTemplateId("1928003"); //传入申请人模板id
|
||||
// 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置
|
||||
// 模板id:1928003 普通短信 案件受理通知 尊敬的{1}用户,您的{2}案件{3}已成功受理。
|
||||
String name = affiliate.getName();
|
||||
request.setTemplateParamSet(new String[]{name, caseName, caseNum});
|
||||
SmsUtils.sendSms(request);
|
||||
} else { //被申请人
|
||||
request.setPhone(affiliate.getContactTelphone());
|
||||
request.setTemplateId("1928006");
|
||||
// 模板id1928006 普通短信 案件应诉通知 尊敬的{1}用户,您的{2}案件{3}已成功受理,请点击https://phmapp.xayunmei.com选择是否应诉。
|
||||
String name = affiliate.getName();
|
||||
request.setTemplateParamSet(new String[]{name, caseName, caseNum});
|
||||
SmsUtils.sendSms(request);
|
||||
}
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
return AjaxResult.error("暂无需要确认的缴费清单");
|
||||
}
|
||||
}
|
||||
+4
-3
@@ -40,7 +40,7 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthenticatio
|
||||
|
||||
@Override
|
||||
public IdentityAuthentication selectIdentityInformation() {
|
||||
IdentityAuthentication identityAuthentication = new IdentityAuthentication();
|
||||
/* IdentityAuthentication identityAuthentication = new IdentityAuthentication();
|
||||
try{
|
||||
Credential credIdentityAuthentication = new Credential(credentialSecretId, credentialSecretKey);
|
||||
HttpProfile httpProfileIdentityAuthentication = new HttpProfile();
|
||||
@@ -92,7 +92,8 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthenticatio
|
||||
log.error("身份认证失败", e);
|
||||
}
|
||||
|
||||
return identityAuthentication;
|
||||
|
||||
return identityAuthentication;*/
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -145,6 +145,7 @@
|
||||
<if test="arbitratorId != null and arbitratorId != ''">arbitrator_id = #{arbitratorId},</if>
|
||||
<if test="arbitratorName != null and arbitratorName != ''">arbitrator_name = #{arbitratorName},</if>
|
||||
<if test="pendingAppointArbotrar != null ">pending_appoint_arbotrar = #{pendingAppointArbotrar},</if>
|
||||
<if test="arbitratMethod != null ">arbitrat_method = #{arbitratMethod},</if>
|
||||
<if test="caseName != null and caseName != ''">case_name = #{caseName},</if>
|
||||
<if test="caseDescribe != null and caseDescribe != ''">case_describe = #{caseDescribe},</if>
|
||||
<if test="caseResult != null and caseResult != ''">case_result = #{caseResult},</if>
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper">
|
||||
<resultMap type="CaseAttach" id="CaseAttachResult">
|
||||
<id property="annexId" column="annex_id" />
|
||||
<result property="caseAppliId" column="case_appli_id" />
|
||||
<result property="annexName" column="annex_name" />
|
||||
<result property="annexPath" column="annex_path" />
|
||||
<result property="annexType" column="annex_type" />
|
||||
<result property="note" column="note" />
|
||||
<result property="userId" column="use_id" />
|
||||
<result property="userName" column="use_account" />
|
||||
</resultMap>
|
||||
<insert id="save">
|
||||
INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account)
|
||||
VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName})
|
||||
</insert>
|
||||
<select id="queryAnnexPathByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" resultMap="CaseAttachResult">
|
||||
select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account
|
||||
from case_attach
|
||||
where case_appli_id =#{id}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.wisdomarbitrate.mapper.CaseEvidenceMapper">
|
||||
<resultMap type="CaseEvidenceVO" id="CaseEvidenceVOResult">
|
||||
<id property="id" column="id" />
|
||||
<result property="caseNum" column="case_num" />
|
||||
<result property="caseStatus" column="case_status" />
|
||||
</resultMap>
|
||||
<select id="getCaseListByRespondent" resultType="CaseEvidenceVO" resultMap="CaseEvidenceVOResult">
|
||||
select c.id, c.case_num,c.case_status
|
||||
from case_application as c ,case_affiliate as d
|
||||
where c.id = d.case_appli_id
|
||||
<if test="identityNum != null and identityNum != ''">
|
||||
and d.identity_num = #{identityNum}
|
||||
</if>
|
||||
<if test="identityType != null ">
|
||||
and identity_type = #{identityType}
|
||||
</if>
|
||||
<if test="caseStatusList != null and caseStatusList.size() > 0">
|
||||
and c.case_status in
|
||||
<foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
|
||||
#{caseStatus}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.wisdomarbitrate.mapper.CasePaymentRecordMapper">
|
||||
<resultMap type="CasePaymentRecord" id="CasePaymentRecordResult">
|
||||
<id property="id" column="id" />
|
||||
<result property="caseId" column="case_id" />
|
||||
<result property="orderNumber" column="order_number" />
|
||||
<result property="paymentStatus" column="payment_status" />
|
||||
<result property="paymentTime" column="payment_time" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
<insert id="saveRecord">
|
||||
INSERT INTO case_payment_record (case_id, order_number, payment_status , create_time)
|
||||
VALUES (#{caseId}, #{orderNumber}, #{paymentStatus},#{createTime})
|
||||
</insert>
|
||||
<update id="update">
|
||||
update case_payment_record
|
||||
<set>
|
||||
<if test="caseId != null">case_id= #{caseId},</if>
|
||||
<if test="orderNumber != null and orderNumber != ''">order_number = #{orderNumber},</if>
|
||||
<if test="paymentTime != null ">payment_time = #{paymentTime},</if>
|
||||
<if test="paymentStatus != null ">payment_status = #{paymentStatus},</if>
|
||||
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<select id="queryRecord" resultType="com.ruoyi.wisdomarbitrate.domain.CasePaymentRecord" resultMap="CasePaymentRecordResult">
|
||||
select c.id ,c.case_id ,c.order_number ,c.payment_time ,c.create_time ,c.update_time ,c.payment_status
|
||||
from case_payment_record c
|
||||
<where>
|
||||
<if test="orderNumber != null ">
|
||||
AND c.order_number = #{orderNumber}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user