Browse Source

新版专家录入和专家录入审核

XMTT 7 years ago
parent
commit
85cf3912ab
22 changed files with 1291 additions and 47 deletions
  1. 17 0
      src/main/java/com/ekexiu/console/system/dao/HonorDao.java
  2. 27 0
      src/main/java/com/ekexiu/console/system/dao/LuserDao.java
  3. 17 0
      src/main/java/com/ekexiu/console/system/dao/PartTimeJobDao.java
  4. 17 0
      src/main/java/com/ekexiu/console/system/dao/ProfessorEduBgDao.java
  5. 17 0
      src/main/java/com/ekexiu/console/system/dao/ProjectDao.java
  6. 17 0
      src/main/java/com/ekexiu/console/system/dao/ResearchAreaDao.java
  7. 5 0
      src/main/java/com/ekexiu/console/system/dao/UserDao.java
  8. 54 0
      src/main/java/com/ekexiu/console/system/dao/UserInfoDao.java
  9. 10 9
      src/main/java/com/ekexiu/console/system/dao/UserRoleDao.java
  10. 65 0
      src/main/java/com/ekexiu/console/system/po/Honor.java
  11. 118 0
      src/main/java/com/ekexiu/console/system/po/Luser.java
  12. 95 0
      src/main/java/com/ekexiu/console/system/po/PartTimeJob.java
  13. 7 7
      src/main/java/com/ekexiu/console/system/po/Professor.java
  14. 112 0
      src/main/java/com/ekexiu/console/system/po/ProfessorEduBg.java
  15. 66 0
      src/main/java/com/ekexiu/console/system/po/Project.java
  16. 58 0
      src/main/java/com/ekexiu/console/system/po/ResearchArea.java
  17. 193 0
      src/main/java/com/ekexiu/console/system/po/UserInfo.java
  18. 27 29
      src/main/java/com/ekexiu/console/system/service/RoleService.java
  19. 338 0
      src/main/java/com/ekexiu/console/system/service/UserInfoService.java
  20. 1 1
      src/main/java/com/ekexiu/console/system/service/UserService.java
  21. 29 0
      src/main/resources/database.sql
  22. 1 1
      src/main/resources/project-dev.properties

+ 17 - 0
src/main/java/com/ekexiu/console/system/dao/HonorDao.java

@ -0,0 +1,17 @@
1
package com.ekexiu.console.system.dao;
2
3
import com.ekexiu.console.system.po.Honor;
4
import org.jfw.apt.orm.annotation.dao.DAO;
5
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
6
7
import java.sql.Connection;
8
import java.sql.SQLException;
9
10
/**
11
 * Created by TT on 2017/7/14.
12
 */
13
@DAO
14
public interface HonorDao {
15
    @Insert
16
    int insert(Connection con, Honor honor) throws SQLException;
17
}

+ 27 - 0
src/main/java/com/ekexiu/console/system/dao/LuserDao.java

@ -0,0 +1,27 @@
1
package com.ekexiu.console.system.dao;
2
3
import com.ekexiu.console.system.po.Luser;
4
import org.jfw.apt.annotation.Nullable;
5
import org.jfw.apt.orm.annotation.dao.DAO;
6
import org.jfw.apt.orm.annotation.dao.method.Or;
7
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
8
import org.jfw.apt.orm.annotation.dao.method.operator.SelectOne;
9
import org.jfw.apt.orm.annotation.dao.param.Alias;
10
11
import java.sql.Connection;
12
import java.sql.SQLException;
13
14
/**
15
 * Created by TT on 2017/7/13.
16
 */
17
@DAO
18
public interface LuserDao {
19
20
    @Or
21
    @Nullable
22
    @SelectOne
23
    Luser check(Connection con, @Alias({ "mobilePhone", "email" }) String key) throws SQLException;
24
25
    @Insert
26
    int insert(Connection con,Luser user)throws SQLException;
27
}

+ 17 - 0
src/main/java/com/ekexiu/console/system/dao/PartTimeJobDao.java

@ -0,0 +1,17 @@
1
package com.ekexiu.console.system.dao;
2
3
import com.ekexiu.console.system.po.PartTimeJob;
4
import org.jfw.apt.orm.annotation.dao.DAO;
5
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
6
7
import java.sql.Connection;
8
import java.sql.SQLException;
9
10
/**
11
 * Created by TT on 2017/7/14.
12
 */
13
@DAO
14
public interface PartTimeJobDao {
15
    @Insert
16
    int insert(Connection con, PartTimeJob job) throws SQLException;
17
}

+ 17 - 0
src/main/java/com/ekexiu/console/system/dao/ProfessorEduBgDao.java

@ -0,0 +1,17 @@
1
package com.ekexiu.console.system.dao;
2
3
import com.ekexiu.console.system.po.ProfessorEduBg;
4
import org.jfw.apt.orm.annotation.dao.DAO;
5
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
6
7
import java.sql.Connection;
8
import java.sql.SQLException;
9
10
/**
11
 * Created by TT on 2017/7/14.
12
 */
13
@DAO
14
public interface ProfessorEduBgDao {
15
    @Insert
16
    int insert(Connection con, ProfessorEduBg edu) throws SQLException;
17
}

+ 17 - 0
src/main/java/com/ekexiu/console/system/dao/ProjectDao.java

@ -0,0 +1,17 @@
1
package com.ekexiu.console.system.dao;
2
3
import com.ekexiu.console.system.po.Project;
4
import org.jfw.apt.orm.annotation.dao.DAO;
5
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
6
7
import java.sql.Connection;
8
import java.sql.SQLException;
9
10
/**
11
 * Created by TT on 2017/7/13.
12
 */
13
@DAO
14
public interface ProjectDao {
15
    @Insert
16
    int insert(Connection con, Project project)throws SQLException;
17
}

+ 17 - 0
src/main/java/com/ekexiu/console/system/dao/ResearchAreaDao.java

@ -0,0 +1,17 @@
1
package com.ekexiu.console.system.dao;
2
3
import com.ekexiu.console.system.po.ResearchArea;
4
import org.jfw.apt.orm.annotation.dao.DAO;
5
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
6
7
import java.sql.Connection;
8
import java.sql.SQLException;
9
10
/**
11
 * Created by TT on 2017/7/13.
12
 */
13
@DAO
14
public interface ResearchAreaDao {
15
    @Insert
16
    int insert(Connection con, ResearchArea area) throws SQLException;
17
}

+ 5 - 0
src/main/java/com/ekexiu/console/system/dao/UserDao.java

@ -78,4 +78,9 @@ public interface UserDao {
78 78
	@Batch
79 79
	@From(User.class)
80 80
	int[] delete(Connection con, @Batch String[] id) throws SQLException;
81

82
	@Batch
83
	@UpdateWith
84
	@From(User.class)
85
	int[] delete(Connection con, @Batch String[] id, @Set boolean actived) throws SQLException;
81 86
}

+ 54 - 0
src/main/java/com/ekexiu/console/system/dao/UserInfoDao.java

@ -0,0 +1,54 @@
1
package com.ekexiu.console.system.dao;
2
3
import com.ekexiu.console.system.po.UserInfo;
4
import org.jfw.apt.annotation.Nullable;
5
import org.jfw.apt.orm.annotation.dao.DAO;
6
import org.jfw.apt.orm.annotation.dao.method.From;
7
import org.jfw.apt.orm.annotation.dao.method.Or;
8
import org.jfw.apt.orm.annotation.dao.method.OrderBy;
9
import org.jfw.apt.orm.annotation.dao.method.Where;
10
import org.jfw.apt.orm.annotation.dao.method.operator.*;
11
import org.jfw.apt.orm.annotation.dao.param.Alias;
12
import org.jfw.apt.orm.annotation.dao.param.GtEq;
13
import org.jfw.apt.orm.annotation.dao.param.Like;
14
import org.jfw.apt.orm.annotation.dao.param.LtEq;
15
import org.jfw.util.PageQueryResult;
16
17
import java.sql.Connection;
18
import java.sql.SQLException;
19
20
/**
21
 * Created by TT on 2017/7/7.
22
 */
23
@DAO
24
public interface UserInfoDao {
25
26
    @Insert
27
    int insert(Connection con, UserInfo ui) throws SQLException;
28
29
    @Update
30
    int update(Connection con, UserInfo ui) throws SQLException;
31
32
    @DeleteWith
33
    @From(UserInfo.class)
34
    int delete(Connection con, String id) throws SQLException;
35
36
    @SelectOne
37
    @Nullable
38
    UserInfo query(Connection con, String id) throws SQLException;
39
40
    @PageQuery
41
    @OrderBy(" ORDER BY create_time DESC")
42
    PageQueryResult<UserInfo> queryPerson(Connection con, String creator, @Nullable @Like String name, @Nullable @Like String orgName, @Nullable String state, @Nullable @GtEq @Alias("createTime") String bt, @Nullable @Alias("createTime") @LtEq String et, int pageSize, int pageNo) throws SQLException;
43
44
    @PageQuery
45
    @OrderBy(" ORDER BY create_time DESC")
46
    @Where("state<>'1'")
47
    PageQueryResult<UserInfo> queryAll(Connection con, @Nullable @Like String name, @Nullable @Like String orgName, @Nullable String state, @Nullable @GtEq @Alias("createTime") String bt, @Nullable @Alias("createTime") @LtEq String et, int pageSize, int pageNo) throws SQLException;
48
49
    @Or
50
    @Nullable
51
    @SelectOne
52
    UserInfo entryCheck(Connection con, @Alias({ "mobile", "email" }) String key) throws SQLException;
53
54
}

+ 10 - 9
src/main/java/com/ekexiu/console/system/dao/UserRoleDao.java

@ -1,18 +1,15 @@
1 1
package com.ekexiu.console.system.dao;
2 2

3
import java.sql.Connection;
4
import java.sql.SQLException;
5
import java.util.List;
6

3
import com.ekexiu.console.system.po.UserRole;
4
import org.jfw.apt.annotation.Nullable;
7 5
import org.jfw.apt.orm.annotation.dao.Batch;
8 6
import org.jfw.apt.orm.annotation.dao.DAO;
9 7
import org.jfw.apt.orm.annotation.dao.method.From;
10
import org.jfw.apt.orm.annotation.dao.method.operator.Delete;
11
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
12
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
13
import org.jfw.apt.orm.annotation.dao.method.operator.SelectList;
8
import org.jfw.apt.orm.annotation.dao.method.operator.*;
14 9

15
import com.ekexiu.console.system.po.UserRole;
10
import java.sql.Connection;
11
import java.sql.SQLException;
12
import java.util.List;
16 13

17 14
@DAO
18 15
public interface UserRoleDao {
@ -34,5 +31,9 @@ public interface UserRoleDao {
34 31
	
35 32
	@SelectList
36 33
	List<UserRole> queryByUserId(Connection con, String userid) throws SQLException;
34

35
	@Nullable
36
	@SelectOne
37
	UserRole queryByRoleId(Connection con, String roleid) throws SQLException;
37 38
	
38 39
}

+ 65 - 0
src/main/java/com/ekexiu/console/system/po/Honor.java

@ -0,0 +1,65 @@
1
package com.ekexiu.console.system.po;
2
3
import org.jfw.apt.orm.annotation.entry.Column;
4
import org.jfw.apt.orm.annotation.entry.PrimaryKey;
5
import org.jfw.apt.orm.annotation.entry.Table;
6
import org.jfw.apt.orm.core.enums.DE;
7
8
/**
9
 * Created by TT on 2017/7/14.
10
 */
11
@PrimaryKey({"id"})
12
@Table
13
public class Honor {
14
    private String professorId;
15
    private String id;
16
    private String year;
17
    private String name;
18
    private String descp;
19
20
21
    @Column(DE.id_32)
22
    public String getId() {
23
        return id;
24
    }
25
26
    public void setId(String id) {
27
        this.id = id;
28
    }
29
30
    @Column(value = DE.time_de, dbType = "CHAR(4)")
31
    public String getYear() {
32
        return year;
33
    }
34
35
    public void setYear(String year) {
36
        this.year = year;
37
    }
38
39
    @Column(value = DE.string_de, dbType = "TEXT")
40
    public String getName() {
41
        return name;
42
    }
43
44
    public void setName(String name) {
45
        this.name = name;
46
    }
47
48
    @Column(DE.id_32)
49
    public String getProfessorId() {
50
        return professorId;
51
    }
52
53
    public void setProfessorId(String professorId) {
54
        this.professorId = professorId;
55
    }
56
57
    @Column(value = DE.String_de, dbType = "TEXT")
58
    public String getDescp() {
59
        return descp;
60
    }
61
62
    public void setDescp(String descp) {
63
        this.descp = descp;
64
    }
65
}

+ 118 - 0
src/main/java/com/ekexiu/console/system/po/Luser.java

@ -0,0 +1,118 @@
1
package com.ekexiu.console.system.po;
2
3
import com.ekexiu.console.basepo.CreateTimeSupported;
4
import org.jfw.apt.orm.annotation.entry.*;
5
import org.jfw.apt.orm.core.defaultImpl.FixLenStringHandler;
6
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
7
import org.jfw.apt.orm.core.defaultImpl.WIntHandler;
8
import org.jfw.apt.orm.core.enums.DE;
9
10
/**
11
 * Created by TT on 2017/7/13.
12
 */
13
@PrimaryKey("id")
14
@Uniques({ @Unique(clolumns = "email", name = "USER_EMAIL_UQ"),
15
        @Unique(clolumns = "mobilePhone", name = "USER_MOBILEPHONE_UQ") })
16
@Table(value="LUSER")
17
public class Luser implements CreateTimeSupported {
18
    private String id;
19
    private String email;
20
    private String mobilePhone;
21
    private String passwd;
22
    private String userType;
23
    private String createTime;
24
    private String inviteCode;
25
    private Integer sendMailStatus;
26
    private String inviterId;
27
    private String activeTime;
28
29
    @Column(DE.id_32)
30
    public String getId() {
31
        return id;
32
    }
33
34
    public void setId(String id) {
35
        this.id = id;
36
    }
37
38
    @Column(DE.Email_de)
39
    public String getEmail() {
40
        return email;
41
    }
42
43
    public void setEmail(String email) {
44
        this.email = email;
45
    }
46
47
    @Column(DE.MobilePhone_de)
48
    public String getMobilePhone() {
49
        return mobilePhone;
50
    }
51
52
    public void setMobilePhone(String mobilePhone) {
53
        this.mobilePhone = mobilePhone;
54
    }
55
56
    @Column(DE.md5_de)
57
    public String getPasswd() {
58
        return passwd;
59
    }
60
61
    public void setPasswd(String passwd) {
62
        this.passwd = passwd;
63
    }
64
65
    @Column(DE.singleChar)
66
    public String getUserType() {
67
        return userType;
68
    }
69
70
    public void setUserType(String userType) {
71
        this.userType = userType;
72
    }
73
74
    public String getCreateTime() {
75
        return createTime;
76
    }
77
78
    public void setCreateTime(String createTime) {
79
        this.createTime = createTime;
80
    }
81
82
    @Column(value= DE.String_de,dbType="VARCHAR(32)")
83
    public String getInviteCode() {
84
        return inviteCode;
85
    }
86
87
    public void setInviteCode(String inviteCode) {
88
        this.inviteCode = inviteCode;
89
    }
90
91
    @Column(handlerClass=WIntHandler.class,dbType="INT",insertable=false,nullable=true,renewable=false,queryable=true)
92
    public Integer getSendMailStatus() {
93
        return sendMailStatus;
94
    }
95
96
    public void setSendMailStatus(Integer sendMailStatus) {
97
        this.sendMailStatus = sendMailStatus;
98
    }
99
100
    @Column(handlerClass=StringHandler.class,dbType="CHAR(32)",insertable = true,renewable=false,queryable=true,nullable=true)
101
    public String getInviterId() {
102
        return inviterId;
103
    }
104
105
    public void setInviterId(String inviterId) {
106
        this.inviterId = inviterId;
107
    }
108
109
    @Column(handlerClass=FixLenStringHandler.class,dbType="CHAR(14)",nullable=true,insertable=true,renewable=false,queryable=true)
110
    public String getActiveTime() {
111
        return activeTime;
112
    }
113
114
    public void setActiveTime(String activeTime) {
115
        this.activeTime = activeTime;
116
    }
117
118
}

+ 95 - 0
src/main/java/com/ekexiu/console/system/po/PartTimeJob.java

@ -0,0 +1,95 @@
1
package com.ekexiu.console.system.po;
2
3
import org.jfw.apt.orm.annotation.entry.Column;
4
import org.jfw.apt.orm.annotation.entry.PrimaryKey;
5
import org.jfw.apt.orm.annotation.entry.Table;
6
import org.jfw.apt.orm.core.enums.DE;
7
8
/**
9
 * Created by TT on 2017/7/14.
10
 */
11
@PrimaryKey({"id"})
12
@Table
13
public class PartTimeJob {
14
    private String professorId;
15
    private String id;
16
    private String startMonth;
17
    private String stopMonth;
18
    private String company;
19
    private String title;
20
    private String descp;
21
    private String department;
22
23
    @Column(DE.id_32)
24
    public String getId() {
25
        return id;
26
    }
27
28
    public void setId(String id) {
29
        this.id = id;
30
    }
31
32
    @Column(DE.time_de)
33
    public String getStartMonth() {
34
        return startMonth;
35
    }
36
37
    public void setStartMonth(String startMonth) {
38
        this.startMonth = startMonth;
39
    }
40
41
    @Column(DE.Time_de)
42
    public String getStopMonth() {
43
        return stopMonth;
44
    }
45
46
    public void setStopMonth(String stopMonth) {
47
        this.stopMonth = stopMonth;
48
    }
49
50
    @Column(DE.id_32)
51
    public String getProfessorId() {
52
        return professorId;
53
    }
54
55
    public void setProfessorId(String professorId) {
56
        this.professorId = professorId;
57
    }
58
59
    @Column(DE.string_de)
60
    public String getCompany() {
61
        return company;
62
    }
63
64
    public void setCompany(String company) {
65
        this.company = company;
66
    }
67
68
    @Column(DE.string_de)
69
    public String getTitle() {
70
        return title;
71
    }
72
73
    public void setTitle(String title) {
74
        this.title = title;
75
    }
76
77
    @Column(value = DE.String_de, dbType = "TEXT")
78
    public String getDescp() {
79
        return descp;
80
    }
81
82
    public void setDescp(String descp) {
83
        this.descp = descp;
84
    }
85
86
    @Column(DE.String_de)
87
    public String getDepartment() {
88
        return department;
89
    }
90
91
    public void setDepartment(String department) {
92
        this.department = department;
93
    }
94
95
}

+ 7 - 7
src/main/java/com/ekexiu/console/system/po/Professor.java

@ -102,7 +102,7 @@ public class Professor implements CreateTimeSupported,ModifyTimeSupported {
102 102
        this.office = office;
103 103
    }
104 104
105
    @Column(handlerClass=StringHandler.class,dbType="TEXT",insertable=false,nullable=true,renewable=false,queryable=true)
105
    @Column(handlerClass=StringHandler.class,dbType="TEXT",insertable=true,nullable=true,renewable=false,queryable=true)
106 106
    public String getSubject() {
107 107
        return subject;
108 108
    }
@ -110,7 +110,7 @@ public class Professor implements CreateTimeSupported,ModifyTimeSupported {
110 110
    public void setSubject(String subject) {
111 111
        this.subject = subject;
112 112
    }
113
    @Column(handlerClass=StringHandler.class,dbType="TEXT",insertable=false,nullable=true,renewable=false,queryable=true)
113
    @Column(handlerClass=StringHandler.class,dbType="TEXT",insertable=true,nullable=true,renewable=false,queryable=true)
114 114
    public String getIndustry() {
115 115
        return industry;
116 116
    }
@ -201,7 +201,7 @@ public class Professor implements CreateTimeSupported,ModifyTimeSupported {
201 201
    public void setName(String name) {
202 202
        this.name = name;
203 203
    }
204
    @Column(handlerClass=StringHandler.class,dbType="TEXT",insertable=false,nullable=true,renewable=false,queryable=true)
204
    @Column(handlerClass=StringHandler.class,dbType="TEXT",insertable=true,nullable=true,renewable=false,queryable=true)
205 205
    public String getDescp() {
206 206
        return descp;
207 207
    }
@ -262,7 +262,7 @@ public class Professor implements CreateTimeSupported,ModifyTimeSupported {
262 262
        this.authentication = authentication;
263 263
    }
264 264
265
    @Column(handlerClass=WIntHandler.class,dbType="INT",insertable=false,nullable=false,renewable=false,queryable=true)
265
    @Column(handlerClass=WIntHandler.class,dbType="INT",insertable=true,nullable=false,renewable=false,queryable=true)
266 266
    public Integer getAuthType() {
267 267
        return authType;
268 268
    }
@ -271,7 +271,7 @@ public class Professor implements CreateTimeSupported,ModifyTimeSupported {
271 271
        this.authType = authType;
272 272
    }
273 273
274
    @Column(handlerClass=WIntHandler.class,dbType="INT",insertable=false,nullable=false,renewable=false,queryable=true)
274
    @Column(handlerClass=WIntHandler.class,dbType="INT",insertable=true,nullable=false,renewable=false,queryable=true)
275 275
    public Integer getAuthStatus() {
276 276
        return authStatus;
277 277
    }
@ -280,7 +280,7 @@ public class Professor implements CreateTimeSupported,ModifyTimeSupported {
280 280
        this.authStatus = authStatus;
281 281
    }
282 282
283
    @Column(handlerClass=WIntHandler.class,dbType="INT",insertable=false,nullable=true,renewable=false,queryable=true)
283
    @Column(handlerClass=WIntHandler.class,dbType="INT",insertable=true,nullable=true,renewable=false,queryable=true)
284 284
    public Integer getAuthStatusExpert() {
285 285
        return authStatusExpert;
286 286
    }
@ -307,7 +307,7 @@ public class Professor implements CreateTimeSupported,ModifyTimeSupported {
307 307
        this.email = email;
308 308
    }
309 309
310
    @Column(handlerClass=WIntHandler.class,dbType="INT",insertable=false,nullable=false,renewable=false,queryable=true)
310
    @Column(handlerClass=WIntHandler.class,dbType="INT",insertable=true,nullable=false,renewable=false,queryable=true)
311 311
    public Integer getSortFirst() {
312 312
        return sortFirst;
313 313
    }

+ 112 - 0
src/main/java/com/ekexiu/console/system/po/ProfessorEduBg.java

@ -0,0 +1,112 @@
1
package com.ekexiu.console.system.po;
2
3
import org.jfw.apt.orm.annotation.entry.Column;
4
import org.jfw.apt.orm.annotation.entry.PrimaryKey;
5
import org.jfw.apt.orm.annotation.entry.Table;
6
import org.jfw.apt.orm.core.enums.DE;
7
8
/**
9
 * Created by TT on 2017/7/14.
10
 */
11
@PrimaryKey({"id"})
12
@Table
13
public class ProfessorEduBg {
14
    private String id;
15
    private String professorId;
16
    private String year;
17
    private String school;
18
    private String college;
19
    private String major;
20
    private boolean student;
21
    private String degree;
22
    private String descp;
23
24
    @Column(DE.id_32)
25
    public String getId() {
26
        return id;
27
    }
28
29
    public void setId(String id) {
30
        this.id = id;
31
    }
32
33
    @Column(value = DE.Time_de, dbType = "CHAR(4)")
34
    public String getYear() {
35
        return year;
36
    }
37
38
    public void setYear(String year) {
39
        this.year = year;
40
    }
41
42
    @Column(DE.boolean_de)
43
    public boolean isStudent() {
44
        return student;
45
    }
46
47
    public void setStudent(boolean student) {
48
        this.student = student;
49
    }
50
51
    @Column(DE.String_de)
52
    public String getDegree() {
53
        return degree;
54
    }
55
56
    public void setDegree(String degree) {
57
        this.degree = degree;
58
    }
59
60
    /**
61
     * @return
62
     */
63
    @Column(DE.id_32)
64
    public String getProfessorId() {
65
        return professorId;
66
    }
67
68
    public void setProfessorId(String professorId) {
69
        this.professorId = professorId;
70
    }
71
72
    /**
73
     * @return
74
     */
75
    @Column(DE.string_de)
76
    public String getSchool() {
77
        return school;
78
    }
79
80
    public void setSchool(String school) {
81
        this.school = school;
82
    }
83
84
    @Column(DE.String_de)
85
    public String getCollege() {
86
        return college;
87
    }
88
89
    public void setCollege(String college) {
90
        this.college = college;
91
    }
92
93
    @Column(DE.String_de)
94
    public String getMajor() {
95
        return major;
96
    }
97
98
    public void setMajor(String major) {
99
        this.major = major;
100
    }
101
102
    @Column(value = DE.String_de, dbType = "TEXT")
103
    public String getDescp() {
104
        return descp;
105
    }
106
107
    public void setDescp(String descp) {
108
        this.descp = descp;
109
    }
110
111
112
}

+ 66 - 0
src/main/java/com/ekexiu/console/system/po/Project.java

@ -0,0 +1,66 @@
1
package com.ekexiu.console.system.po;
2
3
import org.jfw.apt.orm.annotation.entry.Column;
4
import org.jfw.apt.orm.annotation.entry.PrimaryKey;
5
import org.jfw.apt.orm.annotation.entry.Table;
6
import org.jfw.apt.orm.core.enums.DE;
7
8
/**
9
 * Created by TT on 2017/7/13.
10
 */
11
@PrimaryKey({"id"})
12
@Table
13
public class Project {
14
    private String id;
15
    private String professorId;
16
    private String startMonth;
17
    private String stopMonth;
18
    private String name;
19
    private String descp;
20
21
    @Column(DE.id_32)
22
    public String getId() {
23
        return id;
24
    }
25
    public void setId(String id) {
26
        this.id = id;
27
    }
28
    @Column(DE.time_de)
29
    public String getStartMonth() {
30
        return startMonth;
31
    }
32
    public void setStartMonth(String startMonth) {
33
        this.startMonth = startMonth;
34
    }
35
    @Column(DE.Time_de)
36
    public String getStopMonth() {
37
        return stopMonth;
38
    }
39
    public void setStopMonth(String stopMonth) {
40
        this.stopMonth = stopMonth;
41
    }
42
    @Column(DE.id_32)
43
    public String getProfessorId() {
44
        return professorId;
45
    }
46
    public void setProfessorId(String professorId) {
47
        this.professorId = professorId;
48
    }
49
50
    @Column(value= DE.string_de,dbType="TEXT")
51
    public String getName() {
52
        return name;
53
    }
54
    public void setName(String title) {
55
        this.name = title;
56
    }
57
58
    @Column(value=DE.String_de,dbType="TEXT")
59
    public String getDescp() {
60
        return descp;
61
    }
62
    public void setDescp(String descp) {
63
        this.descp = descp;
64
    }
65
66
}

+ 58 - 0
src/main/java/com/ekexiu/console/system/po/ResearchArea.java

@ -0,0 +1,58 @@
1
package com.ekexiu.console.system.po;
2
3
import org.jfw.apt.orm.annotation.entry.Column;
4
import org.jfw.apt.orm.annotation.entry.PrimaryKey;
5
import org.jfw.apt.orm.annotation.entry.Table;
6
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
7
import org.jfw.apt.orm.core.enums.DE;
8
9
/**
10
 * Created by TT on 2017/7/13.
11
 */
12
@PrimaryKey({"professorId","caption"})
13
@Table
14
public class ResearchArea {
15
    private String professorId;
16
    private String caption;
17
    private String descp;
18
    private int sortNum;
19
    private int count;
20
21
    @Column(DE.int_de)
22
    public int getSortNum() {
23
        return sortNum;
24
    }
25
    public void setSortNum(int sortNum) {
26
        this.sortNum = sortNum;
27
    }
28
    @Column(handlerClass=StringHandler.class,dbType="TEXT",insertable=true,nullable=true,renewable=true,queryable=true)
29
    public String getDescp() {
30
        return descp;
31
    }
32
    public void setDescp(String descp) {
33
        this.descp = descp;
34
    }
35
    @Column(DE.int_de)
36
    public int getCount() {
37
        return count;
38
    }
39
    public void setCount(int count) {
40
        this.count = count;
41
    }
42
43
    @Column(DE.id_32)
44
    public String getProfessorId() {
45
        return professorId;
46
    }
47
    public void setProfessorId(String orgId) {
48
        this.professorId = orgId;
49
    }
50
    @Column(DE.string_de)
51
    public String getCaption() {
52
        return caption;
53
    }
54
    public void setCaption(String caption) {
55
        this.caption = caption;
56
    }
57
}
58

+ 193 - 0
src/main/java/com/ekexiu/console/system/po/UserInfo.java

@ -0,0 +1,193 @@
1
package com.ekexiu.console.system.po;
2
3
import org.jfw.apt.orm.annotation.entry.Column;
4
import org.jfw.apt.orm.annotation.entry.PrimaryKey;
5
import org.jfw.apt.orm.annotation.entry.Table;
6
import org.jfw.apt.orm.core.enums.DE;
7
import org.jfw.util.json.JsonService;
8
import org.jfw.util.reflect.TypeReference;
9
10
import java.lang.reflect.Type;
11
import java.util.Collection;
12
import java.util.HashMap;
13
import java.util.Map;
14
import java.util.Set;
15
16
/**
17
 * Created by TT on 2017/7/7.
18
 */
19
@PrimaryKey("id")
20
@Table
21
public class UserInfo implements Map<String, Object> {
22
    public static Type MAP_TYPE = (new TypeReference<Map<String, Object>>() {
23
    }).getType();
24
25
26
    private transient Map<String, Object> target = new HashMap<String, Object>();
27
28
29
    @Column(DE.id_32)
30
    public String getId() {
31
        return (String) this.get("id");
32
    }
33
34
    public void setId(String id) {
35
        this.put("id", id);
36
    }
37
38
    @Column(DE.id_32)
39
    public String getCreator() {
40
        return (String) this.get("creator");
41
    }
42
43
    public void setCreator(String creator) {
44
        this.put("creator", creator);
45
    }
46
47
    @Column(DE.Text_de)
48
    public String getCreatorName() {
49
        return (String) this.get("creatorName");
50
    }
51
52
    public void setCreatorName(String creatorName) {
53
        this.put("creatorName", creatorName);
54
    }
55
56
    @Column(DE.Text_de)
57
    public String getMobile() {
58
        return (String) this.get("mobile");
59
    }
60
61
    public void setMobile(String mobile) {
62
        this.put("mobile", mobile);
63
    }
64
65
    @Column(DE.Text_de)
66
    public String getEmail() {
67
        return (String) this.get("email");
68
    }
69
70
    public void setEmail(String email) {
71
        this.put("email", email);
72
    }
73
74
    @Column(DE.Text_de)
75
    public String getOrgName() {
76
        return (String) this.get("orgName");
77
    }
78
79
    public void setOrgName(String orgName) {
80
        this.put("orgName", orgName);
81
    }
82
83
    @Column(DE.text_de)
84
    public String getState() {
85
        return (String) this.get("state");
86
    }
87
88
    public void setState(String state) {
89
        this.put("state", state);
90
    }
91
92
    @Column(DE.text_de)
93
    public String getName() {
94
        return (String) this.get("name");
95
    }
96
97
    public void setName(String name) {
98
        this.put("name", name);
99
    }
100
101
    @Column(DE.text_de)
102
    public String getCreateTime() {
103
        return (String) this.get("createTime");
104
    }
105
106
107
    public void setCreateTime(String createTime) {
108
        this.put("createTime", createTime);
109
    }
110
111
    @Column(DE.text_de)
112
    public String getCnt() {
113
        return JsonService.toJson(this);
114
    }
115
116
    public void setCnt(String cnt) {
117
        Map<String, Object> map = JsonService.fromJson(cnt, MAP_TYPE);
118
        this.putAll(map);
119
    }
120
121
122
    public static void main(String[] args) throws Exception {
123
        UserInfo ui = new UserInfo();
124
        ui.setId("dddd");
125
        ui.setState("2");
126
        String s = JsonService.toJson(ui);
127
        System.out.println(s);
128
        ui = JsonService.fromJson(s, UserInfo.class);
129
        System.out.println(ui.getId());
130
        System.out.println(ui.getState());
131
132
    }
133
134
    @Override
135
    public int size() {
136
        return target.size();
137
    }
138
139
    @Override
140
    public boolean isEmpty() {
141
        return target.isEmpty();
142
    }
143
144
    @Override
145
    public boolean containsKey(Object key) {
146
        return target.containsKey(key);
147
    }
148
149
    @Override
150
    public boolean containsValue(Object value) {
151
        return target.containsValue(value);
152
    }
153
154
    @Override
155
    public Object get(Object key) {
156
        return target.get(key);
157
    }
158
159
    @Override
160
    public Object put(String key, Object value) {
161
        return target.put(key, value);
162
    }
163
164
    @Override
165
    public Object remove(Object key) {
166
        return target.remove(key);
167
    }
168
169
    @Override
170
    public void putAll(Map<? extends String, ?> m) {
171
        target.putAll(m);
172
    }
173
174
    @Override
175
    public void clear() {
176
        target.clear();
177
    }
178
179
    @Override
180
    public Set<String> keySet() {
181
        return target.keySet();
182
    }
183
184
    @Override
185
    public Collection<Object> values() {
186
        return target.values();
187
    }
188
189
    @Override
190
    public Set<Entry<String, Object>> entrySet() {
191
        return target.entrySet();
192
    }
193
}

+ 27 - 29
src/main/java/com/ekexiu/console/system/service/RoleService.java

@ -1,21 +1,12 @@
1 1
package com.ekexiu.console.system.service;
2 2

3
import java.sql.Connection;
4
import java.sql.SQLException;
5
import java.util.ArrayList;
6
import java.util.Collection;
7
import java.util.HashMap;
8
import java.util.List;
9
import java.util.ListIterator;
10
import java.util.Map;
11
import java.util.concurrent.atomic.AtomicBoolean;
12
import java.util.concurrent.atomic.AtomicReference;
13

14
import javax.sql.DataSource;
15

3
import com.ekexiu.console.system.dao.RoleDao;
4
import com.ekexiu.console.system.dao.UserRoleDao;
5
import com.ekexiu.console.system.po.Role;
6
import com.ekexiu.console.system.po.UserRole;
7
import com.ekexiu.console.system.vo.ConsoleAuthRole;
16 8
import org.jfw.apt.annotation.Autowrie;
17 9
import org.jfw.apt.web.annotation.Path;
18
import org.jfw.apt.web.annotation.operate.Delete;
19 10
import org.jfw.apt.web.annotation.operate.Get;
20 11
import org.jfw.apt.web.annotation.operate.Post;
21 12
import org.jfw.apt.web.annotation.operate.Put;
@ -27,10 +18,12 @@ import org.jfw.util.auth.AuthUtil;
27 18
import org.jfw.util.jdbc.JdbcTask;
28 19
import org.jfw.util.jdbc.JdbcUtil;
29 20

30
import com.ekexiu.console.system.dao.RoleDao;
31
import com.ekexiu.console.system.dao.UserRoleDao;
32
import com.ekexiu.console.system.po.Role;
33
import com.ekexiu.console.system.vo.ConsoleAuthRole;
21
import javax.sql.DataSource;
22
import java.sql.Connection;
23
import java.sql.SQLException;
24
import java.util.*;
25
import java.util.concurrent.atomic.AtomicBoolean;
26
import java.util.concurrent.atomic.AtomicReference;
34 27

35 28
@Path("/sys/role")
36 29
public class RoleService {
@ -113,18 +106,23 @@ public class RoleService {
113 106
	}
114 107

115 108
	@Path("/{id}")
116
	@Delete
117
	public void delete(@JdbcConn final Connection con, @PathVar final String id) throws SQLException {
109
	@Post
110
	public int delete(@JdbcConn final Connection con, @PathVar final String id) throws SQLException {
118 111
		final AtomicBoolean ab = new AtomicBoolean(false);
119
		JdbcUtil.executeAutoCommit(con, new JdbcTask() {
120
			@Override
121
			public void exec() throws SQLException {
122
				userRoleDao.deleteByRoleId(con, id);
123
				ab.set(roleDao.delete(con, id) > 0);
124
			}
125
		});
126
		if (ab.get())
127
			this.remove(id);
112
		UserRole userRole = userRoleDao.queryByRoleId(con, id);
113
		if (userRole == null) {
114
			JdbcUtil.executeAutoCommit(con, new JdbcTask() {
115
				@Override
116
				public void exec() throws SQLException {
117
					//userRoleDao.deleteByRoleId(con, id);
118
					ab.set(roleDao.delete(con, id) > 0);
119
				}
120
			});
121
			if (ab.get())
122
				this.remove(id);
123
			return 1;
124
		}
125
		return 0;
128 126
	}
129 127

130 128
	@Path("/all")

+ 338 - 0
src/main/java/com/ekexiu/console/system/service/UserInfoService.java

@ -0,0 +1,338 @@
1
package com.ekexiu.console.system.service;
2
3
import com.ekexiu.console.system.dao.*;
4
import com.ekexiu.console.system.po.*;
5
import com.ekexiu.console.system.vo.ConsoleAuthUser;
6
import org.jfw.apt.annotation.Autowrie;
7
import org.jfw.apt.annotation.DefaultValue;
8
import org.jfw.apt.annotation.Nullable;
9
import org.jfw.apt.web.annotation.LoginUser;
10
import org.jfw.apt.web.annotation.Path;
11
import org.jfw.apt.web.annotation.operate.Delete;
12
import org.jfw.apt.web.annotation.operate.Get;
13
import org.jfw.apt.web.annotation.operate.Post;
14
import org.jfw.apt.web.annotation.operate.Put;
15
import org.jfw.apt.web.annotation.param.JdbcConn;
16
import org.jfw.apt.web.annotation.param.PathVar;
17
import org.jfw.apt.web.annotation.param.RequestBody;
18
import org.jfw.util.DateUtil;
19
import org.jfw.util.PageQueryResult;
20
import org.jfw.util.StringUtil;
21
22
import java.io.IOException;
23
import java.sql.Connection;
24
import java.sql.SQLException;
25
import java.util.*;
26
27
/**
28
 * Created by TT on 2017/7/7.
29
 */
30
@Path("/userinfo")
31
public class UserInfoService {
32
    public static final String DEFAULT_PASS_WORD = "11111111111111111111111111111111";
33
    @Autowrie
34
    private UserInfoDao userInfoDao;
35
    @Autowrie
36
    private LuserDao luserDao;
37
    @Autowrie
38
    private ResearchAreaDao researchAreaDao;
39
    @Autowrie
40
    private ProjectDao projectDao;
41
    @Autowrie
42
    private HonorDao honorDao;
43
    @Autowrie
44
    private PartTimeJobDao partTimeJobDao;
45
    @Autowrie
46
    private ProfessorEduBgDao professorEduBgDao;
47
    @Autowrie
48
    private ProfessorService professorService;
49
50
    public PartTimeJobDao getPartTimeJobDao() {
51
        return partTimeJobDao;
52
    }
53
54
    public void setPartTimeJobDao(PartTimeJobDao partTimeJobDao) {
55
        this.partTimeJobDao = partTimeJobDao;
56
    }
57
58
    public ProfessorEduBgDao getProfessorEduBgDao() {
59
        return professorEduBgDao;
60
    }
61
62
    public void setProfessorEduBgDao(ProfessorEduBgDao professorEduBgDao) {
63
        this.professorEduBgDao = professorEduBgDao;
64
    }
65
66
    public HonorDao getHonorDao() {
67
        return honorDao;
68
    }
69
70
    public void setHonorDao(HonorDao honorDao) {
71
        this.honorDao = honorDao;
72
    }
73
74
    public ProjectDao getProjectDao() {
75
        return projectDao;
76
    }
77
78
    public void setProjectDao(ProjectDao projectDao) {
79
        this.projectDao = projectDao;
80
    }
81
82
    public ResearchAreaDao getResearchAreaDao() {
83
        return researchAreaDao;
84
    }
85
86
    public void setResearchAreaDao(ResearchAreaDao researchAreaDao) {
87
        this.researchAreaDao = researchAreaDao;
88
    }
89
90
    public static String getDefaultPassWord() {
91
        return DEFAULT_PASS_WORD;
92
    }
93
94
    public ProfessorService getProfessorService() {
95
        return professorService;
96
    }
97
98
    public void setProfessorService(ProfessorService professorService) {
99
        this.professorService = professorService;
100
    }
101
102
    public LuserDao getLuserDao() {
103
        return luserDao;
104
    }
105
106
    public void setLuserDao(LuserDao luserDao) {
107
        this.luserDao = luserDao;
108
    }
109
110
    public UserInfoDao getUserInfoDao() {
111
        return userInfoDao;
112
    }
113
114
    public void setUserInfoDao(UserInfoDao userInfoDao) {
115
        this.userInfoDao = userInfoDao;
116
    }
117
118
    @Path("/insert")
119
    @Put
120
    public void insert(@JdbcConn(true) Connection con, @RequestBody UserInfo userInfo, @LoginUser ConsoleAuthUser user) throws SQLException {
121
        String id = StringUtil.buildUUID();
122
        userInfo.setId(id);
123
        userInfo.setState("1");
124
        userInfo.setCreator(user.getId());
125
        userInfo.setCreatorName(user.getName());
126
        userInfo.setCreateTime(DateUtil.formatDateTime(System.currentTimeMillis()));
127
        this.userInfoDao.insert(con, userInfo);
128
    }
129
130
    @Path("/update")
131
    @Put
132
    public void update(@JdbcConn(true) Connection con, @RequestBody UserInfo userInfo) throws SQLException {
133
        this.userInfoDao.update(con, userInfo);
134
    }
135
136
    @Path("/updateState")
137
    @Post
138
    public void updateState(@JdbcConn(true) Connection con, String id) throws SQLException {
139
        UserInfo userInfo = this.userInfoDao.query(con, id);
140
        userInfo.setState("2");
141
        this.userInfoDao.update(con, userInfo);
142
    }
143
144
    @Delete
145
    @Path("/del/{id}")
146
    public int delete(@JdbcConn(true) Connection con, @PathVar String id) throws SQLException {
147
        UserInfo userInfo = this.userInfoDao.query(con, id);
148
        if (userInfo!=null) {
149
            if(Objects.equals(userInfo.getState(), "1") || Objects.equals(userInfo.getState(), "4")) {
150
                this.userInfoDao.delete(con, id);
151
                return 1;//删除成功
152
            }else {
153
                return 2;//无法删除
154
            }
155
        }else
156
            return 3;//没有账户
157
    }
158
159
    @Path("/id/{id}")
160
    @Get
161
    public UserInfo queryOne(@JdbcConn Connection con, @PathVar String id) throws SQLException {
162
        return this.userInfoDao.query(con, id);
163
    }
164
165
    @Path("/pq")
166
    @Get
167
    public PageQueryResult<UserInfo> pageQueryPerson(@JdbcConn Connection con, @LoginUser ConsoleAuthUser user, @Nullable String name, @Nullable String orgName, @Nullable String state, @Nullable String bt, @Nullable String et, @DefaultValue("1") int pageNo, @DefaultValue("10") int pageSize) throws SQLException {
168
        return this.userInfoDao.queryPerson(con, user.getId(), name == null ? null : "%" + name + "%", orgName == null ? null : "%" + orgName + "%", state, bt == null ? null : bt + "000000", et == null ? null : et + "235959", pageSize, pageNo);
169
    }
170
171
    @Path("/pqAll")
172
    @Get
173
    PageQueryResult<UserInfo> pageQueryAll(@JdbcConn Connection con, @Nullable String name, @Nullable String orgName, @Nullable String state, @Nullable String bt, @Nullable String et, @DefaultValue("1") int pageNo, @DefaultValue("10") int pageSize) throws SQLException {
174
        return this.userInfoDao.queryAll(con, name == null ? null : "%" + name + "%", orgName == null ? null : "%" + orgName + "%", state, bt == null ? null : bt + "000000", et == null ? null : et + "235959", pageSize, pageNo);
175
    }
176
177
    @Path("/entryCheck")
178
    @Get
179
    public Boolean entryCheck(@JdbcConn Connection con, @Nullable String mobile, @Nullable String email) throws SQLException {
180
        UserInfo userInfo1 = this.userInfoDao.entryCheck(con, mobile);
181
        UserInfo userInfo2 = this.userInfoDao.entryCheck(con, email);
182
        Luser luser1 = this.luserDao.check(con, mobile);
183
        Luser luser2 = this.luserDao.check(con, email);
184
        return userInfo1 == null && userInfo2 == null && luser1 == null && luser2 == null;
185
    }
186
187
    @Path("/reviewCheck")
188
    @Get
189
    public Boolean reviewCheck(@JdbcConn Connection con, @Nullable String mobile, @Nullable String email) throws SQLException {
190
        Luser luser1 = this.luserDao.check(con, mobile);
191
        Luser luser2 = this.luserDao.check(con, email);
192
        return luser1 == null && luser2 == null;
193
    }
194
195
    @Path("/import")
196
    @Post
197
    public int importData(@JdbcConn(true) Connection con, String id, String reviewer, String reviewTime, String reviewerName,
198
                           Integer authentication, Integer authStatus, Integer authStatusExpert, @Nullable Integer sortFirst) throws SQLException, IOException {
199
        UserInfo userInfo = this.userInfoDao.query(con, id);
200
        if (userInfo!=null) {
201
            if (Objects.equals(userInfo.getState(), "2")) {
202
                userInfo.setState("3");
203
                userInfo.put("reviewer", reviewer);
204
                userInfo.put("reviewTime", reviewTime);
205
                userInfo.put("reviewerName", reviewerName);
206
                userInfo.put("authentication", authentication);
207
                userInfo.put("authStatus", authStatus);
208
                userInfo.put("authStatusExpert", authStatusExpert);
209
                userInfo.put("sortFirst", sortFirst);
210
                this.userInfoDao.update(con, userInfo);
211
212
                Luser luser = new Luser();
213
                luser.setId(userInfo.getId());
214
                luser.setEmail(userInfo.getEmail());
215
                Random rd = new Random();
216
                int code = rd.nextInt(1000000);
217
                String inviteCode = String.format("%06d", code);
218
                luser.setInviteCode(inviteCode);
219
                luser.setMobilePhone(userInfo.getMobile());
220
                luser.setPasswd(DEFAULT_PASS_WORD);
221
                luser.setUserType("0");
222
                luser.setCreateTime(userInfo.getCreateTime());
223
                this.luserDao.insert(con, luser);
224
225
                Professor professor = new Professor();
226
                professor.setId(userInfo.getId());
227
                professor.setName(userInfo.getName());
228
                professor.setEmail((String) userInfo.get("pEmail"));
229
                professor.setPhone((String) userInfo.get("pMobile"));
230
                professor.setTitle((String) userInfo.get("title"));
231
                professor.setOffice((String) userInfo.get("office"));
232
                professor.setSubject((String) userInfo.get("subject"));
233
                professor.setDepartment((String) userInfo.get("department"));
234
                professor.setIndustry((String) userInfo.get("industry"));
235
                professor.setDescp((String) userInfo.get("descp"));
236
                professor.setCreateTime(userInfo.getCreateTime());
237
                professor.setModifyTime(userInfo.getCreateTime());
238
                professor.setAddress((String) userInfo.get("address"));
239
                professor.setProvince((String) userInfo.get("province"));
240
                professor.setAuthentication((Integer) userInfo.get("authentication"));
241
                professor.setAuthType(1);
242
                if(userInfo.get("authStatus")!=null) {
243
                    professor.setAuthStatus((Integer) userInfo.get("authStatus"));
244
                }else {
245
                    professor.setAuthStatus(0);
246
                }
247
                if (userInfo.get("authStatusExpert")!=null) {
248
                    professor.setAuthStatusExpert((Integer) userInfo.get("authStatusExpert"));
249
                }else {
250
                    professor.setAuthStatusExpert(0);
251
                }
252
                if (userInfo.get("sortFirst")!=null) {
253
                    professor.setSortFirst((Integer) userInfo.get("sortFirst"));
254
                }else {
255
                    professor.setSortFirst(0);
256
                }
257
                professor.setProfessorState(0);
258
                this.professorService.insert(con, professor, userInfo.getOrgName());
259
260
                ArrayList<String> areas = (ArrayList<String>) userInfo.get("researchArea");
261
                if (areas != null) {
262
                    ResearchArea researchArea = new ResearchArea();
263
                    int sortNum = 1;
264
                    for (String area : areas) {
265
                        researchArea.setProfessorId(userInfo.getId());
266
                        researchArea.setCaption(area);
267
                        researchArea.setSortNum(sortNum++);
268
                        this.researchAreaDao.insert(con, researchArea);
269
                    }
270
                }
271
272
                ArrayList<Map<String, Object>> projects = (ArrayList<Map<String, Object>>) userInfo.get("projects");
273
                if (projects != null) {
274
                    for (Map<String, Object> project : projects) {
275
                        Project project1 = new Project();
276
                        String projectId = StringUtil.buildUUID();
277
                        project1.setId(projectId);
278
                        project1.setName((String) project.get("projectName"));
279
                        project1.setProfessorId(userInfo.getId());
280
                        project1.setDescp((String) project.get("projectDescp"));
281
                        project1.setStartMonth((String) project.get("projectStart"));
282
                        project1.setStopMonth((String) project.get("projectStop"));
283
                        this.projectDao.insert(con, project1);
284
                    }
285
                }
286
287
                ArrayList<Map<String, Object>> honors = (ArrayList<Map<String, Object>>) userInfo.get("honors");
288
                if (honors != null) {
289
                    for (Map<String, Object> honor : honors) {
290
                        Honor honor1 = new Honor();
291
                        String honorId = StringUtil.buildUUID();
292
                        honor1.setId(honorId);
293
                        honor1.setProfessorId(userInfo.getId());
294
                        honor1.setName((String) honor.get("honorName"));
295
                        honor1.setDescp((String) honor.get("honorDescp"));
296
                        honor1.setYear((String) honor.get("honorYear"));
297
                        this.honorDao.insert(con, honor1);
298
                    }
299
                }
300
301
                ArrayList<Map<String, Object>> jobs = (ArrayList<Map<String, Object>>) userInfo.get("jobs");
302
                if (jobs != null) {
303
                    for (Map<String, Object> job : jobs) {
304
                        PartTimeJob partTimeJob = new PartTimeJob();
305
                        String jobId = StringUtil.buildUUID();
306
                        partTimeJob.setId(jobId);
307
                        partTimeJob.setProfessorId(userInfo.getId());
308
                        partTimeJob.setCompany((String) job.get("jobCompany"));
309
                        partTimeJob.setDepartment((String) job.get("jobDepartment"));
310
                        partTimeJob.setTitle((String) job.get("jobTitle"));
311
                        partTimeJob.setStartMonth((String) job.get("jobStart"));
312
                        partTimeJob.setStopMonth((String) job.get("jobStop"));
313
                        this.partTimeJobDao.insert(con, partTimeJob);
314
                    }
315
                }
316
317
                List<Map<String, Object>> edus = (List<Map<String, Object>>) userInfo.get("edus");
318
                if (edus != null) {
319
                    for (Map<String, Object> edu : edus) {
320
                        ProfessorEduBg professorEduBg = new ProfessorEduBg();
321
                        String eduId = StringUtil.buildUUID();
322
                        professorEduBg.setId(eduId);
323
                        professorEduBg.setProfessorId(userInfo.getId());
324
                        professorEduBg.setSchool((String) edu.get("eduSchool"));
325
                        professorEduBg.setCollege((String) edu.get("eduCollege"));
326
                        professorEduBg.setMajor((String) edu.get("eduMajor"));
327
                        professorEduBg.setDegree((String) edu.get("eduDegree"));
328
                        professorEduBg.setYear((String) edu.get("eduYear"));
329
                        this.professorEduBgDao.insert(con, professorEduBg);
330
                    }
331
                }
332
                return 1;//导入成功
333
            }else
334
                return 2;//状态不符合要求
335
        }else
336
            return 3;//用户不存在
337
    }
338
}

+ 1 - 1
src/main/java/com/ekexiu/console/system/service/UserService.java

@ -211,7 +211,7 @@ public class UserService extends Upload {
211 211
	@Post
212 212
	@Path("/del")
213 213
	public void delete(@JdbcConn(true) Connection con, String[] ids) throws SQLException {
214
		this.userDao.delete(con, ids);
214
		this.userDao.delete(con, ids,false);
215 215
	}
216 216

217 217
	@Get

+ 29 - 0
src/main/resources/database.sql

@ -0,0 +1,29 @@
1
-- ----------------------------
2
-- Table structure for user_info
3
-- ----------------------------
4
CREATE TABLE public.user_info (
5
  id CHARACTER(32) PRIMARY KEY NOT NULL,
6
  org_name TEXT, -- 机构名称
7
  state TEXT NOT NULL, -- 审核状态(1-未提交,2-待审核,3-审核通过,4-审核失败)
8
  name TEXT NOT NULL, -- 姓名
9
  create_time TEXT NOT NULL, -- 创建时间
10
  cnt TEXT NOT NULL, -- 详细信息
11
  creator CHARACTER(32) NOT NULL, -- 创建人ID
12
  creator_name TEXT, -- 创建人姓名
13
  mobile TEXT, -- 注册手机
14
  email TEXT -- 注册邮箱
15
);
16
COMMENT ON COLUMN public.user_info.org_name IS '机构名称';
17
COMMENT ON COLUMN public.user_info.state IS '审核状态(1-未提交,2-待审核,3-审核通过,4-审核失败)';
18
COMMENT ON COLUMN public.user_info.name IS '姓名';
19
COMMENT ON COLUMN public.user_info.create_time IS '创建时间';
20
COMMENT ON COLUMN public.user_info.cnt IS '详细信息';
21
COMMENT ON COLUMN public.user_info.creator IS '创建人ID';
22
COMMENT ON COLUMN public.user_info.creator_name IS '创建人姓名';
23
COMMENT ON COLUMN public.user_info.mobile IS '注册手机';
24
COMMENT ON COLUMN public.user_info.email IS '注册邮箱';
25
26
-- ----------------------------
27
-- Uniques structure for table user_info
28
-- ----------------------------
29
ALTER TABLE USER_INFO ADD PRIMARY KEY (ID);

+ 1 - 1
src/main/resources/project-dev.properties

@ -49,7 +49,7 @@ dataSource.defaultAutoCommit::boolean=false
49 49
com_ekexiu_console_system_service_OrgService.tmpPath::java.io.File=/kexiu/www/html/images/tmp
50 50
com_ekexiu_console_system_service_OrgService.imagePath::java.io.File=/kexiu/www/html/images
51 51
cachedFileUploadServlet.cachePath::java.io.File=/kexiu/www/html/images/tmp
52
用户默认头像保存路径
52
#用户默认头像保存路径
53 53
com_ekexiu_console_system_service_OrgService.defaultHeadPhoto::java.io.File=/kexiu/www/html/images/default-photo.jpg
54 54
#机构默认图片保存路径
55 55
com_ekexiu_console_system_service_OrgService.defaultOrgLogo::java.io.File=/kexiu/www/html/images/default-icon.jpg