批量缴费 #321
+10
@@ -46,6 +46,16 @@ public class CasePaymentController {
|
|||||||
return paymentService.confirmPay(payDTO);
|
return paymentService.confirmPay(payDTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量缴费
|
||||||
|
* @param payDTO 缴费传入参数
|
||||||
|
* @return 统一响应结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/confirmPayBatch")
|
||||||
|
public AjaxResult confirmPayBatch(@Validated @RequestBody CasePayDTO payDTO) {
|
||||||
|
return paymentService.confirmPayBatch(payDTO);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 缴费确认
|
* 缴费确认
|
||||||
* @param batchCaseApplication
|
* @param batchCaseApplication
|
||||||
|
|||||||
@@ -25,4 +25,5 @@ public class CaseConfirmPayDTO {
|
|||||||
* 缴费凭证
|
* 缴费凭证
|
||||||
*/
|
*/
|
||||||
private List<CaseAttach> payOrderList;
|
private List<CaseAttach> payOrderList;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -35,4 +35,8 @@ public class CasePayDTO {
|
|||||||
* 缴费凭证
|
* 缴费凭证
|
||||||
*/
|
*/
|
||||||
private List<CaseAttach> payOrderList;
|
private List<CaseAttach> payOrderList;
|
||||||
|
/**
|
||||||
|
* 批号
|
||||||
|
*/
|
||||||
|
private String batchNumber;
|
||||||
}
|
}
|
||||||
@@ -26,4 +26,5 @@ public interface ICasePaymentService {
|
|||||||
|
|
||||||
AjaxResult casePayList(CasePayDTO casePayDTO);
|
AjaxResult casePayList(CasePayDTO casePayDTO);
|
||||||
|
|
||||||
|
AjaxResult confirmPayBatch(CasePayDTO payDTO);
|
||||||
}
|
}
|
||||||
|
|||||||
+54
@@ -20,6 +20,7 @@ import com.ruoyi.dto.PayRequest;
|
|||||||
import com.ruoyi.dto.PayResponse;
|
import com.ruoyi.dto.PayResponse;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO;
|
import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO;
|
||||||
import com.ruoyi.wisdomarbitrate.service.ICasePaymentService;
|
import com.ruoyi.wisdomarbitrate.service.ICasePaymentService;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -28,6 +29,7 @@ import java.math.BigDecimal;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static com.ruoyi.common.utils.SecurityUtils.getUsername;
|
import static com.ruoyi.common.utils.SecurityUtils.getUsername;
|
||||||
|
|
||||||
@@ -268,5 +270,57 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
|
|||||||
return AjaxResult.success(listVO);
|
return AjaxResult.success(listVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public AjaxResult confirmPayBatch(CasePayDTO payDTO) {
|
||||||
|
|
||||||
|
String batchNumber = payDTO.getBatchNumber();
|
||||||
|
CaseApplication caseApplicationsel = new CaseApplication();
|
||||||
|
caseApplicationsel.setBatchNumber(Integer.parseInt(batchNumber));
|
||||||
|
caseApplicationsel.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT);
|
||||||
|
List<CaseApplication> caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel);
|
||||||
|
List<Long> caseIds = caseApplications.stream().map(CaseApplication::getId).collect(Collectors.toList());
|
||||||
|
if(caseApplications!=null&&caseApplications.size()>0){
|
||||||
|
if (payDTO.getPayType() != null) {
|
||||||
|
payDTO.setCaseIds(caseIds);
|
||||||
|
// 修改支付方式
|
||||||
|
CaseConfirmPayDTO caseConfirmPayDTO = new CaseConfirmPayDTO();
|
||||||
|
BeanUtils.copyProperties(payDTO, caseConfirmPayDTO);
|
||||||
|
caseApplicationMapper.updatePayType(caseConfirmPayDTO);
|
||||||
|
}
|
||||||
|
for (Long caseId : caseIds) {
|
||||||
|
if (CollectionUtil.isNotEmpty(payDTO.getPayOrderList())) {
|
||||||
|
for (CaseAttach caseAttach : payDTO.getPayOrderList()) {
|
||||||
|
caseAttach.setCaseAppliId(caseId);
|
||||||
|
caseAttachMapper.updateCaseAttach(caseAttach);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改节点状态
|
||||||
|
//根据案件id查询案件信息
|
||||||
|
CaseApplication caseApplication = new CaseApplication();
|
||||||
|
caseApplication.setId(caseId);
|
||||||
|
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
||||||
|
caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
|
||||||
|
//修改案件状态
|
||||||
|
int i = caseApplicationMapper.submitCaseApplication(caseApplication1);
|
||||||
|
if (i > 0) {
|
||||||
|
// 修改支付状态
|
||||||
|
CasePaymentRecord paymentRecord = new CasePaymentRecord();
|
||||||
|
paymentRecord.setPayType(payDTO.getPayType());
|
||||||
|
paymentRecord.setCaseId(caseId);
|
||||||
|
paymentRecord.setPaymentStatus(1);
|
||||||
|
casePaymentRecordMapper.saveRecord(paymentRecord);
|
||||||
|
// 新增日志
|
||||||
|
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT_CONFIRM, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return AjaxResult.success("确认缴费成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user