Bladeren bron

--add bindMobileForUpdate();add bindEmailForUpdate();

zzy.zhiyuan.foxmail 8 jaren geleden
bovenliggende
commit
7cf20626fa
1 gewijzigde bestanden met toevoegingen van 28 en 2 verwijderingen
  1. 28 2
      src/main/java/com/ekexiu/portal/service/GrowthLogService.java

+ 28 - 2
src/main/java/com/ekexiu/portal/service/GrowthLogService.java

@ -88,13 +88,13 @@ public class GrowthLogService {
88 88
			if((user.getMobilePhone() != null) && (user.getMobilePhone().trim().length() == 11)){
89 89
				Professor professor = this.professorDao.query(con, user.getId());
90 90
				if(professor != null){
91
					this.bindMobile(con, user.getId());
91
					this.bindMobileForUpdate(con, user.getId());
92 92
				}
93 93
			}
94 94
			if((user.getEmail() != null) && (!"".equals(user.getEmail()))){
95 95
				Professor professor = this.professorDao.query(con, user.getId());
96 96
				if(professor != null){
97
					this.bindEmail(con, user.getEmail());
97
					this.bindEmailForUpdate(con, user.getEmail());
98 98
				}
99 99
			}
100 100
		}
@ -112,6 +112,32 @@ public class GrowthLogService {
112 112
		}
113 113
		return true;
114 114
	}
115
	public void bindMobileForUpdate(@JdbcConn(true) Connection con,String professorId)throws SQLException{
116
		List<GrowthLog> logs = this.growthLogDao.queryOperate(con, professorId, "23");
117
		if(!(logs.size() > 0)){
118
			GrowthLog growthLog = new GrowthLog();
119
			growthLog.setId(StringUtil.buildUUID());
120
			growthLog.setProfessorId(professorId);
121
			growthLog.setOperate("23");
122
			growthLog.setScore(this.rule.getBindMobile());
123
			this.growthLogDao.insert(con, growthLog);
124
			this.professorDao.updateScoreValue(con, professorId, growthLog.getScore());
125
			this.professorDao.updateGrowthValue(con, professorId, growthLog.getScore());
126
		}
127
	}
128
	public void bindEmailForUpdate(@JdbcConn(true) Connection con,String professorId)throws SQLException{
129
		List<GrowthLog> logs = this.growthLogDao.queryOperate(con, professorId, "24");
130
		if(!(logs.size() > 0)){
131
			GrowthLog growthLog = new GrowthLog();
132
			growthLog.setId(StringUtil.buildUUID());
133
			growthLog.setProfessorId(professorId);
134
			growthLog.setOperate("24");
135
			growthLog.setScore(this.rule.getBindEmail());
136
			this.growthLogDao.insert(con, growthLog);
137
			this.professorDao.updateScoreValue(con, professorId, growthLog.getScore());
138
			this.professorDao.updateGrowthValue(con, professorId, growthLog.getScore());
139
		}
140
	}
115 141
	
116 142
	@Get
117 143
	@Path("/lastSignInTime")