证据上传接口开发
This commit is contained in:
+58
@@ -0,0 +1,58 @@
|
|||||||
|
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO;
|
||||||
|
import com.ruoyi.wisdomarbitrate.service.ICaseEvidenceService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件证据上传
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/evidence")
|
||||||
|
public class CaseEvidenceController extends BaseController {
|
||||||
|
private final ICaseEvidenceService caseEvidenceService;
|
||||||
|
@Autowired
|
||||||
|
public CaseEvidenceController(ICaseEvidenceService caseEvidenceService) {
|
||||||
|
this.caseEvidenceService = caseEvidenceService;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 查询被申请人案件列表
|
||||||
|
* @param identityNum 身份证号
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/respondent")
|
||||||
|
public TableDataInfo getCaseListByRespondent(@RequestParam String identityNum
|
||||||
|
,Integer pageNum,Integer pageSize){
|
||||||
|
startPage();
|
||||||
|
List<CaseEvidenceVO> list = caseEvidenceService.getCaseListByRespondent(identityNum);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 根据案件id查询案件详情
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public AjaxResult getCaseDetailsById(@PathVariable Long id ){
|
||||||
|
return caseEvidenceService.getCaseDetailsById(id);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 案件证据上传
|
||||||
|
* @param file 附件
|
||||||
|
* @param annexType 附件类型,立案申请书(1)、证据材料(2)、仲裁文书(3)、案件视频(4)、身份证件(5)
|
||||||
|
* @param id 案件申请id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/upload")
|
||||||
|
public AjaxResult uploadEvidence(@RequestParam("file") MultipartFile file , Integer annexType , Long id){
|
||||||
|
return caseEvidenceService.uploadEvidence(file,annexType,id);
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package com.ruoyi.web.controller.payment;
|
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||||
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -7,7 +7,7 @@ import lombok.Data;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class CasePaymentRecord extends BaseEntity {
|
public class CasePaymentRecord {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
/**
|
/**
|
||||||
* 主键
|
* 主键
|
||||||
@@ -30,4 +30,12 @@ public class CasePaymentRecord extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date paymentTime;
|
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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,11 +15,6 @@ public class CasePayDTO {
|
|||||||
* 订单金额 单位:分
|
* 订单金额 单位:分
|
||||||
*/
|
*/
|
||||||
private int totalFee;
|
private int totalFee;
|
||||||
|
|
||||||
/**
|
|
||||||
* 描述
|
|
||||||
*/
|
|
||||||
private String body;
|
|
||||||
/**
|
/**
|
||||||
* 交易类型 native(扫码) / jsapi(小程序) / app / h5
|
* 交易类型 native(扫码) / jsapi(小程序) / app / h5
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package com.ruoyi.wisdomarbitrate.domain.vo;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@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;
|
||||||
|
}
|
||||||
@@ -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,7 @@
|
|||||||
|
package com.ruoyi.wisdomarbitrate.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
|
||||||
|
|
||||||
|
public interface CaseAttachMapper {
|
||||||
|
int save(CaseAttach caseAttach);
|
||||||
|
}
|
||||||
@@ -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 = "caseStatus" ) Integer caseStatus
|
||||||
|
, @Param(value = "identityType" ) Integer identityType);
|
||||||
|
}
|
||||||
+1
-1
@@ -5,7 +5,7 @@ import com.ruoyi.wisdomarbitrate.domain.CasePaymentRecord;
|
|||||||
public interface CasePaymentRecordMapper {
|
public interface CasePaymentRecordMapper {
|
||||||
int saveRecord(CasePaymentRecord casePaymentRecord);
|
int saveRecord(CasePaymentRecord casePaymentRecord);
|
||||||
|
|
||||||
CasePaymentRecord queryRecord(String orderSn);
|
CasePaymentRecord queryRecord(String orderNumber);
|
||||||
|
|
||||||
void update(CasePaymentRecord casePaymentRecord);
|
void update(CasePaymentRecord casePaymentRecord);
|
||||||
}
|
}
|
||||||
|
|||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
package com.ruoyi.wisdomarbitrate.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface ICaseEvidenceService {
|
||||||
|
List<CaseEvidenceVO> getCaseListByRespondent(String identityNum);
|
||||||
|
|
||||||
|
AjaxResult getCaseDetailsById(Long id);
|
||||||
|
|
||||||
|
AjaxResult uploadEvidence(MultipartFile file, Integer annexType, Long id);
|
||||||
|
}
|
||||||
+101
@@ -0,0 +1,101 @@
|
|||||||
|
package com.ruoyi.wisdomarbitrate.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.common.config.RuoYiConfig;
|
||||||
|
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.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
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
|
||||||
|
public List<CaseEvidenceVO> getCaseListByRespondent(String identityNum) {
|
||||||
|
int caseStatus = 3;
|
||||||
|
int identityType = 2;
|
||||||
|
List<CaseEvidenceVO> caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatus,identityType);
|
||||||
|
if (caseListByRespondent!= null && caseListByRespondent.size()>0){
|
||||||
|
for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) {
|
||||||
|
//根据案件id查询申请人姓名
|
||||||
|
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
||||||
|
caseAffiliate.setCaseAppliId(caseEvidenceVO.getId());
|
||||||
|
caseAffiliate.setIdentityType(1);
|
||||||
|
String name = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate).get(0).getName();
|
||||||
|
caseEvidenceVO.setApplicantName(name);
|
||||||
|
}
|
||||||
|
return caseListByRespondent;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult getCaseDetailsById(Long id) {
|
||||||
|
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) {
|
||||||
|
if (affiliate.getIdentityType() == 1){ //申请人
|
||||||
|
caseDetailVO.setApplicantName(affiliate.getName());
|
||||||
|
}else {
|
||||||
|
caseDetailVO.setRespondentName(affiliate.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return AjaxResult.success(caseDetailVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult uploadEvidence(MultipartFile file , Integer annexType, Long id) {
|
||||||
|
if (file.isEmpty()) {
|
||||||
|
return AjaxResult.error("请选择要上传的文件");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
String filePath = RuoYiConfig.getUploadPath();
|
||||||
|
// 上传并返回新文件名称
|
||||||
|
String fileNewName = FileUploadUtils.upload(filePath, file);
|
||||||
|
CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id)
|
||||||
|
.annexName(fileNewName)
|
||||||
|
.annexPath(filePath)
|
||||||
|
.annexType(annexType)
|
||||||
|
.build();
|
||||||
|
int count = caseAttachMapper.save(caseAttach);
|
||||||
|
if (count>0){
|
||||||
|
return AjaxResult.success("上传成功");
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return AjaxResult.error("上传失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
+33
-26
@@ -12,6 +12,7 @@ import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
|
|||||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.CasePaymentRecord;
|
import com.ruoyi.wisdomarbitrate.domain.CasePaymentRecord;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO;
|
import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO;
|
||||||
|
import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper;
|
||||||
import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
|
import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
|
||||||
import com.ruoyi.wisdomarbitrate.mapper.CasePaymentRecordMapper;
|
import com.ruoyi.wisdomarbitrate.mapper.CasePaymentRecordMapper;
|
||||||
import com.ruoyi.wisdomarbitrate.service.ICasePaymentService;
|
import com.ruoyi.wisdomarbitrate.service.ICasePaymentService;
|
||||||
@@ -27,21 +28,23 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
|
|||||||
private final ElegentPay elegentPay;
|
private final ElegentPay elegentPay;
|
||||||
private final CaseApplicationMapper caseApplicationMapper;
|
private final CaseApplicationMapper caseApplicationMapper;
|
||||||
private final CasePaymentRecordMapper casePaymentRecordMapper;
|
private final CasePaymentRecordMapper casePaymentRecordMapper;
|
||||||
|
private final CaseAffiliateMapper caseAffiliateMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public CasePaymentServiceImpl(ElegentPay elegentPay
|
public CasePaymentServiceImpl(ElegentPay elegentPay
|
||||||
, CaseApplicationMapper caseApplicationMapper
|
, CaseApplicationMapper caseApplicationMapper
|
||||||
, CasePaymentRecordMapper casePaymentRecordMapper) {
|
, CasePaymentRecordMapper casePaymentRecordMapper
|
||||||
|
, CaseAffiliateMapper caseAffiliateMapper) {
|
||||||
this.elegentPay = elegentPay;
|
this.elegentPay = elegentPay;
|
||||||
this.caseApplicationMapper = caseApplicationMapper;
|
this.caseApplicationMapper = caseApplicationMapper;
|
||||||
this.casePaymentRecordMapper = casePaymentRecordMapper;
|
this.casePaymentRecordMapper = casePaymentRecordMapper;
|
||||||
|
this.caseAffiliateMapper = caseAffiliateMapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult casePay(CasePayDTO casePayDTO) {
|
public AjaxResult casePay(CasePayDTO casePayDTO) {
|
||||||
PayRequest payRequest = new PayRequest();
|
PayRequest payRequest = new PayRequest();
|
||||||
payRequest.setBody(casePayDTO.getBody());
|
payRequest.setBody("案件缴费");
|
||||||
payRequest.setOrderSn(System.currentTimeMillis() + "");
|
payRequest.setOrderSn(System.currentTimeMillis() + "");
|
||||||
payRequest.setTotalFee(casePayDTO.getTotalFee());
|
payRequest.setTotalFee(casePayDTO.getTotalFee());
|
||||||
PayResponse response = elegentPay.requestPay(payRequest, casePayDTO.getTradeType(), casePayDTO.getPlatform());
|
PayResponse response = elegentPay.requestPay(payRequest, casePayDTO.getTradeType(), casePayDTO.getPlatform());
|
||||||
@@ -53,6 +56,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
|
|||||||
casePaymentRecord.setCaseId(casePayDTO.getCaseId());
|
casePaymentRecord.setCaseId(casePayDTO.getCaseId());
|
||||||
casePaymentRecord.setOrderNumber(payRequest.getOrderSn());
|
casePaymentRecord.setOrderNumber(payRequest.getOrderSn());
|
||||||
casePaymentRecord.setPaymentStatus(0);
|
casePaymentRecord.setPaymentStatus(0);
|
||||||
|
casePaymentRecord.setCreateTime(new Date());
|
||||||
int count = casePaymentRecordMapper.saveRecord(casePaymentRecord);
|
int count = casePaymentRecordMapper.saveRecord(casePaymentRecord);
|
||||||
if (count < 1) {
|
if (count < 1) {
|
||||||
return AjaxResult.error("请检查参数是否有误");
|
return AjaxResult.error("请检查参数是否有误");
|
||||||
@@ -61,9 +65,9 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public AjaxResult callback(String orderSn) {
|
public AjaxResult callback(String orderNumber) {
|
||||||
//查询记录
|
//查询记录
|
||||||
CasePaymentRecord casePaymentRecord = casePaymentRecordMapper.queryRecord(orderSn);
|
CasePaymentRecord casePaymentRecord = casePaymentRecordMapper.queryRecord(orderNumber);
|
||||||
if (casePaymentRecord == null) {
|
if (casePaymentRecord == null) {
|
||||||
return AjaxResult.error("未查询到相关记录");
|
return AjaxResult.error("未查询到相关记录");
|
||||||
}
|
}
|
||||||
@@ -71,6 +75,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
|
|||||||
//更改记录表里的支付状态和支付时间
|
//更改记录表里的支付状态和支付时间
|
||||||
casePaymentRecord.setPaymentStatus(1);
|
casePaymentRecord.setPaymentStatus(1);
|
||||||
casePaymentRecord.setPaymentTime(new Date());
|
casePaymentRecord.setPaymentTime(new Date());
|
||||||
|
casePaymentRecord.setUpdateTime(new Date());
|
||||||
casePaymentRecordMapper.update(casePaymentRecord);
|
casePaymentRecordMapper.update(casePaymentRecord);
|
||||||
//根据案件id查询案件信息
|
//根据案件id查询案件信息
|
||||||
CaseApplication caseApplication = new CaseApplication();
|
CaseApplication caseApplication = new CaseApplication();
|
||||||
@@ -78,26 +83,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
|
|||||||
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
||||||
caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
|
caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
|
||||||
//修改案件状态
|
//修改案件状态
|
||||||
caseApplicationMapper.submitCaseApplication(caseApplication);
|
caseApplicationMapper.submitCaseApplication(caseApplication1);
|
||||||
//发送短信通知
|
|
||||||
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
|
||||||
List<CaseAffiliate> caseAffiliates = caseApplication1.getCaseAffiliates();//获取案件关联人信息
|
|
||||||
if (caseAffiliates!=null&&caseAffiliates.size()>0){
|
|
||||||
for (CaseAffiliate caseAffiliate : caseAffiliates) {
|
|
||||||
request.setPhone(caseAffiliate.getContactTelphone());
|
|
||||||
//获取身份类型
|
|
||||||
int identityType = caseAffiliate.getIdentityType();
|
|
||||||
if (identityType==1){ //申请人
|
|
||||||
request.setTemplateId("申请人模板id"); //传入申请人模板id
|
|
||||||
// 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置
|
|
||||||
request.setTemplateParamSet(new String[]{"模板中的参数值,如果没有则为空"});
|
|
||||||
} else { //被申请人
|
|
||||||
request.setTemplateId("被申请人模板id");
|
|
||||||
request.setTemplateParamSet(new String[]{"模板中的参数值,如果没有则为空"});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
SmsUtils.sendSms(request);
|
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
@@ -105,7 +91,28 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
|
|||||||
caseApplication.setCaseStatus(CaseApplicationConstants.EVIDENCE_CONFREMED);
|
caseApplication.setCaseStatus(CaseApplicationConstants.EVIDENCE_CONFREMED);
|
||||||
int i = caseApplicationMapper.submitCaseApplication(caseApplication);
|
int i = caseApplicationMapper.submitCaseApplication(caseApplication);
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
return AjaxResult.success();
|
//发送短信通知
|
||||||
|
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) {
|
||||||
|
request.setPhone(affiliate.getContactTelphone());
|
||||||
|
//获取身份类型
|
||||||
|
int identityType = affiliate.getIdentityType();
|
||||||
|
if (identityType == 1) { //申请人
|
||||||
|
request.setTemplateId("申请人模板id"); //传入申请人模板id
|
||||||
|
// 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置
|
||||||
|
request.setTemplateParamSet(new String[]{"模板中的参数值,如果没有则为空"});
|
||||||
|
} else { //被申请人
|
||||||
|
request.setTemplateId("被申请人模板id");
|
||||||
|
request.setTemplateParamSet(new String[]{"模板中的参数值,如果没有则为空"});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//SmsUtils.sendSms(request);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return AjaxResult.error("暂无需要确认的缴费清单");
|
return AjaxResult.error("暂无需要确认的缴费清单");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<?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">
|
||||||
|
<insert id="save">
|
||||||
|
INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note)
|
||||||
|
VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note})
|
||||||
|
</insert>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?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">
|
||||||
|
<select id="getCaseListByRespondent" resultType="CaseEvidenceVO">
|
||||||
|
select c.id, c.case_num as caseNum ,c.case_status as caseStatus,d.name as respondentName
|
||||||
|
from case_application as c ,case_affiliate as d
|
||||||
|
where c.id = d.case_appli_id and d.identity_num = #{identityNum} and identity_type = #{identityType}
|
||||||
|
and c.case_status = #{caseStatus}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -3,9 +3,18 @@
|
|||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.ruoyi.wisdomarbitrate.mapper.CasePaymentRecordMapper">
|
<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 id="saveRecord">
|
||||||
INSERT INTO case_payment_record (case_id, order_number, payment_status)
|
INSERT INTO case_payment_record (case_id, order_number, payment_status , create_time)
|
||||||
VALUES (#{caseId}, #{orderNumber}, #{paymentStatus})
|
VALUES (#{caseId}, #{orderNumber}, #{paymentStatus},#{createTime})
|
||||||
</insert>
|
</insert>
|
||||||
<update id="update">
|
<update id="update">
|
||||||
update case_payment_record
|
update case_payment_record
|
||||||
@@ -14,15 +23,16 @@
|
|||||||
<if test="orderNumber != null and orderNumber != ''">order_number = #{orderNumber},</if>
|
<if test="orderNumber != null and orderNumber != ''">order_number = #{orderNumber},</if>
|
||||||
<if test="paymentTime != null ">payment_time = #{paymentTime},</if>
|
<if test="paymentTime != null ">payment_time = #{paymentTime},</if>
|
||||||
<if test="paymentStatus != null ">payment_status = #{paymentStatus},</if>
|
<if test="paymentStatus != null ">payment_status = #{paymentStatus},</if>
|
||||||
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
||||||
</set>
|
</set>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
<select id="queryRecord" resultType="com.ruoyi.wisdomarbitrate.domain.CasePaymentRecord">
|
<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
|
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
|
from case_payment_record c
|
||||||
<where>
|
<where>
|
||||||
<if test="orderSn != null ">
|
<if test="orderNumber != null ">
|
||||||
AND c.order_number = #{orderSn}
|
AND c.order_number = #{orderNumber}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Reference in New Issue
Block a user