fhx
2024-08-02 eda38da913494cbd6a3673e001809662023919e4
1.新增获取其他现金退款支付方式列表方法
1个文件已修改
49 ■■■■ 已修改文件
phi_platform_user/src/main/java/com/hx/phip/controller/refund/OrderRefundController.java 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/controller/refund/OrderRefundController.java
@@ -7,15 +7,12 @@
import com.hx.mybatisTool.SqlSentence;
import com.hx.phiappt.common.OrderTotalConstants;
import com.hx.phiappt.dao.mapper.OrdersTotalMapper;
import com.hx.phiappt.model.BaseEntity;
import com.hx.phiappt.model.Employee;
import com.hx.phiappt.model.EmployeeRole;
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.phip.service.EmployeeRoleService;
import com.hx.phip.service.EmployeeService;
import com.hx.phip.service.OrdersTotalService;
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;
@@ -41,6 +38,7 @@
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;
@@ -68,7 +66,10 @@
    private EmployeeRoleService employeeRoleService;
    @Resource
    private ConsumeNotifyService consumeNotifyService;
    @Resource
    private SystemParameterService systemParameterService;
    @Resource
    private PaymentMethodService paymentMethodService;
    /** 部分退款显示数据接口-获取可退款数量*/
@@ -431,5 +432,39 @@
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /** 获取其他现金退款支付方式列表 */
    private List<Map<String, Object>> getOtherCashRefundMethodList(){
        SystemParameter sp = systemParameterService.selectOneByName(SystemParameter.KEY_REFUND_CONFIG);
        if(sp == null || StringUtils.isEmpty(sp.getParamValue())){
            return null;
        }
        //转换vo
        RefundConfigVo refundConfig = JSONObject.parseObject(sp.getParamValue(), RefundConfigVo.class);
        if(refundConfig == null || refundConfig.getIsEnableSocrm() == null
                || refundConfig.getIsEnableSocrm() != BaseEntity.YES
                || StringUtils.isEmpty(refundConfig.getOtherCashRefundMethodNos())){
            return null;
        }
        String [] noArr = refundConfig.getOtherCashRefundMethodNos().split(",");
        List<Map<String, Object>> list = new ArrayList<>();
        Map<String, Object> dataMap;
        //遍历查询对应支付编号的支付方式
        for(String numberNo : noArr){
            PaymentMethod paymentMethod = paymentMethodService.selectNumberNo(numberNo);
            //查询不到支付方式
            if(paymentMethod == null){
                continue;
            }
            //支付方式是现金和执行金额
            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);
            }
        }
        return list;
    }
}