diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 9839537..28f3d1f 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -6,7 +6,28 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -80,22 +101,23 @@
-
-
+
+
-
+
+
-
+
-
-
+
+
-
+
@@ -103,29 +125,31 @@
-
+
-
+
-
+
+
-
+
-
+
+
@@ -135,20 +159,66 @@
-
-
+
+
-
-
+
+
-
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -156,8 +226,36 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -168,6 +266,7 @@
@@ -175,6 +274,20 @@
controller
view/
+ reimbu
+ email
+ home
+ ini
+ 时间
+ 联系人
+ han
+ switch
+ reimbursementFileListItem
+ ReimbursementListItem
+ 客户端
+ exit
+ show
+ 弹窗
@@ -607,13 +720,26 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -629,7 +755,7 @@
-
+
@@ -680,8 +806,6 @@
-
-
@@ -690,16 +814,136 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -710,10 +954,14 @@
+
+
-
+
+
+
@@ -735,7 +983,7 @@
-
+
@@ -847,18 +1095,21 @@
-
+
+
+
+
+
-
+
-
-
+
-
+
@@ -867,7 +1118,7 @@
-
+
@@ -884,11 +1135,43 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -901,126 +1184,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1049,13 +1212,6 @@
-
-
-
-
-
-
-
@@ -1063,27 +1219,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1129,13 +1264,6 @@
-
-
-
-
-
-
-
@@ -1168,30 +1296,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1209,20 +1313,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1230,10 +1320,250 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ndn/pib.db b/ndn/pib.db
new file mode 100644
index 0000000..7f31f5f
Binary files /dev/null and b/ndn/pib.db differ
diff --git a/out/production/classes/cn/minoa/Main.class b/out/production/classes/cn/minoa/Main.class
index b7f64a1..b65075b 100644
Binary files a/out/production/classes/cn/minoa/Main.class and b/out/production/classes/cn/minoa/Main.class differ
diff --git a/out/production/classes/cn/minoa/MainApp.class b/out/production/classes/cn/minoa/MainApp.class
index 53a76c9..eab193b 100644
Binary files a/out/production/classes/cn/minoa/MainApp.class and b/out/production/classes/cn/minoa/MainApp.class differ
diff --git a/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$1.class b/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$1.class
index 6e34359..c4b4f30 100644
Binary files a/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$1.class and b/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$1.class differ
diff --git a/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$2.class b/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$2.class
index 3e8c804..c6d3b84 100644
Binary files a/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$2.class and b/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$2.class differ
diff --git a/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$3.class b/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$3.class
index 549d7d2..b2354a3 100644
Binary files a/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$3.class and b/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$3.class differ
diff --git a/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$4.class b/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$4.class
index 0597978..b0e2caa 100644
Binary files a/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$4.class and b/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$4.class differ
diff --git a/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$5.class b/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$5.class
index f3671d6..1e4f566 100644
Binary files a/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$5.class and b/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$5.class differ
diff --git a/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$6.class b/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$6.class
index ef7dfd7..1929043 100644
Binary files a/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$6.class and b/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$6.class differ
diff --git a/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$7.class b/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$7.class
index 043cb0b..afee147 100644
Binary files a/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$7.class and b/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$7.class differ
diff --git a/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$8.class b/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$8.class
index 5c46faa..5b21d06 100644
Binary files a/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$8.class and b/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI$8.class differ
diff --git a/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI.class b/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI.class
index fe1f890..c9be5be 100644
Binary files a/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI.class and b/out/production/classes/cn/minoa/dataRequestInterface/MinoaDataAPI.class differ
diff --git a/out/production/classes/cn/minoa/model/Reimbursement.class b/out/production/classes/cn/minoa/model/Reimbursement.class
new file mode 100644
index 0000000..0549bfc
Binary files /dev/null and b/out/production/classes/cn/minoa/model/Reimbursement.class differ
diff --git a/out/production/classes/cn/minoa/view/home/DealSingleReimbursementController.class b/out/production/classes/cn/minoa/view/home/DealSingleReimbursementController.class
new file mode 100644
index 0000000..269a16d
Binary files /dev/null and b/out/production/classes/cn/minoa/view/home/DealSingleReimbursementController.class differ
diff --git a/out/production/classes/cn/minoa/view/home/HomeListController.class b/out/production/classes/cn/minoa/view/home/HomeListController.class
index c01a9ab..370bb7f 100644
Binary files a/out/production/classes/cn/minoa/view/home/HomeListController.class and b/out/production/classes/cn/minoa/view/home/HomeListController.class differ
diff --git a/out/production/classes/cn/minoa/view/home/ReimbursementApplyController.class b/out/production/classes/cn/minoa/view/home/ReimbursementApplyController.class
new file mode 100644
index 0000000..df3864d
Binary files /dev/null and b/out/production/classes/cn/minoa/view/home/ReimbursementApplyController.class differ
diff --git a/out/production/classes/cn/minoa/view/home/ReimbursementDealController.class b/out/production/classes/cn/minoa/view/home/ReimbursementDealController.class
new file mode 100644
index 0000000..c69d458
Binary files /dev/null and b/out/production/classes/cn/minoa/view/home/ReimbursementDealController.class differ
diff --git a/out/production/classes/cn/minoa/view/home/ReimbursementListItem.class b/out/production/classes/cn/minoa/view/home/ReimbursementListItem.class
new file mode 100644
index 0000000..0fbeabb
Binary files /dev/null and b/out/production/classes/cn/minoa/view/home/ReimbursementListItem.class differ
diff --git a/out/production/classes/cn/minoa/view/home/SingleReimbursementDetailsController.class b/out/production/classes/cn/minoa/view/home/SingleReimbursementDetailsController.class
new file mode 100644
index 0000000..30d2428
Binary files /dev/null and b/out/production/classes/cn/minoa/view/home/SingleReimbursementDetailsController.class differ
diff --git a/out/production/classes/cn/minoa/view/home/WrittenReimbursementController.class b/out/production/classes/cn/minoa/view/home/WrittenReimbursementController.class
new file mode 100644
index 0000000..6a51eb5
Binary files /dev/null and b/out/production/classes/cn/minoa/view/home/WrittenReimbursementController.class differ
diff --git a/out/production/classes/cn/minoa/view/home/reimbursementFileListItem.class b/out/production/classes/cn/minoa/view/home/reimbursementFileListItem.class
new file mode 100644
index 0000000..3b34d38
Binary files /dev/null and b/out/production/classes/cn/minoa/view/home/reimbursementFileListItem.class differ
diff --git a/out/production/classes/cn/minoa/view/mine/SingleEmailDetailsController.class b/out/production/classes/cn/minoa/view/mine/SingleEmailDetailsController.class
index 8cb0c10..c4ceae9 100644
Binary files a/out/production/classes/cn/minoa/view/mine/SingleEmailDetailsController.class and b/out/production/classes/cn/minoa/view/mine/SingleEmailDetailsController.class differ
diff --git a/out/production/classes/cn/minoa/view/mine/WrittenEmailController.class b/out/production/classes/cn/minoa/view/mine/WrittenEmailController.class
index 6de9c95..cdb5391 100644
Binary files a/out/production/classes/cn/minoa/view/mine/WrittenEmailController.class and b/out/production/classes/cn/minoa/view/mine/WrittenEmailController.class differ
diff --git a/out/production/classes/cn/minoa/view/mine/emailFileListItem.class b/out/production/classes/cn/minoa/view/mine/emailFileListItem.class
index 87c0cdd..aa60fd0 100644
Binary files a/out/production/classes/cn/minoa/view/mine/emailFileListItem.class and b/out/production/classes/cn/minoa/view/mine/emailFileListItem.class differ
diff --git a/out/production/resources/fxml/home/DealSingleReimbursement.fxml b/out/production/resources/fxml/home/DealSingleReimbursement.fxml
new file mode 100644
index 0000000..b5c1ac7
--- /dev/null
+++ b/out/production/resources/fxml/home/DealSingleReimbursement.fxml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/out/production/resources/fxml/home/HomeListOverview.fxml b/out/production/resources/fxml/home/HomeListOverview.fxml
index a321ba5..4867fa9 100644
--- a/out/production/resources/fxml/home/HomeListOverview.fxml
+++ b/out/production/resources/fxml/home/HomeListOverview.fxml
@@ -13,10 +13,10 @@
-
+
-
+
@@ -24,10 +24,10 @@
-
+
-
+
diff --git a/out/production/resources/fxml/home/ReimbursementApply.css b/out/production/resources/fxml/home/ReimbursementApply.css
new file mode 100644
index 0000000..fb14be2
--- /dev/null
+++ b/out/production/resources/fxml/home/ReimbursementApply.css
@@ -0,0 +1,46 @@
+/*list样式
+ * */
+.list-cell:empty {
+ -fx-background-color: white;
+}
+/*页面底色
+*/
+#upPane{
+ -fx-background-color:#E8F2FE;
+}
+/*文件图标样式
+ */
+.head{
+ -fx-background-radius: 1px;
+ -fx-background-position: center center;
+ -fx-background-repeat: no-repeat;
+ -fx-background-size: 40px 40px;
+ -fx-background-color: rgba(255,255,255,0);
+ -fx-background-image: url("file:resources/images/headPhotos/default.png");
+ -fx-cursor: hand;
+ -fx-border-width: 1px;
+ -fx-border-radius: 1px;
+ -fx-border-color:transparent;
+}
+.head:hover{
+ -fx-background-radius: 1px;
+ -fx-background-position: center center;
+ -fx-background-repeat: no-repeat;
+ -fx-background-color: transparent;
+ -fx-background-size: 40px 40px;
+ -fx-cursor: hand;
+ -fx-border-width: 1px;
+ -fx-border-radius: 1px;
+ -fx-border-color:transparent;
+}
+.head:pressed{
+ -fx-background-radius: 1px;
+ -fx-background-position: center center;
+ -fx-background-repeat: no-repeat;
+ -fx-background-color: transparent;
+ -fx-background-size: 40px 40px;
+ -fx-cursor: hand;
+ -fx-border-width: 1px;
+ -fx-border-radius: 1px;
+ -fx-border-color:transparent;
+}
\ No newline at end of file
diff --git a/out/production/resources/fxml/home/ReimbursementApplyOverview.fxml b/out/production/resources/fxml/home/ReimbursementApplyOverview.fxml
new file mode 100644
index 0000000..90d4eb2
--- /dev/null
+++ b/out/production/resources/fxml/home/ReimbursementApplyOverview.fxml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/out/production/resources/fxml/home/ReimbursementDeal.css b/out/production/resources/fxml/home/ReimbursementDeal.css
new file mode 100644
index 0000000..fb14be2
--- /dev/null
+++ b/out/production/resources/fxml/home/ReimbursementDeal.css
@@ -0,0 +1,46 @@
+/*list样式
+ * */
+.list-cell:empty {
+ -fx-background-color: white;
+}
+/*页面底色
+*/
+#upPane{
+ -fx-background-color:#E8F2FE;
+}
+/*文件图标样式
+ */
+.head{
+ -fx-background-radius: 1px;
+ -fx-background-position: center center;
+ -fx-background-repeat: no-repeat;
+ -fx-background-size: 40px 40px;
+ -fx-background-color: rgba(255,255,255,0);
+ -fx-background-image: url("file:resources/images/headPhotos/default.png");
+ -fx-cursor: hand;
+ -fx-border-width: 1px;
+ -fx-border-radius: 1px;
+ -fx-border-color:transparent;
+}
+.head:hover{
+ -fx-background-radius: 1px;
+ -fx-background-position: center center;
+ -fx-background-repeat: no-repeat;
+ -fx-background-color: transparent;
+ -fx-background-size: 40px 40px;
+ -fx-cursor: hand;
+ -fx-border-width: 1px;
+ -fx-border-radius: 1px;
+ -fx-border-color:transparent;
+}
+.head:pressed{
+ -fx-background-radius: 1px;
+ -fx-background-position: center center;
+ -fx-background-repeat: no-repeat;
+ -fx-background-color: transparent;
+ -fx-background-size: 40px 40px;
+ -fx-cursor: hand;
+ -fx-border-width: 1px;
+ -fx-border-radius: 1px;
+ -fx-border-color:transparent;
+}
\ No newline at end of file
diff --git a/out/production/resources/fxml/home/ReimbursementDealOverview.fxml b/out/production/resources/fxml/home/ReimbursementDealOverview.fxml
new file mode 100644
index 0000000..a19801d
--- /dev/null
+++ b/out/production/resources/fxml/home/ReimbursementDealOverview.fxml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/out/production/resources/fxml/home/SingleReimbursementDetails.fxml b/out/production/resources/fxml/home/SingleReimbursementDetails.fxml
new file mode 100644
index 0000000..b2fd46f
--- /dev/null
+++ b/out/production/resources/fxml/home/SingleReimbursementDetails.fxml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/out/production/resources/fxml/home/WrittenReimbursementDetails.fxml b/out/production/resources/fxml/home/WrittenReimbursementDetails.fxml
new file mode 100644
index 0000000..f8e4b8a
--- /dev/null
+++ b/out/production/resources/fxml/home/WrittenReimbursementDetails.fxml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/out/production/resources/fxml/mine/MyEmailOverview.fxml b/out/production/resources/fxml/mine/MyEmailOverview.fxml
index 48a9c19..0dfd81d 100644
--- a/out/production/resources/fxml/mine/MyEmailOverview.fxml
+++ b/out/production/resources/fxml/mine/MyEmailOverview.fxml
@@ -20,7 +20,7 @@
-
+
diff --git a/out/production/resources/fxml/mine/SingleEmailDetails.fxml b/out/production/resources/fxml/mine/SingleEmailDetails.fxml
index 4a28132..1027787 100644
--- a/out/production/resources/fxml/mine/SingleEmailDetails.fxml
+++ b/out/production/resources/fxml/mine/SingleEmailDetails.fxml
@@ -7,7 +7,7 @@
-
+
diff --git a/out/production/resources/fxml/mine/WrittenEmailDetails.fxml b/out/production/resources/fxml/mine/WrittenEmailDetails.fxml
index 5c815f5..a213f4f 100644
--- a/out/production/resources/fxml/mine/WrittenEmailDetails.fxml
+++ b/out/production/resources/fxml/mine/WrittenEmailDetails.fxml
@@ -8,6 +8,7 @@
+
diff --git a/src/main/java/cn/minoa/MainApp.java b/src/main/java/cn/minoa/MainApp.java
index 17128de..5923d84 100644
--- a/src/main/java/cn/minoa/MainApp.java
+++ b/src/main/java/cn/minoa/MainApp.java
@@ -8,14 +8,9 @@ import java.util.Map;
import java.util.TreeMap;
import cn.minoa.dataRequestInterface.MinoaDataAPI;
-import cn.minoa.model.Email;
-import cn.minoa.model.Loginer;
-import cn.minoa.model.NotReadMessageList;
-import cn.minoa.model.Person;
-import cn.minoa.model.SingleMessage;
-import cn.minoa.model.SingleNotice;
+import cn.minoa.model.*;
import cn.minoa.view.NavigationBarController;
-import cn.minoa.view.home.HomeListController;
+import cn.minoa.view.home.*;
import cn.minoa.view.login.LoginOverviewController;
import cn.minoa.view.login.RegisterOverviewController;
import cn.minoa.view.message.ChatBoxController;
@@ -71,6 +66,8 @@ public class MainApp extends Application {
private final String MAIN_EMAILPANE;
private final String MAIN_CLOUDFILEPANE;
private final String MAIN_ABOUTMINEPANE;
+ private final String MAIN_REIMPANE;
+ private final String MAIN_REIMDEALPANE;
// 判断联系人列表是否已经被完整加载的锁(保证刷新小红点的时候联系人列表已经产生)
private boolean contactListFinished;
@@ -121,6 +118,7 @@ public class MainApp extends Application {
fileServerBinPath = "/";
sharedFileServerPath = "/share/";
// userHeadPhotoBinPath = "E:\\MyCode\\newEclipseWorkspace\\minoa_client_windows_JavaFX11\\resources\\images\\headPhotos\\";
+ System.out.println("客户端根目录:"+getClientPath());
userHeadPhotoBinPath = getClientPath() + "\\resources\\images\\headPhotos\\";
// System.out.println(userHeadPhotoBinPath);
sliceSize = 7000;
@@ -137,6 +135,8 @@ public class MainApp extends Application {
MAIN_EMAILPANE = "MAIN_EMAILPANE";
MAIN_CLOUDFILEPANE = "MAIN_CLOUDFILEPANE";
MAIN_ABOUTMINEPANE = "MAIN_ABOUTMINEPANE";
+ MAIN_REIMPANE = "MAIN_REIMPANE";
+ MAIN_REIMDEALPANE = "MAIN_REIMDEALPANE";
// 记录字符串
currentSecondPane = SECOND_NULLPANE;
currentMainPane = MAIN_NULLPANE;
@@ -158,7 +158,7 @@ public class MainApp extends Application {
// TODO Auto-generated catch block
e.printStackTrace();
}
- System.out.println("客户端根目录:" + path);
+// System.out.println("客户端根目录:" + path);
return path;
}
@@ -405,6 +405,143 @@ public class MainApp extends Application {
currentSecondPane = SECOND_HOMEPANE;
}
+ // 设为报销申请
+ public void showReimbursementOverview() throws IOException {
+ // 加载FXMLLoader
+ FXMLLoader loader = new FXMLLoader();
+ loader.setLocation(MainApp.class.getClassLoader().getResource("fxml/home/ReimbursementApplyOverview.fxml"));
+
+ // 修改主面板内容
+ barController.skipMainContextView(loader);
+
+ // 设置对应的控制器
+ ReimbursementApplyController reimbursementApplyController = loader.getController();
+ reimbursementApplyController.setMainApp(this);
+
+ currentMainPane = MAIN_REIMPANE;
+ }
+
+ // 重新加载我的报销【我申报的和我审核的】
+ public void reloadReimbursementOverview(String controlString) throws IOException {
+ // 加载FXMLLoader
+ FXMLLoader loader = new FXMLLoader();
+ loader.setLocation(MainApp.class.getClassLoader().getResource("fxml/home/ReimbursementApplyOverview.fxml"));
+
+ // 修改主面板内容
+ barController.skipMainContextView(loader);
+
+ // 设置对应的控制器
+ ReimbursementApplyController reimbursementApplyController = loader.getController();
+ reimbursementApplyController.setMainApp(this, controlString);
+
+ currentMainPane = MAIN_REIMPANE;
+ }
+
+ // 展示某条报销的详细信息
+ public void showReimbursementDetailsDialog(Reimbursement reimbursement) {
+ try {
+ // Load the fxml file and create a new stage for the popup dialog.
+ FXMLLoader loader = new FXMLLoader();
+ loader.setLocation(MainApp.class.getClassLoader().getResource("fxml/home/SingleReimbursementDetails.fxml"));
+ AnchorPane page = (AnchorPane) loader.load();
+
+ // Create the dialog Stage.
+ Stage dialogStage = new Stage();
+ dialogStage.initStyle(StageStyle.TRANSPARENT);
+ dialogStage.setTitle("报销");
+ dialogStage.initModality(Modality.WINDOW_MODAL);
+ dialogStage.initOwner(primaryStage);
+ Scene scene = new Scene(page);
+ dialogStage.setScene(scene);
+
+ // Set the controller.
+ SingleReimbursementDetailsController controller = loader.getController();
+ controller.setDialogStage(dialogStage);
+ controller.setMainApp(this);
+ controller.setReimInfo(reimbursement);
+
+ // Show the dialog and wait until the user closes it
+ dialogStage.showAndWait();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ // 审核某条报销
+ public void dealReimbursementDetailsDialog(Reimbursement reimbursement) {
+ try {
+ // Load the fxml file and create a new stage for the popup dialog.
+ FXMLLoader loader = new FXMLLoader();
+ loader.setLocation(MainApp.class.getClassLoader().getResource("fxml/home/DealSingleReimbursement.fxml"));
+ AnchorPane page = (AnchorPane) loader.load();
+
+ // Create the dialog Stage.
+ Stage dialogStage = new Stage();
+ dialogStage.initStyle(StageStyle.TRANSPARENT);
+ dialogStage.setTitle("审核报销");
+ dialogStage.initModality(Modality.WINDOW_MODAL);
+ dialogStage.initOwner(primaryStage);
+ Scene scene = new Scene(page);
+ dialogStage.setScene(scene);
+
+ // Set the controller.
+ DealSingleReimbursementController controller = loader.getController();
+ controller.setDialogStage(dialogStage);
+ controller.setMainApp(this);
+ controller.setReimInfo(reimbursement);
+
+ // Show the dialog and wait until the user closes it
+ dialogStage.showAndWait();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ // 展示编辑报销界面
+ public void showWritterReimbursementDialog() {
+ try {
+ // Load the fxml file and create a new stage for the popup dialog.
+ FXMLLoader loader = new FXMLLoader();
+ loader.setLocation(MainApp.class.getClassLoader().getResource("fxml/home/WrittenReimbursementDetails.fxml"));
+ AnchorPane page = (AnchorPane) loader.load();
+
+ // Create the dialog Stage.
+ Stage dialogStage = new Stage();
+ dialogStage.initStyle(StageStyle.TRANSPARENT);
+ dialogStage.setTitle("报销申请");
+ dialogStage.initModality(Modality.WINDOW_MODAL);
+ dialogStage.initOwner(primaryStage);
+ Scene scene = new Scene(page);
+ dialogStage.setScene(scene);
+
+ // Set the controller.
+ WrittenReimbursementController controller = loader.getController();
+ controller.setStage(dialogStage);
+ controller.setMainApp(this);
+
+ // Show the dialog and wait until the user closes it
+ dialogStage.showAndWait();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ // 设为报销审核
+ public void showReimbursementDealOverview() throws IOException {
+ // 加载FXMLLoader
+ FXMLLoader loader = new FXMLLoader();
+ loader.setLocation(MainApp.class.getClassLoader().getResource("fxml/home/ReimbursementDealOverview.fxml"));
+
+ // 修改主面板内容
+ barController.skipMainContextView(loader);
+
+ // 设置对应的控制器
+ ReimbursementDealController controller = loader.getController();
+ controller.setMainApp(this);
+
+ currentMainPane = MAIN_REIMDEALPANE;
+ }
+
// 二级导航栏设为联系人列表页
public void showMessageListOverview() throws IOException {
contactListFinished = false;
diff --git a/src/main/java/cn/minoa/dataRequestInterface/MinoaDataAPI.java b/src/main/java/cn/minoa/dataRequestInterface/MinoaDataAPI.java
index ffd79fe..86a7e21 100644
--- a/src/main/java/cn/minoa/dataRequestInterface/MinoaDataAPI.java
+++ b/src/main/java/cn/minoa/dataRequestInterface/MinoaDataAPI.java
@@ -27,8 +27,8 @@ import net.named_data.jndn.util.Blob;
public class MinoaDataAPI {
static private String keyChainNameString = "/wefree";
static private String minoaServerIpString = "121.15.171.89";
-// static private String pidDbPathString = "E:\\MyCode\\newEclipseWorkspace\\minoa_client_windows_JavaFX11";
- static private String pidDbPathString = "";
+ private String pidDbPathString;
+// static private String pidDbPathString = "";
static private String globalPrefixString = "/ndn/edu/pkusz/OA";
KeyChain keyChain;
@@ -41,6 +41,7 @@ public class MinoaDataAPI {
this.face = new Face(minoaServerIpString);
this.dataCacheQueue = new DataCacheQueue();
this.mainApp = mainApp;
+ pidDbPathString=mainApp.getClientPath()+"\\ndn";
runFace();
try {
// 密钥“黑盒”
@@ -366,6 +367,9 @@ public class MinoaDataAPI {
case "/getDataSlice":
requestStr = orderInfo.getJsonString();
break;
+ case "/dealApproval":
+ requestStr = orderInfo.getJsonString();
+ break;
default:
requestStr = "*wrong command string*";
break;
diff --git a/src/main/java/cn/minoa/model/Reimbursement.java b/src/main/java/cn/minoa/model/Reimbursement.java
new file mode 100644
index 0000000..96f6cbc
--- /dev/null
+++ b/src/main/java/cn/minoa/model/Reimbursement.java
@@ -0,0 +1,164 @@
+package cn.minoa.model;
+//报销类
+
+import java.util.LinkedList;
+import java.util.List;
+
+import javafx.beans.property.*;
+
+public class Reimbursement {
+ // 报销发起方
+ private StringProperty sender;
+ // 报销审批方
+ private StringProperty receiver;
+ // 报销编号
+ private IntegerProperty id;
+ // 报销状态
+ private IntegerProperty process;
+ //报销日期
+ private LongProperty date;
+ // 报销内容
+ private StringProperty content;
+ // 报销单据张数
+ private IntegerProperty number;
+ //报销总价值
+ private DoubleProperty totalMoney;
+ //报销费用详细
+ private StringProperty detail;
+ // 报销中的附件列表
+ public List files;
+
+ public Reimbursement() {
+ // TODO Auto-generated constructor stub
+ detail = new SimpleStringProperty();
+ totalMoney=new SimpleDoubleProperty();
+ number = new SimpleIntegerProperty();
+ date =new SimpleLongProperty();
+ process=new SimpleIntegerProperty();
+ content = new SimpleStringProperty();
+ sender = new SimpleStringProperty();
+ receiver = new SimpleStringProperty();
+ id = new SimpleIntegerProperty();
+ files=new LinkedList();
+ }
+
+ // id
+ public void setId(Integer id) {
+ this.id.set(id);
+ }
+ public Integer getId() {
+ return this.id.get();
+ }
+ public IntegerProperty idProperty() {
+ return id;
+ }
+
+ // sender
+ public void setSender(String sender) {
+ this.sender.set(sender);
+ }
+
+ public String getSender() {
+ return this.sender.get();
+ }
+
+ public StringProperty senderProperty() {
+ return sender;
+ }
+
+ // receiver
+ public void setReceiver(String receiver) {
+ this.receiver.set(receiver);
+ }
+
+ public String getReceiver() {
+ return this.receiver.get();
+ }
+
+ public StringProperty receiverProperty() {
+ return receiver;
+ }
+
+ //process
+ public void setProcess(Integer process){
+ this.process.set(process);
+ }
+
+ public Integer getProcess(){
+ return process.get();
+ }
+
+ public IntegerProperty processProperty(){
+ return process;
+ }
+
+ //date
+ public void setDate(Long date){
+ this.date.set(date);
+ }
+
+ public Long getDate(){
+ return date.get();
+ }
+
+ public LongProperty dateProperty(){
+ return date;
+ }
+
+ //number
+ public void setNumber(Integer number){
+ this.number.set(number);
+ }
+
+ public Integer getNumber(){
+ return number.get();
+ }
+
+ public IntegerProperty numberProperty(){
+ return number;
+ }
+
+ //totalMoney
+ public void setTotalMoney(Double totalMoney){
+ this.totalMoney.set(totalMoney);
+ }
+
+ public Double getTotalMoney(){
+ return totalMoney.get();
+ }
+
+ public DoubleProperty totalMoneyProperty(){
+ return totalMoney;
+ }
+
+ // detail
+ public void setDetail(String detail) {
+ this.detail.set(detail);
+ }
+
+ public String getDetail() {
+ return detail.get();
+ }
+
+ public StringProperty detailProperty() {
+ return detail;
+ }
+
+ // content
+ public void setContent(String content) {
+ this.content.set(content);
+ }
+
+ public String getContent() {
+ return content.get();
+ }
+
+ public StringProperty contentProperty() {
+ return content;
+ }
+
+ // 获取附件文件数目
+ public Integer getFilesNumber() {
+ return files.size();
+ }
+}
diff --git a/src/main/java/cn/minoa/view/home/DealSingleReimbursementController.java b/src/main/java/cn/minoa/view/home/DealSingleReimbursementController.java
new file mode 100644
index 0000000..b121375
--- /dev/null
+++ b/src/main/java/cn/minoa/view/home/DealSingleReimbursementController.java
@@ -0,0 +1,247 @@
+package cn.minoa.view.home;
+
+import cn.minoa.MainApp;
+import cn.minoa.dataRequestInterface.OrderInfo;
+import cn.minoa.dataRequestInterface.ResponseData;
+import cn.minoa.model.Email;
+import cn.minoa.model.Reimbursement;
+import javafx.fxml.FXML;
+import javafx.scene.control.Alert;
+import javafx.scene.control.ListView;
+import javafx.scene.control.TextArea;
+import javafx.scene.layout.Pane;
+import javafx.scene.text.Text;
+import javafx.stage.DirectoryChooser;
+import javafx.stage.Stage;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.File;
+import java.util.LinkedList;
+import java.util.List;
+
+public class DealSingleReimbursementController {
+ private MainApp mainApp;
+ private Stage dialogStage;
+ private Integer aprovalId;
+
+ @FXML
+ private Text senderText;
+ @FXML
+ private Text receiverText;
+ @FXML
+ private Text processText;
+ @FXML
+ private Text moneyText;
+ @FXML
+ private Text numberText;
+ @FXML
+ private Text contentText;
+ @FXML
+ private TextArea detailTextArea;
+
+ @FXML
+ private Text reimFilesTitleText;
+ @FXML
+ private ListView reimFiles;
+
+ public DealSingleReimbursementController(){
+ aprovalId=0;
+ }
+
+ @FXML
+ private void initialize() {
+ // 在fxml被载入时候被自动调用
+ // 监听选择的改变
+ reimFiles.getSelectionModel().selectedItemProperty()
+ .addListener((observable, oldValue, newValue) -> downloadReimFile(newValue.getId()));
+ }
+
+ /*
+ * @param mainApp
+ */
+ public void setMainApp(MainApp mainApp) {
+ this.mainApp = mainApp;
+ }
+
+ public void setReimInfo(Reimbursement reimbursement) {
+ senderText.setText(reimbursement.getSender());
+ receiverText.setText(reimbursement.getReceiver());
+ processText.setText(reimbursement.getProcess().toString());
+ moneyText.setText(reimbursement.getTotalMoney().toString());
+ numberText.setText(reimbursement.getNumber().toString());
+ contentText.setText(reimbursement.getContent());
+ detailTextArea.setText(reimbursement.getDetail());
+ aprovalId=reimbursement.getId();
+ // 如果邮件带有附件,将其显示到前端
+ showReimFiles(reimbursement);
+ }
+
+ private void showReimFiles(Reimbursement reimbursement) {
+ if (reimbursement.getFilesNumber() == 0) {
+ // 没有文件,隐藏附件列表
+ // ...
+ reimFilesTitleText.setText("报销凭证【当前报销申请无附加凭证】");
+ } else {
+ // 有文件,展示到前端
+ for (int i = 0; i < reimbursement.getFilesNumber(); i++) {
+ reimFiles.getItems().add(new reimbursementFileListItem(reimbursement.files.get(i)).getPaneItem());
+ }
+ }
+ }
+
+ //从服务器下载选中的附件到指定的本地文件夹下
+ private void downloadReimFile(String pathfilename) {
+ //选择要下载到的文件夹
+ String localDirString=mainApp.fileLocalPath;
+ DirectoryChooser directoryChooser=new DirectoryChooser();
+ directoryChooser.setTitle("选择要下载到的本地文件夹");
+ Stage selectFileStage = new Stage();
+ File file = directoryChooser.showDialog(selectFileStage);
+ if (file != null) {
+ //文件不为空,且不是文件夹
+ if(file.isDirectory()) {
+ localDirString=file.getPath()+"\\";
+ System.out.println("选中的文件夹为:"+localDirString);
+ }else {
+// 弹窗参考:https://code.makery.ch/blog/javafx-dialogs-official/
+ Alert alert = new Alert(Alert.AlertType.WARNING);
+ alert.setTitle("选中类型错误");
+ alert.setHeaderText("你的选中类型错误");
+ alert.setContentText("请确保你选中的是一个文件夹而不是一个文件。");
+ alert.showAndWait();
+ }
+ }else{
+ return ;
+ }
+
+ System.out.println("开始下载... :"+pathfilename);
+ int flag=mainApp.downloadFileByPathfilename(pathfilename,localDirString);
+ if(flag==0) {
+// 弹窗参考:https://code.makery.ch/blog/javafx-dialogs-official/
+ Alert alert = new Alert(Alert.AlertType.INFORMATION);
+ alert.setTitle("下载成功");
+ alert.setHeaderText("下载文件成功");
+ alert.setContentText("您请求的文件数据已经被全部下载到本地,"
+ + "如有发现打开异常或数据内容并非所求,说明出现了服务器数据请求问题。"
+ + "您的文件保存位置为:"+localDirString);
+ alert.showAndWait();
+ }else {
+// 弹窗参考:https://code.makery.ch/blog/javafx-dialogs-official/
+ Alert alert = new Alert(Alert.AlertType.ERROR);
+ alert.setTitle("下载失败");
+ alert.setHeaderText("下载文件失败");
+ alert.setContentText("本地文件数据写入失败,请检查是否有权限访问默认存储位置。"
+ + "您的文件默认保存位置为:"+localDirString);
+ alert.showAndWait();
+ }
+ }
+
+ public void setDialogStage(Stage stage) {
+ this.dialogStage = stage;
+ }
+
+ @FXML
+ private void exit() {
+ this.dialogStage.close();
+ }
+
+ @FXML
+ private void passReim(){
+ //通过报销
+ //否决报销
+ Integer r=makeReim(1);
+ if(r==0){
+ // 弹窗参考:https://code.makery.ch/blog/javafx-dialogs-official/
+ Alert alert = new Alert(Alert.AlertType.INFORMATION);
+ alert.setTitle("通过报销成功");
+ alert.setHeaderText("已通过该报销申请");
+ alert.setContentText("已通过该报销申请,报销的ID为:"+aprovalId);
+ alert.showAndWait();
+ exit();
+ }else{
+ Alert alert = new Alert(Alert.AlertType.ERROR);
+ alert.setTitle("通过报销失败");
+ alert.setHeaderText("通过该报销申请失败");
+ alert.setContentText("由于未知原因,不能通过该报销申请,报销的ID为:"+aprovalId);
+ alert.showAndWait();
+ exit();
+ }
+ }
+
+ @FXML
+ private void vetoReim(){
+ //否决报销
+ Integer r=makeReim(0);
+ if(r==0){
+ // 弹窗参考:https://code.makery.ch/blog/javafx-dialogs-official/
+ Alert alert = new Alert(Alert.AlertType.INFORMATION);
+ alert.setTitle("否决报销成功");
+ alert.setHeaderText("已否决该报销申请");
+ alert.setContentText("已否决该报销申请,报销的ID为:"+aprovalId);
+ alert.showAndWait();
+ exit();
+ }else{
+ Alert alert = new Alert(Alert.AlertType.ERROR);
+ alert.setTitle("否决报销失败");
+ alert.setHeaderText("否决该报销申请失败");
+ alert.setContentText("由于未知原因,不能否决该报销申请,报销的ID为:"+aprovalId);
+ alert.showAndWait();
+ exit();
+ }
+ }
+
+ //审核报销:0不通过,1通过
+ private Integer makeReim(Integer rstCode){
+ if(aprovalId==0){
+ return -1;
+ }
+ // 请求数据
+ OrderInfo orderInfo = new OrderInfo();
+ ResponseData responseData = new ResponseData();
+ Long seqLong = mainApp.getNewDataReqId();
+ orderInfo.setSeq(seqLong);
+ orderInfo.setJsonString(getDealApproval(aprovalId,rstCode));
+ mainApp.minoaDataAPI.executeOrder("/dealApproval", orderInfo);
+ responseData = mainApp.minoaDataAPI.dataCacheQueue.getResponseDataBySeq(seqLong);
+ JSONObject jsonObject = responseData.praseRequestData();
+ responseData.printSelf();
+ // 解析数据
+ Integer codeInteger = null;
+ try {
+ codeInteger = jsonObject.getInt("code");
+ } catch (JSONException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ if (codeInteger == 200) {
+ return 0;
+ } else {
+ return -1;
+ }
+ }
+
+ // 审核报销命令: 0表示不通过,1表示通过
+ private String getDealApproval(Integer aprId,Integer rstCode) {
+ JSONObject jsonObject = new JSONObject();
+ String commandString = "/dealApproval";
+ String usernameString = mainApp.loginer.getUserName();
+ String uuidString = mainApp.loginer.getUuid();
+ Integer approvalIdInteger = aprId;
+ Integer approvalRstInteger = rstCode;
+ try {
+ jsonObject.put("command", commandString);
+ jsonObject.put("username", usernameString);
+ jsonObject.put("uuid", uuidString);
+ jsonObject.put("approvalId", approvalIdInteger);
+ jsonObject.put("approvalRst", approvalRstInteger);
+ jsonObject.put("reason","no reason");
+ } catch (Exception e) {
+ // TODO: handle exception
+ System.out.println("exception: " + e.getMessage());
+ }
+ return jsonObject.toString();
+ }
+
+}
diff --git a/src/main/java/cn/minoa/view/home/HomeListController.java b/src/main/java/cn/minoa/view/home/HomeListController.java
index ab87a85..7f78454 100644
--- a/src/main/java/cn/minoa/view/home/HomeListController.java
+++ b/src/main/java/cn/minoa/view/home/HomeListController.java
@@ -5,6 +5,7 @@ import javafx.fxml.FXML;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
+import java.io.IOException;
public class HomeListController {
@SuppressWarnings("unused")
@@ -40,4 +41,14 @@ public class HomeListController {
public void setMainApp(MainApp mainApp) {
this.mainApp = mainApp;
}
+
+ @FXML
+ private void showReimApplyView() throws IOException {
+ mainApp.showReimbursementOverview();
+ }
+
+ @FXML
+ private void showReimDealView() throws IOException {
+ mainApp.showReimbursementDealOverview();
+ }
}
diff --git a/src/main/java/cn/minoa/view/home/ReimbursementApplyController.java b/src/main/java/cn/minoa/view/home/ReimbursementApplyController.java
new file mode 100644
index 0000000..12b6bf8
--- /dev/null
+++ b/src/main/java/cn/minoa/view/home/ReimbursementApplyController.java
@@ -0,0 +1,344 @@
+package cn.minoa.view.home;
+
+import java.io.IOException;
+import java.util.LinkedList;
+import java.util.List;
+
+import cn.minoa.model.Reimbursement;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import cn.minoa.MainApp;
+import cn.minoa.dataRequestInterface.OrderInfo;
+import cn.minoa.dataRequestInterface.ResponseData;
+import javafx.fxml.FXML;
+import javafx.scene.control.Button;
+import javafx.scene.control.ListView;
+import javafx.scene.layout.Pane;
+import javafx.scene.text.Text;
+
+public class ReimbursementApplyController {
+ private MainApp mainApp;
+ private List reimbursementInfoList;
+ private final String CONTROLSTRING_SEND;//表示“我发起的”
+ private final String CONTROLSTRING_RECEIVE;//表示“我审批的”
+
+ @FXML
+ private Text listTitleText;
+ @FXML
+ private ListView reimbursementList;
+
+ public ReimbursementApplyController() {
+ // TODO Auto-generated constructor stub
+ reimbursementInfoList = new LinkedList();
+ CONTROLSTRING_RECEIVE = "R";
+ CONTROLSTRING_SEND = "S";
+ }
+
+ @FXML
+ private void initialize() {
+ // 在fxml被载入时候被自动调用
+ // 监听选择的改变
+ reimbursementList.getSelectionModel().selectedItemProperty()
+ .addListener((observable, oldValue, newValue) -> showReimbursementDetails(Integer.parseInt(newValue.getId())));
+ }
+
+ /*
+ * @param mainApp
+ */
+ public void setMainApp(MainApp mainApp) {
+ // 被mainApp调用
+ this.mainApp = mainApp;
+ // 缺省标题
+ listTitleText.setText("我申报的报销列表");
+ // 初始化list
+ getReimbursement(0);
+ // 反应到前端
+ for (int i = 0; i < reimbursementInfoList.size(); i++) {
+ reimbursementList.getItems().add(new ReimbursementListItem(reimbursementInfoList.get(i)).getPaneItem());
+ }
+ }
+
+ /*
+ * @param mainApp
+ */
+ public void setMainApp(MainApp mainApp, String controlString) {
+ // 被mainApp调用
+ this.mainApp = mainApp;
+ if (controlString.equals(CONTROLSTRING_RECEIVE)) {
+ // 缺省标题
+ listTitleText.setText("我审核的报销列表");
+ // 初始化list
+ getReimbursement(1);
+ // 反应到前端
+ for (int i = 0; i < reimbursementInfoList.size(); i++) {
+ reimbursementList.getItems().add(new ReimbursementListItem(reimbursementInfoList.get(i)).getPaneItem());
+ }
+ } else {
+ // 缺省标题
+ listTitleText.setText("我申报的报销列表");
+ // 初始化list
+ getReimbursement(0);
+ // 反应到前端
+ for (int i = 0; i < reimbursementInfoList.size(); i++) {
+ reimbursementList.getItems().add(new ReimbursementListItem(reimbursementInfoList.get(i)).getPaneItem());
+ }
+ }
+ }
+
+ // 切换成我审批的报销审批
+ @FXML
+ private void switchToSendBox() {
+ try {
+ mainApp.reloadReimbursementOverview(CONTROLSTRING_SEND);
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ // 切换成我发出的报销审批
+ @FXML
+ private void switchToRecvBox() {
+ try {
+ mainApp.reloadReimbursementOverview(CONTROLSTRING_RECEIVE);
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ // 展示报销的详细信息的弹窗
+ private void showReimbursementDetails(Integer paneId) {
+ // 在当前数据结构中找到这个emailId对应的邮件
+ Reimbursement reimbursement = new Reimbursement();
+ for (int i = 0; i < reimbursementInfoList.size(); i++) {
+ reimbursement = reimbursementInfoList.get(i);
+ if (reimbursement.getId() == paneId) {
+ break;
+ }
+ }
+ // 传递给主函数
+ mainApp.showReimbursementDetailsDialog(reimbursement);
+ }
+
+ // 申请报销弹窗
+ @FXML
+ private void handleWritter() {
+ mainApp.showWritterReimbursementDialog();
+ }
+
+ // 发送数据请求请求发送给登录者的报销列表
+ private Integer getReimbursement(Integer queryCode) {
+ // 请求数据
+ OrderInfo orderInfo = new OrderInfo();
+ ResponseData responseData = new ResponseData();
+ Long seqLong = mainApp.getNewDataReqId();
+ orderInfo.setSeq(seqLong);
+ orderInfo.setJsonString(getGetApproval(queryCode));
+ mainApp.minoaDataAPI.executeOrder("/getApproval", orderInfo);
+ responseData = mainApp.minoaDataAPI.dataCacheQueue.getResponseDataBySeq(seqLong);
+ JSONObject jsonObject = responseData.praseRequestData();
+ responseData.printSelf();
+ // 解析数据
+ Integer codeInteger = null;
+ try {
+ codeInteger = jsonObject.getInt("code");
+ } catch (JSONException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ if (codeInteger == 200) {
+ String dataString;
+ try {
+ dataString = jsonObject.getString("data");
+ if ((dataString.equals("")) || (dataString.equals("null"))) {
+ reimbursementInfoList.clear();
+ return 0;
+ }
+ reimbursementInfoList.clear();
+ JSONArray dataJsonArray = new JSONArray(dataString);
+ String reimbursementCacheString;
+ JSONObject reimbursementCacheJsonObject;
+ // 遍历每个邮件信息
+ for (int i = 0; i < dataJsonArray.length(); i++) {
+ reimbursementCacheString = dataJsonArray.getString(i);
+ reimbursementCacheJsonObject = new JSONObject(reimbursementCacheString);
+ Integer id = reimbursementCacheJsonObject.getInt("approvalId");
+ String senderInfo = reimbursementCacheJsonObject.getString("proposer");
+ // 解析发送者和接收者的姓名
+ String receiverInfo = reimbursementCacheJsonObject.getString("approver");
+ Integer process=reimbursementCacheJsonObject.getInt("process");
+ String detailString = reimbursementCacheJsonObject.getString("detail");
+ JSONObject receiverJsonObject = new JSONObject(receiverInfo);
+ JSONObject senderJsonObject = new JSONObject(senderInfo);
+ String sender_usernameString = senderJsonObject.getString("username");
+ String receiver_usernameString = receiverJsonObject.getString("username");
+ // 解析报销详细内容
+ JSONObject detailJsonObject = new JSONObject(detailString);
+ Long detail_date = detailJsonObject.getLong("date");
+ String detail_content = detailJsonObject.getString("content");
+ Integer detail_invoiceNum = detailJsonObject.getInt("invoiceNum");
+ Double detail_totalMoney = detailJsonObject.getDouble("totalMoney");
+ String detail_detail = detailJsonObject.getString("detail");
+ //解析邮件的附件列表
+ String filesString=detailJsonObject.getString("pictures");
+ JSONArray filesJsonArray=new JSONArray(filesString);
+ List reimbursementfiles=new LinkedList();
+ for(int j=0;j reimbursementInfoList;
+
+ @FXML
+ private ListView reimbursementList;
+
+ public ReimbursementDealController(){
+ reimbursementInfoList = new LinkedList();
+ }
+
+ @FXML
+ private void initialize() {
+ // 在fxml被载入时候被自动调用
+ // 监听选择的改变
+ reimbursementList.getSelectionModel().selectedItemProperty()
+ .addListener((observable, oldValue, newValue) -> showReimbursementDetails(Integer.parseInt(newValue.getId())));
+ }
+
+ // 展示报销的详细信息的弹窗
+ private void showReimbursementDetails(Integer paneId) {
+ // 在当前数据结构中找到这个emailId对应的邮件
+ Reimbursement reimbursement = new Reimbursement();
+ for (int i = 0; i < reimbursementInfoList.size(); i++) {
+ reimbursement = reimbursementInfoList.get(i);
+ if (reimbursement.getId() == paneId) {
+ break;
+ }
+ }
+ // 传递给主函数
+ mainApp.dealReimbursementDetailsDialog(reimbursement);
+ }
+
+ //弹出一个可以选择通过审批或者拒绝通过审批的弹窗
+ private void dealReimbursementDetails(Integer paneId){
+ // 在当前数据结构中找到这个emailId对应的邮件
+ Reimbursement reimbursement = new Reimbursement();
+ for (int i = 0; i < reimbursementInfoList.size(); i++) {
+ reimbursement = reimbursementInfoList.get(i);
+ if (reimbursement.getId() == paneId) {
+ break;
+ }
+ }
+ //然后发条消息将这个审批给通过或否决
+ //...
+ }
+
+ /*
+ * @param mainApp
+ */
+ public void setMainApp(MainApp mainApp) {
+ // 被mainApp调用
+ this.mainApp = mainApp;
+ // 初始化list
+ getReimbursement(1);
+ // 反应到前端
+ for (int i = 0; i < reimbursementInfoList.size(); i++) {
+ reimbursementList.getItems().add(new ReimbursementListItem(reimbursementInfoList.get(i)).getPaneItem());
+ }
+ }
+
+ // 发送数据请求请求发送给登录者的报销列表
+ // 0表示我发送的,1表示发送给我的
+ // 要判断是否是已经被审核的,process=0表示还审核
+ private Integer getReimbursement(Integer queryCode) {
+ // 请求数据
+ OrderInfo orderInfo = new OrderInfo();
+ ResponseData responseData = new ResponseData();
+ Long seqLong = mainApp.getNewDataReqId();
+ orderInfo.setSeq(seqLong);
+ orderInfo.setJsonString(getGetApproval(queryCode));
+ mainApp.minoaDataAPI.executeOrder("/getApproval", orderInfo);
+ responseData = mainApp.minoaDataAPI.dataCacheQueue.getResponseDataBySeq(seqLong);
+ JSONObject jsonObject = responseData.praseRequestData();
+ responseData.printSelf();
+ // 解析数据
+ Integer codeInteger = null;
+ try {
+ codeInteger = jsonObject.getInt("code");
+ } catch (JSONException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ if (codeInteger == 200) {
+ String dataString;
+ try {
+ dataString = jsonObject.getString("data");
+ if ((dataString.equals("")) || (dataString.equals("null"))) {
+ reimbursementInfoList.clear();
+ return 0;
+ }
+ reimbursementInfoList.clear();
+ JSONArray dataJsonArray = new JSONArray(dataString);
+ String reimbursementCacheString;
+ JSONObject reimbursementCacheJsonObject;
+ // 遍历每个信息
+ for (int i = 0; i < dataJsonArray.length(); i++) {
+ reimbursementCacheString = dataJsonArray.getString(i);
+ reimbursementCacheJsonObject = new JSONObject(reimbursementCacheString);
+ Integer id = reimbursementCacheJsonObject.getInt("approvalId");
+ String senderInfo = reimbursementCacheJsonObject.getString("proposer");
+ // 解析发送者和接收者的姓名
+ String receiverInfo = reimbursementCacheJsonObject.getString("approver");
+ Integer process=reimbursementCacheJsonObject.getInt("process");
+ String detailString = reimbursementCacheJsonObject.getString("detail");
+ JSONObject receiverJsonObject = new JSONObject(receiverInfo);
+ JSONObject senderJsonObject = new JSONObject(senderInfo);
+ String sender_usernameString = senderJsonObject.getString("username");
+ String receiver_usernameString = receiverJsonObject.getString("username");
+ // 解析报销详细内容
+ JSONObject detailJsonObject = new JSONObject(detailString);
+ Long detail_date = detailJsonObject.getLong("date");
+ String detail_content = detailJsonObject.getString("content");
+ Integer detail_invoiceNum = detailJsonObject.getInt("invoiceNum");
+ Double detail_totalMoney = detailJsonObject.getDouble("totalMoney");
+ String detail_detail = detailJsonObject.getString("detail");
+ //解析邮件的附件列表
+ String filesString=detailJsonObject.getString("pictures");
+ JSONArray filesJsonArray=new JSONArray(filesString);
+ List reimbursementfiles=new LinkedList();
+ for(int j=0;j reimFiles;
+
+ public SingleReimbursementDetailsController(){
+ }
+
+ @FXML
+ private void initialize() {
+ // 在fxml被载入时候被自动调用
+ // 监听选择的改变
+ reimFiles.getSelectionModel().selectedItemProperty()
+ .addListener((observable, oldValue, newValue) -> downloadReimFile(newValue.getId()));
+ }
+
+ /*
+ * @param mainApp
+ */
+ public void setMainApp(MainApp mainApp) {
+ this.mainApp = mainApp;
+ }
+
+ public void setReimInfo(Reimbursement reimbursement) {
+ senderText.setText(reimbursement.getSender());
+ receiverText.setText(reimbursement.getReceiver());
+ processText.setText(reimbursement.getProcess().toString());
+ moneyText.setText(reimbursement.getTotalMoney().toString());
+ numberText.setText(reimbursement.getNumber().toString());
+ contentText.setText(reimbursement.getContent());
+ detailTextArea.setText(reimbursement.getDetail());
+ // 如果邮件带有附件,将其显示到前端
+ showReimFiles(reimbursement);
+ }
+
+ private void showReimFiles(Reimbursement reimbursement) {
+ if (reimbursement.getFilesNumber() == 0) {
+ // 没有文件,隐藏附件列表
+ // ...
+ reimFilesTitleText.setText("报销凭证【当前报销申请无附加凭证】");
+ } else {
+ // 有文件,展示到前端
+ for (int i = 0; i < reimbursement.getFilesNumber(); i++) {
+ reimFiles.getItems().add(new reimbursementFileListItem(reimbursement.files.get(i)).getPaneItem());
+ }
+ }
+ }
+
+ //从服务器下载选中的附件到指定的本地文件夹下
+ private void downloadReimFile(String pathfilename) {
+ //选择要下载到的文件夹
+ String localDirString=mainApp.fileLocalPath;
+ DirectoryChooser directoryChooser=new DirectoryChooser();
+ directoryChooser.setTitle("选择要下载到的本地文件夹");
+ Stage selectFileStage = new Stage();
+ File file = directoryChooser.showDialog(selectFileStage);
+ if (file != null) {
+ //文件不为空,且不是文件夹
+ if(file.isDirectory()) {
+ localDirString=file.getPath()+"\\";
+ System.out.println("选中的文件夹为:"+localDirString);
+ }else {
+// 弹窗参考:https://code.makery.ch/blog/javafx-dialogs-official/
+ Alert alert = new Alert(Alert.AlertType.WARNING);
+ alert.setTitle("选中类型错误");
+ alert.setHeaderText("你的选中类型错误");
+ alert.setContentText("请确保你选中的是一个文件夹而不是一个文件。");
+ alert.showAndWait();
+ }
+ }else{
+ return ;
+ }
+
+ System.out.println("开始下载... :"+pathfilename);
+ int flag=mainApp.downloadFileByPathfilename(pathfilename,localDirString);
+ if(flag==0) {
+// 弹窗参考:https://code.makery.ch/blog/javafx-dialogs-official/
+ Alert alert = new Alert(Alert.AlertType.INFORMATION);
+ alert.setTitle("下载成功");
+ alert.setHeaderText("下载文件成功");
+ alert.setContentText("您请求的文件数据已经被全部下载到本地,"
+ + "如有发现打开异常或数据内容并非所求,说明出现了服务器数据请求问题。"
+ + "您的文件保存位置为:"+localDirString);
+ alert.showAndWait();
+ }else {
+// 弹窗参考:https://code.makery.ch/blog/javafx-dialogs-official/
+ Alert alert = new Alert(Alert.AlertType.ERROR);
+ alert.setTitle("下载失败");
+ alert.setHeaderText("下载文件失败");
+ alert.setContentText("本地文件数据写入失败,请检查是否有权限访问默认存储位置。"
+ + "您的文件默认保存位置为:"+localDirString);
+ alert.showAndWait();
+ }
+ }
+
+ public void setDialogStage(Stage stage) {
+ this.dialogStage = stage;
+ }
+
+ @FXML
+ private void exit() {
+ this.dialogStage.close();
+ }
+}
diff --git a/src/main/java/cn/minoa/view/home/WrittenReimbursementController.java b/src/main/java/cn/minoa/view/home/WrittenReimbursementController.java
new file mode 100644
index 0000000..8f6bee8
--- /dev/null
+++ b/src/main/java/cn/minoa/view/home/WrittenReimbursementController.java
@@ -0,0 +1,403 @@
+package cn.minoa.view.home;
+
+import cn.minoa.MainApp;
+import cn.minoa.dataRequestInterface.OrderInfo;
+import cn.minoa.dataRequestInterface.ResponseData;
+import cn.minoa.model.Person;
+import cn.minoa.view.login.LoginOverviewController;
+import javafx.collections.ObservableList;
+import javafx.fxml.FXML;
+import javafx.scene.control.*;
+import javafx.scene.layout.Pane;
+import javafx.scene.text.Text;
+import javafx.stage.FileChooser;
+import javafx.stage.Stage;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.File;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+public class WrittenReimbursementController {
+
+ private MainApp mainApp;
+ private Stage dialogStage;
+
+ @FXML
+ private TextField receiverField;
+ @FXML
+ private TextField moneyField;
+ @FXML
+ private TextField numberField;
+ @FXML
+ private TextField contentField;
+ @FXML
+ private TextArea detailArea;
+
+ @FXML
+ private ListView reimbursementFiles;
+ //与之对应的数据结构
+ private List reimbursementFilesList;
+
+ public WrittenReimbursementController(){
+ reimbursementFilesList=new LinkedList();
+ }
+
+ @FXML
+ private void initialize() {
+ // 在fxml被载入时候被自动调用
+ receiverField.setPromptText("请输入一个联系人...");
+ moneyField.setPromptText("请输入一个正数...");
+ numberField.setPromptText("请输入一个正整数...");
+ contentField.setPromptText("请输入报销类别,如:采购经费、活动经费等...");
+ detailArea.setPromptText("请输入报销费用的详细描述...");
+ }
+
+ public void setMainApp(MainApp mainApp) {
+ this.mainApp = mainApp;
+ }
+
+ public void setStage(Stage stage) {
+ this.dialogStage = stage;
+ }
+
+ /*
+ * 从弹窗获取要添加的附件文件路径,将其加入到附件列表中,并显示到前端
+ */
+ @FXML
+ private void addFilesToReimbursement() {
+ FileChooser fileChooser = new FileChooser();
+ fileChooser.setTitle("选择上传文件");
+ Stage selectFileStage = new Stage();
+ File file = fileChooser.showOpenDialog(selectFileStage);
+ if (file != null) {
+ //文件不为空,且不是文件夹
+ if(file.isFile()) {
+ if(!isSelected(file.getAbsolutePath())) {
+ reimbursementFilesList.add(file.getAbsolutePath());
+ reimbursementFiles.getItems().add(new reimbursementFileListItem(file.getAbsolutePath()).getPaneItem());
+ }else {
+// 弹窗参考:https://code.makery.ch/blog/javafx-dialogs-official/
+ Alert alert = new Alert(Alert.AlertType.WARNING);
+ alert.setTitle("附件添加重复");
+ alert.setHeaderText("你选择的该文件已加入附件列表");
+ alert.setContentText("请确保你选中的文件是未加入附件列表的文件。");
+ alert.showAndWait();
+ }
+ }else {
+// 弹窗参考:https://code.makery.ch/blog/javafx-dialogs-official/
+ Alert alert = new Alert(Alert.AlertType.WARNING);
+ alert.setTitle("附件类型错误");
+ alert.setHeaderText("你的文件类型错误");
+ alert.setContentText("请确保你选中的是一个文件而非文件夹。");
+ alert.showAndWait();
+ }
+ }
+ }
+
+ //根据文件路径判断该选中文件是否已经加入到列表中
+ private boolean isSelected(String absolutePath) {
+ boolean flag=false;
+ //...
+ return flag;
+ }
+
+ @FXML
+ private void exit() {
+// System.out.println("关闭弹窗中...");
+ this.dialogStage.close();
+ }
+
+ //发送报销凭证
+ @FXML
+ private void handleSendReimbursement() {
+ if(isRightContent()) {
+ // 请求数据
+ OrderInfo orderInfo = new OrderInfo();
+ ResponseData responseData = new ResponseData();
+ Long seqLong = mainApp.getNewDataReqId();
+ orderInfo.setSeq(seqLong);
+ orderInfo.setJsonString(getSendApproval());
+ System.out.println("getSendApproval: " + orderInfo.getJsonString());
+ mainApp.minoaDataAPI.executeOrder("/sendApproval", orderInfo);
+ responseData = mainApp.minoaDataAPI.dataCacheQueue.getResponseDataBySeq(seqLong);
+ JSONObject jsonObject = responseData.praseRequestData();
+ responseData.printSelf();
+ // 解析数据
+ Integer codeInteger = null;
+ try {
+ codeInteger = jsonObject.getInt("code");
+ } catch (JSONException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ if (codeInteger == 200) {
+// 弹窗参考:https://code.makery.ch/blog/javafx-dialogs-official/
+ Alert alert = new Alert(Alert.AlertType.INFORMATION);
+ alert.setTitle("发送成功");
+ alert.setHeaderText("报销发送成功");
+ alert.setContentText("你的报销申请已经发送给审核人。");
+ alert.showAndWait();
+ exit();
+ }else {
+// 弹窗参考:https://code.makery.ch/blog/javafx-dialogs-official/
+ Alert alert = new Alert(Alert.AlertType.WARNING);
+ alert.setTitle("发送失败");
+ alert.setHeaderText("报销发送失败");
+ alert.setContentText("登录信息过期,报销发送失败,请尝试重新登录。");
+ alert.showAndWait();
+ }
+ }
+ }
+
+ //验证报销格式
+ private boolean isRightContent() {
+ //验证接收人是否是联系人列表中的一个
+ String receiverName = receiverField.getText().trim();
+ Integer flag = 0;
+ ObservableList persons = mainApp.contactListData;
+ for (Iterator iterator = persons.iterator(); iterator.hasNext(); ) {
+ Person person = (Person) iterator.next();
+ if (person.getUserName().equals(receiverName)) {
+ flag++;
+ }
+ }
+ if (flag == 0) {
+ //弹窗提示
+// 弹窗参考:https://code.makery.ch/blog/javafx-dialogs-official/
+ Alert alert = new Alert(Alert.AlertType.WARNING);
+ alert.setTitle("收件人错误");
+ alert.setHeaderText("你的收件人错误");
+ alert.setContentText("请确保你输入的收件人姓名是系统的实际用户。");
+ alert.showAndWait();
+ return false;
+ }
+ //验证金额
+ if (moneyField.getText().trim().equals("")) {
+ //弹窗提示
+// 弹窗参考:https://code.makery.ch/blog/javafx-dialogs-official/
+ Alert alert = new Alert(Alert.AlertType.WARNING);
+ alert.setTitle("报销金额错误");
+ alert.setHeaderText("你的报销金额错误");
+ alert.setContentText("请确保你输入的报销金额不为空。");
+ alert.showAndWait();
+ return false;
+ } else {
+ try {
+ Double.parseDouble(moneyField.getText());
+ } catch (NumberFormatException e) {
+ //弹窗提示
+// 弹窗参考:https://code.makery.ch/blog/javafx-dialogs-official/
+ Alert alert = new Alert(Alert.AlertType.WARNING);
+ alert.setTitle("报销金额错误");
+ alert.setHeaderText("你的报销金额错误");
+ alert.setContentText("请确保你输入的报销金额是一个数字。");
+ alert.showAndWait();
+ return false;
+ }
+ }
+ //验证金额
+ if (numberField.getText().trim().equals("")) {
+ //弹窗提示
+// 弹窗参考:https://code.makery.ch/blog/javafx-dialogs-official/
+ Alert alert = new Alert(Alert.AlertType.WARNING);
+ alert.setTitle("单据张数错误");
+ alert.setHeaderText("你的单据张数错误");
+ alert.setContentText("请确保你输入的单据张数不为空。");
+ alert.showAndWait();
+ return false;
+ } else {
+ try {
+ Integer.parseInt(numberField.getText());
+ } catch (NumberFormatException e) {
+ //弹窗提示
+// 弹窗参考:https://code.makery.ch/blog/javafx-dialogs-official/
+ Alert alert = new Alert(Alert.AlertType.WARNING);
+ alert.setTitle("单据张数错误");
+ alert.setHeaderText("你的单据张数错误");
+ alert.setContentText("请确保你输入的单据张数是一个整数。");
+ alert.showAndWait();
+ return false;
+ }
+ }
+ //验证报销类别
+ if (contentField.getText().trim().equals("")) {
+ //弹窗提示
+// 弹窗参考:https://code.makery.ch/blog/javafx-dialogs-official/
+ Alert alert = new Alert(Alert.AlertType.WARNING);
+ alert.setTitle("报销内容错误");
+ alert.setHeaderText("你的报销内容错误");
+ alert.setContentText("请确保你输入的报销内容不为空。");
+ alert.showAndWait();
+ return false;
+ }
+ //验证报销详情
+ if (detailArea.getText().trim().equals("")) {
+ //弹窗提示
+// 弹窗参考:https://code.makery.ch/blog/javafx-dialogs-official/
+ Alert alert = new Alert(Alert.AlertType.WARNING);
+ alert.setTitle("费用详细错误");
+ alert.setHeaderText("你的费用详细错误");
+ alert.setContentText("请确保你输入的费用详细不为空。");
+ alert.showAndWait();
+ return false;
+ }
+ return true;
+ }
+
+ //发送报销命令
+ private String getSendApproval () {
+ JSONObject detailJsonObject = new JSONObject();
+ String detail_detailString = detailArea.getText().trim();
+ String detail_contentString = contentField.getText().trim();
+ Integer detail_numberInteger = Integer.parseInt(numberField.getText().trim());
+ Double detail_moneyDouble = Double.parseDouble(moneyField.getText().trim());
+ String detail_approvalER=receiverField.getText().trim();
+ Long detail_date=LoginOverviewController.getNowTimeStamp();
+ //根据已经添加的文件附件列表制作一个arraylist
+ JSONArray filesArray = new JSONArray();
+ for (int i = 0; i < reimbursementFilesList.size(); i++) {
+ String pathfilename = reimbursementFilesList.get(i);
+ //上传该文件到服务器共享文件夹目录下
+ File file = new File(pathfilename);
+ mainApp.uploadFileToServerSharedFolder(file);
+ //将该文件信息[服务器文件路径地址]写入邮件信息中
+ String oneFile = mainApp.sharedFileServerPath + getPureFileNameFromWindows(pathfilename);
+ filesArray.put(oneFile);
+ }
+ try {
+ detailJsonObject.put("date", detail_date);
+ detailJsonObject.put("content", detail_contentString);
+ detailJsonObject.put("invoiceNum",detail_numberInteger);
+ detailJsonObject.put("totalMoney",detail_moneyDouble);
+ detailJsonObject.put("detail",detail_detailString);
+ detailJsonObject.put("approvalER",detail_approvalER);
+ detailJsonObject.put("pictures", filesArray);
+ } catch (JSONException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+
+ JSONObject jsonObject = new JSONObject();
+ String commandString = "/sendApproval";
+ String usernameString = mainApp.loginer.getUserName();
+ String uuidString = mainApp.loginer.getUuid();
+ String approverString = receiverField.getText().trim();
+ Integer typeCodeInteger = 2;
+ try {
+ jsonObject.put("command", commandString);
+ jsonObject.put("username", usernameString);
+ jsonObject.put("uuid", uuidString);
+ jsonObject.put("approver", approverString);
+ jsonObject.put("typeCode", typeCodeInteger);
+ jsonObject.put("detail", detailJsonObject);
+ } catch (Exception e) {
+ // TODO: handle exception
+ System.out.println("exception: " + e.getMessage());
+ }
+ return jsonObject.toString();
+ }
+
+ // 根据包含路径的文件名获取纯文件名[windows本地]
+ private String getPureFileNameFromWindows(String pathfilename) {
+ // 标记最后一个/的下标
+ int indexLeft = -1;
+ for (int i = 0; i < pathfilename.length(); i++) {
+ if (pathfilename.charAt(i) == '\\') {
+ indexLeft = i;
+ }
+ }
+ if (indexLeft == -1) {
+ System.out.println("pure name[windows]: " + pathfilename);
+ return pathfilename;
+ } else {
+ System.out.println("pure name[windows]: " + pathfilename.substring(indexLeft + 1, pathfilename.length()));
+ return pathfilename.substring(indexLeft + 1, pathfilename.length());
+ }
+ }
+
+}
+
+//报销附件
+class reimbursementFileListItem {
+ // 外部pane
+ private Pane pane;
+ private Integer paneWidth;
+ private Integer paneHeight;
+ // 头像
+ private Button head;
+ private Integer headLength;
+ // 文本区域
+// public TextArea text;
+ private Text text;
+// private Integer textWidth;
+// private Integer textHeight;
+
+ // 每个Pane代映射了一个文件[路径+文件名+@文件类型]
+ String pathfilename;
+
+ // 组件位置属性
+ private Integer headXInteger;
+ private Integer headYInteger;
+ private Integer textXInteger;
+ private Integer textYInteger;
+
+ // 设置联系人头像
+ private void setHeadPortrait(Button button, String filetype) {
+ button.setStyle(
+ String.format("-fx-background-image: url('file:resources/images/emailFileIcon/%s.png')", filetype));
+ }
+
+ // 构造函数
+ public reimbursementFileListItem(String pathfiletypename) {
+ // 映射数据
+ this.pathfilename = pathfiletypename;
+ // 大小配置
+ paneWidth = 200;
+ paneHeight = 50;
+ headLength = 35;
+// textWidth = 150;
+// textHeight = 25;
+ // 位置配置
+ headXInteger = 10;
+ headYInteger = 10;
+ textXInteger = 70;
+ textYInteger = 28;
+
+ pane = new Pane();
+ head = new Button();
+ text = new Text();
+
+ // 最外面的pane的大小
+ pane.setPrefSize(paneWidth, paneHeight);
+
+ // 设置头像和pane的CSS的样式标识
+ head.getStyleClass().add("head");
+ pane.getStyleClass().add("pane");
+
+ // 设置消息头像和消息文本属性
+ head.setPrefSize(headLength, headLength);
+ }
+
+ // 根据person获取pane
+ public Pane getPaneItem() {
+ String name = this.pathfilename;
+ // 头像位置
+ head.setLayoutY(headYInteger);
+ head.setLayoutX(headXInteger);
+ // text位置
+ text.setLayoutX(textXInteger);
+ text.setLayoutY(textYInteger);
+ // 头像和气泡文本内容
+ text.setText(name);
+ setHeadPortrait(head, "f");
+ pane.getChildren().add(head);
+ pane.getChildren().add(text);
+ // 设置pane的id
+ pane.setId(name);
+ return pane;
+ }
+}
diff --git a/src/main/java/cn/minoa/view/mine/SingleEmailDetailsController.java b/src/main/java/cn/minoa/view/mine/SingleEmailDetailsController.java
index 2f47af4..02e4c47 100644
--- a/src/main/java/cn/minoa/view/mine/SingleEmailDetailsController.java
+++ b/src/main/java/cn/minoa/view/mine/SingleEmailDetailsController.java
@@ -54,8 +54,8 @@ public class SingleEmailDetailsController {
}
public void setEmailInfo(Email email) {
- senderText.setText(email.getSender());
- receiverText.setText(email.getReceiver());
+ senderText.setText(email.getSender()+"@pkusz.edu.cn");
+ receiverText.setText(email.getReceiver()+"@pkusz.edu.cn");
titleText.setText(email.getTitle());
contentText.setText(email.getContent());
// 如果邮件带有附件,将其显示到前端
@@ -119,7 +119,9 @@ public class SingleEmailDetailsController {
alert.setContentText("请确保你选中的是一个文件夹而不是一个文件。");
alert.showAndWait();
}
- }
+ }else{
+ return ;
+ }
System.out.println("开始下载... :"+pathfilename);
int flag=mainApp.downloadFileByPathfilename(pathfilename,localDirString);
diff --git a/src/main/java/cn/minoa/view/mine/WrittenEmailController.java b/src/main/java/cn/minoa/view/mine/WrittenEmailController.java
index 5b92068..d5be703 100644
--- a/src/main/java/cn/minoa/view/mine/WrittenEmailController.java
+++ b/src/main/java/cn/minoa/view/mine/WrittenEmailController.java
@@ -49,6 +49,9 @@ public class WrittenEmailController {
@FXML
private void initialize() {
// 在fxml被载入时候被自动调用
+ receiverField.setPromptText("请输入邮件地址(格式:昵称@pkusz.edu.cn)");
+ emailTitleField.setPromptText("请输入邮件主题...");
+ emailContentTextArea.setPromptText("请输入邮件内容...");
}
/*
@@ -95,6 +98,26 @@ public class WrittenEmailController {
}
}
}
+
+ //判断邮件地址是否符合要求
+ private boolean isRightEmailPath(String emailPath){
+ //取尾部字段:@pkusz.edu.cn [length=13]
+ if(emailPath.length()<=13){
+ return false;
+ }
+ String tailPath=emailPath.substring(emailPath.length()-13);
+ System.out.println("tailPath: "+tailPath);
+ if(tailPath.equals("@pkusz.edu.cn")){
+ return true;
+ }else{
+ return false;
+ }
+ }
+
+ //取邮件地址中的昵称字段
+ private String getUserInEmailPath(String emailPath){
+ return emailPath.substring(0,emailPath.length()-13);
+ }
//根据文件路径判断该选中文件是否已经加入到列表中
private boolean isSelected(String absolutePath) {
@@ -153,7 +176,18 @@ public class WrittenEmailController {
//验证邮件格式
private boolean isRightContent() {
//验证接收人是否是联系人列表中的一个
- String receiverName=receiverField.getText().trim();
+ String receiverRawName=receiverField.getText().trim();
+ if(!isRightEmailPath(receiverRawName)){
+ //弹窗提示
+// 弹窗参考:https://code.makery.ch/blog/javafx-dialogs-official/
+ Alert alert = new Alert(AlertType.WARNING);
+ alert.setTitle("地址后缀错误");
+ alert.setHeaderText("你的地址后缀错误");
+ alert.setContentText("请确保你输入的地址后缀是@pkusz.edu.cn,并保证前面有用户名。");
+ alert.showAndWait();
+ return false;
+ }
+ String receiverName=getUserInEmailPath(receiverRawName);
Integer flag=0;
ObservableList persons=mainApp.contactListData;
for (Iterator iterator = persons.iterator(); iterator.hasNext();) {
diff --git a/src/main/resources/fxml/home/DealSingleReimbursement.fxml b/src/main/resources/fxml/home/DealSingleReimbursement.fxml
new file mode 100644
index 0000000..b5c1ac7
--- /dev/null
+++ b/src/main/resources/fxml/home/DealSingleReimbursement.fxml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/fxml/home/HomeListOverview.fxml b/src/main/resources/fxml/home/HomeListOverview.fxml
index a321ba5..4867fa9 100644
--- a/src/main/resources/fxml/home/HomeListOverview.fxml
+++ b/src/main/resources/fxml/home/HomeListOverview.fxml
@@ -13,10 +13,10 @@
-
+
-
+
@@ -24,10 +24,10 @@
-
+
-
+
diff --git a/src/main/resources/fxml/home/ReimbursementApply.css b/src/main/resources/fxml/home/ReimbursementApply.css
new file mode 100644
index 0000000..fb14be2
--- /dev/null
+++ b/src/main/resources/fxml/home/ReimbursementApply.css
@@ -0,0 +1,46 @@
+/*list样式
+ * */
+.list-cell:empty {
+ -fx-background-color: white;
+}
+/*页面底色
+*/
+#upPane{
+ -fx-background-color:#E8F2FE;
+}
+/*文件图标样式
+ */
+.head{
+ -fx-background-radius: 1px;
+ -fx-background-position: center center;
+ -fx-background-repeat: no-repeat;
+ -fx-background-size: 40px 40px;
+ -fx-background-color: rgba(255,255,255,0);
+ -fx-background-image: url("file:resources/images/headPhotos/default.png");
+ -fx-cursor: hand;
+ -fx-border-width: 1px;
+ -fx-border-radius: 1px;
+ -fx-border-color:transparent;
+}
+.head:hover{
+ -fx-background-radius: 1px;
+ -fx-background-position: center center;
+ -fx-background-repeat: no-repeat;
+ -fx-background-color: transparent;
+ -fx-background-size: 40px 40px;
+ -fx-cursor: hand;
+ -fx-border-width: 1px;
+ -fx-border-radius: 1px;
+ -fx-border-color:transparent;
+}
+.head:pressed{
+ -fx-background-radius: 1px;
+ -fx-background-position: center center;
+ -fx-background-repeat: no-repeat;
+ -fx-background-color: transparent;
+ -fx-background-size: 40px 40px;
+ -fx-cursor: hand;
+ -fx-border-width: 1px;
+ -fx-border-radius: 1px;
+ -fx-border-color:transparent;
+}
\ No newline at end of file
diff --git a/src/main/resources/fxml/home/ReimbursementApplyOverview.fxml b/src/main/resources/fxml/home/ReimbursementApplyOverview.fxml
new file mode 100644
index 0000000..90d4eb2
--- /dev/null
+++ b/src/main/resources/fxml/home/ReimbursementApplyOverview.fxml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/fxml/home/ReimbursementDeal.css b/src/main/resources/fxml/home/ReimbursementDeal.css
new file mode 100644
index 0000000..fb14be2
--- /dev/null
+++ b/src/main/resources/fxml/home/ReimbursementDeal.css
@@ -0,0 +1,46 @@
+/*list样式
+ * */
+.list-cell:empty {
+ -fx-background-color: white;
+}
+/*页面底色
+*/
+#upPane{
+ -fx-background-color:#E8F2FE;
+}
+/*文件图标样式
+ */
+.head{
+ -fx-background-radius: 1px;
+ -fx-background-position: center center;
+ -fx-background-repeat: no-repeat;
+ -fx-background-size: 40px 40px;
+ -fx-background-color: rgba(255,255,255,0);
+ -fx-background-image: url("file:resources/images/headPhotos/default.png");
+ -fx-cursor: hand;
+ -fx-border-width: 1px;
+ -fx-border-radius: 1px;
+ -fx-border-color:transparent;
+}
+.head:hover{
+ -fx-background-radius: 1px;
+ -fx-background-position: center center;
+ -fx-background-repeat: no-repeat;
+ -fx-background-color: transparent;
+ -fx-background-size: 40px 40px;
+ -fx-cursor: hand;
+ -fx-border-width: 1px;
+ -fx-border-radius: 1px;
+ -fx-border-color:transparent;
+}
+.head:pressed{
+ -fx-background-radius: 1px;
+ -fx-background-position: center center;
+ -fx-background-repeat: no-repeat;
+ -fx-background-color: transparent;
+ -fx-background-size: 40px 40px;
+ -fx-cursor: hand;
+ -fx-border-width: 1px;
+ -fx-border-radius: 1px;
+ -fx-border-color:transparent;
+}
\ No newline at end of file
diff --git a/src/main/resources/fxml/home/ReimbursementDealOverview.fxml b/src/main/resources/fxml/home/ReimbursementDealOverview.fxml
new file mode 100644
index 0000000..a19801d
--- /dev/null
+++ b/src/main/resources/fxml/home/ReimbursementDealOverview.fxml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/fxml/home/SingleReimbursementDetails.fxml b/src/main/resources/fxml/home/SingleReimbursementDetails.fxml
new file mode 100644
index 0000000..b2fd46f
--- /dev/null
+++ b/src/main/resources/fxml/home/SingleReimbursementDetails.fxml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/fxml/home/WrittenReimbursementDetails.fxml b/src/main/resources/fxml/home/WrittenReimbursementDetails.fxml
new file mode 100644
index 0000000..f8e4b8a
--- /dev/null
+++ b/src/main/resources/fxml/home/WrittenReimbursementDetails.fxml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/fxml/mine/MyEmailOverview.fxml b/src/main/resources/fxml/mine/MyEmailOverview.fxml
index 48a9c19..0dfd81d 100644
--- a/src/main/resources/fxml/mine/MyEmailOverview.fxml
+++ b/src/main/resources/fxml/mine/MyEmailOverview.fxml
@@ -20,7 +20,7 @@
-
+
diff --git a/src/main/resources/fxml/mine/SingleEmailDetails.fxml b/src/main/resources/fxml/mine/SingleEmailDetails.fxml
index 4a28132..1027787 100644
--- a/src/main/resources/fxml/mine/SingleEmailDetails.fxml
+++ b/src/main/resources/fxml/mine/SingleEmailDetails.fxml
@@ -7,7 +7,7 @@
-
+
diff --git a/src/main/resources/fxml/mine/WrittenEmailDetails.fxml b/src/main/resources/fxml/mine/WrittenEmailDetails.fxml
index 5c815f5..a213f4f 100644
--- a/src/main/resources/fxml/mine/WrittenEmailDetails.fxml
+++ b/src/main/resources/fxml/mine/WrittenEmailDetails.fxml
@@ -8,6 +8,7 @@
+