fhx
2024-08-02 877df89dc54fcded5ffe6f8a440445b6f66ff58f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
package com.hx.phip.controller.refund;
 
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hx.common.service.CommonService;
import com.hx.exception.TipsException;
import com.hx.mybatisTool.SqlSentence;
import com.hx.phiappt.common.OrderTotalConstants;
import com.hx.phiappt.dao.mapper.OrdersTotalMapper;
import com.hx.phiappt.model.*;
import com.hx.phiappt.model.consume.ConsumeNotify;
import com.hx.phiappt.model.order.OrdersTotal;
import com.hx.phiappt.model.refund.RefundRecord;
import com.hx.phiappt.vo.system.config.RefundConfigVo;
import com.hx.phip.service.*;
import com.hx.phip.service.consume.ConsumeNotifyService;
import com.hx.phip.service.order.OrderRefundService;
import com.hx.phip.service.refund.RefundRecordService;
import com.hx.phip.tool.payment.ConsumeTool;
import com.hx.resultTool.Result;
import com.hx.util.StringUtils;
import com.hz.his.dto.order.OrderPayMethodDto;
import com.hz.his.dto.order.OrderRefundDto;
import com.hz.his.dto.refund.RefundPreferentialDto;
import com.hz.his.vo.order.refund.RefundCancelVo;
import com.hz.his.vo.order.refund.qr.RefundQrVo;
import com.platform.constants.LoginConstant;
import com.platform.entity.ThirtApplication;
import com.platform.exception.PlatTipsException;
import com.platform.resultTool.PlatformCode;
import com.platform.resultTool.PlatformResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
 
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
/**
 * @Author  部分退款工具类
 */
@RestController
@RequestMapping("/order")
public class OrderRefundController {
 
    private static final Logger logger = LoggerFactory.getLogger(OrderRefundController.class);
 
    @Resource
    private OrderRefundService orderRefundService;
    @Resource
    private CommonService commonService;
    @Resource
    private OrdersTotalService ordersTotalService;
    @Resource
    private RefundRecordService refundRecordService;
    @Resource
    private EmployeeService employeeService;
    @Resource
    private EmployeeRoleService employeeRoleService;
    @Resource
    private ConsumeNotifyService consumeNotifyService;
    @Resource
    private SystemParameterService systemParameterService;
    @Resource
    private PaymentMethodService paymentMethodService;
 
 
    /** 部分退款显示数据接口-获取可退款数量*/
    @RequestMapping("/refund/details")
    public Result refundDetails(@RequestBody OrderRefundDto orderRefundDto){
        if (StringUtils.isEmpty(orderRefundDto.getOrderId())) {
            throw new TipsException("订单标识为空!");
        }
        OrdersTotal ordersTotal = ordersTotalService.selectOneByKey(orderRefundDto.getOrderId());
        if (ordersTotal == null) {
            throw new TipsException("订单标识错误!");
        }
        if(ordersTotal.getIsDel().equals(OrdersTotal.YES)){
            throw new TipsException("订单处于删除状态!");
        }
 
        if (OrderTotalConstants.TYPE_RECHARGE.equals(ordersTotal.getType())) {
            throw new TipsException("充值订单不支持部分退款!");
        }
 
        if(OrderTotalConstants.PAY_STATUS_SUC != ordersTotal.getPayStatus()){
            throw new TipsException("订单未支付!");
        }
 
        if(OrderTotalConstants.STATUS_PAY != ordersTotal.getStatus()
                && OrderTotalConstants.STATUS_WAIT_RECEIVE != ordersTotal.getStatus()
                && OrderTotalConstants.STATUS_DONE != ordersTotal.getStatus()){
            throw new TipsException("当前订单状态不能退款!");
        }
 
        if(OrderTotalConstants.STATUS_REFUND_NONE != ordersTotal.getRefundStatus()
                && OrderTotalConstants.STATUS_REFUND_PART != ordersTotal.getRefundStatus()){
            throw new TipsException("订单退款状态不正确!");
        }
 
        //返回集合
        Map<String, Object> returnMap = new HashMap<>();
        returnMap.put("details",ordersTotal);
        List<Map<String, Object>> refundDetails=orderRefundService.refundDetails(ordersTotal);
        returnMap.put("refundDetails",refundDetails);
 
        return Result.success(returnMap);
    }
 
    /** 选完数量点击下一步显示数据接口 */
    @RequestMapping("/refund/nextStep")
    public Result nextStep(@RequestBody OrderRefundDto orderRefundDto){
        if (StringUtils.isEmpty(orderRefundDto.getOrderId())) {
            throw new TipsException("订单标识为空!");
        }
        if (orderRefundDto.getRefundList()==null) {
            throw new TipsException("退款信息集合为空!");
        }
        SqlSentence sqlSentence = new SqlSentence();
        Map<String, Object> sqlMap = new HashMap<>();
        sqlSentence.setM(sqlMap);
        sqlMap.put("isDel", BaseEntity.NO);
        sqlMap.put("orderId", orderRefundDto.getOrderId());
 
        sqlSentence.setSqlSentence("SELECT * FROM  orders_total WHERE id = #{m.orderId} and isDel = #{m.isDel} ");
        OrdersTotal ordersTotal = ordersTotalService.selectOne(sqlSentence);
        if (ordersTotal == null) {
            throw new TipsException("订单标识错误!");
        }
        if (OrderTotalConstants.TYPE_RECHARGE.equals(ordersTotal.getType())) {
            throw new TipsException("充值订单不支持部分退款!");
        }
        if(OrderTotalConstants.PAY_STATUS_SUC != ordersTotal.getPayStatus()){
            throw new TipsException("订单未支付!");
        }
 
        if(OrderTotalConstants.STATUS_PAY != ordersTotal.getStatus()
                && OrderTotalConstants.STATUS_WAIT_RECEIVE != ordersTotal.getStatus()
                && OrderTotalConstants.STATUS_DONE != ordersTotal.getStatus()){
            throw new TipsException("当前订单状态不能退款!");
        }
 
        if(OrderTotalConstants.STATUS_REFUND_NONE != ordersTotal.getRefundStatus()
                && OrderTotalConstants.STATUS_REFUND_PART != ordersTotal.getRefundStatus()){
            throw new TipsException("订单退款状态不正确!");
        }
 
        //返回集合
        OrderRefundDto returnMap = orderRefundService.nextStep(ordersTotal,orderRefundDto);
        returnMap.setRefundPayMethod(returnMap.getPayMethodList());
        returnMap.setCouponList(returnMap.getPayCouponList());
        //处理其他现金退款支付方式列表
        handleOtherCashRefundMethodList(returnMap.getRefundPayMethod());
 
        return Result.success(returnMap);
    }
 
    /**
     * 部分退款
     */
    @RequestMapping(value = "/partial/refund",method = RequestMethod.POST)
    public PlatformResult partRefund(HttpServletRequest request, @RequestBody OrderRefundDto orderRefundDto)  {
        //操作平台
        ThirtApplication thirtApplication = (ThirtApplication) request.getSession().getAttribute(LoginConstant.LOGIN_APPLY);
        if(thirtApplication==null){
            throw new PlatTipsException(PlatformCode.ERROR_TIPS,"签名失败,请检查签名!");
        }
 
        if(StringUtils.isEmpty(orderRefundDto.getOrderId())){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"订单标识不能为空");
        }
 
        if(StringUtils.isEmpty(orderRefundDto.getRoleId())){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"操作角色标识不能为空");
        }
        if(StringUtils.isEmpty(orderRefundDto.getOperatorId())){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"操作员工标识不能为空");
        }
 
        if(orderRefundDto.getIsApproval()==null){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"是否需要审批不能为空");
        }
 
        if(orderRefundDto.getIsRefund() == null){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"是否自动生成退款单不能为空");
        }
        if(orderRefundDto.getRefundStatistics() == null){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"退款统计类型不能为空!");
        }
 
        OrdersTotal ordersTotal = ordersTotalService.selectOneByKey(orderRefundDto.getOrderId());
        if (ordersTotal == null) {
            throw new PlatTipsException(PlatformCode.ERROR_TIPS,"订单标识错误!");
        }
        if(ordersTotal.getIsDel().equals(OrdersTotal.YES)){
            throw new PlatTipsException(PlatformCode.ERROR_TIPS,"订单已删除!");
        }
        if (OrderTotalConstants.TYPE_RECHARGE.equals(ordersTotal.getType())) {
            throw new TipsException("充值订单不支持部分退款!");
        }
 
 
        orderRefundDto.setRefundOperationType(BaseEntity.YES);
        return orderRefundService.partRefund(ordersTotal,orderRefundDto,thirtApplication);
    }
 
    /**
     * 全部退款
     */
    @RequestMapping(value = "/whole/refund",method = RequestMethod.POST)
    public PlatformResult wholeRefund(HttpServletRequest request,@RequestBody OrderRefundDto orderRefundDto)  {
        //操作平台
        ThirtApplication thirtApplication= (ThirtApplication) request.getSession().getAttribute(LoginConstant.LOGIN_APPLY);
        if(thirtApplication==null){
            throw new PlatTipsException(PlatformCode.ERROR_TIPS,"签名失败,请检查签名!");
        }
 
        if(StringUtils.isEmpty(orderRefundDto.getOrderId())){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"订单id不能为空");
        }
        if(StringUtils.isEmpty(orderRefundDto.getOperatorId())){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"操作人不能为空");
        }
        if(orderRefundDto.getIsApproval()==null){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"是否需要审批不能为空");
        }
        if(orderRefundDto.getIsRefund()==null){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"是否自动生成退款单不能为空");
        }
        if(orderRefundDto.getRefundStatistics() == null){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"退款统计类型不能为空!");
        }
 
        SqlSentence sqlSentence = new SqlSentence();
        Map<String, Object> sqlMap = new HashMap<>();
        sqlSentence.setM(sqlMap);
        sqlMap.put("isDel", BaseEntity.NO);
        sqlMap.put("id", orderRefundDto.getOrderId());
        sqlSentence.setSqlSentence("SELECT * FROM orders_total  WHERE id = #{m.id}  and  isDel = #{m.isDel} ");
        OrdersTotal ordersTotal = commonService.selectOne(OrdersTotalMapper.class, sqlSentence);
        if (ordersTotal == null) {
            throw new TipsException("订单标识错误!");
        }
        if(!(OrderTotalConstants.PAY_STATUS_SUC==ordersTotal.getPayStatus())){
            throw new TipsException("订单未支付!");
        }
        if(!(OrderTotalConstants.STATUS_PAY==ordersTotal.getStatus())  && !(OrderTotalConstants.STATUS_WAIT_RECEIVE==ordersTotal.getStatus()) && !(OrderTotalConstants.STATUS_DONE==ordersTotal.getStatus())){
            throw new TipsException("订单不是已支付状态!");
        }
 
        if(OrderTotalConstants.STATUS_REFUND_NONE!=ordersTotal.getRefundStatus()){
            throw new TipsException("订单退款状态不正确!");
        }
 
        return orderRefundService.wholeRefund(orderRefundDto,thirtApplication);
    }
 
    /**
     * 伪造部分退款处理退款逻辑
     *
     */
    /*@RequestMapping(value = "/forge/partial/refund",method = RequestMethod.POST)*/
//    public PlatformResult forgePartRefund(@RequestBody OrderRefundDto orderRefundDto)  {
//        if(StringUtils.isEmpty(orderRefundDto.getOrderId())){
//            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"订单id不能为空");
//        }
//        if(StringUtils.isEmpty(orderRefundDto.getOperatorId())){
//            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"操作人不能为空");
//        }
//        if(orderRefundDto.getIsApproval()==null){
//            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"是否需要审批不能为空");
//        }
//        if(orderRefundDto.getIsRefund()==null){
//            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"是否自动生成退款单不能为空");
//        }
//        SqlSentence sqlSentence = new SqlSentence();
//        Map<String, Object> sqlMap = new HashMap<>();
//        sqlSentence.setM(sqlMap);
//        sqlMap.put("isDel", BaseEntity.NO);
//        sqlMap.put("id", orderRefundDto.getOrderId());
//        sqlSentence.setSqlSentence("SELECT * FROM orders_total  WHERE id = #{m.id}  and  isDel = #{m.isDel} ");
//        OrdersTotal ordersTotal = commonService.selectOne(OrdersTotalMapper.class, sqlSentence);
//        if (ordersTotal == null) {
//            throw new TipsException("订单标识错误!");
//        }
//        if(!(OrderTotalConstants.PAY_STATUS_SUC==ordersTotal.getPayStatus())){
//            throw new TipsException("订单未支付!");
//        }
//        if(!(OrderTotalConstants.STATUS_PAY==ordersTotal.getStatus())  && !(OrderTotalConstants.STATUS_WAIT_RECEIVE==ordersTotal.getStatus()) && !(OrderTotalConstants.STATUS_DONE==ordersTotal.getStatus())){
//            throw new TipsException("订单不是已支付状态!");
//        }
//
//        if(!(OrderTotalConstants.STATUS_REFUND_NONE==ordersTotal.getRefundStatus()) &&
//                !(OrderTotalConstants.STATUS_REFUND_PART==ordersTotal.getRefundStatus())){
//            throw new TipsException("订单退款状态不正确!");
//        }
//     /*   if (OrderTotalConstants.TYPE_RECHARGE.equals(ordersTotal.getType())) {
//            throw new TipsException("充值订单不支持部分退款!");
//        }*/
//        orderRefundDto.setRefundOperationType(BaseEntity.YES);
//        return orderRefundService.forgePartRefund(orderRefundDto);
//    }
 
 
    /**
     * 根据订单 重新绑定订单退款状态
     *
     */
    @RequestMapping(value = "/verify/order/refundStatus",method = RequestMethod.POST)
    public PlatformResult verifyOrderRefundStatus(@RequestBody OrdersTotal ordersTotalDto)  {
        if(ordersTotalDto==null){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"参数不能为空!");
        }
        if(StringUtils.isEmpty(ordersTotalDto.getId())){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"订单id不能为空");
        }
        orderRefundService.verifyOrderRefundStatus(ordersTotalDto);
        return PlatformResult.success();
    }
 
    /**
     * 作废订单退款单
     *
     */
    @RequestMapping(value = "/refund/cancel",method = RequestMethod.POST)
    public PlatformResult refundCancel(HttpServletRequest request,@RequestBody RefundCancelVo refundCancelVo)  {
        //操作平台
        ThirtApplication thirtApplication= (ThirtApplication) request.getSession().getAttribute(LoginConstant.LOGIN_APPLY);
        if(thirtApplication==null){
            throw new PlatTipsException(PlatformCode.ERROR_TIPS,"未获取到操作平台!");
        }
 
        if(StringUtils.isEmpty(refundCancelVo.getId())){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"退款单标识必传!");
        }
        RefundRecord refundRecord = refundRecordService.selectOneByKey(refundCancelVo.getId());
        if(refundRecord == null){
            throw new PlatTipsException(PlatformCode.ERROR_TIPS,"退款单标识错误!");
        }
        if(StringUtils.isEmpty(refundCancelVo.getRemarks())){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"作废备注必填!");
        }
        if(StringUtils.isEmpty(refundCancelVo.getStaffId())){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"操作员工必填!");
        }
        Employee employee = employeeService.selectOneByKey(refundCancelVo.getStaffId());
        if(employee == null){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"操作员工标识错误!");
        }
        if(StringUtils.isEmpty(refundCancelVo.getStaffRoleId())){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"操作员工角色必填!");
        }
        EmployeeRole employeeRole = employeeRoleService.getEmployeeRole(refundCancelVo.getStaffRoleId());
        if(employeeRole == null){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"操作员工角色标识错误!");
        }
 
        orderRefundService.refundCancel(refundCancelVo,refundRecord,employee,employeeRole,thirtApplication);
        return PlatformResult.success();
    }
 
    /**
     * 订单二维码调起退款
     * 针对未支付的订单,但是已经使用了订单二维码支付
     * 只能全部退款,不能部分退款,逻辑删除支付回调记录
     */
    @RequestMapping(value = "/qr/refund",method = RequestMethod.POST)
    public PlatformResult orderQrRefund(HttpServletRequest request,@RequestBody RefundQrVo refundQrVo)  {
        logger.info("订单二维码调起退款数据:{}", JSON.toJSONString(refundQrVo));
 
        //操作平台
        ThirtApplication thirtApplication= (ThirtApplication) request.getSession().getAttribute(LoginConstant.LOGIN_APPLY);
        if(thirtApplication==null){
            throw new PlatTipsException(PlatformCode.ERROR_TIPS,"未获取到操作平台!");
        }
        logger.info("订单二维码调起退款操作平台:{},{},{}", thirtApplication.getAppId(),thirtApplication.getName(),thirtApplication.getAppIdCode());
 
        if(StringUtils.isEmpty(refundQrVo.getOrderId())){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"订单标识必传!");
        }
        if(refundQrVo.getRefundTotal() == null){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"退款金額!");
        }
        if(refundQrVo.getRefundTotal().compareTo(BigDecimal.ZERO) < 1){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"退款金額错误!");
        }
        if(StringUtils.isEmpty(refundQrVo.getPayNo())){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"支付订单编号必传!");
        }
 
        //找到回调信息
        ConsumeNotify consumeNotify = ConsumeTool.selectConsumeNotifyByOrderNo(refundQrVo.getOrderId(),refundQrVo.getPayNo(),refundQrVo.getPayNo(),commonService);
        if(consumeNotify == null){
            throw new TipsException("未找到支付记录!");
        }
 
        return PlatformResult.success( consumeNotifyService.consumeNotifyRefund(consumeNotify,refundQrVo));
    }
 
    /**退款前逻辑检查 */
    @RequestMapping("/reufnd/afrer/check")
    public Result refundAfterCheck(@RequestBody OrderRefundDto dto){
 
        if(StringUtils.isEmpty(dto.getOrderId())){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"订单标识必传!");
        }
 
        OrdersTotal ordersTotal = commonService.selectOneByKey(OrdersTotalMapper.class, dto.getOrderId());
        if(ordersTotal == null){
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL, "查询不到订单信息!");
        }
 
        RefundPreferentialDto refundPreferentialDto = orderRefundService.handleRefundPreferentialData(dto, ordersTotal.getUserId());
 
        JSONObject data = new JSONObject();
        if(refundPreferentialDto != null && refundPreferentialDto.getCouponTipsList() != null && refundPreferentialDto.getCouponTipsList().size() > 0){
            StringBuilder sb = new StringBuilder();
            for(String tips : refundPreferentialDto.getCouponTipsList()){
                sb.append(tips).append(";");
            }
            sb.delete(sb.length() - 1, sb.length());
            sb.append(",这些优惠券已被使用,是否确认退款!");
            data.put("couponUseTips", sb.toString());
        }
 
        return Result.success(data);
    }
 
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
    /** 处理其他现金退款支付方式列表 */
    private void handleOtherCashRefundMethodList(List<OrderPayMethodDto> refundPayMethodList){
        SystemParameter sp = systemParameterService.selectOneByName(SystemParameter.KEY_REFUND_CONFIG);
        if(sp == null || StringUtils.isEmpty(sp.getParamValue())){
            return;
        }
 
        //转换vo
        RefundConfigVo refundConfig = JSONObject.parseObject(sp.getParamValue(), RefundConfigVo.class);
        if(refundConfig == null || refundConfig.getIsEnableSocrm() == null
                || refundConfig.getIsEnableSocrm() != BaseEntity.YES
                || StringUtils.isEmpty(refundConfig.getOtherCashRefundMethodNos())){
            return;
        }
 
        String [] noArr = refundConfig.getOtherCashRefundMethodNos().split(",");
        List<OrderPayMethodDto> otherRefundMethodList = new ArrayList<>();
        //遍历查询对应支付编号的支付方式
        for(String numberNo : noArr){
            PaymentMethod paymentMethod = paymentMethodService.selectNumberNo(numberNo);
            //查询不到支付方式
            if(paymentMethod == null){
                continue;
            }
            //支付方式是现金和执行金额
            if(paymentMethod.getIsMoneyPay() == BaseEntity.YES && paymentMethod.getIsExecute() == BaseEntity.YES){
                OrderPayMethodDto orderPayMethodDto = new OrderPayMethodDto();
                orderPayMethodDto.setPayMethodNo(paymentMethod.getNumberNo());
                orderPayMethodDto.setPayMethodName(paymentMethod.getName());
                orderPayMethodDto.setIsMoneyPay(paymentMethod.getIsMoneyPay());
                orderPayMethodDto.setIsExecute(paymentMethod.getIsExecute());
                otherRefundMethodList.add(orderPayMethodDto);
            }
        }
 
        //再遍历原支付方式,是现金和执行金额才赋值其他配置的支付方式退款
        for(OrderPayMethodDto payMethodDto : refundPayMethodList){
            if(payMethodDto.getIsMoneyPay() == BaseEntity.YES && payMethodDto.getIsExecute() == BaseEntity.YES){
                payMethodDto.setOtherRefundMethodList(otherRefundMethodList);
            }
        }
    }
}