|
@@ -1,7 +1,7 @@
|
|
|
package com.sooka.base.util;
|
|
|
|
|
|
public class Generator {
|
|
|
- public static void main(String[] args) {
|
|
|
+ public static void main2(String[] args) {
|
|
|
String str = "userName, userPhone, userAddr, balance, userCode";
|
|
|
|
|
|
String[] arr = str.split(", ");
|
|
@@ -17,4 +17,44 @@ public class Generator {
|
|
|
System.out.println("bean.set" + arr[i].substring(0, 1).toUpperCase() + arr[i].substring(1, arr[i].length()) + "(Data.getString(\"" + arr[i] + "\"));");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ static String str = "";
|
|
|
+ static String note = "";
|
|
|
+ static String[] arr = null;
|
|
|
+ static String[] notes = null;
|
|
|
+ static String[] properties = null;
|
|
|
+ public static void main(String[] args) {
|
|
|
+ String bean = "String ClerkOrdering;//接单人员\n" +
|
|
|
+ " String DateTime;//接单时间\n" +
|
|
|
+ " String Worker;//工作人员\n" +
|
|
|
+ " String ResultCode;//处理结果\n" +
|
|
|
+ " String Content;//具体内容";
|
|
|
+
|
|
|
+ properties = bean.split("\n");
|
|
|
+
|
|
|
+ for (int i = 0; i < properties.length; i++) {
|
|
|
+ String line = properties[i];
|
|
|
+ String property = line.split(";")[0].split("String ")[1];
|
|
|
+ str = str + property + ", ";
|
|
|
+ }
|
|
|
+ arr = str.split(", ");
|
|
|
+
|
|
|
+ for (int i = 0; i < properties.length; i++) {
|
|
|
+ String line = properties[i];
|
|
|
+ String annotation = line.split(";")[1].split("//")[1];//String f_username;//用户姓名/单位名称
|
|
|
+ note = note + annotation + ", ";
|
|
|
+ }
|
|
|
+ //debug
|
|
|
+ //System.out.println(note);
|
|
|
+ notes = note.split(", ");
|
|
|
+
|
|
|
+ for (int i = 0; i < arr.length; i++) {
|
|
|
+ System.out.println(" \""+arr[i]+"\":\""+notes[i]+"\",");
|
|
|
+// System.out.println("/** " + notes[i] + " */");
|
|
|
+// System.out.println("@Excel(name = \"" + notes[i] + "\" )");
|
|
|
+// System.out.println("private String " + arr[i] + ";");
|
|
|
+// System.out.println();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|