diff --git a/WebRoot/WEB-INF/classes/com/jsh/action/asset/AssetAction.class b/WebRoot/WEB-INF/classes/com/jsh/action/asset/AssetAction.class
index 8a2b680a..3980ab42 100644
Binary files a/WebRoot/WEB-INF/classes/com/jsh/action/asset/AssetAction.class and b/WebRoot/WEB-INF/classes/com/jsh/action/asset/AssetAction.class differ
diff --git a/WebRoot/WEB-INF/classes/com/jsh/action/asset/ReportAction.class b/WebRoot/WEB-INF/classes/com/jsh/action/asset/ReportAction.class
index 16c9ca38..1e40724e 100644
Binary files a/WebRoot/WEB-INF/classes/com/jsh/action/asset/ReportAction.class and b/WebRoot/WEB-INF/classes/com/jsh/action/asset/ReportAction.class differ
diff --git a/WebRoot/WEB-INF/classes/com/jsh/action/basic/UserAction.class b/WebRoot/WEB-INF/classes/com/jsh/action/basic/UserAction.class
index 30fa8fa6..7f5d033a 100644
Binary files a/WebRoot/WEB-INF/classes/com/jsh/action/basic/UserAction.class and b/WebRoot/WEB-INF/classes/com/jsh/action/basic/UserAction.class differ
diff --git a/WebRoot/WEB-INF/classes/com/jsh/action/materials/DepotItemAction.class b/WebRoot/WEB-INF/classes/com/jsh/action/materials/DepotItemAction.class
index 38a7a910..ba2877bf 100644
Binary files a/WebRoot/WEB-INF/classes/com/jsh/action/materials/DepotItemAction.class and b/WebRoot/WEB-INF/classes/com/jsh/action/materials/DepotItemAction.class differ
diff --git a/WebRoot/WEB-INF/classes/com/jsh/dao/asset/ReportDAO.class b/WebRoot/WEB-INF/classes/com/jsh/dao/asset/ReportDAO.class
index 94f59f0a..d476dee8 100644
Binary files a/WebRoot/WEB-INF/classes/com/jsh/dao/asset/ReportDAO.class and b/WebRoot/WEB-INF/classes/com/jsh/dao/asset/ReportDAO.class differ
diff --git a/WebRoot/WEB-INF/classes/com/jsh/dao/asset/ReportIDAO.class b/WebRoot/WEB-INF/classes/com/jsh/dao/asset/ReportIDAO.class
index a1fa8523..31fa71a8 100644
Binary files a/WebRoot/WEB-INF/classes/com/jsh/dao/asset/ReportIDAO.class and b/WebRoot/WEB-INF/classes/com/jsh/dao/asset/ReportIDAO.class differ
diff --git a/WebRoot/WEB-INF/classes/com/jsh/dao/basic/UserBusinessDAO.class b/WebRoot/WEB-INF/classes/com/jsh/dao/basic/UserBusinessDAO.class
index 364d9439..09278624 100644
Binary files a/WebRoot/WEB-INF/classes/com/jsh/dao/basic/UserBusinessDAO.class and b/WebRoot/WEB-INF/classes/com/jsh/dao/basic/UserBusinessDAO.class differ
diff --git a/WebRoot/WEB-INF/classes/com/jsh/dao/basic/UserBusinessIDAO.class b/WebRoot/WEB-INF/classes/com/jsh/dao/basic/UserBusinessIDAO.class
index 08451d72..30e51bd6 100644
Binary files a/WebRoot/WEB-INF/classes/com/jsh/dao/basic/UserBusinessIDAO.class and b/WebRoot/WEB-INF/classes/com/jsh/dao/basic/UserBusinessIDAO.class differ
diff --git a/WebRoot/WEB-INF/classes/com/jsh/dao/materials/DepotHeadDAO.class b/WebRoot/WEB-INF/classes/com/jsh/dao/materials/DepotHeadDAO.class
index bd5ae618..b52cea52 100644
Binary files a/WebRoot/WEB-INF/classes/com/jsh/dao/materials/DepotHeadDAO.class and b/WebRoot/WEB-INF/classes/com/jsh/dao/materials/DepotHeadDAO.class differ
diff --git a/WebRoot/WEB-INF/classes/com/jsh/dao/materials/DepotHeadIDAO.class b/WebRoot/WEB-INF/classes/com/jsh/dao/materials/DepotHeadIDAO.class
index f556f175..ec22b35c 100644
Binary files a/WebRoot/WEB-INF/classes/com/jsh/dao/materials/DepotHeadIDAO.class and b/WebRoot/WEB-INF/classes/com/jsh/dao/materials/DepotHeadIDAO.class differ
diff --git a/WebRoot/WEB-INF/classes/com/jsh/dao/materials/DepotItemDAO.class b/WebRoot/WEB-INF/classes/com/jsh/dao/materials/DepotItemDAO.class
index 96302d0a..1b1bb4e9 100644
Binary files a/WebRoot/WEB-INF/classes/com/jsh/dao/materials/DepotItemDAO.class and b/WebRoot/WEB-INF/classes/com/jsh/dao/materials/DepotItemDAO.class differ
diff --git a/WebRoot/WEB-INF/classes/com/jsh/dao/materials/DepotItemIDAO.class b/WebRoot/WEB-INF/classes/com/jsh/dao/materials/DepotItemIDAO.class
index 2d9a9e50..fdefbedb 100644
Binary files a/WebRoot/WEB-INF/classes/com/jsh/dao/materials/DepotItemIDAO.class and b/WebRoot/WEB-INF/classes/com/jsh/dao/materials/DepotItemIDAO.class differ
diff --git a/WebRoot/WEB-INF/classes/com/jsh/exception/JshException.class b/WebRoot/WEB-INF/classes/com/jsh/exception/JshException.class
new file mode 100644
index 00000000..a900fd7a
Binary files /dev/null and b/WebRoot/WEB-INF/classes/com/jsh/exception/JshException.class differ
diff --git a/WebRoot/WEB-INF/classes/com/jsh/model/po/Basicuser.hbm.xml b/WebRoot/WEB-INF/classes/com/jsh/model/po/Basicuser.hbm.xml
index 5b7a04eb..e6abb717 100644
--- a/WebRoot/WEB-INF/classes/com/jsh/model/po/Basicuser.hbm.xml
+++ b/WebRoot/WEB-INF/classes/com/jsh/model/po/Basicuser.hbm.xml
@@ -18,7 +18,7 @@
-
+
登陆密码
diff --git a/WebRoot/WEB-INF/classes/com/jsh/model/vo/materials/DepotHeadModel.class b/WebRoot/WEB-INF/classes/com/jsh/model/vo/materials/DepotHeadModel.class
index aa655910..cb952e7c 100644
Binary files a/WebRoot/WEB-INF/classes/com/jsh/model/vo/materials/DepotHeadModel.class and b/WebRoot/WEB-INF/classes/com/jsh/model/vo/materials/DepotHeadModel.class differ
diff --git a/WebRoot/WEB-INF/classes/com/jsh/service/asset/AssetIService.class b/WebRoot/WEB-INF/classes/com/jsh/service/asset/AssetIService.class
index 71e2733d..33ccb5b2 100644
Binary files a/WebRoot/WEB-INF/classes/com/jsh/service/asset/AssetIService.class and b/WebRoot/WEB-INF/classes/com/jsh/service/asset/AssetIService.class differ
diff --git a/WebRoot/WEB-INF/classes/com/jsh/service/asset/AssetService.class b/WebRoot/WEB-INF/classes/com/jsh/service/asset/AssetService.class
index 670e2ed1..4aebc9c5 100644
Binary files a/WebRoot/WEB-INF/classes/com/jsh/service/asset/AssetService.class and b/WebRoot/WEB-INF/classes/com/jsh/service/asset/AssetService.class differ
diff --git a/WebRoot/WEB-INF/classes/com/jsh/service/asset/ReportIService.class b/WebRoot/WEB-INF/classes/com/jsh/service/asset/ReportIService.class
index 90823132..02a31771 100644
Binary files a/WebRoot/WEB-INF/classes/com/jsh/service/asset/ReportIService.class and b/WebRoot/WEB-INF/classes/com/jsh/service/asset/ReportIService.class differ
diff --git a/WebRoot/WEB-INF/classes/com/jsh/service/asset/ReportService.class b/WebRoot/WEB-INF/classes/com/jsh/service/asset/ReportService.class
index fe1201a8..e5434466 100644
Binary files a/WebRoot/WEB-INF/classes/com/jsh/service/asset/ReportService.class and b/WebRoot/WEB-INF/classes/com/jsh/service/asset/ReportService.class differ
diff --git a/WebRoot/WEB-INF/classes/com/jsh/service/basic/UserBusinessIService.class b/WebRoot/WEB-INF/classes/com/jsh/service/basic/UserBusinessIService.class
index 154fa1f0..fe35362d 100644
Binary files a/WebRoot/WEB-INF/classes/com/jsh/service/basic/UserBusinessIService.class and b/WebRoot/WEB-INF/classes/com/jsh/service/basic/UserBusinessIService.class differ
diff --git a/WebRoot/WEB-INF/classes/com/jsh/service/basic/UserBusinessService.class b/WebRoot/WEB-INF/classes/com/jsh/service/basic/UserBusinessService.class
index cc01cc51..3ebfc440 100644
Binary files a/WebRoot/WEB-INF/classes/com/jsh/service/basic/UserBusinessService.class and b/WebRoot/WEB-INF/classes/com/jsh/service/basic/UserBusinessService.class differ
diff --git a/WebRoot/WEB-INF/classes/com/jsh/service/basic/UserIService.class b/WebRoot/WEB-INF/classes/com/jsh/service/basic/UserIService.class
index 48a0f9bd..44acb782 100644
Binary files a/WebRoot/WEB-INF/classes/com/jsh/service/basic/UserIService.class and b/WebRoot/WEB-INF/classes/com/jsh/service/basic/UserIService.class differ
diff --git a/WebRoot/WEB-INF/classes/com/jsh/service/basic/UserService.class b/WebRoot/WEB-INF/classes/com/jsh/service/basic/UserService.class
index e2a903bc..69b98f37 100644
Binary files a/WebRoot/WEB-INF/classes/com/jsh/service/basic/UserService.class and b/WebRoot/WEB-INF/classes/com/jsh/service/basic/UserService.class differ
diff --git a/WebRoot/WEB-INF/classes/com/jsh/service/materials/DepotHeadIService.class b/WebRoot/WEB-INF/classes/com/jsh/service/materials/DepotHeadIService.class
index 603645db..c3319043 100644
Binary files a/WebRoot/WEB-INF/classes/com/jsh/service/materials/DepotHeadIService.class and b/WebRoot/WEB-INF/classes/com/jsh/service/materials/DepotHeadIService.class differ
diff --git a/WebRoot/WEB-INF/classes/com/jsh/service/materials/DepotHeadService.class b/WebRoot/WEB-INF/classes/com/jsh/service/materials/DepotHeadService.class
index 9e379826..76b63db3 100644
Binary files a/WebRoot/WEB-INF/classes/com/jsh/service/materials/DepotHeadService.class and b/WebRoot/WEB-INF/classes/com/jsh/service/materials/DepotHeadService.class differ
diff --git a/WebRoot/WEB-INF/classes/com/jsh/service/materials/DepotItemIService.class b/WebRoot/WEB-INF/classes/com/jsh/service/materials/DepotItemIService.class
index 864f20d2..49164b44 100644
Binary files a/WebRoot/WEB-INF/classes/com/jsh/service/materials/DepotItemIService.class and b/WebRoot/WEB-INF/classes/com/jsh/service/materials/DepotItemIService.class differ
diff --git a/WebRoot/WEB-INF/classes/com/jsh/service/materials/DepotItemService.class b/WebRoot/WEB-INF/classes/com/jsh/service/materials/DepotItemService.class
index 22c5f16f..183d72a8 100644
Binary files a/WebRoot/WEB-INF/classes/com/jsh/service/materials/DepotItemService.class and b/WebRoot/WEB-INF/classes/com/jsh/service/materials/DepotItemService.class differ
diff --git a/WebRoot/WEB-INF/classes/com/jsh/util/common/BeanFactoryUtil.class b/WebRoot/WEB-INF/classes/com/jsh/util/common/BeanFactoryUtil.class
index e4ca17d2..1585e535 100644
Binary files a/WebRoot/WEB-INF/classes/com/jsh/util/common/BeanFactoryUtil.class and b/WebRoot/WEB-INF/classes/com/jsh/util/common/BeanFactoryUtil.class differ
diff --git a/WebRoot/WEB-INF/classes/com/jsh/util/common/Tools.class b/WebRoot/WEB-INF/classes/com/jsh/util/common/Tools.class
index 6aa1fd0e..668b9714 100644
Binary files a/WebRoot/WEB-INF/classes/com/jsh/util/common/Tools.class and b/WebRoot/WEB-INF/classes/com/jsh/util/common/Tools.class differ
diff --git a/sql/jsh_erp.sql b/sql/jsh_erp.sql
index d35d2dfd..d4f661a8 100644
--- a/sql/jsh_erp.sql
+++ b/sql/jsh_erp.sql
@@ -2,7 +2,7 @@
MySQL Backup
Source Server Version: 5.1.54
Source Database: jsh_erp
-Date: 2016-11-13 13:35:26
+Date: 2016-11-20 13:29:35
*/
SET FOREIGN_KEY_CHECKS=0;
@@ -213,7 +213,7 @@ CREATE TABLE `jsh_log` (
PRIMARY KEY (`id`),
KEY `FKF2696AA13E226853` (`userID`),
CONSTRAINT `FKF2696AA13E226853` FOREIGN KEY (`userID`) REFERENCES `jsh_user` (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1664 DEFAULT CHARSET=utf8;
+) ENGINE=InnoDB AUTO_INCREMENT=1674 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `jsh_material`
@@ -295,7 +295,7 @@ CREATE TABLE `jsh_user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`username` varchar(255) NOT NULL COMMENT '用户姓名--例如张三',
`loginame` varchar(255) DEFAULT NULL COMMENT '登录用户名--可能为空',
- `password` varchar(30) DEFAULT NULL COMMENT '登陆密码',
+ `password` varchar(50) DEFAULT NULL COMMENT '登陆密码',
`position` varchar(200) DEFAULT NULL COMMENT '职位',
`department` varchar(255) DEFAULT NULL COMMENT '所属部门',
`email` varchar(100) DEFAULT NULL COMMENT '电子邮箱',
@@ -306,7 +306,7 @@ CREATE TABLE `jsh_user` (
`description` varchar(500) DEFAULT NULL COMMENT '用户描述信息',
`remark` varchar(500) DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=66 DEFAULT CHARSET=utf8;
+) ENGINE=InnoDB AUTO_INCREMENT=68 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `jsh_userbusiness`
@@ -360,11 +360,11 @@ INSERT INTO `jsh_functions` VALUES ('101','070203','资料查阅','0702','../Fil
INSERT INTO `jsh_log` VALUES ('1316','63','增加用户','192.168.1.105','2016-10-04 14:53:11','0','增加用户名称为 曹玉丽 成功!','增加用户成功'), ('1317','63','增加用户','192.168.1.105','2016-10-04 14:53:30','0','增加用户名称为 郭秀红 成功!','增加用户成功'), ('1318','63','更新用户','192.168.1.105','2016-10-04 14:53:47','0','更新用户ID为 64 成功!','更新用户成功'), ('1319','63','更新用户','192.168.1.105','2016-10-04 14:53:58','0','更新用户ID为 63 成功!','更新用户成功'), ('1320','63','退出系统','192.168.1.105','2016-10-04 14:54:21','0','管理用户:jishenghua 退出系统','jishenghua 退出系统'), ('1321','63','登录系统','192.168.1.105','2016-10-04 14:54:28','0','管理用户:jsh 登录系统','jsh 登录系统'), ('1322','63','更新用户','','2016-10-04 14:54:42','0','更新用户ID为 63密码信息 成功!','更新用户成功'), ('1323','63','登录系统','192.168.1.105','2016-10-04 14:54:47','0','管理用户:jsh 登录系统','jsh 登录系统'), ('1324','63','退出系统','192.168.1.105','2016-10-04 14:55:16','0','管理用户:jsh 退出系统','jsh 退出系统'), ('1325','64','登录系统','192.168.1.105','2016-10-04 14:55:24','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1326','64','批量删除角色','192.168.1.105','2016-10-04 14:56:01','0','批量删除角色ID为 6 成功!','批量删除角色成功'), ('1327','64','批量删除角色','192.168.1.105','2016-10-04 14:56:04','0','批量删除角色ID为 7 成功!','批量删除角色成功'), ('1328','64','批量删除角色','192.168.1.105','2016-10-04 14:56:07','0','批量删除角色ID为 8 成功!','批量删除角色成功'), ('1329','64','批量删除角色','192.168.1.105','2016-10-04 14:56:10','0','批量删除角色ID为 9 成功!','批量删除角色成功'), ('1330','64','批量删除角色','192.168.1.105','2016-10-04 14:56:13','0','批量删除角色ID为 10 成功!','批量删除角色成功'), ('1331','64','批量删除角色','192.168.1.105','2016-10-04 14:56:16','0','批量删除角色ID为 11 成功!','批量删除角色成功'), ('1332','64','删除角色','192.168.1.105','2016-10-04 14:56:50','0','删除角色ID为 19 成功!','删除角色成功'), ('1333','64','删除角色','192.168.1.105','2016-10-04 14:56:52','0','删除角色ID为 18 成功!','删除角色成功'), ('1334','64','删除角色','192.168.1.105','2016-10-04 14:56:53','0','删除角色ID为 17 成功!','删除角色成功'), ('1335','64','删除角色','192.168.1.105','2016-10-04 14:56:54','0','删除角色ID为 16 成功!','删除角色成功'), ('1336','64','删除角色','192.168.1.105','2016-10-04 14:56:56','0','删除角色ID为 20 成功!','删除角色成功'), ('1337','64','删除角色','192.168.1.105','2016-10-04 14:56:59','0','删除角色ID为 21 成功!','删除角色成功'), ('1338','64','删除角色','192.168.1.105','2016-10-04 14:57:00','0','删除角色ID为 15 成功!','删除角色成功'), ('1339','64','删除角色','192.168.1.105','2016-10-04 14:57:02','0','删除角色ID为 14 成功!','删除角色成功'), ('1340','64','删除角色','192.168.1.105','2016-10-04 14:57:04','0','删除角色ID为 13 成功!','删除角色成功'), ('1341','64','删除角色','192.168.1.105','2016-10-04 14:57:05','0','删除角色ID为 23 成功!','删除角色成功'), ('1342','64','删除角色','192.168.1.105','2016-10-04 14:57:07','0','删除角色ID为 25 成功!','删除角色成功'), ('1343','64','删除角色','192.168.1.105','2016-10-04 14:57:09','0','删除角色ID为 27 成功!','删除角色成功'), ('1344','64','删除角色','192.168.1.105','2016-10-04 14:57:10','0','删除角色ID为 28 成功!','删除角色成功'), ('1345','64','删除角色','192.168.1.105','2016-10-04 14:57:12','0','删除角色ID为 30 成功!','删除角色成功'), ('1346','64','删除角色','192.168.1.105','2016-10-04 14:57:14','0','删除角色ID为 32 成功!','删除角色成功'), ('1347','64','删除角色','192.168.1.105','2016-10-04 14:57:17','0','删除角色ID为 33 成功!','删除角色成功'), ('1348','64','删除角色','192.168.1.105','2016-10-04 14:57:18','0','删除角色ID为 35 成功!','删除角色成功'), ('1349','64','删除角色','192.168.1.105','2016-10-04 14:57:20','0','删除角色ID为 31 成功!','删除角色成功'), ('1350','64','删除角色','192.168.1.105','2016-10-04 14:57:21','0','删除角色ID为 29 成功!','删除角色成功'), ('1351','64','删除角色','192.168.1.105','2016-10-04 14:57:22','0','删除角色ID为 34 成功!','删除角色成功'), ('1352','64','删除角色','192.168.1.105','2016-10-04 14:57:23','0','删除角色ID为 36 成功!','删除角色成功'), ('1353','64','删除角色','192.168.1.105','2016-10-04 14:57:26','0','删除角色ID为 38 成功!','删除角色成功'), ('1354','64','删除角色','192.168.1.105','2016-10-04 14:57:27','0','删除角色ID为 40 成功!','删除角色成功'), ('1355','64','删除角色','192.168.1.105','2016-10-04 14:57:28','0','删除角色ID为 26 成功!','删除角色成功'), ('1356','64','删除角色','192.168.1.105','2016-10-04 14:57:29','0','删除角色ID为 24 成功!','删除角色成功'), ('1357','64','删除角色','192.168.1.105','2016-10-04 14:57:31','0','删除角色ID为 22 成功!','删除角色成功'), ('1358','64','删除角色','192.168.1.105','2016-10-04 14:57:32','0','删除角色ID为 37 成功!','删除角色成功'), ('1359','64','删除角色','192.168.1.105','2016-10-04 14:57:34','0','删除角色ID为 12 成功!','删除角色成功'), ('1360','64','更新UserBusiness','192.168.1.105','2016-10-04 14:58:08','0','更新UserBusiness的ID为 2 成功!','更新UserBusiness成功'), ('1361','64','更新UserBusiness','192.168.1.105','2016-10-04 15:00:01','0','更新UserBusiness的ID为 6 成功!','更新UserBusiness成功'), ('1362','64','更新UserBusiness','192.168.1.105','2016-10-04 15:00:29','0','更新UserBusiness的ID为 6 成功!','更新UserBusiness成功'), ('1363','64','增加UserBusiness','192.168.1.105','2016-10-04 15:00:56','0','增加UserBusiness为 UserRole 成功!','增加UserBusiness成功'), ('1364','64','增加UserBusiness','192.168.1.105','2016-10-04 15:01:01','0','增加UserBusiness为 UserDepot 成功!','增加UserBusiness成功'), ('1365','64','退出系统','192.168.1.105','2016-10-04 15:01:15','0','管理用户:cyl 退出系统','cyl 退出系统'), ('1366','63','登录系统','192.168.1.105','2016-10-04 15:01:17','0','管理用户:jsh 登录系统','jsh 登录系统'), ('1367','63','增加UserBusiness','192.168.1.105','2016-10-04 15:01:29','0','增加UserBusiness为 UserRole 成功!','增加UserBusiness成功'), ('1368','63','增加UserBusiness','192.168.1.105','2016-10-04 15:01:34','0','增加UserBusiness为 UserDepot 成功!','增加UserBusiness成功'), ('1369','63','退出系统','192.168.1.105','2016-10-04 15:01:40','0','管理用户:jsh 退出系统','jsh 退出系统'), ('1370','64','登录系统','192.168.1.105','2016-10-04 15:01:45','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1371','64','退出系统','192.168.1.105','2016-10-04 15:03:23','0','管理用户:cyl 退出系统','cyl 退出系统'), ('1372','63','登录系统','192.168.1.105','2016-10-04 15:03:31','0','管理用户:jsh 登录系统','jsh 登录系统'), ('1373','63','增加供应商','192.168.1.105','2016-10-04 15:15:37','0','增加供应商名称为 客户AAAA 成功!','增加供应商成功'), ('1374','63','增加仓管通','192.168.1.105','2016-10-04 15:16:30','0','增加仓管通编号为 123123 成功!','增加仓管通成功'), ('1375','63','保存仓管通明细','192.168.1.105','2016-10-04 15:16:30','0','保存仓管通明细对应主表编号为 4 成功!','保存仓管通明细成功'), ('1376','63','增加功能','192.168.1.105','2016-10-04 15:18:49','0','增加功能名称为 销售出库审核 成功!','增加功能成功'), ('1377','63','更新功能','192.168.1.105','2016-10-04 15:18:58','0','更新功能ID为 193 成功!','更新功能成功'), ('1378','63','更新功能','192.168.1.105','2016-10-04 15:19:14','0','更新功能ID为 193 成功!','更新功能成功'), ('1379','63','更新UserBusiness','192.168.1.105','2016-10-04 15:19:50','0','更新UserBusiness的ID为 5 成功!','更新UserBusiness成功'), ('1380','63','更新状态仓管通','192.168.1.105','2016-10-04 15:20:14','0','更新状态-待审核-ID为 4 成功!','更新状态仓管通成功'), ('1381','63','更新状态仓管通','192.168.1.105','2016-10-04 15:20:28','0','更新状态-已生效-ID为 4 成功!','更新状态仓管通成功'), ('1382','63','更新UserBusiness','192.168.1.105','2016-10-04 15:21:13','0','更新UserBusiness的ID为 6 成功!','更新UserBusiness成功'), ('1383','63','退出系统','192.168.1.105','2016-10-04 15:21:24','0','管理用户:jsh 退出系统','jsh 退出系统'), ('1384','64','登录系统','192.168.1.105','2016-10-04 15:21:26','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1385','63','登录系统','192.168.1.102','2016-10-05 10:00:48','0','管理用户:jsh 登录系统','jsh 登录系统'), ('1386','63','退出系统','192.168.1.102','2016-10-05 10:00:56','0','管理用户:jsh 退出系统','jsh 退出系统'), ('1387','64','登录系统','192.168.1.102','2016-10-05 10:01:00','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1388','64','退出系统','192.168.1.102','2016-10-05 10:01:24','0','管理用户:cyl 退出系统','cyl 退出系统'), ('1389','63','登录系统','192.168.1.102','2016-10-05 10:01:28','0','管理用户:jsh 登录系统','jsh 登录系统'), ('1390','63','更新UserBusiness','192.168.1.102','2016-10-05 10:02:07','0','更新UserBusiness的ID为 6 成功!','更新UserBusiness成功'), ('1391','63','退出系统','192.168.1.102','2016-10-05 10:02:11','0','管理用户:jsh 退出系统','jsh 退出系统'), ('1392','64','登录系统','192.168.1.102','2016-10-05 10:02:13','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1393','64','增加物料','192.168.1.102','2016-10-05 10:05:10','0','增加物料名称为 花边 成功!','增加物料成功'), ('1394','64','更新物料类别','192.168.1.102','2016-10-05 10:05:42','0','更新物料类别ID为 244 成功!','更新物料类别成功'), ('1395','64','增加物料类别','192.168.1.102','2016-10-05 10:08:28','0','增加物料类别名称为 棉布 成功!','增加物料类别成功'), ('1396','64','增加物料类别','192.168.1.102','2016-10-05 10:08:46','0','增加物料类别名称为 网布 成功!','增加物料类别成功'), ('1397','64','更新物料','192.168.1.102','2016-10-05 10:09:23','0','更新物料ID为 5 成功!','更新物料成功'), ('1398','64','批量删除仓管通','192.168.1.102','2016-10-05 10:11:05','1','批量删除仓管通ID为 1 失败!','批量删除仓管通失败'), ('1399','64','删除物料','192.168.1.102','2016-10-05 10:11:41','0','删除物料ID为 4 成功!','删除物料成功'), ('1400','64','增加物料','192.168.1.102','2016-10-05 10:13:11','0','增加物料名称为 花边 成功!','增加物料成功'), ('1401','64','增加物料','192.168.1.102','2016-10-05 10:15:21','0','增加物料名称为 花边 成功!','增加物料成功'), ('1402','64','增加物料','192.168.1.102','2016-10-05 10:15:55','0','增加物料名称为 花边 成功!','增加物料成功'), ('1403','64','增加仓管通','192.168.1.102','2016-10-05 10:18:39','0','增加仓管通编号为 30198 成功!','增加仓管通成功'), ('1404','64','更新仓管通','192.168.1.102','2016-10-05 10:19:42','0','更新仓管通ID为 5 成功!','更新仓管通成功'), ('1405','64','保存仓管通明细','192.168.1.102','2016-10-05 10:19:42','0','保存仓管通明细对应主表编号为 5 成功!','保存仓管通明细成功'), ('1406','64','更新仓管通','192.168.1.102','2016-10-05 10:21:18','0','更新仓管通ID为 5 成功!','更新仓管通成功'), ('1407','64','保存仓管通明细','192.168.1.102','2016-10-05 10:21:18','0','保存仓管通明细对应主表编号为 5 成功!','保存仓管通明细成功'), ('1408','64','增加仓管通','192.168.1.102','2016-10-05 10:22:35','0','增加仓管通编号为 30199 成功!','增加仓管通成功'), ('1409','64','增加物料类别','192.168.1.102','2016-10-05 10:24:53','0','增加物料类别名称为 其他 成功!','增加物料类别成功'), ('1410','64','增加物料','192.168.1.102','2016-10-05 10:25:48','0','增加物料名称为 花边 成功!','增加物料成功'), ('1411','64','增加物料','192.168.1.102','2016-10-05 10:26:37','0','增加物料名称为 花边 成功!','增加物料成功'), ('1412','64','增加物料','192.168.1.102','2016-10-05 10:27:30','0','增加物料名称为 花边 成功!','增加物料成功'), ('1413','64','增加物料','192.168.1.102','2016-10-05 10:28:48','0','增加物料名称为 花边 成功!','增加物料成功'), ('1414','64','增加物料','192.168.1.102','2016-10-05 10:31:03','0','增加物料名称为 线边 成功!','增加物料成功'), ('1415','64','更新物料','192.168.1.102','2016-10-05 10:34:21','0','更新物料ID为 13 成功!','更新物料成功');
INSERT INTO `jsh_log` VALUES ('1416','64','更新物料','192.168.1.102','2016-10-05 10:34:40','0','更新物料ID为 11 成功!','更新物料成功'), ('1417','64','更新物料','192.168.1.102','2016-10-05 10:34:45','0','更新物料ID为 10 成功!','更新物料成功'), ('1418','64','更新物料','192.168.1.102','2016-10-05 10:35:24','0','更新物料ID为 9 成功!','更新物料成功'), ('1419','64','更新物料','192.168.1.102','2016-10-05 10:35:37','0','更新物料ID为 8 成功!','更新物料成功'), ('1420','64','更新物料','192.168.1.102','2016-10-05 10:35:44','0','更新物料ID为 7 成功!','更新物料成功'), ('1421','63','登录系统','192.168.1.102','2016-10-05 10:44:31','0','管理用户:jsh 登录系统','jsh 登录系统'), ('1422','63','退出系统','192.168.1.102','2016-10-05 10:44:39','0','管理用户:jsh 退出系统','jsh 退出系统'), ('1423','64','登录系统','192.168.1.102','2016-10-05 10:44:44','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1424','64','登录系统','192.168.1.102','2016-10-05 12:00:45','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1425','64','登录系统','192.168.1.102','2016-10-05 12:02:51','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1426','64','更新物料','192.168.1.102','2016-10-05 12:05:01','0','更新物料ID为 9 成功!','更新物料成功'), ('1427','64','更新仓管通','192.168.1.102','2016-10-05 12:07:32','0','更新仓管通ID为 6 成功!','更新仓管通成功'), ('1428','64','保存仓管通明细','192.168.1.102','2016-10-05 12:07:32','0','保存仓管通明细对应主表编号为 6 成功!','保存仓管通明细成功'), ('1429','64','登录系统','192.168.1.102','2016-10-05 12:33:28','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1430','64','批量删除仓管通','192.168.1.102','2016-10-05 12:34:27','1','批量删除仓管通ID为 6,5 失败!','批量删除仓管通失败'), ('1431','64','登录系统','192.168.1.102','2016-10-05 12:36:23','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1432','64','批量删除仓管通','192.168.1.102','2016-10-05 12:37:26','0','批量删除仓管通ID为 6,5 成功!','批量删除仓管通成功'), ('1433','64','批量删除物料','192.168.1.102','2016-10-05 12:37:39','0','批量删除物料ID为 5,6,7,8,9,10,11,12,13 成功!','批量删除物料成功'), ('1434','64','增加物料','192.168.1.102','2016-10-05 12:41:40','0','增加物料名称为 飞梭 成功!','增加物料成功'), ('1435','64','增加仓管通','192.168.1.102','2016-10-05 12:45:55','0','增加仓管通编号为 30198 成功!','增加仓管通成功'), ('1436','64','保存仓管通明细','192.168.1.102','2016-10-05 12:45:55','0','保存仓管通明细对应主表编号为 7 成功!','保存仓管通明细成功'), ('1437','64','增加物料','192.168.1.102','2016-10-05 12:46:55','0','增加物料名称为 飞梭 成功!','增加物料成功'), ('1438','64','更新仓管通','192.168.1.102','2016-10-05 12:47:23','0','更新仓管通ID为 7 成功!','更新仓管通成功'), ('1439','64','保存仓管通明细','192.168.1.102','2016-10-05 12:47:23','0','保存仓管通明细对应主表编号为 7 成功!','保存仓管通明细成功'), ('1440','64','增加仓管通','192.168.1.102','2016-10-05 12:51:01','0','增加仓管通编号为 30199 成功!','增加仓管通成功'), ('1441','64','保存仓管通明细','192.168.1.102','2016-10-05 12:51:02','0','保存仓管通明细对应主表编号为 8 成功!','保存仓管通明细成功'), ('1442','64','增加仓管通','192.168.1.102','2016-10-05 12:52:10','0','增加仓管通编号为 30205 成功!','增加仓管通成功'), ('1443','64','保存仓管通明细','192.168.1.102','2016-10-05 12:52:10','0','保存仓管通明细对应主表编号为 9 成功!','保存仓管通明细成功'), ('1444','64','增加物料','192.168.1.102','2016-10-05 12:52:52','0','增加物料名称为 飞梭 成功!','增加物料成功'), ('1445','64','更新仓管通','192.168.1.102','2016-10-05 12:57:46','0','更新仓管通ID为 9 成功!','更新仓管通成功'), ('1446','64','保存仓管通明细','192.168.1.102','2016-10-05 12:57:47','0','保存仓管通明细对应主表编号为 9 成功!','保存仓管通明细成功'), ('1447','64','增加物料','192.168.1.102','2016-10-05 12:58:37','0','增加物料名称为 棉线 成功!','增加物料成功'), ('1448','64','更新仓管通','192.168.1.102','2016-10-05 12:59:56','0','更新仓管通ID为 9 成功!','更新仓管通成功'), ('1449','64','保存仓管通明细','192.168.1.102','2016-10-05 12:59:57','0','保存仓管通明细对应主表编号为 9 成功!','保存仓管通明细成功'), ('1450','64','增加物料','192.168.1.102','2016-10-05 13:02:53','0','增加物料名称为 飞梭 成功!','增加物料成功'), ('1451','64','增加仓管通','192.168.1.102','2016-10-05 13:03:18','0','增加仓管通编号为 30213 成功!','增加仓管通成功'), ('1452','64','保存仓管通明细','192.168.1.102','2016-10-05 13:03:18','0','保存仓管通明细对应主表编号为 10 成功!','保存仓管通明细成功'), ('1453','64','增加仓管通','192.168.1.102','2016-10-05 13:11:36','0','增加仓管通编号为 30229 成功!','增加仓管通成功'), ('1454','64','保存仓管通明细','192.168.1.102','2016-10-05 13:11:36','0','保存仓管通明细对应主表编号为 11 成功!','保存仓管通明细成功'), ('1455','64','更新仓管通','192.168.1.102','2016-10-05 14:19:29','0','更新仓管通ID为 9 成功!','更新仓管通成功'), ('1456','64','更新仓管通','192.168.1.102','2016-10-05 14:19:59','0','更新仓管通ID为 9 成功!','更新仓管通成功'), ('1457','64','增加仓管通','192.168.1.102','2016-10-05 14:23:56','0','增加仓管通编号为 30230 成功!','增加仓管通成功'), ('1458','64','保存仓管通明细','192.168.1.102','2016-10-05 14:23:58','0','保存仓管通明细对应主表编号为 12 成功!','保存仓管通明细成功'), ('1459','64','增加仓管通','192.168.1.102','2016-10-05 14:30:48','0','增加仓管通编号为 30228 成功!','增加仓管通成功'), ('1460','64','保存仓管通明细','192.168.1.102','2016-10-05 14:30:50','0','保存仓管通明细对应主表编号为 13 成功!','保存仓管通明细成功'), ('1461','64','增加物料','192.168.1.102','2016-10-05 14:31:53','0','增加物料名称为 棉线 成功!','增加物料成功'), ('1462','64','增加物料','192.168.1.102','2016-10-05 14:34:39','0','增加物料名称为 棉线 成功!','增加物料成功'), ('1463','64','增加物料','192.168.1.102','2016-10-05 14:35:24','0','增加物料名称为 棉线 成功!','增加物料成功'), ('1464','64','增加物料','192.168.1.102','2016-10-05 14:38:22','0','增加物料名称为 棉线 成功!','增加物料成功'), ('1465','64','增加物料','192.168.1.102','2016-10-05 14:41:03','0','增加物料名称为 棉线 成功!','增加物料成功'), ('1466','64','更新仓管通','192.168.1.102','2016-10-05 14:43:45','0','更新仓管通ID为 13 成功!','更新仓管通成功'), ('1467','64','保存仓管通明细','192.168.1.102','2016-10-05 14:43:46','0','保存仓管通明细对应主表编号为 13 成功!','保存仓管通明细成功'), ('1468','64','增加仓管通','192.168.1.102','2016-10-05 14:44:56','0','增加仓管通编号为 30227 成功!','增加仓管通成功'), ('1469','64','增加物料','192.168.1.102','2016-10-05 14:46:19','0','增加物料名称为 飞梭 成功!','增加物料成功'), ('1470','64','更新仓管通','192.168.1.102','2016-10-05 14:46:59','0','更新仓管通ID为 14 成功!','更新仓管通成功'), ('1471','64','保存仓管通明细','192.168.1.102','2016-10-05 14:46:59','0','保存仓管通明细对应主表编号为 14 成功!','保存仓管通明细成功'), ('1472','64','增加物料','192.168.1.102','2016-10-05 14:47:44','0','增加物料名称为 飞梭 成功!','增加物料成功'), ('1473','64','更新仓管通','192.168.1.102','2016-10-05 14:49:08','0','更新仓管通ID为 14 成功!','更新仓管通成功'), ('1474','64','保存仓管通明细','192.168.1.102','2016-10-05 14:49:09','0','保存仓管通明细对应主表编号为 14 成功!','保存仓管通明细成功'), ('1475','64','增加物料','192.168.1.102','2016-10-05 14:51:24','0','增加物料名称为 飞梭 成功!','增加物料成功'), ('1476','64','增加仓管通','192.168.1.102','2016-10-05 14:52:10','0','增加仓管通编号为 30257 成功!','增加仓管通成功'), ('1477','64','保存仓管通明细','192.168.1.102','2016-10-05 14:52:12','0','保存仓管通明细对应主表编号为 15 成功!','保存仓管通明细成功'), ('1478','64','增加物料','192.168.1.102','2016-10-05 14:55:48','0','增加物料名称为 飞梭 成功!','增加物料成功'), ('1479','64','增加仓管通','192.168.1.102','2016-10-05 14:56:40','0','增加仓管通编号为 30249 成功!','增加仓管通成功'), ('1480','64','保存仓管通明细','192.168.1.102','2016-10-05 14:56:42','0','保存仓管通明细对应主表编号为 16 成功!','保存仓管通明细成功'), ('1481','64','增加物料','192.168.1.102','2016-10-05 14:59:16','0','增加物料名称为 飞梭 成功!','增加物料成功'), ('1482','64','增加物料','192.168.1.102','2016-10-05 15:00:43','0','增加物料名称为 飞梭 成功!','增加物料成功'), ('1483','64','增加物料','192.168.1.102','2016-10-05 15:03:20','0','增加物料名称为 棉线 成功!','增加物料成功'), ('1484','64','增加物料','192.168.1.102','2016-10-05 15:16:06','0','增加物料名称为 棉线 成功!','增加物料成功'), ('1485','64','增加仓管通','192.168.1.102','2016-10-05 15:16:53','0','增加仓管通编号为 30258 成功!','增加仓管通成功'), ('1486','64','保存仓管通明细','192.168.1.102','2016-10-05 15:16:56','0','保存仓管通明细对应主表编号为 17 成功!','保存仓管通明细成功'), ('1487','64','增加物料','192.168.1.102','2016-10-05 15:20:21','0','增加物料名称为 棉线 成功!','增加物料成功'), ('1488','64','更新仓管通','192.168.1.102','2016-10-05 15:21:11','0','更新仓管通ID为 17 成功!','更新仓管通成功'), ('1489','64','保存仓管通明细','192.168.1.102','2016-10-05 15:21:12','0','保存仓管通明细对应主表编号为 17 成功!','保存仓管通明细成功'), ('1490','64','更新仓管通','192.168.1.102','2016-10-05 15:21:29','0','更新仓管通ID为 17 成功!','更新仓管通成功'), ('1491','64','增加物料','192.168.1.102','2016-10-05 15:25:26','0','增加物料名称为 棉线 成功!','增加物料成功'), ('1492','64','增加仓管通','192.168.1.102','2016-10-05 15:31:34','0','增加仓管通编号为 30260 成功!','增加仓管通成功'), ('1493','64','保存仓管通明细','192.168.1.102','2016-10-05 15:31:36','0','保存仓管通明细对应主表编号为 18 成功!','保存仓管通明细成功'), ('1494','64','更新仓管通','192.168.1.102','2016-10-05 15:33:08','0','更新仓管通ID为 18 成功!','更新仓管通成功'), ('1495','64','保存仓管通明细','192.168.1.102','2016-10-05 15:33:10','0','保存仓管通明细对应主表编号为 18 成功!','保存仓管通明细成功'), ('1496','64','更新仓管通','192.168.1.102','2016-10-05 15:33:58','0','更新仓管通ID为 18 成功!','更新仓管通成功'), ('1497','64','增加物料','192.168.1.102','2016-10-05 15:35:44','0','增加物料名称为 棉线 成功!','增加物料成功'), ('1498','64','增加仓管通','192.168.1.102','2016-10-05 15:37:25','0','增加仓管通编号为 30271 成功!','增加仓管通成功'), ('1499','64','保存仓管通明细','192.168.1.102','2016-10-05 15:37:26','0','保存仓管通明细对应主表编号为 19 成功!','保存仓管通明细成功'), ('1500','64','增加仓管通','192.168.1.102','2016-10-05 15:40:12','0','增加仓管通编号为 30278 成功!','增加仓管通成功'), ('1501','64','保存仓管通明细','192.168.1.102','2016-10-05 15:40:19','0','保存仓管通明细对应主表编号为 20 成功!','保存仓管通明细成功'), ('1502','64','增加物料','192.168.1.102','2016-10-05 15:42:50','0','增加物料名称为 飞梭 成功!','增加物料成功'), ('1503','64','增加仓管通','192.168.1.102','2016-10-05 15:45:27','0','增加仓管通编号为 30296 成功!','增加仓管通成功'), ('1504','64','保存仓管通明细','192.168.1.102','2016-10-05 15:45:31','0','保存仓管通明细对应主表编号为 21 成功!','保存仓管通明细成功'), ('1505','64','增加物料','192.168.1.102','2016-10-05 15:49:31','0','增加物料名称为 飞梭 成功!','增加物料成功'), ('1506','64','增加物料','192.168.1.102','2016-10-05 15:50:44','0','增加物料名称为 飞梭 成功!','增加物料成功'), ('1507','64','增加物料','192.168.1.102','2016-10-05 15:52:26','0','增加物料名称为 飞梭 成功!','增加物料成功'), ('1508','64','增加物料','192.168.1.102','2016-10-05 15:54:11','0','增加物料名称为 飞梭 成功!','增加物料成功'), ('1509','64','增加仓管通','192.168.1.102','2016-10-05 15:55:02','0','增加仓管通编号为 30295 成功!','增加仓管通成功'), ('1510','64','保存仓管通明细','192.168.1.102','2016-10-05 15:55:04','0','保存仓管通明细对应主表编号为 22 成功!','保存仓管通明细成功'), ('1511','64','增加物料','192.168.1.102','2016-10-05 15:56:15','0','增加物料名称为 飞梭 成功!','增加物料成功'), ('1512','64','增加物料','192.168.1.102','2016-10-05 15:56:50','0','增加物料名称为 飞梭 成功!','增加物料成功'), ('1513','64','增加物料','192.168.1.102','2016-10-05 15:58:36','0','增加物料名称为 飞梭 成功!','增加物料成功'), ('1514','64','增加物料','192.168.1.102','2016-10-05 16:01:43','0','增加物料名称为 棉线 成功!','增加物料成功'), ('1515','64','增加物料','192.168.1.102','2016-10-05 16:05:22','0','增加物料名称为 飞梭 成功!','增加物料成功');
INSERT INTO `jsh_log` VALUES ('1516','64','增加仓管通','192.168.1.102','2016-10-05 16:06:32','0','增加仓管通编号为 30305 成功!','增加仓管通成功'), ('1517','64','保存仓管通明细','192.168.1.102','2016-10-05 16:06:33','0','保存仓管通明细对应主表编号为 23 成功!','保存仓管通明细成功'), ('1518','64','增加物料','192.168.1.102','2016-10-05 16:08:24','0','增加物料名称为 飞梭 成功!','增加物料成功'), ('1519','64','增加仓管通','192.168.1.102','2016-10-05 16:10:53','0','增加仓管通编号为 30309 成功!','增加仓管通成功'), ('1520','64','保存仓管通明细','192.168.1.102','2016-10-05 16:10:57','0','保存仓管通明细对应主表编号为 24 成功!','保存仓管通明细成功'), ('1521','64','增加仓管通','192.168.1.102','2016-10-05 16:13:45','0','增加仓管通编号为 30315 成功!','增加仓管通成功'), ('1522','64','保存仓管通明细','192.168.1.102','2016-10-05 16:13:49','0','保存仓管通明细对应主表编号为 25 成功!','保存仓管通明细成功'), ('1523','64','更新仓管通','192.168.1.102','2016-10-05 16:17:22','0','更新仓管通ID为 25 成功!','更新仓管通成功'), ('1524','64','保存仓管通明细','192.168.1.102','2016-10-05 16:17:23','0','保存仓管通明细对应主表编号为 25 成功!','保存仓管通明细成功'), ('1525','64','增加仓管通','192.168.1.102','2016-10-05 16:18:16','0','增加仓管通编号为 30316 成功!','增加仓管通成功'), ('1526','64','更新仓管通','192.168.1.102','2016-10-05 16:18:46','0','更新仓管通ID为 26 成功!','更新仓管通成功'), ('1527','64','登录系统','192.168.1.106','2016-10-05 17:01:51','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1528','64','登录系统','192.168.1.107','2016-10-06 08:24:57','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1529','64','登录系统','127.0.0.1','2016-10-06 10:43:18','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1530','64','登录系统','127.0.0.1','2016-10-06 15:04:09','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1531','64','登录系统','127.0.0.1','2016-10-06 15:30:25','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1532','64','登录系统','192.168.1.107','2016-10-06 20:13:50','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1533','64','增加仓管通','192.168.1.107','2016-10-06 21:37:26','0','增加仓管通编号为 1001 成功!','增加仓管通成功'), ('1534','64','保存仓管通明细','192.168.1.107','2016-10-06 21:37:27','0','保存仓管通明细对应主表编号为 27 成功!','保存仓管通明细成功'), ('1535','64','登录系统','192.168.1.107','2016-10-06 22:14:09','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1536','64','增加仓管通','192.168.1.107','2016-10-07 00:25:54','0','增加仓管通编号为 123123 成功!','增加仓管通成功'), ('1537','64','保存仓管通明细','192.168.1.107','2016-10-07 00:25:54','0','保存仓管通明细对应主表编号为 28 成功!','保存仓管通明细成功'), ('1538','64','更新仓管通','192.168.1.107','2016-10-07 00:27:33','0','更新仓管通ID为 28 成功!','更新仓管通成功'), ('1539','64','保存仓管通明细','192.168.1.107','2016-10-07 00:27:33','0','保存仓管通明细对应主表编号为 28 成功!','保存仓管通明细成功'), ('1540','64','登录系统','192.168.1.107','2016-10-07 07:11:42','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1541','64','更新仓管通','192.168.1.107','2016-10-07 07:12:52','0','更新仓管通ID为 27 成功!','更新仓管通成功'), ('1542','64','保存仓管通明细','192.168.1.107','2016-10-07 07:12:52','0','保存仓管通明细对应主表编号为 27 成功!','保存仓管通明细成功'), ('1543','64','更新仓管通','192.168.1.107','2016-10-07 07:16:15','0','更新仓管通ID为 28 成功!','更新仓管通成功'), ('1544','64','保存仓管通明细','192.168.1.107','2016-10-07 07:16:15','0','保存仓管通明细对应主表编号为 28 成功!','保存仓管通明细成功'), ('1545','64','登录系统','192.168.1.107','2016-10-07 08:42:16','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1546','64','更新仓管通','192.168.1.107','2016-10-07 09:11:13','0','更新仓管通ID为 28 成功!','更新仓管通成功'), ('1547','64','保存仓管通明细','192.168.1.107','2016-10-07 09:11:14','0','保存仓管通明细对应主表编号为 28 成功!','保存仓管通明细成功'), ('1548','64','退出系统','192.168.1.107','2016-10-07 09:12:07','0','管理用户:cyl 退出系统','cyl 退出系统'), ('1549','63','登录系统','192.168.1.107','2016-10-07 09:12:12','0','管理用户:jsh 登录系统','jsh 登录系统'), ('1550','63','更新UserBusiness','192.168.1.107','2016-10-07 09:12:49','0','更新UserBusiness的ID为 6 成功!','更新UserBusiness成功'), ('1551','63','退出系统','192.168.1.107','2016-10-07 09:12:53','0','管理用户:jsh 退出系统','jsh 退出系统'), ('1552','64','登录系统','192.168.1.107','2016-10-07 09:12:59','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1553','64','退出系统','192.168.1.107','2016-10-07 09:13:15','0','管理用户:cyl 退出系统','cyl 退出系统'), ('1554','63','登录系统','192.168.1.107','2016-10-07 09:13:20','0','管理用户:jsh 登录系统','jsh 登录系统'), ('1555','63','更新UserBusiness','192.168.1.107','2016-10-07 09:14:08','0','更新UserBusiness的ID为 6 成功!','更新UserBusiness成功'), ('1556','63','退出系统','192.168.1.107','2016-10-07 09:14:13','0','管理用户:jsh 退出系统','jsh 退出系统'), ('1557','64','登录系统','192.168.1.107','2016-10-07 09:14:18','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1558','64','退出系统','192.168.1.107','2016-10-07 09:14:55','0','管理用户:cyl 退出系统','cyl 退出系统'), ('1559','63','登录系统','192.168.1.107','2016-10-07 09:14:59','0','管理用户:jsh 登录系统','jsh 登录系统'), ('1560','63','更新UserBusiness','192.168.1.107','2016-10-07 09:15:52','0','更新UserBusiness的ID为 6 成功!','更新UserBusiness成功'), ('1561','63','退出系统','192.168.1.107','2016-10-07 09:15:56','0','管理用户:jsh 退出系统','jsh 退出系统'), ('1562','64','登录系统','192.168.1.107','2016-10-07 09:16:02','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1563','63','登录系统','192.168.8.105','2016-10-08 17:58:33','0','管理用户:jsh 登录系统','jsh 登录系统'), ('1564','64','登录系统','192.168.8.105','2016-10-08 18:03:13','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1565','64','登录系统','192.168.112.100','2016-10-08 21:25:05','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1566','64','登录系统','192.168.1.107','2016-10-15 16:33:07','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1567','64','退出系统','192.168.1.107','2016-10-15 16:38:03','0','管理用户:cyl 退出系统','cyl 退出系统'), ('1568','63','登录系统','192.168.1.107','2016-10-15 16:38:10','0','管理用户:jsh 登录系统','jsh 登录系统'), ('1569','64','登录系统','192.168.1.105','2016-10-16 09:30:46','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1570','64','登录系统','192.168.1.105','2016-10-16 09:35:30','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1571','64','更新仓管通','192.168.1.105','2016-10-16 11:31:53','0','更新仓管通ID为 28 成功!','更新仓管通成功'), ('1572','64','保存仓管通明细','192.168.1.105','2016-10-16 11:31:53','0','保存仓管通明细对应主表编号为 28 成功!','保存仓管通明细成功'), ('1573','64','登录系统','192.168.112.102','2016-10-16 20:13:38','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1574','64','登录系统','192.168.112.102','2016-10-22 16:11:53','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1575','64','登录系统','192.168.112.102','2016-10-22 16:42:20','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1576','64','更新仓管通','192.168.112.102','2016-10-22 17:53:43','0','更新仓管通ID为 28 成功!','更新仓管通成功'), ('1577','64','保存仓管通明细','192.168.112.102','2016-10-22 17:53:43','0','保存仓管通明细对应主表编号为 28 成功!','保存仓管通明细成功'), ('1578','64','登录系统','192.168.112.102','2016-10-22 19:58:45','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1579','64','退出系统','192.168.112.102','2016-10-22 19:59:50','0','管理用户:cyl 退出系统','cyl 退出系统'), ('1580','63','登录系统','192.168.112.102','2016-10-22 19:59:53','0','管理用户:jsh 登录系统','jsh 登录系统'), ('1581','63','增加资产','192.168.112.102','2016-10-22 20:04:48','0','增加资产名称ID为 27 成功!','增加资产成功'), ('1582','63','登录系统','192.168.112.102','2016-10-22 21:14:52','0','管理用户:jsh 登录系统','jsh 登录系统'), ('1583','64','登录系统','192.168.112.102','2016-10-23 20:12:34','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1584','64','登录系统','192.168.112.102','2016-10-23 20:58:11','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1585','64','登录系统','192.168.4.108','2016-10-30 17:29:19','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1586','64','登录系统','192.168.112.102','2016-10-30 20:18:07','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1587','64','登录系统','192.168.1.104','2016-11-06 09:10:05','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1588','64','登录系统','192.168.1.104','2016-11-06 13:44:03','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1589','64','退出系统','192.168.1.104','2016-11-06 13:45:02','0','管理用户:cyl 退出系统','cyl 退出系统'), ('1590','64','登录系统','192.168.1.104','2016-11-06 13:46:31','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1591','64','登录系统','192.168.112.100','2016-11-06 21:26:43','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1592','64','退出系统','192.168.112.100','2016-11-06 21:27:01','0','管理用户:cyl 退出系统','cyl 退出系统'), ('1593','64','登录系统','192.168.112.100','2016-11-06 23:15:25','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1594','64','登录系统','127.0.0.1','2016-11-07 09:04:00','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1595','64','登录系统','127.0.0.1','2016-11-07 09:04:40','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1596','64','退出系统','127.0.0.1','2016-11-07 09:06:49','0','管理用户:cyl 退出系统','cyl 退出系统'), ('1597','64','登录系统','192.168.4.108','2016-11-08 22:01:22','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1598','64','退出系统','192.168.4.108','2016-11-08 22:02:18','0','管理用户:cyl 退出系统','cyl 退出系统'), ('1599','63','登录系统','192.168.4.108','2016-11-08 22:02:29','0','管理用户:jsh 登录系统','jsh 登录系统'), ('1600','63','退出系统','192.168.4.108','2016-11-08 22:04:34','0','管理用户:jsh 退出系统','jsh 退出系统'), ('1601','64','登录系统','192.168.4.108','2016-11-08 22:04:43','0','管理用户:cyl 登录系统','cyl 登录系统'), ('1602','64','批量删除仓管通','192.168.4.108','2016-11-08 22:05:58','0','批量删除仓管通ID为 27,26,25,24,23,22,21,20,19,18,17,16,15,14,13 成功!','批量删除仓管通成功'), ('1603','64','批量删除仓管通','192.168.4.108','2016-11-08 22:06:09','0','批量删除仓管通ID为 12,11,10,9,8,7 成功!','批量删除仓管通成功'), ('1604','64','批量删除仓管通','192.168.4.108','2016-11-08 22:06:24','0','批量删除仓管通ID为 28 成功!','批量删除仓管通成功'), ('1605','64','更新经手人','192.168.4.108','2016-11-08 22:07:08','0','更新经手人ID为 1 成功!','更新经手人成功'), ('1606','64','更新经手人','192.168.4.108','2016-11-08 22:07:14','0','更新经手人ID为 2 成功!','更新经手人成功'), ('1607','64','更新供应商','192.168.4.108','2016-11-08 22:07:58','0','更新供应商ID为 1 成功!','更新供应商成功'), ('1608','64','批量删除物料','192.168.4.108','2016-11-08 22:08:26','0','批量删除物料ID为 15,16,17,18,19,20,21,22,23,24,25,26,27,28,29 成功!','批量删除物料成功'), ('1609','64','批量删除物料','192.168.4.108','2016-11-08 22:08:36','0','批量删除物料ID为 30,31,32,33,34,35,36,37,38,39,40,41,42,43,44 成功!','批量删除物料成功'), ('1610','64','批量删除物料','192.168.4.108','2016-11-08 22:08:40','0','批量删除物料ID为 45,46,47,48,49,50,51,52,53,54,55,56,57,58,59 成功!','批量删除物料成功'), ('1611','64','批量删除物料','192.168.4.108','2016-11-08 22:08:48','0','批量删除物料ID为 60,61,62,63,64,65,66,67,68,69,70,71,72,73,74 成功!','批量删除物料成功'), ('1612','64','批量删除物料','192.168.4.108','2016-11-08 22:08:53','0','批量删除物料ID为 75,76,77,78,79,80,81,82,83,84,85,86,87,88,89 成功!','批量删除物料成功'), ('1613','64','批量删除物料','192.168.4.108','2016-11-08 22:09:03','0','批量删除物料ID为 90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139 成功!','批量删除物料成功'), ('1614','64','批量删除物料','192.168.4.108','2016-11-08 22:09:09','0','批量删除物料ID为 140,141,142,143,144,145,146,147,148,149,150,151,152,153,154 成功!','批量删除物料成功'), ('1615','64','批量删除物料','192.168.4.108','2016-11-08 22:09:14','0','批量删除物料ID为 155,156,157,158,159,160,161,162,163,164,165,166,167,168,169 成功!','批量删除物料成功');
-INSERT INTO `jsh_log` VALUES ('1616','64','批量删除物料','192.168.4.108','2016-11-08 22:09:31','0','批量删除物料ID为 170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219 成功!','批量删除物料成功'), ('1617','64','批量删除物料','192.168.4.108','2016-11-08 22:09:39','0','批量删除物料ID为 220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269 成功!','批量删除物料成功'), ('1618','64','批量删除物料','192.168.4.108','2016-11-08 22:09:48','0','批量删除物料ID为 270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319 成功!','批量删除物料成功'), ('1619','64','批量删除物料','192.168.4.108','2016-11-08 22:09:56','0','批量删除物料ID为 320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369 成功!','批量删除物料成功'), ('1620','64','批量删除物料','192.168.4.108','2016-11-08 22:10:08','0','批量删除物料ID为 370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419 成功!','批量删除物料成功'), ('1621','64','批量删除物料','192.168.4.108','2016-11-08 22:10:17','0','批量删除物料ID为 420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469 成功!','批量删除物料成功'), ('1622','64','批量删除物料','192.168.4.108','2016-11-08 22:10:37','0','批量删除物料ID为 470,471,472,473,474,475,476,477,478,479,480,481,482,483,484 成功!','批量删除物料成功'), ('1623','64','批量删除物料','192.168.4.108','2016-11-08 22:10:48','0','批量删除物料ID为 486 成功!','批量删除物料成功'), ('1624','64','批量删除物料','192.168.4.108','2016-11-08 22:11:10','0','批量删除物料ID为 488,489,490,491,492,493,494,495,496,497 成功!','批量删除物料成功'), ('1625','64','更新物料','192.168.4.108','2016-11-08 22:11:33','0','更新物料ID为 487 成功!','更新物料成功'), ('1626','64','更新物料','192.168.4.108','2016-11-08 22:11:46','0','更新物料ID为 485 成功!','更新物料成功'), ('1627','64','增加物料','192.168.4.108','2016-11-08 22:12:18','0','增加物料名称为 蕾丝 成功!','增加物料成功'), ('1628','64','更新供应商','192.168.4.108','2016-11-08 22:12:41','0','更新供应商ID为 1 成功!','更新供应商成功'), ('1629','64','更新仓库','192.168.4.108','2016-11-08 22:13:06','0','更新仓库ID为 1 成功!','更新仓库成功'), ('1630','64','增加仓管通','192.168.4.108','2016-11-08 22:14:37','0','增加仓管通编号为 1234 成功!','增加仓管通成功'), ('1631','64','保存仓管通明细','192.168.4.108','2016-11-08 22:14:38','0','保存仓管通明细对应主表编号为 29 成功!','保存仓管通明细成功'), ('1632','64','增加仓管通','192.168.4.108','2016-11-08 22:15:16','0','增加仓管通编号为 1235 成功!','增加仓管通成功'), ('1633','64','保存仓管通明细','192.168.4.108','2016-11-08 22:15:17','0','保存仓管通明细对应主表编号为 30 成功!','保存仓管通明细成功'), ('1634','64','增加仓管通','192.168.4.108','2016-11-08 22:16:11','0','增加仓管通编号为 123A 成功!','增加仓管通成功'), ('1635','64','保存仓管通明细','192.168.4.108','2016-11-08 22:16:11','0','保存仓管通明细对应主表编号为 31 成功!','保存仓管通明细成功'), ('1636','64','退出系统','192.168.4.108','2016-11-08 22:16:39','0','管理用户:cyl 退出系统','cyl 退出系统'), ('1637','63','登录系统','192.168.4.108','2016-11-08 22:16:42','0','管理用户:jsh 登录系统','jsh 登录系统'), ('1638','63','登录系统','192.168.4.108','2016-11-08 22:17:05','0','管理用户:jsh 登录系统','jsh 登录系统'), ('1639','63','更新用户','192.168.4.108','2016-11-08 22:17:34','0','更新用户ID为 64 成功!','更新用户成功'), ('1640','63','更新用户','192.168.4.108','2016-11-08 22:17:48','0','更新用户ID为 65 成功!','更新用户成功'), ('1641','63','退出系统','192.168.4.108','2016-11-08 22:18:07','0','管理用户:jsh 退出系统','jsh 退出系统'), ('1642','65','登录系统','192.168.4.108','2016-11-08 22:18:16','0','管理用户:ls 登录系统','ls 登录系统'), ('1643','65','退出系统','192.168.4.108','2016-11-08 22:18:22','0','管理用户:ls 退出系统','ls 退出系统'), ('1644','65','登录系统','192.168.4.108','2016-11-08 22:18:39','0','管理用户:ls 登录系统','ls 登录系统'), ('1645','65','更新仓管通','192.168.4.108','2016-11-08 22:18:50','0','更新仓管通ID为 30 成功!','更新仓管通成功'), ('1646','65','更新仓管通','192.168.4.108','2016-11-08 22:18:53','0','更新仓管通ID为 29 成功!','更新仓管通成功'), ('1647','65','更新仓管通','192.168.4.108','2016-11-08 22:19:03','0','更新仓管通ID为 31 成功!','更新仓管通成功'), ('1648','65','退出系统','192.168.4.108','2016-11-08 22:20:46','0','管理用户:ls 退出系统','ls 退出系统'), ('1649','63','登录系统','192.168.4.108','2016-11-08 22:20:57','0','管理用户:jsh 登录系统','jsh 登录系统'), ('1650','63','登录系统','192.168.4.108','2016-11-08 22:29:58','0','管理用户:jsh 登录系统','jsh 登录系统'), ('1651','63','退出系统','192.168.4.108','2016-11-08 22:30:22','0','管理用户:jsh 退出系统','jsh 退出系统'), ('1652','65','登录系统','192.168.4.108','2016-11-08 22:30:26','0','管理用户:ls 登录系统','ls 登录系统'), ('1653','63','登录系统','127.0.0.1','2016-11-10 09:15:50','0','管理用户:jsh 登录系统','jsh 登录系统'), ('1654','65','登录系统','192.168.1.105','2016-11-13 12:21:50','0','管理用户:ls 登录系统','ls 登录系统'), ('1655','65','登录系统','192.168.1.105','2016-11-13 12:41:50','0','管理用户:ls 登录系统','ls 登录系统'), ('1656','65','登录系统','192.168.1.105','2016-11-13 12:41:51','0','管理用户:ls 登录系统','ls 登录系统'), ('1657','65','登录系统','192.168.1.105','2016-11-13 13:09:10','0','管理用户:ls 登录系统','ls 登录系统'), ('1658','65','退出系统','192.168.1.105','2016-11-13 13:09:16','0','管理用户:ls 退出系统','ls 退出系统'), ('1659','65','登录系统','192.168.1.105','2016-11-13 13:09:21','0','管理用户:ls 登录系统','ls 登录系统'), ('1660','65','登录系统','192.168.1.105','2016-11-13 13:31:39','0','管理用户:ls 登录系统','ls 登录系统'), ('1661','65','退出系统','192.168.1.105','2016-11-13 13:32:20','0','管理用户:ls 退出系统','ls 退出系统'), ('1662','65','登录系统','192.168.1.105','2016-11-13 13:32:25','0','管理用户:ls 登录系统','ls 登录系统'), ('1663','65','登录系统','192.168.1.105','2016-11-13 13:35:12','0','管理用户:ls 登录系统','ls 登录系统');
+INSERT INTO `jsh_log` VALUES ('1616','64','批量删除物料','192.168.4.108','2016-11-08 22:09:31','0','批量删除物料ID为 170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219 成功!','批量删除物料成功'), ('1617','64','批量删除物料','192.168.4.108','2016-11-08 22:09:39','0','批量删除物料ID为 220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269 成功!','批量删除物料成功'), ('1618','64','批量删除物料','192.168.4.108','2016-11-08 22:09:48','0','批量删除物料ID为 270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319 成功!','批量删除物料成功'), ('1619','64','批量删除物料','192.168.4.108','2016-11-08 22:09:56','0','批量删除物料ID为 320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369 成功!','批量删除物料成功'), ('1620','64','批量删除物料','192.168.4.108','2016-11-08 22:10:08','0','批量删除物料ID为 370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419 成功!','批量删除物料成功'), ('1621','64','批量删除物料','192.168.4.108','2016-11-08 22:10:17','0','批量删除物料ID为 420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469 成功!','批量删除物料成功'), ('1622','64','批量删除物料','192.168.4.108','2016-11-08 22:10:37','0','批量删除物料ID为 470,471,472,473,474,475,476,477,478,479,480,481,482,483,484 成功!','批量删除物料成功'), ('1623','64','批量删除物料','192.168.4.108','2016-11-08 22:10:48','0','批量删除物料ID为 486 成功!','批量删除物料成功'), ('1624','64','批量删除物料','192.168.4.108','2016-11-08 22:11:10','0','批量删除物料ID为 488,489,490,491,492,493,494,495,496,497 成功!','批量删除物料成功'), ('1625','64','更新物料','192.168.4.108','2016-11-08 22:11:33','0','更新物料ID为 487 成功!','更新物料成功'), ('1626','64','更新物料','192.168.4.108','2016-11-08 22:11:46','0','更新物料ID为 485 成功!','更新物料成功'), ('1627','64','增加物料','192.168.4.108','2016-11-08 22:12:18','0','增加物料名称为 蕾丝 成功!','增加物料成功'), ('1628','64','更新供应商','192.168.4.108','2016-11-08 22:12:41','0','更新供应商ID为 1 成功!','更新供应商成功'), ('1629','64','更新仓库','192.168.4.108','2016-11-08 22:13:06','0','更新仓库ID为 1 成功!','更新仓库成功'), ('1630','64','增加仓管通','192.168.4.108','2016-11-08 22:14:37','0','增加仓管通编号为 1234 成功!','增加仓管通成功'), ('1631','64','保存仓管通明细','192.168.4.108','2016-11-08 22:14:38','0','保存仓管通明细对应主表编号为 29 成功!','保存仓管通明细成功'), ('1632','64','增加仓管通','192.168.4.108','2016-11-08 22:15:16','0','增加仓管通编号为 1235 成功!','增加仓管通成功'), ('1633','64','保存仓管通明细','192.168.4.108','2016-11-08 22:15:17','0','保存仓管通明细对应主表编号为 30 成功!','保存仓管通明细成功'), ('1634','64','增加仓管通','192.168.4.108','2016-11-08 22:16:11','0','增加仓管通编号为 123A 成功!','增加仓管通成功'), ('1635','64','保存仓管通明细','192.168.4.108','2016-11-08 22:16:11','0','保存仓管通明细对应主表编号为 31 成功!','保存仓管通明细成功'), ('1636','64','退出系统','192.168.4.108','2016-11-08 22:16:39','0','管理用户:cyl 退出系统','cyl 退出系统'), ('1637','63','登录系统','192.168.4.108','2016-11-08 22:16:42','0','管理用户:jsh 登录系统','jsh 登录系统'), ('1638','63','登录系统','192.168.4.108','2016-11-08 22:17:05','0','管理用户:jsh 登录系统','jsh 登录系统'), ('1639','63','更新用户','192.168.4.108','2016-11-08 22:17:34','0','更新用户ID为 64 成功!','更新用户成功'), ('1640','63','更新用户','192.168.4.108','2016-11-08 22:17:48','0','更新用户ID为 65 成功!','更新用户成功'), ('1641','63','退出系统','192.168.4.108','2016-11-08 22:18:07','0','管理用户:jsh 退出系统','jsh 退出系统'), ('1642','65','登录系统','192.168.4.108','2016-11-08 22:18:16','0','管理用户:ls 登录系统','ls 登录系统'), ('1643','65','退出系统','192.168.4.108','2016-11-08 22:18:22','0','管理用户:ls 退出系统','ls 退出系统'), ('1644','65','登录系统','192.168.4.108','2016-11-08 22:18:39','0','管理用户:ls 登录系统','ls 登录系统'), ('1645','65','更新仓管通','192.168.4.108','2016-11-08 22:18:50','0','更新仓管通ID为 30 成功!','更新仓管通成功'), ('1646','65','更新仓管通','192.168.4.108','2016-11-08 22:18:53','0','更新仓管通ID为 29 成功!','更新仓管通成功'), ('1647','65','更新仓管通','192.168.4.108','2016-11-08 22:19:03','0','更新仓管通ID为 31 成功!','更新仓管通成功'), ('1648','65','退出系统','192.168.4.108','2016-11-08 22:20:46','0','管理用户:ls 退出系统','ls 退出系统'), ('1649','63','登录系统','192.168.4.108','2016-11-08 22:20:57','0','管理用户:jsh 登录系统','jsh 登录系统'), ('1650','63','登录系统','192.168.4.108','2016-11-08 22:29:58','0','管理用户:jsh 登录系统','jsh 登录系统'), ('1651','63','退出系统','192.168.4.108','2016-11-08 22:30:22','0','管理用户:jsh 退出系统','jsh 退出系统'), ('1652','65','登录系统','192.168.4.108','2016-11-08 22:30:26','0','管理用户:ls 登录系统','ls 登录系统'), ('1653','63','登录系统','127.0.0.1','2016-11-10 09:15:50','0','管理用户:jsh 登录系统','jsh 登录系统'), ('1654','65','登录系统','192.168.1.105','2016-11-13 12:21:50','0','管理用户:ls 登录系统','ls 登录系统'), ('1655','65','登录系统','192.168.1.105','2016-11-13 12:41:50','0','管理用户:ls 登录系统','ls 登录系统'), ('1656','65','登录系统','192.168.1.105','2016-11-13 12:41:51','0','管理用户:ls 登录系统','ls 登录系统'), ('1657','65','登录系统','192.168.1.105','2016-11-13 13:09:10','0','管理用户:ls 登录系统','ls 登录系统'), ('1658','65','退出系统','192.168.1.105','2016-11-13 13:09:16','0','管理用户:ls 退出系统','ls 退出系统'), ('1659','65','登录系统','192.168.1.105','2016-11-13 13:09:21','0','管理用户:ls 登录系统','ls 登录系统'), ('1660','65','登录系统','192.168.1.105','2016-11-13 13:31:39','0','管理用户:ls 登录系统','ls 登录系统'), ('1661','65','退出系统','192.168.1.105','2016-11-13 13:32:20','0','管理用户:ls 退出系统','ls 退出系统'), ('1662','65','登录系统','192.168.1.105','2016-11-13 13:32:25','0','管理用户:ls 登录系统','ls 登录系统'), ('1663','65','登录系统','192.168.1.105','2016-11-13 13:35:12','0','管理用户:ls 登录系统','ls 登录系统'), ('1664','65','登录系统','192.168.112.102','2016-11-13 22:49:05','0','管理用户:ls 登录系统','ls 登录系统'), ('1665','65','登录系统','192.168.112.102','2016-11-13 23:06:49','0','管理用户:ls 登录系统','ls 登录系统'), ('1666','65','登录系统','192.168.1.104','2016-11-20 13:16:01','0','管理用户:ls 登录系统','ls 登录系统'), ('1667','65','退出系统','192.168.1.104','2016-11-20 13:21:10','0','管理用户:ls 退出系统','ls 退出系统'), ('1668','65','登录系统','192.168.1.104','2016-11-20 13:21:19','0','管理用户:ls 登录系统','ls 登录系统'), ('1669','65','退出系统','192.168.1.104','2016-11-20 13:21:28','0','管理用户:ls 退出系统','ls 退出系统'), ('1670','63','登录系统','192.168.1.104','2016-11-20 13:21:37','0','管理用户:jsh 登录系统','jsh 登录系统'), ('1671','63','增加用户','192.168.1.104','2016-11-20 13:22:07','0','增加用户名称为 cdy 成功!','增加用户成功'), ('1672','63','批量删除用户','192.168.1.104','2016-11-20 13:24:19','0','批量删除用户ID为 66 成功!','批量删除用户成功'), ('1673','63','增加用户','192.168.1.104','2016-11-20 13:24:41','0','增加用户名称为 啊啊啊啊 成功!','增加用户成功');
INSERT INTO `jsh_material` VALUES ('485','1','棉线','A21-4321','米色','码',''), ('487','1','网布','12343','红色','码',''), ('498','2','蕾丝','B123','蓝色','码','');
INSERT INTO `jsh_materialcategory` VALUES ('1','根目录','1','1'), ('2','花边分类','1','1');
INSERT INTO `jsh_person` VALUES ('1','1','仓管员','张三'), ('2','1','采购人','李四');
INSERT INTO `jsh_role` VALUES ('4','管理员'), ('5','仓管员');
INSERT INTO `jsh_supplier` VALUES ('1','上海某某花边工厂','','','','','1','供应商','\0'), ('2','客户AAAA','','','','','1','客户','\0');
-INSERT INTO `jsh_user` VALUES ('63','季圣华','jsh','4QrcOUm6Wau+VuBX8g+IPg==','','','','','1','1','-1','',NULL), ('64','张三','zs','4QrcOUm6Wau+VuBX8g+IPg==','','销售','','','1','1',NULL,'',NULL), ('65','李四','ls','4QrcOUm6Wau+VuBX8g+IPg==','','销售','','','1','1',NULL,'',NULL);
+INSERT INTO `jsh_user` VALUES ('63','季圣华','jsh','e10adc3949ba59abbe56e057f20f883e','','','','','1','1','-1','',NULL), ('64','张三','zs','e10adc3949ba59abbe56e057f20f883e','','销售','','','1','1',NULL,'',NULL), ('65','李四','ls','e10adc3949ba59abbe56e057f20f883e','','销售','','','1','1',NULL,'',NULL);
INSERT INTO `jsh_userbusiness` VALUES ('1','RoleAPP','4','[21][1][8][11][10][19][16][15][12][7][17][20][18][3][6][22][23][24][25]'), ('2','RoleAPP','5','[8][7][3][6]'), ('3','RoleAPP','6','[21][1][8]'), ('4','RoleAPP','7','[21][1][8][11]'), ('5','RoleFunctions','4','[168][13][12][16][14][15][189][18][19][132][22][23][25][26][27][31][33][34][35][36][37][39][40][41][42][43][46][47][48][49][50][51][193][52][53][54][55][56][57][192][59][60][61][62][63][65][66][68][69][70][71][73][74][76][77][79][191][81][82][83][85][89][161][86][176][165][160][28][134][91][92][29][94][95][97][104][99][100][101][102][105][107][108][110][111][113][114][116][117][118][120][121][131][135][123][122][20][130][146][147][138][148][149][153][140][145][184][152][143][170][171][169][166][167][163][164][172][173][179][178][181][182][183][186][187][188]'), ('6','RoleFunctions','5','[22][23][25][26][27][31][33][41][46][193][52][55][59]'), ('7','RoleFunctions','6','[168][13][12][16][14][15][189][18][19]'), ('8','RoleAPP','8','[21][1][8][11][10]'), ('9','RoleFunctions','7','[168][13][12][16][14][15][189][18][19][132]'), ('10','RoleFunctions','8','[168][13][12][16][14][15][189][18][19][132][22][23][25][26][27][157][158][155][156][125][31][127][126][128][33][34][35][36][37][39][40][41][42][43][46][47][48][49][50][51][52][53][54][55][56][57][192][59][60][61][62][63][65][66][68][69][70][71][73][74][76][77][79][191][81][82][83][85][89][161][86][176][165][160][28][134][91][92][29][94][95][97][104][99][100][101][102][105][107][108][110][111][113][114][116][117][118][120][121][131][135][123][122][20][130][146][147][138][148][149][153][140][145][184][152][143][170][171][169][166][167][163][164][172][173][179][178][181][182][183][186][187]'), ('11','RoleFunctions','9','[168][13][12][16][14][15][189][18][19][132][22][23][25][26][27][157][158][155][156][125][31][127][126][128][33][34][35][36][37][39][40][41][42][43][46][47][48][49][50][51][52][53][54][55][56][57][192][59][60][61][62][63][65][66][68][69][70][71][73][74][76][77][79][191][81][82][83][85][89][161][86][176][165][160][28][134][91][92][29][94][95][97][104][99][100][101][102][105][107][108][110][111][113][114][116][117][118][120][121][131][135][123][122][20][130][146][147][138][148][149][153][140][145][184][152][143][170][171][169][166][167][163][164][172][173][179][178][181][182][183][186][187][188]'), ('12','UserRole','1','[5]'), ('13','UserRole','2','[6][7]'), ('14','UserDepot','2','[1][2][6][7]'), ('15','UserDepot','1','[1][2][5][6][7][10][12][14][15][17]'), ('16','UserRole','63','[4]'), ('17','RoleFunctions','13','[46][47][48][49]'), ('18','UserDepot','63','[1][6][45][46][50][51]'), ('19','UserDepot','5','[6][45][46][50]'), ('20','UserRole','5','[5]'), ('21','UserRole','64','[5]'), ('22','UserDepot','64','[1]'), ('23','UserRole','65','[5]'), ('24','UserDepot','65','[1]');
diff --git a/src/com/jsh/action/asset/AssetAction.java b/src/com/jsh/action/asset/AssetAction.java
index 87b0708c..5170c216 100644
--- a/src/com/jsh/action/asset/AssetAction.java
+++ b/src/com/jsh/action/asset/AssetAction.java
@@ -1,517 +1,517 @@
-package com.jsh.action.asset;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.sql.Timestamp;
-import java.text.ParseException;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import net.sf.json.JSONArray;
-import net.sf.json.JSONObject;
-
-import org.springframework.dao.DataAccessException;
-
-import com.jsh.base.BaseAction;
-import com.jsh.base.Log;
-import com.jsh.constants.asset.AssetConstants;
-import com.jsh.exception.AmsException;
-import com.jsh.model.po.Asset;
-import com.jsh.model.po.Assetname;
-import com.jsh.model.po.Basicuser;
-import com.jsh.model.po.Logdetails;
-import com.jsh.model.po.Supplier;
-import com.jsh.model.vo.asset.AssetModel;
-import com.jsh.service.asset.AssetIService;
-import com.jsh.service.basic.AssetNameIService;
-import com.jsh.service.basic.CategoryIService;
-import com.jsh.service.basic.SupplierIService;
-import com.jsh.service.basic.UserIService;
-import com.jsh.util.common.PageUtil;
-import com.jsh.util.common.Tools;
-
-@SuppressWarnings("serial")
-public class AssetAction extends BaseAction
-{
- private AssetModel model = new AssetModel();
- private AssetIService assetService;
- private CategoryIService categoryService;
- private SupplierIService supplierService;
- private UserIService userService;
- private AssetNameIService assetnameService;
-
- @SuppressWarnings({ "rawtypes", "unchecked" })
- public String getBasicData()
- {
- Map mapData = model.getShowModel().getMap();
- PageUtil pageUtil = new PageUtil();
- pageUtil.setPageSize(0);
- pageUtil.setCurPage(0);
- try
- {
- Map condition = pageUtil.getAdvSearch();
- condition.put("id_s_order", "desc");
- categoryService.find(pageUtil);
- mapData.put("categoryList", pageUtil.getPageList());
- supplierService.find(pageUtil);
- mapData.put("supplierList", pageUtil.getPageList());
-
- condition.put("isystem_n_eq", 1);
- condition.put("id_s_order", "desc");
- userService.find(pageUtil);
- mapData.put("userList", pageUtil.getPageList());
-
- //清除搜索条件 防止对查询有影响
- condition.remove("isystem_n_eq");
-
- assetnameService.find(pageUtil);
- mapData.put("assetnameList", pageUtil.getPageList());
- }
- catch (Exception e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>查找系统基础数据信息异常", e);
- model.getShowModel().setMsgTip("exceptoin");
- }
- return SUCCESS;
- }
-
- /**
- * 增加资产
- * @return
- */
- public void create()
- {
- Log.infoFileSync("==================开始调用增加资产方法===================");
- Boolean flag = false;
- try
- {
- Asset asset = new Asset();
- //添加设置
- asset.setAssetname(new Assetname(model.getAssetNameID()));
-
- asset.setLocation(model.getLocation());
- asset.setStatus(model.getStatus());
- asset.setPrice(model.getPrice());
-
- if(null != model.getUserID())
- {
- asset.setUser( new Basicuser(model.getUserID()));
- }
- try
- {
- //购买日期
- asset.setPurchasedate(new Timestamp(Tools.parse(model.getPurchasedate(), "yyyy-MM-dd").getTime()));
- //有效日期
- asset.setPeriodofvalidity(new Timestamp(Tools.parse(model.getPeriodofvalidity(), "yyyy-MM-dd").getTime()));
- //保修日期
- asset.setWarrantydate(new Timestamp(Tools.parse(model.getWarrantydate(), "yyyy-MM-dd").getTime()));
- }
- catch (ParseException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>解析购买日期格式异常", e);
- }
-
- asset.setAssetnum(model.getAssetnum());
- asset.setSerialnum(model.getSerialnum());
- asset.setLabels(model.getLabels());
-
- asset.setSupplier( new Supplier(model.getSupplierID()));
- asset.setDescription(model.getDescription());
-
- asset.setCreatetime(new Timestamp(new Date().getTime()));
- asset.setCreator(getUser());
- asset.setUpdatetime(new Timestamp(new Date().getTime()));
- asset.setUpdator(getUser());
- asset.setAddMonth(Tools.getCurrentMonth());
- assetService.create(asset);
- //========标识位===========
- flag = true;
- //记录操作日志使用
- tipMsg = "成功";
- tipType = 0;
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加资产异常", e);
- flag = false;
- tipMsg = "失败";
- tipType = 1;
- }
- finally
- {
- try
- {
- toClient(flag.toString());
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>增加资产回写客户端结果异常", e);
- }
- }
-
- logService.create(new Logdetails(getUser(), "增加资产", model.getClientIp(),
- new Timestamp(System.currentTimeMillis())
- , tipType, "增加资产名称ID为 "+ model.getAssetNameID() + " " + tipMsg + "!", "增加资产" + tipMsg));
- Log.infoFileSync("==================结束调用增加资产方法===================");
- }
-
- /**
- * 删除资产
- * @return
- */
- public String delete()
- {
- Log.infoFileSync("====================开始调用删除资产信息方法delete()================");
- try
- {
- assetService.delete(model.getAssetID());
- tipMsg = "成功";
- tipType = 0;
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getAssetID() + " 的资产异常", e);
- tipMsg = "失败";
- tipType = 1;
- }
- model.getShowModel().setMsgTip(tipMsg);
- logService.create(new Logdetails(getUser(), "删除资产", model.getClientIp(),
- new Timestamp(System.currentTimeMillis())
- , tipType, "删除资产ID为 "+ model.getAssetID() + " " + tipMsg + "!", "删除资产" + tipMsg));
- Log.infoFileSync("====================结束调用删除资产信息方法delete()================");
- return SUCCESS;
- }
-
- /**
- * 更新资产
- * @return
- */
- public void update()
- {
- Boolean flag = false;
- try
- {
- Asset asset = assetService.get(model.getAssetID());
-
- //设置要更新的熟悉值
- asset.setAssetname(new Assetname(model.getAssetNameID()));
-
- asset.setLocation(model.getLocation());
- asset.setStatus(model.getStatus());
- asset.setPrice(model.getPrice());
-
- if(null != model.getUserID())
- asset.setUser(new Basicuser(model.getUserID()));
- else
- asset.setUser(null);
- try
- {
- //购买日期
- asset.setPurchasedate(new Timestamp(Tools.parse(model.getPurchasedate(), "yyyy-MM-dd").getTime()));
- //有效日期
- asset.setPeriodofvalidity(new Timestamp(Tools.parse(model.getPeriodofvalidity(), "yyyy-MM-dd").getTime()));
- //保修日期
- asset.setWarrantydate(new Timestamp(Tools.parse(model.getWarrantydate(), "yyyy-MM-dd").getTime()));
- }
- catch (ParseException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>解析购买日期格式异常", e);
- }
-
- asset.setAssetnum(model.getAssetnum());
- asset.setSerialnum(model.getSerialnum());
- asset.setLabels(model.getLabels());
-
- asset.setSupplier(new Supplier(model.getSupplierID()));
- asset.setDescription(model.getDescription());
-
- asset.setUpdatetime(new Timestamp(new Date().getTime()));
- asset.setUpdator(getUser());
- assetService.update(asset);
- flag = true;
- tipMsg = "成功";
- tipType = 0;
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>修改资产ID为 : " + model.getAssetID() + "信息失败", e);
- flag = false;
- tipMsg = "失败";
- tipType = 1;
- }
- finally
- {
- try
- {
- toClient(flag.toString());
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>修改资产回写客户端结果异常", e);
- }
- }
- logService.create(new Logdetails(getUser(), "更新资产", model.getClientIp(),
- new Timestamp(System.currentTimeMillis())
- , tipType, "更新资产ID为 "+ model.getAssetID() + " " + tipMsg + "!", "更新资产" + tipMsg));
- }
-
- /**
- * 批量删除指定ID资产
- * @return
- */
- public String batchDelete()
- {
- try
- {
- assetService.batchDelete(model.getAssetIDs());
- model.getShowModel().setMsgTip("成功");
- //记录操作日志使用
- tipMsg = "成功";
- tipType = 0;
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>批量删除资产ID为:" + model.getAssetIDs() + "信息异常", e);
- tipMsg = "失败";
- tipType = 1;
- }
-
- logService.create(new Logdetails(getUser(), "批量删除资产", model.getClientIp(),
- new Timestamp(System.currentTimeMillis())
- , tipType, "批量删除资产ID为 "+ model.getAssetIDs() + " " + tipMsg + "!", "批量删除资产" + tipMsg));
- return SUCCESS;
- }
-
- /**
- * 查找资产信息
- * @return
- */
- public void findBy()
- {
- try
- {
- PageUtil pageUtil = new PageUtil();
- pageUtil.setPageSize(model.getPageSize());
- pageUtil.setCurPage(model.getPageNo());
- pageUtil.setAdvSearch(getCondition());
- assetService.find(pageUtil);
-
- getSession().put("pageUtil", pageUtil);
- List dataList = pageUtil.getPageList();
-
- //开始拼接json数据
-// {"total":28,"rows":[
-// {"productid":"AV-CB-01","attr1":"Adult Male","itemid":"EST-18"}
-// ]}
- JSONObject outer = new JSONObject();
- outer.put("total", pageUtil.getTotalCount());
- //存放数据json数组
- JSONArray dataArray = new JSONArray();
- if(null != dataList)
- {
- for(Asset asset:dataList)
- {
- JSONObject item = new JSONObject();
- item.put("id", asset.getId());
- //添加资产属性
- item.put("assetname", asset.getAssetname().getAssetname());
- item.put("assetnameID", asset.getAssetname().getId());
- //单价
- item.put("price", Tools.dealNullStr(asset.getPrice() + ""));
- //分类
- item.put("category", asset.getAssetname().getCategory().getAssetname());
- item.put("categoryID", asset.getAssetname().getCategory().getId());
- //资产的状态:0==在库,1==在用,2==消费
- item.put("status", getStatusInfo(asset.getStatus()));
- item.put("statushort", asset.getStatus());
- //在用用户名称
- item.put("username", asset.getUser()==null?"":asset.getUser().getUsername());
- item.put("userID", asset.getUser()==null?"":asset.getUser().getId());
- //位置
- item.put("location", Tools.dealNullStr(asset.getLocation()));
-
- //购买日期
- item.put("purchasedate", asset.getPurchasedate()==null?"":Tools.getCurrentMonth(asset.getPurchasedate()));
- //有效日期
- item.put("periodofvalidity", asset.getPeriodofvalidity()==null?"":Tools.getCurrentMonth(asset.getPeriodofvalidity()));
- //保修日期
- item.put("warrantydate", asset.getWarrantydate()==null?"":Tools.getCurrentMonth(asset.getWarrantydate()));
- //资产编号
- item.put("assetnum", Tools.dealNullStr(asset.getAssetnum()));
- //资产序列号
- item.put("serialnum", Tools.dealNullStr(asset.getSerialnum()));
- //供应商
- item.put("supplier", asset.getSupplier()==null?"":asset.getSupplier().getSupplier());
- //供应商
- item.put("supplierID", asset.getSupplier()==null?"":asset.getSupplier().getId());
- //标签
- item.put("labels", Tools.dealNullStr(asset.getLabels()));
- item.put("description", Tools.dealNullStr(asset.getDescription()));
- item.put("op", 1);
- dataArray.add(item);
- }
- }
- outer.put("rows", dataArray);
- //回写查询结果
- toClient(outer.toString());
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>查找资产信息异常", e);
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>回写查询资产信息结果异常", e);
- }
- }
-
- /**
- * 导出excel表格
- * @return
- */
- @SuppressWarnings("unchecked")
- public String exportExcel()
- {
- Log.infoFileSync("===================调用导出资产信息action方法exportExcel开始=======================");
- try
- {
- PageUtil pageUtil = (PageUtil)getSession().get("pageUtil");
-
- pageUtil.setPageSize(model.getPageSize());
- pageUtil.setCurPage(model.getPageNo());
- //pageUtil.setAdvSearch(getCondition());
- String isCurrentPage = model.getIsAllData();
- model.setFileName(Tools.changeUnicode(model.getFileName() + ".xls",model.getBrowserType()));
- model.setExcelStream(assetService.exmportExcel(isCurrentPage,pageUtil));
- }
- catch (Exception e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>>>>调用导出资产信息action方法exportExcel异常",e);
- model.getShowModel().setMsgTip("export excel exception");
- }
- Log.infoFileSync("===================调用导出资产信息action方法exportExcel结束==================");
- return AssetConstants.BusinessForExcel.EXCEL;
- }
-
-
- /**
- * 导入资产excel表格内容
- */
- public String importExcel()
- {
- //资产excel表格file
- Boolean result = false;
- String returnStr = "";
- try
- {
- InputStream in = assetService.importExcel(model.getAssetFile(), model.getIsCheck());
-
- if(null != in)
- {
- model.setFileName(Tools.getRandomChar() + Tools.getNow2(Calendar.getInstance().getTime()) + "_wrong.xls");
- model.setExcelStream(in);
- returnStr = AssetConstants.BusinessForExcel.EXCEL;
- }
- else
- {
- result = true;
- try
- {
- toClient(result.toString());
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>回写导入资产信息结果异常", e);
- }
- //导入数据成功
- returnStr = SUCCESS;
- }
-
- }
- catch (AmsException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>导入excel表格信息异常", e);
- }
- return returnStr;
- }
-
- /**
- * 拼接搜索条件
- * @return
- */
- private Map getCondition()
- {
- /**
- * 拼接搜索条件
- */
- Map condition = new HashMap();
- condition.put("assetname.id_n_eq", model.getAssetNameID());
- condition.put("assetname.category.id_n_eq", model.getAssetCategoryID());
- condition.put("user.id_n_eq", model.getUserID());
- condition.put("status_n_eq", model.getStatus());
- condition.put("supplier.id_n_eq", model.getSupplierID());
- condition.put("createtime_s_order", "desc");
- return condition;
- }
-
- /**
- * 根据状态码转化成说明字符串
- * 资产的状态:0==在库,1==在用,2==消费
- * @param statusCode
- * @return
- */
- private String getStatusInfo(short statusCode)
- {
- String statusInfo = "";
- switch(statusCode)
- {
- case AssetConstants.BusinessForExcel.EXCEl_STATUS_ZAIKU:
- statusInfo = "在库";
- break;
-
- case AssetConstants.BusinessForExcel.EXCEl_STATUS_INUSE:
- statusInfo = "在用";
- break;
-
- case AssetConstants.BusinessForExcel.EXCEl_STATUS_CONSUME:
- statusInfo = "消费";
- break;
- }
- return statusInfo;
- }
-
- //=========Spring注入以及model驱动公共方法===========
- public void setAssetService(AssetIService assetService)
- {
- this.assetService = assetService;
- }
-
- public void setCategoryService(CategoryIService categoryService)
- {
- this.categoryService = categoryService;
- }
-
- public void setSupplierService(SupplierIService supplierService)
- {
- this.supplierService = supplierService;
- }
-
- public void setUserService(UserIService userService)
- {
- this.userService = userService;
- }
-
- public void setAssetnameService(AssetNameIService assetnameService)
- {
- this.assetnameService = assetnameService;
- }
-
- @Override
- public AssetModel getModel()
- {
- return model;
- }
-}
+package com.jsh.action.asset;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.sql.Timestamp;
+import java.text.ParseException;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import net.sf.json.JSONArray;
+import net.sf.json.JSONObject;
+
+import org.springframework.dao.DataAccessException;
+
+import com.jsh.base.BaseAction;
+import com.jsh.base.Log;
+import com.jsh.constants.asset.AssetConstants;
+import com.jsh.exception.JshException;
+import com.jsh.model.po.Asset;
+import com.jsh.model.po.Assetname;
+import com.jsh.model.po.Basicuser;
+import com.jsh.model.po.Logdetails;
+import com.jsh.model.po.Supplier;
+import com.jsh.model.vo.asset.AssetModel;
+import com.jsh.service.asset.AssetIService;
+import com.jsh.service.basic.AssetNameIService;
+import com.jsh.service.basic.CategoryIService;
+import com.jsh.service.basic.SupplierIService;
+import com.jsh.service.basic.UserIService;
+import com.jsh.util.common.PageUtil;
+import com.jsh.util.common.Tools;
+
+@SuppressWarnings("serial")
+public class AssetAction extends BaseAction
+{
+ private AssetModel model = new AssetModel();
+ private AssetIService assetService;
+ private CategoryIService categoryService;
+ private SupplierIService supplierService;
+ private UserIService userService;
+ private AssetNameIService assetnameService;
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public String getBasicData()
+ {
+ Map mapData = model.getShowModel().getMap();
+ PageUtil pageUtil = new PageUtil();
+ pageUtil.setPageSize(0);
+ pageUtil.setCurPage(0);
+ try
+ {
+ Map condition = pageUtil.getAdvSearch();
+ condition.put("id_s_order", "desc");
+ categoryService.find(pageUtil);
+ mapData.put("categoryList", pageUtil.getPageList());
+ supplierService.find(pageUtil);
+ mapData.put("supplierList", pageUtil.getPageList());
+
+ condition.put("isystem_n_eq", 1);
+ condition.put("id_s_order", "desc");
+ userService.find(pageUtil);
+ mapData.put("userList", pageUtil.getPageList());
+
+ //清除搜索条件 防止对查询有影响
+ condition.remove("isystem_n_eq");
+
+ assetnameService.find(pageUtil);
+ mapData.put("assetnameList", pageUtil.getPageList());
+ }
+ catch (Exception e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>查找系统基础数据信息异常", e);
+ model.getShowModel().setMsgTip("exceptoin");
+ }
+ return SUCCESS;
+ }
+
+ /**
+ * 增加资产
+ * @return
+ */
+ public void create()
+ {
+ Log.infoFileSync("==================开始调用增加资产方法===================");
+ Boolean flag = false;
+ try
+ {
+ Asset asset = new Asset();
+ //添加设置
+ asset.setAssetname(new Assetname(model.getAssetNameID()));
+
+ asset.setLocation(model.getLocation());
+ asset.setStatus(model.getStatus());
+ asset.setPrice(model.getPrice());
+
+ if(null != model.getUserID())
+ {
+ asset.setUser( new Basicuser(model.getUserID()));
+ }
+ try
+ {
+ //购买日期
+ asset.setPurchasedate(new Timestamp(Tools.parse(model.getPurchasedate(), "yyyy-MM-dd").getTime()));
+ //有效日期
+ asset.setPeriodofvalidity(new Timestamp(Tools.parse(model.getPeriodofvalidity(), "yyyy-MM-dd").getTime()));
+ //保修日期
+ asset.setWarrantydate(new Timestamp(Tools.parse(model.getWarrantydate(), "yyyy-MM-dd").getTime()));
+ }
+ catch (ParseException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>解析购买日期格式异常", e);
+ }
+
+ asset.setAssetnum(model.getAssetnum());
+ asset.setSerialnum(model.getSerialnum());
+ asset.setLabels(model.getLabels());
+
+ asset.setSupplier( new Supplier(model.getSupplierID()));
+ asset.setDescription(model.getDescription());
+
+ asset.setCreatetime(new Timestamp(new Date().getTime()));
+ asset.setCreator(getUser());
+ asset.setUpdatetime(new Timestamp(new Date().getTime()));
+ asset.setUpdator(getUser());
+ asset.setAddMonth(Tools.getCurrentMonth());
+ assetService.create(asset);
+ //========标识位===========
+ flag = true;
+ //记录操作日志使用
+ tipMsg = "成功";
+ tipType = 0;
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加资产异常", e);
+ flag = false;
+ tipMsg = "失败";
+ tipType = 1;
+ }
+ finally
+ {
+ try
+ {
+ toClient(flag.toString());
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>增加资产回写客户端结果异常", e);
+ }
+ }
+
+ logService.create(new Logdetails(getUser(), "增加资产", model.getClientIp(),
+ new Timestamp(System.currentTimeMillis())
+ , tipType, "增加资产名称ID为 "+ model.getAssetNameID() + " " + tipMsg + "!", "增加资产" + tipMsg));
+ Log.infoFileSync("==================结束调用增加资产方法===================");
+ }
+
+ /**
+ * 删除资产
+ * @return
+ */
+ public String delete()
+ {
+ Log.infoFileSync("====================开始调用删除资产信息方法delete()================");
+ try
+ {
+ assetService.delete(model.getAssetID());
+ tipMsg = "成功";
+ tipType = 0;
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getAssetID() + " 的资产异常", e);
+ tipMsg = "失败";
+ tipType = 1;
+ }
+ model.getShowModel().setMsgTip(tipMsg);
+ logService.create(new Logdetails(getUser(), "删除资产", model.getClientIp(),
+ new Timestamp(System.currentTimeMillis())
+ , tipType, "删除资产ID为 "+ model.getAssetID() + " " + tipMsg + "!", "删除资产" + tipMsg));
+ Log.infoFileSync("====================结束调用删除资产信息方法delete()================");
+ return SUCCESS;
+ }
+
+ /**
+ * 更新资产
+ * @return
+ */
+ public void update()
+ {
+ Boolean flag = false;
+ try
+ {
+ Asset asset = assetService.get(model.getAssetID());
+
+ //设置要更新的熟悉值
+ asset.setAssetname(new Assetname(model.getAssetNameID()));
+
+ asset.setLocation(model.getLocation());
+ asset.setStatus(model.getStatus());
+ asset.setPrice(model.getPrice());
+
+ if(null != model.getUserID())
+ asset.setUser(new Basicuser(model.getUserID()));
+ else
+ asset.setUser(null);
+ try
+ {
+ //购买日期
+ asset.setPurchasedate(new Timestamp(Tools.parse(model.getPurchasedate(), "yyyy-MM-dd").getTime()));
+ //有效日期
+ asset.setPeriodofvalidity(new Timestamp(Tools.parse(model.getPeriodofvalidity(), "yyyy-MM-dd").getTime()));
+ //保修日期
+ asset.setWarrantydate(new Timestamp(Tools.parse(model.getWarrantydate(), "yyyy-MM-dd").getTime()));
+ }
+ catch (ParseException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>解析购买日期格式异常", e);
+ }
+
+ asset.setAssetnum(model.getAssetnum());
+ asset.setSerialnum(model.getSerialnum());
+ asset.setLabels(model.getLabels());
+
+ asset.setSupplier(new Supplier(model.getSupplierID()));
+ asset.setDescription(model.getDescription());
+
+ asset.setUpdatetime(new Timestamp(new Date().getTime()));
+ asset.setUpdator(getUser());
+ assetService.update(asset);
+ flag = true;
+ tipMsg = "成功";
+ tipType = 0;
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>修改资产ID为 : " + model.getAssetID() + "信息失败", e);
+ flag = false;
+ tipMsg = "失败";
+ tipType = 1;
+ }
+ finally
+ {
+ try
+ {
+ toClient(flag.toString());
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>修改资产回写客户端结果异常", e);
+ }
+ }
+ logService.create(new Logdetails(getUser(), "更新资产", model.getClientIp(),
+ new Timestamp(System.currentTimeMillis())
+ , tipType, "更新资产ID为 "+ model.getAssetID() + " " + tipMsg + "!", "更新资产" + tipMsg));
+ }
+
+ /**
+ * 批量删除指定ID资产
+ * @return
+ */
+ public String batchDelete()
+ {
+ try
+ {
+ assetService.batchDelete(model.getAssetIDs());
+ model.getShowModel().setMsgTip("成功");
+ //记录操作日志使用
+ tipMsg = "成功";
+ tipType = 0;
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>批量删除资产ID为:" + model.getAssetIDs() + "信息异常", e);
+ tipMsg = "失败";
+ tipType = 1;
+ }
+
+ logService.create(new Logdetails(getUser(), "批量删除资产", model.getClientIp(),
+ new Timestamp(System.currentTimeMillis())
+ , tipType, "批量删除资产ID为 "+ model.getAssetIDs() + " " + tipMsg + "!", "批量删除资产" + tipMsg));
+ return SUCCESS;
+ }
+
+ /**
+ * 查找资产信息
+ * @return
+ */
+ public void findBy()
+ {
+ try
+ {
+ PageUtil pageUtil = new PageUtil();
+ pageUtil.setPageSize(model.getPageSize());
+ pageUtil.setCurPage(model.getPageNo());
+ pageUtil.setAdvSearch(getCondition());
+ assetService.find(pageUtil);
+
+ getSession().put("pageUtil", pageUtil);
+ List dataList = pageUtil.getPageList();
+
+ //开始拼接json数据
+// {"total":28,"rows":[
+// {"productid":"AV-CB-01","attr1":"Adult Male","itemid":"EST-18"}
+// ]}
+ JSONObject outer = new JSONObject();
+ outer.put("total", pageUtil.getTotalCount());
+ //存放数据json数组
+ JSONArray dataArray = new JSONArray();
+ if(null != dataList)
+ {
+ for(Asset asset:dataList)
+ {
+ JSONObject item = new JSONObject();
+ item.put("id", asset.getId());
+ //添加资产属性
+ item.put("assetname", asset.getAssetname().getAssetname());
+ item.put("assetnameID", asset.getAssetname().getId());
+ //单价
+ item.put("price", Tools.dealNullStr(asset.getPrice() + ""));
+ //分类
+ item.put("category", asset.getAssetname().getCategory().getAssetname());
+ item.put("categoryID", asset.getAssetname().getCategory().getId());
+ //资产的状态:0==在库,1==在用,2==消费
+ item.put("status", getStatusInfo(asset.getStatus()));
+ item.put("statushort", asset.getStatus());
+ //在用用户名称
+ item.put("username", asset.getUser()==null?"":asset.getUser().getUsername());
+ item.put("userID", asset.getUser()==null?"":asset.getUser().getId());
+ //位置
+ item.put("location", Tools.dealNullStr(asset.getLocation()));
+
+ //购买日期
+ item.put("purchasedate", asset.getPurchasedate()==null?"":Tools.getCurrentMonth(asset.getPurchasedate()));
+ //有效日期
+ item.put("periodofvalidity", asset.getPeriodofvalidity()==null?"":Tools.getCurrentMonth(asset.getPeriodofvalidity()));
+ //保修日期
+ item.put("warrantydate", asset.getWarrantydate()==null?"":Tools.getCurrentMonth(asset.getWarrantydate()));
+ //资产编号
+ item.put("assetnum", Tools.dealNullStr(asset.getAssetnum()));
+ //资产序列号
+ item.put("serialnum", Tools.dealNullStr(asset.getSerialnum()));
+ //供应商
+ item.put("supplier", asset.getSupplier()==null?"":asset.getSupplier().getSupplier());
+ //供应商
+ item.put("supplierID", asset.getSupplier()==null?"":asset.getSupplier().getId());
+ //标签
+ item.put("labels", Tools.dealNullStr(asset.getLabels()));
+ item.put("description", Tools.dealNullStr(asset.getDescription()));
+ item.put("op", 1);
+ dataArray.add(item);
+ }
+ }
+ outer.put("rows", dataArray);
+ //回写查询结果
+ toClient(outer.toString());
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>查找资产信息异常", e);
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>回写查询资产信息结果异常", e);
+ }
+ }
+
+ /**
+ * 导出excel表格
+ * @return
+ */
+ @SuppressWarnings("unchecked")
+ public String exportExcel()
+ {
+ Log.infoFileSync("===================调用导出资产信息action方法exportExcel开始=======================");
+ try
+ {
+ PageUtil pageUtil = (PageUtil)getSession().get("pageUtil");
+
+ pageUtil.setPageSize(model.getPageSize());
+ pageUtil.setCurPage(model.getPageNo());
+ //pageUtil.setAdvSearch(getCondition());
+ String isCurrentPage = model.getIsAllData();
+ model.setFileName(Tools.changeUnicode(model.getFileName() + ".xls",model.getBrowserType()));
+ model.setExcelStream(assetService.exmportExcel(isCurrentPage,pageUtil));
+ }
+ catch (Exception e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>>>>调用导出资产信息action方法exportExcel异常",e);
+ model.getShowModel().setMsgTip("export excel exception");
+ }
+ Log.infoFileSync("===================调用导出资产信息action方法exportExcel结束==================");
+ return AssetConstants.BusinessForExcel.EXCEL;
+ }
+
+
+ /**
+ * 导入资产excel表格内容
+ */
+ public String importExcel()
+ {
+ //资产excel表格file
+ Boolean result = false;
+ String returnStr = "";
+ try
+ {
+ InputStream in = assetService.importExcel(model.getAssetFile(), model.getIsCheck());
+
+ if(null != in)
+ {
+ model.setFileName(Tools.getRandomChar() + Tools.getNow2(Calendar.getInstance().getTime()) + "_wrong.xls");
+ model.setExcelStream(in);
+ returnStr = AssetConstants.BusinessForExcel.EXCEL;
+ }
+ else
+ {
+ result = true;
+ try
+ {
+ toClient(result.toString());
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>回写导入资产信息结果异常", e);
+ }
+ //导入数据成功
+ returnStr = SUCCESS;
+ }
+
+ }
+ catch (JshException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>导入excel表格信息异常", e);
+ }
+ return returnStr;
+ }
+
+ /**
+ * 拼接搜索条件
+ * @return
+ */
+ private Map getCondition()
+ {
+ /**
+ * 拼接搜索条件
+ */
+ Map condition = new HashMap();
+ condition.put("assetname.id_n_eq", model.getAssetNameID());
+ condition.put("assetname.category.id_n_eq", model.getAssetCategoryID());
+ condition.put("user.id_n_eq", model.getUserID());
+ condition.put("status_n_eq", model.getStatus());
+ condition.put("supplier.id_n_eq", model.getSupplierID());
+ condition.put("createtime_s_order", "desc");
+ return condition;
+ }
+
+ /**
+ * 根据状态码转化成说明字符串
+ * 资产的状态:0==在库,1==在用,2==消费
+ * @param statusCode
+ * @return
+ */
+ private String getStatusInfo(short statusCode)
+ {
+ String statusInfo = "";
+ switch(statusCode)
+ {
+ case AssetConstants.BusinessForExcel.EXCEl_STATUS_ZAIKU:
+ statusInfo = "在库";
+ break;
+
+ case AssetConstants.BusinessForExcel.EXCEl_STATUS_INUSE:
+ statusInfo = "在用";
+ break;
+
+ case AssetConstants.BusinessForExcel.EXCEl_STATUS_CONSUME:
+ statusInfo = "消费";
+ break;
+ }
+ return statusInfo;
+ }
+
+ //=========Spring注入以及model驱动公共方法===========
+ public void setAssetService(AssetIService assetService)
+ {
+ this.assetService = assetService;
+ }
+
+ public void setCategoryService(CategoryIService categoryService)
+ {
+ this.categoryService = categoryService;
+ }
+
+ public void setSupplierService(SupplierIService supplierService)
+ {
+ this.supplierService = supplierService;
+ }
+
+ public void setUserService(UserIService userService)
+ {
+ this.userService = userService;
+ }
+
+ public void setAssetnameService(AssetNameIService assetnameService)
+ {
+ this.assetnameService = assetnameService;
+ }
+
+ @Override
+ public AssetModel getModel()
+ {
+ return model;
+ }
+}
diff --git a/src/com/jsh/action/asset/ReportAction.java b/src/com/jsh/action/asset/ReportAction.java
index 831347cb..07437077 100644
--- a/src/com/jsh/action/asset/ReportAction.java
+++ b/src/com/jsh/action/asset/ReportAction.java
@@ -1,120 +1,120 @@
-package com.jsh.action.asset;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import com.jsh.base.BaseAction;
-import com.jsh.base.Log;
-import com.jsh.exception.AmsException;
-import com.jsh.model.po.Asset;
-import com.jsh.model.vo.asset.ReportModel;
-import com.jsh.service.asset.ReportIService;
-import com.jsh.util.common.PageUtil;
-
-@SuppressWarnings("serial")
-public class ReportAction extends BaseAction
-{
- private ReportModel model = new ReportModel();
- private ReportIService reportService;
-
- /**
- * 查找资产信息
- * @return
- */
- public String find()
- {
- try
- {
- PageUtil pageUtil = new PageUtil();
- pageUtil.setPageSize(0);
- pageUtil.setCurPage(0);
- pageUtil.setAdvSearch(getCondition());
- String reportType = getReportType(new HashMap());
- reportService.find(pageUtil,reportType.split("_")[0],reportType.split("_")[1]);
- model.getShowModel().setReportData(pageUtil.getPageList());
- }
- catch (AmsException e)
- {
- Log.errorFileSync(">>>>>>>>>查找资产信息异常", e);
- model.getShowModel().setMsgTip("get report data exception");
- }
- return SUCCESS;
- }
-
- /**
- * 拼接搜索条件
- * @return
- */
- private Map getCondition()
- {
- /**
- * 拼接搜索条件
- */
- Map condition = new HashMap();
- condition.put("assetname.id_n_eq", model.getAssetNameID());
- condition.put("assetname.category.id_n_eq", model.getAssetCategoryID());
- condition.put("user.id_n_eq", model.getUsernameID());
- condition.put("status_n_eq", model.getStatus());
- condition.put("supplier.id_n_eq", model.getSupplierID());
- condition.put("dataSum_s_order","desc");
- //拼接统计数据条件
- getReportType(condition);
- return condition;
- }
-
- /**
- * 获取统计条件
- * @param condition
- */
- private String getReportType(Map condition)
- {
-//
-//
-//
-//
-//
- int reportType = model.getReportType();
- String reportTypeInfo = "";
- String reportTypeName = "";
- switch(reportType)
- {
- case 0:
- condition.put("status_s_gb", "group");
- reportTypeInfo = "status";
- reportTypeName = "status";
- break;
- case 1:
- condition.put("assetname.category.id_s_gb", "group");
- reportTypeInfo = "assetname.category.id";
- reportTypeName = "assetname.category.assetname";
- break;
- case 2:
- condition.put("supplier.id_s_gb", "group");
- reportTypeInfo = "supplier.id";
- reportTypeName = "supplier.supplier";
- break;
- case 3:
- condition.put("assetname.id_s_gb", "group");
- reportTypeInfo = "assetname.id";
- reportTypeName = "assetname.assetname";
- break;
- case 4:
- condition.put("user.id_s_gb", "group");
- reportTypeInfo = "user.id";
- reportTypeName = "user.username";
- break;
- }
- return reportTypeInfo + "_" + reportTypeName;
- }
- //=========Spring注入以及model驱动公共方法===========
- public void setReportService(ReportIService reportService)
- {
- this.reportService = reportService;
- }
-
- @Override
- public ReportModel getModel()
- {
- return model;
- }
-}
+package com.jsh.action.asset;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.jsh.base.BaseAction;
+import com.jsh.base.Log;
+import com.jsh.exception.JshException;
+import com.jsh.model.po.Asset;
+import com.jsh.model.vo.asset.ReportModel;
+import com.jsh.service.asset.ReportIService;
+import com.jsh.util.common.PageUtil;
+
+@SuppressWarnings("serial")
+public class ReportAction extends BaseAction
+{
+ private ReportModel model = new ReportModel();
+ private ReportIService reportService;
+
+ /**
+ * 查找资产信息
+ * @return
+ */
+ public String find()
+ {
+ try
+ {
+ PageUtil pageUtil = new PageUtil();
+ pageUtil.setPageSize(0);
+ pageUtil.setCurPage(0);
+ pageUtil.setAdvSearch(getCondition());
+ String reportType = getReportType(new HashMap());
+ reportService.find(pageUtil,reportType.split("_")[0],reportType.split("_")[1]);
+ model.getShowModel().setReportData(pageUtil.getPageList());
+ }
+ catch (JshException e)
+ {
+ Log.errorFileSync(">>>>>>>>>查找资产信息异常", e);
+ model.getShowModel().setMsgTip("get report data exception");
+ }
+ return SUCCESS;
+ }
+
+ /**
+ * 拼接搜索条件
+ * @return
+ */
+ private Map getCondition()
+ {
+ /**
+ * 拼接搜索条件
+ */
+ Map condition = new HashMap();
+ condition.put("assetname.id_n_eq", model.getAssetNameID());
+ condition.put("assetname.category.id_n_eq", model.getAssetCategoryID());
+ condition.put("user.id_n_eq", model.getUsernameID());
+ condition.put("status_n_eq", model.getStatus());
+ condition.put("supplier.id_n_eq", model.getSupplierID());
+ condition.put("dataSum_s_order","desc");
+ //拼接统计数据条件
+ getReportType(condition);
+ return condition;
+ }
+
+ /**
+ * 获取统计条件
+ * @param condition
+ */
+ private String getReportType(Map condition)
+ {
+//
+//
+//
+//
+//
+ int reportType = model.getReportType();
+ String reportTypeInfo = "";
+ String reportTypeName = "";
+ switch(reportType)
+ {
+ case 0:
+ condition.put("status_s_gb", "group");
+ reportTypeInfo = "status";
+ reportTypeName = "status";
+ break;
+ case 1:
+ condition.put("assetname.category.id_s_gb", "group");
+ reportTypeInfo = "assetname.category.id";
+ reportTypeName = "assetname.category.assetname";
+ break;
+ case 2:
+ condition.put("supplier.id_s_gb", "group");
+ reportTypeInfo = "supplier.id";
+ reportTypeName = "supplier.supplier";
+ break;
+ case 3:
+ condition.put("assetname.id_s_gb", "group");
+ reportTypeInfo = "assetname.id";
+ reportTypeName = "assetname.assetname";
+ break;
+ case 4:
+ condition.put("user.id_s_gb", "group");
+ reportTypeInfo = "user.id";
+ reportTypeName = "user.username";
+ break;
+ }
+ return reportTypeInfo + "_" + reportTypeName;
+ }
+ //=========Spring注入以及model驱动公共方法===========
+ public void setReportService(ReportIService reportService)
+ {
+ this.reportService = reportService;
+ }
+
+ @Override
+ public ReportModel getModel()
+ {
+ return model;
+ }
+}
diff --git a/src/com/jsh/action/basic/AppAction.java b/src/com/jsh/action/basic/AppAction.java
index 6a9e1fe6..b6cd1321 100644
--- a/src/com/jsh/action/basic/AppAction.java
+++ b/src/com/jsh/action/basic/AppAction.java
@@ -1,544 +1,544 @@
-package com.jsh.action.basic;
-
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import java.sql.Timestamp;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import net.sf.json.JSONArray;
-import net.sf.json.JSONObject;
-
-import org.apache.struts2.ServletActionContext;
-import org.springframework.dao.DataAccessException;
-
-import com.jsh.base.BaseAction;
-import com.jsh.base.Log;
-import com.jsh.exception.AmsException;
-import com.jsh.model.po.App;
-import com.jsh.model.po.Logdetails;
-import com.jsh.model.vo.basic.AppModel;
-import com.jsh.service.basic.AppIService;
-import com.jsh.service.basic.UserBusinessIService;
-import com.jsh.util.common.PageUtil;
-//import com.opensymphony.xwork2.ActionContext;
-
-@SuppressWarnings("serial")
-public class AppAction extends BaseAction
-{
- private AppIService appService;
- private UserBusinessIService userBusinessService;
- private AppModel model = new AppModel();
-
-
- /**
- * 增加应用
- * @return
- */
- public void create()
- {
- Log.infoFileSync("==================开始调用增加应用方法create()===================");
- Boolean flag = false;
- try
- {
- App app = new App();
- app.setNumber(model.getNumber());
- app.setName(model.getName());
- app.setType(model.getType());
-
- try {
- if(model.getIcon()!=null)
- {
- String path = ServletActionContext.getServletContext().getRealPath("/upload/images/deskIcon");
- String iconName=model.getIcon();
- File file1 = new File(iconName); //文件
- String FileName = file1.getName(); //获取文件名
- app.setIcon(FileName); //设置图片ICON
- InputStream is = new FileInputStream(iconName);
- File file = new File(path, FileName);
- OutputStream os = new FileOutputStream(file);
- byte[] b = new byte[1024];
- int bs = 0;
- while ((bs = is.read(b)) > 0) {
- os.write(b, 0, bs);
- }
- is.close();
- os.close();
- }
-
- } catch (FileNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- app.setURL(model.getURL());
- app.setWidth(model.getWidth());
- app.setHeight(model.getHeight());
- app.setReSize(model.getReSize());
- app.setOpenMax(model.getOpenMax());
- app.setFlash(model.getFlash());
- app.setZL(model.getZL());
- app.setSort(model.getSort());
- app.setRemark(model.getRemark());
- app.setEnabled(model.getEnabled());
- appService.create(app);
-
- //========标识位===========
- flag = true;
- //记录操作日志使用
- tipMsg = "成功";
- tipType = 0;
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加应用异常", e);
- flag = false;
- tipMsg = "失败";
- tipType = 1;
- }
- finally
- {
- try
- {
- toClient(flag.toString());
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>增加应用回写客户端结果异常", e);
- }
- }
-
- logService.create(new Logdetails(getUser(), "增加应用", model.getClientIp(),
- new Timestamp(System.currentTimeMillis())
- , tipType, "增加应用名称为 "+ model.getName() + " " + tipMsg + "!", "增加应用" + tipMsg));
- Log.infoFileSync("==================结束调用增加应用方法create()===================");
- }
-
- /**
- * 删除应用
- * @return
- */
- public String delete()
- {
- Log.infoFileSync("====================开始调用删除应用方法delete()================");
- try
- {
- appService.delete(model.getAppID());
- tipMsg = "成功";
- tipType = 0;
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getAppID() + " 的应用异常", e);
- tipMsg = "失败";
- tipType = 1;
- }
- model.getShowModel().setMsgTip(tipMsg);
- logService.create(new Logdetails(getUser(), "删除应用", model.getClientIp(),
- new Timestamp(System.currentTimeMillis())
- , tipType, "删除应用ID为 "+ model.getAppID() + " " + tipMsg + "!", "删除应用" + tipMsg));
- Log.infoFileSync("====================结束调用删除应用方法delete()================");
- return SUCCESS;
- }
-
- /**
- * 更新仓库
- * @return
- */
- public void update()
- {
- Boolean flag = false;
- try
- {
- App app = appService.get(model.getAppID());
- app.setNumber(model.getNumber());
- app.setName(model.getName());
- app.setType(model.getType());
- //app.setIcon(model.getIcon());
- app.setURL(model.getURL());
- app.setWidth(model.getWidth());
- app.setHeight(model.getHeight());
- app.setReSize(model.getReSize());
- app.setOpenMax(model.getOpenMax());
- app.setFlash(model.getFlash());
- app.setZL(model.getZL());
- app.setSort(model.getSort());
- app.setRemark(model.getRemark());
- app.setEnabled(model.getEnabled());
- appService.update(app);
-
- flag = true;
- tipMsg = "成功";
- tipType = 0;
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>修改应用ID为 : " + model.getAppID() + "信息失败", e);
- flag = false;
- tipMsg = "失败";
- tipType = 1;
- }
- finally
- {
- try
- {
- toClient(flag.toString());
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>修改应用回写客户端结果异常", e);
- }
- }
- logService.create(new Logdetails(getUser(), "更新应用", model.getClientIp(),
- new Timestamp(System.currentTimeMillis())
- , tipType, "更新应用ID为 "+ model.getAppID() + " " + tipMsg + "!", "更新应用" + tipMsg));
- }
-
- /**
- * 批量删除指定ID应用
- * @return
- */
- public String batchDelete()
- {
- try
- {
- appService.batchDelete(model.getAppIDs());
- model.getShowModel().setMsgTip("成功");
- //记录操作日志使用
- tipMsg = "成功";
- tipType = 0;
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>批量删除应用ID为:" + model.getAppIDs() + "信息异常", e);
- tipMsg = "失败";
- tipType = 1;
- }
-
- logService.create(new Logdetails(getUser(), "批量删除应用", model.getClientIp(),
- new Timestamp(System.currentTimeMillis())
- , tipType, "批量删除应用ID为 "+ model.getAppIDs() + " " + tipMsg + "!", "批量删除应用" + tipMsg));
- return SUCCESS;
- }
-
- /**
- * 检查输入名称是否存在
- */
- public void checkIsNameExist()
- {
- Boolean flag = false;
- try
- {
- flag = appService.checkIsNameExist("name",model.getName(),"Id", model.getAppID());
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>检查应用名称为:" + model.getName() + " ID为: " + model.getAppID() + " 是否存在异常!");
- }
- finally
- {
- try
- {
- toClient(flag.toString());
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>回写检查应用名称为:" + model.getName() + " ID为: " + model.getAppID() + " 是否存在异常!",e);
- }
- }
- }
-
- /**
- * 查找应用信息
- * @return
- */
- public void findBy()
- {
- try
- {
- PageUtil pageUtil = new PageUtil();
- pageUtil.setPageSize(model.getPageSize());
- pageUtil.setCurPage(model.getPageNo());
- pageUtil.setAdvSearch(getCondition());
- appService.find(pageUtil);
- List dataList = pageUtil.getPageList();
-
- //开始拼接json数据
-// {"total":28,"rows":[
-// {"productid":"AV-CB-01","attr1":"Adult Male","itemid":"EST-18"}
-// ]}
- JSONObject outer = new JSONObject();
- outer.put("total", pageUtil.getTotalCount());
- //存放数据json数组
- JSONArray dataArray = new JSONArray();
- if(null != dataList)
- {
- for(App app:dataList)
- {
- JSONObject item = new JSONObject();
- item.put("Id", app.getId());
- //应用名称
- item.put("Number", app.getNumber());
- item.put("Name", app.getName());
- item.put("Type", app.getType());
- item.put("Icon", app.getIcon());
- item.put("URL", app.getURL());
- item.put("Width", app.getWidth());
- item.put("Height", app.getHeight());
- item.put("ReSize", app.getReSize());
- item.put("OpenMax", app.getOpenMax());
- item.put("Flash", app.getFlash());
- item.put("ZL", app.getZL());
- item.put("Sort", app.getSort());
- item.put("Remark", app.getRemark());
- item.put("Enabled", app.getEnabled());
- item.put("op", 1);
- dataArray.add(item);
- }
- }
- outer.put("rows", dataArray);
- //回写查询结果
- toClient(outer.toString());
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找应用异常", e);
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询应用结果异常", e);
- }
- }
-
- /**
- * 桌面应用显示
- * @return
- */
- public void findDesk()
- {
- try
- {
- PageUtil pageUtil = new PageUtil();
- pageUtil.setPageSize(100);
- //pageUtil.setCurPage(model.getPageNo());
-
- JSONObject outer = new JSONObject();
-
- //下面是dock
- pageUtil.setAdvSearch(getCondition_dock());
- appService.find(pageUtil);
- List dataList1 = pageUtil.getPageList();
-
- //开始拼接json数据
- //存放数据json数组
- JSONArray dataArray1 = new JSONArray();
- if(null != dataList1)
- {
- for(App app:dataList1)
- {
- JSONObject item = new JSONObject();
- item.put("id", app.getId());
- item.put("title", app.getName());
- item.put("type", app.getType());
- item.put("icon", "../../upload/images/deskIcon/"+app.getIcon());
- item.put("url", app.getURL());
- item.put("width", app.getWidth());
- item.put("height", app.getHeight());
- item.put("isresize", app.getReSize());
- item.put("isopenmax", app.getOpenMax());
- item.put("isflash", app.getFlash());
- dataArray1.add(item);
- }
- }
- outer.put("dock", dataArray1);
-
- //下面是desk
- pageUtil.setAdvSearch(getCondition_desk());
- appService.find(pageUtil);
- List dataList2 = pageUtil.getPageList();
-
- //开始拼接json数据
- //存放数据json数组
- JSONArray dataArray2 = new JSONArray();
- if(null != dataList2)
- {
- for(App app:dataList2)
- {
- JSONObject item = new JSONObject();
- item.put("id", app.getId());
- item.put("title", app.getName());
- item.put("type", app.getType());
- item.put("icon", "../../upload/images/deskIcon/"+app.getIcon());
- item.put("url", "../../pages/common/menu.jsp?appID="+app.getNumber()+"&id="+app.getId());
- item.put("width", app.getWidth());
- item.put("height", app.getHeight());
- item.put("isresize", app.getReSize());
- item.put("isopenmax", app.getOpenMax());
- item.put("isflash", app.getFlash());
- dataArray2.add(item);
- }
- }
- outer.put("desk", dataArray2);
- //回写查询结果
- toClient(outer.toString());
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找应用异常", e);
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询应用结果异常", e);
- }
- }
-
-
- /**
- * 角色对应应用显示
- * @return
- */
- public void findRoleAPP()
- {
- try
- {
- PageUtil pageUtil = new PageUtil();
- pageUtil.setPageSize(100);
- //pageUtil.setCurPage(model.getPageNo());
-
- pageUtil.setAdvSearch(getCondition_RoleAPP());
- appService.find(pageUtil);
- List dataList = pageUtil.getPageList();
-
- //开始拼接json数据
- JSONObject outer = new JSONObject();
- outer.put("id", 1);
- outer.put("text", "应用列表");
- outer.put("state", "open");
- //存放数据json数组
- JSONArray dataArray = new JSONArray();
- if(null != dataList)
- {
- for(App app:dataList)
- {
- JSONObject item = new JSONObject();
- item.put("id", app.getId());
- item.put("text", app.getName());
- //勾选判断1
- Boolean flag = false;
- try
- {
- flag = userBusinessService.checkIsUserBusinessExist("Type",model.getUBType(),"KeyId",model.getUBKeyId(),"Value","["+app.getId().toString()+"]");
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>设置角色对应的应用:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
- }
- if (flag==true){item.put("checked", true);}
- //结束
- dataArray.add(item);
- }
- }
- outer.put("children", dataArray);
- //回写查询结果
- toClient("["+outer.toString()+"]");
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找应用异常", e);
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询应用结果异常", e);
- }
- }
-
- /**
- * 拼接搜索条件
- * @return
- */
- private Map getCondition()
- {
- /**
- * 拼接搜索条件
- */
- Map condition = new HashMap();
- condition.put("Name_s_like", model.getName());
- condition.put("Type_s_like", model.getType());
- condition.put("Sort_s_order", "asc");
- return condition;
- }
-
- /**
- * 拼接搜索条件-桌面dock
- * @return
- */
- private Map getCondition_dock()
- {
- /**
- * 拼接搜索条件
- */
- Map condition = new HashMap();
- condition.put("ZL_s_eq", "dock");
- condition.put("Enabled_n_eq", 1);
- condition.put("Sort_s_order", "asc");
- return condition;
- }
-
- /**
- * 拼接搜索条件-桌面desk
- * @return
- */
- private Map getCondition_desk()
- {
- /**
- * 拼接搜索条件
- */
- Map condition = new HashMap();
- condition.put("ZL_s_eq", "desk");
- condition.put("Enabled_n_eq", 1);
- condition.put("Sort_s_order", "asc");
- return condition;
- }
-
- /**
- * 拼接搜索条件-角色对应应用
- * @return
- */
- private Map getCondition_RoleAPP()
- {
- /**
- * 拼接搜索条件
- */
- Map condition = new HashMap();
- condition.put("Enabled_n_eq", 1);
- condition.put("Sort_s_order", "asc");
- return condition;
- }
-
- //=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
- @Override
- public AppModel getModel()
- {
- return model;
- }
- public void setAppService(AppIService appService)
- {
- this.appService = appService;
- }
-
- public void setUserBusinessService(UserBusinessIService userBusinessService) {
- this.userBusinessService = userBusinessService;
- }
-
-}
+package com.jsh.action.basic;
+
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import java.sql.Timestamp;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import net.sf.json.JSONArray;
+import net.sf.json.JSONObject;
+
+import org.apache.struts2.ServletActionContext;
+import org.springframework.dao.DataAccessException;
+
+import com.jsh.base.BaseAction;
+import com.jsh.base.Log;
+import com.jsh.exception.JshException;
+import com.jsh.model.po.App;
+import com.jsh.model.po.Logdetails;
+import com.jsh.model.vo.basic.AppModel;
+import com.jsh.service.basic.AppIService;
+import com.jsh.service.basic.UserBusinessIService;
+import com.jsh.util.common.PageUtil;
+//import com.opensymphony.xwork2.ActionContext;
+
+@SuppressWarnings("serial")
+public class AppAction extends BaseAction
+{
+ private AppIService appService;
+ private UserBusinessIService userBusinessService;
+ private AppModel model = new AppModel();
+
+
+ /**
+ * 增加应用
+ * @return
+ */
+ public void create()
+ {
+ Log.infoFileSync("==================开始调用增加应用方法create()===================");
+ Boolean flag = false;
+ try
+ {
+ App app = new App();
+ app.setNumber(model.getNumber());
+ app.setName(model.getName());
+ app.setType(model.getType());
+
+ try {
+ if(model.getIcon()!=null)
+ {
+ String path = ServletActionContext.getServletContext().getRealPath("/upload/images/deskIcon");
+ String iconName=model.getIcon();
+ File file1 = new File(iconName); //文件
+ String FileName = file1.getName(); //获取文件名
+ app.setIcon(FileName); //设置图片ICON
+ InputStream is = new FileInputStream(iconName);
+ File file = new File(path, FileName);
+ OutputStream os = new FileOutputStream(file);
+ byte[] b = new byte[1024];
+ int bs = 0;
+ while ((bs = is.read(b)) > 0) {
+ os.write(b, 0, bs);
+ }
+ is.close();
+ os.close();
+ }
+
+ } catch (FileNotFoundException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ app.setURL(model.getURL());
+ app.setWidth(model.getWidth());
+ app.setHeight(model.getHeight());
+ app.setReSize(model.getReSize());
+ app.setOpenMax(model.getOpenMax());
+ app.setFlash(model.getFlash());
+ app.setZL(model.getZL());
+ app.setSort(model.getSort());
+ app.setRemark(model.getRemark());
+ app.setEnabled(model.getEnabled());
+ appService.create(app);
+
+ //========标识位===========
+ flag = true;
+ //记录操作日志使用
+ tipMsg = "成功";
+ tipType = 0;
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加应用异常", e);
+ flag = false;
+ tipMsg = "失败";
+ tipType = 1;
+ }
+ finally
+ {
+ try
+ {
+ toClient(flag.toString());
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>增加应用回写客户端结果异常", e);
+ }
+ }
+
+ logService.create(new Logdetails(getUser(), "增加应用", model.getClientIp(),
+ new Timestamp(System.currentTimeMillis())
+ , tipType, "增加应用名称为 "+ model.getName() + " " + tipMsg + "!", "增加应用" + tipMsg));
+ Log.infoFileSync("==================结束调用增加应用方法create()===================");
+ }
+
+ /**
+ * 删除应用
+ * @return
+ */
+ public String delete()
+ {
+ Log.infoFileSync("====================开始调用删除应用方法delete()================");
+ try
+ {
+ appService.delete(model.getAppID());
+ tipMsg = "成功";
+ tipType = 0;
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getAppID() + " 的应用异常", e);
+ tipMsg = "失败";
+ tipType = 1;
+ }
+ model.getShowModel().setMsgTip(tipMsg);
+ logService.create(new Logdetails(getUser(), "删除应用", model.getClientIp(),
+ new Timestamp(System.currentTimeMillis())
+ , tipType, "删除应用ID为 "+ model.getAppID() + " " + tipMsg + "!", "删除应用" + tipMsg));
+ Log.infoFileSync("====================结束调用删除应用方法delete()================");
+ return SUCCESS;
+ }
+
+ /**
+ * 更新仓库
+ * @return
+ */
+ public void update()
+ {
+ Boolean flag = false;
+ try
+ {
+ App app = appService.get(model.getAppID());
+ app.setNumber(model.getNumber());
+ app.setName(model.getName());
+ app.setType(model.getType());
+ //app.setIcon(model.getIcon());
+ app.setURL(model.getURL());
+ app.setWidth(model.getWidth());
+ app.setHeight(model.getHeight());
+ app.setReSize(model.getReSize());
+ app.setOpenMax(model.getOpenMax());
+ app.setFlash(model.getFlash());
+ app.setZL(model.getZL());
+ app.setSort(model.getSort());
+ app.setRemark(model.getRemark());
+ app.setEnabled(model.getEnabled());
+ appService.update(app);
+
+ flag = true;
+ tipMsg = "成功";
+ tipType = 0;
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>修改应用ID为 : " + model.getAppID() + "信息失败", e);
+ flag = false;
+ tipMsg = "失败";
+ tipType = 1;
+ }
+ finally
+ {
+ try
+ {
+ toClient(flag.toString());
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>修改应用回写客户端结果异常", e);
+ }
+ }
+ logService.create(new Logdetails(getUser(), "更新应用", model.getClientIp(),
+ new Timestamp(System.currentTimeMillis())
+ , tipType, "更新应用ID为 "+ model.getAppID() + " " + tipMsg + "!", "更新应用" + tipMsg));
+ }
+
+ /**
+ * 批量删除指定ID应用
+ * @return
+ */
+ public String batchDelete()
+ {
+ try
+ {
+ appService.batchDelete(model.getAppIDs());
+ model.getShowModel().setMsgTip("成功");
+ //记录操作日志使用
+ tipMsg = "成功";
+ tipType = 0;
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>批量删除应用ID为:" + model.getAppIDs() + "信息异常", e);
+ tipMsg = "失败";
+ tipType = 1;
+ }
+
+ logService.create(new Logdetails(getUser(), "批量删除应用", model.getClientIp(),
+ new Timestamp(System.currentTimeMillis())
+ , tipType, "批量删除应用ID为 "+ model.getAppIDs() + " " + tipMsg + "!", "批量删除应用" + tipMsg));
+ return SUCCESS;
+ }
+
+ /**
+ * 检查输入名称是否存在
+ */
+ public void checkIsNameExist()
+ {
+ Boolean flag = false;
+ try
+ {
+ flag = appService.checkIsNameExist("name",model.getName(),"Id", model.getAppID());
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>检查应用名称为:" + model.getName() + " ID为: " + model.getAppID() + " 是否存在异常!");
+ }
+ finally
+ {
+ try
+ {
+ toClient(flag.toString());
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>回写检查应用名称为:" + model.getName() + " ID为: " + model.getAppID() + " 是否存在异常!",e);
+ }
+ }
+ }
+
+ /**
+ * 查找应用信息
+ * @return
+ */
+ public void findBy()
+ {
+ try
+ {
+ PageUtil pageUtil = new PageUtil();
+ pageUtil.setPageSize(model.getPageSize());
+ pageUtil.setCurPage(model.getPageNo());
+ pageUtil.setAdvSearch(getCondition());
+ appService.find(pageUtil);
+ List dataList = pageUtil.getPageList();
+
+ //开始拼接json数据
+// {"total":28,"rows":[
+// {"productid":"AV-CB-01","attr1":"Adult Male","itemid":"EST-18"}
+// ]}
+ JSONObject outer = new JSONObject();
+ outer.put("total", pageUtil.getTotalCount());
+ //存放数据json数组
+ JSONArray dataArray = new JSONArray();
+ if(null != dataList)
+ {
+ for(App app:dataList)
+ {
+ JSONObject item = new JSONObject();
+ item.put("Id", app.getId());
+ //应用名称
+ item.put("Number", app.getNumber());
+ item.put("Name", app.getName());
+ item.put("Type", app.getType());
+ item.put("Icon", app.getIcon());
+ item.put("URL", app.getURL());
+ item.put("Width", app.getWidth());
+ item.put("Height", app.getHeight());
+ item.put("ReSize", app.getReSize());
+ item.put("OpenMax", app.getOpenMax());
+ item.put("Flash", app.getFlash());
+ item.put("ZL", app.getZL());
+ item.put("Sort", app.getSort());
+ item.put("Remark", app.getRemark());
+ item.put("Enabled", app.getEnabled());
+ item.put("op", 1);
+ dataArray.add(item);
+ }
+ }
+ outer.put("rows", dataArray);
+ //回写查询结果
+ toClient(outer.toString());
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找应用异常", e);
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询应用结果异常", e);
+ }
+ }
+
+ /**
+ * 桌面应用显示
+ * @return
+ */
+ public void findDesk()
+ {
+ try
+ {
+ PageUtil pageUtil = new PageUtil();
+ pageUtil.setPageSize(100);
+ //pageUtil.setCurPage(model.getPageNo());
+
+ JSONObject outer = new JSONObject();
+
+ //下面是dock
+ pageUtil.setAdvSearch(getCondition_dock());
+ appService.find(pageUtil);
+ List dataList1 = pageUtil.getPageList();
+
+ //开始拼接json数据
+ //存放数据json数组
+ JSONArray dataArray1 = new JSONArray();
+ if(null != dataList1)
+ {
+ for(App app:dataList1)
+ {
+ JSONObject item = new JSONObject();
+ item.put("id", app.getId());
+ item.put("title", app.getName());
+ item.put("type", app.getType());
+ item.put("icon", "../../upload/images/deskIcon/"+app.getIcon());
+ item.put("url", app.getURL());
+ item.put("width", app.getWidth());
+ item.put("height", app.getHeight());
+ item.put("isresize", app.getReSize());
+ item.put("isopenmax", app.getOpenMax());
+ item.put("isflash", app.getFlash());
+ dataArray1.add(item);
+ }
+ }
+ outer.put("dock", dataArray1);
+
+ //下面是desk
+ pageUtil.setAdvSearch(getCondition_desk());
+ appService.find(pageUtil);
+ List dataList2 = pageUtil.getPageList();
+
+ //开始拼接json数据
+ //存放数据json数组
+ JSONArray dataArray2 = new JSONArray();
+ if(null != dataList2)
+ {
+ for(App app:dataList2)
+ {
+ JSONObject item = new JSONObject();
+ item.put("id", app.getId());
+ item.put("title", app.getName());
+ item.put("type", app.getType());
+ item.put("icon", "../../upload/images/deskIcon/"+app.getIcon());
+ item.put("url", "../../pages/common/menu.jsp?appID="+app.getNumber()+"&id="+app.getId());
+ item.put("width", app.getWidth());
+ item.put("height", app.getHeight());
+ item.put("isresize", app.getReSize());
+ item.put("isopenmax", app.getOpenMax());
+ item.put("isflash", app.getFlash());
+ dataArray2.add(item);
+ }
+ }
+ outer.put("desk", dataArray2);
+ //回写查询结果
+ toClient(outer.toString());
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找应用异常", e);
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询应用结果异常", e);
+ }
+ }
+
+
+ /**
+ * 角色对应应用显示
+ * @return
+ */
+ public void findRoleAPP()
+ {
+ try
+ {
+ PageUtil pageUtil = new PageUtil();
+ pageUtil.setPageSize(100);
+ //pageUtil.setCurPage(model.getPageNo());
+
+ pageUtil.setAdvSearch(getCondition_RoleAPP());
+ appService.find(pageUtil);
+ List dataList = pageUtil.getPageList();
+
+ //开始拼接json数据
+ JSONObject outer = new JSONObject();
+ outer.put("id", 1);
+ outer.put("text", "应用列表");
+ outer.put("state", "open");
+ //存放数据json数组
+ JSONArray dataArray = new JSONArray();
+ if(null != dataList)
+ {
+ for(App app:dataList)
+ {
+ JSONObject item = new JSONObject();
+ item.put("id", app.getId());
+ item.put("text", app.getName());
+ //勾选判断1
+ Boolean flag = false;
+ try
+ {
+ flag = userBusinessService.checkIsUserBusinessExist("Type",model.getUBType(),"KeyId",model.getUBKeyId(),"Value","["+app.getId().toString()+"]");
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>设置角色对应的应用:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
+ }
+ if (flag==true){item.put("checked", true);}
+ //结束
+ dataArray.add(item);
+ }
+ }
+ outer.put("children", dataArray);
+ //回写查询结果
+ toClient("["+outer.toString()+"]");
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找应用异常", e);
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询应用结果异常", e);
+ }
+ }
+
+ /**
+ * 拼接搜索条件
+ * @return
+ */
+ private Map getCondition()
+ {
+ /**
+ * 拼接搜索条件
+ */
+ Map condition = new HashMap();
+ condition.put("Name_s_like", model.getName());
+ condition.put("Type_s_like", model.getType());
+ condition.put("Sort_s_order", "asc");
+ return condition;
+ }
+
+ /**
+ * 拼接搜索条件-桌面dock
+ * @return
+ */
+ private Map getCondition_dock()
+ {
+ /**
+ * 拼接搜索条件
+ */
+ Map condition = new HashMap();
+ condition.put("ZL_s_eq", "dock");
+ condition.put("Enabled_n_eq", 1);
+ condition.put("Sort_s_order", "asc");
+ return condition;
+ }
+
+ /**
+ * 拼接搜索条件-桌面desk
+ * @return
+ */
+ private Map getCondition_desk()
+ {
+ /**
+ * 拼接搜索条件
+ */
+ Map condition = new HashMap();
+ condition.put("ZL_s_eq", "desk");
+ condition.put("Enabled_n_eq", 1);
+ condition.put("Sort_s_order", "asc");
+ return condition;
+ }
+
+ /**
+ * 拼接搜索条件-角色对应应用
+ * @return
+ */
+ private Map getCondition_RoleAPP()
+ {
+ /**
+ * 拼接搜索条件
+ */
+ Map condition = new HashMap();
+ condition.put("Enabled_n_eq", 1);
+ condition.put("Sort_s_order", "asc");
+ return condition;
+ }
+
+ //=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
+ @Override
+ public AppModel getModel()
+ {
+ return model;
+ }
+ public void setAppService(AppIService appService)
+ {
+ this.appService = appService;
+ }
+
+ public void setUserBusinessService(UserBusinessIService userBusinessService) {
+ this.userBusinessService = userBusinessService;
+ }
+
+}
diff --git a/src/com/jsh/action/basic/DepotAction.java b/src/com/jsh/action/basic/DepotAction.java
index 391f5c48..d48ff7f6 100644
--- a/src/com/jsh/action/basic/DepotAction.java
+++ b/src/com/jsh/action/basic/DepotAction.java
@@ -1,380 +1,380 @@
-package com.jsh.action.basic;
-
-import java.io.IOException;
-import java.sql.Timestamp;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import net.sf.json.JSONArray;
-import net.sf.json.JSONObject;
-
-import org.springframework.dao.DataAccessException;
-
-import com.jsh.base.BaseAction;
-import com.jsh.base.Log;
-import com.jsh.exception.AmsException;
-import com.jsh.model.po.Depot;
-import com.jsh.model.po.Logdetails;
-import com.jsh.model.po.Role;
-import com.jsh.model.vo.basic.DepotModel;
-import com.jsh.service.basic.DepotIService;
-import com.jsh.service.basic.UserBusinessIService;
-import com.jsh.util.common.PageUtil;
-
-@SuppressWarnings("serial")
-public class DepotAction extends BaseAction
-{
- private DepotIService depotService;
- private UserBusinessIService userBusinessService;
- private DepotModel model = new DepotModel();
-
-
- @SuppressWarnings({ "rawtypes", "unchecked" })
- public String getBasicData()
- {
- Map mapData = model.getShowModel().getMap();
- PageUtil pageUtil = new PageUtil();
- pageUtil.setPageSize(0);
- pageUtil.setCurPage(0);
- try
- {
- Map condition = pageUtil.getAdvSearch();
- condition.put("id_s_order", "asc");
- depotService.find(pageUtil);
- mapData.put("depotList", pageUtil.getPageList());
- }
- catch (Exception e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>查找系统基础数据信息异常", e);
- model.getShowModel().setMsgTip("exceptoin");
- }
- return SUCCESS;
- }
-
- /**
- * 增加仓库
- * @return
- */
- public void create()
- {
- Log.infoFileSync("==================开始调用增加仓库信息方法create()===================");
- Boolean flag = false;
- try
- {
- Depot depot = new Depot();
- depot.setName(model.getName());
- depot.setSort(model.getSort());
- depot.setRemark(model.getRemark());
- depotService.create(depot);
-
- //========标识位===========
- flag = true;
- //记录操作日志使用
- tipMsg = "成功";
- tipType = 0;
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加仓库信息异常", e);
- flag = false;
- tipMsg = "失败";
- tipType = 1;
- }
- finally
- {
- try
- {
- toClient(flag.toString());
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>增加仓库信息回写客户端结果异常", e);
- }
- }
-
- logService.create(new Logdetails(getUser(), "增加仓库", model.getClientIp(),
- new Timestamp(System.currentTimeMillis())
- , tipType, "增加仓库名称为 "+ model.getName() + " " + tipMsg + "!", "增加仓库" + tipMsg));
- Log.infoFileSync("==================结束调用增加仓库方法create()===================");
- }
-
- /**
- * 删除仓库
- * @return
- */
- public String delete()
- {
- Log.infoFileSync("====================开始调用删除仓库信息方法delete()================");
- try
- {
- depotService.delete(model.getDepotID());
- tipMsg = "成功";
- tipType = 0;
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getDepotID() + " 的仓库异常", e);
- tipMsg = "失败";
- tipType = 1;
- }
- model.getShowModel().setMsgTip(tipMsg);
- logService.create(new Logdetails(getUser(), "删除仓库", model.getClientIp(),
- new Timestamp(System.currentTimeMillis())
- , tipType, "删除仓库ID为 "+ model.getDepotID() + " " + tipMsg + "!", "删除仓库" + tipMsg));
- Log.infoFileSync("====================结束调用删除仓库信息方法delete()================");
- return SUCCESS;
- }
-
- /**
- * 更新仓库
- * @return
- */
- public void update()
- {
- Boolean flag = false;
- try
- {
- Depot depot = depotService.get(model.getDepotID());
- depot.setName(model.getName());
- depot.setSort(model.getSort());
- depot.setRemark(model.getRemark());
- depotService.update(depot);
-
- flag = true;
- tipMsg = "成功";
- tipType = 0;
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>修改仓库ID为 : " + model.getDepotID() + "信息失败", e);
- flag = false;
- tipMsg = "失败";
- tipType = 1;
- }
- finally
- {
- try
- {
- toClient(flag.toString());
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>修改仓库回写客户端结果异常", e);
- }
- }
- logService.create(new Logdetails(getUser(), "更新仓库", model.getClientIp(),
- new Timestamp(System.currentTimeMillis())
- , tipType, "更新仓库ID为 "+ model.getDepotID() + " " + tipMsg + "!", "更新仓库" + tipMsg));
- }
-
- /**
- * 批量删除指定ID仓库
- * @return
- */
- public String batchDelete()
- {
- try
- {
- depotService.batchDelete(model.getDepotIDs());
- model.getShowModel().setMsgTip("成功");
- //记录操作日志使用
- tipMsg = "成功";
- tipType = 0;
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>批量删除仓库ID为:" + model.getDepotIDs() + "信息异常", e);
- tipMsg = "失败";
- tipType = 1;
- }
-
- logService.create(new Logdetails(getUser(), "批量删除仓库", model.getClientIp(),
- new Timestamp(System.currentTimeMillis())
- , tipType, "批量删除仓库ID为 "+ model.getDepotIDs() + " " + tipMsg + "!", "批量删除仓库" + tipMsg));
- return SUCCESS;
- }
-
- /**
- * 检查输入名称是否存在
- */
- public void checkIsNameExist()
- {
- Boolean flag = false;
- try
- {
- flag = depotService.checkIsNameExist("name",model.getName(),"id", model.getDepotID());
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>检查仓库名称为:" + model.getName() + " ID为: " + model.getDepotID() + " 是否存在异常!");
- }
- finally
- {
- try
- {
- toClient(flag.toString());
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>回写检查仓库名称为:" + model.getName() + " ID为: " + model.getDepotID() + " 是否存在异常!",e);
- }
- }
- }
-
- /**
- * 查找仓库信息
- * @return
- */
- public void findBy()
- {
- try
- {
- PageUtil pageUtil = new PageUtil();
- pageUtil.setPageSize(model.getPageSize());
- pageUtil.setCurPage(model.getPageNo());
- pageUtil.setAdvSearch(getCondition());
- depotService.find(pageUtil);
- List dataList = pageUtil.getPageList();
-
- //开始拼接json数据
-// {"total":28,"rows":[
-// {"productid":"AV-CB-01","attr1":"Adult Male","itemid":"EST-18"}
-// ]}
- JSONObject outer = new JSONObject();
- outer.put("total", pageUtil.getTotalCount());
- //存放数据json数组
- JSONArray dataArray = new JSONArray();
- if(null != dataList)
- {
- for(Depot depot:dataList)
- {
- JSONObject item = new JSONObject();
- item.put("id", depot.getId());
- //供应商名称
- item.put("name", depot.getName());
- item.put("sort", depot.getSort());
- item.put("remark", depot.getRemark());
- item.put("op", 1);
- dataArray.add(item);
- }
- }
- outer.put("rows", dataArray);
- //回写查询结果
- toClient(outer.toString());
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找仓库信息异常", e);
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询仓库信息结果异常", e);
- }
- }
-
- /**
- * 用户对应部门显示
- * @return
- */
- public void findUserDepot()
- {
- try
- {
- PageUtil pageUtil = new PageUtil();
- pageUtil.setPageSize(100);
- //pageUtil.setCurPage(model.getPageNo());
-
- pageUtil.setAdvSearch(getCondition_UserDepot());
- depotService.find(pageUtil);
- List dataList = pageUtil.getPageList();
-
- //开始拼接json数据
- JSONObject outer = new JSONObject();
- outer.put("id", 1);
- outer.put("text", "部门列表");
- outer.put("state", "open");
- //存放数据json数组
- JSONArray dataArray = new JSONArray();
- if(null != dataList)
- {
- for(Depot depot:dataList)
- {
- JSONObject item = new JSONObject();
- item.put("id", depot.getId());
- item.put("text", depot.getName());
- //勾选判断1
- Boolean flag = false;
- try
- {
- flag = userBusinessService.checkIsUserBusinessExist("Type",model.getUBType(),"KeyId",model.getUBKeyId(),"Value","["+depot.getId().toString()+"]");
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>设置用户对应的部门:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
- }
- if (flag==true){item.put("checked", true);}
- //结束
- dataArray.add(item);
- }
- }
- outer.put("children", dataArray);
- //回写查询结果
- toClient("["+outer.toString()+"]");
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找部门异常", e);
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询部门结果异常", e);
- }
- }
-
- /**
- * 拼接搜索条件
- * @return
- */
- private Map getCondition()
- {
- /**
- * 拼接搜索条件
- */
- Map condition = new HashMap();
- condition.put("name_s_like", model.getName());
- condition.put("remark_s_like", model.getRemark());
- condition.put("sort_s_order", "asc");
- return condition;
- }
-
- /**
- * 拼接搜索条件-用户对应部门
- * @return
- */
- private Map getCondition_UserDepot()
- {
- /**
- * 拼接搜索条件
- */
- Map condition = new HashMap();
- condition.put("Id_s_order", "asc");
- return condition;
- }
-
- //=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
- @Override
- public DepotModel getModel()
- {
- return model;
- }
- public void setDepotService(DepotIService depotService)
- {
- this.depotService = depotService;
- }
-
- public void setUserBusinessService(UserBusinessIService userBusinessService) {
- this.userBusinessService = userBusinessService;
- }
-
-}
+package com.jsh.action.basic;
+
+import java.io.IOException;
+import java.sql.Timestamp;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import net.sf.json.JSONArray;
+import net.sf.json.JSONObject;
+
+import org.springframework.dao.DataAccessException;
+
+import com.jsh.base.BaseAction;
+import com.jsh.base.Log;
+import com.jsh.exception.JshException;
+import com.jsh.model.po.Depot;
+import com.jsh.model.po.Logdetails;
+import com.jsh.model.po.Role;
+import com.jsh.model.vo.basic.DepotModel;
+import com.jsh.service.basic.DepotIService;
+import com.jsh.service.basic.UserBusinessIService;
+import com.jsh.util.common.PageUtil;
+
+@SuppressWarnings("serial")
+public class DepotAction extends BaseAction
+{
+ private DepotIService depotService;
+ private UserBusinessIService userBusinessService;
+ private DepotModel model = new DepotModel();
+
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public String getBasicData()
+ {
+ Map mapData = model.getShowModel().getMap();
+ PageUtil pageUtil = new PageUtil();
+ pageUtil.setPageSize(0);
+ pageUtil.setCurPage(0);
+ try
+ {
+ Map condition = pageUtil.getAdvSearch();
+ condition.put("id_s_order", "asc");
+ depotService.find(pageUtil);
+ mapData.put("depotList", pageUtil.getPageList());
+ }
+ catch (Exception e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>查找系统基础数据信息异常", e);
+ model.getShowModel().setMsgTip("exceptoin");
+ }
+ return SUCCESS;
+ }
+
+ /**
+ * 增加仓库
+ * @return
+ */
+ public void create()
+ {
+ Log.infoFileSync("==================开始调用增加仓库信息方法create()===================");
+ Boolean flag = false;
+ try
+ {
+ Depot depot = new Depot();
+ depot.setName(model.getName());
+ depot.setSort(model.getSort());
+ depot.setRemark(model.getRemark());
+ depotService.create(depot);
+
+ //========标识位===========
+ flag = true;
+ //记录操作日志使用
+ tipMsg = "成功";
+ tipType = 0;
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加仓库信息异常", e);
+ flag = false;
+ tipMsg = "失败";
+ tipType = 1;
+ }
+ finally
+ {
+ try
+ {
+ toClient(flag.toString());
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>增加仓库信息回写客户端结果异常", e);
+ }
+ }
+
+ logService.create(new Logdetails(getUser(), "增加仓库", model.getClientIp(),
+ new Timestamp(System.currentTimeMillis())
+ , tipType, "增加仓库名称为 "+ model.getName() + " " + tipMsg + "!", "增加仓库" + tipMsg));
+ Log.infoFileSync("==================结束调用增加仓库方法create()===================");
+ }
+
+ /**
+ * 删除仓库
+ * @return
+ */
+ public String delete()
+ {
+ Log.infoFileSync("====================开始调用删除仓库信息方法delete()================");
+ try
+ {
+ depotService.delete(model.getDepotID());
+ tipMsg = "成功";
+ tipType = 0;
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getDepotID() + " 的仓库异常", e);
+ tipMsg = "失败";
+ tipType = 1;
+ }
+ model.getShowModel().setMsgTip(tipMsg);
+ logService.create(new Logdetails(getUser(), "删除仓库", model.getClientIp(),
+ new Timestamp(System.currentTimeMillis())
+ , tipType, "删除仓库ID为 "+ model.getDepotID() + " " + tipMsg + "!", "删除仓库" + tipMsg));
+ Log.infoFileSync("====================结束调用删除仓库信息方法delete()================");
+ return SUCCESS;
+ }
+
+ /**
+ * 更新仓库
+ * @return
+ */
+ public void update()
+ {
+ Boolean flag = false;
+ try
+ {
+ Depot depot = depotService.get(model.getDepotID());
+ depot.setName(model.getName());
+ depot.setSort(model.getSort());
+ depot.setRemark(model.getRemark());
+ depotService.update(depot);
+
+ flag = true;
+ tipMsg = "成功";
+ tipType = 0;
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>修改仓库ID为 : " + model.getDepotID() + "信息失败", e);
+ flag = false;
+ tipMsg = "失败";
+ tipType = 1;
+ }
+ finally
+ {
+ try
+ {
+ toClient(flag.toString());
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>修改仓库回写客户端结果异常", e);
+ }
+ }
+ logService.create(new Logdetails(getUser(), "更新仓库", model.getClientIp(),
+ new Timestamp(System.currentTimeMillis())
+ , tipType, "更新仓库ID为 "+ model.getDepotID() + " " + tipMsg + "!", "更新仓库" + tipMsg));
+ }
+
+ /**
+ * 批量删除指定ID仓库
+ * @return
+ */
+ public String batchDelete()
+ {
+ try
+ {
+ depotService.batchDelete(model.getDepotIDs());
+ model.getShowModel().setMsgTip("成功");
+ //记录操作日志使用
+ tipMsg = "成功";
+ tipType = 0;
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>批量删除仓库ID为:" + model.getDepotIDs() + "信息异常", e);
+ tipMsg = "失败";
+ tipType = 1;
+ }
+
+ logService.create(new Logdetails(getUser(), "批量删除仓库", model.getClientIp(),
+ new Timestamp(System.currentTimeMillis())
+ , tipType, "批量删除仓库ID为 "+ model.getDepotIDs() + " " + tipMsg + "!", "批量删除仓库" + tipMsg));
+ return SUCCESS;
+ }
+
+ /**
+ * 检查输入名称是否存在
+ */
+ public void checkIsNameExist()
+ {
+ Boolean flag = false;
+ try
+ {
+ flag = depotService.checkIsNameExist("name",model.getName(),"id", model.getDepotID());
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>检查仓库名称为:" + model.getName() + " ID为: " + model.getDepotID() + " 是否存在异常!");
+ }
+ finally
+ {
+ try
+ {
+ toClient(flag.toString());
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>回写检查仓库名称为:" + model.getName() + " ID为: " + model.getDepotID() + " 是否存在异常!",e);
+ }
+ }
+ }
+
+ /**
+ * 查找仓库信息
+ * @return
+ */
+ public void findBy()
+ {
+ try
+ {
+ PageUtil pageUtil = new PageUtil();
+ pageUtil.setPageSize(model.getPageSize());
+ pageUtil.setCurPage(model.getPageNo());
+ pageUtil.setAdvSearch(getCondition());
+ depotService.find(pageUtil);
+ List dataList = pageUtil.getPageList();
+
+ //开始拼接json数据
+// {"total":28,"rows":[
+// {"productid":"AV-CB-01","attr1":"Adult Male","itemid":"EST-18"}
+// ]}
+ JSONObject outer = new JSONObject();
+ outer.put("total", pageUtil.getTotalCount());
+ //存放数据json数组
+ JSONArray dataArray = new JSONArray();
+ if(null != dataList)
+ {
+ for(Depot depot:dataList)
+ {
+ JSONObject item = new JSONObject();
+ item.put("id", depot.getId());
+ //供应商名称
+ item.put("name", depot.getName());
+ item.put("sort", depot.getSort());
+ item.put("remark", depot.getRemark());
+ item.put("op", 1);
+ dataArray.add(item);
+ }
+ }
+ outer.put("rows", dataArray);
+ //回写查询结果
+ toClient(outer.toString());
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找仓库信息异常", e);
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询仓库信息结果异常", e);
+ }
+ }
+
+ /**
+ * 用户对应部门显示
+ * @return
+ */
+ public void findUserDepot()
+ {
+ try
+ {
+ PageUtil pageUtil = new PageUtil();
+ pageUtil.setPageSize(100);
+ //pageUtil.setCurPage(model.getPageNo());
+
+ pageUtil.setAdvSearch(getCondition_UserDepot());
+ depotService.find(pageUtil);
+ List dataList = pageUtil.getPageList();
+
+ //开始拼接json数据
+ JSONObject outer = new JSONObject();
+ outer.put("id", 1);
+ outer.put("text", "部门列表");
+ outer.put("state", "open");
+ //存放数据json数组
+ JSONArray dataArray = new JSONArray();
+ if(null != dataList)
+ {
+ for(Depot depot:dataList)
+ {
+ JSONObject item = new JSONObject();
+ item.put("id", depot.getId());
+ item.put("text", depot.getName());
+ //勾选判断1
+ Boolean flag = false;
+ try
+ {
+ flag = userBusinessService.checkIsUserBusinessExist("Type",model.getUBType(),"KeyId",model.getUBKeyId(),"Value","["+depot.getId().toString()+"]");
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>设置用户对应的部门:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
+ }
+ if (flag==true){item.put("checked", true);}
+ //结束
+ dataArray.add(item);
+ }
+ }
+ outer.put("children", dataArray);
+ //回写查询结果
+ toClient("["+outer.toString()+"]");
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找部门异常", e);
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询部门结果异常", e);
+ }
+ }
+
+ /**
+ * 拼接搜索条件
+ * @return
+ */
+ private Map getCondition()
+ {
+ /**
+ * 拼接搜索条件
+ */
+ Map condition = new HashMap();
+ condition.put("name_s_like", model.getName());
+ condition.put("remark_s_like", model.getRemark());
+ condition.put("sort_s_order", "asc");
+ return condition;
+ }
+
+ /**
+ * 拼接搜索条件-用户对应部门
+ * @return
+ */
+ private Map getCondition_UserDepot()
+ {
+ /**
+ * 拼接搜索条件
+ */
+ Map condition = new HashMap();
+ condition.put("Id_s_order", "asc");
+ return condition;
+ }
+
+ //=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
+ @Override
+ public DepotModel getModel()
+ {
+ return model;
+ }
+ public void setDepotService(DepotIService depotService)
+ {
+ this.depotService = depotService;
+ }
+
+ public void setUserBusinessService(UserBusinessIService userBusinessService) {
+ this.userBusinessService = userBusinessService;
+ }
+
+}
diff --git a/src/com/jsh/action/basic/FunctionsAction.java b/src/com/jsh/action/basic/FunctionsAction.java
index 9aa5470f..6e2c1ff6 100644
--- a/src/com/jsh/action/basic/FunctionsAction.java
+++ b/src/com/jsh/action/basic/FunctionsAction.java
@@ -1,588 +1,588 @@
-package com.jsh.action.basic;
-
-import java.io.IOException;
-import java.sql.Timestamp;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import net.sf.json.JSONArray;
-import net.sf.json.JSONObject;
-
-import org.springframework.dao.DataAccessException;
-
-import com.jsh.base.BaseAction;
-import com.jsh.base.Log;
-import com.jsh.exception.AmsException;
-import com.jsh.model.po.App;
-import com.jsh.model.po.Functions;
-import com.jsh.model.po.Logdetails;
-import com.jsh.model.vo.basic.FunctionsModel;
-import com.jsh.service.basic.FunctionsIService;
-import com.jsh.service.basic.UserBusinessIService;
-import com.jsh.util.common.PageUtil;
-
-@SuppressWarnings("serial")
-public class FunctionsAction extends BaseAction
-{
- private FunctionsIService functionsService;
- private UserBusinessIService userBusinessService;
- private FunctionsModel model = new FunctionsModel();
- /**
- * 增加功能
- * @return
- */
- public void create()
- {
- Log.infoFileSync("==================开始调用增加功能信息方法create()===================");
- Boolean flag = false;
- try
- {
- Functions functions = new Functions();
- functions.setNumber(model.getNumber());
- functions.setName(model.getName());
- functions.setPNumber(model.getPNumber());
- functions.setURL(model.getURL());
- functions.setState(model.getState());
- functions.setSort(model.getSort());
- functions.setEnabled(model.getEnabled());
- functions.setType(model.getType());
-
- functionsService.create(functions);
-
- //========标识位===========
- flag = true;
- //记录操作日志使用
- tipMsg = "成功";
- tipType = 0;
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加功能信息异常", e);
- flag = false;
- tipMsg = "失败";
- tipType = 1;
- }
- finally
- {
- try
- {
- toClient(flag.toString());
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>增加功能信息回写客户端结果异常", e);
- }
- }
-
- logService.create(new Logdetails(getUser(), "增加功能", model.getClientIp(),
- new Timestamp(System.currentTimeMillis())
- , tipType, "增加功能名称为 "+ model.getName() + " " + tipMsg + "!", "增加功能" + tipMsg));
- Log.infoFileSync("==================结束调用增加功能方法create()===================");
- }
-
- /**
- * 删除功能
- * @return
- */
- public String delete()
- {
- Log.infoFileSync("====================开始调用删除功能信息方法delete()================");
- try
- {
- functionsService.delete(model.getFunctionsID());
- tipMsg = "成功";
- tipType = 0;
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getFunctionsID() + " 的功能异常", e);
- tipMsg = "失败";
- tipType = 1;
- }
- model.getShowModel().setMsgTip(tipMsg);
- logService.create(new Logdetails(getUser(), "删除功能", model.getClientIp(),
- new Timestamp(System.currentTimeMillis())
- , tipType, "删除功能ID为 "+ model.getFunctionsID() + " " + tipMsg + "!", "删除功能" + tipMsg));
- Log.infoFileSync("====================结束调用删除功能信息方法delete()================");
- return SUCCESS;
- }
-
- /**
- * 更新功能
- * @return
- */
- public void update()
- {
- Boolean flag = false;
- try
- {
- Functions functions = functionsService.get(model.getFunctionsID());
- functions.setNumber(model.getNumber());
- functions.setName(model.getName());
- functions.setPNumber(model.getPNumber());
- functions.setURL(model.getURL());
- functions.setState(model.getState());
- functions.setSort(model.getSort());
- functions.setEnabled(model.getEnabled());
- functions.setType(model.getType());
- functionsService.update(functions);
-
- flag = true;
- tipMsg = "成功";
- tipType = 0;
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>修改功能ID为 : " + model.getFunctionsID() + "信息失败", e);
- flag = false;
- tipMsg = "失败";
- tipType = 1;
- }
- finally
- {
- try
- {
- toClient(flag.toString());
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>修改功能回写客户端结果异常", e);
- }
- }
- logService.create(new Logdetails(getUser(), "更新功能", model.getClientIp(),
- new Timestamp(System.currentTimeMillis())
- , tipType, "更新功能ID为 "+ model.getFunctionsID() + " " + tipMsg + "!", "更新功能" + tipMsg));
- }
-
- /**
- * 批量删除指定ID功能
- * @return
- */
- public String batchDelete()
- {
- try
- {
- functionsService.batchDelete(model.getFunctionsIDs());
- model.getShowModel().setMsgTip("成功");
- //记录操作日志使用
- tipMsg = "成功";
- tipType = 0;
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>批量删除功能ID为:" + model.getFunctionsIDs() + "信息异常", e);
- tipMsg = "失败";
- tipType = 1;
- }
-
- logService.create(new Logdetails(getUser(), "批量删除功能", model.getClientIp(),
- new Timestamp(System.currentTimeMillis())
- , tipType, "批量删除功能ID为 "+ model.getFunctionsIDs() + " " + tipMsg + "!", "批量删除功能" + tipMsg));
- return SUCCESS;
- }
-
- /**
- * 检查输入名称是否存在
- */
- public void checkIsNameExist()
- {
- Boolean flag = false;
- try
- {
- flag = functionsService.checkIsNameExist("Name",model.getName(),"Id", model.getFunctionsID());
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>检查功能名称为:" + model.getName() + " ID为: " + model.getFunctionsID() + " 是否存在异常!");
- }
- finally
- {
- try
- {
- toClient(flag.toString());
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>回写检查功能名称为:" + model.getName() + " ID为: " + model.getFunctionsID() + " 是否存在异常!",e);
- }
- }
- }
-
- /**
- * 查找功能信息
- * @return
- */
- public void findBy()
- {
- try
- {
- PageUtil pageUtil = new PageUtil();
- pageUtil.setPageSize(model.getPageSize());
- pageUtil.setCurPage(model.getPageNo());
- pageUtil.setAdvSearch(getCondition());
- functionsService.find(pageUtil);
- List dataList = pageUtil.getPageList();
-
- //开始拼接json数据
-// {"total":28,"rows":[
-// {"productid":"AV-CB-01","attr1":"Adult Male","itemid":"EST-18"}
-// ]}
- JSONObject outer = new JSONObject();
- outer.put("total", pageUtil.getTotalCount());
- //存放数据json数组
- JSONArray dataArray = new JSONArray();
- if(null != dataList)
- {
- for(Functions functions:dataList)
- {
- JSONObject item = new JSONObject();
- item.put("Id", functions.getId());
- item.put("Number", functions.getNumber());
- item.put("Name", functions.getName());
- item.put("PNumber", functions.getPNumber());
- item.put("URL", functions.getURL());
- item.put("State", functions.getState());
- item.put("Sort", functions.getSort());
- item.put("Enabled", functions.getEnabled());
- item.put("Type", functions.getType());
- item.put("op", 1);
- dataArray.add(item);
- }
- }
- outer.put("rows", dataArray);
- //回写查询结果
- toClient(outer.toString());
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找功能信息异常", e);
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询功能信息结果异常", e);
- }
- }
-
-
- /**
- * 角色对应功能显示
- * @return
- */
- public void findRoleFunctions()
- {
- try
- {
- PageUtil pageUtil = new PageUtil();
- pageUtil.setPageSize(200);
- pageUtil.setAdvSearch(getCondition_RoleFunctions("0"));
- functionsService.find(pageUtil);
- List dataList = pageUtil.getPageList();
-
- //开始拼接json数据
- JSONObject outer = new JSONObject();
- outer.put("id", 1);
- outer.put("text", "功能列表");
- outer.put("state", "open");
- //存放数据json数组
- JSONArray dataArray = new JSONArray();
- if(null != dataList)
- {
- for(Functions functions:dataList)
- {
- JSONObject item = new JSONObject();
- item.put("id", functions.getId());
- item.put("text", functions.getName());
-
- //勾选判断1
- Boolean flag = false;
- try
- {
- flag = userBusinessService.checkIsUserBusinessExist("Type",model.getUBType(),"KeyId",model.getUBKeyId(),"Value","["+functions.getId().toString()+"]");
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>设置角色对应的功能:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
- }
- if (flag==true){item.put("checked", true);}
- //结束
-
- pageUtil.setAdvSearch(getCondition_RoleFunctions(functions.getNumber()));
- functionsService.find(pageUtil);
- List dataList1 = pageUtil.getPageList();
- JSONArray dataArray1 = new JSONArray();
- if(null != dataList1)
- {
-
- for(Functions functions1:dataList1)
- {
- item.put("state", "open"); //如果不为空,节点不展开
- JSONObject item1 = new JSONObject();
- item1.put("id", functions1.getId());
- item1.put("text", functions1.getName());
-
- //勾选判断2
- //Boolean flag = false;
- try
- {
- flag = userBusinessService.checkIsUserBusinessExist("Type",model.getUBType(),"KeyId",model.getUBKeyId(),"Value","["+functions1.getId().toString()+"]");
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>设置角色对应的功能:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
- }
- if (flag==true){item1.put("checked", true);}
- //结束
-
- pageUtil.setAdvSearch(getCondition_RoleFunctions(functions1.getNumber()));
- functionsService.find(pageUtil);
- List dataList2 = pageUtil.getPageList();
- JSONArray dataArray2 = new JSONArray();
- if(null != dataList2)
- {
-
- for(Functions functions2:dataList2)
- {
- item1.put("state", "closed"); //如果不为空,节点不展开
- JSONObject item2 = new JSONObject();
- item2.put("id", functions2.getId());
- item2.put("text", functions2.getName());
-
- //勾选判断3
- //Boolean flag = false;
- try
- {
- flag = userBusinessService.checkIsUserBusinessExist("Type",model.getUBType(),"KeyId",model.getUBKeyId(),"Value","["+functions2.getId().toString()+"]");
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>设置角色对应的功能:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
- }
- if (flag==true){item2.put("checked", true);}
- //结束
-
- pageUtil.setAdvSearch(getCondition_RoleFunctions(functions2.getNumber()));
- functionsService.find(pageUtil);
- List dataList3 = pageUtil.getPageList();
- JSONArray dataArray3 = new JSONArray();
- if(null != dataList3)
- {
-
- for(Functions functions3:dataList3)
- {
- item2.put("state", "closed"); //如果不为空,节点不展开
- JSONObject item3 = new JSONObject();
- item3.put("id", functions3.getId());
- item3.put("text", functions3.getName());
-
- //勾选判断4
- //Boolean flag = false;
- try
- {
- flag = userBusinessService.checkIsUserBusinessExist("Type",model.getUBType(),"KeyId",model.getUBKeyId(),"Value","["+functions3.getId().toString()+"]");
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>设置角色对应的功能:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
- }
- if (flag==true){item3.put("checked", true);}
- //结束
-
- dataArray3.add(item3);
- item2.put("children", dataArray3);
- }
- }
-
- dataArray2.add(item2);
- item1.put("children", dataArray2);
- }
- }
-
- dataArray1.add(item1);
- item.put("children", dataArray1);
- }
-
- }
-
- dataArray.add(item);
- }
- outer.put("children", dataArray);
- }
- //回写查询结果
- toClient("["+outer.toString()+"]");
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找应用异常", e);
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询应用结果异常", e);
- }
- }
-
-
- /**
- * 页面显示菜单
- * @return
- */
- public void findMenu()
- {
- try
- {
- String fc=model.getHasFunctions(); //当前用户所拥有的功能列表,格式如:[1][2][5]
- PageUtil pageUtil = new PageUtil();
- pageUtil.setPageSize(200);
- pageUtil.setAdvSearch(getCondition_RoleFunctions(model.getPNumber()));
- functionsService.find(pageUtil);
- List dataList = pageUtil.getPageList();
-
- //存放数据json数组
- JSONArray dataArray = new JSONArray();
- if(null != dataList)
- {
- for(Functions functions:dataList)
- {
- JSONObject item = new JSONObject();
- item.put("id", functions.getId());
-
- pageUtil.setAdvSearch(getCondition_RoleFunctions(functions.getNumber()));
- functionsService.find(pageUtil);
- List dataList1 = pageUtil.getPageList();
- JSONArray dataArray1 = new JSONArray();
- if(dataList1.size()!=0)
- {
- item.put("text", functions.getName()); //是目录就没链接
- for(Functions functions1:dataList1)
- {
- item.put("state", "open"); //如果不为空,节点展开
- JSONObject item1 = new JSONObject();
-
- pageUtil.setAdvSearch(getCondition_RoleFunctions(functions1.getNumber()));
- functionsService.find(pageUtil);
- List dataList2 = pageUtil.getPageList();
- if(fc.indexOf("["+functions1.getId().toString()+"]")!=-1||dataList2.size()!=0)
- {
- item1.put("id", functions1.getId());
- JSONArray dataArray2 = new JSONArray();
- if(dataList2.size()!=0)
- {
- item1.put("text", functions1.getName());//是目录就没链接
- for(Functions functions2:dataList2)
- {
- item1.put("state", "closed"); //如果不为空,节点不展开
- JSONObject item2 = new JSONObject();
-
- pageUtil.setAdvSearch(getCondition_RoleFunctions(functions2.getNumber()));
- functionsService.find(pageUtil);
- List dataList3 = pageUtil.getPageList();
- if(fc.indexOf("["+functions2.getId().toString()+"]")!=-1||dataList3.size()!=0)
- {
- item2.put("id", functions2.getId());
- JSONArray dataArray3 = new JSONArray();
- if(dataList3.size()!=0)
- {
- item2.put("text", functions2.getName());//是目录就没链接
- for(Functions functions3:dataList3)
- {
- item2.put("state", "closed"); //如果不为空,节点不展开
- JSONObject item3 = new JSONObject();
- item3.put("id", functions3.getId());
- item3.put("text", functions3.getName());
- //
- dataArray3.add(item3);
- item2.put("children", dataArray3);
- }
- }
- else
- {
- //不是目录,有链接
- item2.put("text", ""+functions2.getName()+"");
- }
-
- dataArray2.add(item2);
- item1.put("children", dataArray2);
- }
- }
- }
- else
- {
- //不是目录,有链接
- item1.put("text", ""+functions1.getName()+"");
- }
-
- dataArray1.add(item1);
- item.put("children", dataArray1);
- }
- }
- }
- else
- {
- //不是目录,有链接
- item.put("text", ""+functions.getName()+"");
- }
-
- dataArray.add(item);
- }
- }
- //回写查询结果
- toClient(dataArray.toString());
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找应用异常", e);
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询应用结果异常", e);
- }
- }
-
- /**
- * 拼接搜索条件
- * @return
- */
- private Map getCondition()
- {
- /**
- * 拼接搜索条件
- */
- Map condition = new HashMap();
- condition.put("Name_s_like", model.getName());
- condition.put("Type_s_eq", model.getType());
- condition.put("Sort_s_order", "asc");
- return condition;
- }
-
- /**
- * 拼接搜索条件-角色对应功能
- * @return
- */
- private Map getCondition_RoleFunctions(String num)
- {
- /**
- * 拼接搜索条件
- */
- Map condition = new HashMap();
- condition.put("Enabled_n_eq", 1);
- condition.put("PNumber_s_eq", num);
- condition.put("Sort_s_order", "asc");
- return condition;
- }
-
- //=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
- @Override
- public FunctionsModel getModel()
- {
- return model;
- }
- public void setFunctionsService(FunctionsIService functionsService)
- {
- this.functionsService = functionsService;
- }
-
- public void setUserBusinessService(UserBusinessIService userBusinessService) {
- this.userBusinessService = userBusinessService;
- }
-
-}
+package com.jsh.action.basic;
+
+import java.io.IOException;
+import java.sql.Timestamp;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import net.sf.json.JSONArray;
+import net.sf.json.JSONObject;
+
+import org.springframework.dao.DataAccessException;
+
+import com.jsh.base.BaseAction;
+import com.jsh.base.Log;
+import com.jsh.exception.JshException;
+import com.jsh.model.po.App;
+import com.jsh.model.po.Functions;
+import com.jsh.model.po.Logdetails;
+import com.jsh.model.vo.basic.FunctionsModel;
+import com.jsh.service.basic.FunctionsIService;
+import com.jsh.service.basic.UserBusinessIService;
+import com.jsh.util.common.PageUtil;
+
+@SuppressWarnings("serial")
+public class FunctionsAction extends BaseAction
+{
+ private FunctionsIService functionsService;
+ private UserBusinessIService userBusinessService;
+ private FunctionsModel model = new FunctionsModel();
+ /**
+ * 增加功能
+ * @return
+ */
+ public void create()
+ {
+ Log.infoFileSync("==================开始调用增加功能信息方法create()===================");
+ Boolean flag = false;
+ try
+ {
+ Functions functions = new Functions();
+ functions.setNumber(model.getNumber());
+ functions.setName(model.getName());
+ functions.setPNumber(model.getPNumber());
+ functions.setURL(model.getURL());
+ functions.setState(model.getState());
+ functions.setSort(model.getSort());
+ functions.setEnabled(model.getEnabled());
+ functions.setType(model.getType());
+
+ functionsService.create(functions);
+
+ //========标识位===========
+ flag = true;
+ //记录操作日志使用
+ tipMsg = "成功";
+ tipType = 0;
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加功能信息异常", e);
+ flag = false;
+ tipMsg = "失败";
+ tipType = 1;
+ }
+ finally
+ {
+ try
+ {
+ toClient(flag.toString());
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>增加功能信息回写客户端结果异常", e);
+ }
+ }
+
+ logService.create(new Logdetails(getUser(), "增加功能", model.getClientIp(),
+ new Timestamp(System.currentTimeMillis())
+ , tipType, "增加功能名称为 "+ model.getName() + " " + tipMsg + "!", "增加功能" + tipMsg));
+ Log.infoFileSync("==================结束调用增加功能方法create()===================");
+ }
+
+ /**
+ * 删除功能
+ * @return
+ */
+ public String delete()
+ {
+ Log.infoFileSync("====================开始调用删除功能信息方法delete()================");
+ try
+ {
+ functionsService.delete(model.getFunctionsID());
+ tipMsg = "成功";
+ tipType = 0;
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getFunctionsID() + " 的功能异常", e);
+ tipMsg = "失败";
+ tipType = 1;
+ }
+ model.getShowModel().setMsgTip(tipMsg);
+ logService.create(new Logdetails(getUser(), "删除功能", model.getClientIp(),
+ new Timestamp(System.currentTimeMillis())
+ , tipType, "删除功能ID为 "+ model.getFunctionsID() + " " + tipMsg + "!", "删除功能" + tipMsg));
+ Log.infoFileSync("====================结束调用删除功能信息方法delete()================");
+ return SUCCESS;
+ }
+
+ /**
+ * 更新功能
+ * @return
+ */
+ public void update()
+ {
+ Boolean flag = false;
+ try
+ {
+ Functions functions = functionsService.get(model.getFunctionsID());
+ functions.setNumber(model.getNumber());
+ functions.setName(model.getName());
+ functions.setPNumber(model.getPNumber());
+ functions.setURL(model.getURL());
+ functions.setState(model.getState());
+ functions.setSort(model.getSort());
+ functions.setEnabled(model.getEnabled());
+ functions.setType(model.getType());
+ functionsService.update(functions);
+
+ flag = true;
+ tipMsg = "成功";
+ tipType = 0;
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>修改功能ID为 : " + model.getFunctionsID() + "信息失败", e);
+ flag = false;
+ tipMsg = "失败";
+ tipType = 1;
+ }
+ finally
+ {
+ try
+ {
+ toClient(flag.toString());
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>修改功能回写客户端结果异常", e);
+ }
+ }
+ logService.create(new Logdetails(getUser(), "更新功能", model.getClientIp(),
+ new Timestamp(System.currentTimeMillis())
+ , tipType, "更新功能ID为 "+ model.getFunctionsID() + " " + tipMsg + "!", "更新功能" + tipMsg));
+ }
+
+ /**
+ * 批量删除指定ID功能
+ * @return
+ */
+ public String batchDelete()
+ {
+ try
+ {
+ functionsService.batchDelete(model.getFunctionsIDs());
+ model.getShowModel().setMsgTip("成功");
+ //记录操作日志使用
+ tipMsg = "成功";
+ tipType = 0;
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>批量删除功能ID为:" + model.getFunctionsIDs() + "信息异常", e);
+ tipMsg = "失败";
+ tipType = 1;
+ }
+
+ logService.create(new Logdetails(getUser(), "批量删除功能", model.getClientIp(),
+ new Timestamp(System.currentTimeMillis())
+ , tipType, "批量删除功能ID为 "+ model.getFunctionsIDs() + " " + tipMsg + "!", "批量删除功能" + tipMsg));
+ return SUCCESS;
+ }
+
+ /**
+ * 检查输入名称是否存在
+ */
+ public void checkIsNameExist()
+ {
+ Boolean flag = false;
+ try
+ {
+ flag = functionsService.checkIsNameExist("Name",model.getName(),"Id", model.getFunctionsID());
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>检查功能名称为:" + model.getName() + " ID为: " + model.getFunctionsID() + " 是否存在异常!");
+ }
+ finally
+ {
+ try
+ {
+ toClient(flag.toString());
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>回写检查功能名称为:" + model.getName() + " ID为: " + model.getFunctionsID() + " 是否存在异常!",e);
+ }
+ }
+ }
+
+ /**
+ * 查找功能信息
+ * @return
+ */
+ public void findBy()
+ {
+ try
+ {
+ PageUtil pageUtil = new PageUtil();
+ pageUtil.setPageSize(model.getPageSize());
+ pageUtil.setCurPage(model.getPageNo());
+ pageUtil.setAdvSearch(getCondition());
+ functionsService.find(pageUtil);
+ List dataList = pageUtil.getPageList();
+
+ //开始拼接json数据
+// {"total":28,"rows":[
+// {"productid":"AV-CB-01","attr1":"Adult Male","itemid":"EST-18"}
+// ]}
+ JSONObject outer = new JSONObject();
+ outer.put("total", pageUtil.getTotalCount());
+ //存放数据json数组
+ JSONArray dataArray = new JSONArray();
+ if(null != dataList)
+ {
+ for(Functions functions:dataList)
+ {
+ JSONObject item = new JSONObject();
+ item.put("Id", functions.getId());
+ item.put("Number", functions.getNumber());
+ item.put("Name", functions.getName());
+ item.put("PNumber", functions.getPNumber());
+ item.put("URL", functions.getURL());
+ item.put("State", functions.getState());
+ item.put("Sort", functions.getSort());
+ item.put("Enabled", functions.getEnabled());
+ item.put("Type", functions.getType());
+ item.put("op", 1);
+ dataArray.add(item);
+ }
+ }
+ outer.put("rows", dataArray);
+ //回写查询结果
+ toClient(outer.toString());
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找功能信息异常", e);
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询功能信息结果异常", e);
+ }
+ }
+
+
+ /**
+ * 角色对应功能显示
+ * @return
+ */
+ public void findRoleFunctions()
+ {
+ try
+ {
+ PageUtil pageUtil = new PageUtil();
+ pageUtil.setPageSize(200);
+ pageUtil.setAdvSearch(getCondition_RoleFunctions("0"));
+ functionsService.find(pageUtil);
+ List dataList = pageUtil.getPageList();
+
+ //开始拼接json数据
+ JSONObject outer = new JSONObject();
+ outer.put("id", 1);
+ outer.put("text", "功能列表");
+ outer.put("state", "open");
+ //存放数据json数组
+ JSONArray dataArray = new JSONArray();
+ if(null != dataList)
+ {
+ for(Functions functions:dataList)
+ {
+ JSONObject item = new JSONObject();
+ item.put("id", functions.getId());
+ item.put("text", functions.getName());
+
+ //勾选判断1
+ Boolean flag = false;
+ try
+ {
+ flag = userBusinessService.checkIsUserBusinessExist("Type",model.getUBType(),"KeyId",model.getUBKeyId(),"Value","["+functions.getId().toString()+"]");
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>设置角色对应的功能:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
+ }
+ if (flag==true){item.put("checked", true);}
+ //结束
+
+ pageUtil.setAdvSearch(getCondition_RoleFunctions(functions.getNumber()));
+ functionsService.find(pageUtil);
+ List dataList1 = pageUtil.getPageList();
+ JSONArray dataArray1 = new JSONArray();
+ if(null != dataList1)
+ {
+
+ for(Functions functions1:dataList1)
+ {
+ item.put("state", "open"); //如果不为空,节点不展开
+ JSONObject item1 = new JSONObject();
+ item1.put("id", functions1.getId());
+ item1.put("text", functions1.getName());
+
+ //勾选判断2
+ //Boolean flag = false;
+ try
+ {
+ flag = userBusinessService.checkIsUserBusinessExist("Type",model.getUBType(),"KeyId",model.getUBKeyId(),"Value","["+functions1.getId().toString()+"]");
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>设置角色对应的功能:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
+ }
+ if (flag==true){item1.put("checked", true);}
+ //结束
+
+ pageUtil.setAdvSearch(getCondition_RoleFunctions(functions1.getNumber()));
+ functionsService.find(pageUtil);
+ List dataList2 = pageUtil.getPageList();
+ JSONArray dataArray2 = new JSONArray();
+ if(null != dataList2)
+ {
+
+ for(Functions functions2:dataList2)
+ {
+ item1.put("state", "closed"); //如果不为空,节点不展开
+ JSONObject item2 = new JSONObject();
+ item2.put("id", functions2.getId());
+ item2.put("text", functions2.getName());
+
+ //勾选判断3
+ //Boolean flag = false;
+ try
+ {
+ flag = userBusinessService.checkIsUserBusinessExist("Type",model.getUBType(),"KeyId",model.getUBKeyId(),"Value","["+functions2.getId().toString()+"]");
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>设置角色对应的功能:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
+ }
+ if (flag==true){item2.put("checked", true);}
+ //结束
+
+ pageUtil.setAdvSearch(getCondition_RoleFunctions(functions2.getNumber()));
+ functionsService.find(pageUtil);
+ List dataList3 = pageUtil.getPageList();
+ JSONArray dataArray3 = new JSONArray();
+ if(null != dataList3)
+ {
+
+ for(Functions functions3:dataList3)
+ {
+ item2.put("state", "closed"); //如果不为空,节点不展开
+ JSONObject item3 = new JSONObject();
+ item3.put("id", functions3.getId());
+ item3.put("text", functions3.getName());
+
+ //勾选判断4
+ //Boolean flag = false;
+ try
+ {
+ flag = userBusinessService.checkIsUserBusinessExist("Type",model.getUBType(),"KeyId",model.getUBKeyId(),"Value","["+functions3.getId().toString()+"]");
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>设置角色对应的功能:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
+ }
+ if (flag==true){item3.put("checked", true);}
+ //结束
+
+ dataArray3.add(item3);
+ item2.put("children", dataArray3);
+ }
+ }
+
+ dataArray2.add(item2);
+ item1.put("children", dataArray2);
+ }
+ }
+
+ dataArray1.add(item1);
+ item.put("children", dataArray1);
+ }
+
+ }
+
+ dataArray.add(item);
+ }
+ outer.put("children", dataArray);
+ }
+ //回写查询结果
+ toClient("["+outer.toString()+"]");
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找应用异常", e);
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询应用结果异常", e);
+ }
+ }
+
+
+ /**
+ * 页面显示菜单
+ * @return
+ */
+ public void findMenu()
+ {
+ try
+ {
+ String fc=model.getHasFunctions(); //当前用户所拥有的功能列表,格式如:[1][2][5]
+ PageUtil pageUtil = new PageUtil();
+ pageUtil.setPageSize(200);
+ pageUtil.setAdvSearch(getCondition_RoleFunctions(model.getPNumber()));
+ functionsService.find(pageUtil);
+ List dataList = pageUtil.getPageList();
+
+ //存放数据json数组
+ JSONArray dataArray = new JSONArray();
+ if(null != dataList)
+ {
+ for(Functions functions:dataList)
+ {
+ JSONObject item = new JSONObject();
+ item.put("id", functions.getId());
+
+ pageUtil.setAdvSearch(getCondition_RoleFunctions(functions.getNumber()));
+ functionsService.find(pageUtil);
+ List dataList1 = pageUtil.getPageList();
+ JSONArray dataArray1 = new JSONArray();
+ if(dataList1.size()!=0)
+ {
+ item.put("text", functions.getName()); //是目录就没链接
+ for(Functions functions1:dataList1)
+ {
+ item.put("state", "open"); //如果不为空,节点展开
+ JSONObject item1 = new JSONObject();
+
+ pageUtil.setAdvSearch(getCondition_RoleFunctions(functions1.getNumber()));
+ functionsService.find(pageUtil);
+ List dataList2 = pageUtil.getPageList();
+ if(fc.indexOf("["+functions1.getId().toString()+"]")!=-1||dataList2.size()!=0)
+ {
+ item1.put("id", functions1.getId());
+ JSONArray dataArray2 = new JSONArray();
+ if(dataList2.size()!=0)
+ {
+ item1.put("text", functions1.getName());//是目录就没链接
+ for(Functions functions2:dataList2)
+ {
+ item1.put("state", "closed"); //如果不为空,节点不展开
+ JSONObject item2 = new JSONObject();
+
+ pageUtil.setAdvSearch(getCondition_RoleFunctions(functions2.getNumber()));
+ functionsService.find(pageUtil);
+ List dataList3 = pageUtil.getPageList();
+ if(fc.indexOf("["+functions2.getId().toString()+"]")!=-1||dataList3.size()!=0)
+ {
+ item2.put("id", functions2.getId());
+ JSONArray dataArray3 = new JSONArray();
+ if(dataList3.size()!=0)
+ {
+ item2.put("text", functions2.getName());//是目录就没链接
+ for(Functions functions3:dataList3)
+ {
+ item2.put("state", "closed"); //如果不为空,节点不展开
+ JSONObject item3 = new JSONObject();
+ item3.put("id", functions3.getId());
+ item3.put("text", functions3.getName());
+ //
+ dataArray3.add(item3);
+ item2.put("children", dataArray3);
+ }
+ }
+ else
+ {
+ //不是目录,有链接
+ item2.put("text", ""+functions2.getName()+"");
+ }
+
+ dataArray2.add(item2);
+ item1.put("children", dataArray2);
+ }
+ }
+ }
+ else
+ {
+ //不是目录,有链接
+ item1.put("text", ""+functions1.getName()+"");
+ }
+
+ dataArray1.add(item1);
+ item.put("children", dataArray1);
+ }
+ }
+ }
+ else
+ {
+ //不是目录,有链接
+ item.put("text", ""+functions.getName()+"");
+ }
+
+ dataArray.add(item);
+ }
+ }
+ //回写查询结果
+ toClient(dataArray.toString());
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找应用异常", e);
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询应用结果异常", e);
+ }
+ }
+
+ /**
+ * 拼接搜索条件
+ * @return
+ */
+ private Map getCondition()
+ {
+ /**
+ * 拼接搜索条件
+ */
+ Map condition = new HashMap();
+ condition.put("Name_s_like", model.getName());
+ condition.put("Type_s_eq", model.getType());
+ condition.put("Sort_s_order", "asc");
+ return condition;
+ }
+
+ /**
+ * 拼接搜索条件-角色对应功能
+ * @return
+ */
+ private Map getCondition_RoleFunctions(String num)
+ {
+ /**
+ * 拼接搜索条件
+ */
+ Map condition = new HashMap();
+ condition.put("Enabled_n_eq", 1);
+ condition.put("PNumber_s_eq", num);
+ condition.put("Sort_s_order", "asc");
+ return condition;
+ }
+
+ //=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
+ @Override
+ public FunctionsModel getModel()
+ {
+ return model;
+ }
+ public void setFunctionsService(FunctionsIService functionsService)
+ {
+ this.functionsService = functionsService;
+ }
+
+ public void setUserBusinessService(UserBusinessIService userBusinessService) {
+ this.userBusinessService = userBusinessService;
+ }
+
+}
diff --git a/src/com/jsh/action/basic/RoleAction.java b/src/com/jsh/action/basic/RoleAction.java
index eb703031..18067b7f 100644
--- a/src/com/jsh/action/basic/RoleAction.java
+++ b/src/com/jsh/action/basic/RoleAction.java
@@ -1,347 +1,347 @@
-package com.jsh.action.basic;
-
-import java.io.IOException;
-import java.sql.Timestamp;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import net.sf.json.JSONArray;
-import net.sf.json.JSONObject;
-
-import org.springframework.dao.DataAccessException;
-
-import com.jsh.base.BaseAction;
-import com.jsh.base.Log;
-import com.jsh.exception.AmsException;
-import com.jsh.model.po.App;
-import com.jsh.model.po.Role;
-import com.jsh.model.po.Logdetails;
-import com.jsh.model.vo.basic.RoleModel;
-import com.jsh.service.basic.RoleIService;
-import com.jsh.service.basic.UserBusinessIService;
-import com.jsh.util.common.PageUtil;
-
-@SuppressWarnings("serial")
-public class RoleAction extends BaseAction
-{
- private RoleIService roleService;
- private UserBusinessIService userBusinessService;
- private RoleModel model = new RoleModel();
- /**
- * 增加角色
- * @return
- */
- public void create()
- {
- Log.infoFileSync("==================开始调用增加角色信息方法create()===================");
- Boolean flag = false;
- try
- {
- Role role = new Role();
- role.setName(model.getName());
- roleService.create(role);
-
- //========标识位===========
- flag = true;
- //记录操作日志使用
- tipMsg = "成功";
- tipType = 0;
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加角色信息异常", e);
- flag = false;
- tipMsg = "失败";
- tipType = 1;
- }
- finally
- {
- try
- {
- toClient(flag.toString());
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>增加角色信息回写客户端结果异常", e);
- }
- }
-
- logService.create(new Logdetails(getUser(), "增加角色", model.getClientIp(),
- new Timestamp(System.currentTimeMillis())
- , tipType, "增加角色名称为 "+ model.getName() + " " + tipMsg + "!", "增加角色" + tipMsg));
- Log.infoFileSync("==================结束调用增加角色方法create()===================");
- }
-
- /**
- * 删除角色
- * @return
- */
- public String delete()
- {
- Log.infoFileSync("====================开始调用删除角色信息方法delete()================");
- try
- {
- roleService.delete(model.getRoleID());
- tipMsg = "成功";
- tipType = 0;
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getRoleID() + " 的角色异常", e);
- tipMsg = "失败";
- tipType = 1;
- }
- model.getShowModel().setMsgTip(tipMsg);
- logService.create(new Logdetails(getUser(), "删除角色", model.getClientIp(),
- new Timestamp(System.currentTimeMillis())
- , tipType, "删除角色ID为 "+ model.getRoleID() + " " + tipMsg + "!", "删除角色" + tipMsg));
- Log.infoFileSync("====================结束调用删除角色信息方法delete()================");
- return SUCCESS;
- }
-
- /**
- * 更新角色
- * @return
- */
- public void update()
- {
- Boolean flag = false;
- try
- {
- Role role = roleService.get(model.getRoleID());
- role.setName(model.getName());
- roleService.update(role);
-
- flag = true;
- tipMsg = "成功";
- tipType = 0;
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>修改角色ID为 : " + model.getRoleID() + "信息失败", e);
- flag = false;
- tipMsg = "失败";
- tipType = 1;
- }
- finally
- {
- try
- {
- toClient(flag.toString());
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>修改角色回写客户端结果异常", e);
- }
- }
- logService.create(new Logdetails(getUser(), "更新角色", model.getClientIp(),
- new Timestamp(System.currentTimeMillis())
- , tipType, "更新角色ID为 "+ model.getRoleID() + " " + tipMsg + "!", "更新角色" + tipMsg));
- }
-
- /**
- * 批量删除指定ID角色
- * @return
- */
- public String batchDelete()
- {
- try
- {
- roleService.batchDelete(model.getRoleIDs());
- model.getShowModel().setMsgTip("成功");
- //记录操作日志使用
- tipMsg = "成功";
- tipType = 0;
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>批量删除角色ID为:" + model.getRoleIDs() + "信息异常", e);
- tipMsg = "失败";
- tipType = 1;
- }
-
- logService.create(new Logdetails(getUser(), "批量删除角色", model.getClientIp(),
- new Timestamp(System.currentTimeMillis())
- , tipType, "批量删除角色ID为 "+ model.getRoleIDs() + " " + tipMsg + "!", "批量删除角色" + tipMsg));
- return SUCCESS;
- }
-
- /**
- * 检查输入名称是否存在
- */
- public void checkIsNameExist()
- {
- Boolean flag = false;
- try
- {
- flag = roleService.checkIsNameExist("name",model.getName(),"Id", model.getRoleID());
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>检查角色名称为:" + model.getName() + " ID为: " + model.getRoleID() + " 是否存在异常!");
- }
- finally
- {
- try
- {
- toClient(flag.toString());
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>回写检查角色名称为:" + model.getName() + " ID为: " + model.getRoleID() + " 是否存在异常!",e);
- }
- }
- }
-
- /**
- * 查找角色信息
- * @return
- */
- public void findBy()
- {
- try
- {
- PageUtil pageUtil = new PageUtil();
- pageUtil.setPageSize(model.getPageSize());
- pageUtil.setCurPage(model.getPageNo());
- pageUtil.setAdvSearch(getCondition());
- roleService.find(pageUtil);
- List dataList = pageUtil.getPageList();
-
- //开始拼接json数据
-// {"total":28,"rows":[
-// {"productid":"AV-CB-01","attr1":"Adult Male","itemid":"EST-18"}
-// ]}
- JSONObject outer = new JSONObject();
- outer.put("total", pageUtil.getTotalCount());
- //存放数据json数组
- JSONArray dataArray = new JSONArray();
- if(null != dataList)
- {
- for(Role role:dataList)
- {
- JSONObject item = new JSONObject();
- item.put("Id", role.getId());
- //供应商名称
- item.put("Name", role.getName());
- item.put("op", 1);
- dataArray.add(item);
- }
- }
- outer.put("rows", dataArray);
- //回写查询结果
- toClient(outer.toString());
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找角色信息异常", e);
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询角色信息结果异常", e);
- }
- }
-
- /**
- * 用户对应角色显示
- * @return
- */
- public void findUserRole()
- {
- try
- {
- PageUtil pageUtil = new PageUtil();
- pageUtil.setPageSize(100);
- //pageUtil.setCurPage(model.getPageNo());
-
- pageUtil.setAdvSearch(getCondition_UserRole());
- roleService.find(pageUtil);
- List dataList = pageUtil.getPageList();
-
- //开始拼接json数据
- JSONObject outer = new JSONObject();
- outer.put("id", 1);
- outer.put("text", "角色列表");
- outer.put("state", "open");
- //存放数据json数组
- JSONArray dataArray = new JSONArray();
- if(null != dataList)
- {
- for(Role role:dataList)
- {
- JSONObject item = new JSONObject();
- item.put("id", role.getId());
- item.put("text", role.getName());
- //勾选判断1
- Boolean flag = false;
- try
- {
- flag = userBusinessService.checkIsUserBusinessExist("Type",model.getUBType(),"KeyId",model.getUBKeyId(),"Value","["+role.getId().toString()+"]");
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>设置用户对应的角色:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
- }
- if (flag==true){item.put("checked", true);}
- //结束
- dataArray.add(item);
- }
- }
- outer.put("children", dataArray);
- //回写查询结果
- toClient("["+outer.toString()+"]");
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找角色异常", e);
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询角色结果异常", e);
- }
- }
-
- /**
- * 拼接搜索条件
- * @return
- */
- private Map getCondition()
- {
- /**
- * 拼接搜索条件
- */
- Map condition = new HashMap();
- condition.put("Name_s_like", model.getName());
- condition.put("Id_s_order", "asc");
- return condition;
- }
-
- /**
- * 拼接搜索条件-用户对应角色
- * @return
- */
- private Map getCondition_UserRole()
- {
- /**
- * 拼接搜索条件
- */
- Map condition = new HashMap();
- condition.put("Id_s_order", "asc");
- return condition;
- }
-
- //=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
- @Override
- public RoleModel getModel()
- {
- return model;
- }
- public void setRoleService(RoleIService roleService)
- {
- this.roleService = roleService;
- }
- public void setUserBusinessService(UserBusinessIService userBusinessService) {
- this.userBusinessService = userBusinessService;
- }
-}
+package com.jsh.action.basic;
+
+import java.io.IOException;
+import java.sql.Timestamp;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import net.sf.json.JSONArray;
+import net.sf.json.JSONObject;
+
+import org.springframework.dao.DataAccessException;
+
+import com.jsh.base.BaseAction;
+import com.jsh.base.Log;
+import com.jsh.exception.JshException;
+import com.jsh.model.po.App;
+import com.jsh.model.po.Role;
+import com.jsh.model.po.Logdetails;
+import com.jsh.model.vo.basic.RoleModel;
+import com.jsh.service.basic.RoleIService;
+import com.jsh.service.basic.UserBusinessIService;
+import com.jsh.util.common.PageUtil;
+
+@SuppressWarnings("serial")
+public class RoleAction extends BaseAction
+{
+ private RoleIService roleService;
+ private UserBusinessIService userBusinessService;
+ private RoleModel model = new RoleModel();
+ /**
+ * 增加角色
+ * @return
+ */
+ public void create()
+ {
+ Log.infoFileSync("==================开始调用增加角色信息方法create()===================");
+ Boolean flag = false;
+ try
+ {
+ Role role = new Role();
+ role.setName(model.getName());
+ roleService.create(role);
+
+ //========标识位===========
+ flag = true;
+ //记录操作日志使用
+ tipMsg = "成功";
+ tipType = 0;
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加角色信息异常", e);
+ flag = false;
+ tipMsg = "失败";
+ tipType = 1;
+ }
+ finally
+ {
+ try
+ {
+ toClient(flag.toString());
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>增加角色信息回写客户端结果异常", e);
+ }
+ }
+
+ logService.create(new Logdetails(getUser(), "增加角色", model.getClientIp(),
+ new Timestamp(System.currentTimeMillis())
+ , tipType, "增加角色名称为 "+ model.getName() + " " + tipMsg + "!", "增加角色" + tipMsg));
+ Log.infoFileSync("==================结束调用增加角色方法create()===================");
+ }
+
+ /**
+ * 删除角色
+ * @return
+ */
+ public String delete()
+ {
+ Log.infoFileSync("====================开始调用删除角色信息方法delete()================");
+ try
+ {
+ roleService.delete(model.getRoleID());
+ tipMsg = "成功";
+ tipType = 0;
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getRoleID() + " 的角色异常", e);
+ tipMsg = "失败";
+ tipType = 1;
+ }
+ model.getShowModel().setMsgTip(tipMsg);
+ logService.create(new Logdetails(getUser(), "删除角色", model.getClientIp(),
+ new Timestamp(System.currentTimeMillis())
+ , tipType, "删除角色ID为 "+ model.getRoleID() + " " + tipMsg + "!", "删除角色" + tipMsg));
+ Log.infoFileSync("====================结束调用删除角色信息方法delete()================");
+ return SUCCESS;
+ }
+
+ /**
+ * 更新角色
+ * @return
+ */
+ public void update()
+ {
+ Boolean flag = false;
+ try
+ {
+ Role role = roleService.get(model.getRoleID());
+ role.setName(model.getName());
+ roleService.update(role);
+
+ flag = true;
+ tipMsg = "成功";
+ tipType = 0;
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>修改角色ID为 : " + model.getRoleID() + "信息失败", e);
+ flag = false;
+ tipMsg = "失败";
+ tipType = 1;
+ }
+ finally
+ {
+ try
+ {
+ toClient(flag.toString());
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>修改角色回写客户端结果异常", e);
+ }
+ }
+ logService.create(new Logdetails(getUser(), "更新角色", model.getClientIp(),
+ new Timestamp(System.currentTimeMillis())
+ , tipType, "更新角色ID为 "+ model.getRoleID() + " " + tipMsg + "!", "更新角色" + tipMsg));
+ }
+
+ /**
+ * 批量删除指定ID角色
+ * @return
+ */
+ public String batchDelete()
+ {
+ try
+ {
+ roleService.batchDelete(model.getRoleIDs());
+ model.getShowModel().setMsgTip("成功");
+ //记录操作日志使用
+ tipMsg = "成功";
+ tipType = 0;
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>批量删除角色ID为:" + model.getRoleIDs() + "信息异常", e);
+ tipMsg = "失败";
+ tipType = 1;
+ }
+
+ logService.create(new Logdetails(getUser(), "批量删除角色", model.getClientIp(),
+ new Timestamp(System.currentTimeMillis())
+ , tipType, "批量删除角色ID为 "+ model.getRoleIDs() + " " + tipMsg + "!", "批量删除角色" + tipMsg));
+ return SUCCESS;
+ }
+
+ /**
+ * 检查输入名称是否存在
+ */
+ public void checkIsNameExist()
+ {
+ Boolean flag = false;
+ try
+ {
+ flag = roleService.checkIsNameExist("name",model.getName(),"Id", model.getRoleID());
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>检查角色名称为:" + model.getName() + " ID为: " + model.getRoleID() + " 是否存在异常!");
+ }
+ finally
+ {
+ try
+ {
+ toClient(flag.toString());
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>回写检查角色名称为:" + model.getName() + " ID为: " + model.getRoleID() + " 是否存在异常!",e);
+ }
+ }
+ }
+
+ /**
+ * 查找角色信息
+ * @return
+ */
+ public void findBy()
+ {
+ try
+ {
+ PageUtil pageUtil = new PageUtil();
+ pageUtil.setPageSize(model.getPageSize());
+ pageUtil.setCurPage(model.getPageNo());
+ pageUtil.setAdvSearch(getCondition());
+ roleService.find(pageUtil);
+ List dataList = pageUtil.getPageList();
+
+ //开始拼接json数据
+// {"total":28,"rows":[
+// {"productid":"AV-CB-01","attr1":"Adult Male","itemid":"EST-18"}
+// ]}
+ JSONObject outer = new JSONObject();
+ outer.put("total", pageUtil.getTotalCount());
+ //存放数据json数组
+ JSONArray dataArray = new JSONArray();
+ if(null != dataList)
+ {
+ for(Role role:dataList)
+ {
+ JSONObject item = new JSONObject();
+ item.put("Id", role.getId());
+ //供应商名称
+ item.put("Name", role.getName());
+ item.put("op", 1);
+ dataArray.add(item);
+ }
+ }
+ outer.put("rows", dataArray);
+ //回写查询结果
+ toClient(outer.toString());
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找角色信息异常", e);
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询角色信息结果异常", e);
+ }
+ }
+
+ /**
+ * 用户对应角色显示
+ * @return
+ */
+ public void findUserRole()
+ {
+ try
+ {
+ PageUtil pageUtil = new PageUtil();
+ pageUtil.setPageSize(100);
+ //pageUtil.setCurPage(model.getPageNo());
+
+ pageUtil.setAdvSearch(getCondition_UserRole());
+ roleService.find(pageUtil);
+ List dataList = pageUtil.getPageList();
+
+ //开始拼接json数据
+ JSONObject outer = new JSONObject();
+ outer.put("id", 1);
+ outer.put("text", "角色列表");
+ outer.put("state", "open");
+ //存放数据json数组
+ JSONArray dataArray = new JSONArray();
+ if(null != dataList)
+ {
+ for(Role role:dataList)
+ {
+ JSONObject item = new JSONObject();
+ item.put("id", role.getId());
+ item.put("text", role.getName());
+ //勾选判断1
+ Boolean flag = false;
+ try
+ {
+ flag = userBusinessService.checkIsUserBusinessExist("Type",model.getUBType(),"KeyId",model.getUBKeyId(),"Value","["+role.getId().toString()+"]");
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>设置用户对应的角色:类型" + model.getUBType() + " KeyId为: " + model.getUBKeyId() + " 存在异常!");
+ }
+ if (flag==true){item.put("checked", true);}
+ //结束
+ dataArray.add(item);
+ }
+ }
+ outer.put("children", dataArray);
+ //回写查询结果
+ toClient("["+outer.toString()+"]");
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找角色异常", e);
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询角色结果异常", e);
+ }
+ }
+
+ /**
+ * 拼接搜索条件
+ * @return
+ */
+ private Map getCondition()
+ {
+ /**
+ * 拼接搜索条件
+ */
+ Map condition = new HashMap();
+ condition.put("Name_s_like", model.getName());
+ condition.put("Id_s_order", "asc");
+ return condition;
+ }
+
+ /**
+ * 拼接搜索条件-用户对应角色
+ * @return
+ */
+ private Map getCondition_UserRole()
+ {
+ /**
+ * 拼接搜索条件
+ */
+ Map condition = new HashMap();
+ condition.put("Id_s_order", "asc");
+ return condition;
+ }
+
+ //=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
+ @Override
+ public RoleModel getModel()
+ {
+ return model;
+ }
+ public void setRoleService(RoleIService roleService)
+ {
+ this.roleService = roleService;
+ }
+ public void setUserBusinessService(UserBusinessIService userBusinessService) {
+ this.userBusinessService = userBusinessService;
+ }
+}
diff --git a/src/com/jsh/action/basic/UserAction.java b/src/com/jsh/action/basic/UserAction.java
index f4332da7..813fc23b 100644
--- a/src/com/jsh/action/basic/UserAction.java
+++ b/src/com/jsh/action/basic/UserAction.java
@@ -41,6 +41,7 @@ public class UserAction extends BaseAction
try
{
password = Tools.md5Encryp(password);
+ System.out.println(password);
}
catch (NoSuchAlgorithmException e)
{
@@ -136,7 +137,7 @@ public class UserAction extends BaseAction
user.setIsystem((short)1);
user.setIsmanager((short)1);
user.setLoginame(model.getLoginame());
- String password ="00000000";
+ String password ="123456";
//因密码用MD5加密,需要对密码进行转化
try
{
diff --git a/src/com/jsh/action/materials/BuildingAction.java b/src/com/jsh/action/materials/BuildingAction.java
index 8dce4739..a6b8e06c 100644
--- a/src/com/jsh/action/materials/BuildingAction.java
+++ b/src/com/jsh/action/materials/BuildingAction.java
@@ -1,277 +1,277 @@
-package com.jsh.action.materials;
-
-import java.io.IOException;
-import java.sql.Timestamp;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import net.sf.json.JSONArray;
-import net.sf.json.JSONObject;
-
-import org.springframework.dao.DataAccessException;
-
-import com.jsh.base.BaseAction;
-import com.jsh.base.Log;
-import com.jsh.model.po.Depot;
-import com.jsh.model.po.Building;
-import com.jsh.model.po.Logdetails;
-import com.jsh.model.vo.materials.BuildingModel;
-import com.jsh.service.materials.BuildingIService;
-import com.jsh.util.common.PageUtil;
-
-@SuppressWarnings("serial")
-public class BuildingAction extends BaseAction
-{
- private BuildingIService buildingService;
- private BuildingModel model = new BuildingModel();
-
-
- @SuppressWarnings({ "rawtypes", "unchecked" })
- public String getBasicData()
- {
- Map mapData = model.getShowModel().getMap();
- PageUtil pageUtil = new PageUtil();
- pageUtil.setPageSize(0);
- pageUtil.setCurPage(0);
- try
- {
- Map condition = pageUtil.getAdvSearch();
- condition.put("ProjectId_n_eq", model.getProjectId());
- condition.put("Id_s_order", "asc");
- buildingService.find(pageUtil);
- mapData.put("buildingList", pageUtil.getPageList());
- }
- catch (Exception e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>查找系统基础数据信息异常", e);
- model.getShowModel().setMsgTip("exceptoin");
- }
- return SUCCESS;
- }
- /**
- * 增加单元
- * @return
- */
- public void create()
- {
- Log.infoFileSync("==================开始调用增加单元信息方法create()===================");
- Boolean flag = false;
- try
- {
- Building building = new Building();
- building.setDepot(new Depot(model.getProjectId()));
-
- building.setName(model.getName());
- building.setRemark(model.getRemark());
- building.setEnabled(model.getEnabled());
- buildingService.create(building);
-
- //========标识位===========
- flag = true;
- //记录操作日志使用
- tipMsg = "成功";
- tipType = 0;
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加单元信息异常", e);
- flag = false;
- tipMsg = "失败";
- tipType = 1;
- }
- finally
- {
- try
- {
- toClient(flag.toString());
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>增加单元信息回写客户端结果异常", e);
- }
- }
-
- logService.create(new Logdetails(getUser(), "增加单元", model.getClientIp(),
- new Timestamp(System.currentTimeMillis())
- , tipType, "增加单元名称为 "+ model.getName() + " " + tipMsg + "!", "增加单元" + tipMsg));
- Log.infoFileSync("==================结束调用增加单元方法create()===================");
- }
-
- /**
- * 删除单元
- * @return
- */
- public String delete()
- {
- Log.infoFileSync("====================开始调用删除单元信息方法delete()================");
- try
- {
- buildingService.delete(model.getBuildingID());
- tipMsg = "成功";
- tipType = 0;
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getBuildingID() + " 的单元异常", e);
- tipMsg = "失败";
- tipType = 1;
- }
- model.getShowModel().setMsgTip(tipMsg);
- logService.create(new Logdetails(getUser(), "删除单元", model.getClientIp(),
- new Timestamp(System.currentTimeMillis())
- , tipType, "删除单元ID为 "+ model.getBuildingID() + " " + tipMsg + "!", "删除单元" + tipMsg));
- Log.infoFileSync("====================结束调用删除单元信息方法delete()================");
- return SUCCESS;
- }
-
- /**
- * 更新单元
- * @return
- */
- public void update()
- {
- Boolean flag = false;
- try
- {
- Building building = buildingService.get(model.getBuildingID());
- building.setDepot(new Depot(model.getProjectId()));
-
- building.setName(model.getName());
- building.setRemark(model.getRemark());
- building.setEnabled(model.getEnabled());
- buildingService.update(building);
-
- flag = true;
- tipMsg = "成功";
- tipType = 0;
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>修改单元ID为 : " + model.getBuildingID() + "信息失败", e);
- flag = false;
- tipMsg = "失败";
- tipType = 1;
- }
- finally
- {
- try
- {
- toClient(flag.toString());
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>修改单元回写客户端结果异常", e);
- }
- }
- logService.create(new Logdetails(getUser(), "更新单元", model.getClientIp(),
- new Timestamp(System.currentTimeMillis())
- , tipType, "更新单元ID为 "+ model.getBuildingID() + " " + tipMsg + "!", "更新单元" + tipMsg));
- }
-
- /**
- * 批量删除指定ID单元
- * @return
- */
- public String batchDelete()
- {
- try
- {
- buildingService.batchDelete(model.getBuildingIDs());
- model.getShowModel().setMsgTip("成功");
- //记录操作日志使用
- tipMsg = "成功";
- tipType = 0;
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>批量删除单元ID为:" + model.getBuildingIDs() + "信息异常", e);
- tipMsg = "失败";
- tipType = 1;
- }
-
- logService.create(new Logdetails(getUser(), "批量删除单元", model.getClientIp(),
- new Timestamp(System.currentTimeMillis())
- , tipType, "批量删除单元ID为 "+ model.getBuildingIDs() + " " + tipMsg + "!", "批量删除单元" + tipMsg));
- return SUCCESS;
- }
-
- /**
- * 查找单元信息
- * @return
- */
- public void findBy()
- {
- try
- {
- PageUtil pageUtil = new PageUtil();
- pageUtil.setPageSize(model.getPageSize());
- pageUtil.setCurPage(model.getPageNo());
- pageUtil.setAdvSearch(getCondition());
- buildingService.find(pageUtil);
- List dataList = pageUtil.getPageList();
-
- //开始拼接json数据
-// {"total":28,"rows":[
-// {"productid":"AV-CB-01","attr1":"Adult Male","itemid":"EST-18"}
-// ]}
- JSONObject outer = new JSONObject();
- outer.put("total", pageUtil.getTotalCount());
- //存放数据json数组
- JSONArray dataArray = new JSONArray();
- if(null != dataList)
- {
- for(Building building:dataList)
- {
- JSONObject item = new JSONObject();
- item.put("Id", building.getId());
- item.put("ProjectId", building.getDepot().getId());
- item.put("ProjectName", building.getDepot().getName());
- item.put("Name", building.getName());
- item.put("Remark", building.getRemark());
- item.put("Enabled", building.getEnabled());
- item.put("op", 1);
- dataArray.add(item);
- }
- }
- outer.put("rows", dataArray);
- //回写查询结果
- toClient(outer.toString());
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找单元信息异常", e);
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询单元信息结果异常", e);
- }
- }
-
- /**
- * 拼接搜索条件
- * @return
- */
- private Map getCondition()
- {
- /**
- * 拼接搜索条件
- */
- Map condition = new HashMap();
- condition.put("ProjectId_n_eq", model.getProjectId());
- condition.put("Name_s_like", model.getName());
- condition.put("Id_s_order", "asc");
- return condition;
- }
-
- //=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
- @Override
- public BuildingModel getModel()
- {
- return model;
- }
- public void setBuildingService(BuildingIService buildingService)
- {
- this.buildingService = buildingService;
- }
-}
+package com.jsh.action.materials;
+
+import java.io.IOException;
+import java.sql.Timestamp;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import net.sf.json.JSONArray;
+import net.sf.json.JSONObject;
+
+import org.springframework.dao.DataAccessException;
+
+import com.jsh.base.BaseAction;
+import com.jsh.base.Log;
+import com.jsh.model.po.Depot;
+import com.jsh.model.po.Building;
+import com.jsh.model.po.Logdetails;
+import com.jsh.model.vo.materials.BuildingModel;
+import com.jsh.service.materials.BuildingIService;
+import com.jsh.util.common.PageUtil;
+
+@SuppressWarnings("serial")
+public class BuildingAction extends BaseAction
+{
+ private BuildingIService buildingService;
+ private BuildingModel model = new BuildingModel();
+
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public String getBasicData()
+ {
+ Map mapData = model.getShowModel().getMap();
+ PageUtil pageUtil = new PageUtil();
+ pageUtil.setPageSize(0);
+ pageUtil.setCurPage(0);
+ try
+ {
+ Map condition = pageUtil.getAdvSearch();
+ condition.put("ProjectId_n_eq", model.getProjectId());
+ condition.put("Id_s_order", "asc");
+ buildingService.find(pageUtil);
+ mapData.put("buildingList", pageUtil.getPageList());
+ }
+ catch (Exception e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>查找系统基础数据信息异常", e);
+ model.getShowModel().setMsgTip("exceptoin");
+ }
+ return SUCCESS;
+ }
+ /**
+ * 增加单元
+ * @return
+ */
+ public void create()
+ {
+ Log.infoFileSync("==================开始调用增加单元信息方法create()===================");
+ Boolean flag = false;
+ try
+ {
+ Building building = new Building();
+ building.setDepot(new Depot(model.getProjectId()));
+
+ building.setName(model.getName());
+ building.setRemark(model.getRemark());
+ building.setEnabled(model.getEnabled());
+ buildingService.create(building);
+
+ //========标识位===========
+ flag = true;
+ //记录操作日志使用
+ tipMsg = "成功";
+ tipType = 0;
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>增加单元信息异常", e);
+ flag = false;
+ tipMsg = "失败";
+ tipType = 1;
+ }
+ finally
+ {
+ try
+ {
+ toClient(flag.toString());
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>增加单元信息回写客户端结果异常", e);
+ }
+ }
+
+ logService.create(new Logdetails(getUser(), "增加单元", model.getClientIp(),
+ new Timestamp(System.currentTimeMillis())
+ , tipType, "增加单元名称为 "+ model.getName() + " " + tipMsg + "!", "增加单元" + tipMsg));
+ Log.infoFileSync("==================结束调用增加单元方法create()===================");
+ }
+
+ /**
+ * 删除单元
+ * @return
+ */
+ public String delete()
+ {
+ Log.infoFileSync("====================开始调用删除单元信息方法delete()================");
+ try
+ {
+ buildingService.delete(model.getBuildingID());
+ tipMsg = "成功";
+ tipType = 0;
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>删除ID为 " + model.getBuildingID() + " 的单元异常", e);
+ tipMsg = "失败";
+ tipType = 1;
+ }
+ model.getShowModel().setMsgTip(tipMsg);
+ logService.create(new Logdetails(getUser(), "删除单元", model.getClientIp(),
+ new Timestamp(System.currentTimeMillis())
+ , tipType, "删除单元ID为 "+ model.getBuildingID() + " " + tipMsg + "!", "删除单元" + tipMsg));
+ Log.infoFileSync("====================结束调用删除单元信息方法delete()================");
+ return SUCCESS;
+ }
+
+ /**
+ * 更新单元
+ * @return
+ */
+ public void update()
+ {
+ Boolean flag = false;
+ try
+ {
+ Building building = buildingService.get(model.getBuildingID());
+ building.setDepot(new Depot(model.getProjectId()));
+
+ building.setName(model.getName());
+ building.setRemark(model.getRemark());
+ building.setEnabled(model.getEnabled());
+ buildingService.update(building);
+
+ flag = true;
+ tipMsg = "成功";
+ tipType = 0;
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>修改单元ID为 : " + model.getBuildingID() + "信息失败", e);
+ flag = false;
+ tipMsg = "失败";
+ tipType = 1;
+ }
+ finally
+ {
+ try
+ {
+ toClient(flag.toString());
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>修改单元回写客户端结果异常", e);
+ }
+ }
+ logService.create(new Logdetails(getUser(), "更新单元", model.getClientIp(),
+ new Timestamp(System.currentTimeMillis())
+ , tipType, "更新单元ID为 "+ model.getBuildingID() + " " + tipMsg + "!", "更新单元" + tipMsg));
+ }
+
+ /**
+ * 批量删除指定ID单元
+ * @return
+ */
+ public String batchDelete()
+ {
+ try
+ {
+ buildingService.batchDelete(model.getBuildingIDs());
+ model.getShowModel().setMsgTip("成功");
+ //记录操作日志使用
+ tipMsg = "成功";
+ tipType = 0;
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>批量删除单元ID为:" + model.getBuildingIDs() + "信息异常", e);
+ tipMsg = "失败";
+ tipType = 1;
+ }
+
+ logService.create(new Logdetails(getUser(), "批量删除单元", model.getClientIp(),
+ new Timestamp(System.currentTimeMillis())
+ , tipType, "批量删除单元ID为 "+ model.getBuildingIDs() + " " + tipMsg + "!", "批量删除单元" + tipMsg));
+ return SUCCESS;
+ }
+
+ /**
+ * 查找单元信息
+ * @return
+ */
+ public void findBy()
+ {
+ try
+ {
+ PageUtil pageUtil = new PageUtil();
+ pageUtil.setPageSize(model.getPageSize());
+ pageUtil.setCurPage(model.getPageNo());
+ pageUtil.setAdvSearch(getCondition());
+ buildingService.find(pageUtil);
+ List dataList = pageUtil.getPageList();
+
+ //开始拼接json数据
+// {"total":28,"rows":[
+// {"productid":"AV-CB-01","attr1":"Adult Male","itemid":"EST-18"}
+// ]}
+ JSONObject outer = new JSONObject();
+ outer.put("total", pageUtil.getTotalCount());
+ //存放数据json数组
+ JSONArray dataArray = new JSONArray();
+ if(null != dataList)
+ {
+ for(Building building:dataList)
+ {
+ JSONObject item = new JSONObject();
+ item.put("Id", building.getId());
+ item.put("ProjectId", building.getDepot().getId());
+ item.put("ProjectName", building.getDepot().getName());
+ item.put("Name", building.getName());
+ item.put("Remark", building.getRemark());
+ item.put("Enabled", building.getEnabled());
+ item.put("op", 1);
+ dataArray.add(item);
+ }
+ }
+ outer.put("rows", dataArray);
+ //回写查询结果
+ toClient(outer.toString());
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找单元信息异常", e);
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询单元信息结果异常", e);
+ }
+ }
+
+ /**
+ * 拼接搜索条件
+ * @return
+ */
+ private Map getCondition()
+ {
+ /**
+ * 拼接搜索条件
+ */
+ Map condition = new HashMap();
+ condition.put("ProjectId_n_eq", model.getProjectId());
+ condition.put("Name_s_like", model.getName());
+ condition.put("Id_s_order", "asc");
+ return condition;
+ }
+
+ //=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
+ @Override
+ public BuildingModel getModel()
+ {
+ return model;
+ }
+ public void setBuildingService(BuildingIService buildingService)
+ {
+ this.buildingService = buildingService;
+ }
+}
diff --git a/src/com/jsh/action/materials/DepotItemAction.java b/src/com/jsh/action/materials/DepotItemAction.java
index 944edcb6..ada1ba3b 100644
--- a/src/com/jsh/action/materials/DepotItemAction.java
+++ b/src/com/jsh/action/materials/DepotItemAction.java
@@ -1,395 +1,395 @@
-package com.jsh.action.materials;
-
-import java.io.File;
-import java.io.IOException;
-import java.sql.Timestamp;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletResponse;
-
-import net.sf.json.JSONArray;
-import net.sf.json.JSONObject;
-
-import org.springframework.dao.DataAccessException;
-
-import com.jsh.base.BaseAction;
-import com.jsh.base.Log;
-import com.jsh.constants.asset.AssetConstants;
-import com.jsh.exception.AmsException;
-import com.jsh.model.po.Asset;
-import com.jsh.model.po.DepotHead;
-import com.jsh.model.po.DepotItem;
-import com.jsh.model.po.Logdetails;
-import com.jsh.model.po.Material;
-import com.jsh.model.vo.materials.DepotItemModel;
-import com.jsh.service.materials.DepotHeadIService;
-import com.jsh.service.materials.DepotItemIService;
-import com.jsh.util.common.PageUtil;
-import com.jsh.util.common.Tools;
-
-@SuppressWarnings("serial")
-public class DepotItemAction extends BaseAction
-{
- private DepotItemIService depotItemService;
- private DepotItemModel model = new DepotItemModel();
- /**
- * action返回excel结果
- */
- public static final String EXCEL = "excel";
-
- /**
- * 保存明细
- * @return
- */
- public void saveDetials()
- {
- Log.infoFileSync("==================开始调用保存仓管通明细信息方法saveDetials()===================");
- Boolean flag = false;
- try
- {
- Long headerId=model.getHeaderId();
- String inserted=model.getInserted();
- String deleted=model.getDeleted();
- String updated=model.getUpdated();
- //转为json
- JSONArray insertedJson = JSONArray.fromObject(inserted);
- JSONArray deletedJson = JSONArray.fromObject(deleted);
- JSONArray updatedJson = JSONArray.fromObject(updated);
- if(null != insertedJson)
- {
- for(int i = 0;i < insertedJson.size(); i++)
- {
- DepotItem depotItem = new DepotItem();
- JSONObject tempInsertedJson = JSONObject.fromObject(insertedJson.get(i));
- depotItem.setHeaderId(new DepotHead(headerId));
- depotItem.setMaterialId(new Material(tempInsertedJson.getLong("MaterialId")));
- depotItem.setOperNumber(tempInsertedJson.getDouble("OperNumber"));
- if(tempInsertedJson.get("UnitPrice")!=null){depotItem.setUnitPrice(tempInsertedJson.getDouble("UnitPrice"));}
- if(tempInsertedJson.get("Incidentals")!=null){depotItem.setIncidentals(0.0);}
- depotItem.setRemark(tempInsertedJson.getString("Remark"));
- depotItem.setImg(tempInsertedJson.getString("Img"));
- depotItemService.create(depotItem);
- }
- }
- if(null != deletedJson)
- {
- for(int i = 0;i < deletedJson.size(); i++)
- {
- JSONObject tempDeletedJson = JSONObject.fromObject(deletedJson.get(i));
- depotItemService.delete(tempDeletedJson.getLong("Id"));
- }
- }
- if(null != updatedJson)
- {
- for(int i = 0;i < updatedJson.size(); i++)
- {
- JSONObject tempUpdatedJson = JSONObject.fromObject(updatedJson.get(i));
- DepotItem depotItem = depotItemService.get(tempUpdatedJson.getLong("Id"));
- depotItem.setMaterialId(new Material(tempUpdatedJson.getLong("MaterialId")));
- depotItem.setOperNumber(tempUpdatedJson.getDouble("OperNumber"));
- if(tempUpdatedJson.get("UnitPrice")!=null){depotItem.setUnitPrice(tempUpdatedJson.getDouble("UnitPrice"));}
- if(tempUpdatedJson.get("Incidentals")!=null){depotItem.setIncidentals(0.0);}
- depotItem.setRemark(tempUpdatedJson.getString("Remark"));
- depotItem.setImg(tempUpdatedJson.getString("Img"));
- depotItemService.create(depotItem);
- }
- }
-
- //========标识位===========
- flag = true;
- //记录操作日志使用
- tipMsg = "成功";
- tipType = 0;
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>保存仓管通明细信息异常", e);
- flag = false;
- tipMsg = "失败";
- tipType = 1;
- }
- finally
- {
- try
- {
- toClient(flag.toString());
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>保存仓管通明细信息回写客户端结果异常", e);
- }
- }
-
- logService.create(new Logdetails(getUser(), "保存仓管通明细", model.getClientIp(),
- new Timestamp(System.currentTimeMillis())
- , tipType, "保存仓管通明细对应主表编号为 "+ model.getHeaderId() + " " + tipMsg + "!", "保存仓管通明细" + tipMsg));
- Log.infoFileSync("==================结束调用保存仓管通明细方法saveDetials()===================");
- }
-
-
- /**
- * 查找仓管通信息
- * @return
- */
- public void findBy()
- {
- try
- {
- PageUtil pageUtil = new PageUtil();
- pageUtil.setPageSize(model.getPageSize());
- pageUtil.setCurPage(model.getPageNo());
- pageUtil.setAdvSearch(getCondition());
- depotItemService.find(pageUtil);
- List dataList = pageUtil.getPageList();
-
- //开始拼接json数据
-// {"total":28,"rows":[
-// {"productid":"AV-CB-01","attr1":"Adult Male","itemid":"EST-18"}
-// ]}
- JSONObject outer = new JSONObject();
- outer.put("total", pageUtil.getTotalCount());
- //存放数据json数组
- JSONArray dataArray = new JSONArray();
- if(null != dataList)
- {
- for(DepotItem depotItem:dataList)
- {
- JSONObject item = new JSONObject();
- item.put("Id", depotItem.getId());
- item.put("MaterialId", depotItem.getMaterialId()==null?"":depotItem.getMaterialId().getId());
- item.put("MaterialName", ((depotItem.getMaterialId().getModel().equals(""))?"":""+depotItem.getMaterialId().getModel())+" "+depotItem.getMaterialId().getName()+((depotItem.getMaterialId().getColor() == null)?"(":"("+depotItem.getMaterialId().getColor()) + ")");
- item.put("OperNumber", depotItem.getOperNumber());
- item.put("UnitPrice", depotItem.getUnitPrice());
- item.put("Incidentals", depotItem.getIncidentals());
- item.put("Remark", depotItem.getRemark());
- item.put("Img", depotItem.getImg());
- item.put("op", 1);
- dataArray.add(item);
- }
- }
- outer.put("rows", dataArray);
- //回写查询结果
- toClient(outer.toString());
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找仓管通信息异常", e);
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询仓管通信息结果异常", e);
- }
- }
-
- /**
- * 查找进销存
- * @return
- */
- public void findByAll()
- {
- try
- {
- PageUtil pageUtil = new PageUtil();
- pageUtil.setPageSize(model.getPageSize());
- pageUtil.setCurPage(model.getPageNo());
- pageUtil.setAdvSearch(getConditionALL());
- depotItemService.find(pageUtil);
- List dataList = pageUtil.getPageList();
-
- JSONObject outer = new JSONObject();
- outer.put("total", pageUtil.getTotalCount());
- //存放数据json数组
- JSONArray dataArray = new JSONArray();
- if(null != dataList)
- {
- for(DepotItem depotItem:dataList)
- {
- JSONObject item = new JSONObject();
- Integer prevSum = sumNumber("入库",depotItem.getMaterialId().getId(),model.getMonthTime(),true) - sumNumber("出库",depotItem.getMaterialId().getId(),model.getMonthTime(),true);
- Integer InSum = sumNumber("入库",depotItem.getMaterialId().getId(),model.getMonthTime(),false);
- Integer OutSum = sumNumber("出库",depotItem.getMaterialId().getId(),model.getMonthTime(),false);
- item.put("Id", depotItem.getId());
- item.put("MaterialId", depotItem.getMaterialId()==null?"":depotItem.getMaterialId().getId());
- item.put("MaterialName", depotItem.getMaterialId().getName());
- item.put("MaterialModel", depotItem.getMaterialId().getModel());
- item.put("MaterialColor", depotItem.getMaterialId().getColor());
- item.put("prevSum", prevSum);
- item.put("InSum", InSum);
- item.put("OutSum", OutSum);
- item.put("thisSum", prevSum + InSum - OutSum);
- item.put("thisAllPrice", depotItem.getUnitPrice() * (prevSum + InSum - OutSum));
- item.put("UnitPrice", depotItem.getUnitPrice());
- dataArray.add(item);
- }
- }
- outer.put("rows", dataArray);
- //回写查询结果
- toClient(outer.toString());
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找信息异常", e);
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询信息结果异常", e);
- }
- }
-
- /**
- * 统计总计金额
- * @return
- */
- public void totalCountMoney()
- {
- try
- {
- PageUtil pageUtil = new PageUtil();
- pageUtil.setPageSize(0);
- pageUtil.setCurPage(0);
- pageUtil.setAdvSearch(getConditionALL());
- depotItemService.find(pageUtil);
- List dataList = pageUtil.getPageList();
-
- JSONObject outer = new JSONObject();
- Double thisAllPrice = 0.0;
- if(null != dataList)
- {
- for(DepotItem depotItem:dataList)
- {
- Integer prevSum = sumNumber("入库",depotItem.getMaterialId().getId(),model.getMonthTime(),true) - sumNumber("出库",depotItem.getMaterialId().getId(),model.getMonthTime(),true);
- Integer InSum = sumNumber("入库",depotItem.getMaterialId().getId(),model.getMonthTime(),false);
- Integer OutSum = sumNumber("出库",depotItem.getMaterialId().getId(),model.getMonthTime(),false);
- thisAllPrice = thisAllPrice + depotItem.getUnitPrice() * (prevSum + InSum - OutSum);
- }
- }
- outer.put("totalCount", thisAllPrice);
- //回写查询结果
- toClient(outer.toString());
- }
- catch (DataAccessException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找信息异常", e);
- }
- catch (IOException e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询信息结果异常", e);
- }
- }
-
- /**
- * 导出excel表格
- * @return
- */
- @SuppressWarnings("unchecked")
- public String exportExcel()
- {
- Log.infoFileSync("===================调用导出信息action方法exportExcel开始=======================");
- try
- {
- PageUtil pageUtil = new PageUtil();
- pageUtil.setPageSize(model.getPageSize());
- pageUtil.setCurPage(model.getPageNo());
- pageUtil.setAdvSearch(getConditionALL());
- depotItemService.find(pageUtil);
- List dataList = pageUtil.getPageList();
-
- //存放数据json数组
- JSONArray dataArray = new JSONArray();
- if(null != dataList)
- {
- for(DepotItem depotItem:dataList)
- {
- JSONObject item = new JSONObject();
- Integer prevSum = sumNumber("入库",depotItem.getMaterialId().getId(),model.getMonthTime(),true) - sumNumber("出库",depotItem.getMaterialId().getId(),model.getMonthTime(),true);
- Integer InSum = sumNumber("入库",depotItem.getMaterialId().getId(),model.getMonthTime(),false);
- Integer OutSum = sumNumber("出库",depotItem.getMaterialId().getId(),model.getMonthTime(),false);
- item.put("Id", depotItem.getId());
- item.put("MaterialId", depotItem.getMaterialId()==null?"":depotItem.getMaterialId().getId());
- item.put("MaterialName", depotItem.getMaterialId().getName());
- item.put("MaterialModel", depotItem.getMaterialId().getModel());
- item.put("MaterialColor", depotItem.getMaterialId().getColor());
- item.put("prevSum", prevSum);
- item.put("InSum", InSum);
- item.put("OutSum", OutSum);
- item.put("thisSum", prevSum + InSum - OutSum);
- item.put("thisAllPrice", depotItem.getUnitPrice() * (prevSum + InSum - OutSum));
- item.put("UnitPrice", depotItem.getUnitPrice());
- dataArray.add(item);
- }
- }
- String isCurrentPage = "allPage";
- model.setFileName(Tools.changeUnicode("report.xls",model.getBrowserType()));
- model.setExcelStream(depotItemService.exmportExcel(isCurrentPage,dataArray));
- }
- catch (Exception e)
- {
- Log.errorFileSync(">>>>>>>>>>>>>>>>>>>>>>调用导出信息action方法exportExcel异常",e);
- model.getShowModel().setMsgTip("export excel exception");
- }
- Log.infoFileSync("===================调用导出信息action方法exportExcel结束==================");
- return EXCEL;
- }
-
- @SuppressWarnings("unchecked")
- public Integer sumNumber(String type,Long MId,String MonthTime, Boolean isPrev) {
- Integer sumNumber = 0;
- String allNumber = "";
- PageUtil pageUtil = new PageUtil();
- pageUtil.setPageSize(0);
- pageUtil.setCurPage(0);
- try {
- depotItemService.findByType(pageUtil, type, MId, MonthTime, isPrev);
- allNumber = pageUtil.getPageList().toString();
- allNumber = allNumber.substring(1,allNumber.length()-1);
- if(allNumber.equals("null")){
- allNumber = "0";
- }
- allNumber = allNumber.replace(".0", "");
- } catch (AmsException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- sumNumber = Integer.parseInt(allNumber);
- return sumNumber;
- }
- /**
- * 拼接搜索条件
- * @return
- */
- private Map getCondition()
- {
- /**
- * 拼接搜索条件
- */
- Map condition = new HashMap();
- condition.put("HeaderId_n_eq", model.getHeaderId());
- condition.put("Id_s_order","asc");
- return condition;
- }
-
- private Map getConditionALL()
- {
- /**
- * 拼接搜索条件
- */
- Map condition = new HashMap();
- condition.put("HeaderId_s_in", model.getHeadIds());
- condition.put("MaterialId_s_in", model.getMaterialIds());
- condition.put("MaterialId_s_gb","aaa");
- return condition;
- }
-
- //=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
- @Override
- public DepotItemModel getModel()
- {
- return model;
- }
- public void setDepotItemService(DepotItemIService depotItemService)
- {
- this.depotItemService = depotItemService;
- }
-}
+package com.jsh.action.materials;
+
+import java.io.File;
+import java.io.IOException;
+import java.sql.Timestamp;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletResponse;
+
+import net.sf.json.JSONArray;
+import net.sf.json.JSONObject;
+
+import org.springframework.dao.DataAccessException;
+
+import com.jsh.base.BaseAction;
+import com.jsh.base.Log;
+import com.jsh.constants.asset.AssetConstants;
+import com.jsh.exception.JshException;
+import com.jsh.model.po.Asset;
+import com.jsh.model.po.DepotHead;
+import com.jsh.model.po.DepotItem;
+import com.jsh.model.po.Logdetails;
+import com.jsh.model.po.Material;
+import com.jsh.model.vo.materials.DepotItemModel;
+import com.jsh.service.materials.DepotHeadIService;
+import com.jsh.service.materials.DepotItemIService;
+import com.jsh.util.common.PageUtil;
+import com.jsh.util.common.Tools;
+
+@SuppressWarnings("serial")
+public class DepotItemAction extends BaseAction
+{
+ private DepotItemIService depotItemService;
+ private DepotItemModel model = new DepotItemModel();
+ /**
+ * action返回excel结果
+ */
+ public static final String EXCEL = "excel";
+
+ /**
+ * 保存明细
+ * @return
+ */
+ public void saveDetials()
+ {
+ Log.infoFileSync("==================开始调用保存仓管通明细信息方法saveDetials()===================");
+ Boolean flag = false;
+ try
+ {
+ Long headerId=model.getHeaderId();
+ String inserted=model.getInserted();
+ String deleted=model.getDeleted();
+ String updated=model.getUpdated();
+ //转为json
+ JSONArray insertedJson = JSONArray.fromObject(inserted);
+ JSONArray deletedJson = JSONArray.fromObject(deleted);
+ JSONArray updatedJson = JSONArray.fromObject(updated);
+ if(null != insertedJson)
+ {
+ for(int i = 0;i < insertedJson.size(); i++)
+ {
+ DepotItem depotItem = new DepotItem();
+ JSONObject tempInsertedJson = JSONObject.fromObject(insertedJson.get(i));
+ depotItem.setHeaderId(new DepotHead(headerId));
+ depotItem.setMaterialId(new Material(tempInsertedJson.getLong("MaterialId")));
+ depotItem.setOperNumber(tempInsertedJson.getDouble("OperNumber"));
+ if(tempInsertedJson.get("UnitPrice")!=null){depotItem.setUnitPrice(tempInsertedJson.getDouble("UnitPrice"));}
+ if(tempInsertedJson.get("Incidentals")!=null){depotItem.setIncidentals(0.0);}
+ depotItem.setRemark(tempInsertedJson.getString("Remark"));
+ depotItem.setImg(tempInsertedJson.getString("Img"));
+ depotItemService.create(depotItem);
+ }
+ }
+ if(null != deletedJson)
+ {
+ for(int i = 0;i < deletedJson.size(); i++)
+ {
+ JSONObject tempDeletedJson = JSONObject.fromObject(deletedJson.get(i));
+ depotItemService.delete(tempDeletedJson.getLong("Id"));
+ }
+ }
+ if(null != updatedJson)
+ {
+ for(int i = 0;i < updatedJson.size(); i++)
+ {
+ JSONObject tempUpdatedJson = JSONObject.fromObject(updatedJson.get(i));
+ DepotItem depotItem = depotItemService.get(tempUpdatedJson.getLong("Id"));
+ depotItem.setMaterialId(new Material(tempUpdatedJson.getLong("MaterialId")));
+ depotItem.setOperNumber(tempUpdatedJson.getDouble("OperNumber"));
+ if(tempUpdatedJson.get("UnitPrice")!=null){depotItem.setUnitPrice(tempUpdatedJson.getDouble("UnitPrice"));}
+ if(tempUpdatedJson.get("Incidentals")!=null){depotItem.setIncidentals(0.0);}
+ depotItem.setRemark(tempUpdatedJson.getString("Remark"));
+ depotItem.setImg(tempUpdatedJson.getString("Img"));
+ depotItemService.create(depotItem);
+ }
+ }
+
+ //========标识位===========
+ flag = true;
+ //记录操作日志使用
+ tipMsg = "成功";
+ tipType = 0;
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>保存仓管通明细信息异常", e);
+ flag = false;
+ tipMsg = "失败";
+ tipType = 1;
+ }
+ finally
+ {
+ try
+ {
+ toClient(flag.toString());
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>保存仓管通明细信息回写客户端结果异常", e);
+ }
+ }
+
+ logService.create(new Logdetails(getUser(), "保存仓管通明细", model.getClientIp(),
+ new Timestamp(System.currentTimeMillis())
+ , tipType, "保存仓管通明细对应主表编号为 "+ model.getHeaderId() + " " + tipMsg + "!", "保存仓管通明细" + tipMsg));
+ Log.infoFileSync("==================结束调用保存仓管通明细方法saveDetials()===================");
+ }
+
+
+ /**
+ * 查找仓管通信息
+ * @return
+ */
+ public void findBy()
+ {
+ try
+ {
+ PageUtil pageUtil = new PageUtil();
+ pageUtil.setPageSize(model.getPageSize());
+ pageUtil.setCurPage(model.getPageNo());
+ pageUtil.setAdvSearch(getCondition());
+ depotItemService.find(pageUtil);
+ List dataList = pageUtil.getPageList();
+
+ //开始拼接json数据
+// {"total":28,"rows":[
+// {"productid":"AV-CB-01","attr1":"Adult Male","itemid":"EST-18"}
+// ]}
+ JSONObject outer = new JSONObject();
+ outer.put("total", pageUtil.getTotalCount());
+ //存放数据json数组
+ JSONArray dataArray = new JSONArray();
+ if(null != dataList)
+ {
+ for(DepotItem depotItem:dataList)
+ {
+ JSONObject item = new JSONObject();
+ item.put("Id", depotItem.getId());
+ item.put("MaterialId", depotItem.getMaterialId()==null?"":depotItem.getMaterialId().getId());
+ item.put("MaterialName", ((depotItem.getMaterialId().getModel().equals(""))?"":""+depotItem.getMaterialId().getModel())+" "+depotItem.getMaterialId().getName()+((depotItem.getMaterialId().getColor() == null)?"(":"("+depotItem.getMaterialId().getColor()) + ")");
+ item.put("OperNumber", depotItem.getOperNumber());
+ item.put("UnitPrice", depotItem.getUnitPrice());
+ item.put("Incidentals", depotItem.getIncidentals());
+ item.put("Remark", depotItem.getRemark());
+ item.put("Img", depotItem.getImg());
+ item.put("op", 1);
+ dataArray.add(item);
+ }
+ }
+ outer.put("rows", dataArray);
+ //回写查询结果
+ toClient(outer.toString());
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找仓管通信息异常", e);
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询仓管通信息结果异常", e);
+ }
+ }
+
+ /**
+ * 查找进销存
+ * @return
+ */
+ public void findByAll()
+ {
+ try
+ {
+ PageUtil pageUtil = new PageUtil();
+ pageUtil.setPageSize(model.getPageSize());
+ pageUtil.setCurPage(model.getPageNo());
+ pageUtil.setAdvSearch(getConditionALL());
+ depotItemService.find(pageUtil);
+ List dataList = pageUtil.getPageList();
+
+ JSONObject outer = new JSONObject();
+ outer.put("total", pageUtil.getTotalCount());
+ //存放数据json数组
+ JSONArray dataArray = new JSONArray();
+ if(null != dataList)
+ {
+ for(DepotItem depotItem:dataList)
+ {
+ JSONObject item = new JSONObject();
+ Integer prevSum = sumNumber("入库",depotItem.getMaterialId().getId(),model.getMonthTime(),true) - sumNumber("出库",depotItem.getMaterialId().getId(),model.getMonthTime(),true);
+ Integer InSum = sumNumber("入库",depotItem.getMaterialId().getId(),model.getMonthTime(),false);
+ Integer OutSum = sumNumber("出库",depotItem.getMaterialId().getId(),model.getMonthTime(),false);
+ item.put("Id", depotItem.getId());
+ item.put("MaterialId", depotItem.getMaterialId()==null?"":depotItem.getMaterialId().getId());
+ item.put("MaterialName", depotItem.getMaterialId().getName());
+ item.put("MaterialModel", depotItem.getMaterialId().getModel());
+ item.put("MaterialColor", depotItem.getMaterialId().getColor());
+ item.put("prevSum", prevSum);
+ item.put("InSum", InSum);
+ item.put("OutSum", OutSum);
+ item.put("thisSum", prevSum + InSum - OutSum);
+ item.put("thisAllPrice", depotItem.getUnitPrice() * (prevSum + InSum - OutSum));
+ item.put("UnitPrice", depotItem.getUnitPrice());
+ dataArray.add(item);
+ }
+ }
+ outer.put("rows", dataArray);
+ //回写查询结果
+ toClient(outer.toString());
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找信息异常", e);
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询信息结果异常", e);
+ }
+ }
+
+ /**
+ * 统计总计金额
+ * @return
+ */
+ public void totalCountMoney()
+ {
+ try
+ {
+ PageUtil pageUtil = new PageUtil();
+ pageUtil.setPageSize(0);
+ pageUtil.setCurPage(0);
+ pageUtil.setAdvSearch(getConditionALL());
+ depotItemService.find(pageUtil);
+ List dataList = pageUtil.getPageList();
+
+ JSONObject outer = new JSONObject();
+ Double thisAllPrice = 0.0;
+ if(null != dataList)
+ {
+ for(DepotItem depotItem:dataList)
+ {
+ Integer prevSum = sumNumber("入库",depotItem.getMaterialId().getId(),model.getMonthTime(),true) - sumNumber("出库",depotItem.getMaterialId().getId(),model.getMonthTime(),true);
+ Integer InSum = sumNumber("入库",depotItem.getMaterialId().getId(),model.getMonthTime(),false);
+ Integer OutSum = sumNumber("出库",depotItem.getMaterialId().getId(),model.getMonthTime(),false);
+ thisAllPrice = thisAllPrice + depotItem.getUnitPrice() * (prevSum + InSum - OutSum);
+ }
+ }
+ outer.put("totalCount", thisAllPrice);
+ //回写查询结果
+ toClient(outer.toString());
+ }
+ catch (DataAccessException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找信息异常", e);
+ }
+ catch (IOException e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询信息结果异常", e);
+ }
+ }
+
+ /**
+ * 导出excel表格
+ * @return
+ */
+ @SuppressWarnings("unchecked")
+ public String exportExcel()
+ {
+ Log.infoFileSync("===================调用导出信息action方法exportExcel开始=======================");
+ try
+ {
+ PageUtil pageUtil = new PageUtil();
+ pageUtil.setPageSize(model.getPageSize());
+ pageUtil.setCurPage(model.getPageNo());
+ pageUtil.setAdvSearch(getConditionALL());
+ depotItemService.find(pageUtil);
+ List dataList = pageUtil.getPageList();
+
+ //存放数据json数组
+ JSONArray dataArray = new JSONArray();
+ if(null != dataList)
+ {
+ for(DepotItem depotItem:dataList)
+ {
+ JSONObject item = new JSONObject();
+ Integer prevSum = sumNumber("入库",depotItem.getMaterialId().getId(),model.getMonthTime(),true) - sumNumber("出库",depotItem.getMaterialId().getId(),model.getMonthTime(),true);
+ Integer InSum = sumNumber("入库",depotItem.getMaterialId().getId(),model.getMonthTime(),false);
+ Integer OutSum = sumNumber("出库",depotItem.getMaterialId().getId(),model.getMonthTime(),false);
+ item.put("Id", depotItem.getId());
+ item.put("MaterialId", depotItem.getMaterialId()==null?"":depotItem.getMaterialId().getId());
+ item.put("MaterialName", depotItem.getMaterialId().getName());
+ item.put("MaterialModel", depotItem.getMaterialId().getModel());
+ item.put("MaterialColor", depotItem.getMaterialId().getColor());
+ item.put("prevSum", prevSum);
+ item.put("InSum", InSum);
+ item.put("OutSum", OutSum);
+ item.put("thisSum", prevSum + InSum - OutSum);
+ item.put("thisAllPrice", depotItem.getUnitPrice() * (prevSum + InSum - OutSum));
+ item.put("UnitPrice", depotItem.getUnitPrice());
+ dataArray.add(item);
+ }
+ }
+ String isCurrentPage = "allPage";
+ model.setFileName(Tools.changeUnicode("report.xls",model.getBrowserType()));
+ model.setExcelStream(depotItemService.exmportExcel(isCurrentPage,dataArray));
+ }
+ catch (Exception e)
+ {
+ Log.errorFileSync(">>>>>>>>>>>>>>>>>>>>>>调用导出信息action方法exportExcel异常",e);
+ model.getShowModel().setMsgTip("export excel exception");
+ }
+ Log.infoFileSync("===================调用导出信息action方法exportExcel结束==================");
+ return EXCEL;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Integer sumNumber(String type,Long MId,String MonthTime, Boolean isPrev) {
+ Integer sumNumber = 0;
+ String allNumber = "";
+ PageUtil pageUtil = new PageUtil();
+ pageUtil.setPageSize(0);
+ pageUtil.setCurPage(0);
+ try {
+ depotItemService.findByType(pageUtil, type, MId, MonthTime, isPrev);
+ allNumber = pageUtil.getPageList().toString();
+ allNumber = allNumber.substring(1,allNumber.length()-1);
+ if(allNumber.equals("null")){
+ allNumber = "0";
+ }
+ allNumber = allNumber.replace(".0", "");
+ } catch (JshException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ sumNumber = Integer.parseInt(allNumber);
+ return sumNumber;
+ }
+ /**
+ * 拼接搜索条件
+ * @return
+ */
+ private Map getCondition()
+ {
+ /**
+ * 拼接搜索条件
+ */
+ Map condition = new HashMap();
+ condition.put("HeaderId_n_eq", model.getHeaderId());
+ condition.put("Id_s_order","asc");
+ return condition;
+ }
+
+ private Map getConditionALL()
+ {
+ /**
+ * 拼接搜索条件
+ */
+ Map condition = new HashMap();
+ condition.put("HeaderId_s_in", model.getHeadIds());
+ condition.put("MaterialId_s_in", model.getMaterialIds());
+ condition.put("MaterialId_s_gb","aaa");
+ return condition;
+ }
+
+ //=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
+ @Override
+ public DepotItemModel getModel()
+ {
+ return model;
+ }
+ public void setDepotItemService(DepotItemIService depotItemService)
+ {
+ this.depotItemService = depotItemService;
+ }
+}
diff --git a/src/com/jsh/base/BaseAction.java b/src/com/jsh/base/BaseAction.java
index 3a5df3c9..a2c6faeb 100644
--- a/src/com/jsh/base/BaseAction.java
+++ b/src/com/jsh/base/BaseAction.java
@@ -1,116 +1,116 @@
-package com.jsh.base;
-
-import java.io.IOException;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.ServletActionContext;
-
-import com.opensymphony.xwork2.ActionContext;
-import com.opensymphony.xwork2.ActionSupport;
-import com.opensymphony.xwork2.ModelDriven;
-import com.jsh.model.po.Basicuser;
-import com.jsh.service.basic.LogIService;
-/**
- * struts2工具类
- * @author andy
- * struts2 base action 一些常用方法获取
- */
-@SuppressWarnings("serial")
-public abstract class BaseAction extends ActionSupport implements ModelDriven
-{
- public LogIService logService;
-
- /**
- * 操作日志使用 是否成功表示
- */
- public String tipMsg = "成功";
-
- /**
- * 操作日志使用 是否成功表示 0 ==成功 1==失败
- */
- public short tipType = 0;
-
- public void setLogService(LogIService logService)
- {
- this.logService = logService;
- }
-
- /**
- * 获取session
- * @return
- */
- public static Map getSession()
- {
- return ActionContext.getContext().getSession();
- }
-
- /**
- * 获取request
- * @return
- */
- public static HttpServletRequest getRequest()
- {
- return ServletActionContext.getRequest();
- }
- /**
- * 获取response
- * @return response
- */
- public static HttpServletResponse getResponse()
- {
- return ServletActionContext.getResponse();
- }
-
- /**
- * 添加错误信息
- * @param anErrorMessage
- */
- public void addActionError(String anErrorMessage)
- {
- super.addActionError(anErrorMessage);
- }
-
- /**
- * 添加消息
- * @param aMessage
- */
- public void addActionMessage(String aMessage)
- {
- clearErrorsAndMessages();
- super.addActionMessage(aMessage);
- }
-
- /**
- * 添加字段错误
- * @param fieldName
- * @param errorMessage
- */
- public void addFieldError(String fieldName, String errorMessage)
- {
- clearErrorsAndMessages();
- super.addFieldError(fieldName, errorMessage);
- }
-
- /**
- * 登录用户信息
- * @return 登录用户对象
- */
- public Basicuser getUser()
- {
- return (Basicuser)getSession().get("user");
- }
-
- /**
- * 回写客户端数据
- * @throws IOException
- */
- public void toClient(String jsonData) throws IOException
- {
- HttpServletResponse response = ServletActionContext.getResponse();
- response.setContentType("text/html;charset=utf-8");
- response.getWriter().print(jsonData);
- }
-}
\ No newline at end of file
+package com.jsh.base;
+
+import java.io.IOException;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.struts2.ServletActionContext;
+
+import com.opensymphony.xwork2.ActionContext;
+import com.opensymphony.xwork2.ActionSupport;
+import com.opensymphony.xwork2.ModelDriven;
+import com.jsh.model.po.Basicuser;
+import com.jsh.service.basic.LogIService;
+/**
+ * struts2工具类
+ * @author jishenghua
+ * struts2 base action 一些常用方法获取
+ */
+@SuppressWarnings("serial")
+public abstract class BaseAction extends ActionSupport implements ModelDriven
+{
+ public LogIService logService;
+
+ /**
+ * 操作日志使用 是否成功表示
+ */
+ public String tipMsg = "成功";
+
+ /**
+ * 操作日志使用 是否成功表示 0 ==成功 1==失败
+ */
+ public short tipType = 0;
+
+ public void setLogService(LogIService logService)
+ {
+ this.logService = logService;
+ }
+
+ /**
+ * 获取session
+ * @return
+ */
+ public static Map getSession()
+ {
+ return ActionContext.getContext().getSession();
+ }
+
+ /**
+ * 获取request
+ * @return
+ */
+ public static HttpServletRequest getRequest()
+ {
+ return ServletActionContext.getRequest();
+ }
+ /**
+ * 获取response
+ * @return response
+ */
+ public static HttpServletResponse getResponse()
+ {
+ return ServletActionContext.getResponse();
+ }
+
+ /**
+ * 添加错误信息
+ * @param anErrorMessage
+ */
+ public void addActionError(String anErrorMessage)
+ {
+ super.addActionError(anErrorMessage);
+ }
+
+ /**
+ * 添加消息
+ * @param aMessage
+ */
+ public void addActionMessage(String aMessage)
+ {
+ clearErrorsAndMessages();
+ super.addActionMessage(aMessage);
+ }
+
+ /**
+ * 添加字段错误
+ * @param fieldName
+ * @param errorMessage
+ */
+ public void addFieldError(String fieldName, String errorMessage)
+ {
+ clearErrorsAndMessages();
+ super.addFieldError(fieldName, errorMessage);
+ }
+
+ /**
+ * 登录用户信息
+ * @return 登录用户对象
+ */
+ public Basicuser getUser()
+ {
+ return (Basicuser)getSession().get("user");
+ }
+
+ /**
+ * 回写客户端数据
+ * @throws IOException
+ */
+ public void toClient(String jsonData) throws IOException
+ {
+ HttpServletResponse response = ServletActionContext.getResponse();
+ response.setContentType("text/html;charset=utf-8");
+ response.getWriter().print(jsonData);
+ }
+}
diff --git a/src/com/jsh/base/BaseIDAO.java b/src/com/jsh/base/BaseIDAO.java
index 4fe52bf2..562cdaae 100644
--- a/src/com/jsh/base/BaseIDAO.java
+++ b/src/com/jsh/base/BaseIDAO.java
@@ -1,124 +1,124 @@
-package com.jsh.base;
-
-import java.io.Serializable;
-import java.util.List;
-import java.util.Map;
-
-import org.springframework.dao.DataAccessException;
-
-import com.jsh.util.common.PageUtil;
-
-/**
- * 常用增删改查操作
- * @author andy
- * @param
- */
-public interface BaseIDAO
-{
-
- /**
- * 设置操作类对象
- * @param paramClass
- */
- void setPoJoClass(Class paramClass);
-
- /**
- * 增加
- * @param t 对象
- * @throws DataAccessException
- */
- Serializable create(T t)throws DataAccessException;
-
- /**
- * 增加
- * @param t 对象
- * @throws DataAccessException
- */
- void save(T t)throws DataAccessException;
-
- /**
- * 删除
- * @param t 对象
- * @throws DataAccessException
- */
- void delete(T t)throws DataAccessException;
-
- /**
- * 获取
- * @param objID ID
- * @return 对象
- * @throws DataAccessException
- */
- T get(Long objID)throws DataAccessException;
-
- /**
- * 修改信息
- * @param t 要修改的对象
- * @throws DataAccessException
- */
- void update(T t)throws DataAccessException;
-
- /**
- * 批量删除信息
- * @param 以逗号分割的ID
- * @throws DataAccessException
- */
- void batchDelete(String objIDs)throws DataAccessException;
-
- /**
- * 查找列表
- * @param pageUtil 分页工具类
- * @throws DataAccessException
- */
- void find(PageUtil pageUtil)throws DataAccessException;
-
- /**
- * 根据条件查询列表--没有分页信息
- * @param conditon 查询条件
- * @return 查询列表数据
- */
- List find(Map conditon)throws DataAccessException;
-
- /**
- * 根据hql查询 --没有分页信息
- * @param hql hibernate查询
- * @return 查询列表数据
- */
- List