agent.java
来自「java swing源码 欢迎下载 有问题请联系 我一定负责到底」· Java 代码 · 共 73 行
JAVA
73 行
/**
* 代理人注册
*/
package com.NCL.axis;
import org.dom4j.Element;
import com.sinosoft.common.*;
public class Agent{
public static int number;
public static String dates = "";
/**
* 代理人注册
* @param IDValue 代理人号码
* @return
*/
public Element AgentRegist(String IDValue){
Element outCustom = null;
axisTypeSearch custom = new axisTypeSearch("00011005");
String date = Data.getCurrentDate();
String time = Data.getCurrentTime();
String numbers = "00011005" + date.replaceAll("-", "");
if(date.equals(dates)&&Integer.toString(number).length()<=6){
number++;
}else{
number = 1;
dates = date;
}
numbers += getStochastic(""+number);
custom.setBaseElementIn("TransDate", date);
custom.setBaseElementIn("TransTime", time);
custom.setBaseElementIn("TransSeq", numbers);
custom.setInputElement("AgentCode", IDValue);
Element eles = custom.getOupPutElecment();
if(eles!=null){
if( eles.elementIterator().hasNext())
outCustom = (Element) eles.elementIterator().next();
}
return outCustom;
}
/**
* 根据eleName获取值
* @param ele
* @param eleName
* @return
*/
public String getElementText(Element ele,String eleName){
return ele.element(eleName).getText();
}
/**
* 构造6位序列号,不足6位的在左侧补0
* @param num
* @return
*/
private String getStochastic(String num){
String tt="";
if(num.length()<6){
for(int count=0;count<5-num.length();count++){
tt+="0";
}
}
return tt+num;
}
public static void main(String[]str){
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?