| | |
| | | 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; |
| | |
| | | OrderRefundDto returnMap = orderRefundService.nextStep(ordersTotal,orderRefundDto); |
| | | returnMap.setRefundPayMethod(returnMap.getPayMethodList()); |
| | | returnMap.setCouponList(returnMap.getPayCouponList()); |
| | | //处理其他现金退款支付方式列表 |
| | | handleOtherCashRefundMethodList(returnMap.getRefundPayMethod()); |
| | | |
| | | return Result.success(returnMap); |
| | | } |
| | | |
| | |
| | | |
| | | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| | | |
| | | /** 获取其他现金退款支付方式列表 */ |
| | | private List<Map<String, Object>> getOtherCashRefundMethodList(){ |
| | | /** 处理其他现金退款支付方式列表 */ |
| | | private void handleOtherCashRefundMethodList(List<OrderPayMethodDto> refundPayMethodList){ |
| | | SystemParameter sp = systemParameterService.selectOneByName(SystemParameter.KEY_REFUND_CONFIG); |
| | | if(sp == null || StringUtils.isEmpty(sp.getParamValue())){ |
| | | return null; |
| | | return; |
| | | } |
| | | |
| | | //转换vo |
| | |
| | | if(refundConfig == null || refundConfig.getIsEnableSocrm() == null |
| | | || refundConfig.getIsEnableSocrm() != BaseEntity.YES |
| | | || StringUtils.isEmpty(refundConfig.getOtherCashRefundMethodNos())){ |
| | | return null; |
| | | return; |
| | | } |
| | | |
| | | String [] noArr = refundConfig.getOtherCashRefundMethodNos().split(","); |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | Map<String, Object> dataMap; |
| | | List<OrderPayMethodDto> otherRefundMethodList = new ArrayList<>(); |
| | | //遍历查询对应支付编号的支付方式 |
| | | for(String numberNo : noArr){ |
| | | PaymentMethod paymentMethod = paymentMethodService.selectNumberNo(numberNo); |
| | |
| | | } |
| | | //支付方式是现金和执行金额 |
| | | if(paymentMethod.getIsMoneyPay() == BaseEntity.YES && paymentMethod.getIsExecute() == BaseEntity.YES){ |
| | | dataMap = new HashMap<>(); |
| | | dataMap.put("payMethodNo", paymentMethod.getNumberNo()); |
| | | dataMap.put("payMethodName", paymentMethod.getName()); |
| | | list.add(dataMap); |
| | | OrderPayMethodDto orderPayMethodDto = new OrderPayMethodDto(); |
| | | orderPayMethodDto.setPayMethodNo(paymentMethod.getNumberNo()); |
| | | orderPayMethodDto.setPayMethodName(paymentMethod.getName()); |
| | | orderPayMethodDto.setIsMoneyPay(paymentMethod.getIsMoneyPay()); |
| | | orderPayMethodDto.setIsExecute(paymentMethod.getIsExecute()); |
| | | otherRefundMethodList.add(orderPayMethodDto); |
| | | } |
| | | } |
| | | return list; |
| | | |
| | | //再遍历原支付方式,是现金和执行金额才赋值其他配置的支付方式退款 |
| | | for(OrderPayMethodDto payMethodDto : refundPayMethodList){ |
| | | if(payMethodDto.getIsMoneyPay() == BaseEntity.YES && payMethodDto.getIsExecute() == BaseEntity.YES){ |
| | | payMethodDto.setOtherRefundMethodList(otherRefundMethodList); |
| | | } |
| | | } |
| | | } |
| | | } |