因为要和银行方进行通信,所以接口通信传参就需要实现定长报文,小小的吐槽一下,最开始是json传参方式到改为xml,刚写好xml还没有试试就通知要改为定长报文,也就我脾气好,真想骂爹,骂娘,但是时间有限还是得实现啊,但是网上资料又不多,最终一点点摸索弄出来了。
首先定长报文是指像json格式那种key,value有字段有值的方式,定长报文就是String拼接的vlaue值,而没有key了,那么你就想了那我解析值或者取值怎么取我想要的对应的值呢,其实定长报文么,顾名思义就是没有了key就把值的长度固定了呀,举个例子:
json:{"id":1,"name":"张三"}
定长报文:000001 张三
看出来了么,我把id的长度定为6,name的长度定为15,那么我取id的值就是从0-6,取name的时候就是从6-21就可以了,取功能说完了,那存呢,存就要得把所有的数据拼成String长字符串,但是规定数字要补0,字符串前要补空格,那怎么办呢?别急,我有办法
1.生成定长报文
实现:把所有的要生成的参数定义为实体,并利用自己写的注解的方式说明每个字段的长度,并表明是要补齐空格还是补0
实体如下
public class BankClaimBody {
@PadRightWithSpace(len = 8)
private String storeId;
@PadRightWithSpace(len = 20)
private String applyTime;
public String getStoreId() {
return storeId;
}
public void setStoreId(String storeId) {
this.storeId = storeId;
}
public String getApplyTime() {
return applyTime;
}
public void setApplyTime(String applyTime) {
this.applyTime = applyTime;
}
}
@PadRightWithSpace 就是补齐空格的注解
package report.fixed.demo.socketfixed.bodyhadle;
import java.lang.annotation.*;
/**
* 左对齐右边补空格
*
*
*/
@Target(ElementType.FIELD)
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface PadRightWithSpace {
int len() default 0;
}
@PadLeftWithZero 的注解类就是补0的操作
@Target(ElementType.FIELD)
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface PadLeftWithZero {
int len() default 0;
}
@NoNeedPack 没有注解的情况
@Target(ElementType.FIELD)
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface NoNeedPack {
}
生成定长报文测试一下
public static void main(String[] args) throws Exception {
BankClaimBody body =new BankClaimBody();
body.setStoreId("02222222");
body.setApplyTime(”2020-02-03“);
// 生成定长报文
String strpj = MessageHelper.createFiexdLengthMsg(body,
body.getClass());
// 打开socket连接并传输定长报文数据
String data = SocketClient.openSendMsg(strpj);
}
发下生成定长报文的工具类
public static String createFiexdLengthMsg(Object obj, Class<?> clazz) throws Exception {
Field[] fields = clazz.getDeclaredFields();
StringBuffer sb = new StringBuffer();
for (Field field : fields) {
if (field.isAnnotationPresent(PadRightWithSpace.class)) {// 如果是左对齐,右边补空格注解
PadRightWithSpace padRightWithSpace = field.getAnnotation(PadRightWithSpace.class);
int len = padRightWithSpace.len();
field.setAccessible(true);
String newValue = padRightWithSpace((String) field.get(obj), len);
field.set(obj, newValue);
} else if (field.isAnnotationPresent(PadLeftWithZero.class)) {// 如果是右对齐,左边补0注解
PadLeftWithZero padLeftWithZero = field.getAnnotation(PadLeftWithZero.class);
int len = padLeftWithZero.len();
field.setAccessible(true);
String newValue = padLeftWithZero((String) field.get(obj), len);
field.set(obj, newValue);
}
String value = (String) field.get(obj);
sb.append(value);
}
String msgBody = sb.toString();
//String msgHead = padLeftWithZero(String.valueOf(msgBody.getBytes("GBK").length), 4);
return msgBody;
}
public static String padRightWithSpace(String orgStr, int len) {
if (orgStr == null) {
orgStr = "";
}
int length = 0;
try {
if (orgStr.getBytes("GBK").length >= len) {
return orgStr;
}
length = orgStr.getBytes("GBK").length;
} catch (UnsupportedEncodingException e) {
}
StringBuffer sb = new StringBuffer(orgStr);
// 准确的字节长度拿到后 再据此补位
for (int j = 0; j < len - length; j++) {
sb.append(" ");
}
return sb.toString();
}
private static String padLeftWithZero(String orgStr, int len) {
if (orgStr == null) {
orgStr = "";
}
int length = orgStr.length();
if (length >= len) {
return orgStr;
}
StringBuffer sb = new StringBuffer(orgStr);
// 准确的字节长度拿到后 再据此补位
for (int j = 0; j < len - length; j++) {
sb.insert(0, "0");
}
return sb.toString();
}
再发下socket连接发送请求操作
package report.fixed.demo.socketfixed.soketclient;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.net.Socket;
/**
* @ClassName : SocketClient
* @Description :
* @Author : df
* @Date: 2021-03-23 13:04
*/
public class SocketClient {
private static Socket socket; //socket连接
private static boolean connection = false;//socket是否连接
private static int connectcount = 0;
private static String ip = "22.16.219.91";
//private static String ip = "localhost";
private static Integer port = 9004;
//private static Integer port = 8888;
/*
* @Author df
* @Description /打开连接并发送数据
* @Date 13:10 2021/3/23
**/
public static String openSendMsg(String sendData) {
// 打开连接
open();
if (connection == false) {
return null;
}
// 发送报文并获取返回报文
String resultData = sendAndRecMsg(sendData.getBytes());
close();
return resultData;
}
/*
* @Author df
* @Description 发送数据
* @Date 13:11 2021/3/23
**/
public static String sendAndRecMsg(byte[] message) {
if (message == null) {
return null;
}
try {
InputStream in = socket.getInputStream(); //获取输入流,并创建相应的数据输入流
OutputStream out = socket.getOutputStream();//获取输出流,并创建相应的数据输出流
out.write(message);
out.flush();
int count = 0;
int k = 0;
while (count == 0 && k < 100) {
count = in.available();
k++;
Thread.sleep(200);
}
byte[] receive = new byte[count];
int readCount = 0; // 已经成功读取的字节的个数
while (readCount < count) {
readCount += in.read(receive, readCount, count - readCount);
}
if (receive.length == 0) {
return null;
}
String strdata = new String(receive);
System.out.println("接收的数据:" + strdata);
return strdata;
} catch (Exception e) {
System.err.println(e + " 发送异常,重新认证发送数据!");
e.printStackTrace();
}
return null;
}
/**
* 打开socket连接
*/
public static boolean open() {
while (connectcount < 60 && !connection) {
try {
socket = new Socket(); //重新连接需要new Socket,否则报错
socket.connect(new InetSocketAddress(ip, port), 0);
connection = true;
connectcount = 0;
System.out.println("socket连接打开成功!");
//Thread.sleep(1000);//创建连接休眠1s,若不sleep等待,将无法接受到认证信息
} catch (Exception ex) {
connectcount++;
System.err.println("与服务器建立socket连接第" + connectcount + "次失败" + ex);
try {
if (connectcount <= 30) Thread.sleep(10000);
else if (connectcount < 20) Thread.sleep(30000);
else if (connectcount < 30) Thread.sleep(60000);
socket.close();//建立失败,以防万一,close
} catch (InterruptedException e) {
System.err.println(e.getMessage());
e.printStackTrace();
} catch (IOException e) {
}
}
}
return connection;
}
/**
* 关闭socket
*/
public static void close() {
if (connection) {
try {
socket.close();
System.out.println("socket连接关闭成功!");
} catch (IOException e) {
System.err.println(e.getMessage());
System.out.println("socket连接关闭失败!");
e.printStackTrace();
}
connection = false;
}
}
}
生成如下的格式
022222222020-02-03
那下面就是解析操作了
解析数据也要双方定义好长度,以及对应长度是哪个属性,还有就是中文要注意字节
// 上文的生成报文以后并打开socket传输,同时就会同步返回数据,我们接收到就要解析
String data = SocketClient.openSendMsg(strpj);
System.out.println("接收到的" + kt + "行方总数据:" + data);
// 定义的0-5就是数据body的长度
String header = MessageHelper.substring(data, 0, 5, "GBK");
System.out.println("接收到的" + kt + "行方头数据:" + header);
// 定义的code码是5-9
String code = MessageHelper.substring(data, 5, 9, "GBK");
System.out.println("接收到的" + kt + "行方code:" + code);
// 定义消息msg是9-109长度
String msg = MessageHelper.substring(data, 9, 109, "GBK");
System.out.println(msg);
System.out.println("接收到的" + kt + "行方数据信息:" + header);
重头戏了要解析body了,body是比较复杂的数据,涉及到多个循环操作
Integer dataLength = MessageHelper.length(data);
// 解析109到之后的所有数据就是body的数据
bankClaimResult = MessageHelper.unPackBody(MessageHelper.substring(data, 109, dataLength, "GBK"));
发下解析类MessageHelper
package txcomponent.socketfixed.bodyhadle;
import txcomponent.socketfixed.domain.bank.resp.*;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.util.*;
public class MessageHelper {
public static String createFiexdLengthMsg(Object obj, Class<?> clazz) throws Exception {
// 获取clazz类的所有声明的字段,包括public、private和proteced不包括父类的声明。
Field[] fields = clazz.getDeclaredFields();
StringBuffer sb = new StringBuffer();
for (Field field : fields) {
// 字段是否存在PadRightWithSpace类注解
if (field.isAnnotationPresent(PadRightWithSpace.class)) {// 如果是左对齐,右边补空格注解
PadRightWithSpace padRightWithSpace = field.getAnnotation(PadRightWithSpace.class);
// 获取当前注解的长度
int len = padRightWithSpace.len();
// 将当前字段设置为不需要安全检查,私有类如果进行安全检查此处会报错
// 并且必须要在获取字段前设置
field.setAccessible(true);
String newValue = padRightWithSpace((String) field.get(obj), len);
field.set(obj, newValue);
} else if (field.isAnnotationPresent(PadLeftWithZero.class)) {// 如果是右对齐,左边补0注解
PadLeftWithZero padLeftWithZero = field.getAnnotation(PadLeftWithZero.class);
int len = padLeftWithZero.len();
field.setAccessible(true);
String newValue = padLeftWithZero((String) field.get(obj), len);
field.set(obj, newValue);
}
String value = (String) field.get(obj);
sb.append(value);
}
String msgBody = sb.toString();
//String msgHead = padLeftWithZero(String.valueOf(msgBody.getBytes("GBK").length), 4);
return msgBody;
}
public static String padRightWithSpace(String orgStr, int len) {
if (orgStr == null) {
orgStr = "";
}
int length = 0;
try {
if (orgStr.getBytes("GBK").length >= len) {
return orgStr;
}
length = orgStr.getBytes("GBK").length;
} catch (UnsupportedEncodingException e) {
}
StringBuffer sb = new StringBuffer(orgStr);
// 准确的字节长度拿到后 再据此补位
for (int j = 0; j < len - length; j++) {
sb.append(" ");
}
return sb.toString();
}
/*private static String padLeftWithZero(Object orgStr, int len) {
String orgStr1 = String.valueOf(orgStr);
if (orgStr == null) {
orgStr = "";
}
int length = orgStr1.length();
if (length >= len) {
return orgStr1;
}
StringBuffer sb = new StringBuffer(orgStr1);
// 准确的字节长度拿到后 再据此补位
for (int j = 0; j < len - length; j++) {
sb.insert(0, "0");
}
return sb.toString();
}*/
private static String padLeftWithZero(String orgStr, int len) {
if (orgStr == null) {
orgStr = "";
}
int length = orgStr.length();
if (length >= len) {
return orgStr;
}
StringBuffer sb = new StringBuffer(orgStr);
// 准确的字节长度拿到后,再据此补位
for (int j = 0; j < len - length; j++) {
sb.insert(0, "0");
}
return sb.toString();
}
/*
* @Author df
* @Description 内容前补0
* @Date 21:35 2021/3/23
* @Param [length, content]
**/
public static String appendZero(int length, String content) {
int lengthByte = 0;
try {
lengthByte = content.getBytes("GBK").length;
} catch (UnsupportedEncodingException e) {
}
String result = lengthByte + "";
for (int i = 0; i < length - (lengthByte + "").length(); i++) {
result = "0" + result;
}
return result;
}
/*
* @Author df
* @Description 解析头部数据
* @Date 21:32 2021/3/23
**/
public static Map<String, String> unPackHeader(String dcStr) throws Exception {
if (dcStr != null) {
//String headerL = dcStr.substring(0, 5);
String code = substring(dcStr, 5, 9, "GBK");
String msg = substring(dcStr, 9, 109, "GBK");
//System.out.println("截取头部:" + headerL);
System.out.println("code码:" + code);
System.out.println("msg:" + msg.trim());
Map<String, String> map = new HashMap();
map.put("code", code);
map.put("msg", msg);
return map;
}
return null;
}
/*
* @Author df
* @Description 解析定长报文header
* @Date 13:32 2021/3/24
* @Param clazz 类
* @Param dcStr 定长报文字符串
* @Param type 类型 1:header 2:body
**/
public static BankResultHeader unPackHeader(Class<?> clazz, String dcStr) throws Exception {
BankResultHeader header = new BankResultHeader();
int indexStart = 0;
int index = 0;
Field[] fields = clazz.getDeclaredFields();
StringBuffer sb = new StringBuffer();
for (Field field : fields) {
String data = "";
if (field.isAnnotationPresent(PadRightWithSpace.class)) {
index = index + 1;
PadRightWithSpace padRightWithSpace = field.getAnnotation(PadRightWithSpace.class);
int len = padRightWithSpace.len();
data = dcStr.substring(indexStart, len);
indexStart = indexStart + len;
}
if (field.isAnnotationPresent(PadLeftWithZero.class)) {
index = index + 1;
PadLeftWithZero padLeftWithZero = field.getAnnotation(PadLeftWithZero.class);
int len = padLeftWithZero.len();
data = dcStr.substring(indexStart, len);
indexStart = indexStart + len;
}
if (index == 1) {
header.setMsgcde(data);
}
if (index == 2) {
header.setDesc(data.trim());
}
}
return header;
}
/**
* 获取字符串的长度,如果有中文,则每个中文字符计为2位
*
* @param value 指定的字符串
* @return 字符串的长度
*/
public static int length(String value) {
int valueLength = 0;
String chinese = "[\u0391-\uFFE5]";
/* 获取字段值的长度,如果含中文字符,则每个中文字符长度为2,否则为1 */
for (int i = 0; i < value.length(); i++) {
/* 获取一个字符 */
String temp = value.substring(i, i + 1);
/* 判断是否为中文字符 */
if (temp.matches(chinese)) {
/* 中文字符长度为2 */
valueLength += 2;
} else {
/* 其他字符长度为1 */
valueLength += 1;
}
}
return valueLength;
}
/*
* @Author df
* @Description 解析定长报文body
* @Date 9:00 2021/3/25
* @Param [dcStr] 定长报文字符串
* @return void
**/
public static BankClaimResult unPackBody(String dcStr) throws Exception {
BankClaimResult bankClaimResult = new BankClaimResult();
// 去掉分页才能获取第一个线路集合
String data = dcStr.substring(4, 9);
Integer lineNum = Integer.parseInt(data.replaceAll("0", ""));
int indexStart1 = 0;
BankBaseClaimBody claimBody = new BankBaseClaimBody();
Field[] fieldsClaimBody = claimBody.getClass().getDeclaredFields();
int index = 0;
for (Field field : fieldsClaimBody) {
index = index + 1;
String data1 = "";
if (field.isAnnotationPresent(PadRightWithSpace.class)) {
PadRightWithSpace padRightWithSpace = field.getAnnotation(PadRightWithSpace.class);
int len = padRightWithSpace.len();
data1 = substring(dcStr, indexStart1, indexStart1 + len, "GBK");
indexStart1 = indexStart1 + len;
}
if (field.isAnnotationPresent(PadLeftWithZero.class)) {
PadLeftWithZero padRightWithSpace = field.getAnnotation(PadLeftWithZero.class);
int len = padRightWithSpace.len();
data1 = substring(dcStr, indexStart1, indexStart1 + len, "GBK");
indexStart1 = indexStart1 + len;
}
if (index == 1) {
//总页数
claimBody.setTotalPage(Integer.parseInt(data1));
}
if (index == 2) {
//当前页码
claimBody.setCurPage(Integer.parseInt(data1));
}
if (index == 3) {
//任务信息列表记录数
claimBody.setTaskInfoSum(Integer.parseInt(data1));
}
}
List<BankLineClaimInfo> list = new ArrayList<>();
for (int i = 0; i < lineNum; i++) {
BankLineClaimInfo claimInfo = new BankLineClaimInfo();
Field[] fieldsClaimInfo = claimInfo.getClass().getDeclaredFields();
int index1 = 0;
for (Field field : fieldsClaimInfo) {
index1 = index1 + 1;
String data1 = "";
if (field.isAnnotationPresent(PadRightWithSpace.class)) {
PadRightWithSpace padRightWithSpace = field.getAnnotation(PadRightWithSpace.class);
int len = padRightWithSpace.len();
data1 = substring(dcStr, indexStart1, indexStart1 + len, "GBK");
indexStart1 = indexStart1 + len;
}
if (field.isAnnotationPresent(PadLeftWithZero.class)) {
PadLeftWithZero padRightWithSpace = field.getAnnotation(PadLeftWithZero.class);
int len = padRightWithSpace.len();
data1 = substring(dcStr, indexStart1, indexStart1 + len, "GBK");
indexStart1 = indexStart1 + len;
}
if (index1 == 1) {
claimInfo.setLineCode(data1.trim());
}
if (index1 == 2) {
claimInfo.setLineName(data1.trim());
}
if (index1 == 3) {
int orgNum = Integer.parseInt(data1);
claimInfo.setApplyOrgsSum(orgNum);
}
}
list.add(claimInfo);
claimBody.setList(list);
List<BankBranchClaimInfo> list1 = new ArrayList<>();
for (int j = 0; j < claimInfo.getApplyOrgsSum(); j++) {
int index2 = 0;
BankBranchClaimInfo branchClaimInfo = new BankBranchClaimInfo();
Field[] fieldsBranchClaimInfo = branchClaimInfo.getClass().getDeclaredFields();
for (Field field : fieldsBranchClaimInfo) {
index2 = index2 + 1;
String data1 = "";
if (field.isAnnotationPresent(PadRightWithSpace.class)) {
PadRightWithSpace padRightWithSpace = field.getAnnotation(PadRightWithSpace.class);
int len = padRightWithSpace.len();
data1 = substring(dcStr, indexStart1, indexStart1 + len, "GBK");
indexStart1 = indexStart1 + len;
}
if (field.isAnnotationPresent(PadLeftWithZero.class)) {
PadLeftWithZero padRightWithSpace = field.getAnnotation(PadLeftWithZero.class);
int len = padRightWithSpace.len();
data1 = substring(dcStr, indexStart1, indexStart1 + len, "GBK");
indexStart1 = indexStart1 + len;
}
if (index2 == 1) {
branchClaimInfo.setOrgId(data1.trim());
}
if (index2 == 2) {
branchClaimInfo.setOrgName(data1.trim());
}
if (index2 == 3) {
if (!"".equals(data1)) {
int currencySum = Integer.parseInt(data1);
branchClaimInfo.setCurrencySum(currencySum);
}
}
}
list1.add(branchClaimInfo);
claimInfo.setList(list1);
List<BankCurrencyClamInfo> list2 = new ArrayList<>();
for (int k = 0; k < branchClaimInfo.getCurrencySum(); k++) {
int index3 = 0;
BankCurrencyClamInfo currencyClamInfo = new BankCurrencyClamInfo();
Field[] fieldsCurrencyClamInfo = currencyClamInfo.getClass().getDeclaredFields();
for (Field field : fieldsCurrencyClamInfo) {
index3 = index3 + 1;
String data1 = "";
if (field.isAnnotationPresent(PadRightWithSpace.class)) {
PadRightWithSpace padRightWithSpace = field.getAnnotation(PadRightWithSpace.class);
int len = padRightWithSpace.len();
data1 = substring(dcStr, indexStart1, indexStart1 + len, "GBK");
indexStart1 = indexStart1 + len;
}
if (field.isAnnotationPresent(PadLeftWithZero.class)) {
PadLeftWithZero padRightWithSpace = field.getAnnotation(PadLeftWithZero.class);
int len = padRightWithSpace.len();
data1 = substring(dcStr, indexStart1, indexStart1 + len, "GBK");
indexStart1 = indexStart1 + len;
}
if (index3 == 1) {
currencyClamInfo.setCode(data1.trim());
}
if (index3 == 2) {
if (data1 != null && !"".equals(data1)) {
Double totalAmt = Double.valueOf(data1);
BigDecimal totalAmtB = new BigDecimal(totalAmt);
currencyClamInfo.setTotalAmt(totalAmtB);
}
}
/* if (index3 == 2) {
currencyClamInfo.setName(data1.trim());
}
if (index3 == 3) {
Double cashAmt = Double.valueOf(data1);
currencyClamInfo.setCashAmt(cashAmt);
}
if (index3 == 4) {
Double standAmt = Double.valueOf(data1);
currencyClamInfo.setStandAmt(standAmt);
}*/
}
list2.add(currencyClamInfo);
branchClaimInfo.setList(list2);
}
}
}
bankClaimResult.setBody(claimBody);
return bankClaimResult;
}
public static String substring(String text, int startIndex, int length, String encode)
throws UnsupportedEncodingException {
if (text == null) {
return null;
}
StringBuilder sb = new StringBuilder();
int currentLength = 0;
for (char c : text.toCharArray()) {
currentLength += String.valueOf(c).getBytes(encode).length;
if (currentLength > startIndex && currentLength <= length) {
sb.append(c);
} else {
continue;
}
}
return sb.toString();
}
}
解析最终会转换成对应的实体,方便我们进行操作,发下实体类把
// 最终包装类
public class BankClaimResult<T> {
private BankResultHeader header;
private BankBaseClaimBody body;
public BankResultHeader getHeader() {
return header;
}
public void setHeader(BankResultHeader header) {
this.header = header;
}
public BankBaseClaimBody getBody() {
return body;
}
public void setBody(BankBaseClaimBody body) {
this.body = body;
}
}
// 得到线路的循环字段以及下一个线路信息的list数据类
public class BankBaseClaimBody {
@PadLeftWithZero(len = 5)
private Integer taskInfoSum;
@NoNeedPack
private List<BankLineClaimInfo> list;
public List<BankLineClaimInfo> getList() {
return list;
}
public void setList(List<BankLineClaimInfo> list) {
this.list = list;
}
public Integer getTaskInfoSum() {
return taskInfoSum;
}
public void setTaskInfoSum(Integer taskInfoSum) {
this.taskInfoSum = taskInfoSum;
}
}
// 线路信息表
public class BankLineClaimInfo {
@PadLeftWithZero(len = 12)
private String lineCode;
@PadLeftWithZero(len = 30)
private String lineName;
@PadLeftWithZero(len = 5)
private Integer applyOrgsSum;
@NoNeedPack
private List<BankBranchClaimInfo> list;
public List<BankBranchClaimInfo> getList() {
return list;
}
public void setList(List<BankBranchClaimInfo> list) {
this.list = list;
}
public String getLineCode() {
return lineCode;
}
public void setLineCode(String lineCode) {
this.lineCode = lineCode;
}
public String getLineName() {
return lineName;
}
public void setLineName(String lineName) {
this.lineName = lineName;
}
public Integer getApplyOrgsSum() {
return applyOrgsSum;
}
public void setApplyOrgsSum(Integer applyOrgsSum) {
this.applyOrgsSum = applyOrgsSum;
}
}
// 网点信息
public class BankBranchClaimInfo {
@PadRightWithSpace(len = 7)
private String orgId;
@PadRightWithSpace(len = 70)
private String orgName;
@PadLeftWithZero(len = 5)
private Integer currencySum;
@NoNeedPack
private List<BankCurrencyClamInfo> list;
public List<BankCurrencyClamInfo> getList() {
return list;
}
public void setList(List<BankCurrencyClamInfo> list) {
this.list = list;
}
public String getOrgId() {
return orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public String getOrgName() {
return orgName;
}
public void setOrgName(String orgName) {
this.orgName = orgName;
}
public Integer getCurrencySum() {
return currencySum;
}
public void setCurrencySum(Integer currencySum) {
this.currencySum = currencySum;
}
}
// 现金信息类
public class BankCurrencyClamInfo {
@PadRightWithSpace(len = 3)
private String code;
@PadRightWithSpace(len = 40)
private String name;
@PadLeftWithZero(len = 18)
private Double cashAmt;
@PadLeftWithZero(len = 18)
private Double standAmt;
@PadLeftWithZero(len = 18)
private Double totalAmt;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Double getCashAmt() {
return cashAmt;
}
public void setCashAmt(Double cashAmt) {
this.cashAmt = cashAmt;
}
public Double getStandAmt() {
return standAmt;
}
public void setStandAmt(Double standAmt) {
this.standAmt = standAmt;
}
public Double getTotalAmt() {
return totalAmt;
}
public void setTotalAmt(Double totalAmt) {
this.totalAmt = totalAmt;
}
}