Browse Source

Merge branch 'dev' of http://www.ekexiu.com:3000/jiapeng/portal-web.git into dev

jiapeng 7 years ago
parent
commit
f594602412

+ 25 - 8
src/main/java/com/ekexiu/operation/service/StatistService.java

1
package com.ekexiu.operation.service;
1
package com.ekexiu.operation.service;
2

2

3
import java.sql.Connection;
4
import java.sql.SQLException;
5
import java.util.HashMap;
6
import java.util.Map;
7

3
import com.ekexiu.portal.dao.DiscoverBannerDao;
4
import com.ekexiu.portal.dao.UserDao;
8
import org.jfw.apt.annotation.Autowrie;
5
import org.jfw.apt.annotation.Autowrie;
9
import org.jfw.apt.web.annotation.Path;
6
import org.jfw.apt.web.annotation.Path;
10
import org.jfw.apt.web.annotation.operate.Get;
7
import org.jfw.apt.web.annotation.operate.Get;
8
import org.jfw.apt.web.annotation.operate.Post;
11
import org.jfw.apt.web.annotation.param.JdbcConn;
9
import org.jfw.apt.web.annotation.param.JdbcConn;
12
import org.jfw.util.jdbc.JdbcUtil;
10
import org.jfw.util.jdbc.JdbcUtil;
13

11

14
import com.ekexiu.portal.dao.UserDao;
12
import java.sql.Connection;
13
import java.sql.SQLException;
14
import java.util.HashMap;
15
import java.util.Map;
15

16

16
@Path("/operation/statist")
17
@Path("/operation/statist")
17
public class StatistService {
18
public class StatistService {
18

19

19
	@Autowrie
20
	@Autowrie
20
	private UserDao userDao;
21
	private UserDao userDao;
22
	@Autowrie
23
	private DiscoverBannerDao discoverBannerDao;
21

24

22
	public UserDao getUserDao() {
25
	public UserDao getUserDao() {
23
		return userDao;
26
		return userDao;
26
	public void setUserDao(UserDao userDao) {
29
	public void setUserDao(UserDao userDao) {
27
		this.userDao = userDao;
30
		this.userDao = userDao;
28
	}
31
	}
29
	
32

33
	public DiscoverBannerDao getDiscoverBannerDao() {
34
		return discoverBannerDao;
35
	}
36

37
	public void setDiscoverBannerDao(DiscoverBannerDao discoverBannerDao) {
38
		this.discoverBannerDao = discoverBannerDao;
39
	}
40

30
	@Get
41
	@Get
31
	@Path("/user")
42
	@Path("/user")
32
	public Map<String,Object> user(@JdbcConn Connection con)throws SQLException{
43
	public Map<String,Object> user(@JdbcConn Connection con)throws SQLException{
35
		map.put("actived", this.userDao.countActived(con));
46
		map.put("actived", this.userDao.countActived(con));
36
		map.put("byRole",JdbcUtil.queryMaps(con, "select authentication code,count(1) num from professor group by code"));
47
		map.put("byRole",JdbcUtil.queryMaps(con, "select authentication code,count(1) num from professor group by code"));
37
		map.put("byType",JdbcUtil.queryMaps(con, "select auth_type code,count(1) num from professor group by code"));
48
		map.put("byType",JdbcUtil.queryMaps(con, "select auth_type code,count(1) num from professor group by code"));
38
		return map;		
49
		return map;
50
	}
51

52
	@Post
53
	@Path("/bannerClick")
54
	public void bannerClick(@JdbcConn(true) Connection con, long id) throws SQLException {
55
		this.discoverBannerDao.incClicks(con, id);
39
	}
56
	}
40
}
57
}

+ 22 - 0
src/main/java/com/ekexiu/portal/dao/DiscoverBannerDao.java

1
package com.ekexiu.portal.dao;
2
3
import com.ekexiu.portal.po.DiscoverBanner;
4
import org.jfw.apt.orm.annotation.dao.DAO;
5
import org.jfw.apt.orm.annotation.dao.method.From;
6
import org.jfw.apt.orm.annotation.dao.method.SetSentence;
7
import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith;
8
9
import java.sql.Connection;
10
import java.sql.SQLException;
11
12
/**
13
 * Created by TT on 2017/8/25.
14
 */
15
@DAO
16
public interface DiscoverBannerDao {
17
18
    @UpdateWith
19
    @From(DiscoverBanner.class)
20
    @SetSentence("clicks = clicks + 1")
21
    int incClicks(Connection con, long id) throws SQLException;
22
}

+ 10 - 0
src/main/java/com/ekexiu/portal/po/DiscoverBanner.java

26
    private String modifier;
26
    private String modifier;
27
    private String createTime;
27
    private String createTime;
28
    private String creator;
28
    private String creator;
29
    private Integer location;
29
30
30
    @Column(DE.bigSerial)
31
    @Column(DE.bigSerial)
31
    public long getId() {
32
    public long getId() {
117
        this.creator = creator;
118
        this.creator = creator;
118
    }
119
    }
119
120
121
    @Column(DE.Int_de)
122
    public Integer getLocation() {
123
        return location;
124
    }
125
126
    public void setLocation(Integer location) {
127
        this.location = location;
128
    }
129
120
    @Override
130
    @Override
121
    public String getModifyTime() {
131
    public String getModifyTime() {
122
        return this.modifyTime;
132
        return this.modifyTime;

+ 7 - 5
src/main/resources/database.sql

1987

1987

1988
  
1988
  
1989
  --- modify begin at version 1.9.2
1989
  --- modify begin at version 1.9.2
1990
ALTER TABLE ARTICLE ADD COLUMN COL_NUM int4 not null default 0;
1991
COMMENT ON COLUMN article.col_num IS '栏目号  <=0:没有栏目号,1:个人自建 2:企业自发  其它:由业务定义';
1992
update article set col_num=1 where professor_id is not null;
1993
update article set col_num=2 where org_id is not null;
1990
-- ALTER TABLE ARTICLE ADD COLUMN COL_NUM int4 not null default 0;
1991
-- COMMENT ON COLUMN article.col_num IS '栏目号  <=0:没有栏目号,1:个人自建 2:企业自发  其它:由业务定义';
1992
-- update article set col_num=1 where professor_id is not null;
1993
-- update article set col_num=2 where org_id is not null;
1994
ALTER TABLE organization ADD COLUMN col_mgr char(1) NOT NULL DEFAULT '0';
1994
ALTER TABLE organization ADD COLUMN col_mgr char(1) NOT NULL DEFAULT '0';
1995
COMMENT ON COLUMN organization.col_mgr IS '是否是管理者 0:不是  1:是';
1995
COMMENT ON COLUMN organization.col_mgr IS '是否是管理者 0:不是  1:是';
1996

1996

2006
  modify_time CHARACTER(14) NOT NULL, -- 修改时间
2006
  modify_time CHARACTER(14) NOT NULL, -- 修改时间
2007
  modifier CHARACTER VARYING(32), -- 最后修改人ID
2007
  modifier CHARACTER VARYING(32), -- 最后修改人ID
2008
  create_time CHARACTER(14) NOT NULL, -- 创建时间
2008
  create_time CHARACTER(14) NOT NULL, -- 创建时间
2009
  creator CHARACTER VARYING(32) NOT NULL -- 创建人ID
2009
  creator CHARACTER VARYING(32) NOT NULL, -- 创建人ID
2010
  location SMALLINT
2010
);
2011
);
2011
COMMENT ON COLUMN discover_banner.id IS '编号id';
2012
COMMENT ON COLUMN discover_banner.id IS '编号id';
2012
COMMENT ON COLUMN discover_banner.title IS '外显标题';
2013
COMMENT ON COLUMN discover_banner.title IS '外显标题';
2020
COMMENT ON COLUMN discover_banner.modifier IS '最后修改人ID';
2021
COMMENT ON COLUMN discover_banner.modifier IS '最后修改人ID';
2021
COMMENT ON COLUMN discover_banner.create_time IS '创建时间';
2022
COMMENT ON COLUMN discover_banner.create_time IS '创建时间';
2022
COMMENT ON COLUMN discover_banner.creator IS '创建人ID';
2023
COMMENT ON COLUMN discover_banner.creator IS '创建人ID';
2024
COMMENT ON COLUMN public.discover_banner.location IS '显示位置';
2023

2025

2024

2026

2025

2027