All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nbsaas.boot.pay.rest.convert.PaymentSimpleConvert Maven / Gradle / Ivy

package com.nbsaas.boot.pay.rest.convert;

import com.nbsaas.boot.pay.data.entity.Payment;
import com.nbsaas.boot.pay.api.domain.simple.PaymentSimple;

import com.nbsaas.boot.rest.api.Converter;
/**
* 列表对象转换器
*/

public class PaymentSimpleConvert implements Converter {




@Override
public PaymentSimple convert(Payment source) {
    PaymentSimple result = new PaymentSimple();

                result.setAmount(source.getAmount());
                if(source.getMethod()!=null){
                    result.setMethodName(String.valueOf(source.getMethod()));
                }
                result.setMethod(source.getMethod());
                result.setFee(source.getFee());
                result.setHandle(source.getHandle());
                if(source.getPayState()!=null){
                    result.setPayStateName(String.valueOf(source.getPayState()));
                }
                result.setPayState(source.getPayState());
                if(source.getPayConfig()!=null){
                    result.setPayConfigName(source.getPayConfig().getName());
                }
                result.setAddDate(source.getAddDate());
                result.setBussId(source.getBussId());
                result.setPayNo(source.getPayNo());
                result.setBank(source.getBank());
                if(source.getPayConfig()!=null){
                    result.setPayConfig(source.getPayConfig().getId());
                }
                result.setBussNo(source.getBussNo());
                result.setExpire(source.getExpire());
                result.setPaymentMethod(source.getPaymentMethod());
                result.setSn(source.getSn());
                result.setId(source.getId());
                result.setPaymentDate(source.getPaymentDate());
                if(source.getUser()!=null){
                    result.setUser(source.getUser().getId());
                }
                result.setAccount(source.getAccount());
                result.setLastDate(source.getLastDate());


    return result;
}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy