jiapeng 7 years ago
parent
commit
a04f7107d6

+ 2 - 0
src/main/java/com/ekexiu/portal/service/OrgService.java

@ -98,6 +98,7 @@ public class OrgService {
98 98
	{
99 99
		organization.setId(StringUtil.buildUUID());
100 100
		if(organization.getOrgType()== null) organization.setOrgType(this.defaultOrgType);
101
		if(organization.getIsJoin() == null ) organization.setIsJoin("0");
101 102
		this.orgDao.insert(con, organization);
102 103
		Organization no = this.orgDao.query(con, organization.getId());
103 104
		if(no!=null && no.getIsJoin().equals("1")){
@ -185,6 +186,7 @@ public class OrgService {
185 186
		org.setName(orgName);
186 187
		org.setOrgType(this.defaultOrgType);
187 188
		org.setAuthStatus(this.defaultAuthStatus);
189
		org.setIsJoin("0");
188 190
		try {
189 191
			orgDao.insert(con, org);
190 192
			this.imageService.saveDefaultOrgLogo(id);

+ 45 - 0
src/main/java/com/ekexiu/portal/service/SysService.java

@ -1827,6 +1827,51 @@ public class SysService {
1827 1827
		}
1828 1828
		return key;
1829 1829
	}
1830
	/**
1831
	 * 发送手机验证码
1832
	 * 
1833
	 * @param con
1834
	 * @param mobilePhone
1835
	 *            验证的手机号
1836
	 * @return
1837
	 * @throws JfwBaseException
1838
	 * @throws SQLException
1839
	 */
1840
	@Get
1841
	@Path("/regmobilephone_onlyphone")
1842
	public String regMobilePhone(@JdbcConn(false) Connection con, String mobilePhone, @DefaultValue("true") boolean checkExists)
1843
			throws JfwBaseException, SQLException {
1844
		if (checkExists) {
1845
			User user = this.userDao.queryByEmailOrMobilePhone(con, mobilePhone);
1846
			if (null != user) {
1847
				return null;
1848
			}
1849
		}
1850
		StateCode<String, String> sc = new StateCode<String, String>();
1851
		final String key = JfwAppContext.cacheObjectAndGenKey(sc);
1852
		try {
1853
			Random rd = new Random();
1854
			int vi = rd.nextInt(10000);
1855
			String vc = String.format("%04d", vi);
1856
			sc.setKey(mobilePhone);
1857
			sc.setValue(vc);
1858
			this.mobilePhoneServcie.sendMessage(mobilePhone, this.regMobilePhoneContentTemplate, this.regMobilePhoneReplaceKey, vc);
1859
			long ct = System.currentTimeMillis();
1860
			long et = ct + this.timeLimitWithRegMobilePhone + 5000;
1861
			sc.setBuildTime(ct);
1862
			sc.setExpiredTime(et);
1863
			JfwAppContext.getScheduledExecutorService().schedule(new Runnable() {
1864
				@Override
1865
				public void run() {
1866
					JfwAppContext.removeCachedObject(key);
1867
				}
1868
			}, this.timeLimitWithRegMobilePhone + 10000, TimeUnit.MILLISECONDS);
1869
		} catch (Exception e) {
1870
			JfwAppContext.removeCachedObject(key);
1871
			throw new JfwBaseException(10012, "send mobile phone message to " + mobilePhone + " error", e);
1872
		}
1873
		return key;
1874
	}
1830 1875
	
1831 1876
	
1832 1877
	@Get