maamin1 7 éve
szülő
commit
fbc02d9567

+ 1 - 0
ccb_fund_trusteeship/.settings/org.eclipse.core.resources.prefs

@@ -1,3 +1,4 @@
 eclipse.preferences.version=1
 encoding//src/main/resources/conf.properties=UTF-8
+encoding//src/main/resources/parameter.properties=UTF-8
 encoding/<project>=UTF-8

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

@@ -11,7 +11,7 @@ import org.hibernate.validator.constraints.NotEmpty;
 public class User implements Serializable{
 	private int id;	//主键
 	private int user_id;	//用户id
-	@NotEmpty(message = "用户名不能为空")
+	@NotEmpty(message = "{user.user_name.notnull.message}")
 	private String user_name;	//用户名称
 	@Size(min = 6,max = 8,message = "密码必须为6到8位的数字")
 	private String password;	//用户密码

+ 140 - 0
ccb_fund_trusteeship/src/main/java/com/fuzamei/utils/UserUtil.java

@@ -0,0 +1,140 @@
+package com.fuzamei.utils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.fuzamei.entity.User;
+import com.fuzamei.utils.blockchain.KeyUtils;
+
+public class UserUtil {
+	public static List<User> getUserList(){
+		List<User> listUsers = new ArrayList<User>();
+		for(int i = 0; i < 18; i ++){
+			User user = new User();
+			String organization_name = "";	//机构名称
+			String person_name = "";		//人员名称
+			String account = "";			//账号
+			if(i == 0){
+				organization_name = "杭州西湖经办支行";
+				person_name = "张三";
+				account = "xhjbzh";
+			}
+			if(i == 1){
+				organization_name = "杭州西湖二级支行";
+				person_name = "李四";
+				account = "xhejzh";
+			}
+			if(i == 2){
+				organization_name = "杭州西湖省分行业务部门";
+				person_name = "王五";
+				account = "xhsfhywbm";
+			}
+			if(i == 3){
+				organization_name = "管理人";
+				person_name = "administrator";
+				account = "glr";
+			}
+			if(i == 4){
+				organization_name = "杭州西湖省分行业务主管部门";
+				person_name = "叶德娴";
+				account = "xhsfhywzgbm";
+			}
+			if(i == 5){
+				organization_name = "杭州西湖省分行法律部";
+				person_name = "刘芸";
+				account = "xhsfhflb";
+			}
+			if(i == 6){
+				organization_name = "杭州西湖省分行托管分中心账户维护岗";
+				person_name = "丁志诚";
+				account = "xhsfhtgzxzhwhg";
+			}
+			if(i == 7){
+				organization_name = "杭州西湖省分行托管分中心账户管理岗";
+				person_name = "徐自贤";
+				account = "xhsfhtgzxzhglg";
+			}
+			if(i == 8){
+				organization_name = "杭州西湖省分行托管分中心业务经办岗";
+				person_name = "梁文道";
+				account = "xhsfhtgfzxywjbg";
+			}
+			if(i == 9){
+				organization_name = "杭州西湖省分行托管分中心业务复核岗";
+				person_name = "杨若兮";
+				account = "xhsfhtgfzxywfhg";
+			}
+			if(i == 10){
+				organization_name = "杭州西湖省分行托管分中心业务主管岗";
+				person_name = "王丽达";
+				account = "xhsfhtgfzxywzgg";
+			}
+			if(i == 11){
+				organization_name = "杭州西湖托管分中心核算岗";
+				person_name = "吴磊";
+				account = "xhtgfzxhsg";
+			}
+			if(i == 12){
+				organization_name = "杭州西湖省分行托管分中心档案保管岗";
+				person_name = "何超仪";
+				account = "xhsfhtgfzxdablg";
+			}
+			if(i == 13){
+				organization_name = "杭州西湖监管机构";
+				person_name = "霍建华";
+				account = "xhjgjg";
+			}
+			if(i == 14){
+				organization_name = "杭州西湖银行内外部人员";
+				person_name = "安妮·蓝妮克丝";
+				account = "xhyhnwbry";
+			}
+			if(i == 15){
+				organization_name = "杭州西湖风管岗";
+				person_name = "亨弗莱·鲍嘉";
+				account = "xhfgg";
+			}
+			if(i == 16){
+				organization_name = "杭州西湖其余岗";
+				person_name = "诺埃尔·瑞丁";
+				account = "xhqyg";
+			}
+			if(i == 17){
+				organization_name = "杭州西湖银行内部人员";
+				person_name = "阿塔尔·比哈里·瓦杰帕伊";
+				account = "xhyhnbry";
+			}
+			int user_id = i+1;
+			String password = "123456";	//密码默认为123456
+			String random = KeyUtils.getRandom();	//随机数
+			String private_key = KeyUtils.getPrivateKey(password, random);	//私钥
+			String public_key = KeyUtils.getPublicKey(private_key);			//公钥
+			/**
+			 * 此处需要进行区块链操作
+			 */
+			user.setUser_id(user_id);
+			user.setUser_name(account);
+			user.setPassword(password);
+			user.setRandom(random);
+			user.setPrivate_key(private_key);
+			user.setPublic_key(public_key);
+			user.setOrganization_name(organization_name);
+			user.setPerson_name(person_name);
+			listUsers.add(user);
+		}
+		return listUsers;
+	}
+	public static List<Map<String,Object>> getUserRoleList(){
+		List<Map<String,Object>> listMap = new ArrayList<Map<String,Object>>();
+		for(int i = 0; i < 18; i ++){
+			Map<String,Object> map = new HashMap<String,Object>();
+			map.put("user_id", i+1);
+			map.put("role_id", i+1);
+			listMap.add(map);
+		}
+		return listMap;
+	}
+	
+}

+ 4 - 0
ccb_fund_trusteeship/src/main/resources/parameter.properties

@@ -0,0 +1,4 @@
+#定义所有错误信息
+user.user_id.notnull.message = 用户id不能为空
+user.user_id.notempty.message = 用户id不能为空
+user.user_name.notnull.message = 用户名不能为空

+ 4 - 0
ccb_fund_trusteeship/src/main/webapp/WEB-INF/web.xml

@@ -44,6 +44,10 @@
       <param-name>contextConfigLocation</param-name>
       <param-value>classpath:spring-mvc.xml</param-value>
     </init-param>
+    <init-param>
+      <param-name>contextConfigLocation</param-name>
+      <param-value>classpath:parameter.properties</param-value>
+    </init-param>
   </servlet>
   <servlet-mapping>
     <servlet-name>springMVC</servlet-name>