|
|
@@ -20,6 +20,7 @@ import com.ruoyi.dto.PayRequest;
|
|
20
|
20
|
import com.ruoyi.dto.PayResponse;
|
|
21
|
21
|
import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO;
|
|
22
|
22
|
import com.ruoyi.wisdomarbitrate.service.ICasePaymentService;
|
|
|
23
|
+import org.springframework.beans.BeanUtils;
|
|
23
|
24
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
24
|
25
|
import org.springframework.stereotype.Service;
|
|
25
|
26
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
@@ -28,6 +29,7 @@ import java.math.BigDecimal;
|
|
28
|
29
|
import java.util.ArrayList;
|
|
29
|
30
|
import java.util.Date;
|
|
30
|
31
|
import java.util.List;
|
|
|
32
|
+import java.util.stream.Collectors;
|
|
31
|
33
|
|
|
32
|
34
|
import static com.ruoyi.common.utils.SecurityUtils.getUsername;
|
|
33
|
35
|
|
|
|
@@ -268,5 +270,57 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
|
|
268
|
270
|
return AjaxResult.success(listVO);
|
|
269
|
271
|
}
|
|
270
|
272
|
|
|
|
273
|
+ @Override
|
|
|
274
|
+ @Transactional
|
|
|
275
|
+ public AjaxResult confirmPayBatch(CasePayDTO payDTO) {
|
|
|
276
|
+
|
|
|
277
|
+ String batchNumber = payDTO.getBatchNumber();
|
|
|
278
|
+ CaseApplication caseApplicationsel = new CaseApplication();
|
|
|
279
|
+ caseApplicationsel.setBatchNumber(Integer.parseInt(batchNumber));
|
|
|
280
|
+ caseApplicationsel.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT);
|
|
|
281
|
+ List<CaseApplication> caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel);
|
|
|
282
|
+ List<Long> caseIds = caseApplications.stream().map(CaseApplication::getId).collect(Collectors.toList());
|
|
|
283
|
+ if(caseApplications!=null&&caseApplications.size()>0){
|
|
|
284
|
+ if (payDTO.getPayType() != null) {
|
|
|
285
|
+ payDTO.setCaseIds(caseIds);
|
|
|
286
|
+ // 修改支付方式
|
|
|
287
|
+ CaseConfirmPayDTO caseConfirmPayDTO = new CaseConfirmPayDTO();
|
|
|
288
|
+ BeanUtils.copyProperties(payDTO, caseConfirmPayDTO);
|
|
|
289
|
+ caseApplicationMapper.updatePayType(caseConfirmPayDTO);
|
|
|
290
|
+ }
|
|
|
291
|
+ for (Long caseId : caseIds) {
|
|
|
292
|
+ if (CollectionUtil.isNotEmpty(payDTO.getPayOrderList())) {
|
|
|
293
|
+ for (CaseAttach caseAttach : payDTO.getPayOrderList()) {
|
|
|
294
|
+ caseAttach.setCaseAppliId(caseId);
|
|
|
295
|
+ caseAttachMapper.updateCaseAttach(caseAttach);
|
|
|
296
|
+ }
|
|
|
297
|
+ }
|
|
|
298
|
+
|
|
|
299
|
+ // 修改节点状态
|
|
|
300
|
+ //根据案件id查询案件信息
|
|
|
301
|
+ CaseApplication caseApplication = new CaseApplication();
|
|
|
302
|
+ caseApplication.setId(caseId);
|
|
|
303
|
+ CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
|
|
304
|
+ caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
|
|
|
305
|
+ //修改案件状态
|
|
|
306
|
+ int i = caseApplicationMapper.submitCaseApplication(caseApplication1);
|
|
|
307
|
+ if (i > 0) {
|
|
|
308
|
+ // 修改支付状态
|
|
|
309
|
+ CasePaymentRecord paymentRecord = new CasePaymentRecord();
|
|
|
310
|
+ paymentRecord.setPayType(payDTO.getPayType());
|
|
|
311
|
+ paymentRecord.setCaseId(caseId);
|
|
|
312
|
+ paymentRecord.setPaymentStatus(1);
|
|
|
313
|
+ casePaymentRecordMapper.saveRecord(paymentRecord);
|
|
|
314
|
+ // 新增日志
|
|
|
315
|
+ CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT_CONFIRM, "");
|
|
|
316
|
+ }
|
|
|
317
|
+
|
|
|
318
|
+ }
|
|
|
319
|
+
|
|
|
320
|
+ }
|
|
|
321
|
+
|
|
|
322
|
+ return AjaxResult.success("确认缴费成功");
|
|
|
323
|
+ }
|
|
|
324
|
+
|
|
271
|
325
|
|
|
272
|
326
|
}
|