|
@ -6,9 +6,12 @@ import java.text.SimpleDateFormat;
|
6
|
6
|
import java.util.Calendar;
|
7
|
7
|
import java.util.Date;
|
8
|
8
|
import java.util.List;
|
|
9
|
import java.util.Map;
|
9
|
10
|
|
10
|
11
|
import org.jfw.apt.annotation.Autowrie;
|
|
12
|
import org.jfw.apt.annotation.DefaultValue;
|
11
|
13
|
import org.jfw.apt.web.annotation.Path;
|
|
14
|
import org.jfw.apt.web.annotation.operate.Get;
|
12
|
15
|
import org.jfw.apt.web.annotation.operate.Post;
|
13
|
16
|
import org.jfw.apt.web.annotation.param.JdbcConn;
|
14
|
17
|
import org.jfw.util.StringUtil;
|
|
@ -18,10 +21,13 @@ import com.ekexiu.portal.dao.GrowthLogDao;
|
18
|
21
|
import com.ekexiu.portal.dao.ProfessorDao;
|
19
|
22
|
import com.ekexiu.portal.dao.UserDao;
|
20
|
23
|
import com.ekexiu.portal.po.GrowthLog;
|
|
24
|
import com.ekexiu.portal.po.Professor;
|
21
|
25
|
import com.ekexiu.portal.po.User;
|
|
26
|
import com.ekexiu.portal.pojo.InviteUserScore;
|
22
|
27
|
|
23
|
28
|
@Path("/growth")
|
24
|
29
|
public class GrowthLogService {
|
|
30
|
public static final String MAX_CREATE_TIME = "9";
|
25
|
31
|
private String dateFormat = "yyyyMMdd";
|
26
|
32
|
@Autowrie
|
27
|
33
|
private GrowthLogDao growthLogDao;
|
|
@ -71,6 +77,42 @@ public class GrowthLogService {
|
71
|
77
|
public void setRule(GrowthRuleService rule) {
|
72
|
78
|
this.rule = rule;
|
73
|
79
|
}
|
|
80
|
|
|
81
|
@Post
|
|
82
|
@Path("/updateData")
|
|
83
|
public boolean updateData(@JdbcConn(true) Connection con)throws SQLException{
|
|
84
|
List<Professor> professors = this.professorDao.queryList(con);
|
|
85
|
for (Professor professor : professors) {
|
|
86
|
User user = this.userDao.query(con, professor.getId());
|
|
87
|
if(user != null){
|
|
88
|
if(user.getMobilePhone() != null && user.getMobilePhone().trim().length() == 11){
|
|
89
|
this.bindMobile(con, professor.getId());
|
|
90
|
}
|
|
91
|
if(user.getEmail() != null && !"".equals(user.getEmail())){
|
|
92
|
this.bindEmail(con, professor.getId());
|
|
93
|
}
|
|
94
|
}
|
|
95
|
}
|
|
96
|
return true;
|
|
97
|
}
|
|
98
|
|
|
99
|
@Get
|
|
100
|
@Path("/queryByPro")
|
|
101
|
public List<GrowthLog> queryByPro(@JdbcConn Connection con,String professorId,@DefaultValue("com.ekexiu.portal.service.GrowthLogService.MAX_CREATE_TIME") String createTime,@DefaultValue("20") int rows)throws SQLException{
|
|
102
|
return this.growthLogDao.queryList(con, professorId, createTime, rows);
|
|
103
|
}
|
|
104
|
|
|
105
|
@Get
|
|
106
|
@Path("/queryInvite")
|
|
107
|
public List<InviteUserScore> queryInvite(@JdbcConn Connection con,String professorId)throws SQLException{
|
|
108
|
return this.growthLogDao.queryInvite(con, professorId);
|
|
109
|
}
|
|
110
|
|
|
111
|
@Get
|
|
112
|
@Path("/queryScore")
|
|
113
|
public Map<String, Integer> queryScore(@JdbcConn Connection con,String professorId)throws SQLException{
|
|
114
|
return this.growthLogDao.queryScore(con, professorId);
|
|
115
|
}
|
74
|
116
|
|
75
|
117
|
/**
|
76
|
118
|
* 分享专家
|
|
@ -228,6 +270,7 @@ public class GrowthLogService {
|
228
|
270
|
log.setProfessorId(user.getInviterId());
|
229
|
271
|
log.setOperate("101");
|
230
|
272
|
log.setScore(this.rule.getInviteProfessorForInviter());
|
|
273
|
log.setInvitePro(professorId);
|
231
|
274
|
this.growthLogDao.insert(con, log);
|
232
|
275
|
this.professorDao.updateScoreValue(con, user.getInviterId(), log.getScore());
|
233
|
276
|
this.professorDao.updateGrowthValue(con, user.getInviterId(), log.getScore());
|
|
@ -252,6 +295,7 @@ public class GrowthLogService {
|
252
|
295
|
log.setProfessorId(user.getInviterId());
|
253
|
296
|
log.setOperate("102");
|
254
|
297
|
log.setScore(this.rule.getAddResearchAreaForInviter());
|
|
298
|
log.setInvitePro(professorId);
|
255
|
299
|
this.growthLogDao.insert(con, log);
|
256
|
300
|
this.professorDao.updateScoreValue(con, user.getInviterId(), log.getScore());
|
257
|
301
|
this.professorDao.updateGrowthValue(con, user.getInviterId(), log.getScore());
|
|
@ -302,6 +346,7 @@ public class GrowthLogService {
|
302
|
346
|
log.setProfessorId(user.getInviterId());
|
303
|
347
|
log.setOperate("103");
|
304
|
348
|
log.setScore(this.rule.getAddArticleForInviter());
|
|
349
|
log.setInvitePro(professorId);
|
305
|
350
|
this.growthLogDao.insert(con, log);
|
306
|
351
|
this.professorDao.updateScoreValue(con, user.getInviterId(), log.getScore());
|
307
|
352
|
this.professorDao.updateGrowthValue(con, user.getInviterId(), log.getScore());
|
|
@ -356,6 +401,7 @@ public class GrowthLogService {
|
356
|
401
|
log.setProfessorId(user.getInviterId());
|
357
|
402
|
log.setOperate("104");
|
358
|
403
|
log.setScore(this.rule.getAddResourceForInviter());
|
|
404
|
log.setInvitePro(professorId);
|
359
|
405
|
this.growthLogDao.insert(con, log);
|
360
|
406
|
this.professorDao.updateScoreValue(con, user.getInviterId(), log.getScore());
|
361
|
407
|
this.professorDao.updateGrowthValue(con, user.getInviterId(), log.getScore());
|
|
@ -384,6 +430,7 @@ public class GrowthLogService {
|
384
|
430
|
log.setProfessorId(user.getInviterId());
|
385
|
431
|
log.setOperate("-104");
|
386
|
432
|
log.setScore(-this.rule.getAddResourceForInviter());
|
|
433
|
log.setInvitePro(professorId);
|
387
|
434
|
this.growthLogDao.insert(con, log);
|
388
|
435
|
this.professorDao.updateScoreValue(con, user.getInviterId(), log.getScore());
|
389
|
436
|
this.professorDao.updateGrowthValue(con, user.getInviterId(), log.getScore());
|
|
@ -417,6 +464,7 @@ public class GrowthLogService {
|
417
|
464
|
log.setProfessorId(user.getInviterId());
|
418
|
465
|
log.setOperate("105");
|
419
|
466
|
log.setScore(this.rule.getAuthRealNameForInviter());
|
|
467
|
log.setInvitePro(professorId);
|
420
|
468
|
this.growthLogDao.insert(con, log);
|
421
|
469
|
this.professorDao.updateScoreValue(con, user.getInviterId(), log.getScore());
|
422
|
470
|
this.professorDao.updateGrowthValue(con, user.getInviterId(), log.getScore());
|
|
@ -451,6 +499,7 @@ public class GrowthLogService {
|
451
|
499
|
log.setProfessorId(user.getInviterId());
|
452
|
500
|
log.setOperate("106");
|
453
|
501
|
log.setScore(this.rule.getAuthExpertForInviter());
|
|
502
|
log.setInvitePro(professorId);
|
454
|
503
|
this.growthLogDao.insert(con, log);
|
455
|
504
|
this.professorDao.updateScoreValue(con, user.getInviterId(), log.getScore());
|
456
|
505
|
this.professorDao.updateGrowthValue(con, user.getInviterId(), log.getScore());
|
|
@ -485,6 +534,7 @@ public class GrowthLogService {
|
485
|
534
|
log.setProfessorId(user.getInviterId());
|
486
|
535
|
log.setOperate("107");
|
487
|
536
|
log.setScore(this.rule.getAuthOrgForInviter());
|
|
537
|
log.setInvitePro(professorId);
|
488
|
538
|
this.growthLogDao.insert(con, log);
|
489
|
539
|
this.professorDao.updateScoreValue(con, user.getInviterId(), log.getScore());
|
490
|
540
|
this.professorDao.updateGrowthValue(con, user.getInviterId(), log.getScore());
|
|
@ -514,6 +564,7 @@ public class GrowthLogService {
|
514
|
564
|
log.setProfessorId(user.getInviterId());
|
515
|
565
|
log.setOperate("108");
|
516
|
566
|
log.setScore(this.rule.getConsultReceiveForInviter());
|
|
567
|
log.setInvitePro(professorId);
|
517
|
568
|
this.growthLogDao.insert(con, log);
|
518
|
569
|
this.professorDao.updateScoreValue(con, user.getInviterId(), log.getScore());
|
519
|
570
|
this.professorDao.updateGrowthValue(con, user.getInviterId(), log.getScore());
|
|
@ -542,6 +593,7 @@ public class GrowthLogService {
|
542
|
593
|
log.setProfessorId(user.getInviterId());
|
543
|
594
|
log.setOperate("109");
|
544
|
595
|
log.setScore(this.rule.getConsultFinishForInviter());
|
|
596
|
log.setInvitePro(professorId);
|
545
|
597
|
this.growthLogDao.insert(con, log);
|
546
|
598
|
this.professorDao.updateScoreValue(con, user.getInviterId(), log.getScore());
|
547
|
599
|
this.professorDao.updateGrowthValue(con, user.getInviterId(), log.getScore());
|
|
@ -570,6 +622,7 @@ public class GrowthLogService {
|
570
|
622
|
log.setProfessorId(user.getInviterId());
|
571
|
623
|
log.setOperate("110");
|
572
|
624
|
log.setScore(this.rule.getReceiveFourStarForInviter());
|
|
625
|
log.setInvitePro(professorId);
|
573
|
626
|
this.growthLogDao.insert(con, log);
|
574
|
627
|
this.professorDao.updateScoreValue(con, user.getInviterId(), log.getScore());
|
575
|
628
|
this.professorDao.updateGrowthValue(con, user.getInviterId(), log.getScore());
|
|
@ -598,6 +651,7 @@ public class GrowthLogService {
|
598
|
651
|
log.setProfessorId(user.getInviterId());
|
599
|
652
|
log.setOperate("111");
|
600
|
653
|
log.setScore(this.rule.getConsultAssessForInviter());
|
|
654
|
log.setInvitePro(professorId);
|
601
|
655
|
this.growthLogDao.insert(con, log);
|
602
|
656
|
this.professorDao.updateScoreValue(con, user.getInviterId(), log.getScore());
|
603
|
657
|
this.professorDao.updateGrowthValue(con, user.getInviterId(), log.getScore());
|
|
@ -626,6 +680,7 @@ public class GrowthLogService {
|
626
|
680
|
log.setProfessorId(user.getInviterId());
|
627
|
681
|
log.setOperate("112");
|
628
|
682
|
log.setScore(this.rule.getAddProDemandForInviter());
|
|
683
|
log.setInvitePro(professorId);
|
629
|
684
|
this.growthLogDao.insert(con, log);
|
630
|
685
|
this.professorDao.updateScoreValue(con, user.getInviterId(), log.getScore());
|
631
|
686
|
this.professorDao.updateGrowthValue(con, user.getInviterId(), log.getScore());
|
|
@ -654,6 +709,7 @@ public class GrowthLogService {
|
654
|
709
|
log.setProfessorId(user.getInviterId());
|
655
|
710
|
log.setOperate("113");
|
656
|
711
|
log.setScore(this.rule.getAddOrgDemandForInviter());
|
|
712
|
log.setInvitePro(professorId);
|
657
|
713
|
this.growthLogDao.insert(con, log);
|
658
|
714
|
this.professorDao.updateScoreValue(con, user.getInviterId(), log.getScore());
|
659
|
715
|
this.professorDao.updateGrowthValue(con, user.getInviterId(), log.getScore());
|
|
@ -682,6 +738,7 @@ public class GrowthLogService {
|
682
|
738
|
log.setProfessorId(user.getInviterId());
|
683
|
739
|
log.setOperate("114");
|
684
|
740
|
log.setScore(this.rule.getDemandConfirmForInviter());
|
|
741
|
log.setInvitePro(professorId);
|
685
|
742
|
this.growthLogDao.insert(con, log);
|
686
|
743
|
this.professorDao.updateScoreValue(con, user.getInviterId(), log.getScore());
|
687
|
744
|
this.professorDao.updateGrowthValue(con, user.getInviterId(), log.getScore());
|