📄 agent.java
字号:
/**
* 代理人注册
*/
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -