⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 basicinfoupdate.java

📁 java swing源码 欢迎下载 有问题请联系 我一定负责到底
💻 JAVA
字号:
/**
 * 基本信息更新
 */
package com.NCL.axis;

import java.util.HashMap;
import java.util.HashSet;
import org.dom4j.Element;
import com.sinosoft.common.Data;

public class BasicInfoUpdate{

	public static int number;
	public static String dates = "";
	protected HashMap propList;	
	protected HashSet Property;
	public String inputXML;
	public String outputXML;
	/**
	 * 构造函数
	 *
	 */
	public BasicInfoUpdate(){
		propList=new HashMap();
		Property=new HashSet();
		Property.add("EdorChangeNo");		//客户号
		Property.add("CustomerNo");		//客户号
		Property.add("EdorType");		//保全变更类型
		Property.add("EdorAppName");	//申请人
		Property.add("AppType");		//申请方式
		Property.add("Province");		//省代码
		Property.add("City");			//市代码
		Property.add("County");			//区/县代码
		Property.add("Street");			//街道
		Property.add("ZipCode");		//邮政编码
		Property.add("Mobile");			//移动电话
		Property.add("CompanyPhone");	//办公电话
		Property.add("HomePhone");		//住宅电话
		Property.add("Email");			//电子邮箱
		Property.add("PostalAddress");	//工作单位
	}
	/**
	 * 基本信息更新
	 * @return
	 */
	public Element ContChargeSearch(){
		Element outCustom = null;
		axisType custom = new axisType("00011015");
		String date = Data.getCurrentDate();
		String time = Data.getCurrentTime();
		String numbers = "00011015" + date.replaceAll("-", "");
		if(date.equals(dates)&&Integer.toString(number).length()<=5){
			number++;
		}else{
			number = 1;
			dates = date;
		}
		numbers += getStochastic(""+number);
		custom.setBaseElementIn("TransDate", date);
		custom.setBaseElementIn("TransTime", time);
		custom.setBaseElementIn("TransSeq", numbers);
		custom.setInputElement("EdorChangeNo", get("EdorChangeNo"));
		custom.setInputElement("CustomerNo", get("CustomerNo"));
		custom.setInputElement("EdorType", get("EdorType"));
		custom.setInputElement("EdorAppName", get("EdorAppName"));
		custom.setInputElement("AppType", get("AppType"));
		custom.setInputElement("EdorAppDate", Data.getCurrentDate());
		//if(Data.hasValue(get("Province")))
			custom.setInputElement("Province", get("Province"));
		//if(Data.hasValue(get("City")))
			custom.setInputElement("City", get("City"));
//		if(Data.hasValue(get("County")))
			custom.setInputElement("County", get("County"));
//		if(Data.hasValue(get("Street")))
			custom.setInputElement("Street", get("Street"));
//		if(Data.hasValue(get("ZipCode")))
			custom.setInputElement("ZipCode", get("ZipCode"));
//		if(Data.hasValue(get("Mobile")))
			custom.setInputElement("Mobile", get("Mobile"));
//		if(Data.hasValue(get("CompanyPhone")))
			custom.setInputElement("CompanyPhone", get("CompanyPhone"));
//		if(Data.hasValue(get("HomePhone")))
			custom.setInputElement("HomePhone", get("HomePhone"));
//		if(Data.hasValue(get("Email")))
			custom.setInputElement("Email", get("Email"));
//		if(Data.hasValue(get("PostalAddress")))
		Element eles = custom.getOupPutElecment();
		if(eles!=null){
		outCustom = (Element) eles.elementIterator().next();
		}
		this.inputXML = custom.getInputXML();
		this.outputXML = custom.getOutputXML();
		return outCustom;
	}
	/**
	 * 赋值
	 * @param name
	 * @param value
	 * @return
	 */
	public boolean set(String name, String value){
		if(Property.contains(name)){
			propList.put(name,value);
			return true;
		}else
			return false;		
	}
	/**
	 * 获取与name对应的值
	 * @param name
	 * @return
	 */
	public String get(String name){
		String value = "";
		if (Property.contains(name)){
			value = (String)propList.get(name);
			if(value == null){
				value = "";
			}			
		}
		return value;
	}
	/**
	 * 清空propList
	 */
	public void clear(){
		propList.clear();
	}
	/**
	 * 根据eleName获取值
	 * @param ele 
	 * @param eleName
	 * @return
	 */
	public String getElementText(Element ele,String eleName){
		return ele.element(eleName).getText();
	}
	/**
	 * 构造5位序列号,不足5位的在左侧补0
	 * @param num
	 * @return String
	 */
	private String getStochastic(String num){
		String tt="";
		if(num.length()<5){
			for(int count=0;count<5-num.length();count++){
				tt+="0";
			}
		}
		return tt+num;
	}
	
	public static void main(String[]sdf){
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -