package com.thinkgem.jeesite.common.utils;

import com.thinkgem.jeesite.common.constant.ComCode;
import com.thinkgem.jeesite.modules.pay.juhezhong.dto.JuhezhongBaseDto;
import com.thinkgem.jeesite.modules.pay.juhezhong.utils.Bean2Map;
import com.thinkgem.jeesite.modules.pay.juhezhong.utils.SignUtils;
import java.util.Map;

public class JuhezhongUtils {

    public static Map<String,Object> juhezhongBaseDtoToMap(JuhezhongBaseDto dto){
        Map<String, Object> params = Bean2Map.Entity2Map(dto);
        String signBefore = SignUtils.signBefore(params);
        String sign = null;
        try {
            sign = SignUtils.sign(signBefore, ComCode.MERCHANT_SECRET);
        } catch (Exception e) {
            e.printStackTrace();
        }
        params.put("sign", sign);
        return params;
    }
}
