Browse Source

Merge branch 'master' of https://dev.33.cn/ll/CCB_Bank

maamin1 7 years ago
parent
commit
9979125eb0
60 changed files with 4134 additions and 755 deletions
  1. 15 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/constant/BattleResult.java
  2. 22 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/constant/HintMSG.java
  3. 24 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/constant/OperationTypeId.java
  4. 31 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/constant/Permission.java
  5. 38 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/constant/Role.java
  6. 24 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/constant/StatusId.java
  7. 37 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/AccountMaintenanceDao.java
  8. 27 7
      ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/AccountOpenDao.java
  9. 18 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/AttachmentDao.java
  10. 6 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/CapitalTransferDao.java
  11. 4 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/OperationHistoryDao.java
  12. 41 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/UserAuthoricationDao.java
  13. 28 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/ValuationAccountingDao.java
  14. 11 4
      ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/test.java
  15. 1 1
      ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/AccountOpeningRecord.java
  16. 2 14
      ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/CapitalTransfer.java
  17. 1 1
      ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/CapitalTransferCheck.java
  18. 123 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/OperationHistoryBO.java
  19. 47 28
      ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/PromptLetter.java
  20. 16 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/User.java
  21. 119 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/UserDetail.java
  22. 19 2
      ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/ValuationAccount.java
  23. 108 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapper/AccountMaintenance.xml
  24. 100 28
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapper/AccountOpenMapper.xml
  25. 9 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapper/AttachmentMapper.xml
  26. 1 1
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapper/BusinessDeclareMapper.xml
  27. 22 13
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapper/CapitalTransferMapper.xml
  28. 47 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapper/OperationHistoryMapper.xml
  29. 184 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapper/UserAuthoricationMapper.xml
  30. 124 1
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapper/ValuationAccountingMapper.xml
  31. 15 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/AccountMaintenanceMapper.java
  32. 5 6
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/AccountOpenMapper.java
  33. 8 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/AttachmentMapper.java
  34. 2 2
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/CapitalTransferMapper.java
  35. 2 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/OperationHistoryMapper.java
  36. 18 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/UserAuthoricationMapper.java
  37. 16 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/ValuationAccountingMapper.java
  38. 226 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/service/AccountMaintenanceService.java
  39. 107 61
      ccb_fund_trusteeship/src/main/java/com/fuzamei/service/AccountOpenService.java
  40. 27 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/service/AttachmentService.java
  41. 46 13
      ccb_fund_trusteeship/src/main/java/com/fuzamei/service/CapitalTransferService.java
  42. 87 65
      ccb_fund_trusteeship/src/main/java/com/fuzamei/service/OperationHistoryService.java
  43. 38 146
      ccb_fund_trusteeship/src/main/java/com/fuzamei/service/ProjectFileService.java
  44. 48 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/service/UserAuthoricationService.java
  45. 242 214
      ccb_fund_trusteeship/src/main/java/com/fuzamei/service/ValuationAccountingService.java
  46. 62 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/utils/ArrayUtil.java
  47. 79 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/utils/IoUtil.java
  48. 84 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/utils/OtherUtil.java
  49. 46 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/utils/RandomUtil.java
  50. 68 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/utils/RelativePathUtil.java
  51. 174 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/utils/StringUtil.java
  52. 648 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/utils/ValidationUtil.java
  53. 119 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/web/AccountMaintenanceAction.java
  54. 40 5
      ccb_fund_trusteeship/src/main/java/com/fuzamei/web/AccountOpenAction.java
  55. 28 0
      ccb_fund_trusteeship/src/main/java/com/fuzamei/web/BusinessDeclareAction.java
  56. 23 1
      ccb_fund_trusteeship/src/main/java/com/fuzamei/web/CapitalTransferAction.java
  57. 106 22
      ccb_fund_trusteeship/src/main/java/com/fuzamei/web/OperationHistoryAction.java
  58. 140 44
      ccb_fund_trusteeship/src/main/java/com/fuzamei/web/ProjectFileAction.java
  59. 22 22
      ccb_fund_trusteeship/src/main/java/com/fuzamei/web/PromptLetterAction.java
  60. 359 54
      ccb_fund_trusteeship/src/main/java/com/fuzamei/web/ValuationAccountingAction.java

+ 15 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/constant/BattleResult.java

@@ -0,0 +1,15 @@
+package com.fuzamei.constant;
+/**
+ * 
+ * @author ylx
+ * @describe 估值核算表中
+ *
+ */
+public class BattleResult {
+	private BattleResult() {
+		throw new AssertionError("禁止实例化");
+	}
+	public static final String TO_BE_MATCHED = "待对账";
+	public static final String CONSISTENT = "估值一致";
+	public static final String INCONSISTENT = "估值不一致";
+}

+ 22 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/constant/HintMSG.java

@@ -0,0 +1,22 @@
+package com.fuzamei.constant;
+
+/**
+ * 
+ * @author ylx
+ * @descibe: 提示信息的类
+ */
+public class HintMSG {
+	private HintMSG() {
+		throw new AssertionError("禁止实例化");
+	}
+	public static final String DOWNLOAD_SUCCESS="文件下载成功";
+	public static final String DOWNLOAD_FAIL="文件下载失败";
+	public static final String UPLOAD_SUCCESS="文件上传成功";
+	public static final String UPLOAD_FAIL="文件上传失败";
+	public static final String QUERY_SUCCESS="查询成功";
+	public static final String QUERY_FAIL="查询失败";
+	public static final String CHECK_SUCCESS="查看成功";
+	public static final String CHECK_FAIL="查看失败";
+	public static final String FILE_NOT_FOUND="文件不存在";
+	public static final String FILE_CANT_BE_NULL="文件不能为空";
+}

+ 24 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/constant/OperationTypeId.java

@@ -0,0 +1,24 @@
+package com.fuzamei.constant;
+/**
+ * 
+ * @author ylx
+ * @describe: 操作类型id号
+ */
+public class OperationTypeId {
+	private OperationTypeId() {
+		throw new AssertionError("禁止实例化");
+	}
+	public static final Integer BUSINESS_APPLY =1001;						//业务申报
+	public static final Integer BUSINESS_FIRST_TRIAL_AGREED =1002;			//业务初审通过
+	public static final Integer BUSINESS_REEXAMINE_REJECTED =1003;			//业务复审拒绝
+	public static final Integer CONTRACT_UPLOAD =1004;						//合同上传
+	public static final Integer CONTRACT_CONFIRM =1005;						//合同确认
+	public static final Integer CAPITAL_TRANSFER_FIRST_TRIAL =1006;			//资金划转初审
+	public static final Integer CAPITAL_TRANSFER_REEXAMINE =1007;			//资金划转复审
+	public static final Integer CAPITAL_TRANSFER_REEXAMINE_REJECTED =1008;	//资金划转复审拒绝
+	public static final Integer CAPITAL_TRANSFER_FINAL_JUDGE =1009;			//资金划转终审
+	public static final Integer UPLOAD_VALUATION_CHECK =1010;				//上传估值核算表
+	public static final Integer UPLOAD_PROJECT_FILE =1011;					//上传项目文档
+	public static final Integer BUSINESS_FIRST_TRIAL_REJECTED =1012;		//业务初审拒绝
+	public static final Integer BUSINESS_REEXAMINE_AGREED =1013;			//业务复审通过
+}

+ 31 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/constant/Permission.java

@@ -0,0 +1,31 @@
+package com.fuzamei.constant;
+
+/**
+ * 
+ * @author ylx
+ * @describe: 权限名称常量表
+ * @date: 2017-12-28 10:12 am
+ */
+public class Permission {
+	private Permission() {
+		throw new AssertionError("禁止实例化");
+	}
+	public static final String ADD="添加";
+	public static final String FIRST_TRIAL="初审";
+	public static final String REEXAMINE="复审";
+	public static final String UPLOAD_CONTRACT="上传合同";
+	public static final String MODIFY_CONTRACT="修订合同";
+	public static final String CONFIRM_CONTRACT="确认合同";
+	public static final String SEND_TRANSFER_ORDER="发出划款指令";
+	public static final String UPLOAD_VALUATION_REPORT="上传估值报表";
+	public static final String OPEN_ACCOUNT="开立账户";
+	public static final String CHECK_ACCOUNT_INFO="查看账户信息";
+	public static final String FIRST_TRIAL_OF_TRANSFER_ORDER="初审划款指令";
+	public static final String REEXAMINE_OF_TRANSFER_ORDER="复审划款指令";
+	public static final String FINAL_CHECK_OF_TRANSFER_ORDER="划款指令";
+	public static final String UPLOAD_PROJECT_FILE="上传项目文档";
+	public static final String CHECK_PROJECT_FILE="查看项目文档";
+	public static final String CHECK_INNER_CETIFICATION_FILE="验证文件是否是内部认证文档";
+	public static final String SEND_VENTURE_LETTER="发风险提示函";
+	public static final String CHECK_OUT="查看";
+}

+ 38 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/constant/Role.java

@@ -0,0 +1,38 @@
+package com.fuzamei.constant;
+
+/**
+ * 
+ * @author ylx
+ * @DESCRIBE: 角色名称常量表
+ * @Date:2017-12-28 10:08 am
+ */
+public class Role {
+	private Role() {
+		throw new AssertionError("禁止实例化");
+	}
+	//TRAN is abbreviation of transactor
+	public static final String TRAN_BRANCH_BANK = "经办支行";
+	//SEC is abbreviation of secondary
+	public static final String SEC_BRANCH_BANK = "二级分行";
+	//PBB is abbreviation of provincial branch bank
+	public static final String BUSINESS_DEP_OF_PBB = "省分行业务部门";
+	public static final String ADMIN = "管理人";
+	public static final String BUSINESS_CHIEF_DEP_OF_PBB = "省分行业务主管部门";
+	public static final String LAW_DEP_OF_PBB = "省分行法律部";
+	//POS is abbreviation of position
+	//PBBTBC is abbreviation of provincial branch bank trusteeship branch center
+	public static final String ACCOUNT_MAINTAIN_POS_OF_PBBTBC = "省分行托管分中心账户维护岗";
+	public static final String ACCOUNT_MANAGE_POS_OF_PBBTBC = "省分行托管分中心账户管理岗";
+	public static final String BUSINESS_TRAN_POS_OF_PBBTBC = "省分行托管分中心业务经办岗";
+	public static final String BUSINESS_CHECK_POS_OF_PBBTBC = "省分行托管分中心业务复核岗";
+	public static final String BUSINESS_CHIEF_POS_OF_PBBTBC = "省分行托管分中心业务主管岗";
+	//TBC is abbreviation of trusteeship branch center
+	public static final String ACCOUNTING_POS_OF_TBC = "托管分中心核算岗";
+	public static final String ARCHIVE_KEEPING_POS_OF_PBBTBC = "省分行托管分中心档案保管岗";
+	public static final String SUPERVISION_AGENCY = "监管机构";
+	public static final String OUTERS_OF_BANK = "银行内外部人员";
+	public static final String VENTURE_MANAGEMENT_POS = "风管岗";
+	public static final String OTHER_POS = "其余岗";
+	public static final String INNERS_OF_BANK = "银行内部人员";
+	
+}

+ 24 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/constant/StatusId.java

@@ -0,0 +1,24 @@
+package com.fuzamei.constant;
+
+/**
+ * 
+ * @author ylx
+ * @describe: 对应状态id号
+ */
+public class StatusId {
+	private StatusId() {
+		throw new AssertionError("禁止实例化");
+	}
+	public static final Integer TO_BE_CHECKED_BY_SECONDARY_BRANCH_BANK = 1;	//待二级分行审核
+	public static final Integer REJECTED_BY_SECONDARY_BRANCH_BANK = 2;		//二级分行审核不通过
+	public static final Integer TO_BE_CHECKED_BY_PROVINCIAL_BRANCH_BANK = 3;//待省分行业务部门审核
+	public static final Integer REJECTED_BY_PROVINCIAL_BRANCH_BANK = 4;		//省分行业务部门审核不通过
+	public static final Integer AGREE = 5;									//通过
+	public static final Integer REJECTED = 6;								//不通过
+	public static final Integer MODIFYING = 7;								//修订中
+	public static final Integer CONFIRMED = 8;								//已确认
+	public static final Integer FINISHED = 9;								//已完成
+	public static final Integer LAUNCHING = 10;								//发起
+	public static final Integer CHECKING = 11;								//审核
+	
+}

+ 37 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/AccountMaintenanceDao.java

@@ -0,0 +1,37 @@
+package com.fuzamei.dao;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Repository;
+
+import com.fuzamei.entity.AccountOpeningRecord;
+import com.fuzamei.mapperInterface.AccountMaintenanceMapper;
+@Repository
+public class AccountMaintenanceDao {
+	@Autowired
+	private AccountMaintenanceMapper accountMaintenanceMapper;
+	
+	
+	public  void  insertIntoAccountMaintenanceInfo(Map<String, Object> map) {
+		accountMaintenanceMapper.insertIntoAccountMaintenanceInfo(map);
+	}
+	public  void  insertAccountMaintenanceInfoFuJianBiao(Map<String, Object> map) {
+		accountMaintenanceMapper.insertAccountMaintenanceInfoFuJianBiao(map);
+	}
+	public  void  insertAccountMaintenanceInfoOperationHistory(Map<String, Object> map) {
+		accountMaintenanceMapper.insertAccountMaintenanceInfoOperationHistory(map);
+	}
+	public List<AccountOpeningRecord> selectAccountMaintenanceInfo(Map<String, Object> map){
+		return accountMaintenanceMapper.selectAccountMaintenanceInfo(map);
+	}
+	public  int selectCountAccountMaintenancePage() {
+		return accountMaintenanceMapper.selectCountAccountMaintenancePage();
+	}
+	
+	
+	
+	
+	
+}

+ 27 - 7
ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/AccountOpenDao.java

@@ -21,28 +21,48 @@ public class AccountOpenDao {
 		public  int  serchCountPage(){//总页数
 			return  mapperDao.serchCountPage();
 		}
-		public List<PromptLetter> selectPromptLetter(Map<String, Object> map){//查询风险提示函
+		public List<PromptLetter> selectPromptLetter(Map<String, Object> map){//查询风险提示函  管理人接收人
 			return mapperDao.selectPromptLetter(map);
 		}
-		public  int  serchCountPage2(){//总页
+		public  int  serchCountPage2(){//总页
 			return  mapperDao.serchCountPage2();
 		}
-		public void insertTiShiHanOrUser(Map<String, Object> map) {//插入管理人账号
-			mapperDao.insertTiShiHanOrUser(map);
+		public void insertTiShiHanOrUserOrOtherTable(Map<String, Object> map) {//插入管理人账号 还要往附件表,提示函表,操作记录表里也要加数据
+			mapperDao.insertTiShiHanOrUserOrOtherTable(map);
 		}
 		public void insertOperationHistory(Map<String, Object> map) {//插入到操作记录表     公共用
 			mapperDao.insertOperationHistory(map);
 		}
-		public List<PromptLetter> selectTishihan(Map<String, Object> map){//查询风险提示函3
+		public List<PromptLetter> selectTishihan(Map<String, Object> map){//查询风险提示函3   发送人
 			return mapperDao.selectTishihan(map);
 		}
 		public void insertTrueFalseSelect(Map<String, Object> map) {//真伪查询   记录插入到附件表
-			mapperDao.insertTiShiHanOrUser(map);
+			mapperDao.insertAccountUploadFileFuJianBiao(map);
 		}
 		public void insertAccountUploadFile(Map<String, Object> map) {//<!-- 上传客户资料,承诺书,开户申请书    经办支行添加创建账号和客户名称 -->
 			mapperDao.insertAccountUploadFile(map);
 		}
-		public void insertAccountUploadFileFuJianBiao(Map<String, Object> map) {//<!-- 上传客户资料,承诺书,开户申请书    经办支行添加创建账号和客户名称    到附件表-->
+		public void insertPromptLetterTable(Map<String, Object> map) {//<!-- 上传客户资料,承诺书,开户申请书    经办支行添加创建账号和客户名称    到附件表-->
+			mapperDao.insertAccountUploadFileFuJianBiao(map);
+		}
+		public void insertAccountUploadFileFuJianBiao(Map<String, Object> map) {
 			mapperDao.insertAccountUploadFileFuJianBiao(map);
 		}
+		
+		public void insertIntoPromptLetterTable(Map<String, Object> map) {//数据往提示函插入99
+			mapperDao.insertIntoPromptLetterTable(map);
+		}
+		public void insertIntoAttachmentTable(Map<String, Object> map) {//提示函数据在往附件表也插入99
+			mapperDao.insertIntoAttachmentTable(map);
+		}
+		public List<AccountOpeningRecord> selectAccountopenNoPage(Map<String, Object> map){////账户开立 通过点击查看  供应下载页面  
+			return  mapperDao.selectAccountopenNoPage(map);		
+         }
+		////////////////////////////////////////////////////////////////////////////////////////////////
+		
+		
+		
+		
+		
+		
 }

+ 18 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/AttachmentDao.java

@@ -0,0 +1,18 @@
+package com.fuzamei.dao;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Repository;
+
+import com.fuzamei.mapperInterface.AttachmentMapper;
+
+@Repository
+public class AttachmentDao {
+	
+	@Autowired
+	private AttachmentMapper attachmentMapper;
+
+	public int queryIfHasTheSameAttachmentId(Integer attachmentId) {
+		return attachmentMapper.queryIfHasTheSameAttachmentId(attachmentId);
+	}
+
+}

+ 6 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/CapitalTransferDao.java

@@ -32,4 +32,10 @@ public class CapitalTransferDao {
 	/*public List<User> selectByPersonName(Map<String, Object> map) {//临时测试的
 		return capitalTransferMapper.selectByPersonName(map);
 	}*/
+	public void insertCheckTransfer(Map<String, Object> map) {//将划转资金审核的意见插入导(划转资金审核表里)
+		capitalTransferMapper.insertCheckTransfer(map);
+	}
+	public void updatecapitaltransferStatus(Map<String, Object> map) {//将划转审核结果意见在插入划转资金表的同时,也将审核结果更新到划转资金表中去,根据基金id  
+		capitalTransferMapper.updatecapitaltransferStatus(map);
+	}
 }

+ 4 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/OperationHistoryDao.java

@@ -22,4 +22,8 @@ public class OperationHistoryDao {
 	public int findAllInformation(){
 		return dao.findAllInformation();
 	}
+
+	public List<OperationHistory> queryOperationHistoryInformationByUser(Map<String, Object> map) {
+		return dao.queryOperationHistoryInformationByUser(map);
+	}
 }

+ 41 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/UserAuthoricationDao.java

@@ -0,0 +1,41 @@
+package com.fuzamei.dao;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Repository;
+
+import com.fuzamei.entity.UserDetail;
+import com.fuzamei.mapperInterface.UserAuthoricationMapper;
+
+/**
+ * 
+ * @author ylx
+ * @describe 用于查询用户的信息的dao层类
+ */
+@Repository
+public class UserAuthoricationDao {
+	
+	@Autowired
+	private UserAuthoricationMapper userAuthoricationMapper;
+	
+	//根据用户的id号查询用户的角色信息 
+	public List<String> queryUserRoleNames(int userId){
+		return userAuthoricationMapper.queryUserRolenames(userId);
+	}
+	
+	//根据用户的id号查询用户的权限信息 
+	public List<String> queryUserPermissionNames(int userId){
+		return userAuthoricationMapper.queryUserPermissionNames(userId);
+	}
+	
+	//根据用户的id号查询用户的账号名Account名
+	public String queryUserAccount(int userId) {
+		return userAuthoricationMapper.queryUserAccount(userId);
+	}
+	
+	//根据id号查询用户全部的信息
+	public UserDetail queryUserDetailInformation(int userId) {
+		return userAuthoricationMapper.queryUserDetailInformation(userId);
+	}
+}

+ 28 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/ValuationAccountingDao.java

@@ -39,4 +39,32 @@ public class ValuationAccountingDao {
 		valuationAccountingMapper.insertInformationToAttachment(map);
 	}
 
+	public List<ValuationAccount> checkoutDownloadInformation(int fundId) {
+		return valuationAccountingMapper.checkoutDownloadInformation(fundId);
+	}
+
+	public int queryIfHasTheSameFundId(Integer fundId) {
+		return valuationAccountingMapper.queryIfHasTheSameFundId(fundId);
+	}
+
+	public ValuationAccount checkIfFundExists(Integer fundId, String fundName) {
+		return valuationAccountingMapper.checkIfFundExists(fundId,fundName);
+	}
+
+	public void updateInformationByAdmin(Map<String, Object> map) {
+		valuationAccountingMapper.updateInformationByAdmin(map);
+	}
+
+	public void updateAttachmentInformationByAdmin(Map<String, Object> map) {
+		valuationAccountingMapper.updateAttachmentInformationByAdmin(map);
+	}
+
+	public void updateAttachmentInformationByBank(Map<String, Object> map) {
+		valuationAccountingMapper.updateAttachmentInformationByBank(map);
+	}
+
+	public int queryIfHasTheSameFundName(String fundName) {
+		return valuationAccountingMapper.queryIfHasTheSameFundName(fundName);
+	}
+
 }

+ 11 - 4
ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/test.java

@@ -10,6 +10,8 @@ import java.net.HttpURLConnection;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLConnection;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 
 public class test {
 /*public static void main(String[] args) {
@@ -31,14 +33,19 @@ public static void main(String[] args) throws MalformedURLException  {
 	System.out.println(ss+"哈jhvbebhvbhvhvb");
 	System.out.println( System.currentTimeMillis()+"eeeeee");*/
 
-	  String photoUrl = "https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo/bd_logo1_31bdc765.png";                                      
+	/*  String photoUrl = "https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo/bd_logo1_31bdc765.png";                                      
 	  String fileName = photoUrl.substring(photoUrl.lastIndexOf("/"));   
       //System.out.println("fileName---->"+fileName);  
       String filePath = "D:\\picture";    
       File file = saveUrlAs(photoUrl, filePath + fileName,"GET");    
-      System.out.println("zzz" + file);  
-	
-	
+      System.out.println("zzz" + file);*/  
+      //System.out.println(Math.round(Math.random()*8999+100));
+	SimpleDateFormat sdf=new SimpleDateFormat("MMddHHmmss");
+	String str=sdf.format(new Date()).substring(6)+Math.round(Math.random()*8999+100);
+	System.out.println(str+"随机数是");
+	 SimpleDateFormat df = new SimpleDateFormat("yyyyMMHHmmss");
+	    String ss=  df.format(new Date());
+	    System.out.println(ss+"shijian ");
     }   
 	
 public static File saveUrlAs(String url,String filePath,String method){  

+ 1 - 1
ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/AccountOpeningRecord.java

@@ -8,9 +8,9 @@ public class AccountOpeningRecord {
 	private int customer_id;//客户编号
 	private String customer_name;//客户名称
 	private String bank_account;//银行账号
-	private String basic_data_id;//客户基本资料id
 	private String letter_of_commitment_id;//账户承诺书id
 	private String application_id;//开户申请书id
+	private String basic_data_id;//其他凭证id
 	private long update_time;//更新时间
 	private int  status_id;//状态id
 	private String hash;//哈希码

+ 2 - 14
ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/CapitalTransfer.java

@@ -6,10 +6,10 @@ public class CapitalTransfer {
 	private int fund_id;//基金id
 	private int custodian;//管理人
 	private String  fund_name;//基金名称
-	private double account_balance;//账户余额
+	//private double account_balance;//账户余额   去掉 放到用户表里
 	private double sum_of_money;//划款金额
 	private int  basis_of_payment;//划款依据
-	private String drawing_account;//划款账户
+	//private String drawing_account;//划款账户  去掉 放到用户表里
 	private long apply_time;//申请时间
 	private long handle_time;//处理时间
 	private int status_id;//状态id
@@ -65,12 +65,6 @@ public class CapitalTransfer {
 	public void setFund_name(String fund_name) {
 		this.fund_name = fund_name;
 	}
-	public double getAccount_balance() {
-		return account_balance;
-	}
-	public void setAccount_balance(double account_balance) {
-		this.account_balance = account_balance;
-	}
 	public double getSum_of_money() {
 		return sum_of_money;
 	}
@@ -83,12 +77,6 @@ public class CapitalTransfer {
 	public void setBasis_of_payment(int basis_of_payment) {
 		this.basis_of_payment = basis_of_payment;
 	}
-	public String getDrawing_account() {
-		return drawing_account;
-	}
-	public void setDrawing_account(String drawing_account) {
-		this.drawing_account = drawing_account;
-	}	
 	public long getHandle_time() {
 		return handle_time;
 	}

+ 1 - 1
ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/CapitalTransferCheck.java

@@ -10,7 +10,7 @@ public class CapitalTransferCheck {
 	private String check_opinin;//审核意见
 	private long check_time;//审核时间
 	private String check_result;//结果
-	private  int relation;
+	private  int relation;//发起or审核
 	public int getRelation() {
 		return relation;
 	}

+ 123 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/OperationHistoryBO.java

@@ -0,0 +1,123 @@
+package com.fuzamei.entity;
+
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.NotNull;
+
+import org.hibernate.validator.constraints.NotEmpty;
+import org.hibernate.validator.constraints.Range;
+/**
+5      * Bean Validation 中内置的 constraint       
+6      * @Null   被注释的元素必须为 null       
+7      * @NotNull    被注释的元素必须不为 null       
+8      * @AssertTrue     被注释的元素必须为 true       
+9      * @AssertFalse    被注释的元素必须为 false       
+10      * @Min(value)     被注释的元素必须是一个数字,其值必须大于等于指定的最小值       
+11      * @Max(value)     被注释的元素必须是一个数字,其值必须小于等于指定的最大值       
+12      * @DecimalMin(value)  被注释的元素必须是一个数字,其值必须大于等于指定的最小值       
+13      * @DecimalMax(value)  被注释的元素必须是一个数字,其值必须小于等于指定的最大值       
+14      * @Size(max=, min=)   被注释的元素的大小必须在指定的范围内       
+15      * @Digits (integer, fraction)     被注释的元素必须是一个数字,其值必须在可接受的范围内       
+16      * @Past   被注释的元素必须是一个过去的日期       
+17      * @Future     被注释的元素必须是一个将来的日期       
+18      * @Pattern(regex=,flag=)  被注释的元素必须符合指定的正则表达式       
+19      * Hibernate Validator 附加的 constraint       
+20      * @NotBlank(message =)   验证字符串非null,且长度必须大于0       
+21      * @Email  被注释的元素必须是电子邮箱地址       
+22      * @Length(min=,max=)  被注释的字符串的大小必须在指定的范围内       
+23      * @NotEmpty   被注释的字符串的必须非空       
+24      * @Range(min=,max=,message=)  被注释的元素必须在合适的范围内 
+25      */
+/*@NotNull 和 @NotEmpty  和@NotBlank 区别
+@NotEmpty 用在集合类上面
+@NotBlank 用在String上面
+@NotNull    用在基本类型上
+如果在基本类型上面用NotEmpty或者NotBlank 会出现上面的错*/
+/**
+ * 
+ * @author ylx
+ * @version 1.0
+ * @descible 操作记录模块中查询的操作接受的实体类信息
+ */
+public class OperationHistoryBO {
+	@NotNull(message="用户id号不能为空")
+	@Min(value=0,message="必须是一个大于0的数字")
+	private Integer userId;
+	
+	@NotNull(message="页数不能为空")
+	@Range(min=1,max=Integer.MAX_VALUE,message="页数最小值应该为1")
+	private Integer page;
+	
+	private String account;
+	
+	private String role;
+	
+	private String type;
+	
+	private Long startTime;
+	
+	private Long endTime;
+
+	public Integer getUserId() {
+		return userId;
+	}
+
+	public void setUserId(Integer userId) {
+		this.userId = userId;
+	}
+
+	public Integer getPage() {
+		return page;
+	}
+
+	public void setPage(Integer page) {
+		this.page = page;
+	}
+
+	public String getAccount() {
+		return account;
+	}
+
+	public void setAccount(String account) {
+		this.account = account;
+	}
+
+	public String getRole() {
+		return role;
+	}
+
+	public void setRole(String role) {
+		this.role = role;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	public Long getStartTime() {
+		return startTime;
+	}
+
+	public void setStartTime(Long startTime) {
+		this.startTime = startTime;
+	}
+
+	public Long getEndTime() {
+		return endTime;
+	}
+
+	public void setEndTime(Long endTime) {
+		this.endTime = endTime;
+	}
+
+	@Override
+	public String toString() {
+		return "OperationHistoryBO [userId=" + userId + ", page=" + page + ", account=" + account + ", role=" + role
+				+ ", type=" + type + ", startTime=" + startTime + ", endTime=" + endTime + "]";
+	}
+	
+}

+ 47 - 28
ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/PromptLetter.java

@@ -2,76 +2,95 @@ package com.fuzamei.entity;
 
 import java.util.Date;
 //提示函表
-public class PromptLetter extends User{
-	private int id;//主键id
-	private int prompt_letter_id;//提示函id
-	//private int  userid;//用户表的外键
+public class PromptLetter {
+	private Integer id;//主键id
+	private Integer prompt_letter_id;//提示函id
 	private String prompt_letter_name;//提示函名称
 	private String send_person;//发送人
 	private String receive_person;//接收人
-	private long send_time;//发送时间
-	private long receive_time;//接收时间
+	private Long send_time;//发送时间
+	private Long receive_time;//接收时间
 	private String hash;//哈希码
-	public int getId() {
-		return id;
+	
+	private String attachment_name;/**附件表账号名称**/
+	private String person_name;/**用户表管理人名字**/
+
+	
+	public String getPerson_name() {
+		return person_name;
+	}
+	public void setPerson_name(String person_name) {
+		this.person_name = person_name;
 	}
-	public void setId(int id) {
+
+	public void setId(Integer id) {
 		this.id = id;
 	}
-	public int getPrompt_letter_id() {
+	public Integer getId() {
+		return id;
+	}
+
+	public Integer getPrompt_letter_id() {
 		return prompt_letter_id;
 	}
-	public void setPrompt_letter_id(int prompt_letter_id) {
+	public void setPrompt_letter_id(Integer prompt_letter_id) {
 		this.prompt_letter_id = prompt_letter_id;
 	}
-/*	public int getUserid() {
-		return userid;
-	}
-	public void setUserid(int userid) {
-		this.userid = userid;
-	}*/
+
 	public String getPrompt_letter_name() {
 		return prompt_letter_name;
 	}
+
 	public void setPrompt_letter_name(String prompt_letter_name) {
 		this.prompt_letter_name = prompt_letter_name;
 	}
+
 	public String getSend_person() {
 		return send_person;
 	}
+
 	public void setSend_person(String send_person) {
 		this.send_person = send_person;
 	}
+
 	public String getReceive_person() {
 		return receive_person;
 	}
+
 	public void setReceive_person(String receive_person) {
 		this.receive_person = receive_person;
 	}
-	public long getSend_time() {
+
+	public Long getSend_time() {
 		return send_time;
 	}
-	public void setSend_time(long send_time) {
+
+	public void setSend_time(Long send_time) {
 		this.send_time = send_time;
 	}
-	public long getReceive_time() {
+
+	public Long getReceive_time() {
 		return receive_time;
 	}
-	public void setReceive_time(long receive_time) {
+
+	public void setReceive_time(Long receive_time) {
 		this.receive_time = receive_time;
 	}
+
 	public String getHash() {
 		return hash;
 	}
+
 	public void setHash(String hash) {
 		this.hash = hash;
 	}
-	
-	
-	
-	
-	
-	
-	
+
+	public String getAttachment_name() {
+		return attachment_name;
+	}
+
+	public void setAttachment_name(String attachment_name) {
+		this.attachment_name = attachment_name;
+	}
 	
 }

+ 16 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/User.java

@@ -34,6 +34,22 @@ public class User{
 	private long create_time;		//创建时间
 	private long update_time;		//更新时间
 	
+	private double account_balance;//账户余额
+	private String drawing_account;//划款账户
+	
+	
+	public double getAccount_balance() {
+		return account_balance;
+	}
+	public void setAccount_balance(double account_balance) {
+		this.account_balance = account_balance;
+	}
+	public String getDrawing_account() {
+		return drawing_account;
+	}
+	public void setDrawing_account(String drawing_account) {
+		this.drawing_account = drawing_account;
+	}
 	public int getId() {
 		return id;
 	}

+ 119 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/UserDetail.java

@@ -0,0 +1,119 @@
+package com.fuzamei.entity;
+
+import java.util.List;
+
+public class UserDetail {
+	private Integer id;							//用户表主键
+	private Integer user_id;					//用户id
+	private String account;						//用户账号名称
+	private String password;					//用户密码
+	private String random;						//随机数
+	private String public_key;					//公钥
+	private String private_key;					//私钥
+	private String organization_name;			//机构名称
+	private String person_name;					//人员名称
+	private List<String> role_name;				//角色名称
+	private List<String> authority_name;		//权限名称
+	private Double account_balance;				//账户余额
+	private String drawing_account;				//划款账户
+	private Long create_time;					//账户创建时间
+	private Long update_time;					//账户修改时间
+	public Double getAccount_balance() {
+		return account_balance;
+	}
+	public void setAccount_balance(Double account_balance) {
+		this.account_balance = account_balance;
+	}
+	public String getDrawing_account() {
+		return drawing_account;
+	}
+	public void setDrawing_account(String drawing_account) {
+		this.drawing_account = drawing_account;
+	}
+	public Long getCreate_time() {
+		return create_time;
+	}
+	public void setCreate_time(Long create_time) {
+		this.create_time = create_time;
+	}
+	public Long getUpdate_time() {
+		return update_time;
+	}
+	public void setUpdate_time(Long update_time) {
+		this.update_time = update_time;
+	}
+	public Integer getId() {
+		return id;
+	}
+	public void setId(Integer id) {
+		this.id = id;
+	}
+	public Integer getUser_id() {
+		return user_id;
+	}
+	public void setUser_id(Integer user_id) {
+		this.user_id = user_id;
+	}
+	public String getAccount() {
+		return account;
+	}
+	public void setAccount(String account) {
+		this.account = account;
+	}
+	public String getPassword() {
+		return password;
+	}
+	public void setPassword(String password) {
+		this.password = password;
+	}
+	public String getRandom() {
+		return random;
+	}
+	public void setRandom(String random) {
+		this.random = random;
+	}
+	public String getPublic_key() {
+		return public_key;
+	}
+	public void setPublic_key(String public_key) {
+		this.public_key = public_key;
+	}
+	public String getPrivate_key() {
+		return private_key;
+	}
+	public void setPrivate_key(String private_key) {
+		this.private_key = private_key;
+	}
+	public String getOrganization_name() {
+		return organization_name;
+	}
+	public void setOrganization_name(String organization_name) {
+		this.organization_name = organization_name;
+	}
+	public String getPerson_name() {
+		return person_name;
+	}
+	public void setPerson_name(String person_name) {
+		this.person_name = person_name;
+	}
+	public List<String> getRole_name() {
+		return role_name;
+	}
+	public void setRole_name(List<String> role_name) {
+		this.role_name = role_name;
+	}
+	public List<String> getAuthority_name() {
+		return authority_name;
+	}
+	public void setAuthority_name(List<String> authority_name) {
+		this.authority_name = authority_name;
+	}
+	@Override
+	public String toString() {
+		return "UserDetail [id=" + id + ", user_id=" + user_id + ", account=" + account + ", password=" + password
+				+ ", random=" + random + ", public_key=" + public_key + ", private_key=" + private_key
+				+ ", organization_name=" + organization_name + ", person_name=" + person_name + ", role_name="
+				+ role_name + ", authority_name=" + authority_name + "]";
+	}
+	
+}

+ 19 - 2
ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/ValuationAccount.java

@@ -10,6 +10,8 @@ public class ValuationAccount {
 	private Long update_time;					//文件更新时间。。。。。暂时理解为文件创建时间????
 	private String battle_result;				//比对结果
 	
+	private Integer attachment_id_of_custodian;				//管理员上传的附件id号
+	private Integer attachment_id_of_bank;					//银行上传的附件id号
 	
 	private String attachment_name_of_custodian;				//附件名称--------->>管理人估值报表名称
 	private String attachment_name_of_bank;				//附件名称----------->>银行估值报表名称
@@ -23,6 +25,23 @@ public class ValuationAccount {
 	public Integer getFund_id() {
 		return fund_id;
 	}
+	
+	public Integer getAttachment_id_of_custodian() {
+		return attachment_id_of_custodian;
+	}
+
+	public void setAttachment_id_of_custodian(Integer attachment_id_of_custodian) {
+		this.attachment_id_of_custodian = attachment_id_of_custodian;
+	}
+
+	public Integer getAttachment_id_of_bank() {
+		return attachment_id_of_bank;
+	}
+
+	public void setAttachment_id_of_bank(Integer attachment_id_of_bank) {
+		this.attachment_id_of_bank = attachment_id_of_bank;
+	}
+
 	public void setFund_id(Integer fund_id) {
 		this.fund_id = fund_id;
 	}
@@ -62,8 +81,6 @@ public class ValuationAccount {
 	public void setBattle_result(String battle_result) {
 		this.battle_result = battle_result;
 	}
-	
-	
 	public String getAttachment_name_of_custodian() {
 		return attachment_name_of_custodian;
 	}

+ 108 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapper/AccountMaintenance.xml

@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fuzamei.mapperInterface.AccountMaintenanceMapper"> 
+    <!--查询账户开立信息维护   列表-->
+	<select id="selectAccountMaintenanceInfo" parameterType="java.util.Map" resultType="com.fuzamei.entity.AccountOpeningRecord">
+		select 
+			customer_id,
+			customer_name,
+			bank_account,
+			f.attachment_name as basic_data_id,
+			f1.attachment_name as letter_of_commitment_id,
+			f2.attachment_name as application_id,
+			update_time,s.status_name 
+		from  
+			      account_opening_record a
+		LEFT JOIN  attachment f
+		
+			on a.basic_data_id=f.attachment_id 
+	  	LEFT JOIN	attachment f1
+	  	on	a.letter_of_commitment_id = f1.attachment_id 
+	  	LEFT JOIN attachment f2
+	  	on	a.application_id= f2.attachment_id 
+	  	LEFT JOIN status s
+	  	on a.status_id = s.status_id
+	 <where>
+		    <if test="customer_name!='' and customer_name!=null ">
+			  customer_name=#{customer_name}
+			</if>
+			<if test="bank_account!='' and bank_account!=null">
+			  and bank_account=#{bank_account}
+			</if>
+		   	<if test="startTime!='' and endTime != ''">
+			  and a.update_time  between #{startTime} and #{endTime}
+			</if>
+	 </where>
+	             order by update_time desc
+	            limit #{startPage},#{rowNum}
+	</select>
+	
+	<!--查询账户维护开立信息总页数  返回一个int类型  -->
+	<select id="selectCountAccountMaintenancePage" resultType="int">
+	  select count(*) from account_opening_record
+	</select>
+	
+	<!-- 添加上传账户维护信息表 -->
+    <insert id="insertIntoAccountMaintenanceInfo" parameterType="java.util.Map">
+    	   insert into account_opening_record(
+	              customer_id,
+	              customer_name,
+	              bank_account,
+	              basic_data_id,
+	              letter_of_commitment_id,
+	              application_id,
+	              update_time,
+	              status_id,
+	              hash)
+	       values(
+	            #{customer_id},
+	            #{customer_name},
+	            #{bank_account},
+	            #{basicAttachment_id},
+	            #{letterAttachment_id},
+	            #{applicationAttachment_id},
+	            #{update_time},
+	            #{status_id},
+	            #{hash}
+	            )
+    </insert>
+    
+    <!-- 上传其他凭证,承诺书,开户申请书    经办支行添加创建账号和客户名称  上传到附件表--> 
+	<insert id="insertAccountMaintenanceInfoFuJianBiao" parameterType="java.util.Map">
+	     	   <!--  插入到附件表-->
+		   insert into attachment (
+		                attachment_id,
+		                attachment_name,
+		                url,
+		                upload_person_id,
+		                create_time) 
+		          values(
+		               #{attachment_id},
+		               #{attachment_name},
+		               #{url},
+		               #{upload_person_id},
+		               #{create_time} )
+	</insert>
+	
+	<!-- 当经办支行进行账户开立维护上传的时候往(操作记录表)中插入一条数据    可公用-->
+	<insert id="insertAccountMaintenanceInfoOperationHistory">
+			insert into 
+				operation_history(operator_type_id,
+								  operator_account,
+								  operator_role,
+								  operator_person,
+								  operator_time,
+								  hash)
+			values(#{operatorTypeId},
+				   #{operatorAccount},
+				   #{operatorRole},
+				   #{operatorPerson},
+				   #{operatorTime},
+				   #{hash})
+	</insert>
+
+
+
+
+
+</mapper>

+ 100 - 28
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapper/AccountOpenMapper.xml

@@ -23,14 +23,16 @@
 	</where>
 	   order by update_time desc
 	   limit #{startNum},10 -->
+	<!--查询账户开立  返回总页数-->
 	<select id="serchCountPage" resultType="int">
 	  select count(*)  from account_opening_record  
 	</select>
+	<!--查询资金划转 返回总页数  -->
 	<select id="serchCountPage2" resultType="int">
 	  select count(*)  from prompt_letter
 	</select>
-   <!-- 账户开立带分页-->
-	<select id="queryAllAccountOpening"  resultType="com.fuzamei.entity.AccountOpeningRecord">
+   <!-- 账户开立带分页,没用左链接-->
+	<!-- <select id="queryAllAccountOpening"  resultType="com.fuzamei.entity.AccountOpeningRecord">
 		select 
 			customer_id,
 			customer_name,
@@ -62,24 +64,27 @@
 	 </where>
 	   order by update_time desc
 	   limit #{startPage},#{rowNum}
-	</select>
+	</select> -->
 	<!-- ************************************************************************************************** -->
+	<!--提示函  管理人接收的 列表   没用左链接不可以话在改-->
+	<!-- select   t.prompt_letter_id,f.attachment_name,  t.receive_time ,f.url from  prompt_letter t left join attachment f on t.prompt_letter_id=f.attachment_id    order by receive_time desc -->
 	<select id="selectPromptLetter" parameterType="java.util.Map" resultType="com.fuzamei.entity.PromptLetter">
-		select   prompt_letter_id , prompt_letter_name ,receive_time  from prompt_letter 
-		<where>
-		  <if test="startTime!='' and endTime != ''">
-		   receive_time   between #{startTime} and #{endTime}
-		  </if>
-		</where>
+	 select  
+	         t.prompt_letter_id,
+             f.attachment_name,
+			 t.receive_time,
+			 f.url
+       from  
+       		prompt_letter t,
+             attachment f 
+       where
+		    t.prompt_letter_id=f.attachment_id and receive_time between #{startTime} and #{endTime}
 		      order by receive_time desc
 	          limit #{startPage},#{rowNum}
 	</select>
 	<!--*********************************************************************************************  -->
-	<!-- 提示函  插入管理人账号  附件   上传-->
-	<insert id="insertTiShiHanOrUser" parameterType="java.util.Map">
-	     <!-- insert  into  t_user(user_id) VALUES (#{user_id}); -->
-	     insert  into  prompt_letter(prompt_letter_id) VALUES (#{prompt_letter_id})<!--还需要改动2017/12/20  -->
-	     
+	<!-- 提示函  插入管理人账号     -->
+	<insert id="insertTiShiHanOrUserOrOtherTable" parameterType="java.util.Map">
 	    <!--先注释有改动 -->
 	    <!--  insert into attachment (
 	                attachment_id,
@@ -94,7 +99,42 @@
 	               #{upload_person_id},
 	               #{create_time} ); -->
 	</insert>
-	<!-- 当经办支行进行账户开立上传的时候往(操作记录表)中插入一条数据 -->
+	<!--提示函上传 插入数据到提示函表  -->
+	<insert id="insertIntoPromptLetterTable" parameterType="java.util.Map">
+		insert into 
+		prompt_letter(prompt_letter_id,
+						   prompt_letter_name,
+				    	   send_person,
+						   receive_person,
+						   send_time,
+						   receive_time,
+						   hash) 
+			values(
+					#{prompt_letter_id},
+					#{prompt_letter_name},
+					#{send_person},
+					#{receive_person},  
+					#{send_time},
+					#{receive_time},
+					#{hash}
+					)
+	</insert>
+	<!-- 提示函上传  往附件表也插入数据信息 -->
+	<insert id="insertIntoAttachmentTable">
+		insert into 
+				attachment(attachment_id,
+					   attachment_name,
+						 url,
+					   upload_person_id,
+					   create_time) 
+			values(#{attachmentId},
+				   #{attachmentName},
+				   #{url},
+				   #{upload_person_id},
+				   #{create_time})
+	</insert> 
+	
+    <!-- 当经办支行进行账户开立上传的时候往(操作记录表)中插入一条数据    公用-->
 	<insert id="insertOperationHistory">
 		insert into 
 			operation_history(operator_type_id,
@@ -110,23 +150,34 @@
 			   #{operatorTime},
 			   #{hash})
 	</insert>
-	<!--根据管理人账号查询管理人名字 -->
+	
+	<!--根据id查询出来   管理人 关系到附件表的id 上传的时候有插入到附件表和操作记录表-->
 	<select id="selectTishihanById" parameterType="java.util.Map" resultType="com.fuzamei.entity.User">
-		select  person_name  from t_user where user_id=#{user_id};
+		select  y.person_name from t_user y, attachment f where  y.user_id=f.attachment_id
 	</select>
 	<!--**********************************************************************************************  -->
-	<!--查询风险提示函3 ,省分行托管中心风管岗  -->
+	<!--发送记录查询风险提示函 ,省分行托管中心风管岗   发送时间列biao-->
 	<select id="selectTishihan" parameterType="java.util.Map" resultType="com.fuzamei.entity.PromptLetter">
-		select  t.prompt_letter_id , y.person_name, t.prompt_letter_name ,t.receive_time from prompt_letter t,t_user y 
+	   select  
+	           t.prompt_letter_id , 
+	           y.person_name, 
+	           f.attachment_name,
+	           t.send_time 
+		from  
+		      prompt_letter t left join 
+              attachment f  
+          on  t.prompt_letter_id=f.attachment_id left join  t_user y
+		  on  t.send_person =user_id        
+	            
 		<where>
-		   t.send_person=y.user_id
 		    <if test="startTime!='' and endTime != ''">
-		    	and	receive_time  between #{startTime} and #{endTime}
+		    	and	send_time  between #{startTime} and #{endTime}
 		   </if>
 		</where>
-		      order by receive_time desc
+		      order by send_time desc
 	          limit #{startPage},#{rowNum}
 	</select>
+	
 	<!--***********************************************************************************************  -->
 	<!-- 真伪查询   上传服务器   附件表记录插入-->
 	<insert id="insertTrueFalseSelect" parameterType="java.util.Map">
@@ -185,8 +236,8 @@
 		               #{upload_person_id},
 		               #{create_time} )
 	</insert>
-<!-- *******************下面暂时没用上************************************************* -->
-<!-- <select id="">
+<!-- *******************代替上面的,用左链接************************************************* -->
+ <select id="queryAllAccountOpening" resultType="com.fuzamei.entity.AccountOpeningRecord">
 	select 
 			customer_id,
 			customer_name,
@@ -217,10 +268,31 @@
 			  and a.update_time  between #{startTime} and #{endTime}
 			</if>
 	 </where>
-	   order by update_time desc
-	   limit #{startPage},#{rowNum}
-</select>	 -->
-	
+	             order by update_time desc
+	            limit #{startPage},#{rowNum}
+</select>
+<!--账户开立 通过点击查看  供应下载页面  -->	
+<select id="selectAccountopenNoPage" parameterType="java.util.Map" resultType="com.fuzamei.entity.AccountOpeningRecord">
+	select 
+			customer_id,
+			customer_name,
+			bank_account,
+			f.attachment_name as basic_data_id,
+			f1.attachment_name as letter_of_commitment_id,
+			f2.attachment_name as application_id,
+			update_time,
+			f.url
+		from  
+			account_opening_record a
+			left  join  attachment f
+			on a.basic_data_id=f.attachment_id 
+	  	left  join	attachment f1
+	  	on	a.letter_of_commitment_id = f1.attachment_id 
+	  	left  join attachment f2
+	  	on	a.application_id= f2.attachment_id 
+
+		 where  customer_id=#{customer_id}
+</select>
 	
 	
 	

+ 9 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapper/AttachmentMapper.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fuzamei.mapperInterface.AttachmentMapper"> 
+	
+	<select id="queryIfHasTheSameAttachmentId" resultType="int">
+		select count(*) from attachment where attachment_id=#{attachmentId}
+	</select>
+	
+</mapper>

+ 1 - 1
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapper/BusinessDeclareMapper.xml

@@ -230,7 +230,7 @@
 			   #{task})
 	</insert>
 	
-	<!-- 将审核结果意见在插入审核表的同时,也将审核结果更新到业务申报表中去,根据业务id(business_id)定位到指定的业务 -->
+	<!-- 将审核结果意见在插入审核表的同时,也将审核结果更新到业务申报表中去,根据业务id(business_id)修改指定的业务 -->
 	<update id="updateBusinessDeclareStatus">
 		update 
 			business_declare

+ 22 - 13
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapper/CapitalTransferMapper.xml

@@ -79,7 +79,7 @@
   </select> -->
   
 <!--*************************************  -->
-    <!--查看  查询划转资金审核记录表  框框 --> 
+    <!--查看  查询(划转资金审核记录表)  框框 --> 
 	<select id="selectCapitalTransferRecord" parameterType="java.util.Map" resultType="com.fuzamei.entity.CapitalTransferCheck">
      select  sj.fund_id,
              sj.check_department,
@@ -118,11 +118,11 @@
 					   url,
 					   upload_person_id,
 					   create_time)
-		values(#{attachmentId},
-			   #{attachmentName},
+		values(#{attachment_id},
+			   #{attachment_name},
 			   #{url},
-			   #{userId},
-			   #{createTime})
+			   #{upload_person_id},
+			   #{create_time})
 	</insert>
     
     <!-- 当划转资金时  往操作记录表中插入一条数据 -->
@@ -134,22 +134,23 @@
 							  operator_person,
 							  operator_time,
 							  hash)
-		values(#{operatorTypeId},
-			   #{operatorAccount},
-			   #{operatorRole},
-			   #{operatorPerson},
-			   #{operatorTime},
+		values(#{operator_type_id},
+			   #{operator_account},
+			   #{operator_role},
+			   #{operator_person},
+			   #{operator_time},
 			   #{hash})
 	</insert>
     <!--**************************************  -->
-    <!--将审核意见插入到划转资金审核表里  -->
+    <!--将审核意见插入到(划转资金审核表)里  -->
     <insert id="insertCheckTransfer">
 	    insert into capital_transfer_check( fund_id,
 			          check_department,
 						   check_person,
 						   check_opinion,
 						   check_time,
-						   check_result,relation) 		
+						   check_result,
+						   relation) 		
 				values( #{fund_id},
 				       #{check_department},
 				       #{check_person},
@@ -158,7 +159,15 @@
 				       #{check_result},
 				       #{relation})
     </insert>
-    
+    <!-- 将划转审核结果意见在插入划转资金表的同时,也将审核结果更新到划转资金表中去,根据基金id  ->fund_id定位到指定的业务 -->
+	<update id="updatecapitaltransferStatus" parameterType="java.util.Map">
+		update 
+			capital_transfer
+		set
+			status_id=#{status_id}
+		where 
+			fund_id=#{fund_id}
+	</update>
    <!-- 资金划转*************///////////////////////////////////////////////////////// --> 
 
     

+ 47 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapper/OperationHistoryMapper.xml

@@ -43,4 +43,51 @@
 		select count(*) from operation_history
 	</select>
 	
+	<!-- 根据操作记录给的条件查询分页数据,但是还要根据用户的账号名来查询 -->
+	<select id="queryOperationHistoryInformationByUser" resultType="com.fuzamei.entity.OperationHistory">
+		select
+			temp.id,
+			temp.operator_type_id,
+			temp.operator_name,
+			temp.operator_account,
+			temp.operator_role,
+			temp.operator_person,
+			temp.operator_time,
+			temp.hash
+		from
+			(select 
+				oh.id,
+				oh.operator_type_id,
+				ot.operator_name,
+				oh.operator_account,
+				oh.operator_role,
+				oh.operator_person,
+				oh.operator_time,
+				oh.hash
+			from 
+				operation_history oh 
+			left join 
+				operation_type ot 
+			on 
+				oh.operator_type_id=ot.operator_type_id 
+			<where>
+				<if test="account!='' and account!=null">
+					oh.operator_account=#{account} 
+				</if>
+				<if test="role!='' and role!=null">
+					and oh.operator_role=#{role} 
+				</if>
+				<if test="type!='' and type!=null">
+					and ot.operator_name=#{type}
+				</if>
+				<if test="startTime!=null and endTime!=null">
+					and oh.operator_time between #{startTime} and #{endTime}
+				</if>
+			</where>
+			order by oh.id asc  
+			limit #{startPage},#{rowNum}) temp
+		where 
+			operator_account=#{Account}
+	</select>
+	
 </mapper>

+ 184 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapper/UserAuthoricationMapper.xml

@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fuzamei.mapperInterface.UserAuthoricationMapper"> 
+	
+	<!-- 根据用户的id号查询用户的角色信息 -->
+	<select id="queryUserRolenames" resultType="string">
+		select 
+			t_role.role_name
+		from 
+			(select 
+				user_role.role_id
+			from 
+				t_user 
+			left join 
+				user_role
+			on
+				t_user.user_id=user_role.user_id
+			where t_user.user_id=#{userId}) temp
+		left join 
+			t_role
+		on 
+			temp.role_id=t_role.role_id
+	</select>
+	
+	<!-- 根据用户的id号查询用户的权限信息 -->
+	<select id="queryUserPermissionNames" resultType="string">
+		select 
+			t_permission.authority_name
+		from 
+			(select 
+				role_permission.authority_id 
+			from 
+				(select 
+					t_role.role_id,
+					t_role.role_name
+				from 
+					(select 
+						user_role.role_id
+					from 
+						t_user 
+					left join 
+						user_role
+					on
+						t_user.user_id=user_role.user_id
+					where t_user.user_id=#{userId}) temp
+				left join 
+					t_role
+				on 
+					temp.role_id=t_role.role_id) temp 
+			left join 
+				role_permission
+			on 
+				temp.role_id=role_permission.role_id) temp 
+		left join 
+			t_permission
+		on 
+			temp.authority_id=t_permission.authority_id
+	</select>
+	
+	<!-- 根据用户的id号查询用户的账号名Account名 -->
+	<select id="queryUserAccount" resultType="string">
+		select account from t_user where user_id=#{userId};
+	</select>
+	
+	<!-- 查询出一个userId号下的用户所有详细信息包括基本信息,还有角色,权限信息 -->
+	<select id="queryUserDetailInformation" resultMap="UserDetailRM">
+		select 
+			temp.id,
+			temp.user_id,
+			temp.account,
+			temp.password,
+			temp.random,
+			temp.public_key,
+			temp.private_key,
+			temp.account_balance,
+			temp.drawing_account,
+			temp.create_time,
+			temp.update_time,
+			temp.organization_name,
+			temp.person_name,
+			temp.role_name,
+			t_permission.authority_name
+		from 
+			(select 
+				temp.id,
+				temp.user_id,
+				temp.account,
+				temp.password,
+				temp.random,
+				temp.public_key,
+				temp.private_key,
+				temp.account_balance,
+				temp.drawing_account,
+				temp.create_time,
+				temp.update_time,
+				temp.organization_name,
+				temp.person_name,
+				temp.role_id,
+				temp.role_name,
+				role_permission.authority_id
+			from
+				(select 
+					temp.id,
+					temp.user_id,
+					temp.account,
+					temp.password,
+					temp.random,
+					temp.public_key,
+					temp.private_key,
+					temp.account_balance,
+					temp.drawing_account,
+					temp.create_time,
+					temp.update_time,
+					temp.organization_name,
+					temp.person_name,
+					temp.role_id,
+					t_role.role_name
+				from 
+					(select 
+						temp.id,
+						temp.user_id,
+						temp.account,
+						temp.password,
+						temp.random,
+						temp.public_key,
+						temp.private_key,
+						temp.organization_name,
+						temp.person_name,
+						temp.account_balance,
+						temp.drawing_account,
+						temp.create_time,
+						temp.update_time,
+						user_role.role_id
+					from
+						(select 
+							id,
+							user_id,
+							account,
+							password,
+							random,
+							public_key,
+							private_key,
+							account_balance,
+							drawing_account,
+							create_time,
+							update_time,
+							organization_name,
+							person_name
+						from 
+							t_user
+						where 
+							user_id=#{userId}) temp 
+					left join 
+						user_role
+					on 
+						temp.user_id=user_role.user_id) temp 
+				left join 
+					t_role
+				on 
+					temp.role_id=t_role.role_id) temp 
+			left join
+				role_permission
+			on 
+				temp.role_id=role_permission.role_id) temp
+		left join 
+			t_permission
+		on 
+			temp.authority_id=t_permission.authority_id
+	</select>
+	<!-- 专门针对queryUserDetailInformation返回值结果用的 -->
+	<resultMap type="com.fuzamei.entity.UserDetail" id="UserDetailRM" autoMapping="true">
+		<id column="id" property="id"/>
+		<collection property="role_name" ofType="java.lang.String" javaType="java.util.ArrayList">
+			<constructor>
+				<arg column="role_name"/>
+			</constructor>
+		</collection>
+		<collection property="authority_name" ofType="java.lang.String" javaType="java.util.ArrayList">
+			<constructor>
+				<arg column="authority_name"/>
+			</constructor>
+		</collection>
+	</resultMap>
+</mapper>

+ 124 - 1
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapper/ValuationAccountingMapper.xml

@@ -56,7 +56,6 @@
 			temp.update_time asc
 		limit 
 			#{startPage},#{rowNum}
-		
 	</select>
 	
 	<!-- 管理岗上传管理人估值报表的时候插入的数据,分别插入valuation_accounting和attachment表,但是注意这个时候银行估值报表暂时不进行插入 -->
@@ -124,4 +123,128 @@
 			   #{hash})
 	</insert>
 	
+	<!-- 返回给下载提示框的数据 -->
+	<select id="checkoutDownloadInformation" resultType="com.fuzamei.entity.ValuationAccount">
+		select 
+			temp.fund_id,
+			temp.fund_name,
+			temp.assets_under_custody,
+			temp.attachment_name attachment_name_of_custodian,
+			att.attachment_name attachment_name_of_bank,
+			temp.url url_of_custodian,
+			att.url url_of_bank,
+		from
+			(select 
+				va.fund_id,
+				va.fund_name,
+				va.assets_under_custody,
+				att.attachment_name,
+				va.bank_valuation_id,
+				va.battle_result,
+				att.url,
+				va.update_time
+			 from 
+				valuation_accounting va
+			 left join 
+			 	attachment att
+			 on 
+			 va.custodian_valuation_id=att.attachment_id
+			 where 
+			 	va.fund_id=#{fundId}) temp 
+		left join 
+			attachment att
+		on 
+			temp.bank_valuation_id = att.attachment_id
+		order by 
+			temp.update_time asc
+	</select>
+	
+	<!-- 对是否有重复的fundId进行查询并返回重复结果 -->
+	<select id="queryIfHasTheSameFundId" resultType="int">
+		select count(*) from valuation_accounting where fund_id=#{fundId}
+	</select>
+
+	<!-- 对是否有重复的fundId进行查询并返回重复结果 -->
+	<select id="queryIfHasTheSameFundName" resultType="int">
+		select count(*) from valuation_accounting where fund_name=#{fundName}
+	</select>
+	
+	
+	
+	<!-- 对是否有存在基金数据进行查询并返回查询到的结果 -->
+	<select id="checkIfFundExists" resultType="com.fuzamei.entity.ValuationAccount">
+		select 
+			temp.fund_id,
+			temp.fund_name,
+			temp.assets_under_custody,
+			temp.custodian_valuation_id attachment_id_of_custodian,
+			temp.bank_valuation_id attachment_id_of_bank,
+			temp.attachment_name attachment_name_of_custodian,
+			att.attachment_name attachment_name_of_bank,
+			temp.url url_of_custodian,
+			att.url url_of_bank,
+			temp.update_time,
+			temp.battle_result
+		from
+			(select 
+				va.fund_id,
+				va.fund_name,
+				va.assets_under_custody,
+				att.attachment_name,
+				va.custodian_valuation_id,
+				va.bank_valuation_id,
+				va.battle_result,
+				att.url,
+				va.update_time
+			 from 
+				valuation_accounting va
+			 left join 
+			 	attachment att
+			 on 
+			 va.custodian_valuation_id=att.attachment_id) temp 
+		left join 
+			attachment att
+		on 
+			temp.bank_valuation_id = att.attachment_id
+		where
+			temp.fund_name=#{fundName} and temp.fund_id=#{fundId}
+	</select>
+	
+	<!-- 管理员再次上传估值文件时修改总表中的信息 -->
+	<update id="updateInformationByAdmin">
+		update
+			valuation_accounting
+		set 
+			update_time=#{updateTime},
+			battle_result=#{battleResult}
+		where 
+			fund_id=#{fundId}
+	</update>
+	
+	<!-- 管理人修改附件信息 -->
+	<update id="updateAttachmentInformationByAdmin">
+		update
+			attachment
+		set 
+			attachment_name=#{attachmentName},
+			url=#{url},
+			upload_person_id=#{userId},
+			create_time=#{addTime}
+		where 
+			attachment_id==#{attachmentId}
+	</update>
+	
+	<!-- 银行修改附件信息 -->
+	<update id="updateAttachmentInformationByBank">
+		update
+			attachment
+		set 
+			attachment_name=#{attachmentName},
+			url=#{url},
+			upload_person_id=#{userId},
+			create_time=#{addTime}
+		where 
+			attachment_id==#{attachmentId}
+	</update>
+	
 </mapper>

+ 15 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/AccountMaintenanceMapper.java

@@ -0,0 +1,15 @@
+package com.fuzamei.mapperInterface;
+
+import java.util.List;
+import java.util.Map;
+
+import com.fuzamei.entity.AccountOpeningRecord;
+
+public interface AccountMaintenanceMapper {
+	public  void  insertIntoAccountMaintenanceInfo(Map<String, Object> map);//添加上传(文件)账户维护信息表 
+	public  void  insertAccountMaintenanceInfoFuJianBiao(Map<String, Object> map);//账户维护开立 上传一份数据到附件表
+	public  void  insertAccountMaintenanceInfoOperationHistory(Map<String, Object> map);//当经办支行进行账户开立维护上传文件的时候往(操作记录表)也插入一条数据
+	public List<AccountOpeningRecord> selectAccountMaintenanceInfo(Map<String, Object> map);//查询账户开立信息维护列表
+	public  int selectCountAccountMaintenancePage();//查询账户维护开立信息总页数  返回一个int类型
+	
+}

+ 5 - 6
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/AccountOpenMapper.java

@@ -11,17 +11,16 @@ public interface AccountOpenMapper {
 	public List<AccountOpeningRecord> queryAllAccountOpening(Map<String, Object> map);//查询账户开立列表
 	public  int serchCountPage();//总页数
 	public  int serchCountPage2();//提示函总页数
+	public List<AccountOpeningRecord> selectAccountopenNoPage(Map<String, Object> map);//账户开立 通过点击查看  供应下载页面  
 	public List<PromptLetter> selectPromptLetter(Map<String, Object> map);//查询风险提示函列表
 	public void insertOperationHistory(Map<String, Object> map);//账户开立上传的时候也往操作记录表插入一条数据     多方法公用
-	public void insertTiShiHanOrUser(Map<String, Object> map);//插入管理人账号
-	//
+	public void insertTiShiHanOrUserOrOtherTable(Map<String, Object> map);//插入管理人账号 还要往附件表,提示函表,操作记录表里也要加数据
 	public List<PromptLetter> selectTishihan(Map<String, Object> map);//查询风险提示函3 ,省分行拓托管中心风管岗
 	public void insertTrueFalseSelect(Map<String, Object> map);//真伪查询   记录插入到附件表
 	public void insertAccountUploadFile(Map<String, Object> map);//<!-- 上传客户资料,承诺书,开户申请书    经办支行添加创建账号和客户名称 -->
 	public void insertAccountUploadFileFuJianBiao(Map<String, Object> map);//<!-- 上传客户资料,承诺书,开户申请书    经办支行添加创建账号和客户名称 -->上传到附件表
-	
-	
-	
-	
+	public void insertIntoPromptLetterTable(Map<String, Object> map);//数据往提示函插入
+	public void insertIntoAttachmentTable(Map<String, Object> map);//提示函数据在往附件表也插入
+	////////////////////////////////////////////////////////////////////////////////////////
 	
 }

+ 8 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/AttachmentMapper.java

@@ -0,0 +1,8 @@
+package com.fuzamei.mapperInterface;
+
+
+public interface AttachmentMapper {
+
+	int queryIfHasTheSameAttachmentId(Integer attachmentId);
+	
+}

+ 2 - 2
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/CapitalTransferMapper.java

@@ -15,7 +15,7 @@ public interface CapitalTransferMapper {
 	public  List<CapitalTransferCheck> selectCapitalTransferRecord(Map<String, Object> map);//资金划转 里审核记录   查看详情
 	//public  List<User> selectByPersonName(Map<String, Object> map);//临时测试用的
    
-	
-	
+	public void insertCheckTransfer(Map<String, Object> map);//将划转资金审核的意见插入导(划转资金审核表里)
+	public void updatecapitaltransferStatus(Map<String, Object> map);//将划转审核结果意见在插入划转资金表的同时,也将审核结果更新到划转资金表中去,根据基金id  ->fund_id修改指定的业务
 	
 }

+ 2 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/OperationHistoryMapper.java

@@ -10,4 +10,6 @@ public interface OperationHistoryMapper {
 	int findAllInformation();
 	
 	List<OperationHistory> queryOperationHistoryInformation(Map<String, Object> map);
+
+	List<OperationHistory> queryOperationHistoryInformationByUser(Map<String, Object> map);
 }

+ 18 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/UserAuthoricationMapper.java

@@ -0,0 +1,18 @@
+package com.fuzamei.mapperInterface;
+
+import java.util.List;
+
+import com.fuzamei.entity.UserDetail;
+
+public interface UserAuthoricationMapper {
+
+	List<String> queryUserRolenames(int userId);//根据用户的id号查询用户的角色信息
+
+	List<String> queryUserPermissionNames(int userId);//根据用户的id号查询用户的权限信息
+
+	String queryUserAccount(int userId);//根据用户的id号查询用户的账号名Account名
+
+	UserDetail queryUserDetailInformation(int userId);//根据用户的id号查询用户的账号所有信息
+	
+	
+}

+ 16 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/ValuationAccountingMapper.java

@@ -3,6 +3,8 @@ package com.fuzamei.mapperInterface;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.ibatis.annotations.Param;
+
 import com.fuzamei.entity.ValuationAccount;
 
 public interface ValuationAccountingMapper {
@@ -19,4 +21,18 @@ public interface ValuationAccountingMapper {
 
 	void insertInformationToAttachment(Map<String, Object> map);
 
+	List<ValuationAccount> checkoutDownloadInformation(int fundId);
+
+	int queryIfHasTheSameFundId(Integer fundId);
+
+	ValuationAccount checkIfFundExists(@Param("fundId") Integer fundId, @Param("fundName") String fundName);
+
+	void updateInformationByAdmin(Map<String, Object> map);
+
+	void updateAttachmentInformationByAdmin(Map<String, Object> map);
+
+	void updateAttachmentInformationByBank(Map<String, Object> map);
+
+	int queryIfHasTheSameFundName(String fundName);
+
 }

+ 226 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/service/AccountMaintenanceService.java

@@ -0,0 +1,226 @@
+package com.fuzamei.service;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.fuzamei.dao.AccountMaintenanceDao;
+import com.fuzamei.entity.AccountOpeningRecord;
+import com.fuzamei.utils.PageDTO;
+
+@Service
+public class AccountMaintenanceService {
+   @Autowired
+   private AccountMaintenanceDao  accountMaintenanceDao;
+   private static final int ROW_NUM = 10; // 分页每页显示数据的数量
+    @Transactional
+	public void insertIntoAccountINfo(Map<String, Object> map) {
+		String customer_id="";   //ID   暂时注释
+		String customer_name="";//客户名称
+		String bank_account="";//银行账号
+		String hash="";//上传三个文件  应该产生几个hash值??????
+	
+		//省略几个直接put进去
+		String basicAttachment_id="";    //基本资料附件id
+		String basicAttachment_name="";  //基本资料附件名称
+		String basicUrl="";              //基本资料附件url
+		String basicUpload_person_id=""; //基本资料附件上传人的id
+	    long basicCreate_time=0;      //基本资料附件添加的时间
+		
+	    String  letterAttachment_id="";    //承诺书附件id
+		String letterAttachment_name="";  //承诺书附件名称
+		String letterUrl="";              //承诺书附件url
+		String letterUpload_person_id=""; //承诺书附件上传人的id
+	    long letterCreate_time=0;      //承诺书附件添加的时间
+	    
+	    String applicationAttachment_id="";    //开户申请书附件id
+		String applicationAttachment_name="";  //开户申请书附件名称
+		String applicationUrl="";              //开户申请书附件url
+		String applicationUpload_person_id=""; //开户申请书附件上传人的id
+	    long applicationCreate_time=0;      //开户申请书附件添加的时间
+	
+	    if (!"".equals(map.get("customer_id")) && map.get("customer_id") != null) { 
+	    	customer_id = String.valueOf(map.get("customer_id"));
+		}
+		if (!"".equals(map.get("customer_name")) && map.get("customer_name") != null) { 
+			customer_name = (String) map.get("customer_name");
+		}
+		if (!"".equals(map.get("bank_account")) && map.get("bank_account") != null) { 
+			bank_account = (String) map.get("bank_account");
+		}
+		
+		if (!"".equals(map.get("basicAttachment_id")) && map.get("basicAttachment_id") != null) { 
+			basicAttachment_id = String.valueOf(map.get("basicAttachment_id"));
+		}
+		if (!"".equals(map.get("basicAttachment_name")) && map.get("basicAttachment_name") != null) { 
+			basicAttachment_name = (String) map.get("basicAttachment_name");
+		}
+		if (!"".equals(map.get("basicUrl")) && map.get("basicUrl") != null) { 
+			basicUrl = (String) map.get("basicUrl");
+		}
+		if (!"".equals(map.get("basicUpload_person_id")) && map.get("basicUpload_person_id") != null) { 
+			basicUpload_person_id = (String) map.get("basicUpload_person_id");
+		}
+		if (!"".equals(map.get("basicCreate_time")) && map.get("basicCreate_time") != null) { 
+			basicCreate_time = (Long) map.get("basicCreate_time");
+		}
+		
+		if (!"".equals(map.get("letterAttachment_id")) && map.get("letterAttachment_id") != null) { 
+			letterAttachment_id =  String.valueOf(map.get("letterAttachment_id"));
+		}
+		if (!"".equals(map.get("letterAttachment_name")) && map.get("letterAttachment_name") != null) { 
+			letterAttachment_name = (String) map.get("letterAttachment_name");
+		}
+		if (!"".equals(map.get("letterUrl")) && map.get("letterUrl") != null) { 
+			letterUrl = (String) map.get("letterUrl");
+		}
+		if (!"".equals(map.get("letterUpload_person_id")) && map.get("letterUpload_person_id") != null) { 
+			letterUpload_person_id = (String) map.get("letterUpload_person_id");
+		}
+		if (!"".equals(map.get("letterCreate_time")) && map.get("letterCreate_time") != null) { 
+			letterCreate_time = (Long) map.get("letterCreate_time");
+		}
+		
+		if (!"".equals(map.get("applicationAttachment_id")) && map.get("applicationAttachment_id") != null) { 
+			applicationAttachment_id = String.valueOf(map.get("applicationAttachment_id"));
+		}
+		if (!"".equals(map.get("applicationAttachment_name")) && map.get("applicationAttachment_name") != null) { 
+			applicationAttachment_name = (String) map.get("applicationAttachment_name");
+		}
+		if (!"".equals(map.get("applicationUrl")) && map.get("applicationUrl") != null) { 
+			applicationUrl = (String) map.get("applicationUrl");
+		}
+		if (!"".equals(map.get("applicationUpload_person_id")) && map.get("applicationUpload_person_id") != null) { 
+			applicationUpload_person_id = (String) map.get("applicationUpload_person_id");
+		}
+		if (!"".equals(map.get("applicationCreate_time")) && map.get("applicationCreate_time") != null) { 
+			applicationCreate_time = (Long) map.get("applicationCreate_time");
+		}
+		
+		 SimpleDateFormat df = new SimpleDateFormat("yyyyMMHHmmss");
+		    String ss=  df.format(new Date());
+	    
+		    Map<String, Object> mapToDao = new LinkedHashMap<String, Object>();
+			  mapToDao.put("customer_id", "201712"+Math.round(Math.random()*8999+100));//ID先写成随机数   到时候不行在改
+			  mapToDao.put("customer_name",customer_name );
+			  mapToDao.put("bank_account","622707"+ss);//银行帐号 产生不能一样    这里是用Date时间做账号   18位数     //直接put进来  Action  可以不要
+			  mapToDao.put("basicAttachment_id", basicAttachment_id);//基本资料id
+			  mapToDao.put("letterAttachment_id", letterAttachment_id);//承诺书id    
+			  mapToDao.put("applicationAttachment_id", applicationAttachment_id);//申请书id
+			  mapToDao.put("update_time",  System.currentTimeMillis());//更新时间
+			  mapToDao.put("status_id",  9);//状态写的是死值    9状态代表已完成  刚注册的用户账号就能使用  
+			  mapToDao.put("hash","ccccccc");//哈希值暂时写的是个字符串死值
+			      accountMaintenanceDao.insertIntoAccountMaintenanceInfo(mapToDao);
+	    
+			  
+			  Map<String, Object> mapToDaoBasic = new LinkedHashMap<String, Object>();  
+				  mapToDaoBasic.put("attachment_id", basicAttachment_id);
+				  mapToDaoBasic.put("attachment_name", basicAttachment_name);
+				  mapToDaoBasic.put("url", basicUrl);  
+				  mapToDaoBasic.put("upload_person_id", 10085);//写的是死值  到时候在改    先将上传人的id号写死,到时候需要动态获取这个信息
+				  mapToDaoBasic.put("create_time", mapToDao.get("update_time"));
+				  accountMaintenanceDao.insertAccountMaintenanceInfoFuJianBiao(mapToDaoBasic);//上传其他凭证      到附件表
+			
+			 
+			 Map<String, Object> mapToDaoLetter = new LinkedHashMap<String, Object>();  
+				 mapToDaoLetter.put("attachment_id", letterAttachment_id);
+				 mapToDaoLetter.put("attachment_name", letterAttachment_name);
+				 mapToDaoLetter.put("url", letterUrl);
+				 mapToDaoLetter.put("upload_person_id", 10085);//写的是死值   到时候在改     待改动  先将上传人的id号写死,到时候需要动态获取这个信息
+				 mapToDaoLetter.put("create_time", mapToDao.get("update_time"));
+				 accountMaintenanceDao.insertAccountMaintenanceInfoFuJianBiao(mapToDaoLetter);//上传承诺书的       到附件表
+			   
+			 Map<String, Object> mapToDaoApplication = new LinkedHashMap<String, Object>();  
+				 mapToDaoApplication.put("attachment_id", applicationAttachment_id);
+				 mapToDaoApplication.put("attachment_name", applicationAttachment_name);
+				 mapToDaoApplication.put("url", applicationUrl);
+				 mapToDaoApplication.put("upload_person_id", 10085);//写的是死值    到时候在改  ??    待改动  先将上传人的id号写死,到时候需要动态获取这个信息
+				 mapToDaoApplication.put("create_time", mapToDao.get("update_time"));
+				 accountMaintenanceDao.insertAccountMaintenanceInfoFuJianBiao(mapToDaoApplication);//上传开户申请书的       到附件表
+			     
+			//还要将账户开立添加上传的这个操作信息插入到操作记录表中
+			Map<String, Object> mapToOperationHistory = new LinkedHashMap<String,Object>();
+				mapToOperationHistory.put("operatorTypeId", 1001);						//
+				mapToOperationHistory.put("operatorAccount", 500000255);				//操作账号先定死
+				mapToOperationHistory.put("operatorRole", "经办支行");						//创建这个操作的角色只能是经办支行
+				mapToOperationHistory.put("operatorPerson", "张五");						//操作人先写死
+				mapToOperationHistory.put("operatorTime", mapToDao.get("update_time")); //操作时间为当前操作时间
+				mapToOperationHistory.put("hash", "操作hash值");	                       //写的时死值
+				accountMaintenanceDao.insertAccountMaintenanceInfoOperationHistory(mapToOperationHistory);           //将账户开立添加上传的操作记录信息插入到操作记录表中     
+	}
+    
+    public  PageDTO selectAccountMaintenanceInfo(Map<String,Object> map) {
+    	int page = 1; // 默认页是第一页
+		String customer_name = ""; // 
+		String bank_account = ""; // 
+		long startTime = 0; // 开始时间默认0
+		long endTime = Long.MAX_VALUE; // 结束时间默认Long最大值
+		if (!"".equals(map.get("page")) && map.get("page") != null) { // 等于空就直接取第一页
+			try {
+				page = Integer.parseInt((String) map.get("page"));
+				if (page < 1) {
+					page = 1;
+				}
+			} catch (NumberFormatException e) {
+				page = 1; // 数据解析异常page还是1
+			}
+		}
+		if (!"".equals(map.get("customer_name")) && map.get("customer_name") != null) { // 等于空就直接取空值
+			customer_name = (String) map.get("customer_name");
+		}
+		if (!"".equals(map.get("bank_account")) && map.get("bank_account") != null) { // 等于空就直接取空值
+			bank_account = (String) map.get("bank_account");
+		}
+		if (!"".equals(map.get("startTime")) && map.get("startTime") != null) { // 等于空就直接取空值
+			try {
+				startTime = Long.parseLong((String) map.get("startTime"));
+			} catch (NumberFormatException e) {
+				startTime = 0; // 数据解析异常startTime还是0
+			}
+		}
+		if (!"".equals(map.get("endTime")) && map.get("endTime") != null) { // 等于空就直接取空值
+			try {
+				endTime = Long.parseLong((String) map.get("endTime"));
+			} catch (NumberFormatException e) {
+				endTime = Long.MAX_VALUE; // 数据解析异常endTime还是9223372036854775807L
+			}
+		}
+		PageDTO pageDto = new PageDTO(); // 创建分页对象
+		Map<String, Object> mapToDao = new LinkedHashMap<String, Object>();
+		mapToDao.put("startPage", (page - 1) * ROW_NUM);
+		mapToDao.put("customer_name", customer_name);
+		mapToDao.put("bank_account", bank_account);
+		if (startTime <= endTime) {
+			mapToDao.put("startTime", startTime);
+			mapToDao.put("endTime", endTime);
+		} else {
+			mapToDao.put("startTime", startTime);
+			mapToDao.put("endTime", Long.MAX_VALUE);
+		}
+		mapToDao.put("rowNum", ROW_NUM); // 默认每页显示数据是10条,可根据需求修改分页数量
+
+		int count = accountMaintenanceDao.selectCountAccountMaintenancePage();
+		List<AccountOpeningRecord> list=accountMaintenanceDao.selectAccountMaintenanceInfo(mapToDao);
+		pageDto.setTotal(count);
+		pageDto.setRows(list);
+		return pageDto;
+	
+    }
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+
+}

+ 107 - 61
ccb_fund_trusteeship/src/main/java/com/fuzamei/service/AccountOpenService.java

@@ -9,11 +9,16 @@ import java.util.Map;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.StringUtils;
 
 import com.fuzamei.dao.AccountOpenDao;
+import com.fuzamei.dao.UserAuthoricationDao;
 import com.fuzamei.entity.AccountOpeningRecord;
+import com.fuzamei.entity.ProjectFile;
 import com.fuzamei.entity.PromptLetter;
 import com.fuzamei.entity.User;
+import com.fuzamei.entity.UserDetail;
+import com.fuzamei.utils.HashXiZhiUtil;
 import com.fuzamei.utils.PageDTO;
 
 
@@ -21,8 +26,14 @@ import com.fuzamei.utils.PageDTO;
 public class AccountOpenService {
 	@Autowired
    private AccountOpenDao  accountOpenDao;
+
 	private static final int ROW_NUM = 10; // 分页每页显示数据的数量
-    public PageDTO queryAllAccountOpening(Map<String, Object> map) {//查询账户开立表
+	/**
+	 * 账户开立列
+	 * @param map
+	 * @return
+	 */
+     public PageDTO queryAllAccountOpening(Map<String, Object> map) {//查询账户开立表
     	int page = 1; // 默认页是第一页
 		String customer_name = ""; // 
 		String bank_account = ""; // 
@@ -38,6 +49,7 @@ public class AccountOpenService {
 				page = 1; // 数据解析异常page还是1
 			}
 		}
+
 		if (!"".equals(map.get("customer_name")) && map.get("customer_name") != null) { // 等于空就直接取空值
 			customer_name = (String) map.get("customer_name");
 		}
@@ -72,23 +84,26 @@ public class AccountOpenService {
 		}
 		mapToDao.put("rowNum", ROW_NUM); // 默认每页显示数据是10条,可根据需求修改分页数量
 
-
 		int count = accountOpenDao.serchCountPage();
 		List<AccountOpeningRecord> list=accountOpenDao.queryAllAccountOpening(mapToDao);
 		pageDto.setTotal(count);
 		pageDto.setRows(list);
 		return pageDto;
 	}
+     
+	
     ////////////////////////////////////////////////////////////
 	/**
-	 * 提示函  管理人
+	 * 提示函  管理人接收列
 	 * @param map
 	 * @return
 	 */
     public PageDTO selectPromptLetter(Map<String, Object> map){//查询风险提示函
 		int page = 1; // 默认页是第一页
+		
 		long startTime = 0; // 开始时间默认0
 		long endTime = Long.MAX_VALUE; // 结束时间默认Long最大值
+		
 		if (!"".equals(map.get("page")) && map.get("page") != null) { // 等于空就直接取第一页
 			try {
 				page = Integer.parseInt((String) map.get("page"));
@@ -136,7 +151,7 @@ public class AccountOpenService {
 	}
    //////////////////////////////////////////////////////////////////////////////
    /**
-    * 提示函  风管岗查询
+    * 提示函  风管岗发送列表查询
     * @param map
     * @return
     */
@@ -154,7 +169,6 @@ public class AccountOpenService {
 				page = 1; // 数据解析异常page还是1
 			}
 		}
-	
 		if (!"".equals(map.get("startTime")) && map.get("startTime") != null) { // 等于空就直接取空值
 			try {
 				startTime = Long.parseLong((String) map.get("startTime"));
@@ -195,54 +209,71 @@ public class AccountOpenService {
      * @param map
      */
 	@Transactional
-	public void insertTiShiHanOrUser(Map<String, Object> map) {//只上传了id到数据库   待修改哦
-	    String   prompt_letter_id="";  // 提示函id
-	   
+	public void insertTiShiHanOrUserOrOtherTable(Map<String, Object> map) {
+	    Integer prompt_letter_id=null;
+	    String prompt_letter_name="";
+	    Integer  send_person=null;
+	    Integer receive_person=null;
+	    long send_time=0;
+	    long receive_time=0;
+	    String hash="";
 	    
-	    String attachment_id="";    //附件id
-	    String attachment_name="";  //附件名称
-	    String url="";              //附件url
-	    String upload_person_id=""; //附件上传人的id
-	    long create_time=0;      //附件添加的时间
+		String url="";					//url路径名称
+		String attachmentName="";		//附件名称
 	    
-		if (!"".equals(map.get("prompt_letter_id")) && map.get("prompt_letter_id") != null) { 
-			prompt_letter_id = (String) map.get("prompt_letter_id");
+		 if (!"".equals(map.get("url")) && map.get("url") != null) { 
+			 url = (String) map.get("url");
+			}
+	    if (!"".equals(map.get("attachmentName")) && map.get("attachmentName") != null) { 
+	    	attachmentName = (String) map.get("attachmentName");
 		}
-		if (!"".equals(map.get("attachment_id")) && map.get("attachment_id") != null) { 
-			attachment_id = (String) map.get("attachment_id");
+	    if (!"".equals(map.get("prompt_letter_id")) && map.get("prompt_letter_id") != null) { 
+	    	prompt_letter_id = Integer.parseInt((String) map.get("prompt_letter_id"));
 		}
-		if (!"".equals(map.get("attachment_name")) && map.get("attachment_name") != null) { 
-			attachment_name = (String) map.get("attachment_name");
+	    if (!"".equals(map.get("prompt_letter_name")) && map.get("prompt_letter_name") != null) { 
+	    	prompt_letter_name = (String) map.get("prompt_letter_name");
 		}
-		if (!"".equals(map.get("url")) && map.get("url") != null) { 
-			url = (String) map.get("url");
+	    if (!"".equals(map.get("send_person")) && map.get("send_person") != null) { 
+	    	send_person = Integer.parseInt((String) map.get("send_person"));
 		}
-		if (!"".equals(map.get("upload_person_id")) && map.get("upload_person_id") != null) {   
-			upload_person_id = (String) map.get("upload_person_id");
+	    if (!"".equals(map.get("receive_person")) && map.get("receive_person") != null) { 
+	    	receive_person = Integer.parseInt((String) map.get("receive_person"));
 		}
-		if (!"".equals(map.get("create_time")) && map.get("create_time") != null) { 
-			create_time = (Long) map.get("create_time");
+	    if (!"".equals(map.get("receive_time")) && map.get("receive_time") != null) { 
+	    	receive_time = (Long) map.get("receive_time");
+		}
+	    if (!"".equals(map.get("send_time")) && map.get("send_time") != null) { 
+	    	send_time = (Long) map.get("send_time");
 		}
+	    if (!"".equals(map.get("hash")) && map.get("hash") != null) { 
+	    	hash = (String) map.get("hash");
+		}
+	    	//Math.round(Math.random()*8999+1000)随机数
 		 Map<String, Object> mapToDao2 = new LinkedHashMap<String, Object>();
-		  mapToDao2.put("prompt_letter_id", prompt_letter_id);//提示函id
-		  //mapToDao.put("hash","1a2b3c4d5e");//先注视
-		  accountOpenDao.insertTiShiHanOrUser(mapToDao2);//将数据添加到提示函数据库里
+		  mapToDao2.put("prompt_letter_id", prompt_letter_id);//提示函 id
+		  mapToDao2.put("prompt_letter_name",attachmentName);//提示函名称    目前写的是文件名称   
+		  mapToDao2.put("send_person",666);//发送人暂时写死的  ??  是不是应该获取登陆人的id???? 
+		  mapToDao2.put("receive_person",999);//接收人应该是?? ??? 接收人写哪个  不是很清楚// 产品说写死 ,目前就往一个人那里发函上传文件
+		  mapToDao2.put("send_time",System.currentTimeMillis());//发送时间 
+		  mapToDao2.put("receive_time", System.currentTimeMillis());//接收时间
+		  mapToDao2.put("hash",hash);//hash值可以插入了
+		  accountOpenDao.insertIntoPromptLetterTable(mapToDao2);//将账号插入提示函表
 		  
 		  Map<String, Object> mapToDao = new LinkedHashMap<String, Object>();
-		  mapToDao.put("attachment_id", 110120119);//附件id   目前写死
-		  mapToDao.put("attachment_name", attachment_name);//附件名称    暂时没写
+		  mapToDao.put("attachmentId",prompt_letter_id);//附件id   目前写的是上面输入的管理人账号一样
+		  mapToDao.put("attachmentName",attachmentName );//附件名称  拿到了
 		  mapToDao.put("url", url);//附件url   后面有下载的   需要地址
-		  mapToDao.put("upload_person_id", 111222333);//附件人上传的id这里写的是死值
-		  mapToDao.put("create_time", System.currentTimeMillis());//附件添加时间,这里应该写添加得到的当前系统时间  目前写的是死值
-		  accountOpenDao.insertAccountUploadFileFuJianBiao(mapToDao);//将数据添加到附件表数据库里
-			
+		  mapToDao.put("upload_person_id", 10121);//附件人上传的id这里写的是死值   待改动  先将上传人的id号写死,到时候需要动态获取这个信息   应该写谁这个附件上传人id
+		  mapToDao.put("create_time", (Long)mapToDao2.get("send_time") );//附件添加时间,这里应该写发送时间  目前写的是死值//System.currentTimeMillis()
+		  accountOpenDao.insertIntoAttachmentTable(mapToDao);//将数据添加到附件表数据库里
+		  
 		  Map<String, Object> mapToOperation = new LinkedHashMap<String,Object>();
-			mapToOperation.put("operatorTypeId", 1001);						//写死目前
-			mapToOperation.put("operatorAccount", 500000266);				//操作账号先定死
-			mapToOperation.put("operatorRole", "经办支行5");						//创建这个操作的角色  目前是写死
-			mapToOperation.put("operatorPerson", "张三3");						//操作人先写死
-			mapToOperation.put("operatorTime", mapToDao.get("create_time")); //操作时间为当前操作时间
-			mapToOperation.put("hash", "222a2s3d4f5g");	                    //写的时死值
+			mapToOperation.put("operatorTypeId", 1009);						//写死目前
+			mapToOperation.put("operatorAccount", 60000289);				//操作账号先定死
+			mapToOperation.put("operatorRole", "经办支行9");						//创建这个操作的角色  目前是写死
+			mapToOperation.put("operatorPerson", "操作人小王");						//操作人先写死
+			mapToOperation.put("operatorTime",(Long)mapToDao2.get("send_time")); //操作时间为当前操作时间
+			mapToOperation.put("hash", hash);//这里的哈希值和上面插入提示函的哈希值一样	                    //写的时死值
 			accountOpenDao.insertOperationHistory(mapToOperation);           //将提示函泛函添加上传的操作记录信息插入到操作记录表中     
 	}
 	
@@ -275,13 +306,22 @@ public class AccountOpenService {
 		}
 	    
 		Map<String, Object> mapToDao = new LinkedHashMap<String, Object>();
-		  mapToDao.put("attachment_id", 123456789);//附件id   目前写死
+		  mapToDao.put("attachment_id", 123456);//附件id  目前写死
 		  mapToDao.put("attachment_name", attachment_name);//附件名称    暂时没写
 		  mapToDao.put("url", url);//附件url   后面有下载的   需要地址
-		  mapToDao.put("upload_person_id", 223344);//附件人上传的id这里写的是死值
+		  mapToDao.put("upload_person_id", 223346);//附件人上传的id这里写的是死值   待修改
 		  mapToDao.put("create_time", System.currentTimeMillis());//附件添加时间,这里应该写添加得到的当前系统时间  
-		  accountOpenDao.insertTrueFalseSelect(mapToDao);//把数据插入到附件表里
-		
+		  accountOpenDao.insertAccountUploadFileFuJianBiao(mapToDao);//把数据插入到 (附件表)里
+		  
+		//还要将真伪查询上传的这个操作信息插入到操作记录表中
+		Map<String, Object> mapToOperationHistory = new LinkedHashMap<String,Object>();
+			mapToOperationHistory.put("operatorTypeId", 1002);						//id应该是写死的目前
+			mapToOperationHistory.put("operatorAccount", 600000289);				//操作账号先定死,到时候再改
+			mapToOperationHistory.put("operatorRole", "经办支行8");					//创建这个操作的角色只能是经办支行
+			mapToOperationHistory.put("operatorPerson", "张八");						//操作人先写死
+			mapToOperationHistory.put("operatorTime", mapToDao.get("create_time")); //操作时间为当前操作时间
+			mapToOperationHistory.put("hash", "re43h333a2s3d4f5gj");	                //写的时死值
+			accountOpenDao.insertOperationHistory(mapToOperationHistory);           //将账户开立添加上传的操作记录信息插入到操作记录表中     
 	
 	}
 	
@@ -296,8 +336,6 @@ public class AccountOpenService {
 		String bank_account="";//银行账号
 		
 		//省略几个直接put进去
-		
-		 
 		String basicAttachment_id="";    //基本资料附件id
 		String basicAttachment_name="";  //基本资料附件名称
 		String basicUrl="";              //基本资料附件url
@@ -387,10 +425,10 @@ public class AccountOpenService {
 			  mapToDao.put("customer_name",customer_name );
 			  mapToDao.put("bank_account","6223"+ss);//银行帐号 产生不能一样    这里是用Date时间做账号   18位数     //直接put进来  Action  可以不要
 			  mapToDao.put("basicAttachment_id", basicAttachment_id);//基本资料id
-			  mapToDao.put("letterAttachment_id", letterAttachment_id);//承诺书id   这三个id为空  
+			  mapToDao.put("letterAttachment_id", letterAttachment_id);//承诺书id    
 			  mapToDao.put("applicationAttachment_id", applicationAttachment_id);//申请书id
 			  mapToDao.put("update_time",  System.currentTimeMillis());//更新时间
-			  mapToDao.put("status_id",  9);//状态写的是死值    9状态代表已完成
+			  mapToDao.put("status_id",  9);//状态写的是死值    9状态代表已完成  刚注册的用户账号就能使用  
 			  mapToDao.put("hash","1aaa2bbb3ccc");//哈希值暂时写的是个字符串死值
 			  accountOpenDao.insertAccountUploadFile(mapToDao);//把数据插入到开户表里
 			  
@@ -398,7 +436,7 @@ public class AccountOpenService {
 			  mapToDaoBasic.put("attachment_id", basicAttachment_id);
 			  mapToDaoBasic.put("attachment_name", basicAttachment_name);
 			  mapToDaoBasic.put("url", basicUrl);  
-			  mapToDaoBasic.put("upload_person_id", 10085);//写的是死值  到时候在改
+			  mapToDaoBasic.put("upload_person_id", 10085);//写的是死值  到时候在改    先将上传人的id号写死,到时候需要动态获取这个信息
 			  mapToDaoBasic.put("create_time", mapToDao.get("update_time"));
 			  accountOpenDao.insertAccountUploadFileFuJianBiao(mapToDaoBasic);//上传基本资料的      到附件表
 		
@@ -407,7 +445,7 @@ public class AccountOpenService {
 			 mapToDaoLetter.put("attachment_id", letterAttachment_id);
 			 mapToDaoLetter.put("attachment_name", letterAttachment_name);
 			 mapToDaoLetter.put("url", letterUrl);
-			 mapToDaoLetter.put("upload_person_id", 10086);//写的是死值   到时候在改
+			 mapToDaoLetter.put("upload_person_id", 10085);//写的是死值   到时候在改     待改动  先将上传人的id号写死,到时候需要动态获取这个信息
 			 mapToDaoLetter.put("create_time", mapToDao.get("update_time"));
 		     accountOpenDao.insertAccountUploadFileFuJianBiao(mapToDaoLetter);//上传承诺书的       到附件表
 		   
@@ -415,7 +453,7 @@ public class AccountOpenService {
 			 mapToDaoApplication.put("attachment_id", applicationAttachment_id);
 			 mapToDaoApplication.put("attachment_name", applicationAttachment_name);
 			 mapToDaoApplication.put("url", applicationUrl);
-			 mapToDaoApplication.put("upload_person_id", 10087);//写的是死值    到时候在改
+			 mapToDaoApplication.put("upload_person_id", 10085);//写的是死值    到时候在改  ??    待改动  先将上传人的id号写死,到时候需要动态获取这个信息
 			 mapToDaoApplication.put("create_time", mapToDao.get("update_time"));
 		     accountOpenDao.insertAccountUploadFileFuJianBiao(mapToDaoApplication);//上传开户申请书的       到附件表
 		     
@@ -426,17 +464,25 @@ public class AccountOpenService {
 			mapToOperationHistory.put("operatorRole", "经办支行");						//创建这个操作的角色只能是经办支行
 			mapToOperationHistory.put("operatorPerson", "张五");						//操作人先写死
 			mapToOperationHistory.put("operatorTime", mapToDao.get("update_time")); //操作时间为当前操作时间
-			mapToOperationHistory.put("hash", "11a2s3d4f5g");	                    //写的时死值
+			mapToOperationHistory.put("hash", "操作hash");	                       //写的时死值
 			accountOpenDao.insertOperationHistory(mapToOperationHistory);           //将账户开立添加上传的操作记录信息插入到操作记录表中     
 		     
 		   
 	}
-	
-	
-	
-	
-	
-	
-	
-	
-}
+	//账户开立  下载页面
+	public Map<String, Object> selectAccountopenNoPage(Map<String, Object> map){
+			Integer customer_id=null;   //ID
+			
+		   if(!"".equals(map.get("customer_id")) && null!=map.get("customer_id")){
+				customer_id = Integer.parseInt((String)map.get("customer_id"));
+			}
+			Map<String, Object> mapToDao = new LinkedHashMap<String, Object>();
+			 mapToDao.put("customer_id", customer_id);
+			 List<AccountOpeningRecord> AccountOpenlist=accountOpenDao.selectAccountopenNoPage(mapToDao);
+			 Map<String, Object> AccountOpenAction = new LinkedHashMap<String, Object>();
+			 AccountOpenAction.put("customer_id", customer_id);
+			 AccountOpenAction.put("AccountOpenlist", AccountOpenlist);
+	        
+			 return AccountOpenAction;
+   }
+}

+ 27 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/service/AttachmentService.java

@@ -0,0 +1,27 @@
+package com.fuzamei.service;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.fuzamei.dao.AttachmentDao;
+
+@Service
+public class AttachmentService {
+	
+	@Autowired
+	private AttachmentDao attachmentDao;
+	
+	public int generateAtachmentId(){
+		int same = -1;
+		Integer attachmentId = null;
+		//如果有重复的继续查,直到查不出重复的fundId号为止
+		while(same != 0){
+			attachmentId=(int)(Math.random()*1000000000);								//=========================>>>产生附件id号的机制要改的TODO
+			same = attachmentDao.queryIfHasTheSameAttachmentId(attachmentId);
+		}
+		return attachmentId;
+	}
+}

+ 46 - 13
ccb_fund_trusteeship/src/main/java/com/fuzamei/service/CapitalTransferService.java

@@ -7,6 +7,7 @@ import java.util.Map;
 import org.apache.poi.util.StringUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 
 import com.fuzamei.dao.CapitalTransferDao;
@@ -89,27 +90,59 @@ public class CapitalTransferService {
 	}
 	//资金划转   点击查看 详情
 	public Map<String, Object>  selectChaKanZiJinHuaZhuan(Map<String, Object> map){
-		int fund_id=0;
-		//int user_id=0;
-		if (!"".equals(map.get("fund_id")) && map.get("fund_id") != null) { 
+		 int fund_id=0;
+		 if (!"".equals(map.get("fund_id")) && map.get("fund_id") != null) { 
 			fund_id =  Integer.parseInt((String)map.get("fund_id"));
-		}
-		/*if (!"".equals(map.get("user_id")) && map.get("user_id") != null) { 
-			user_id =  Integer.parseInt((String)map.get("user_id"));
-		}*/
-		
-		
+		 }
 		 Map<String, Object> mapToDao = new LinkedHashMap<String, Object>();
 		  mapToDao.put("fund_id", fund_id);//附件名称    暂时没写
-		  //mapToDao.put("user_id", user_id);
 		  List<CapitalTransfer> list=capitalTransferDao.selectChaKanZiJinHuaZhuan(mapToDao);
 		  List<CapitalTransferCheck> lis= capitalTransferDao.selectCapitalTransferRecord(mapToDao);
-		  //List<User> user=capitalTransferDao.selectByPersonName(mapToDao);
 		  Map<String, Object> map1=new LinkedHashMap<String, Object>();
-		  map1.put("CapitalTransfer", list);//管理人取不到值  稍做修改 persont_name
+		  map1.put("CapitalTransfer", list);//管理人persont_name取不到值  稍做修改 
 		  map1.put("CapitalTransferCheck", lis);
-		 // map1.put("user", user); 
 		return map1;
 	}
 	
+	/**
+	 * 将审核意见插入到审核表
+	 * @param map
+	 */
+	@Transactional
+	public void insertCheckTransfer(Map<String, Object> map) {
+		String check_department="";		//审核部门
+		String check_person="";			//审核人
+		Integer check_result=null;			//审核结果
+		String check_opinion="";			//审核意见
+	
+		Integer fund_id=null;			//划转资金的id号,要根据这个更新划转资金审核的状态的
+		Integer status_id=null;			//划转资金表的状态id号,这个要根据check_result审核结果来判断状态哦
+		
+		Integer operatorTypeId=null;     ////把操作类型id号-*放到操作记录表中去的
+		
+		if (!"".equals(map.get("check_department")) && map.get("check_department") != null) { 
+			check_department = (String)map.get("check_department");
+		}
+		if (!"".equals(map.get("check_person")) && map.get("check_person") != null) { 
+				check_person = (String)map.get("check_person");
+		}
+		if (!"".equals(map.get("check_result")) && map.get("check_result") != null) { 
+			check_result = Integer.parseInt((String)map.get("check_result"));
+		}
+		//判断
+		
+		
+		
+		if (!"".equals(map.get("check_opinion")) && map.get("check_opinion") != null) { 
+			check_opinion = (String)map.get("check_opinion");
+	    }
+		if (!"".equals(map.get("fund_id")) && map.get("fund_id") != null) { 
+			fund_id = Integer.parseInt((String)map.get("fund_id"));
+	    }
+		if (!"".equals(map.get("status_id")) && map.get("status_id") != null) { 
+			status_id = Integer.parseInt((String)map.get("status_id"));
+	    }
+		
+		
+	}
 }

+ 87 - 65
ccb_fund_trusteeship/src/main/java/com/fuzamei/service/OperationHistoryService.java

@@ -7,10 +7,15 @@ import java.util.Map;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import com.fuzamei.constant.Role;
 import com.fuzamei.dao.OperationHistoryDao;
+import com.fuzamei.dao.UserAuthoricationDao;
 import com.fuzamei.entity.OperationHistory;
+import com.fuzamei.entity.OperationHistoryBO;
+import com.fuzamei.entity.UserDetail;
 import com.fuzamei.utils.DateUtil;
 import com.fuzamei.utils.PageDTO;
+import com.fuzamei.utils.StringUtil;
 
 @Service
 public class OperationHistoryService {
@@ -18,89 +23,106 @@ public class OperationHistoryService {
 	@Autowired
 	private OperationHistoryDao operationHistoryDao;
 
-	private static final int ROW_NUM = 10; // 分页每页显示数据的数量
+	@Autowired
+	private UserAuthoricationDao userAuthoricationDao;
 
 	/**
 	 * 
-	 * @Title: queryOperationHistoryInformation @Description:
-	 * TODO(从dao层查询出分页数据信息) @param @param page @param @param
-	 * account @param @param role @param @param type @param @param
-	 * startTime @param @param endTime @param @return 设定文件 @return PageDTO
-	 * 返回类型 @author ylx @date 2017年12月14日 下午8:09:43 @throws
+	* @Title: queryOperationHistoryInformation
+	* @Description: TODO(根据用户的id号查询操作记录,但是现在只做了风管岗可以查看所有的信息,)
+	* @param @param map
+	* @param @return    设定文件
+	* @return PageDTO    返回类型
+	* @author ylx
+	* @date 2017年12月27日 下午3:02:42
+	* @throws
 	 */
 	public PageDTO queryOperationHistoryInformation(Map<String, Object> map) {
-		int page = 1; // 默认页是第一页
-		String account = ""; // 账号默认空值
-		String role = ""; // 操作角色默认空值
-		String type = ""; // 操作类型默认空值
-		long startTime = 0; // 开始时间默认0
-		long endTime = Long.MAX_VALUE; // 结束时间默认Long最大值
-		if (!"".equals(map.get("page")) && map.get("page") != null) { 							// 等于空就直接取第一页
-			try {
-				page = Integer.parseInt((String) map.get("page"));
-				if (page < 1) {
-					page = 1;
-				}
-			} catch (Exception e) {
-				page = 1; // 数据解析异常page还是1
-			}
-		}
-		if (!"".equals(map.get("account")) && map.get("account") != null) { 						// 等于空就直接取空值
-			try {
-				account = (String) map.get("account");
-			} catch (Exception e) {
-				account="";
-			}
-		}
-		if (!"".equals(map.get("role")) && map.get("role") != null) { // 等于空就直接取空值
-			try {
-				role = (String) map.get("role");
-			} catch (Exception e) {
-				role="";
-			}
-		}
-		if (!"".equals(map.get("type")) && map.get("type") != null) { // 等于空就直接取空值
-			try {
-				type = (String) map.get("type");
-			} catch (Exception e) {
-				type="";
-			}
-		}
-		if (!"".equals(map.get("startTime")) && map.get("startTime") != null) { // 等于空就直接取空值
-			try {
-				startTime = Long.parseLong((String) map.get("startTime"));
-			} catch (Exception e) {
-				startTime = 0; // 数据解析异常或转换类型异常startTime还是0
-			}
+		PageDTO pageDto = new PageDTO(); // 创建分页对象
+		//定义一个查询信息的list
+		List<OperationHistory> informationList=null;
+		int userId = (Integer) map.get("userId");
+		UserDetail userDetail=userAuthoricationDao.queryUserDetailInformation(userId);
+		if(userDetail==null){
+			throw new RuntimeException("用户信息不存在");
 		}
-		if (!"".equals(map.get("endTime")) && map.get("endTime") != null) { // 等于空就直接取空值
-			try {
-				endTime = Long.parseLong((String) map.get("endTime"));
-			} catch (Exception e) {
-				endTime = Long.MAX_VALUE; // 数据解析异常或转换类型异常endTime还是9223372036854775807L
+		List<String> roleList = userDetail.getRole_name();
+		if(roleList.contains(Role.VENTURE_MANAGEMENT_POS)){		//判断是否是风管岗位
+			// 去dao层取分页的数据,因为是风管岗位,可以查看所有人的操作记录
+			informationList = operationHistoryDao.queryOperationHistoryInformation(map); 
+		}else{
+			//根据用户id号查询出用户的账号account信息
+			//这里还有上下级关系查看的问题还没解决============================================================>>>>>>待定TODO
+			String account = userDetail.getAccount();
+			if(StringUtil.isEmpty(account)){
+				throw new RuntimeException("用户账号信息不存在");
 			}
+			map.put("Account", account);
+			informationList = operationHistoryDao.queryOperationHistoryInformationByUser(map); 
 		}
+		int count = operationHistoryDao.findAllInformation();
+		pageDto.setTotal(count);
+		pageDto.setRows(informationList);
+		return pageDto;
+	}
+
+	
+
+	/**
+	 * 
+	* @Title: queryOperationHistoryInformation
+	* @Description: TODO(controller层通过对象的形式传入信息查询)
+	* @param @param operationHistoryBO
+	* @param @return    设定文件
+	* @return PageDTO    返回类型
+	* @author ylx
+	* @date 2017年12月26日 下午4:26:44
+	* @throws
+	 */
+	/*public PageDTO queryOperationHistoryInformation(OperationHistoryBO operationHistoryBO) {
+		Integer userId = operationHistoryBO.getUserId();
+		Integer page = operationHistoryBO.getPage();
+		String account = operationHistoryBO.getAccount();
+		String role = operationHistoryBO.getRole(); // 操作角色默认空值
+		String type = operationHistoryBO.getType(); // 操作类型默认空值
+		Long startTime = operationHistoryBO.getStartTime(); // 开始时间默认0
+		Long endTime = operationHistoryBO.getEndTime(); // 结束时间
 		PageDTO pageDto = new PageDTO(); // 创建分页对象
 		Map<String, Object> mapToDao = new LinkedHashMap<String, Object>();
 		mapToDao.put("startPage", (page - 1) * ROW_NUM);
 		mapToDao.put("account", account);
 		mapToDao.put("role", role);
 		mapToDao.put("type", type);
-		if (startTime <= endTime) {
-			mapToDao.put("startTime", startTime);
-			mapToDao.put("endTime", endTime);
-		} else {
-			mapToDao.put("startTime", startTime);
-			mapToDao.put("endTime", Long.MAX_VALUE);
-		}
+		mapToDao.put("startTime", startTime);
+		mapToDao.put("endTime", endTime);
 		mapToDao.put("rowNum", ROW_NUM); //默认每页显示数据是10条,可根据需求修改分页数量
-
-		List<OperationHistory> informationList = operationHistoryDao.queryOperationHistoryInformation(mapToDao); // 去dao层取分页的数据
-
-		int count = operationHistoryDao.findAllInformation();
+		List<OperationHistory> informationList = operationHistoryDao.queryOperationHistoryInformation(mapToDao); //去dao层取分页的数据
+		int count = operationHistoryDao.findAllInformation();	//查询总信息条数
 		pageDto.setTotal(count);
 		pageDto.setRows(informationList);
 		return pageDto;
+	}*/
+	
+	/*//定义一个查询信息的list
+	List<OperationHistory> informationList=null;
+	int userId = (Integer) map.get("userId");
+	//查询用户的角色信息
+	List<String> roleList = userAuthoricationDao.queryUserRoleNames(userId);
+	//如果没有角色信息直接抛出异常信息
+	if(roleList==null||roleList.size()==0){
+		throw new RuntimeException("用户角色信息不存在");
 	}
+	if(roleList.contains("风管岗")){
+		// 去dao层取分页的数据,因为是风管岗位,可以查看所有人的操作记录
+		informationList = operationHistoryDao.queryOperationHistoryInformation(map); 
+	}else{
+		//根据用户id号查询出用户的账号account信息
+		String account = userAuthoricationDao.queryUserAccount(userId);
+		if(StringUtil.isEmpty(account)){
+			throw new RuntimeException("用户信息不存在");
+		}
+		map.put("Account", account);
+		informationList = operationHistoryDao.queryOperationHistoryInformationByUser(map); 
+	}*/
 
 }

+ 38 - 146
ccb_fund_trusteeship/src/main/java/com/fuzamei/service/ProjectFileService.java

@@ -1,8 +1,5 @@
 package com.fuzamei.service;
 
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.util.Arrays;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -11,8 +8,11 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import com.fuzamei.constant.OperationTypeId;
+import com.fuzamei.constant.Role;
 import com.fuzamei.dao.ProjectFileDao;
 import com.fuzamei.entity.ProjectFile;
+import com.fuzamei.entity.UserDetail;
 import com.fuzamei.utils.PageDTO;
 
 @Service
@@ -20,13 +20,14 @@ public class ProjectFileService {
 
 	@Autowired
 	private ProjectFileDao projectFileDao;
-
-	private static final int ROW_NUM = 10; // 分页每页显示数据的数量(固定10条数据)
+	
+	@Autowired
+	private UserAuthoricationService userAuthoricationService;
 
 	/**
 	 * 
 	* @Title: queryProjectFileInformation
-	* @Description: TODO(这里用一句话描述这个方法的作用)
+	* @Description: TODO(查询项目文档的信息)
 	* @param @param map
 	* @param @return    设定文件
 	* @return PageDTO    返回类型
@@ -35,55 +36,11 @@ public class ProjectFileService {
 	* @throws
 	 */
 	public PageDTO queryProjectFileInformation(Map<String, Object> map) {
-		int page = 1; // 默认页数是第一页
-		String projectName = ""; // 默认名称为空值
-		long startTime = 0; // 默认起始时间为0
-		long endTime = Long.MAX_VALUE; // 默认终止时间为Long最大值
-		if (!"".equals(map.get("page")) && map.get("page") != null) { // 等于空就直接取第一页
-			try {
-				page = Integer.parseInt((String) map.get("page"));
-				if (page < 1) {
-					page = 1;
-				}
-			} catch (Exception e) {
-				page = 1; // 数据解析异常或者类型转换异常page还是1
-			}
-		}
-		if (!"".equals(map.get("projectName")) && map.get("projectName") != null) { // 等于空就直接取空值
-			try {
-				projectName = (String) map.get("projectName");
-			} catch (Exception e) {
-				projectName="";
-			}
-		}
-		if (!"".equals(map.get("startTime")) && map.get("startTime") != null) { // 等于空就直接取空值
-			try {
-				startTime = Long.parseLong((String) map.get("startTime"));
-			} catch (Exception e) {
-				startTime = 0; // 数据解析异常和类型转换异常startTime还是0
-			}
-		}
-		if (!"".equals(map.get("endTime")) && map.get("endTime") != null) { // 等于空就直接取空值
-			try {
-				endTime = Long.parseLong((String) map.get("endTime"));
-			} catch (Exception e) {
-				endTime = Long.MAX_VALUE; // 数据解析异常和类型转换异常endTime还是9223372036854775807L
-			}
-		}
-
+		
 		PageDTO pageDto = new PageDTO(); // 创建分页对象
-		Map<String, Object> mapToDao = new LinkedHashMap<String, Object>();
-		mapToDao.put("startPage", (page - 1) * ROW_NUM);
-		mapToDao.put("projectName", projectName);
-		if (startTime <= endTime) {
-			mapToDao.put("startTime", startTime);
-			mapToDao.put("endTime", endTime);
-		} else {
-			mapToDao.put("startTime", startTime);
-			mapToDao.put("endTime", Long.MAX_VALUE);
-		}
-		mapToDao.put("rowNum", ROW_NUM); // 默认每页显示数据是10条,可根据需求修改分页数量
-		List<ProjectFile> informationList = projectFileDao.queryProjectFileInformation(mapToDao);
+		int userId = (Integer) map.get("userId");
+		userAuthoricationService.checkUserAuthority(userId,Role.SUPERVISION_AGENCY,Role.ARCHIVE_KEEPING_POS_OF_PBBTBC);		//查看用户非空和权限
+		List<ProjectFile> informationList = projectFileDao.queryProjectFileInformation(map);
 		int count = projectFileDao.findAllInformation();
 		pageDto.setRows(informationList);
 		pageDto.setTotal(count);
@@ -103,36 +60,13 @@ public class ProjectFileService {
 	* @throws
 	 */
 	public Map<String, Object> checkoutProjectFiles(Map<String, Object> map) {
-		Integer projectId = null;	//默认项目编号为空
-		String projectName="";		//默认项目名称为空值
-		if(!"".equals(map.get("projectId")) && null!=map.get("projectId")){
-			try {
-				projectId = Integer.parseInt((String)map.get("projectId"));
-			} catch (Exception e) {
-				projectId = null;	//如果解析出现异常或者类型转换异常,依然保持projectId为null
-			}
-		}
-		if (!"".equals(map.get("projectName")) && map.get("projectName") != null) { // 等于空就直接取空值
-			try {
-				projectName = (String) map.get("projectName");
-			} catch (Exception e) {
-				projectName="";
-			}
-		}
-		
-		Map<String, Object> mapToDao = new LinkedHashMap<String, Object>();
-		
-		mapToDao.put("projectId", projectId);
-		mapToDao.put("projectName", projectName);
-		
-		List<ProjectFile> informationList = projectFileDao.checkoutProjectFiles(mapToDao);	//将项目id和项目名称封装成map到dao层去获取数据
-		
+		int userId = (Integer) map.get("userId");
+		userAuthoricationService.checkUserAuthority(userId,Role.SUPERVISION_AGENCY,Role.ARCHIVE_KEEPING_POS_OF_PBBTBC);	//查看用户非空和权限
+		List<ProjectFile> informationList = projectFileDao.checkoutProjectFiles(map);	//将项目id和项目名称封装成map到dao层去获取数据
 		Map<String, Object> mapBackToController = new LinkedHashMap<String, Object>();
-		
-		mapBackToController.put("projectId", projectId);
-		mapBackToController.put("projectName", projectName);
-		mapBackToController.put("fileInformations", informationList);
-		
+		mapBackToController.put("projectId", map.get("projectId"));		//展示给前端的项目id号码
+		mapBackToController.put("projectName", map.get("projectName"));	//展示给前端的项目名称
+		mapBackToController.put("fileInformations", informationList);	//展示给前端的所有文件信息(包括文件名、文件hash值,还有文件url下载地址)
 		return mapBackToController;
 	}
 
@@ -148,77 +82,38 @@ public class ProjectFileService {
 	 */
 	@Transactional(rollbackFor=Exception.class)
 	public void insertInformationIntoTable(Map<String, Object> map) {
-		String projectId="";			//项目id号
-		String projectName="";			//项目文件名称
-		String url="";					//url路径名称
-		String attachmentName="";		//附件名称
-		if (!"".equals(map.get("projectId")) && map.get("projectId") != null) { // 等于空就直接取空值
-			try {
-				projectId = (String) map.get("projectName");
-			} catch (Exception e) {
-				throw new RuntimeException("projectId类型转换异常");
-			}
-		}else{
-			throw new RuntimeException("项目id号为空");
-		}
-		if (!"".equals(map.get("projectName")) && map.get("projectName") != null) { // 等于空就直接取空值
-			try {
-				projectName = (String) map.get("projectName");
-			} catch (Exception e) {
-				throw new RuntimeException("projectName类型转换异常");
-			}
-		}else{
-			throw new RuntimeException("项目名称为空");
-		}
-		if (!"".equals(map.get("url")) && map.get("url") != null) { // 等于空就直接取空值
-			try {
-				url = (String) map.get("url");
-			} catch (Exception e) {
-				throw new RuntimeException("url类型转换异常");
-			}
-		}else{
-			throw new RuntimeException("url路径名称为空");
-		}
-		if (!"".equals(map.get("attachmentName")) && map.get("attachmentName") != null) { // 等于空就直接取空值
-			try {
-				attachmentName = (String) map.get("attachmentName");
-			} catch (Exception e) {
-				throw new RuntimeException("attachmentName类型转换异常");
-			}
-		}else{
-			throw new RuntimeException("附件名称为空");
-		}
-		
+		long currentTime = System.currentTimeMillis();										//获取当前时间
+		int attachmentId = (Integer)(int)(Math.random()*1000000);							//附件id不能用随机数,这里到时候要改的================>>待定TODO
+		UserDetail userDetail = (UserDetail) map.get("userDetail");							//获取controller传过来的UserDetail对象
 		//将数据封装到mapToDaoForProjectFile,并插入【项目文档表】
 		Map<String, Object> mapToDaoForProjectFile = new LinkedHashMap<String,Object>();
-		mapToDaoForProjectFile.put("projectId", projectId);
-		mapToDaoForProjectFile.put("projectName", projectName);
-		mapToDaoForProjectFile.put("attachmentId", (Integer)(int)(Math.random()*1000000));		//附件id不能用随机数,这里到时候要改的。。。。。。。。。TODO
-		mapToDaoForProjectFile.put("updateTime", System.currentTimeMillis());			//上传文件的更新时间为当前时间
-		mapToDaoForProjectFile.put("hash", "to be changed");							//上传文件的hash值到时候要通过对文件进行计算后才能进行数据库的录入(这里先写死)。。。。。。。。TODO
-		projectFileDao.insertInformationIntoTable(mapToDaoForProjectFile);			//将以上的数据直接添加到数据库中【项目文档表】去
+		mapToDaoForProjectFile.put("projectId", map.get("projectId"));
+		mapToDaoForProjectFile.put("projectName", map.get("projectName"));
+		mapToDaoForProjectFile.put("attachmentId", attachmentId);							//附件id不能用随机数,这里到时候要改的================>>待定TODO
+		mapToDaoForProjectFile.put("updateTime", currentTime);								//上传文件的更新时间为当前时间
+		mapToDaoForProjectFile.put("hash", map.get("hash"));								//将算好的hash值放入mapToDaoForProjectFile中
+		projectFileDao.insertInformationIntoTable(mapToDaoForProjectFile);					//将以上的数据直接添加到数据库中【项目文档表】去
 		
 		//将数据封装到mapToDaoForAttachment,并插入【附件表】
 		Map<String, Object> mapToDaoForAttachment = new LinkedHashMap<String,Object>();
-		mapToDaoForAttachment.put("attachmentId", mapToDaoForProjectFile.get("attachmentId"));
-		mapToDaoForAttachment.put("attachmentName", attachmentName);					//附件名称需要录入
-		mapToDaoForAttachment.put("url", url);										//下载文件需要用到的url地址需要录入
-		mapToDaoForAttachment.put("userId", 2000000001);								//用户id(这里先写死)。。。。。。。。。。TODO
-		mapToDaoForAttachment.put("addTime", (Long)mapToDaoForProjectFile.get("updateTime"));		//这里添加的文件上传时间,和项目文档更新时间一样
+		mapToDaoForAttachment.put("attachmentId", attachmentId);							//附件id不能用随机数,这里到时候要改的================>>待定TODO
+		mapToDaoForAttachment.put("attachmentName", map.get("attachmentName"));				//附件名称需要录入
+		mapToDaoForAttachment.put("url", map.get("url"));									//下载文件需要用到的url地址需要录入
+		mapToDaoForAttachment.put("userId", userDetail.getUser_id());						//直接通过userDetail中获取
+		mapToDaoForAttachment.put("addTime", currentTime);									//这里添加的文件上传时间,和项目文档更新时间一样
 		projectFileDao.insertInformationToAttachment(mapToDaoForAttachment);
 		
 		//此外,还要将业务申报的这个操作信息插入到操作记录表中【操作记录表】
 		Map<String, Object> mapToOperationHistory = new LinkedHashMap<String,Object>();
-		mapToOperationHistory.put("operatorTypeId", 1011);								//上传项目文档的类型为1011
-		mapToOperationHistory.put("operatorAccount", 300000001);						//操作账号先定死
-		mapToOperationHistory.put("operatorRole", "省分行托管分中心档案保管岗");			//创建这个操作的角色只能是省分行托管分中心档案保管岗
-		mapToOperationHistory.put("operatorPerson", "张三");								//操作人暂时先写死
-		mapToOperationHistory.put("operatorTime", (Long)mapToDaoForProjectFile.get("updateTime"));//操作时间为当前操作时间
-		mapToOperationHistory.put("hash", "to be calculated from operation");			//如何计算操作的hash值????
-		projectFileDao.insertOperationHistoryInformationToDao(mapToOperationHistory);//将操作记录信息插入到操作记录表中
+		mapToOperationHistory.put("operatorTypeId", OperationTypeId.UPLOAD_PROJECT_FILE);//上传项目文档的类型为1011
+		mapToOperationHistory.put("operatorAccount", userDetail.getAccount());			//操作账号通过userDetail中获取
+		mapToOperationHistory.put("operatorRole", Role.ARCHIVE_KEEPING_POS_OF_PBBTBC);	//创建这个操作的角色只能是省分行托管分中心档案保管岗
+		mapToOperationHistory.put("operatorPerson", userDetail.getPerson_name());		//操作人通过userDetail中获取
+		mapToOperationHistory.put("operatorTime", currentTime);							//操作时间为当前操作时间
+		mapToOperationHistory.put("hash", "来自前端token计算");							//如何计算操作的hash值?(按照上传的项目文件的hash值算)=====>>待定TODO
+		projectFileDao.insertOperationHistoryInformationToDao(mapToOperationHistory);   //将操作记录信息插入到操作记录表中
 		
 	}
-	
 	/*public static void main(String[] args) throws NoSuchAlgorithmException {
 		MessageDigest complete=MessageDigest.getInstance("MD5");
 		byte[] bs={1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
@@ -234,7 +129,4 @@ public class ProjectFileService {
 		
 	}*/
 	
-
-
-	
 }

+ 48 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/service/UserAuthoricationService.java

@@ -0,0 +1,48 @@
+package com.fuzamei.service;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.fuzamei.dao.UserAuthoricationDao;
+import com.fuzamei.entity.UserDetail;
+
+@Service
+public class UserAuthoricationService {
+	
+	@Autowired
+	private UserAuthoricationDao userAuthoricationDao;
+	
+	
+	/**
+	 * 
+	* @Title: checkUserAuthority
+	* @Description: TODO(查看用户是否有权限下载项目文档文件,如果没有权限直接抛出异常,校验结束返回一个UserDetail信息)
+	* @param @param userId    设定文件
+	* @return UserDetail    返回类型
+	* @author ylx
+	* @date 2017年12月27日 下午4:51:22
+	* @throws
+	 */
+	public UserDetail checkUserAuthority(int userId,String... authority) {
+		UserDetail userDetail = userAuthoricationDao.queryUserDetailInformation(userId);
+		if(userDetail==null){
+			throw new RuntimeException("用户信息不存在");
+		}
+		List<String> roleList = userDetail.getRole_name();
+		boolean temp = false;
+		for (String string : authority) {
+			temp=roleList.contains(string)||temp;
+		}
+		if(!temp){
+			throw new RuntimeException("无权操作");
+		}
+		return userDetail;
+		/*if(!(roleList.contains("监管机构")||roleList.contains("省分行托管分中心档案保管岗"))){
+			throw new RuntimeException("无权查看项目文档信息");
+		}*/
+	}
+	
+	
+}

+ 242 - 214
ccb_fund_trusteeship/src/main/java/com/fuzamei/service/ValuationAccountingService.java

@@ -8,7 +8,14 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import com.fuzamei.constant.BattleResult;
+import com.fuzamei.constant.OperationTypeId;
+import com.fuzamei.constant.Role;
+import com.fuzamei.dao.AttachmentDao;
+import com.fuzamei.dao.ProjectFileDao;
+import com.fuzamei.dao.UserAuthoricationDao;
 import com.fuzamei.dao.ValuationAccountingDao;
+import com.fuzamei.entity.UserDetail;
 import com.fuzamei.entity.ValuationAccount;
 import com.fuzamei.utils.PageDTO;
 
@@ -17,73 +24,24 @@ public class ValuationAccountingService {
 	
 	@Autowired
 	private ValuationAccountingDao valuationAccountingDao;
-
-	private static final int ROW_NUM = 10; // 分页每页显示数据的数量
 	
+	@Autowired
+	private ProjectFileDao projectFileDao;
+	/**
+	 * 
+	* @Title: queryValuationAccountingInformation
+	* @Description: TODO(查看估值核算表的信息,只有管理人和省托管分中心估值核算岗才有权限查看)
+	* @param @param map
+	* @param @return    设定文件
+	* @return PageDTO    返回类型
+	* @author ylx
+	* @date 2017年12月28日 上午11:38:35
+	* @throws
+	 */
 	public PageDTO queryValuationAccountingInformation(Map<String, Object> map) {
-		int page = 1; // 默认页是第一页
-		String fundName="";	//基金名默认为空
-		String battleResult="";	//比对结果默认为空
-		long startTime = 0; // 开始时间默认0
-		long endTime = Long.MAX_VALUE; // 结束时间默认Long最大值
-		
-		if (!"".equals(map.get("page")) && map.get("page") != null) { // 等于空就直接取第一页
-			try {
-				page = Integer.parseInt((String) map.get("page"));
-				if (page < 1) {
-					page = 1;
-				}
-			} catch (Exception e) {
-				page = 1; // 数据解析异常或类型转换异常page还是1
-			}
-		}
-		if (!"".equals(map.get("fundName")) && map.get("fundName") != null) { // 等于空就直接取空值
-			try {
-				fundName = (String) map.get("fundName");
-			} catch (Exception e) {
-				fundName="";//类型转换异常基金名称还是空字符串
-			}
-		}
-		if (!"".equals(map.get("battleResult")) && map.get("battleResult") != null) { // 等于空就直接取空值
-			try {
-				battleResult = (String) map.get("battleResult");
-			} catch (Exception e) {
-				battleResult="";//类型转换异常比对结果还是空字符串
-			}
-		}
-		if (!"".equals(map.get("startTime")) && map.get("startTime") != null) { // 等于空就直接取空值
-			try {
-				startTime = Long.parseLong((String) map.get("startTime"));
-			} catch (Exception e) {
-				startTime = 0; // 数据解析异常或者类型转换异常startTime还是0
-			}
-		}
-		if (!"".equals(map.get("endTime")) && map.get("endTime") != null) { // 等于空就直接取空值
-			try {
-				endTime = Long.parseLong((String) map.get("endTime"));
-			} catch (Exception e) {
-				endTime = Long.MAX_VALUE; // 数据解析异常或者类型转换异常endTime还是9223372036854775807L
-			}
-		}
-		Map<String, Object> mapToDao = new LinkedHashMap<String, Object>();				//这个map是去dao层调取数据的
-		mapToDao.put("startPage", (page - 1) * ROW_NUM);
-		mapToDao.put("fundName", fundName);
-		mapToDao.put("battleResult", battleResult);
-		
-		//如果时间顺序错位,要重新进行排位
-		if (startTime <= endTime) {
-			mapToDao.put("startTime", startTime);
-			mapToDao.put("endTime", endTime);
-		} else {
-			mapToDao.put("startTime", startTime);
-			mapToDao.put("endTime", Long.MAX_VALUE);
-		}
-		mapToDao.put("rowNum", ROW_NUM); // 默认每页显示数据是10条,可根据需求修改分页数量
-		
 		PageDTO pageDTO=new PageDTO();
-		
-		List<ValuationAccount> informationList=valuationAccountingDao.queryValuationAccountingInformation(mapToDao);	//从service层中获取分页的对象信息
-		int count=valuationAccountingDao.findAllInformations();	//获取总的信息数量
+		List<ValuationAccount> informationList=valuationAccountingDao.queryValuationAccountingInformation(map);	//从service层中获取分页的对象信息
+		int count=valuationAccountingDao.findAllInformations();													//获取总的信息数量
 		pageDTO.setTotal(count);
 		pageDTO.setRows(informationList);
 		return pageDTO;
@@ -92,7 +50,7 @@ public class ValuationAccountingService {
 	/**
 	 * 
 	* @Title: insertInformationIntoTable
-	* @Description: TODO(以管理员身份将估值核算等数据插入数据库中)
+	* @Description: TODO(以管理员身份首次将估值核算等数据插入数据库中------>首次创建基金id号要生成,基金名,托管资产都要从用户这里获取)
 	* @param @param map    设定文件
 	* @return void    返回类型
 	* @author ylx
@@ -100,80 +58,88 @@ public class ValuationAccountingService {
 	* @throws
 	 */
 	@Transactional(rollbackFor=Exception.class)
-	public void insertInformationIntoTableByAdmin(Map<String, Object> map) {
-		String fundId="";			//基金id号
-		String fundName="";			//基金名称
-		String assets="";			//托管资产名称
-		String url="";					//url路径名称
-		String attachmentName="";		//附件名称
-		if (!"".equals(map.get("fundId")) && map.get("fundId") != null) { // 等于空就直接取空值
-			try {
-				fundId = (String) map.get("fundId");
-			} catch (Exception e) {
-				throw new RuntimeException("fundId类型转换异常");
-			}
-		}else{
-			throw new RuntimeException("项目id号为空");
-		}
-		if (!"".equals(map.get("fundName")) && map.get("fundName") != null) { // 等于空就直接取空值
-			try {
-				fundName = (String) map.get("fundName");
-			} catch (Exception e) {
-				throw new RuntimeException("fundName类型转换异常");
-			}
-		}else{
-			throw new RuntimeException("项目名称为空");
-		}
-		if (!"".equals(map.get("assets")) && map.get("assets") != null) { // 等于空就直接取空值
-			try {
-				assets = (String) map.get("assets");
-			} catch (Exception e) {
-				throw new RuntimeException("assets类型转换异常");
-			}
-		}else{
-			throw new RuntimeException("url路径名称为空");
-		}
-		if (!"".equals(map.get("url")) && map.get("url") != null) { // 等于空就直接取空值
-			try {
-				url = (String) map.get("url");
-			} catch (Exception e) {
-				throw new RuntimeException("url类型转换异常");
-			}
-		}else{
-			throw new RuntimeException("url路径名称为空");
-		}
-		if (!"".equals(map.get("attachmentName")) && map.get("attachmentName") != null) { // 等于空就直接取空值
-			try {
-				attachmentName = (String) map.get("attachmentName");
-			} catch (Exception e) {
-				throw new RuntimeException("attachmentName类型转换异常");
-			}
-		}else{
-			throw new RuntimeException("附件名称为空");
-		}
-		
+	public void insertInformationIntoTableByAdminForTheFirstTime(Map<String, Object> map) {
+		long currentTime = System.currentTimeMillis();
+		int attachmentId = (Integer) map.get("attachmentId");
+		UserDetail userDetail = (UserDetail) map.get("userDetail"); 
 		//将数据插入到估值核算表的数据封装到mapToDaoForValuationAccounting
 		Map<String, Object> mapToDaoForValuationAccounting = new LinkedHashMap<String,Object>();
-		mapToDaoForValuationAccounting.put("fundId", fundId);
-		mapToDaoForValuationAccounting.put("fundName", fundName);
-		mapToDaoForValuationAccounting.put("assets", assets);
-		
+		mapToDaoForValuationAccounting.put("fundId", map.get("fundId"));
+		mapToDaoForValuationAccounting.put("fundName", map.get("fundName"));
+		mapToDaoForValuationAccounting.put("assets", map.get("assets"));
 		//管理员估值报表的id,而银行估值报表的id这个时候是没有添加的,也就是表中插入数据的时候,银行估值报表的id先空着
-		mapToDaoForValuationAccounting.put("attachmentId", (Integer)(int)(Math.random()*1000000));		//附件id不能用随机数,这里到时候要改的(这个是管理员估值报表的id)。。。。。。。。。TODO
-		mapToDaoForValuationAccounting.put("updateTime", System.currentTimeMillis());			//上传文件的更新时间为当前时间
-		mapToDaoForValuationAccounting.put("battleResult", "待对账");							//上传文件的hash值到时候要通过对文件进行计算后才能进行数据库的录入(这里先写死)。。。。。。。。TODO
+		mapToDaoForValuationAccounting.put("attachmentId", attachmentId);									//附件id已经写活♥
+		mapToDaoForValuationAccounting.put("updateTime", currentTime);										//上传文件的更新时间为当前时间
+		mapToDaoForValuationAccounting.put("battleResult", BattleResult.TO_BE_MATCHED);						//对账结果为待对账,这里就是一个常量信息♥
 		valuationAccountingDao.insertInformationIntoTableByAdmin(mapToDaoForValuationAccounting);			//将以上的数据直接添加到数据库中【估值核算表】去
 
 		//将附件信息放入到mapToDaoForAttachment并传递到数据库插入
 		Map<String, Object> mapToDaoForAttachment = new LinkedHashMap<String,Object>();
-		mapToDaoForAttachment.put("attachmentId", mapToDaoForValuationAccounting.get("attachmentId"));	//附件表的id直接从之前封装的map中获取即可
-		mapToDaoForAttachment.put("attachmentName", attachmentName);									//附件名称需要录入
-		mapToDaoForAttachment.put("url", url);															//下载文件需要用到的url地址需要录入
-		//用户id到时候再确定,先写死
-		mapToDaoForAttachment.put("userId", 2000000001);												//用户id(这里先写死)。。。。。。。。。。TODO
-		mapToDaoForAttachment.put("addTime", (Long)mapToDaoForValuationAccounting.get("updateTime"));	//这里添加的文件上传时间,和估值核算添加的时间一致
-		valuationAccountingDao.insertInformationToAttachment(mapToDaoForValuationAccounting);
+		mapToDaoForAttachment.put("attachmentId", attachmentId);										//附件id已经写活♥
+		mapToDaoForAttachment.put("attachmentName", map.get("attachmentName"));							//附件名称需要录入
+		mapToDaoForAttachment.put("url", map.get("url"));												//下载文件需要用到的url地址需要录入
+		mapToDaoForAttachment.put("userId", map.get("userId"));											//用户id♥
+		mapToDaoForAttachment.put("addTime", currentTime);												//这里添加的文件上传时间,和估值核算添加的时间一致
+		valuationAccountingDao.insertInformationToAttachment(mapToDaoForAttachment);
+		
+		//此外,还要将业务申报的这个操作信息插入到操作记录表中【操作记录表】
+		Map<String, Object> mapToOperationHistory = new LinkedHashMap<String,Object>();
+		mapToOperationHistory.put("operatorTypeId", OperationTypeId.UPLOAD_VALUATION_CHECK);	//上传估值核算表为1010
+		mapToOperationHistory.put("operatorAccount", userDetail.getAccount());					//操作账号通过userDetail中获取
+		mapToOperationHistory.put("operatorRole", Role.ADMIN);									//创建这个操作的角色只能是管理人
+		mapToOperationHistory.put("operatorPerson", userDetail.getPerson_name());				//操作人通过userDetail中获取
+		mapToOperationHistory.put("operatorTime", currentTime);									//操作时间为当前操作时间
+		mapToOperationHistory.put("hash", "来自前端token计算");									//如何计算操作的hash值?(按照上传的项目文件的hash值算)=====>>待定TODO
+		projectFileDao.insertOperationHistoryInformationToDao(mapToOperationHistory);   		//将操作记录信息插入到操作记录表中
+	}
+	
+	
+	
+	
+	/**
+	 * 
+	* @Title: updateInformationByAdmin
+	* @Description: TODO(以管理员的身份进行估值核算文件重新上传的操作)
+	* @param @param mapToService    设定文件
+	* @return void    返回类型
+	* @author ylx
+	* @date 2017年12月29日 上午10:08:47
+	* @throws
+	 */
+	@Transactional(rollbackFor=Exception.class)
+	public void updateInformationByAdmin(Map<String, Object> map) {
+		long currentTime=System.currentTimeMillis();	//获取当前时间
+		UserDetail userDetail = (UserDetail) map.get("userDetail");   //获取用户详细信息
+		Map<String, Object> mapToDaoForValuationAccounting = new LinkedHashMap<String,Object>();
+		mapToDaoForValuationAccounting.put("fundId", map.get("fundId"));
+		//管理员估值报表这个时候重新上传文件只需要把总表中的对账结果和更新时间改一下就可以了,附件id不用换
+		mapToDaoForValuationAccounting.put("updateTime", currentTime);			//上传文件的更新时间为当前时间
+		mapToDaoForValuationAccounting.put("battleResult", map.get("battleResult"));			//总表中需要改变的对账结果
+		valuationAccountingDao.updateInformationByAdmin(mapToDaoForValuationAccounting);			//将以上的数据更新到之前估值核算表
+		
+		
+		//将附件信息封装到mapToDaoForAttachment并传入数据库中
+		Map<String, Object> mapToDaoForAttachment = new LinkedHashMap<String,Object>();
+		mapToDaoForAttachment.put("attachmentId", map.get("attachmentId"));						//直接从前面的map中获取
+		mapToDaoForAttachment.put("url", map.get("url"));										//下载文件需要用到的url地址需要录入到附件表中
+		mapToDaoForAttachment.put("attachmentName", map.get("attachmentName"));					//附件名称要重新修改
+		mapToDaoForAttachment.put("userId", userDetail.getUser_id());							//用户id写活了,这个用户id也要改下♥
+		mapToDaoForAttachment.put("addTime", currentTime);									//这里添加的文件重新上传的时间,和项目文档更新时间一样
+		valuationAccountingDao.updateAttachmentInformationByAdmin(mapToDaoForAttachment);	//将以上的数据更新到附件表
+		
+		//此外,还要将上传估值核算表的这个操作信息插入到操作记录表中【】
+		Map<String, Object> mapToOperationHistory = new LinkedHashMap<String,Object>();
+		mapToOperationHistory.put("operatorTypeId", OperationTypeId.UPLOAD_VALUATION_CHECK);	//操作类型为【上传估值核算表】---1010
+		mapToOperationHistory.put("operatorAccount", userDetail.getAccount());					//操作账号写活了♥
+		mapToOperationHistory.put("operatorRole", Role.ADMIN);			//创建这个操作的角色只能是---管理人
+		mapToOperationHistory.put("operatorPerson", userDetail.getPerson_name());		//操作人写活了♥
+		mapToOperationHistory.put("operatorTime", currentTime);			//操作时间为当前操作时间
+		mapToOperationHistory.put("hash", "to be calculated from operation");			//如何计算操作的hash值????======================================>>待定TODO
+		valuationAccountingDao.insertOperationHistoryInformationToDao(mapToOperationHistory);//将操作记录信息插入到操作记录表中
+		
 	}
+	
+	
 
 	/**
 	 * 
@@ -187,99 +153,161 @@ public class ValuationAccountingService {
 	 */
 	@Transactional(rollbackFor=Exception.class)
 	public void updateInformationByBank(Map<String, Object> map) {
-		String fundId="";			//基金id号
-		String fundName="";			//基金名称
-		String assets="";			//托管资产名称
-		String url="";					//url路径名称
-		String attachmentName="";		//附件名称
-		if (!"".equals(map.get("fundId")) && map.get("fundId") != null) { // 等于空就直接取空值
-			try {
-				fundId = (String) map.get("fundId");
-			} catch (Exception e) {
-				throw new RuntimeException("fundId类型转换异常");
-			}
-		}else{
-			throw new RuntimeException("项目id号为空");
-		}
-		if (!"".equals(map.get("fundName")) && map.get("fundName") != null) { // 等于空就直接取空值
-			try {
-				fundName = (String) map.get("fundName");
-			} catch (Exception e) {
-				throw new RuntimeException("fundName类型转换异常");
-			}
-		}else{
-			throw new RuntimeException("项目名称为空");
-		}
-		if (!"".equals(map.get("assets")) && map.get("assets") != null) { // 等于空就直接取空值
-			try {
-				assets = (String) map.get("assets");
-			} catch (Exception e) {
-				throw new RuntimeException("assets类型转换异常");
-			}
-		}else{
-			throw new RuntimeException("url路径名称为空");
-		}
-		if (!"".equals(map.get("url")) && map.get("url") != null) { // 等于空就直接取空值
-			try {
-				url = (String) map.get("url");
-			} catch (Exception e) {
-				throw new RuntimeException("url类型转换异常");
-			}
-		}else{
-			throw new RuntimeException("url路径名称为空");
-		}
-		if (!"".equals(map.get("attachmentName")) && map.get("attachmentName") != null) { // 等于空就直接取空值
-			try {
-				attachmentName = (String) map.get("attachmentName");
-			} catch (Exception e) {
-				throw new RuntimeException("attachmentName类型转换异常");
-			}
-		}else{
-			throw new RuntimeException("附件名称为空");
-		}
+		long currentTime=System.currentTimeMillis();
+		UserDetail userDetail = (UserDetail) map.get("userDetail");   //获取用户详细信息
+		Integer attachmentId = (Integer) map.get("attachmentId");
+		String battleResult = (String) map.get("battleResult");		//获取比对结果
 		
+		//更新估值核算表中的信息
 		Map<String, Object> mapToDaoForValuationAccounting = new LinkedHashMap<String,Object>();
-		mapToDaoForValuationAccounting.put("fundId", fundId);
-		mapToDaoForValuationAccounting.put("fundName", fundName);
-		mapToDaoForValuationAccounting.put("assets", assets);
-		/*
-		 * TODO
-		 * 这里有一段代码是需要对管理岗和银行的上传估值报表进行比较,来确定battleResult的结果是---->>估值一致 or 估值不一致????????
-		 */
-		//这是一段伪代码,到时候要删除的
-		if((int)(Math.random()*3)>1){
-			mapToDaoForValuationAccounting.put("battleResult", "估值一致");	
-		}else{
-			mapToDaoForValuationAccounting.put("battleResult", "估值不一致");	
-		}
-		//管理员估值报表的id,而银行估值报表的id这个时候是没有添加的,也就是表中插入数据的时候,银行估值报表的id先空着
-		mapToDaoForValuationAccounting.put("attachmentId", (Integer)(int)(Math.random()*1000000));		//附件id不能用随机数,这里到时候要改的(这个是银行估值报表的id)。。。。。。。。。TODO
-		mapToDaoForValuationAccounting.put("updateTime", System.currentTimeMillis());			//上传文件的更新时间为当前时间
+		mapToDaoForValuationAccounting.put("fundId", map.get("fundId"));
+		mapToDaoForValuationAccounting.put("attachmentId", attachmentId);		//附件id已经写活♥===========>>id号生成机制到时候再改TODO
+		mapToDaoForValuationAccounting.put("updateTime", currentTime);			//上传文件的更新时间为当前时间
+		mapToDaoForValuationAccounting.put("battleResult", battleResult);			//总表中需要改变的对账结果
 		valuationAccountingDao.updateInformationByBank(mapToDaoForValuationAccounting);			//将以上的数据更新到之前估值核算表
 		
 		
-		//将附件信息封装到mapToDaoForAttachment并传入数据库中
-		Map<String, Object> mapToDaoForAttachment = new LinkedHashMap<String,Object>();
-		mapToDaoForAttachment.put("attachmentId", mapToDaoForValuationAccounting.get("attachmentId"));	//直接从前面的map中获取
-		mapToDaoForAttachment.put("url", url);										//下载文件需要用到的url地址需要录入到附件表中
-		mapToDaoForAttachment.put("attachmentName", attachmentName);					//附件名称需要录入
-		//用户id到时候再确定,先写死
-		mapToDaoForAttachment.put("userId", 2000000001);								//用户id(这里先写死)。。。。。。。。。。TODO
-		mapToDaoForAttachment.put("addTime", (Long)mapToDaoForValuationAccounting.get("updateTime"));		//这里添加的文件上传时间,和项目文档更新时间一样
+		//待对账银行是插入一个新数据
+		if(BattleResult.TO_BE_MATCHED.equals(battleResult)){
+			//将附件信息封装到mapToDaoForAttachment并传入数据库中
+			Map<String, Object> mapToDaoForAttachment = new LinkedHashMap<String,Object>();
+			mapToDaoForAttachment.put("attachmentId", attachmentId);						
+			mapToDaoForAttachment.put("url", map.get("url"));										//下载文件需要用到的url地址需要录入到附件表中
+			mapToDaoForAttachment.put("attachmentName", map.get("attachmentName"));					//附件名称需要录入
+			//用户id已经写活♥
+			mapToDaoForAttachment.put("userId", userDetail.getUser_id());							//用户id写活了♥
+			mapToDaoForAttachment.put("addTime", currentTime);										//这里添加的文件上传时间,和项目文档更新时间一样
+			valuationAccountingDao.insertInformationToAttachment(mapToDaoForAttachment);			//将以上的数据插入到附件表中
+		}
+		
+		//不一致说明银行要修改附件中的信息
+		if(BattleResult.INCONSISTENT.equals(battleResult)){
+			//将附件信息封装到mapToDaoForAttachment并传入数据库中
+			Map<String, Object> mapToDaoForAttachment = new LinkedHashMap<String,Object>();
+			mapToDaoForAttachment.put("attachmentId", attachmentId);						
+			mapToDaoForAttachment.put("url", map.get("url"));										//下载文件需要用到的url地址需要录入到附件表中
+			mapToDaoForAttachment.put("attachmentName", map.get("attachmentName"));					//附件名称需要录入
+			//用户id已经写活♥
+			mapToDaoForAttachment.put("userId", userDetail.getUser_id());							//用户id写活了♥
+			mapToDaoForAttachment.put("addTime", currentTime);										//这里添加的文件上传时间,和项目文档更新时间一样
+			valuationAccountingDao.updateAttachmentInformationByBank(mapToDaoForAttachment);		//将以上的数据插入到附件表中
+		}
+		
 		
 		
 		//此外,还要将业务申报的这个操作信息插入到操作记录表中【】
 		Map<String, Object> mapToOperationHistory = new LinkedHashMap<String,Object>();
-		mapToOperationHistory.put("operatorTypeId", 1010);								//操作类型为【上传估值核算表】---1010
-		mapToOperationHistory.put("operatorAccount", 300000001);						//操作账号先定死
-		mapToOperationHistory.put("operatorRole", "省分行托管分中心估值核算岗");			//创建这个操作的角色只能是---省分行托管分中心估值核算岗
-		mapToOperationHistory.put("operatorPerson", "张三");								//操作人先写死
-		mapToOperationHistory.put("operatorTime", mapToDaoForValuationAccounting.get("updateTime"));			//操作时间为当前操作时间
-		mapToOperationHistory.put("hash", "to be calculated from operation");			//如何计算操作的hash值????
+		mapToOperationHistory.put("operatorTypeId", OperationTypeId.UPLOAD_VALUATION_CHECK);	//操作类型为【上传估值核算表】---1010
+		mapToOperationHistory.put("operatorAccount", userDetail.getAccount());					//操作账号写活了♥
+		mapToOperationHistory.put("operatorRole", Role.ACCOUNTING_POS_OF_TBC);					//创建这个操作的角色只能是---省分行托管分中心估值核算岗
+		mapToOperationHistory.put("operatorPerson", userDetail.getPerson_name());				//操作人写活了♥
+		mapToOperationHistory.put("operatorTime", currentTime);									//操作时间为当前操作时间
+		mapToOperationHistory.put("hash", "to be calculated from operation");					//如何计算操作的hash值????=========================>>TODO
 		valuationAccountingDao.insertOperationHistoryInformationToDao(mapToOperationHistory);//将操作记录信息插入到操作记录表中
-		
-		
-		
 	}
 
+	
+	/**
+	 * 
+	* @Title: checkoutDownloadInformation
+	* @Description: TODO(去数据库调取下载提示框的信息)
+	* @param @param fundId
+	* @param @return    设定文件
+	* @return Map<String,Object>    返回类型
+	* @author ylx
+	* @date 2017年12月28日 下午1:59:58
+	* @throws
+	 */
+	public List<ValuationAccount> checkoutDownloadInformation(int fundId) {
+		List<ValuationAccount> listToClient = valuationAccountingDao.checkoutDownloadInformation(fundId);
+		if(listToClient==null||listToClient.isEmpty()){
+			throw new RuntimeException("查无此信息");
+		}
+		return listToClient;
+	}
+
+	/**
+	 * 
+	* @Title: generateFundId
+	* @Description: TODO(用于给前端返回一个fundId号,而且还不能和数据库中已有的id号重复)
+	* @param @return    设定文件
+	* @return Map<String,Object>    返回类型
+	* @author ylx
+	* @date 2017年12月28日 下午3:45:12
+	* @throws
+	 */
+	public Map<String, Object> generateFundId() {
+		int same = 0;
+		Integer fundId = null;
+		//如果有重复的继续查,直到查不出重复的fundId号为止
+		while(same > 0){
+			fundId=(int)(Math.random()*1000000000);								//=========================>>>产生基金id号的机制要改的TODO
+			same = valuationAccountingDao.queryIfHasTheSameFundId(fundId);
+		}
+		Map<String, Object> mapToClient = new LinkedHashMap<String, Object>();
+		mapToClient.put("fundId", fundId);
+		return mapToClient;
+	}
+	
+	/**
+	 * 
+	* @Title: checkIfHasTheSameFundId
+	* @Description: TODO(验证基金id号是不是已经存在,如果已经存在直接报错)
+	* @param @param fundId    设定文件
+	* @return void    返回类型
+	* @author ylx
+	* @date 2017年12月28日 下午5:18:55
+	* @throws
+	 */
+	public void checkIfHasTheSameFundId(int fundId){
+		int same = valuationAccountingDao.queryIfHasTheSameFundId(fundId);
+		if(same >0){
+			throw new RuntimeException("该信息已经存在");
+		}
+	}
+
+	/**
+	 * 
+	* @Title: checkIfFundExists
+	* @Description: TODO(验证该基金是否存在,并返回这个基金的对账结果)
+	* @param @param fundId
+	* @param @param fundName
+	* @param @param     设定文件
+	* @return void    返回类型
+	* @author ylx
+	* @date 2017年12月28日 下午6:22:16
+	* @throws
+	 */
+	public ValuationAccount checkIfFundExists(Integer fundId, String fundName) {
+		ValuationAccount valuationAccount = valuationAccountingDao.checkIfFundExists(fundId,fundName);
+		if(valuationAccount == null){
+			throw new RuntimeException("该信息不存在");
+		}
+		return valuationAccount;
+	}
+
+	/**
+	 * 
+	* @Title: checkIfHasTheSameFundId
+	* @Description: TODO(验证基金名是不是已经存在,如果已经存在直接报错)
+	* @param @param fundId    设定文件
+	* @return void    返回类型
+	* @author ylx
+	* @date 2017年12月28日 下午5:18:55
+	* @throws
+	 */
+	public void checkIfHasTheSameFundName(String fundName) {
+		int same = valuationAccountingDao.queryIfHasTheSameFundName(fundName);
+		if(same >0){
+			throw new RuntimeException("该信息已经存在");
+		}
+	}
+
+	
+	
+	
+	
+	
+	
+
 }

+ 62 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/utils/ArrayUtil.java

@@ -0,0 +1,62 @@
+/**
+ * FileName: ArrayUtil
+ * Author: wangtao
+ * Date: 2017/12/15 11:28
+ * Description:
+ */
+package com.fuzamei.utils;
+
+/**
+ *
+ *
+ * @author wangtao
+ * @create 2017/12/15
+ *
+ */
+
+public class ArrayUtil {
+
+    private ArrayUtil() {
+        throw new AssertionError("不能实例化 ArrayUtil");
+    }
+
+    // Empty checks
+    //-----------------------------------------------------------------------
+
+    public static boolean isEmpty(final Object[] array) {
+        return array == null || array.length == 0;
+    }
+
+    public static boolean isEmpty(final long[] array) {
+        return array == null || array.length == 0;
+    }
+
+    public static boolean isEmpty(final int[] array) {
+        return array == null || array.length == 0;
+    }
+
+    public static boolean isEmpty(final short[] array) {
+        return array == null || array.length == 0;
+    }
+
+    public static boolean isEmpty(final char[] array) {
+        return array == null || array.length == 0;
+    }
+
+    public static boolean isEmpty(final byte[] array) {
+        return array == null || array.length == 0;
+    }
+
+    public static boolean isEmpty(final double[] array) {
+        return array == null || array.length == 0;
+    }
+
+    public static boolean isEmpty(final float[] array) {
+        return array == null || array.length == 0;
+    }
+
+    public static boolean isEmpty(final boolean[] array) {
+        return array == null || array.length == 0;
+    }
+
+}

+ 79 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/utils/IoUtil.java

@@ -0,0 +1,79 @@
+package com.fuzamei.utils;
+
+import java.io.*;
+
+/**
+ * 
+ * @author wangtao
+ * @description IO工具包
+ * @createTime 2017-12-6 15:22:02
+ *
+ */
+public class IoUtil {
+
+	private IoUtil(){
+		throw new AssertionError("不能实例化 IoUtil");
+	}
+	/**
+	 * 读取输入流为 字节数组
+	 * @param inputStream 输入流
+	 * @param bufferSize 缓存大小
+	 * @return
+	 * @throws IOException
+	 */
+	public static byte[] read(InputStream inputStream, int bufferSize) throws IOException {
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		byte[] buffer = new byte[bufferSize];
+		for (int num = inputStream.read(buffer); num != -1; num = inputStream.read(buffer)) {
+			baos.write(buffer, 0, num);
+		}
+		baos.flush();
+		return baos.toByteArray();
+	}
+	/**
+	 * 读取输入流为字节数组
+	 * @param inputStream 输入流
+	 * @return
+	 * @throws IOException
+	 */
+	public static byte[] read(InputStream inputStream) throws IOException {
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		byte[] buffer = new byte[1024];
+		for (int num = inputStream.read(buffer); num != -1; num = inputStream.read(buffer)) {
+			baos.write(buffer, 0, num);
+		}
+		baos.flush();
+		return baos.toByteArray();
+	}
+	/**
+	 * 写入文件到指定路径
+	 * @param filePath 文件保存路径
+	 * @param data 文件数据
+	 * @throws IOException
+	 */
+	public static void write(String filePath, byte[] data) throws IOException {
+		FileOutputStream outputStream = new FileOutputStream(filePath);
+		outputStream.write(data);
+		outputStream.flush();
+		outputStream.close();
+	}
+	/**
+	 * 以行为单位读取文件,常用于读面向行的格式化文件
+	 * @param filePath 文件路径
+	 * @return 文件内容字符串
+	 * @throws IOException
+	 */
+	public static String readFileByLines(String filePath) throws IOException {
+		StringBuilder sbld = new StringBuilder();
+        File file = new File(filePath);
+		BufferedReader reader = new BufferedReader(new FileReader(file));
+    	String tempString = null;
+        // 一次读入一行,直到读入null为文件结束
+        while ((tempString = reader.readLine()) != null) {
+        	sbld.append(tempString);
+        }
+        reader.close();
+        return sbld.toString();
+    }
+
+}

+ 84 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/utils/OtherUtil.java

@@ -0,0 +1,84 @@
+/**
+ * FileName: OtherUtil
+ * Author: wangtao
+ * Date: 2017/12/15 11:35
+ * Description:
+ */
+package com.fuzamei.utils;
+
+import java.text.StringCharacterIterator;
+import java.util.Map;
+
+/**
+ *
+ *
+ * @author wangtao
+ * @create 2017/12/15
+ *
+ */
+
+public class OtherUtil {
+
+    private OtherUtil() {
+        throw new AssertionError("不能实例化 OtherUtil");
+    }
+
+    /**
+     * 字符串替换,src中的key转换为value
+     * @param src
+     * @param map
+     * @return
+     */
+    public static String replace(String src, Map<String, String> map){
+        if (src != null && src.trim().length() != 0) {
+            for (Map.Entry<String, String> entry : map.entrySet()) {
+                src = src.replace(entry.getKey(), entry.getValue());
+            }
+        }
+        return src;
+    }
+    /**
+     * 对src转义编码,src中的key转换为value
+     * @param src
+     * @param map
+     * @return
+     */
+    public static String escape(String src, Map<String, String> map) {
+        if (src != null && src.trim().length() != 0) {
+            StringBuffer sb = new StringBuffer();
+            StringCharacterIterator sci = new StringCharacterIterator(src);
+            for (char c = sci.first(); !Character.isSpaceChar(c); c = sci.next()) {
+                String ch = String.valueOf(c);
+                if (map.containsKey(ch)) {
+                    ch = (String) map.get(ch);
+                }
+                sb.append(ch);
+            }
+            return sb.toString();
+        } else {
+            return "";
+        }
+    }
+    /**
+     * 获取XML字符串中的节点
+     * @param xmlString
+     * @param nodeName
+     * @return
+     */
+    public static String getNodeText(String xmlString, String nodeName) {
+        String beginName = "<" + nodeName + ">";
+        String endName = "</" + nodeName + ">";
+        int beginIndex = xmlString.indexOf(beginName);
+        if (beginIndex == -1) {
+            return "";
+        } else {
+            int endIndex = xmlString.indexOf(endName);
+            if (endIndex == -1) {
+                return "";
+            } else {
+                String nodeValue = xmlString.substring(beginIndex + beginName.length(), endIndex);
+                return nodeValue;
+            }
+        }
+    }
+}

+ 46 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/utils/RandomUtil.java

@@ -0,0 +1,46 @@
+package com.fuzamei.utils;
+
+import java.util.Random;
+
+/**
+ * 随机数相关方法
+ * @author wangtao
+ * @time 2017年11月16日
+ *
+ */
+public final class RandomUtil {
+
+	private RandomUtil(){
+		throw new AssertionError("不能实例化 RandomUtil");
+	}
+	
+	private static final Random RANDOM = new Random();
+	
+	/**
+	 * 获取指定长度的随机数
+	 * @param length 位数 长度
+	 * @return
+	 */
+	public static String getRandomNumber(int length) {
+		String string;
+		for (string = String.valueOf(Math.abs(RANDOM.nextLong())); string.length() < length; 
+				string = string + String.valueOf(Math.abs(RANDOM.nextLong()))) {
+			;
+		}
+		return string.substring(0, length);
+	}
+	/**
+	 * 获取指定长度的字符串
+	 * @param length
+	 * @return
+	 */
+	public static String getRandomString(int length) {
+		String str="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
+		StringBuilder sb = new StringBuilder();
+		for(int i = 0; i < length; i++) {
+			sb.append(str.charAt(RANDOM.nextInt(str.length())));
+		}
+		return sb.toString();
+	}
+
+}

+ 68 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/utils/RelativePathUtil.java

@@ -0,0 +1,68 @@
+package com.fuzamei.utils;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * 
+ * @author ylx
+ * @describe: 用于生成相对路径的一个工具类
+ */
+public class RelativePathUtil {
+	
+	private RelativePathUtil() {
+		throw new AssertionError("不能实例化 RelativePathUtil");
+	}
+	
+	/**
+	 * 
+	* @Title: formatPath
+	* @Description: TODO(产生一个pattern格式的相对路径,用于拼接使用)
+	* @param @param date
+	* @param @param pattern
+	* @param @return    设定文件
+	* @return String    返回类型
+	* @author ylx
+	* @date 2017年12月29日 下午5:14:36
+	* @throws
+	 */
+	public static final String formatPath(final Date date, String pattern){
+		if (date != null) {
+			SimpleDateFormat dateformatter = new SimpleDateFormat(pattern);
+			String dateString = dateformatter.format(date);
+			return dateString;
+		} 
+		throw new RuntimeException("date should not be null");
+	}
+	
+	/**
+	 * 
+	* @Title: formatPath
+	* @Description: TODO(相对路径格式为    /yyyy/MM/dd/HH/mm/ss/   )
+	* @param @return    设定文件
+	* @return String    返回类型
+	* @author ylx
+	* @date 2017年12月29日 下午5:19:26
+	* @throws
+	 */
+	public static final String formatPath(){
+		return formatPath(new Date(),"/yyyy/MM/dd/HH/mm/ss/");
+	}
+	
+	/**
+	 * 
+	* @Title: formatPath
+	* @Description: TODO(根据需求传入默认路径的前缀和后缀)
+	* @param @param prefix
+	* @param @param sufix
+	* @param @return    设定文件
+	* @return String    返回类型
+	* @author ylx
+	* @date 2017年12月29日 下午5:38:51
+	* @throws
+	 */
+	public static final String formatPath(String prefix,String sufix){
+		return formatPath(new Date(),prefix+"/yyyy/MM/dd/HH/mm/ss/"+sufix);
+	}
+	
+}

+ 174 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/utils/StringUtil.java

@@ -0,0 +1,174 @@
+package com.fuzamei.utils;
+public final class StringUtil {
+
+	private StringUtil() {
+		throw new AssertionError("不能实例化 StringUtil");
+	}
+
+	// Empty checks
+	//-----------------------------------------------------------------------
+
+	/**
+	 * 检查CharSequence是否为empty ("")或null
+	 *
+	 * StringUtil.isEmpty(null)      = true
+	 * StringUtil.isEmpty("")        = true
+	 * StringUtil.isEmpty(" ")       = false
+	 * StringUtil.isEmpty("bob")     = false
+	 * StringUtil.isEmpty("  bob  ") = false
+	 *
+	 * @param cs 待测字符序列
+	 * @return 待测序列是否为empty或null
+	 */
+	public static boolean isEmpty(final CharSequence cs) {
+		return cs == null || cs.length() == 0;
+	}
+
+	/**
+	 * 检查CharSequence是否不为empty ("")或null
+	 *
+	 * StringUtil.isNotEmpty(null)      = false
+	 * StringUtil.isNotEmpty("")        = false
+	 * StringUtil.isNotEmpty(" ")       = true
+	 * StringUtil.isNotEmpty("bob")     = true
+	 * StringUtil.isNotEmpty("  bob  ") = true
+	 *
+	 * @param cs 待测字符序列
+	 * @return 待测序列是否不为empty或null
+	 */
+	public static boolean isNotEmpty(final CharSequence cs) {
+		return !isEmpty(cs);
+	}
+
+	/**
+	 * 检测CharSequence中是否有任意一个为empty ("")或null
+	 *
+	 * StringUtil.isAnyEmpty(null)             = true
+	 * StringUtil.isAnyEmpty(null, "foo")      = true
+	 * StringUtil.isAnyEmpty("", "bar")        = true
+	 * StringUtil.isAnyEmpty("bob", "")        = true
+	 * StringUtil.isAnyEmpty("  bob  ", null)  = true
+	 * StringUtil.isAnyEmpty(" ", "bar")       = false
+	 * StringUtil.isAnyEmpty("foo", "bar")     = false
+	 *
+	 * @param css 待测字符序列
+	 * @return 待测序列是否有任意一个为empty或null
+	 */
+	public static boolean isAnyEmpty(final CharSequence... css) {
+		if (ArrayUtil.isEmpty(css)) {
+			return true;
+		}
+		for (final CharSequence cs : css){
+			if (isEmpty(cs)) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+	/**
+	 * 检测CharSequence中是否都不为empty ("")或null
+	 *
+	 * StringUtil.isNoneEmpty(null)             = false
+	 * StringUtil.isNoneEmpty(null, "foo")      = false
+	 * StringUtil.isNoneEmpty("", "bar")        = false
+	 * StringUtil.isNoneEmpty("bob", "")        = false
+	 * StringUtil.isNoneEmpty("  bob  ", null)  = false
+	 * StringUtil.isNoneEmpty(" ", "bar")       = true
+	 * StringUtil.isNoneEmpty("foo", "bar")     = true
+	 *
+	 * @param css 待测字符序列
+	 * @return 待测序列是否都不为empty或null
+	 */
+	public static boolean isNoneEmpty(final CharSequence... css) {
+		return !isAnyEmpty(css);
+	}
+
+	/**
+	 * 检测CharSequence中是否为whitespace空字符或empty ("")或null
+	 *
+	 * StringUtil.isBlank(null)      = true
+	 * StringUtil.isBlank("")        = true
+	 * StringUtil.isBlank(" ")       = true
+	 * StringUtil.isBlank("bob")     = false
+	 * StringUtil.isBlank("  bob  ") = false
+	 *
+	 * @param cs 待测字符序列
+	 * @return 待测序列是否为whitespace空字符或empty或null
+	 */
+	public static boolean isBlank(final CharSequence cs) {
+		int strLen;
+		if (cs == null || (strLen = cs.length()) == 0) {
+			return true;
+		}
+		for (int i = 0; i < strLen; i++) {
+			if (!Character.isWhitespace(cs.charAt(i))) {
+				return false;
+			}
+		}
+		return true;
+	}
+
+	/**
+	 * 检测CharSequence中是否不为whitespace空字符或empty ("")或null
+	 *
+	 * StringUtil.isNotBlank(null)      = false
+	 * StringUtil.isNotBlank("")        = false
+	 * StringUtil.isNotBlank(" ")       = false
+	 * StringUtil.isNotBlank("bob")     = true
+	 * StringUtil.isNotBlank("  bob  ") = true
+	 *
+	 * @param cs 待测字符序列
+	 * @return 待测序列是否不为whitespace空字符或empty或null
+	 */
+	public static boolean isNotBlank(final CharSequence cs) {
+		return !isBlank(cs);
+	}
+
+	/**
+	 * 检测CharSequence中是否有任意一个为whitespace空字符或empty ("")或null
+	 *
+	 * StringUtil.isAnyBlank(null)             = true
+	 * StringUtil.isAnyBlank(null, "foo")      = true
+	 * StringUtil.isAnyBlank(null, null)       = true
+	 * StringUtil.isAnyBlank("", "bar")        = true
+	 * StringUtil.isAnyBlank("bob", "")        = true
+	 * StringUtil.isAnyBlank("  bob  ", null)  = true
+	 * StringUtil.isAnyBlank(" ", "bar")       = true
+	 * StringUtil.isAnyBlank("foo", "bar")     = false
+	 *
+	 * @param css 待测字符序列
+	 * @return 待测序列是否有任意一个为whitespace空字符或empty或null
+	 */
+	public static boolean isAnyBlank(final CharSequence... css) {
+		if (ArrayUtil.isEmpty(css)) {
+			return true;
+		}
+		for (final CharSequence cs : css){
+			if (isBlank(cs)) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+	/**
+	 * 检测CharSequence中是否都不为whitespace空字符或empty ("")或null
+	 *
+	 * StringUtil.isNoneBlank(null)             = false
+	 * StringUtil.isNoneBlank(null, "foo")      = false
+	 * StringUtil.isNoneBlank(null, null)       = false
+	 * StringUtil.isNoneBlank("", "bar")        = false
+	 * StringUtil.isNoneBlank("bob", "")        = false
+	 * StringUtil.isNoneBlank("  bob  ", null)  = false
+	 * StringUtil.isNoneBlank(" ", "bar")       = false
+	 * StringUtil.isNoneBlank("foo", "bar")     = true
+	 *
+	 * @param css 待测字符序列
+	 * @return 待测序列是否都不为whitespace空字符或empty或null
+	 */
+	public static boolean isNoneBlank(final CharSequence... css) {
+		return !isAnyBlank(css);
+	}
+
+}

+ 648 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/utils/ValidationUtil.java

@@ -0,0 +1,648 @@
+package com.fuzamei.utils;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.validation.ConstraintViolation;
+import javax.validation.Validation;
+import javax.validation.Validator;
+import javax.validation.ValidatorFactory;
+
+import org.springframework.util.StringUtils;
+
+import com.alibaba.fastjson.JSON;
+
+/**
+ * 
+ * @author ylx
+ * @describe: 针对hibernate-validator的实体类进行数据校验的工具类
+ * @describe: 针对该项目中其它各类数据校验的工具类
+ * @Date: 2017-12-26
+ */
+public class ValidationUtil {
+
+	private ValidationUtil() {
+		throw new AssertionError("不能实例化 ValidationUtil");
+	}
+
+	/**
+	 * @Title: validate
+	 * @Description: TODO(仅针对校验一个实体类的所有校验失败信息)
+	 * @return List<String> 返回的是数据校验的所有校验失败信息,封装在一个list中作为返回值
+	 * @author ylx
+	 * @date 2017年12月26日 下午3:48:40
+	 */
+	public static <T> List<String> validate(T bo) {
+		ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
+		Validator validator = factory.getValidator();
+		Set<ConstraintViolation<T>> validateSet = validator.validate(bo);
+		List<String> list = new ArrayList<String>();
+		for (ConstraintViolation<T> validate : validateSet) {
+			list.add(validate.getMessage());
+		}
+		return list; // 包含所有校验出错的信息
+
+		/*
+		 * 使用hibernate validator出现上面的错误, 需要 注意
+		 * 
+		 * @NotNull 和 @NotEmpty 和@NotBlank 区别
+		 * 
+		 * @NotEmpty 用在集合类上面
+		 * 
+		 * @NotBlank 用在String上面
+		 * 
+		 * @NotNull 用在基本类型上
+		 */
+	}
+
+	/**
+	 * @Title: checkRangeOfInt
+	 * @Description: 针对传入的参数进行校验--->Integer类型
+	 * @Detail: 参数类型虽然是Object,但是要求数据类型是String或者是Integer类型的数据,而且String类型还必须是能被解析成整数的,否则会抛出异常.
+	 * 			而且还要限定数值的范围,超出范围的也会报异常.
+	 * 			如果一切都解析正常,返回一个true的布尔类型
+	 * @Usage: 适用于数据判断的校验
+	 * @return boolean
+	 * @author ylx
+	 * @date 2017年12月26日 下午3:48:40
+	 */
+	public static boolean checkRangeOfInt(final Object obj, int min, int max) {
+		String number = null;
+		try {
+			if (obj == null) {
+				throw new NullPointerException();
+			}
+			number = String.class.cast(obj);
+			try {
+				Integer.parseInt(number);
+			} catch (NumberFormatException e) {
+				throw new NumberFormatException();
+			}
+		} catch (Exception e) {
+			if (e instanceof NullPointerException) {
+				throw new NullPointerException("对象为null");
+			}
+			if (e instanceof NumberFormatException) {
+				throw new RuntimeException("数据类型解析异常");
+			}
+			Integer num = null;
+			try {
+				num = Integer.class.cast(obj);
+			} catch (Exception e1) {
+				throw new RuntimeException("数字解析异常");
+			}
+			if (num < min) {
+				throw new RuntimeException("最小值应该大于等于"+min);
+			}
+			if(num > max){
+				throw new RuntimeException("最大值应该小于等于"+max);
+			}
+		}
+		return true;
+	}
+
+	/**
+	 * @Title: checkMinOfInt
+	 * @Description: 针对传入的参数进行校验--->Integer类型
+	 * @Detail: 参数类型虽然是Object,但是要求数据类型是String或者是Integer类型的数据,而且String类型还必须是能被解析成整数的,否则会抛出异常.
+	 * 			而且还要限定数值的最小值,小于最小值的也会报异常.
+	 * 			如果一切都解析正常,返回一个true的布尔类型
+	 * @Usage: 适用于数据判断的校验
+	 * @return boolean
+	 * @author ylx
+	 * @date 2017年12月26日 下午3:48:40
+	 */
+	public static boolean checkMinOfInt(final Object obj, int min) {
+		return checkRangeOfInt(obj, min, Integer.MAX_VALUE);
+	}
+
+	/**
+	 * @Title: checkMaxOfInt
+	 * @Description: 针对传入的参数进行校验--->Integer类型
+	 * @Detail: 参数类型虽然是Object,但是要求数据类型是String或者是Integer类型的数据,而且String类型还必须是能被解析成整数的,否则会抛出异常.
+	 * 			而且还要限定数值的最大值,大于最大值的也会报异常.
+	 * 			如果一切都解析正常,返回一个true的布尔类型
+	 * @Usage: 适用于数据判断的校验
+	 * @return boolean
+	 * @author ylx
+	 * @date 2017年12月26日 下午3:48:40
+	 */
+	public static boolean checkMaxOfInt(final Object obj, int max) {
+		return checkRangeOfInt(obj, Integer.MIN_VALUE, max);
+	}
+	
+	/**
+	 * @Title: checkOfInt
+	 * @Description: 针对传入的参数进行校验--->Integer类型
+	 * @Detail: 参数类型虽然是Object,但是要求数据类型是String或者是Integer类型的数据,而且String类型还必须是能被解析成整数的,否则会抛出异常.
+	 * 			针对整个Integer范围内的数据校验(也就是能被解析成Integer的String还是Integer就能校验成功返回true)
+	 * 			如果一切都解析正常,返回一个true的布尔类型
+	 * @Usage: 适用于数据判断的校验
+	 * @return boolean
+	 * @author ylx
+	 * @date 2017年12月26日 下午3:48:40
+	 */
+	public static boolean checkOfInt(final Object obj) {
+		return checkRangeOfInt(obj, Integer.MIN_VALUE, Integer.MAX_VALUE);
+	}
+	
+
+	/**
+	 * @Title: checkRangeOfLong
+	 * @Description: 针对传入的参数进行校验--->Long类型
+	 * @Detail: 参数类型虽然是Object,但是要求数据类型是String或者是Long类型的数据,而且String类型还必须是能被解析成整数的,否则会抛出异常.
+	 * 			而且还要限定数值的范围,超出范围的也会报异常.
+	 * 			如果一切都解析正常,返回一个true的布尔类型
+	 * @Usage: 适用于数据判断的校验
+	 * @return boolean
+	 * @author ylx
+	 * @date 2017年12月26日 下午3:48:40
+	 */
+	public static boolean checkRangeOfLong(final Object obj, long min, long max) {
+		String number = null;
+		try {
+			if (obj == null) {
+				throw new NullPointerException();
+			}
+			number = String.class.cast(obj);
+			try {
+				Long.parseLong(number);
+			} catch (NumberFormatException e) {
+				throw new NumberFormatException();
+			}
+		} catch (Exception e) {
+			if (e instanceof NullPointerException) {
+				throw new NullPointerException("对象为null");
+			}
+			if (e instanceof NumberFormatException) {
+				throw new RuntimeException("数据类型解析异常");
+			}
+			Long num = null;
+			try {
+				num=Long.parseLong(""+obj);
+			} catch (Exception e1) {
+				throw new RuntimeException("数字解析异常");
+			}
+			if (num < min) {
+				throw new RuntimeException("最小值应该大于等于"+min);
+			}
+			if(num > max){
+				throw new RuntimeException("最大值应该小于等于"+max);
+			}
+		}
+		return true;
+	}
+	
+	/**
+	 * @Title: checkMinOfLong
+	 * @Description: 针对传入的参数进行校验--->Long类型
+	 * @Detail: 参数类型虽然是Object,但是要求数据类型是String或者是Long类型的数据,而且String类型还必须是能被解析成整数的,否则会抛出异常.
+	 * 			而且还要限定数值的最小值,小于最小值的也会报异常.
+	 * 			如果一切都解析正常,返回一个true的布尔类型
+	 * @Usage: 适用于数据判断的校验
+	 * @return boolean
+	 * @author ylx
+	 * @date 2017年12月26日 下午3:48:40
+	 */
+	public static boolean checkMinOfLong(final Object obj, long min) {
+		return checkRangeOfLong(obj, min, Long.MAX_VALUE);
+	}
+
+	/**
+	 * @Title: checkMaxOfLong
+	 * @Description: 针对传入的参数进行校验--->Long类型
+	 * @Detail: 参数类型虽然是Object,但是要求数据类型是String或者是Long类型的数据,而且String类型还必须是能被解析成整数的,否则会抛出异常.
+	 * 			而且还要限定数值的最大值,大于最大值的也会报异常.
+	 * 			如果一切都解析正常,返回一个true的布尔类型
+	 * @Usage: 适用于数据判断的校验
+	 * @return boolean
+	 * @author ylx
+	 * @date 2017年12月26日 下午3:48:40
+	 */
+	public static boolean checkMaxOfLong(final Object obj, long max) {
+		return checkRangeOfLong(obj, Long.MIN_VALUE, max);
+	}
+	
+	/**
+	 * @Title: checkOfLong
+	 * @Description: 针对传入的参数进行校验--->Long类型
+	 * @Detail: 参数类型虽然是Object,但是要求数据类型是String或者是Long类型的数据,而且String类型还必须是能被解析成整数的,否则会抛出异常.
+	 * 			这个针对Long范围内类型数据的校验
+	 * 			如果一切都解析正常,返回一个true的布尔类型
+	 * @Usage: 适用于数据判断的校验
+	 * @return boolean
+	 * @author ylx
+	 * @date 2017年12月26日 下午3:48:40
+	 */
+	public static boolean checkOfLong(final Object obj) {
+		return checkRangeOfLong(obj, Long.MIN_VALUE, Long.MAX_VALUE);
+	}
+
+	/**
+	 * @Title: checkRangeAndAssignInt
+	 * @Description: 针对传入的参数进行校验--->Integer类型
+	 * @Detail: 参数类型虽然是Object,但是要求数据类型是String或者是Integer类型的数据,而且String类型还必须是能被解析成整数的,否则会抛出异常.
+	 * 			而且还要限定数值的范围,超出范围的也会报异常.
+	 * 			如果一切都解析正常,说明解析没有问题,结果将解析后的数值以int类型返回
+	 * @Usage: 适用于数据判断的校验和赋值同时进行
+	 * @return int
+	 * @author ylx
+	 * @date 2017年12月26日 下午3:48:40
+	 */
+	public static int checkRangeAndAssignInt(final Object obj, int min, int max) {
+		String number = null;
+		try {
+			if (obj == null) {
+				throw new NullPointerException();
+			}
+			number = String.class.cast(obj);
+			try {
+				return Integer.parseInt(number);
+			} catch (NumberFormatException e) {
+				throw new NumberFormatException();
+			}
+		} catch (Exception e) {
+			if (e instanceof NullPointerException) {
+				throw new NullPointerException("对象为null");
+			}
+			if (e instanceof NumberFormatException) {
+				throw new RuntimeException("数据类型解析异常");
+			}
+			Integer num = null;
+			try {
+				num = Integer.class.cast(obj);
+			} catch (Exception e1) {
+				throw new RuntimeException("数字解析异常");
+			}
+			if (num < min) {
+				throw new RuntimeException("最小值应该大于等于"+min);
+			}
+			if(num > max){
+				throw new RuntimeException("最大值应该小于等于"+max);
+			}
+			return num;
+		}
+	}
+
+	/**
+	 * @Title: checkMinAndAssignInt
+	 * @Description: 针对传入的参数进行校验--->Integer类型
+	 * @Detail: 参数类型虽然是Object,但是要求数据类型是String或者是Integer类型的数据,而且String类型还必须是能被解析成整数的,否则会抛出异常.
+	 * 			而且还要限定数值的最小值,小于最小值的也会报异常.
+	 * 			如果一切都解析正常,说明解析没有问题,结果将解析后的数值以int类型返回
+	 * @Usage: 适用于数据判断的校验和赋值同时进行
+	 * @return int
+	 * @author ylx
+	 * @date 2017年12月26日 下午3:48:40
+	 */
+	public static int checkMinAndAssignInt(final Object obj, int min) {
+		return checkRangeAndAssignInt(obj,min,Integer.MAX_VALUE);
+	}
+	
+	/**
+	 * @Title: checkMaxAndAssignInt
+	 * @Description: 针对传入的参数进行校验--->Integer类型
+	 * @Detail: 参数类型虽然是Object,但是要求数据类型是String或者是Integer类型的数据,而且String类型还必须是能被解析成整数的,否则会抛出异常.
+	 * 			而且还要限定数值的最大值,大于最大值的也会报异常.
+	 * 			如果一切都解析正常,说明解析没有问题,结果将解析后的数值以int类型返回
+	 * @Usage: 适用于数据判断的校验和赋值同时进行
+	 * @return int
+	 * @author ylx
+	 * @date 2017年12月26日 下午3:48:40
+	 */
+	public static int checkMaxAndAssignInt(final Object obj, int max) {
+		return checkRangeAndAssignInt(obj,Integer.MIN_VALUE,max);
+	}
+	
+	/**
+	 * @Title: checkAndAssignInt
+	 * @Description: 针对传入的参数进行校验--->Integer类型
+	 * @Detail: 参数类型虽然是Object,但是要求数据类型是String或者是Integer类型的数据,而且String类型还必须是能被解析成整数的,否则会抛出异常.
+	 * 			这个针对Integer范围内类型数据的校验和赋值
+	 * 			如果一切都解析正常,说明解析没有问题,结果将解析后的数值以int类型返回
+	 * @Usage: 适用于数据判断的校验和赋值同时进行
+	 * @return int
+	 * @author ylx
+	 * @date 2017年12月26日 下午3:48:40
+	 */
+	public static int checkAndAssignInt(final Object obj) {
+		return checkRangeAndAssignInt(obj,Integer.MIN_VALUE,Integer.MAX_VALUE);
+	}
+	
+	/**
+	 * @Title: range
+	 * @Description: 针对传入的参数进行校验--->Long类型
+	 * @Detail: 参数类型虽然是Object,但是要求数据类型是String或者是Long类型的数据,而且String类型还必须是能被解析成整数的,否则会抛出异常.
+	 * 			而且还要限定数值的范围,超出范围的也会报异常.
+	 * 			如果一切都解析正常,说明解析没有问题,结果将解析后的数值以long类型返回
+	 * @Usage: 适用于数据判断的校验和赋值同时进行
+	 * @return long
+	 * @author ylx
+	 * @date 2017年12月26日 下午3:48:40
+	 */
+	public static long checkRangeAndAssignLong(final Object obj, long min, long max) {
+		String number = null;
+		try {
+			if (obj == null) {
+				throw new NullPointerException();
+			}
+			number = String.class.cast(obj);
+			try {
+				return Long.parseLong(number);
+			} catch (NumberFormatException e) {
+				throw new NumberFormatException();
+			}
+		} catch (Exception e) {
+			if (e instanceof NullPointerException) {
+				throw new NullPointerException("对象为null");
+			}
+			if (e instanceof NumberFormatException) {
+				throw new RuntimeException("数据类型解析异常");
+			}
+			Long num = null;
+			try {
+				num=Long.parseLong(""+obj);
+			} catch (Exception e1) {
+				throw new RuntimeException("数字解析异常");
+			}
+			if (num < min) {
+				throw new RuntimeException("最小值应该大于等于"+min);
+			}
+			if(num > max){
+				throw new RuntimeException("最大值应该小于等于"+max);
+			}
+			return num;
+		}
+	}
+	
+	/**
+	 * @Title: range
+	 * @Description: 针对传入的参数进行校验--->Long类型
+	 * @Detail: 参数类型虽然是Object,但是要求数据类型是String或者是Long类型的数据,而且String类型还必须是能被解析成整数的,否则会抛出异常.
+	 * 			而且还要限定数值的最小值,小于最小值的也会报异常.
+	 * 			如果一切都解析正常,说明解析没有问题,结果将解析后的数值以long类型返回
+	 * @Usage: 适用于数据判断的校验和赋值同时进行
+	 * @return long
+	 * @author ylx
+	 * @date 2017年12月26日 下午3:48:40
+	 */
+	public static long checkMinAndAssignLong(final Object obj, long min) {
+		return checkRangeAndAssignLong(obj,min,Long.MAX_VALUE);
+	}
+	
+	/**
+	 * @Title: range
+	 * @Description: 针对传入的参数进行校验--->Long类型
+	 * @Detail: 参数类型虽然是Object,但是要求数据类型是String或者是Long类型的数据,而且String类型还必须是能被解析成整数的,否则会抛出异常.
+	 * 			而且还要限定数值的最大值,大于最大值的也会报异常.
+	 * 			如果一切都解析正常,说明解析没有问题,结果将解析后的数值以long类型返回
+	 * @Usage: 适用于数据判断的校验和赋值同时进行
+	 * @return long
+	 * @author ylx
+	 * @date 2017年12月26日 下午3:48:40
+	 */
+	public static long checkMaxAndAssignLong(final Object obj, long max) {
+		return checkRangeAndAssignLong(obj,Long.MIN_VALUE,max);
+	}
+	
+	/**
+	 * @Title: range
+	 * @Description: 针对传入的参数进行校验--->Long类型
+	 * @Detail: 参数类型虽然是Object,但是要求数据类型是String或者是Long类型的数据,而且String类型还必须是能被解析成整数的,否则会抛出异常.
+	 * 			这个针对Long范围内类型数据的校验和赋值
+	 * 			如果一切都解析正常,说明解析没有问题,结果将解析后的数值以long类型返回
+	 * @Usage: 适用于数据判断的校验和赋值同时进行
+	 * @return long
+	 * @author ylx
+	 * @date 2017年12月26日 下午3:48:40
+	 */
+	public static long checkAndAssignLong(final Object obj) {
+		return checkRangeAndAssignLong(obj,Long.MIN_VALUE,Long.MAX_VALUE);
+	}
+	/**
+	 * @Title: range
+	 * @Target: 针对空(null)
+	 * @Description: TODO(针对传入的参数进行非空(null)校验并返回string数据类型--->只针对String类型,校验和赋值同时进行,同时返回真实的String值)
+	 * @Attention: 保证传入的数据是字符串,且不能为空(null),否则报异常,正常就返回一个正常的String类型的参数
+	 * @return String
+	 * @author ylx
+	 * @date 2017年12月26日 下午3:48:40
+	 */
+	public static String checkNullAndAssignString(final Object obj){
+		try {
+			if (obj == null) {
+				throw new NullPointerException();
+			}
+			String str=String.class.cast(obj);
+			return str;
+		} catch (Exception e) {
+			if(e instanceof NullPointerException){
+				throw new NullPointerException("对象为null");
+			}
+			if(e instanceof ClassCastException){
+				throw new ClassCastException("强转String类型异常");
+			}
+			throw new RuntimeException();
+		}
+	}
+	
+	/**
+	 * @Title: checkEmptyAndAssignString
+	 * @Target: 针对空(null)和空字符串("")
+	 * @Description: TODO(针对传入的参数进行非空(null)和空字符串("")校验并返回string数据类型--->只针对String类型,校验和赋值同时进行,同时返回真实的String值)
+	 * @Attention: 保证传入的数据是字符串,且不能为空(null)和空字符串(""),否则报异常,正常就返回一个正常的String类型的参数
+	 * @return String
+	 * @author ylx
+	 * @date 2017年12月26日 下午3:48:40
+	 */
+	public static String checkEmptyAndAssignString(final Object obj){
+		try {
+			if (obj == null) {
+				throw new NullPointerException();
+			}
+			String str=String.class.cast(obj);
+			if("".equals(str)){
+				throw new RuntimeException("字符串不能为空");
+			}
+			return str;
+		} catch (Exception e) {
+			if(e instanceof NullPointerException){
+				throw new NullPointerException("对象为null");
+			}
+			if(e instanceof ClassCastException){
+				throw new ClassCastException("强转String类型异常");
+			}
+			throw new RuntimeException(e.getMessage());
+		}
+	}
+	
+	/**
+	 * @Title: checkBlankAndAssignString
+	 * @target: 针对空(null)和空字符串("")和空内容的字符串("   ")
+	 * @Description: TODO(针对传入的参数进行非空(null)和空字符串("")和空内容的字符串("   ")校验并返回string数据类型--->只针对String类型,校验和赋值同时进行,同时返回真实的String值)
+	 * @Attention: 保证传入的数据是字符串,且不能为空(null)和空字符串("")和空内容的字符串("   "),否则报异常,正常就返回一个正常的String类型的参数
+	 * @return String
+	 * @author ylx
+	 * @date 2017年12月26日 下午3:48:40
+	 */
+	public static String checkBlankAndAssignString(final Object obj){
+		try {
+			if (obj == null) {
+				throw new NullPointerException();
+			}
+			String str=String.class.cast(obj);
+			if("".equals(str.trim())){
+				throw new RuntimeException("字符串不能无任何内容");
+			}
+			return str;
+		} catch (Exception e) {
+			if(e instanceof NullPointerException){
+				throw new NullPointerException("对象为null");
+			}
+			if(e instanceof ClassCastException){
+				throw new ClassCastException("强转String类型异常");
+			}
+			throw new RuntimeException(e.getMessage());
+		}
+	}
+	
+	
+	/**
+	 * @Title: checkBlankStringAndAssignNullIfIsBlank
+	 * @Description: TODO(针对传入的Object类型参数进行非空(null)和空字符串("")和空内容的字符串("   ")校验并返回string数据类型,只要是null,""或"  "全部返回null,不会抛出异常,除非无法强转为String,其它情况正常转String)
+	 * @Attention: 默认返回null
+	 * @return String
+	 * @author ylx
+	 * @date 2017年12月26日 下午3:48:40
+	 */
+	public static String checkBlankStringAndAssignNullIfIsBlank(final Object obj){
+		try {
+			if (obj == null) {
+				return null;
+			}
+			String str=String.class.cast(obj);
+			if("".equals(str.trim())){
+				return null;
+			}
+			return str;
+		} catch (Exception e) {
+			throw new RuntimeException("String类型转换异常");
+		}
+	}
+	
+	/**
+	 * @Title: checkBlankStringAndAssignEmptyIfIsBlank
+	 * @Description: TODO(针对传入的参数进行非空(null)和空字符串("")和空内容的字符串("   ")校验并返回string数据类型,只要是null,""或"  "全部返回""空串,不会抛出异常,除非无法强转为String,其它情况正常转String)
+	 * @Attention: 默认返回""
+	 * @return String
+	 * @author ylx
+	 * @date 2017年12月26日 下午3:48:40
+	 */
+	public static String checkBlankStringAndAssignEmptyIfIsBlank(final Object obj){
+		try {
+			if (obj == null) {
+				return "";
+			}
+			String str=String.class.cast(obj);
+			if("".equals(str.trim())){
+				return "";
+			}
+			return str;
+		} catch (Exception e) {
+			throw new RuntimeException("String类型转换异常");
+		}
+	}
+	
+	/**
+	 * 
+	* @Title: checkAndAssignDefaultInt
+	* @Description: TODO(如果校验的Object不能转换Integer则抛出异常,如果是null,空字符串或者是长空串,统一返回用户指定的默认值defaultInt)
+	* @Attention: obj为null,空字符串""或者是长空串"   "都不会抛异常,而是直接返回默认值
+	* @return int    返回类型
+	* @author ylx
+	* @date 2017年12月27日 下午1:51:43
+	 */
+	public static int checkAndAssignDefaultInt(final Object obj,int defaultInt){
+		String number = null;
+		try {
+			if (obj == null) {
+				return defaultInt;
+			}
+			number = String.class.cast(obj);
+			if("".equals(number.trim())){
+				return defaultInt;
+			}
+			try {
+				return Integer.parseInt(number);
+			} catch (NumberFormatException e) {
+				throw new NumberFormatException();
+			}
+		} catch (Exception e) {
+			if (e instanceof NumberFormatException) {
+				throw new RuntimeException("数据类型解析异常");
+			}
+			Integer num = null;
+			try {
+				num = Integer.class.cast(obj);
+			} catch (Exception e1) {
+				throw new RuntimeException("Integer强转异常");
+			}
+			return num;
+		}
+	}
+	
+	
+	/**
+	 * 
+	* @Title: checkAndAssignDefaultLong
+	* @Description: TODO(如果校验的Object不能转换Long则抛出异常,如果是null,空字符串或者是长空串,统一返回用户指定的默认值defaultLong)
+	* @Attention: obj为null,空字符串""或者是长空串"   "都不会抛异常,而是直接返回默认值
+	* @Solved: 这里要特别注意下,Long.class.cast(obj)当obj是Integer时会出现异常,包装类不能像基本类型一样强转,所以这里改成num=Long.parseLong(""+obj);
+	* @return long    返回类型
+	* @author ylx
+	* @date 2017年12月27日 下午1:51:43
+	 */
+	public static long checkAndAssignDefaultLong(final Object obj,long defaultLong){
+		String number = null;
+		try {
+			if (obj == null) {
+				return defaultLong;
+			}
+			number = String.class.cast(obj);
+			if("".equals(number.trim())){
+				return defaultLong;
+			}
+			try {
+				return Long.parseLong(number);
+			} catch (NumberFormatException e) {
+				throw new NumberFormatException();
+			}
+		} catch (Exception e) {
+			if (e instanceof NumberFormatException) {
+				throw new RuntimeException("数据类型解析异常");
+			}
+			Long num = null;
+			try {
+				num=Long.parseLong(""+obj);
+			} catch (Exception e1) {
+				throw new RuntimeException("Long解析异常");
+			}
+			return num;
+		}
+	}
+	
+
+	/*public static void main(String[] args) {
+		String json="{'KEY1':'12','KEY2':23,'KEY3':null}";
+		Map parseObject = JSON.parseObject(json, Map.class);
+		Object obj=20000000;
+		long checkAndAssignDefaultLong = checkAndAssignDefaultLong(obj,1000);
+		System.out.println(checkAndAssignDefaultLong);
+//		Long.class.cast(obj
+//		Long cast = Long.class.cast(1L);
+//		System.out.println(checkAndAssignDefaultLong);
+	}*/
+
+}

+ 119 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/web/AccountMaintenanceAction.java

@@ -0,0 +1,119 @@
+package com.fuzamei.web;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.multipart.MultipartFile;
+
+import com.fuzamei.service.AccountMaintenanceService;
+import com.fuzamei.utils.HashXiZhiUtil;
+import com.fuzamei.utils.JSONUtil;
+import com.fuzamei.utils.PageDTO;
+
+@Controller
+@RequestMapping(value = "/AccountMaintenance")
+public class AccountMaintenanceAction {
+	@Autowired
+	private AccountMaintenanceService  accountMaintenanceService;//注入service
+
+	/**  
+    *  账户开立 添加客户名称和银行账号  上传3份资料  分别插入  附件表  操作记录表,账户开立表
+    *  需要完成【申请输】【账户承诺书】【其他凭证】3个文件的上传,插入账务开立表1条数据,插入附件表3条数据,还有插入操作历史1条数据)
+    * @param  
+    * @param   
+    * @throws Exception  
+    */
+   @RequestMapping(value="/uploadOrInsertAccountMaintenance",method=RequestMethod.POST)  
+   @ResponseBody  
+   public Map<String,Object> uploadOrInsertBankAccount(@RequestParam("basic_data_id") MultipartFile file,
+		@RequestParam("letter_of_commitment_id") MultipartFile file2 ,
+   		@RequestParam("application_id") MultipartFile file3, HttpServletRequest request,
+   	    @RequestParam("customer_name") String customer_name,
+   	    @RequestParam("bank_account") String bank_account) throws IOException{
+	   try {
+		   String path = "D:\\tomcate\\apache-tomcat-8.5.24\\webapps"+request.getServletContext().getContextPath()+"\\testCeshi";  
+             File dir = new File(path);          
+             if(!dir.exists()){  
+                 dir.mkdirs();   
+             }  
+             Map<String, Object> map = new LinkedHashMap<String, Object>();
+             map.put("customer_name", customer_name);  
+             map.put("bank_account", bank_account);//可以不要  不输入参数   直接在service里put进去   后台插入要求格式以622707开头
+		     //同时上传三个文件 应该对几个文件产生几个哈希值??????
+             //其他凭证 
+             String fileName = file.getOriginalFilename();  
+             String pathFile=path+"/"+fileName;
+             File newfile = new File(pathFile); 
+             file.transferTo(newfile);
+             map.put("basicAttachment_id", 1001);//附件id暂时写死
+     		 map.put("basicAttachment_name", fileName);
+     	     map.put("basicUrl","\\testCeshi"+fileName);
+     	     
+     	     //账户承诺书
+    	     String fileName2 = file2.getOriginalFilename();  
+             String pathFile2=path+"/"+fileName2;
+             File newfile2 = new File(pathFile2); 
+             file2.transferTo(newfile2);
+             map.put("letterAttachment_id", 1002);//附件id暂时写死
+    		 map.put("letterAttachment_name", fileName2);
+    	     map.put("letterUrl","\\testCeshi"+fileName2);
+    	     //开户申请书
+        	 String fileName3 = file3.getOriginalFilename();  
+             String pathFile3=path+"/"+fileName3;
+             File newfile3 = new File(pathFile3); 
+             file3.transferTo(newfile3);
+             map.put("applicationAttachment_id", 1003);//附件id暂时写死
+     	     map.put("applicationAttachment_name", fileName3);
+     	     map.put("applicationUrl","\\testCeshi"+fileName3);
+     	     
+
+     	    accountMaintenanceService.insertIntoAccountINfo(map);//将经办支行提交的所有数据信息通过map传入service层先进行校验
+     	   return JSONUtil.getJsonMap(200, true, "上传成功",null); //返回给前端一个map进行前段提示
+	} catch (Exception e) {
+		   return JSONUtil.getJsonMap(500, false, "上传出错"+e.getMessage(),null); //返回给前端一个map进行前段提示
+	}
+	
+   }
+   
+   /**
+    * 查询账户维护信息 列表
+    * @param data
+    * @return
+    */
+    @PostMapping(value = "/selectAccountMaintenanceInfo")//@PostMapping此注解 提交方式为post
+	@ResponseBody
+	public Map<String, Object> selectAccountMaintenanceInfo(@RequestBody String data) {
+		//System.out.println("查询账户维护开立信息列表");
+		Map<String, Object> mapResult = new LinkedHashMap<String, Object>();
+		Map<String, Object> map = JSONUtil.jsonToMap(data);
+		PageDTO pageDto=accountMaintenanceService.selectAccountMaintenanceInfo(map);
+		mapResult = JSONUtil.getJsonMap(200, true, "操作查询成功", pageDto);
+
+		return mapResult;
+	}
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+}

+ 40 - 5
ccb_fund_trusteeship/src/main/java/com/fuzamei/web/AccountOpenAction.java

@@ -18,9 +18,11 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.multipart.MultipartFile;
 
+import com.alibaba.fastjson.JSON;
 import com.fuzamei.service.AccountOpenService;
 import com.fuzamei.utils.JSONUtil;
 import com.fuzamei.utils.PageDTO;
+import com.fuzamei.utils.ValidationUtil;
 
 @Controller
 @RequestMapping(value = "/Account")
@@ -29,7 +31,12 @@ public class AccountOpenAction {
 
 	@Autowired
 	private AccountOpenService  accountService;//注入service
-
+	private static final int ROW_NUM = 10; // 分页每页显示数据的数量(固定10条数据)
+    /**
+     * 查询账户开立
+     * @param data
+     * @return
+     */
 	@RequestMapping(value = "/queryAccountInfo", method = RequestMethod.POST)
 	@ResponseBody
 	public Map<String, Object> queryAccountInfo(@RequestBody String data) {
@@ -42,10 +49,16 @@ public class AccountOpenAction {
 		return mapResult;
 	}
 	
+	/**
+	 * 查询提示函   管理人接收列表
+	 * @param data
+	 * @return
+	 */
+	
 	@RequestMapping(value = "/selectPromptLetter", method = RequestMethod.POST)
 	@ResponseBody
 	public Map<String, Object> selectPromptLetter(@RequestBody String data) {
-		//System.out.println("查询风险提示函信息列表");
+		//System.out.println("管理人查询风险提示函信息列表");
 		Map<String, Object> mapResult = new LinkedHashMap<String, Object>();
 		Map<String, Object> map = JSONUtil.jsonToMap(data);
 		PageDTO pageDto=  accountService.selectPromptLetter(map);
@@ -54,7 +67,11 @@ public class AccountOpenAction {
 		return mapResult;
 	}
 	
-
+	/**
+	 * 查询提示函 发送人的列表   还没做好
+	 * @param data
+	 * @return
+	 */
 	@RequestMapping(value = "/selectTishihan", method = RequestMethod.POST)
 	@ResponseBody
 	public Map<String, Object> selectTishihan(@RequestBody String data) {
@@ -66,10 +83,29 @@ public class AccountOpenAction {
 
 		return mapResult;
 	}
+	/**
+	 * 账户开立   点击查看  显示下载文件的提示框
+	 * @param data
+	 * @return
+	 */
+	@RequestMapping(value = "/selectAccountopenNoPage",method = RequestMethod.POST)
+	@ResponseBody
+	public Map<String, Object> selectAccountopenNoPage(@RequestBody String data){
+		
+		//System.out.println("账户开立查看....");
+		Map<String, Object> map = JSONUtil.jsonToMap(data);	// 将前端传过来的json数据转化为map对象,并将map对象传入service层进行数据校验
+		
+		Map<String, Object> mapFromService = accountService.selectAccountopenNoPage(map); //这里不要分页,只要service传过来一个map对象即可
+		
+		return JSONUtil.getJsonMap(200, true, "操作成功", mapFromService); //将从service返回回来的map对象通过map对象直接返回给前端
+	}
+	
+	
+	
 	
 	
 	 /**  
-     *  添加客户名称和银行账号  上传资料
+     *  账户开立 添加客户名称和银行账号  上传3份资料
      * @param  
      * @param   
      * @throws Exception  
@@ -91,7 +127,6 @@ public class AccountOpenAction {
              map.put("customer_name", customer_name);  
              map.put("bank_account", bank_account);//可以不要  不输入参数   直接在service里put进去
      
-		    
             //基本资料 
             String fileName = file.getOriginalFilename();  
             String pathFile=path+"/"+fileName;

+ 28 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/web/BusinessDeclareAction.java

@@ -7,12 +7,19 @@ import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URLEncoder;
+import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import javax.validation.ConstraintViolation;
+import javax.validation.Valid;
+import javax.validation.Validation;
+import javax.validation.Validator;
+import javax.validation.ValidatorFactory;
 
 import org.apache.commons.io.FileUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -21,6 +28,9 @@ import org.springframework.http.HttpStatus;
 import org.springframework.http.MediaType;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
+import org.springframework.validation.BindingResult;
+import org.springframework.validation.FieldError;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -28,6 +38,7 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.multipart.MultipartFile;
 
+import com.alibaba.fastjson.JSON;
 import com.fuzamei.entity.BusinessCheck;
 import com.fuzamei.service.BusinessDeclareService;
 import com.fuzamei.utils.JSONUtil;
@@ -323,6 +334,23 @@ public class BusinessDeclareAction {
 	}
 	
 	
+	/*@RequestMapping(value="/test")
+	@ResponseBody
+	public Map<String, Object> test(@RequestBody String data){
+		try {
+			TestBO testBO = JSON.parseObject(data, TestBO.class);
+			List<String> list=validate(testBO);
+			if(!list.isEmpty()){
+				throw new RuntimeException(list.get(0));
+			}
+			return JSONUtil.getJsonMap(200, true, "成功",null);
+		} catch (Exception e) {
+			return JSONUtil.getJsonMap(200, true, "失败:"+e.getMessage(),null);
+		}
+	}*/
+	
+	
+	
 	
 	/**
 	 * 上传文件功能模块

+ 23 - 1
ccb_fund_trusteeship/src/main/java/com/fuzamei/web/CapitalTransferAction.java

@@ -43,7 +43,7 @@ public class CapitalTransferAction {
 	}
 	
 	/**{ 
-	    "fund_id":"1005"   postman 传id
+	    "fund_id":"1005"   postman 传id
        }
 	 * 资金划转查看详情
 	 * @param data
@@ -58,6 +58,28 @@ public class CapitalTransferAction {
 		return JSONUtil.getJsonMap(200, true, "操作成功", map1);
 		
 	}
+	/**
+	 * 划转资金审核的意见提交
+	 * @param data
+	 * @return
+	 * @return Map<String,Object>返回类型
+	 * 
+	 */
+	@RequestMapping(value="/insertCheckTransfer",method=RequestMethod.POST)
+	@ResponseBody
+	public Map<String,Object> insertCheckTransfer(@RequestBody String data){
+		
+		try {
+			//System.out.println("添加到划转审核总表信息....");
+			Map<String, Object> map = JSONUtil.jsonToMap(data);		//将前端传过来的json数据转化为map对象,并将map对象传入service层进行数据校验
+			capitalTransferService.insertCheckTransfer(map);
+			
+			return JSONUtil.getJsonMap(200, true, "添加审核意见成功", null);
+		} catch (Exception e) {
+			return JSONUtil.getJsonMap(500, false, "添加审核意见失败:"+e.getMessage(), null);
+		}
+		
+	}
 	
 	
 	

+ 106 - 22
ccb_fund_trusteeship/src/main/java/com/fuzamei/web/OperationHistoryAction.java

@@ -4,6 +4,7 @@ import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.LinkedHashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Scanner;
 
@@ -15,9 +16,15 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.ResponseBody;
 
+import com.alibaba.fastjson.JSON;
+import com.fuzamei.entity.OperationHistoryBO;
+import com.fuzamei.entity.UserDetail;
 import com.fuzamei.service.OperationHistoryService;
+import com.fuzamei.service.UserAuthoricationService;
 import com.fuzamei.utils.JSONUtil;
 import com.fuzamei.utils.PageDTO;
+import com.fuzamei.utils.StringUtil;
+import com.fuzamei.utils.ValidationUtil;
 
 
 @Controller
@@ -27,13 +34,16 @@ public class OperationHistoryAction {
 	@Autowired
 	private OperationHistoryService operationHistoryService;
 	
+	private static final int ROW_NUM = 10; // 分页每页显示数据的数量
 	/**
 	 * 
 	* @Title: queryOperationHistoryInformation
 	* @Description: TODO(查询操作记录信息....)
 	* @param @param data--前台传递过来的application/json数据
 	* 				传递过来的参数json格式为:
+	* 				全部是字符串
 					{
+						"userId":"xxx",
 						"page":"1",			
 						"account":"",
 						"role":"",
@@ -50,32 +60,106 @@ public class OperationHistoryAction {
 	@RequestMapping(value="/queryOperationHistoryInformation",method=RequestMethod.POST)
 	@ResponseBody
 	public Map<String,Object> queryOperationHistoryInformation(@RequestBody String data){
-		
-		System.out.println("查询操作记录信息....");
-		
-		Map<String, Object> map = JSONUtil.jsonToMap(data);		//将前端传过来的json数据转化为map对象,并将map对象传入service层进行数据校验
-		
-		PageDTO pageDto = operationHistoryService.queryOperationHistoryInformation(map);
-		
-		return JSONUtil.getJsonMap(200, true, "操作成功", pageDto);
+		try {
+			System.out.println("查询操作记录信息....");
+			@SuppressWarnings("unchecked")
+			Map<String, String> map = JSON.parseObject(data, Map.class);	//将前端传过来的json数据转化为map对象,并将map对象传入service层进行数据校验
+			int userId = ValidationUtil.checkAndAssignInt(map.get("userId"));	//userId只要是一个int类型即可
+			int page = ValidationUtil.checkMinAndAssignInt(map.get("page"), 1); // 默认页是第一页
+			String account = ValidationUtil.checkBlankStringAndAssignEmptyIfIsBlank(map.get("account")); // 账号默认空值""(空串,也可以是null,根据需求改)
+			String role = ValidationUtil.checkBlankStringAndAssignEmptyIfIsBlank(map.get("role")); // 操作角色默认空值""
+			String type = ValidationUtil.checkBlankStringAndAssignEmptyIfIsBlank(map.get("type"));; // 操作类型默认空值""
+			long startTime = ValidationUtil.checkAndAssignDefaultLong(map.get("startTime"), 0); // 开始时间默认0
+			long endTime = ValidationUtil.checkAndAssignDefaultLong(map.get("endTime"), Long.MAX_VALUE); // 结束时间默认Long最大值
+			Map<String, Object> mapToService = new LinkedHashMap<String, Object>();
+			mapToService.put("userId", userId);					//用户id用于查询权限或者角色信息
+			mapToService.put("startPage", (page - 1) * ROW_NUM);
+			mapToService.put("account", account);
+			mapToService.put("role", role);
+			mapToService.put("type", type);
+			if (startTime <= endTime) {
+				mapToService.put("startTime", startTime);
+				mapToService.put("endTime", endTime);
+			} else {
+				mapToService.put("startTime", startTime);
+				mapToService.put("endTime", Long.MAX_VALUE);
+			}
+			mapToService.put("rowNum", ROW_NUM); //默认每页显示数据是10条,可根据需求修改分页数量
+			PageDTO pageDto = operationHistoryService.queryOperationHistoryInformation(mapToService);
+			return JSONUtil.getJsonMap(200, true, "查询成功", pageDto);
+		} catch (Exception e) {
+			return JSONUtil.getJsonMap(500, false, "查询失败:"+e.getMessage(), null);
+		}
 	}
 	
 	
 	
-	/*//算数据库中bigint的时间用的
-	public static void main(String[] args) throws ParseException {
-		SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
-		Scanner scan=new Scanner(System.in);
-		while(true){
-		String str=scan.next();
-		Date parse = sdf.parse(str);
-		System.out.println(parse.getTime());
-		}
-		
+	/*@RequestMapping(value="/test",method=RequestMethod.POST)
+	@ResponseBody
+	public Map<String,Object> test(@RequestBody String data){
+		int userId=15254122;
+		UserDetail detail=operationHistoryService.queryUserDetailInformation(userId);
+		System.out.println(detail);
+		return JSONUtil.getJsonMap(200, true, "查询成功", null);
 	}*/
 	
-	/*public static void main(String[] args) {
-		System.out.println(Long.MAX_VALUE);
-		System.out.println(Integer.parseInt("1.1"));
-	}*/
+	/*OperationHistoryBO operationHistoryBO = JSON.parseObject(data, OperationHistoryBO.class);
+	List<String> validateList = ValidationUtil.validate(operationHistoryBO);
+	if(!validateList.isEmpty()){
+		throw new RuntimeException(validateList.get(0));	//抛出校验失败异常
+	}
+	PageDTO pageDto = operationHistoryService.queryOperationHistoryInformation(operationHistoryBO);*/
+	
+	/*if (StringUtil.isNotEmpty(map.get("userId"))) { 		// 等于空就直接取空值
+	try {
+		userId = Integer.parseInt((String) map.get("userId"));
+	} catch (Exception e) {
+		throw new RuntimeException("userId类型转换异常");
+	}
+}
+if (StringUtil.isNotEmpty(map.get("page"))) { 			// 等于空就直接取第一页
+	try {
+		page = Integer.parseInt((String) map.get("page"));
+		if (page < 1) {
+			page = 1;
+		}
+	} catch (Exception e) {
+		throw new RuntimeException("page类型转换异常");
+	}
+}
+if (StringUtil.isNotEmpty(map.get("account"))) { 		// 等于空就直接取空值
+	try {
+		account = (String) map.get("account");
+	} catch (Exception e) {
+		throw new RuntimeException("account类型转换异常");
+	}
+}
+if (StringUtil.isNotEmpty(map.get("role"))) { 			// 等于空就直接取空值
+	try {
+		role = (String) map.get("role");
+	} catch (Exception e) {
+		throw new RuntimeException("role类型转换异常");
+	}
+}
+if (StringUtil.isNotEmpty(map.get("type"))) { 			// 等于空就直接取空值
+	try {
+		type = (String) map.get("type");
+	} catch (Exception e) {
+		throw new RuntimeException("type类型转换异常");
+	}
+}
+if (StringUtil.isNotEmpty(map.get("startTime"))) { // 等于空就直接取空值
+	try {
+		startTime = Long.parseLong((String) map.get("startTime"));
+	} catch (Exception e) {
+		throw new RuntimeException("startTime类型转换异常");// 数据解析异常或转换类型异常startTime还是0
+	}
+}
+if (StringUtil.isNotEmpty(map.get("endTime"))) { // 等于空就直接取空值
+	try {
+		endTime = Long.parseLong((String) map.get("endTime"));
+	} catch (Exception e) {
+		throw new RuntimeException("endTime类型转换异常");// 数据解析异常或转换类型异常endTime还是9223372036854775807L
+	}
+}*/
 }

+ 140 - 44
ccb_fund_trusteeship/src/main/java/com/fuzamei/web/ProjectFileAction.java

@@ -26,9 +26,16 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.multipart.MultipartFile;
 
+import com.alibaba.fastjson.JSON;
+import com.fuzamei.constant.HintMSG;
+import com.fuzamei.constant.Role;
+import com.fuzamei.entity.UserDetail;
 import com.fuzamei.service.ProjectFileService;
+import com.fuzamei.service.UserAuthoricationService;
+import com.fuzamei.utils.HashXiZhiUtil;
 import com.fuzamei.utils.JSONUtil;
 import com.fuzamei.utils.PageDTO;
+import com.fuzamei.utils.ValidationUtil;
 
 @Controller
 @RequestMapping("/project_file")
@@ -36,7 +43,12 @@ public class ProjectFileAction {
 
 	@Autowired
 	private ProjectFileService projectFileService;
+	
+	@Autowired
+	private UserAuthoricationService userAuthoricationService;
 
+	private static final int ROW_NUM = 10; // 分页每页显示数据的数量(固定10条数据)
+	
 	private static final String SP = File.separator;
 	/**
 	 * 
@@ -45,6 +57,7 @@ public class ProjectFileAction {
 	 * TODO(获取项目文档信息,用于展示项目文档基本信息展示) 
 	 * 			以下为前端传递过来的参数
 				 {
+				 	"userId":"XXX"
 					"page":"1",
 					"projectName":"",
 					"startTime":"",
@@ -57,23 +70,47 @@ public class ProjectFileAction {
 	 * @author ylx 
 	 * @date 2017年12月15日下午1:24:40
 	 */
+	@SuppressWarnings("unchecked")
 	@RequestMapping(value = "/queryProjectFileInformation")
 	@ResponseBody
 	public Map<String, Object> queryProjectFileInformation(@RequestBody String data) {
-
-		System.out.println("查询项目文档记录信息....");
-
-		Map<String, Object> map = JSONUtil.jsonToMap(data);
-
-		PageDTO pageDto = projectFileService.queryProjectFileInformation(map); // 将前端传过来的json数据转化为map对象,并将map对象传入service层进行数据校验
-
-		return JSONUtil.getJsonMap(200, true, "操作成功", pageDto);
+		try {
+			System.out.println("查询项目文档记录信息....");
+			Map<String, String> map = JSON.parseObject(data, Map.class);	//将前端传过来的json数据转化为map对象,并将map对象传入service层进行数据校验
+			int userId = ValidationUtil.checkAndAssignInt(map.get("userId"));	//userId只要是一个int类型即可
+			int page = ValidationUtil.checkMinAndAssignInt(map.get("page"), 1); // 默认页数是第一页
+			String projectName = ValidationUtil.checkBlankStringAndAssignEmptyIfIsBlank(map.get("projectName")); // 默认名称为空值
+			long startTime = ValidationUtil.checkAndAssignDefaultLong(map.get("startTime"), 0); // 默认起始时间为0
+			long endTime = ValidationUtil.checkAndAssignDefaultLong(map.get("endTime"), Long.MAX_VALUE); // 默认终止时间为Long最大值
+			Map<String, Object> mapToService = new LinkedHashMap<String, Object>();
+			mapToService.put("userId", userId);					//用户id用于查询权限或者角色信息
+			mapToService.put("startPage", (page - 1) * ROW_NUM);
+			mapToService.put("projectName", projectName);
+			if (startTime <= endTime) {
+				mapToService.put("startTime", startTime);
+				mapToService.put("endTime", endTime);
+			} else {
+				mapToService.put("startTime", startTime);
+				mapToService.put("endTime", Long.MAX_VALUE);
+			}
+			mapToService.put("rowNum", ROW_NUM); // 默认每页显示数据是10条,可根据需求修改分页数量
+			PageDTO pageDto = projectFileService.queryProjectFileInformation(mapToService); // 将前端传过来的json数据转化为map对象,并将map对象传入service层进行数据校验
+			return JSONUtil.getJsonMap(200, true, HintMSG.QUERY_SUCCESS, pageDto);
+		} catch (Exception e) {
+			return JSONUtil.getJsonMap(500, false, HintMSG.QUERY_FAIL+":"+e.getMessage(), null);
+		}
 	}
 	
 	/**
 	 * 
 	* @Title: checkoutProjectFiles
 	* @Description: TODO--------------->>显示下载文件的提示框
+	* 				以下为前端传递过来的参数
+				 {
+				 	"userId":"XXX"
+					"projectId":"",
+					"projectName":"",
+				}
 	* @param @param data
 	* @param @return    设定文件
 	* @return Map<String,Object>    返回类型
@@ -81,25 +118,33 @@ public class ProjectFileAction {
 	* @date 2017年12月15日 下午8:09:44
 	* @throws
 	 */
+	@SuppressWarnings("unchecked")
 	@RequestMapping(value = "/checkoutProjectFiles")
 	@ResponseBody
 	public Map<String, Object> checkoutProjectFiles(@RequestBody String data){
-		
-		System.out.println("项目文档查看....");
-		
-		Map<String, Object> map = JSONUtil.jsonToMap(data);	// 将前端传过来的json数据转化为map对象,并将map对象传入service层进行数据校验
-		
-		Map<String, Object> mapFromService = projectFileService.checkoutProjectFiles(map); //由于这里不需要分页,只要service传过来一个map对象即可
-		
-		return JSONUtil.getJsonMap(200, true, "操作成功", mapFromService); //将从service返回回来的map对象通过map对象直接返回给前端
+		try {
+			System.out.println("项目文档查看....");
+			Map<String, Object> map = JSON.parseObject(data, Map.class);	// 将前端传过来的json数据转化为map对象,并将map对象传入service层进行数据校验
+			int userId = ValidationUtil.checkAndAssignInt(map.get("userId"));	//userId只要是一个int类型即可
+			Integer projectId = ValidationUtil.checkAndAssignDefaultInt(map.get("projectId"),0);	//默认项目编号为空
+			String projectName=ValidationUtil.checkBlankStringAndAssignEmptyIfIsBlank(map.get("projectName"));		//默认项目名称为空值
+			Map<String, Object> mapToService = new LinkedHashMap<String, Object>();
+			mapToService.put("userId", userId);
+			mapToService.put("projectId", projectId);
+			mapToService.put("projectName", projectName);
+			Map<String, Object> mapFromService = projectFileService.checkoutProjectFiles(map); //由于这里不需要分页,只要service传过来一个map对象即可
+			return JSONUtil.getJsonMap(200, true, HintMSG.CHECK_SUCCESS, mapFromService); //将从service返回回来的map对象通过map对象直接返回给前端
+		} catch (Exception e) {
+			return JSONUtil.getJsonMap(500, false, HintMSG.CHECK_FAIL+":"+e.getMessage(), null); 
+		}
 	}
 	
 	/**
 	 * 
 	* @Title: download
 	* @Description: TODO(项目文档中的文件下载功能实现)
-	* @param @param request
-	* @param @param response
+	* 				前端传来一个get或post请求
+	* 				
 	* @param @param url    设定文件
 	* @return void    返回类型
 	* @author ylx
@@ -108,9 +153,15 @@ public class ProjectFileAction {
 	 */
 	@RequestMapping(value="/downloadProjectFile")
 	@ResponseBody
-	public Map<String, Object> download(HttpServletRequest request,HttpServletResponse response,@RequestParam("url") String url) {
+	public Map<String, Object> download(HttpServletRequest request,HttpServletResponse response,@RequestParam("url") String url,@RequestParam("userId") Object id) {
 		try {
+			int userId=ValidationUtil.checkAndAssignInt(id);
+			userAuthoricationService.checkUserAuthority(userId,Role.SUPERVISION_AGENCY,Role.ARCHIVE_KEEPING_POS_OF_PBBTBC);//查看用户是否为空及是否有权限下载项目文档文件
 			String fileName = request.getServletContext().getRealPath("")+url;  		//SP是系统分隔符
+			//如果文件不存在直接抛出异常
+			if(!new File(fileName).exists()){
+				throw new RuntimeException(HintMSG.FILE_NOT_FOUND);
+			}
 			InputStream bis = new BufferedInputStream(new FileInputStream(new File(fileName)));  
 			String filename = url.substring(url.lastIndexOf("/")+1);  //截取文件名
 			filename = URLEncoder.encode(filename,"UTF-8");
@@ -124,9 +175,9 @@ public class ProjectFileAction {
 			}  
 			out.close();
 			bis.close();
-			return JSONUtil.getJsonMap(200, true, "下载成功",null); //返回给前端一个map进行前段提示
+			return JSONUtil.getJsonMap(200, true, HintMSG.DOWNLOAD_SUCCESS,null); //返回给前端一个map进行前段提示
 		} catch (Exception e) {
-			return JSONUtil.getJsonMap(500, false, "下载出现异常:"+e.getMessage(),null); //返回给前端一个map进行前段提示
+			return JSONUtil.getJsonMap(500, false, HintMSG.DOWNLOAD_FAIL+":"+e.getMessage(),null); //返回给前端一个map进行前段提示
 		}
 	}
 	
@@ -134,52 +185,97 @@ public class ProjectFileAction {
 	 * 
 	* @Title: showUploadProjectFileInterface
 	* @Description: TODO------------->>显示项目文档上传的界面
+	* 			以下为前端传递过来的参数
+				 {
+				 	"userId":"XXX"
+					"projectId":"",
+					"projectName":"",
+				}
 	* @param @return    设定文件
 	* @return Map<String,Object>    返回类型
 	* @author ylx
 	* @date 2017年12月15日 下午8:11:09
 	* @throws
 	 */
-	/*@RequestMapping(value = "/showUploadProjectFileInterface")
+	@SuppressWarnings("unchecked")
+	@RequestMapping(value = "/showUploadProjectFileInterface")
 	@ResponseBody
-	public Map<String, Object> showUploadProjectFileInterface(){
-		
-	}*/
+	public Map<String, Object> showUploadProjectFileInterface(@RequestBody String data){
+		try {
+			Map<String,Object> map = JSON.parseObject(data, Map.class);
+			int userId = ValidationUtil.checkAndAssignInt(map.get("userId"));									//userId只要是一个int类型即可
+			userAuthoricationService.checkUserAuthority(userId,Role.ARCHIVE_KEEPING_POS_OF_PBBTBC);				//该权限只有	【省分行托管分中心档案保管岗】才能操作
+			Integer projectId = ValidationUtil.checkAndAssignDefaultInt(map.get("projectId"),-1);				//默认项目编号为-1,就是让你查不到
+			String projectName=ValidationUtil.checkBlankStringAndAssignEmptyIfIsBlank(map.get("projectName"));	//默认项目名称为空值
+			Map<String, Object> mapToClient =new LinkedHashMap<String, Object>();
+			mapToClient.put("projectId", projectId);
+			mapToClient.put("projectName", projectName);
+			return JSONUtil.getJsonMap(200, true, HintMSG.CHECK_SUCCESS, mapToClient); 										//将从service返回回来的map对象通过map对象直接返回给前端
+		} catch (Exception e) {
+			return JSONUtil.getJsonMap(500, false, HintMSG.CHECK_FAIL+":"+e.getMessage(),null); 							//返回给前端一个map进行前段提示
+		}
+	}
 	
+	/**
+	 * 
+	* @Title: upload
+	* @Description: TODO(用户通过上传文件的界面上传文件,需要通过表单的形式将文件上传到服务器制定的存放路径)
+	* 			以下是表单的格式信息(按照一次一个文件上传)
+	* 			【userId:用户id号
+	* 			  file:上传的文件
+	* 			  projectId:项目id号
+	* 			  projectName:项目名称】
+	* 
+	* @param @param projectId
+	* @param @param projectName
+	* @param @param id
+	* @return Map<String,Object>    返回类型
+	* @author ylx
+	* @date 2017年12月27日 下午5:32:18
+	 */
 	@RequestMapping(value="/uploadProjetcFile",method=RequestMethod.POST)
 	@ResponseBody
-	public Map<String, Object> upload(@RequestParam("file") MultipartFile file,HttpServletRequest request,@RequestParam("projectId") String projectId,@RequestParam("projectName") String projectName ) {
-		
-//		Map<String, Object> map = JSONUtil.jsonToMap(data);	// 将前端传过来的json数据转化为map对象,并将map对象传入service层进行数据校验
-		
+	public Map<String, Object> upload(@RequestParam("file") MultipartFile file,//================================>>多文件上传?待定TODO
+									@RequestParam("projectId") String pId,
+									@RequestParam("projectName") String pName,
+									@RequestParam("userId") Object uId,
+									HttpServletRequest request) {
 		try {
-			String path = request.getServletContext().getRealPath("")+SP+"content";			//SP是系统分隔符	
+			int userId=ValidationUtil.checkAndAssignInt(uId);
+			UserDetail userDetail = userAuthoricationService.checkUserAuthority(userId,Role.ARCHIVE_KEEPING_POS_OF_PBBTBC);//查看用户是否为空及是否有权限下载项目文档文件
+			String projectId = ValidationUtil.checkBlankAndAssignString(pId);				//校验projectId并赋值
+			String projectName = ValidationUtil.checkBlankAndAssignString(pName);			//校验projectName并赋值
+			if(file.isEmpty()){
+				throw new RuntimeException(HintMSG.FILE_CANT_BE_NULL);						//校验上传的文件是否为空
+			}
+			String path = request.getServletContext().getRealPath("")+SP+"content";			//SP是系统分隔符,path是存放上传文件的父类文件夹绝对路径====>>这个路径要改TODO	
 			File dir=new File(path);
 			if(!dir.exists()){
 				dir.mkdirs();
 			}
-			
-			String filename = file.getOriginalFilename();
-			String pathFile=path+SP+filename;
+			String filename = file.getOriginalFilename();									//filename是上传文件的真实文件名
+			String pathFile=path+SP+filename;												//pathFile是该文件在系统中的绝对路径
 			File newFile=new File(pathFile);
-			file.transferTo(newFile);
-			
-			Map<String, Object> map =new LinkedHashMap<String, Object>();
 			
-			map.put("projectId", projectId);
-			map.put("projectName", projectName);
-			map.put("url", "/content/"+filename);		//将文件下载路径url通过map传到service层进行校验
-			map.put("attachmentName", filename);			//将文件以附件名的形式通过map传递到service层中进行校验
+			String fileHash = HashXiZhiUtil.getMD5Checksum(filename);						//文件上传后计算文件的hash值=============>>换hash算法这里直接换掉即可TODO			
+			Map<String, Object> mapToService =new LinkedHashMap<String, Object>();
+			mapToService.put("userDetail", userDetail);				//将用户的信息传入
+			mapToService.put("projectId", projectId);
+			mapToService.put("projectName", projectName);
+			mapToService.put("url", "/content/"+filename);			//将文件下载路径url通过map传到service层进行校验
+			mapToService.put("attachmentName", filename);			//将文件以附件名的形式通过map传递到service层中进行校验
+			mapToService.put("hash", fileHash);						//将上传的文件hash值放入map
+			projectFileService.insertInformationIntoTable(mapToService);		//将获取到的数据插入到各类表中
 			
-			projectFileService.insertInformationIntoTable(map);		//将获取到的数据插入到表中
+			//文件最后上传,防止出现垃圾数据
+			file.transferTo(newFile);														//文件已经上传成功
 			
-			Map<String, Object> mapResult = JSONUtil.getJsonMap(200, true, "上传成功",null); //返回给前端一个map进行前段提示
+			Map<String, Object> mapResult = JSONUtil.getJsonMap(200, true, HintMSG.UPLOAD_SUCCESS,null); //返回给前端一个map进行前段提示
 			return mapResult;
 		} catch (Exception e) {
-			Map<String, Object> mapResult = JSONUtil.getJsonMap(500, true, "上传出现异常"+e.getMessage(),null); //返回给前端一个map进行前段提示
+			Map<String, Object> mapResult = JSONUtil.getJsonMap(500, true, HintMSG.UPLOAD_FAIL+":"+e.getMessage(),null); //返回给前端一个map进行前段提示
 			return mapResult;
 		}
-		
 	}
 	
 }

+ 22 - 22
ccb_fund_trusteeship/src/main/java/com/fuzamei/web/PromptLetterAction.java

@@ -82,19 +82,19 @@ public class PromptLetterAction {
         }  
         out.close();  
     } */
-	/**
-	 * 风险提示函发函  上传
-	 * @param file
-	 * @param request
-	 * @param prompt_letter_id
-	 * @return
-	 * @throws IOException
-	 */
+		/**
+		 * 风险提示函发函  上传
+		 * @param file
+		 * @param request
+		 * @param prompt_letter_id
+		 * @return
+		 * @throws IOException
+		 */
 	    @RequestMapping(value="/uploadFile",method=RequestMethod.POST)  
 	    @ResponseBody  
 	    public Map<String,Object> upload(@RequestParam("file") MultipartFile file,HttpServletRequest request,@RequestParam("prompt_letter_id") String prompt_letter_id) throws IOException{  
 	        try {
-	        	String path = "D:\\tomcate\\apache-tomcat-8.5.24\\webapps"+request.getServletContext().getContextPath()+"\\UploadCeshi";  
+	        	String path = "D:\\tomcate\\apache-tomcat-8.5.24\\webapps"+request.getServletContext().getContextPath()+"\\Content";  
 	            File dir = new File(path);          
 	            if(!dir.exists()){  
 	                dir.mkdirs();  
@@ -103,23 +103,25 @@ public class PromptLetterAction {
 	            String pathFile=path+"/"+fileName;
 	            File newfile = new File(pathFile); 
 	            file.transferTo(newfile);
+	          String hash = HashXiZhiUtil.getMD5Checksum(pathFile);//上传(文件)之后产生哈希值      是对文件产生哈希值
+	          System.out.println(hash+"上传提示函的哈希值是");
 	            //MultipartFile自带的解析方法 
 	    		Map<String, Object> map = new LinkedHashMap<String, Object>();
-	    		map.put("prompt_letter_id", prompt_letter_id);//有问题   待改动   , 这里应该是管理人账号   这里只插入了一个账号到提示函表 别的字段没写,问清楚了在改
+	    		map.put("prompt_letter_id",prompt_letter_id);//有问题   待改动 
+	    		map.put("hash", hash);//上传的文件产生的哈希值插入到提示函表
 	    		
-	    		map.put("fileName", fileName);
-	    		map.put("url",fileName);
-	            accountService.insertTiShiHanOrUser(map);
-	            
+	    		//map.put("fileName", fileName);
+	    		map.put("url","/Content/"+fileName);
+				map.put("attachmentName", fileName);
+	            accountService.insertTiShiHanOrUserOrOtherTable(map);//在插入数据库
+	    	    
 	            Map<String, Object>	mapResult=JSONUtil.getJsonMap(200, true, "上传提示函成功", null);
-				return mapResult ;
+				return mapResult;
 			}
 	       catch (Exception e) {
 				Map<String, Object> mapResult=JSONUtil.getJsonMap(500, true, "上传提示函失败"+e.getMessage(), null);
 				return mapResult;
 			}
-		
-	    	
 	    }  
 	
     /**  
@@ -177,7 +179,6 @@ public class PromptLetterAction {
                dir.mkdirs();  
            }  
            //MultipartFile自带的解析方法  
-           
            String fileName = file.getOriginalFilename();  
            String pathFile=path+"/"+fileName;
            File newfile = new File(pathFile); 
@@ -186,11 +187,11 @@ public class PromptLetterAction {
    		   Map<String, Object> map = new LinkedHashMap<String, Object>();
    		   map.put("fileName", fileName);
    		   map.put("url",fileName);
+          accountService.insertTrueFalseSelect(map);
            
-           accountService.insertTrueFalseSelect(map);
-           //上传文件之后才会产生一条哈希值的
+           //是上传文件之后才会产生一条哈希值的
           // HashXiZhiUtil.getMd5("D:\\xiangnu\\123.doc");
-           HashXiZhiUtil.getMD5Checksum(pathFile);//调用方法 对(文件)产生一条哈希值
+         String hash=HashXiZhiUtil.getMD5Checksum(pathFile);//调用方法 对(文件)产生一条哈希值
         System.out.println( HashXiZhiUtil.getMD5Checksum(pathFile)+"--哈希值");//自己测试的
        	Map<String, Object> mapResult=JSONUtil.getJsonMap(200, true, "上传成功", null);//将查询出来的结果封装成map数据返回
             return mapResult ;
@@ -203,5 +204,4 @@ public class PromptLetterAction {
     
 
  
-	
 }

+ 359 - 54
ccb_fund_trusteeship/src/main/java/com/fuzamei/web/ValuationAccountingAction.java

@@ -8,6 +8,7 @@ import java.io.InputStream;
 import java.net.URLEncoder;
 import java.util.HashSet;
 import java.util.LinkedHashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
@@ -23,10 +24,20 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.multipart.MultipartFile;
 
+import com.alibaba.fastjson.JSON;
+import com.fuzamei.constant.BattleResult;
+import com.fuzamei.constant.HintMSG;
+import com.fuzamei.constant.Role;
+import com.fuzamei.entity.UserDetail;
+import com.fuzamei.entity.ValuationAccount;
+import com.fuzamei.service.AttachmentService;
+import com.fuzamei.service.UserAuthoricationService;
 import com.fuzamei.service.ValuationAccountingService;
 import com.fuzamei.utils.JSONUtil;
 import com.fuzamei.utils.MapUtil;
 import com.fuzamei.utils.PageDTO;
+//import com.fuzamei.utils.RelativePathUtil;
+import com.fuzamei.utils.ValidationUtil;
 
 /**
  * 估值核算模块实现
@@ -34,20 +45,34 @@ import com.fuzamei.utils.PageDTO;
  *
  */
 @Controller
-@RequestMapping("valuation_accounting")
+@RequestMapping("/valuation_accounting")
 public class ValuationAccountingAction {
 
 	@Autowired
 	private ValuationAccountingService valuationAccountingService;
 	
+	@Autowired
+	private UserAuthoricationService userAuthoricationService;
+	
+	@Autowired
+	private AttachmentService attachmentService;
+	
 	private static final String SP = File.separator;	//系统分隔符,随操作系统而决定
 	
+	private static final int ROW_NUM = 10; // 分页每页显示数据的数量
 	/**
 	 * 
 	* @Title: queryOperationHistoryInformation
 	* @Description: TODO(估值核算的查询结果,包括所有的查询条件也包括进去了)
-	* @param @param data
-	* @param @return    设定文件
+	* 				前端传过来的json格式为:
+	* 				{
+	* 					"userId":"xxx",
+	* 					"page":"1",
+	* 					"fundName":"",
+	* 					"battleResult":"",
+	* 					"startTime":"",
+	* 					"endTime":""
+	* 				}
 	* @return Map<String,Object>    返回类型
 	* @author ylx
 	* @date 2017年12月18日 下午3:17:30
@@ -56,22 +81,110 @@ public class ValuationAccountingAction {
 	@RequestMapping(value="/queryValuationAccountingInformation",method=RequestMethod.POST)
 	@ResponseBody
 	public Map<String,Object> queryOperationHistoryInformation(@RequestBody String data){
-		
-		System.out.println("查询估值核算数据");
-		
-		Map<String, Object> map = JSONUtil.jsonToMap(data);
-		
-		PageDTO pageDto = valuationAccountingService.queryValuationAccountingInformation(map);
-		
-		return JSONUtil.getJsonMap(200, true, "查询成功", pageDto);
+		try {
+			System.out.println("查询估值核算数据");
+			@SuppressWarnings("unchecked")
+			Map<String, Object> map = JSON.parseObject(data, Map.class);
+			int userId = ValidationUtil.checkAndAssignInt(map.get("userId"));										//userId只要是一个int类型即可
+			userAuthoricationService.checkUserAuthority(userId,Role.ADMIN,Role.ACCOUNTING_POS_OF_TBC);				//查看用户非空和权限
+			int page = ValidationUtil.checkMinAndAssignInt(map.get("page"), 1); 									// 默认页是第一页
+			String fundName=ValidationUtil.checkBlankStringAndAssignEmptyIfIsBlank(map.get("fundName"));			//基金名默认为空
+			String battleResult=ValidationUtil.checkBlankStringAndAssignEmptyIfIsBlank(map.get("battleResult"));	//比对结果默认为空
+			long startTime = ValidationUtil.checkAndAssignDefaultLong(map.get("startTime"), 0L); 					//开始时间默认0
+			long endTime = ValidationUtil.checkAndAssignDefaultLong(map.get("endTime"), Long.MAX_VALUE); 			//结束时间默认Long最大值
+			Map<String, Object> mapToService = new LinkedHashMap<String, Object>();									//这个map是去service层调取数据的
+			mapToService.put("userId", userId);
+			mapToService.put("startPage", (page - 1) * ROW_NUM);
+			mapToService.put("fundName", fundName);
+			mapToService.put("battleResult", battleResult);
+			//如果时间顺序错位,要重新进行排位
+			if (startTime <= endTime) {
+				mapToService.put("startTime", startTime);
+				mapToService.put("endTime", endTime);
+			} else {
+				mapToService.put("startTime", startTime);
+				mapToService.put("endTime", Long.MAX_VALUE);
+			}
+			mapToService.put("rowNum", ROW_NUM); // 默认每页显示数据是10条,可根据需求修改分页数量
+			PageDTO pageDto = valuationAccountingService.queryValuationAccountingInformation(mapToService);
+			return JSONUtil.getJsonMap(200, true, HintMSG.QUERY_SUCCESS, pageDto);
+		} catch (Exception e) {
+			return JSONUtil.getJsonMap(500, false, HintMSG.QUERY_FAIL+":"+e.getMessage(), null);
+		}
+	}
+	
+	
+	/**
+	 * 
+	* @Title: queryOperationHistoryInformation
+	* @Description: TODO(查看估值核算基金的下载信息的小弹框)
+	* @param @param data
+	* 				前端传过来的json格式
+	* 				{
+	* 					userId:"xxx",
+	* 					fundId:""
+	* 				}
+	* @param @return    设定文件
+	* @return Map<String,Object>    返回类型
+	* @author ylx
+	* @date 2017年12月28日 下午1:48:43
+	* @throws
+	 */
+	@RequestMapping(value="/checkoutDownloadInformation",method=RequestMethod.POST)
+	@ResponseBody
+	public Map<String,Object> checkoutDownloadInformation(@RequestBody String data){
+		try {
+			@SuppressWarnings("unchecked")
+			Map<String, Object> map = JSON.parseObject(data, Map.class);
+			int userId = ValidationUtil.checkAndAssignInt(map.get("userId"));										//userId只要是一个int类型即可
+			userAuthoricationService.checkUserAuthority(userId,Role.ADMIN,Role.ACCOUNTING_POS_OF_TBC);				//查看用户非空和权限
+			int fundId = ValidationUtil.checkAndAssignInt(map.get("fundId"));										//fundId只要是一个int类型即可
+			List<ValuationAccount> listToClient = valuationAccountingService.checkoutDownloadInformation(fundId);	//这个map是去service层调取数据的
+			return JSONUtil.getJsonMap(200, true, HintMSG.CHECK_SUCCESS, listToClient);
+		} catch (Exception e) {
+			return JSONUtil.getJsonMap(500, false, HintMSG.CHECK_FAIL+":"+e.getMessage(), null);
+		}
+	}
+	
+	
+	/**
+	 * 
+	* @Title: checkoutDownloadInformation
+	* @Description: TODO(管理人首次上传估值报表弹出的界面需要显示的ID号)
+	* 				前端传过来的json数据格式
+	* 				{
+	* 					"userId":"xxx"
+	* 				}
+	* @param @return    返回一个fundId的值用于弹框中首次创建基金id的回显
+	* @return Map<String,Object>    返回类型
+	* @author ylx
+	* @date 2017年12月28日 下午3:39:18
+	* @throws
+	 */
+	@RequestMapping(value="/fistUploadFundDataByAdmin",method=RequestMethod.POST)
+	@ResponseBody
+	public Map<String,Object> fistUploadFundDataByAdmin(@RequestBody String data){
+		try {
+			@SuppressWarnings("unchecked")
+			Map<String, Object> map = JSON.parseObject(data, Map.class);
+			int userId = ValidationUtil.checkAndAssignInt(map.get("userId"));										//userId只要是一个int类型即可
+			userAuthoricationService.checkUserAuthority(userId,Role.ADMIN);											//查看用户非空和权限
+			Map<String, Object> mapToClient = valuationAccountingService.generateFundId();							//这个map是去service层调fundId的
+			return JSONUtil.getJsonMap(200, true, HintMSG.CHECK_SUCCESS, mapToClient);
+		} catch (Exception e) {
+			return JSONUtil.getJsonMap(500, false, HintMSG.CHECK_FAIL+":"+e.getMessage(), null);
+		}
 	}
 	
+	
+	
 	/**
 	 * 
 	* @Title: download
 	* @Description: TODO(估值核算界面,下载功能实现)
-	* @param @param request
-	* @param @param response
+	* 				前端通过get或post发来请求
+	* 				url:链接地址
+	* 				userId:用户id号
 	* @param @param url
 	* @param @return    设定文件
 	* @return Map<String,Object>    返回类型
@@ -81,9 +194,18 @@ public class ValuationAccountingAction {
 	 */
 	@RequestMapping(value="/downloadValuationPOI")
 	@ResponseBody
-	public Map<String, Object> download(HttpServletRequest request,HttpServletResponse response,@RequestParam("url") String url) {
+	public Map<String, Object> download(HttpServletRequest request,HttpServletResponse response,
+										@RequestParam("url") String url,
+										@RequestParam("userId") Object uId) {
 		try {
+			int userId=ValidationUtil.checkAndAssignInt(uId);
+			userAuthoricationService.checkUserAuthority(userId,Role.ADMIN,Role.ACCOUNTING_POS_OF_TBC);	//查看用户非空和权限(管理员和核算岗都能进行下载)
+			url=ValidationUtil.checkBlankAndAssignString(url);							//对传过来的url进行非空校验
 			String fileName = request.getServletContext().getRealPath("")+url;  		//SP是系统分隔符
+			//如果文件不存在直接抛出异常
+			if(!new File(fileName).exists()){
+				throw new RuntimeException(HintMSG.FILE_NOT_FOUND);
+			}
 			InputStream bis = new BufferedInputStream(new FileInputStream(new File(fileName)));  
 			String filename = url.substring(url.lastIndexOf("/")+1);  //截取文件名
 			filename = URLEncoder.encode(filename,"UTF-8");
@@ -97,9 +219,9 @@ public class ValuationAccountingAction {
 			}  
 			out.close();
 			bis.close();
-			return JSONUtil.getJsonMap(200, true, "下载成功",null); //返回给前端一个map进行前段提示
+			return JSONUtil.getJsonMap(200, true, HintMSG.DOWNLOAD_SUCCESS,null); //返回给前端一个map进行前段提示
 		} catch (Exception e) {
-			return JSONUtil.getJsonMap(500, false, "下载出现异常:"+e.getMessage(),null); //返回给前端一个map进行前段提示
+			return JSONUtil.getJsonMap(500, false, HintMSG.DOWNLOAD_FAIL+":"+e.getMessage(),null); //返回给前端一个map进行前段提示
 		}
 	}
 	
@@ -108,47 +230,78 @@ public class ValuationAccountingAction {
 	* @Title: upload
 	* @Description: TODO(实现管理员估值核算的报表文件上传功能---------->>暂时按照一次上传一个文件进行实现)
 	* 
-	* 如果是管理岗的人员进行上传,则是创建一条新的数据进数据库,同时在附件表中插入一条新的数据
+	* 因为是首次创建,管理岗的人员进行上传,则是创建一条新的数据进数据库,同时在附件表中插入一条新的数据,同时还要在操作记录也要插入一条操作记录,操作记录hash以这个文件的hash为准
+	* @ Attention: 首次上传,所以大部分的信息可以写死
+	* 				首次创建基金id号要生成,基金名,托管资产都要从用户这里获取
+	* 				传过来的参数以表单形式提交
 	* 
-	* @param @param file
-	* @param @param request
-	* @param @param fundId 			基金id号,前端随机生成?????还是说后台生成????TODO
+	* 
+	* @param @param userId			用户id号
+	* @param @param fundId 			基金id号,前端随机生成?????还是说后台生成????================================>暂时通过打开估值核算弹框自动生成TODO
 	* @param @param fundName		基金名称,客户端手动输入生成并传输过来
 	* @param @param assets			托管资产,客户端手动输入生成并传输过来
+	* 
+	* 
 	* @param @return    设定文件
 	* @return Map<String,Object>    返回类型
 	* @author ylx
 	* @date 2017年12月18日 下午5:29:38
 	* @throws
 	 */
-	@RequestMapping(value="/uploadValuationPOIByAdmin",method=RequestMethod.POST)
+	@RequestMapping(value="/uploadValuationPOIByAdminForTheFirstTime",method=RequestMethod.POST)
 	@ResponseBody
-	public Map<String, Object> uploadValuationPOIByAdmin(@RequestParam("file") MultipartFile file,HttpServletRequest request,@RequestParam("fundId") String fundId,@RequestParam("fundName") String fundName, @RequestParam("assets") String assets ) {
+	public Map<String, Object> uploadValuationPOIByAdmin(@RequestParam("file") MultipartFile file,HttpServletRequest request,
+														 @RequestParam("fundId") String fId,
+														 @RequestParam("fundName") String fName, 
+														 @RequestParam("assets") String ass,
+														 @RequestParam("userId") Object uId) {
 		try {
-			String path = request.getServletContext().getRealPath("")+SP+"content";			//SP是系统分隔符	
+			if(file.isEmpty()){
+				throw new RuntimeException("上传文件不能为空");
+			}
+			int userId=ValidationUtil.checkAndAssignInt(uId);
+			UserDetail userDetail = userAuthoricationService.checkUserAuthority(userId,Role.ADMIN);	//查看用户非空和权限(管理员创建并上传的权限)
+			Integer fundId=ValidationUtil.checkAndAssignInt(fId);							//基金id号
+			valuationAccountingService.checkIfHasTheSameFundId(fundId);						//对传过来的基金id(fundId)进行查重校验
+			String fundName=ValidationUtil.checkBlankAndAssignString(fName);				//基金名称===============================>>基金名要不要查重?TODO
+			valuationAccountingService.checkIfHasTheSameFundName(fundName);					//对传过来的基金名(fundName)进行查重校验
+			String assets=ValidationUtil.checkBlankAndAssignString(ass);					//托管资产名称============================>>托管资产要不要查重?TODO
+			Integer attachmentId = attachmentService.generateAtachmentId();					//生成一个不重复的附件Id号==================>>生成id号的机制待定TODO
+			
+			String path = request.getServletContext().getRealPath("");							//上传文件顶级父类的绝对路径============================>>路径机制待定TODO	
+			//String relativePath = RelativePathUtil.formatPath("/"+userId,"");					//生成默认的相对路径格式================================>>路径机制待定TODO
+			
+			
+			
 			File dir=new File(path);
 			if(!dir.exists()){
 				dir.mkdirs();
 			}
-			
 			String filename = file.getOriginalFilename();
+			String url = "/content/"+ValidationUtil.checkBlankAndAssignString(filename);	//url路径名称被赋值之前先进行filename的校验
+			String attachmentName = filename;												//附件名称,已经校验过,不需要再进行校验了
 			String pathFile=path+SP+filename;
 			File newFile=new File(pathFile);
-			file.transferTo(newFile);
 			
-			Map<String, Object> map =new LinkedHashMap<String, Object>();
-			map.put("fundId", fundId);
-			map.put("fundName", fundName);
-			map.put("assets", assets);
-			map.put("url", "/content/"+filename);		//将文件下载路径url通过map传到service层进行校验
-			map.put("attachmentName", filename);			//将文件以附件名的形式通过map传递到service层中进行校验
 			
+			Map<String, Object> mapToService =new LinkedHashMap<String, Object>();
+			mapToService.put("userId", userId);												//用户id号
+			mapToService.put("userDetail", userDetail);										//用户详细信息封装入map
+			mapToService.put("fundId", fundId);
+			mapToService.put("fundName", fundName);
+			mapToService.put("assets", assets);
+			mapToService.put("url", url);													//将文件下载路径url通过map传到service层进行校验
+			mapToService.put("attachmentName", attachmentName);								//将文件以附件名的形式通过map传递到service层中进行校验
+			mapToService.put("attachmentId", attachmentId);									//附件id号封装好
 			//这里是以管理岗的身份进行插入的,注意银行的估值报表暂时先不插入数据
-			valuationAccountingService.insertInformationIntoTableByAdmin(map);		//将获取到的数据插入到表中
+			valuationAccountingService.insertInformationIntoTableByAdminForTheFirstTime(mapToService);		//将获取到的数据插入到表中
 			
-			return JSONUtil.getJsonMap(200, true, "上传成功",null); //返回给前端一个map进行前段提示
+			//文件最后上传到服务器
+			file.transferTo(newFile);														//此时文件已经上传成功---->upload file success
+			
+			return JSONUtil.getJsonMap(200, true, HintMSG.UPLOAD_SUCCESS,null); //返回给前端一个map进行前段提示
 		} catch (Exception e) {
-			return JSONUtil.getJsonMap(500, false, "上传出现异常"+e.getMessage(),null); //返回给前端一个map进行前段提示
+			return JSONUtil.getJsonMap(500, false, HintMSG.UPLOAD_FAIL+":"+e.getMessage(),null); //返回给前端一个map进行前段提示
 		}
 	}
 	
@@ -156,46 +309,198 @@ public class ValuationAccountingAction {
 	 * 
 	* @Title: upload
 	* @Description: TODO(实现银行估值核算的报表文件上传功能---------->>暂时按照一次上传一个文件进行实现)
+	* 
+	* 上传的时候以表单的形式传过来
 	* @param @param file
-	* @param @param request
 	* @param @param fundId
 	* @param @param fundName
-	* @param @param assets
-	* @param @return    设定文件
+	* @param @param userId
+	* 
+	* @param @return    这里上传人有可能是银行也有可能是管理岗的人,这里要进行校验
 	* @return Map<String,Object>    返回类型
 	* @author ylx
 	* @date 2017年12月18日 下午8:17:47
 	* @throws
 	 */
-	@RequestMapping(value="/uploadValuationPOIByBank",method=RequestMethod.POST)
+	@RequestMapping(value="/uploadValuationPOIByBankOrByAdmin",method=RequestMethod.POST)
 	@ResponseBody
-	public Map<String, Object> uploadValuationPOIByBank(@RequestParam("file") MultipartFile file,HttpServletRequest request,@RequestParam("fundId") String fundId,@RequestParam("fundName") String fundName, @RequestParam("assets") String assets ) {
+	public Map<String, Object> uploadValuationPOIByBankOrByAdmin(@RequestParam("file") MultipartFile file,HttpServletRequest request,
+														@RequestParam("fundId") String fId,
+														@RequestParam("fundName") String fName, 
+														@RequestParam("userId") Object uId) {
 		try {
-			String path = request.getServletContext().getRealPath("")+SP+"content";			//SP是系统分隔符	
+			if(file.isEmpty()){
+				throw new RuntimeException("上传文件不能为空");
+			}
+			//确定好上传的文件的顶级父级路径=======================================================================>>待定TODO
+			String path = request.getServletContext().getRealPath("")+SP+"content";			//SP是系统分隔符
 			File dir=new File(path);
 			if(!dir.exists()){
 				dir.mkdirs();
 			}
 			String filename = file.getOriginalFilename();
-			String pathFile=path+SP+filename;
-			File newFile=new File(pathFile);
-			file.transferTo(newFile);					//这里已经完成银行估值文件的上传,后续需要对该文件和管理岗上传文件中的报价信息进行比对,在Service层中进行校验
+			if(!(filename.endsWith(".xls")||filename.endsWith("xlsx"))){
+				throw new RuntimeException("上传文件格式不对");
+			}
+			int userId=ValidationUtil.checkAndAssignInt(uId);
+			UserDetail userDetail = userAuthoricationService.checkUserAuthority(userId,Role.ADMIN,Role.ACCOUNTING_POS_OF_TBC);//查看用户非空和权限(管理员创建并上传的权限)
+			Integer fundId=ValidationUtil.checkAndAssignInt(fId);									//基金id号
+			String fundName=ValidationUtil.checkBlankAndAssignString(fName);						//基金名称
+			ValuationAccount valuationAccount = valuationAccountingService.checkIfFundExists(fundId,fundName); 	//对传过来的基金id进行检测是否存在,并赋值对账结果,不存在就报错(因为这个时候基金信息已经存在)
+			//获得对账结果
+			String battleResult = valuationAccount.getBattle_result();
+			List<String> roleList=userDetail.getRole_name();
+			
+			//已经对账结束,无法继续上传文件
+			if(BattleResult.CONSISTENT.equals(battleResult)){
+				throw new RuntimeException("对账结果一致,无法继续上传文件");
+			}
+			//判断是否是管理岗
+			if(roleList.contains(Role.ADMIN)){
+				if(BattleResult.TO_BE_MATCHED.equals(battleResult)){
+					throw new RuntimeException("待对账中无法重复上传");
+				}
+				//接下来肯定是对账结果不一致,说明可以上传文件===================>>待做TODO
+				//先获取自己之前上传的文件路径
+				String custodianOldFilePath = path+valuationAccount.getUrl_of_custodian();
+				//核查文件是否还在
+				File oldFile = new File(custodianOldFilePath);
+				if(!oldFile.exists()){
+					throw new RuntimeException("之前上传的文件丢失");
+				}
+				//切断旧路径,拼接成新路径
+				String custodianNewFilePath = custodianOldFilePath.substring(0, custodianOldFilePath.lastIndexOf("/")+1)+filename;
+				File newFile=new File(custodianNewFilePath);
+				
+				//再获取银行之前上传的文件路径
+				String bankFilePath = path+valuationAccount.getUrl_of_bank();
+				/*
+				 * 如过不是excel文件类型,导入也会报错,然后就把这个新上传的文件删了
+				 * 这里对两份文件进行估值报价的比对得出比对的结果是一致还是不一致
+				 */
+				//获取比对结果
+				String result = "????";
+				Map<String, Object> mapToService =new LinkedHashMap<String, Object>();
+				mapToService.put("userDetail", userDetail);			//将用户的全部信息传入service层
+				mapToService.put("fundId", fundId);
+				mapToService.put("url", custodianNewFilePath);		//将文件下载路径url通过map传到service层进行校验
+				mapToService.put("attachmentName", filename);			//将文件以附件名的形式通过map传递到service层中进行校验
+				mapToService.put("battleResult", result);			//将文件比对结果封装进去
+				mapToService.put("attachmentId", valuationAccount.getAttachment_id_of_custodian());	//获取之前上传的附件id号在附件表中修改
+				valuationAccountingService.updateInformationByAdmin(mapToService);
+				
+				//文件的覆盖放到最后操作(重要!!!)
+				oldFile.delete();
+				file.transferTo(newFile);
+				
+				return JSONUtil.getJsonMap(200, true, HintMSG.UPLOAD_SUCCESS,null); //返回给前端一个成功提示
+			}
 			
-			Map<String, Object> map =new LinkedHashMap<String, Object>();
-			map.put("fundId", fundId);
-			map.put("fundName", fundName);
-			map.put("assets", assets);
-			map.put("url", "/content/"+filename);		//将文件下载路径url通过map传到service层进行校验
-			map.put("attachmentName", filename);			//将文件以附件名的形式通过map传递到service层中进行校验
+			//如果不是管理岗,那接下来的业务肯定是银行
+			//银行待对账操作
+			if(BattleResult.TO_BE_MATCHED.equals(battleResult)){
+				//待审核的状态说明文件是一个新的文件上传上去
+				
+				//先获取管理员之前上传的文件
+				String custodianOldFilePath = path+SP+valuationAccount.getUrl_of_custodian();
+				//核查文件是否还在
+				File oldFile = new File(custodianOldFilePath);
+				if(!oldFile.exists()){
+					throw new RuntimeException("管理员上传的文件丢失");
+				}
+				//银行上传文件的新路径
+				String bankNewFilePath = path + SP + filename;								//=========================>>新上传的文件路径怎么确定到时候再说TODO
+				File newFile=new File(bankNewFilePath);
+				
+				/*
+				 * 如过不是excel文件类型,导入也会报错,然后就把这个新上传的文件删了
+				 * 这里对两份文件进行估值报价的比对得出比对的结果是一致还是不一致
+				 */
+				//获取比对结果
+				String result = "????";
+				
+				Integer attachmentId = attachmentService.generateAtachmentId();					//生成一个不重复的附件Id号==================>>生成id号的机制待定TODO
+				
+				Map<String, Object> mapToService =new LinkedHashMap<String, Object>();
+				mapToService.put("userDetail", userDetail);			//将用户的全部信息传入service层
+				mapToService.put("fundId", fundId);
+				mapToService.put("url", "/content/"+filename);		//将文件下载路径url通过map传到service层进行校验//=================>>新上传的文件路径怎么确定到时候再说TODO
+				mapToService.put("attachmentName", filename);		//将文件以附件名的形式通过map传递到service层中进行校验
+				mapToService.put("battleResult", result);			//将文件比对结果封装进去
+				mapToService.put("attachmentId", attachmentId);		
+				valuationAccountingService.updateInformationByBank(mapToService);
+				
+				//文件放到最后上传上去(重点!!!!)
+				file.transferTo(newFile);
+				
+				return JSONUtil.getJsonMap(200, true, HintMSG.UPLOAD_SUCCESS,null); //返回给前端一个成功提示
+			}
 			
-			//这里是以银行的身份将数据进行更新
-			valuationAccountingService.updateInformationByBank(map);		//将获取到的数据更新到已有的估值核算表中,这个表是由管理岗创建的
+			//银行对账不一致操作
+			if(BattleResult.INCONSISTENT.equals(battleResult)){
+				//审核结果不一致的状态说明之前银行那边上传过一个文件,这次就要对之前的文件进行替换
+				
+				//先获取管理员之前上传的文件
+				String custodianOldFilePath = path+valuationAccount.getUrl_of_custodian();
+				//核查文件是否还在
+				File oldCustodianFile = new File(custodianOldFilePath);
+				if(!oldCustodianFile.exists()){
+					throw new RuntimeException("管理员之前上传的文件丢失");
+				}
+				//银行之前上传文件的路径
+				String banckOldFilePath = path + valuationAccount.getUrl_of_bank();
+				//核查文件是否还在
+				File oldBankFile = new File(banckOldFilePath);
+				if(!oldBankFile.exists()){
+					throw new RuntimeException("银行之前上传的文件丢失");
+				}
+				
+				//切断旧路径,拼接成新路径
+				String bankNewFilePath = banckOldFilePath.substring(0, banckOldFilePath.lastIndexOf("/")+1)+filename;
+				File newBankFile=new File(bankNewFilePath);
+				
+				/*
+				 * 如过不是excel文件类型,导入也会报错,然后就把这个新上传的文件删了(这里旧文件不能先删了)
+				 * 这里对两份文件进行估值报价的比对得出比对的结果是一致还是不一致
+				 */
+				//获取比对结果
+				String result = "????";
+				
+				Map<String, Object> mapToService =new LinkedHashMap<String, Object>();
+				mapToService.put("userDetail", userDetail);			//将用户的全部信息传入service层
+				mapToService.put("fundId", fundId);
+				mapToService.put("url", "/content/"+filename);		//将文件下载路径url通过map传到service层进行校验//=================>>新上传的文件路径怎么确定到时候再说TODO
+				mapToService.put("attachmentName", filename);		//将文件以附件名的形式通过map传递到service层中进行校验
+				mapToService.put("battleResult", result);			//将文件比对结果封装进去
+				mapToService.put("attachmentId", valuationAccount.getAttachment_id_of_bank());	//获取之前银行上传的附件id号	
+				valuationAccountingService.updateInformationByBank(mapToService);
+				
+				//文件覆盖的这个操作放到最后操做(很重要!!!)
+				oldBankFile.delete();
+				file.transferTo(newBankFile);
+				
+				return JSONUtil.getJsonMap(200, true, HintMSG.UPLOAD_SUCCESS,null); //返回给前端一个成功提示
+			}
 			
-			return JSONUtil.getJsonMap(200, true, "上传成功",null); //返回给前端一个map进行前段提示
+			//能运行到这里肯定有问题
+			throw new RuntimeException("你是怎么运行到这里的");
 		} catch (Exception e) {
-			return JSONUtil.getJsonMap(500, false, "上传出现异常"+e.getMessage(),null); //返回给前端一个map进行前段提示
+			return JSONUtil.getJsonMap(500, false, HintMSG.UPLOAD_FAIL+":"+e.getMessage(),null); //返回给前端一个map进行前段提示
+		}
+	}
+
+	@RequestMapping(value="/test",method=RequestMethod.POST)
+	@ResponseBody
+	public Map<String, Object> test(@RequestBody String data){
+		try {
+			Map map= JSON.parseObject(data, Map.class);
+			int userId=ValidationUtil.checkAndAssignInt(map.get("userId"));
+			UserDetail userDetail = userAuthoricationService.checkUserAuthority(userId,Role.ADMIN,Role.ACCOUNTING_POS_OF_TBC);	//查看用户非空和权限(管理员创建并上传的权限)
+			ValuationAccount valuationAccount = valuationAccountingService.checkIfFundExists((Integer)map.get("fundId"), (String)map.get("fundName"));
+			return JSONUtil.getJsonMap(200, true, HintMSG.UPLOAD_SUCCESS,valuationAccount); //返回给前端一个成功提示
+		} catch (Exception e) {
+			return JSONUtil.getJsonMap(500, false, HintMSG.UPLOAD_FAIL+":"+e.getMessage(),null); //返回给前端一个map进行前段提示
 		}
 	}
-	
 	
 }