package com.sifang.modules.sunshine.SystemSetting.utils;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.List;
import java.util.Map;
import java.util.Objects;

import com.google.common.collect.Maps;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;
import com.sifang.modules.customer.entity.Customer;
import com.sifang.modules.customer.entity.CustomerEntry;
import com.sifang.modules.customer.entity.CustomerEntryMsg;
import com.sifang.modules.customer.form.CustomerPlanReq;
import com.sifang.modules.sys.common.UserUtils;
import com.sifang.modules.sys.common.entity.User;

public class ComUtils {


	// 获取服务商信息列表 status:0(正常)和3(停用)
	public static List<Record> getSiteList() {
		return Db.find("select a.name,a.id,a.status from crm_site a where a.status in('0','3') order by a.status asc, a.create_time desc");
	}

	// 根据siteId获取site信息
	public static Record getSiteMsg(String siteId) {
		return Db.findFirst("select a.* from crm_site a where a.id=?", siteId);
	}



	public static Map<String,String> getIpName() throws UnknownHostException
	{		Map<String,String> map = Maps.newHashMap();
		// 获取IP地址
		String ip = InetAddress.getLocalHost().getHostAddress();
		// 获取计算机名
		String name = InetAddress.getLocalHost().getHostName();
		map.put("ip",ip);
		map.put("name",name);
		//打印
		System.out.println("IP地址："+ip);
		System.err.println("计算机名："+name);
		return map;
	}

	public static void main(String[] args) {
		CustomerEntry entry = new CustomerEntry();
		Customer entryReq = new Customer();
		if (!entry.getDeliverTime().equals(entryReq.getDisableTime())) {
			System.out.println("该农户已开卡，不可修改证件失效日期-----------");
		}

		if (!Objects.equals(entry.getCreateTime(),entryReq.getDisableTime())) {
			System.out.println("该农户已开卡，不可修改证件失效日期");
		}
		System.out.println("就开始对可能可接受的跨境电商");
	}
}
