Browse Source

数据服务添加项目数据源

dev_shibei_match
sunyuchao 5 years ago
parent
commit
c74c526a17
  1. 1
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java
  2. 11
      epmet-module/data-statistical/data-statistical-server/pom.xml
  3. 23
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java
  4. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java
  5. 78
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectEntity.java
  6. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java
  7. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java
  8. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java
  9. 41
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java
  10. 5
      epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml
  11. 7
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml

1
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java

@ -5,5 +5,6 @@ public interface DataSourceConstant {
String GOV_ORG = "govOrg";
String STATS = "stats";
String GOV_ISSUE = "govIssue";
String GOV_PROJECT = "govProject";
}

11
epmet-module/data-statistical/data-statistical-server/pom.xml

@ -116,6 +116,12 @@
<datasource.druid.issue.username>epmet_gov_issue_user</datasource.druid.issue.username>
<datasource.druid.issue.password>EpmEt-db-UsEr</datasource.druid.issue.password>
<datasource.druid.project.url>
<![CDATA[jdbc:mysql://192.168.1.130:3306/epmet_gov_project?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.project.url>
<datasource.druid.project.username>epmet_gov_project_user</datasource.druid.project.username>
<datasource.druid.project.password>EpmEt-db-UsEr</datasource.druid.project.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>192.168.1.130</spring.redis.host>
@ -162,6 +168,11 @@
<datasource.druid.issue.username>epmet</datasource.druid.issue.username>
<datasource.druid.issue.password>elink@833066</datasource.druid.issue.password>
<datasource.druid.project.url>
<![CDATA[jdbc:mysql://192.168.1.130:3306/epmet_gov_project?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.project.url>
<datasource.druid.project.username>epmet_gov_project_user</datasource.druid.project.username>
<datasource.druid.project.password>EpmEt-db-UsEr</datasource.druid.project.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>

23
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java

@ -0,0 +1,23 @@
package com.epmet.controller;
import com.epmet.service.StatsDemoService;
import com.epmet.service.StatsProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 数据统计-项目
* @author sun
*/
@RequestMapping("statsProject")
@RestController
public class StatsProjectController {
@Autowired
private StatsProjectService statsProjectService;
}

33
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.project;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.project.ProjectEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 项目表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-05-11
*/
@Mapper
public interface ProjectDao extends BaseDao<ProjectEntity> {
}

78
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectEntity.java

@ -0,0 +1,78 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.project;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 项目表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-05-11
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("project")
public class ProjectEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 机关ID
*/
private String agencyId;
/**
* 来源议题issue
*/
private String origin;
/**
* 来源ID
*/
private String originId;
/**
* 项目标题
*/
private String title;
/**
* 状态:待处理 pending结案closed
*/
private String status;
/**
* 结案状态已解决 resolved未解决 unresolved
*/
private String closedStatus;
/**
* 所属机关 11:22:33(本机关以及上级所有机关ID)
*/
private String orgIdPath;
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java

@ -0,0 +1,10 @@
package com.epmet.service;
/**
* 数据统计-项目
* @author sun
*/
public interface StatsProjectService {
}

18
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java

@ -0,0 +1,18 @@
package com.epmet.service.impl;
import com.epmet.service.StatsProjectService;
import com.epmet.service.project.ProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 数据统计-项目独立于任何具体数据源外层的service
* @author sun
*/
@Service
public class StatsProjectServiceImpl implements StatsProjectService {
@Autowired
private ProjectService projectService;
}

31
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java

@ -0,0 +1,31 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.project;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.project.ProjectEntity;
/**
* 项目表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-05-11
*/
public interface ProjectService extends BaseService<ProjectEntity> {
}

41
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java

@ -0,0 +1,41 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.project.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.project.ProjectDao;
import com.epmet.entity.project.ProjectEntity;
import com.epmet.service.project.ProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 项目表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-05-11
*/
@Service
@DataSource(DataSourceConstant.GOV_PROJECT)
public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntity> implements ProjectService {
@Autowired
private ProjectDao projectDao;
}

5
epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml

@ -143,3 +143,8 @@ dynamic:
url: @datasource.druid.issue.url@
username: @datasource.druid.issue.username@
password: @datasource.druid.issue.password@
govProject:
driver-class-name: com.mysql.cj.jdbc.Driver
url: @datasource.druid.project.url@
username: @datasource.druid.project.username@
password: @datasource.druid.project.password@

7
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.project.ProjectDao">
</mapper>
Loading…
Cancel
Save