| | |
| | | || requestURI.contains("LicenseAction") |
| | | || requestURI.contains("UKey") |
| | | || requestURI.contains("closeBrowser") |
| | | || requestURI.contains("User_infAction!register") |
| | | //大屏需要直接调用接口 |
| | | || requestURI.contains("MapOutlineAction!getAll") |
| | | || requestURI.contains("BattMap_informationAction!findStationState") |
| | |
| | | result = ActionUtil.tojson(model); |
| | | return SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 注册用户: |
| | | * IOS审核使用 |
| | | * 账号,密码,性别,手机号 |
| | | * */ |
| | | public String register() { |
| | | uif=ActionUtil.getGson().fromJson(addjson, User_inf.class); |
| | | String passwordEncrypt = null; |
| | | try { |
| | | passwordEncrypt = URLDecoder.decode(uif.getUSnId(), "utf-8"); |
| | | } catch (UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | //密码AES密文 |
| | | //String uSnId = uif.getUSnId(); |
| | | //密码明文+MD5(明文) |
| | | String[] passwordArr = RSAUtil.decryptFront(passwordEncrypt, RSAUtil.fontSeparator); |
| | | String data = passwordArr[0]; |
| | | if(data.contains(uif.getUName())){ |
| | | result = ActionUtil.tojson(new ServiceModel().set(0,"密码包含用户名")); |
| | | return SUCCESS; |
| | | } |
| | | //验签md5 |
| | | if(!passwordArr[1].equals(ActionUtil.EncryptionMD5(data).toString())){ |
| | | result = ActionUtil.tojson(new ServiceModel().set(0,"密码验签失败")); |
| | | return SUCCESS; |
| | | } |
| | | String passwordRSA = RSAUtil.encrypt(data, RSAUtil.getPublicKey()); |
| | | uif.setUSnId(passwordRSA); |
| | | uif.setUpassword(passwordRSA); |
| | | |
| | | model = service.register(uif); |
| | | result = ActionUtil.tojson(model); |
| | | return SUCCESS; |
| | | } |
| | | |
| | | |
| | | //修改用户信息 |
| | | public String update() { |
| | | uif=ActionUtil.getGson("yyyy-MM-dd").fromJson(upjson, User_inf.class); |
| | |
| | | uinf.getUNote(),uinf.getLicense(),uinf.getURole(),uinf.getType(),uinf.getStatus(),uinf.getExpirationTime(),uinf.getVisitTime(),uinf.getVisitIp()}); |
| | | return bl; |
| | | } |
| | | |
| | | //5.1用户管理(添加) |
| | | public boolean register(User_inf uinf) { |
| | | String sql="insert into db_user.tb_user_inf(uSnId,uPassword,uName,uMobilephone," + |
| | | "uSex,uRole,type,status,create_time) values(?,?,?,?,?,?,?,?,?)"; |
| | | Boolean bl=DAOHelper.executeUpdate(DBUtil.getConn(), sql, new Object[]{ |
| | | uinf.getUSnId(),uinf.getUpassword(),uinf.getUName(),uinf.getUMobilephone(),uinf.getUSex(), |
| | | 2,1,1,new Date() |
| | | |
| | | }); |
| | | return bl; |
| | | } |
| | | |
| | | //5.1用户管理(添加时判断用户名和手机号是否重复) |
| | | public int addJudge(Object obj){ |
| | | User_inf uinf=(User_inf) obj; |
| | |
| | | import com.fgkj.dao.BaseDAO; |
| | | import com.fgkj.dao.BaseDAOFactory; |
| | | import com.fgkj.dao.impl.PageParamDao; |
| | | import com.fgkj.dao.impl.User_battgroup_baojigroup_usrImpl; |
| | | import com.fgkj.dao.impl.User_infImpl; |
| | | import com.fgkj.dao.impl.User_permitgroup_dataImpl; |
| | | import com.fgkj.dto.*; |
| | |
| | | return model; |
| | | } |
| | | |
| | | public ServiceModel register(User_inf userInf) { |
| | | int flag=((User_infImpl)dao).addJudge(userInf); |
| | | //System.out.println(flag); |
| | | if(flag!=0){ |
| | | Boolean bl=((User_infImpl)dao).register(userInf); |
| | | if(bl){ |
| | | //添加成功,分配到默认初始化权限组 |
| | | Integer uId = ((User_infImpl) dao).getUserInfoByPhoneNumber(((User_inf) userInf).getUMobilephone()).getUId(); |
| | | User_permitgroup_data permitGroupData = new User_permitgroup_data(); |
| | | permitGroupData.setPermit_group_id(100020); |
| | | permitGroupData.setuId(uId); |
| | | new User_permitgroup_dataImpl().add(permitGroupData); |
| | | |
| | | //添加成功,分配到默认的包机组 |
| | | com.fgkj.dto.User_battgroup_baojigroup_usr baojigroupUsr = new User_battgroup_baojigroup_usr(); |
| | | baojigroupUsr.setBaoji_group_id(100091); |
| | | baojigroupUsr.setuId(uId); |
| | | new User_battgroup_baojigroup_usrImpl().add(baojigroupUsr); |
| | | |
| | | model.setCode(1); |
| | | model.setMsg("注册成功!"); |
| | | } |
| | | else{ |
| | | model.setCode(0); |
| | | model.setMsg("注册失败!"); |
| | | } |
| | | }else{ |
| | | model.setCode(0); |
| | | model.setMsg("用户名或手机号已存在,请重新输入!"); |
| | | } |
| | | return model; |
| | | } |
| | | |
| | | // 5.1用户管理(编辑) |
| | | public ServiceModel update(Object obj) { |
| | | Boolean bl = false; |