|
|
@@ -143,6 +143,11 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
|
|
143
|
143
|
@Transactional
|
|
144
|
144
|
@Override
|
|
145
|
145
|
public AjaxResult confirmPayment(CaseConfirmPayDTO dto) {
|
|
|
146
|
+ // 根据流程id查找当前流程节点
|
|
|
147
|
+ MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(dto.getCaseFlowId());
|
|
|
148
|
+ if (currentFlow == null) {
|
|
|
149
|
+ return AjaxResult.error("未找到当前流程节点");
|
|
|
150
|
+ }
|
|
146
|
151
|
// 根据流程id查找下一个流程节点
|
|
147
|
152
|
MsCaseFlow nextFlow = caseFlowMapper.nextFlow(dto.getCaseFlowId());
|
|
148
|
153
|
if (nextFlow == null) {
|
|
|
@@ -156,7 +161,7 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
|
|
156
|
161
|
return AjaxResult.error("该批号下未找到案件");
|
|
157
|
162
|
}
|
|
158
|
163
|
for (MsCaseApplication application : applicationList) {
|
|
159
|
|
- confirmPayment(nextFlow, application, dto);
|
|
|
164
|
+ confirmPayment(currentFlow,nextFlow, application, dto);
|
|
160
|
165
|
|
|
161
|
166
|
}
|
|
162
|
167
|
} else {
|
|
|
@@ -164,7 +169,7 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
|
|
164
|
169
|
MsCaseApplication application = new MsCaseApplication();
|
|
165
|
170
|
application.setId(dto.getCaseId());
|
|
166
|
171
|
application.setLockStatus(YesOrNoEnum.YES.getCode());
|
|
167
|
|
- confirmPayment(nextFlow, application, dto);
|
|
|
172
|
+ confirmPayment(currentFlow,nextFlow, application, dto);
|
|
168
|
173
|
|
|
169
|
174
|
}
|
|
170
|
175
|
return AjaxResult.success("确认缴费成功");
|
|
|
@@ -253,6 +258,12 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
|
|
253
|
258
|
@Transactional
|
|
254
|
259
|
@Override
|
|
255
|
260
|
public AjaxResult confirmPaid(CaseConfirmPayDTO dto) {
|
|
|
261
|
+ // 根据流程id查找当前流程节点
|
|
|
262
|
+ MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(dto.getCaseFlowId());
|
|
|
263
|
+ if (currentFlow == null) {
|
|
|
264
|
+ return AjaxResult.error("未找到当前流程节点");
|
|
|
265
|
+ }
|
|
|
266
|
+
|
|
256
|
267
|
// 根据流程id查找下一个流程节点
|
|
257
|
268
|
MsCaseFlow nextFlow = caseFlowMapper.nextFlow(dto.getCaseFlowId());
|
|
258
|
269
|
if (nextFlow == null) {
|
|
|
@@ -266,13 +277,13 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
|
|
266
|
277
|
return AjaxResult.error("该批号下未找到案件");
|
|
267
|
278
|
}
|
|
268
|
279
|
for (MsCaseApplication application : applicationList) {
|
|
269
|
|
- confirmPaid(nextFlow, application);
|
|
|
280
|
+ confirmPaid(currentFlow,nextFlow, application);
|
|
270
|
281
|
}
|
|
271
|
282
|
}else {
|
|
272
|
283
|
MsCaseApplication caseApplication=new MsCaseApplication();
|
|
273
|
284
|
caseApplication.setId(dto.getCaseId());
|
|
274
|
285
|
caseApplication.setLockStatus(YesOrNoEnum.YES.getCode());
|
|
275
|
|
- confirmPaid(nextFlow,caseApplication );
|
|
|
286
|
+ confirmPaid(currentFlow,nextFlow,caseApplication );
|
|
276
|
287
|
}
|
|
277
|
288
|
|
|
278
|
289
|
|
|
|
@@ -285,7 +296,7 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
|
|
285
|
296
|
* @param application
|
|
286
|
297
|
* @param
|
|
287
|
298
|
*/
|
|
288
|
|
- private void confirmPaid(MsCaseFlow nextFlow, MsCaseApplication application) {
|
|
|
299
|
+ private void confirmPaid(MsCaseFlow currentFlow,MsCaseFlow nextFlow, MsCaseApplication application) {
|
|
289
|
300
|
//更改记录表里的支付状态和支付时间
|
|
290
|
301
|
MsCasePaymentRecord casePaymentRecord = new MsCasePaymentRecord();
|
|
291
|
302
|
casePaymentRecord.setPaymentStatus(1);
|
|
|
@@ -300,7 +311,7 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
|
|
300
|
311
|
application.setCaseStatusName(nextFlow.getCaseStatusName());
|
|
301
|
312
|
caseApplicationMapper.updateByPrimaryKeySelective(application);
|
|
302
|
313
|
// 新增日志
|
|
303
|
|
- CaseLogUtils.insertCaseLog(application.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(),"确认已缴费");
|
|
|
314
|
+ CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"确认已缴费");
|
|
304
|
315
|
// todo 发送短信
|
|
305
|
316
|
|
|
306
|
317
|
|
|
|
@@ -314,7 +325,7 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
|
|
314
|
325
|
* @param dto
|
|
315
|
326
|
*/
|
|
316
|
327
|
|
|
317
|
|
- private void confirmPayment(MsCaseFlow nextFlow, MsCaseApplication application, CaseConfirmPayDTO dto) {
|
|
|
328
|
+ private void confirmPayment(MsCaseFlow currentFlow,MsCaseFlow nextFlow, MsCaseApplication application, CaseConfirmPayDTO dto) {
|
|
318
|
329
|
application.setPayType(dto.getPayType());
|
|
319
|
330
|
// 修改缴费附件
|
|
320
|
331
|
if (CollectionUtil.isNotEmpty(dto.getPayOrderList())) {
|
|
|
@@ -327,7 +338,7 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
|
|
327
|
338
|
application.setCaseFlowId(nextFlow.getId());
|
|
328
|
339
|
application.setCaseStatusName(nextFlow.getCaseStatusName());
|
|
329
|
340
|
caseApplicationMapper.updateByPrimaryKeySelective(application);
|
|
330
|
|
- CaseLogUtils.insertCaseLog(application.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(),"确认缴费");
|
|
|
341
|
+ CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"确认缴费");
|
|
331
|
342
|
}
|
|
332
|
343
|
|
|
333
|
344
|
|