diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..aa896a6f7 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "esua-epdc/epdc-cloud-gateway-shibei"] + path = esua-epdc/epdc-cloud-gateway-shibei + url = http://121.42.41.42:7070/r/epdc-cloud-gateway-shibei.git diff --git a/esua-epdc/doc/db/dev_youhua/esua_epdc_user.sql b/esua-epdc/doc/db/dev_youhua/esua_epdc_user.sql new file mode 100644 index 000000000..db8f63d20 --- /dev/null +++ b/esua-epdc/doc/db/dev_youhua/esua_epdc_user.sql @@ -0,0 +1,52 @@ +--------标记一下这个已经随工作端上线 +ALTER TABLE esua_epdc_user.epdc_party_authentication_failed MODIFY COLUMN `STATE` VARCHAR(1) NULL COMMENT '状态 0-认证失败'; +ALTER TABLE esua_epdc_user.epdc_party_authentication_failed MODIFY COLUMN `CADRE_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 0 NULL COMMENT '干部下沉标识 0-否,1-是'; +ALTER TABLE esua_epdc_user.epdc_user_authenticate_history ADD AUTHENTICATED_TYPE varchar(2) NOT NULL COMMENT '认证类别(0-居民认证,1-党员认证,2-志愿者认证)'; +------------------------------------------------ + +CREATE TABLE `epdc_handle_category` ( + `ID` varchar(32) NOT NULL COMMENT '主键', + `CATEGORY_VAL` int(11) NOT NULL COMMENT '处理类别值', + `CATEGORY_LABEL` varchar(20) NOT NULL COMMENT '处理类别显示信息', + `AVAILABLE` varchar(1) NOT NULL DEFAULT '1' COMMENT '可用状态(0-不可用,1-可用)', + `SORT` int(11) NOT NULL DEFAULT '0' COMMENT '排序', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识 0:未删除,1:已删除', + `CATEGORY_CODE` varchar(32) NOT NULL COMMENT '处理类型编码', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='处理类别表' + + +CREATE TABLE `epdc_role_category` ( + `ID` varchar(32) NOT NULL COMMENT '主键', + `ROLE_ID` varchar(32) NOT NULL COMMENT '角色ID', + `CATEGORY_ID` varchar(32) NOT NULL COMMENT '处理类别ID', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识 0:未删除,1:已删除', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色和处理类别关系表' + + +ALTER TABLE EPDC_HANDLE_ROLE_CATEGORY COMMENT '角色和处理类别关系表';; +CREATE TABLE EPDC_HANDLE_ROLE_DEPT( + ID VARCHAR(32) NOT NULL COMMENT '主键' , + ROLE_ID VARCHAR(32) NOT NULL COMMENT '角色ID' , + DEPT_ID VARCHAR(32) NOT NULL COMMENT '部门ID' , + DEPT_TYPE VARCHAR(50) NOT NULL COMMENT '部门机构类型' , + REVISION INT COMMENT '乐观锁' , + CREATED_BY VARCHAR(32) COMMENT '创建人' , + CREATED_TIME DATETIME COMMENT '创建时间' , + UPDATED_BY VARCHAR(32) COMMENT '更新人' , + UPDATED_TIME DATETIME COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '处理部门角色权限表 处理部门角色权限表';; + +ALTER TABLE EPDC_HANDLE_ROLE_DEPT COMMENT '处理部门角色权限表';; diff --git a/esua-epdc/docker-compose/jinshui/app/admin/docker-compose.yml b/esua-epdc/docker-compose/jinshui/app/admin/docker-compose.yml new file mode 100644 index 000000000..6e62ccfea --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/app/admin/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3.7' +services: + epdc-admin-server: + image: registry.cn-qingdao.aliyuncs.com/esua-epdc-shibei/epdc-admin-server:prod + container_name: epdc-admin-server-01 + restart: always + networks: + epdc_network: + ipv4_address: 172.20.0.41 + volumes: + - /mnt/epdc/app/admin/logs:/logs +networks: + epdc_network: + external: true diff --git a/esua-epdc/docker-compose/jinshui/app/api/docker-compose.yml b/esua-epdc/docker-compose/jinshui/app/api/docker-compose.yml new file mode 100644 index 000000000..73506b52b --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/app/api/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3.7' +services: + epdc-api-server: + image: registry.cn-qingdao.aliyuncs.com/esua-epdc-shibei/epdc-api-server:prod + container_name: epdc-api-server-01 + restart: always + networks: + epdc_network: + ipv4_address: 172.20.0.42 + volumes: + - /mnt/epdc/app/api/logs:/logs +networks: + epdc_network: + external: true diff --git a/esua-epdc/docker-compose/jinshui/app/auth/docker-compose.yml b/esua-epdc/docker-compose/jinshui/app/auth/docker-compose.yml new file mode 100644 index 000000000..f9070bab0 --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/app/auth/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3.7' +services: + epdc-auth: + image: registry.cn-qingdao.aliyuncs.com/esua-epdc-shibei/epdc-auth:prod + container_name: epdc-auth-server-01 + restart: always + networks: + epdc_network: + ipv4_address: 172.20.0.43 + volumes: + - /mnt/epdc/app/auth/logs:/logs +networks: + epdc_network: + external: true diff --git a/esua-epdc/docker-compose/jinshui/app/events/docker-compose.yml b/esua-epdc/docker-compose/jinshui/app/events/docker-compose.yml new file mode 100644 index 000000000..9c244981a --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/app/events/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3.7' +services: + epdc-events-server: + image: registry.cn-qingdao.aliyuncs.com/esua-epdc-shibei/epdc-events-server:prod + container_name: epdc-events-server-01 + restart: always + networks: + epdc_network: + ipv4_address: 172.20.0.44 + volumes: + - /mnt/epdc/app/events/logs:/logs +networks: + epdc_network: + external: true diff --git a/esua-epdc/docker-compose/jinshui/app/gateway/docker-compose.yml b/esua-epdc/docker-compose/jinshui/app/gateway/docker-compose.yml new file mode 100644 index 000000000..2828635f8 --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/app/gateway/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3.7' +services: + epdc-gateway: + image: registry.cn-qingdao.aliyuncs.com/esua-epdc-shibei/epdc-gateway:prod + container_name: epdc-gateway-server-01 + restart: always + networks: + epdc_network: + ipv4_address: 172.20.0.40 + volumes: + - /mnt/epdc/app/gateway/logs:/logs +networks: + epdc_network: + external: true diff --git a/esua-epdc/docker-compose/jinshui/app/group/docker-compose.yml b/esua-epdc/docker-compose/jinshui/app/group/docker-compose.yml new file mode 100644 index 000000000..31ad7f03a --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/app/group/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3.7' +services: + epdc-group-server: + image: registry.cn-qingdao.aliyuncs.com/esua-epdc-shibei/epdc-group-server:prod + container_name: epdc-group-server-01 + restart: always + networks: + epdc_network: + ipv4_address: 172.20.0.45 + volumes: + - /mnt/epdc/app/group/logs:/logs +networks: + epdc_network: + external: true diff --git a/esua-epdc/docker-compose/jinshui/app/message/docker-compose.yml b/esua-epdc/docker-compose/jinshui/app/message/docker-compose.yml new file mode 100644 index 000000000..a7bf82c9f --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/app/message/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3.7' +services: + epdc-message-server: + image: registry.cn-qingdao.aliyuncs.com/esua-epdc-shibei/epdc-message-server:prod + container_name: epdc-message-server-01 + restart: always + networks: + epdc_network: + ipv4_address: 172.20.0.46 + volumes: + - /mnt/epdc/app/message/logs:/logs +networks: + epdc_network: + external: true diff --git a/esua-epdc/docker-compose/jinshui/app/news/docker-compose.yml b/esua-epdc/docker-compose/jinshui/app/news/docker-compose.yml new file mode 100644 index 000000000..3fd1a9dce --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/app/news/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3.7' +services: + epdc-news-server: + image: registry.cn-qingdao.aliyuncs.com/esua-epdc-shibei/epdc-news-server:prod + container_name: epdc-news-server-01 + restart: always + networks: + epdc_network: + ipv4_address: 172.20.0.47 + volumes: + - /mnt/epdc/app/news/logs:/logs +networks: + epdc_network: + external: true diff --git a/esua-epdc/docker-compose/jinshui/app/oss/docker-compose.yml b/esua-epdc/docker-compose/jinshui/app/oss/docker-compose.yml new file mode 100644 index 000000000..5bf7b7e50 --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/app/oss/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3.7' +services: + epdc-oss-server: + image: registry.cn-qingdao.aliyuncs.com/esua-epdc-shibei/epdc-oss-server:prod + container_name: epdc-oss-server-01 + restart: always + networks: + epdc_network: + ipv4_address: 172.20.0.48 + volumes: + - /mnt/epdc/app/oss/logs:/logs +networks: + epdc_network: + external: true diff --git a/esua-epdc/docker-compose/jinshui/app/user/docker-compose.yml b/esua-epdc/docker-compose/jinshui/app/user/docker-compose.yml new file mode 100644 index 000000000..215d7c16f --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/app/user/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3.7' +services: + epdc-user-server: + image: registry.cn-qingdao.aliyuncs.com/esua-epdc-shibei/epdc-user-server:prod + container_name: epdc-user-server-01 + restart: always + networks: + epdc_network: + ipv4_address: 172.20.0.49 + volumes: + - /mnt/epdc/app/user/logs:/logs +networks: + epdc_network: + external: true diff --git a/esua-epdc/docker-compose/jinshui/app/websocket/docker-compose.yml b/esua-epdc/docker-compose/jinshui/app/websocket/docker-compose.yml new file mode 100644 index 000000000..1af424db7 --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/app/websocket/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3.7' +services: + epdc-websocket-server: + image: registry.cn-qingdao.aliyuncs.com/esua-epdc-shibei/epdc-websocket-server:prod + container_name: epdc-websocket-server-01 + restart: always + networks: + epdc_network: + ipv4_address: 172.20.0.50 + volumes: + - /mnt/epdc/app/websocket/logs:/logs +networks: + epdc_network: + external: true diff --git a/esua-epdc/docker-compose/jinshui/node03/1-mysql/conf/mysql.conf.cnf b/esua-epdc/docker-compose/jinshui/node03/1-mysql/conf/mysql.conf.cnf new file mode 100644 index 000000000..36d2ca841 --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node03/1-mysql/conf/mysql.conf.cnf @@ -0,0 +1,45 @@ +[client] + +default-character-set=utf8 + +[mysqld] + +character-set-server=utf8 + +##### 这两部操作可以解决mysql连接很慢的问题 ##### +# 根据官方文档说明,如果你的mysql主机查询DNS很慢或是有很多客户端主机时会导致连接很慢,由于我们的开发机器是不能够连接外网的, +# 所以DNS解析是不可能完成的,从而也就明白了为什么连接那么慢了。同时,请注意在增加该配置参数后,mysql的授权表中的host字段就 +# 不能够使用域名而只能够使用 ip地址了,因为这是禁止了域名解析的结果。 + +# 1.禁止域名解析 +skip-host-cache + +# 2.禁用dns解析,但是,这样不能在mysql的授权表中使用主机名了,只能使用IP。 +skip-name-resolve + +# 数据库编号, 要具有唯一性, 不能跟其他数据库重复, 方便同步区分 +server-id = 21 + +# mysql日志 +log_bin = /var/lib/mysql/mysql-bin.log +log-bin-index=slave-relay-bin.index + +#日志记录的格式 +binlog_format=MIXED + +#单个日志文件最大 +max_binlog_size = 512M  + +#从库建议开启,有利于数据一致性 +relay_log_recovery = 1    + +#如果从库还会用做主库,建议开启 +log_slave_updates = 1    + +# 中继日志:存储所有主库TP过来的binlog事件主库binlog:记录主库发生过的修改事件 +# relay-log = /var/lib/mysql/mysql-relay-bin.log + +# Disabling symbolic-links is recommended to prevent assorted security risks +symbolic-links=0 + +sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION diff --git a/esua-epdc/docker-compose/jinshui/node03/1-mysql/docker-compose.yml b/esua-epdc/docker-compose/jinshui/node03/1-mysql/docker-compose.yml new file mode 100644 index 000000000..841fff19f --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node03/1-mysql/docker-compose.yml @@ -0,0 +1,21 @@ +version: "3.7" +services: + mysql-slave: + container_name: mysql-slave + image: mysql:5.7 + environment: + TZ: Asia/Shanghai + MYSQL_ROOT_PASSWORD: epdc!elink1405 + MYSQL_LOWER_CASE_TABLE_NAMES: 1 + volumes: + - /etc/localtime:/etc/localtime + - /etc/timezone:/etc/timezone + - /mnt/epdc/mysql/data:/var/lib/mysql + - /mnt/epdc/mysql/conf/mysql.conf.cnf:/etc/mysql/conf.d/mysql.conf.cnf + restart: always + networks: + epdc_network: + ipv4_address: 172.20.0.3 +networks: + epdc_network: + external: true diff --git a/esua-epdc/docker-compose/jinshui/node03/2-nginx/docker-compose.yml b/esua-epdc/docker-compose/jinshui/node03/2-nginx/docker-compose.yml new file mode 100644 index 000000000..5ea8ecf9a --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node03/2-nginx/docker-compose.yml @@ -0,0 +1,20 @@ +version: "3.7" +services: + web: + image: nginx + ports: + - 80:80 + - 443:443 + volumes: + - /mnt/epdc/nginx/html:/usr/share/nginx/html + - /mnt/epdc/nginx/conf/nginx.conf:/etc/nginx/nginx.conf:ro + - /mnt/epdc/nginx/conf.d:/etc/nginx/conf.d:ro + - /mnt/epdc/nginx/logs:/var/log/nginx + restart: always + container_name: nginx_master + networks: + epdc_network: + ipv4_address: 172.20.0.4 +networks: + epdc_network: + external: true diff --git a/esua-epdc/docker-compose/jinshui/node03/3-nacos/docker-compose.yml b/esua-epdc/docker-compose/jinshui/node03/3-nacos/docker-compose.yml new file mode 100644 index 000000000..329d60e86 --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node03/3-nacos/docker-compose.yml @@ -0,0 +1,27 @@ +version: "3.7" +services: + nacos3: + image: nacos/nacos-server:latest + container_name: nacos3 + networks: + epdc_network: + ipv4_address: 172.20.0.5 + volumes: + - /mnt/epdc/nacos/logs:/home/nacos/logs + - /mnt/epdc/nacos/init.d/custom.properties:/home/nacos/init.d/custom.properties + environment: + PREFER_HOST_MODE: ip #如果支持主机名可以使用hostname,否则使用ip,默认也是ip + SPRING_DATASOURCE_PLATFORM: mysql #数据源平台 仅支持mysql或不保存empty + NACOS_SERVER_IP: 172.20.0.5 #多网卡情况下,指定ip或网卡 + NACOS_SERVERS: 172.20.0.5:8848 172.19.0.3:8848 172.19.0.4:8848 #集群中其它节点[ip1:port ip2:port ip3:port] + MYSQL_MASTER_SERVICE_HOST: 172.19.0.2 #mysql配置,Master为主节点,Slave为从节点 + MYSQL_MASTER_SERVICE_PORT: 3306 + MYSQL_MASTER_SERVICE_DB_NAME: epdc_nacos + MYSQL_MASTER_SERVICE_USER: nacos + MYSQL_MASTER_SERVICE_PASSWORD: elink!nacos888 + MYSQL_SLAVE_SERVICE_HOST: 172.20.0.3 + MYSQL_SLAVE_SERVICE_PORT: 3306 + restart: always +networks: + epdc_network: + external: true diff --git a/esua-epdc/docker-compose/jinshui/node03/4-redis/docker-compose.yml b/esua-epdc/docker-compose/jinshui/node03/4-redis/docker-compose.yml new file mode 100644 index 000000000..314ce01c5 --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node03/4-redis/docker-compose.yml @@ -0,0 +1,17 @@ +version: '3.7' +services: + slave2: + image: redis + container_name: redis-slave-2 + command: redis-server --slaveof 172.19.0.11 6379 --requirepass epdc!redis@slave1405 --masterauth epdc!redis@master1405 --logfile /data/log/redis-slave2.log + restart: always + volumes: + - /mnt/epdc/redis/log:/data/log + - /mnt/epdc/redis/data:/data + networks: + epdc_network: + ipv4_address: 172.20.0.11 + +networks: + epdc_network: + external: true diff --git a/esua-epdc/docker-compose/jinshui/node03/4-redis/sentinel/conf/sentinel1.conf b/esua-epdc/docker-compose/jinshui/node03/4-redis/sentinel/conf/sentinel1.conf new file mode 100644 index 000000000..a19d1e21b --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node03/4-redis/sentinel/conf/sentinel1.conf @@ -0,0 +1,9 @@ +port 26379 +logfile "/usr/local/redis/sentinel/log/sentinel.log" +dir "/usr/local/redis/sentinel" +sentinel monitor epdcmaster 172.19.0.11 6379 2 +sentinel down-after-milliseconds epdcmaster 30000 +sentinel parallel-syncs epdcmaster 1 +sentinel failover-timeout epdcmaster 180000 +sentinel deny-scripts-reconfig yes +sentinel auth-pass epdcmaster epdc!redis@master1405 diff --git a/esua-epdc/docker-compose/jinshui/node03/4-redis/sentinel/docker-compose.yml b/esua-epdc/docker-compose/jinshui/node03/4-redis/sentinel/docker-compose.yml new file mode 100644 index 000000000..01ac65055 --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node03/4-redis/sentinel/docker-compose.yml @@ -0,0 +1,18 @@ +version: '3.7' +services: + sentinel2: + image: redis + container_name: redis-sentinel-2 + command: redis-sentinel /usr/local/etc/redis/sentinel.conf + volumes: + - /mnt/epdc/redis/sentinel/conf/sentinel1.conf:/usr/local/etc/redis/sentinel.conf + - /mnt/epdc/redis/sentinel/data:/data + - /mnt/epdc/redis/sentinel/log:/usr/local/redis/sentinel/log + - /mnt/epdc/redis/sentinel/dir:/usr/local/redis/sentinel + networks: + epdc_network: + ipv4_address: 172.20.0.12 + +networks: + epdc_network: + external: true diff --git a/esua-epdc/docker-compose/jinshui/node03/5-seata/conf/registry.conf b/esua-epdc/docker-compose/jinshui/node03/5-seata/conf/registry.conf new file mode 100644 index 000000000..b54576988 --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node03/5-seata/conf/registry.conf @@ -0,0 +1,73 @@ +registry { + # file 、nacos 、eureka、redis、zk、consul、etcd3、sofa + type = "nacos" + + nacos { + serverAddr = "47.104.208.104:80" + namespace = "" + cluster = "default" + } + eureka { + serviceUrl = "http://localhost:8761/eureka" + application = "default" + weight = "1" + } + redis { + serverAddr = "localhost:6379" + db = "0" + } + zk { + cluster = "default" + serverAddr = "127.0.0.1:2181" + session.timeout = 6000 + connect.timeout = 2000 + } + consul { + cluster = "default" + serverAddr = "127.0.0.1:8500" + } + etcd3 { + cluster = "default" + serverAddr = "http://localhost:2379" + } + sofa { + serverAddr = "127.0.0.1:9603" + application = "default" + region = "DEFAULT_ZONE" + datacenter = "DefaultDataCenter" + cluster = "default" + group = "SEATA_GROUP" + addressWaitTime = "3000" + } + file { + name = "file.conf" + } +} + +config { + # file、nacos 、apollo、zk、consul、etcd3 + type = "nacos" + + nacos { + serverAddr = "47.104.208.104:80" + namespace = "" + } + consul { + serverAddr = "127.0.0.1:8500" + } + apollo { + app.id = "seata-server" + apollo.meta = "http://192.168.1.204:8801" + } + zk { + serverAddr = "127.0.0.1:2181" + session.timeout = 6000 + connect.timeout = 2000 + } + etcd3 { + serverAddr = "http://localhost:2379" + } + file { + name = "file.conf" + } +} diff --git a/esua-epdc/docker-compose/prod/master/db/10.5.34.164/docker-compose.yml b/esua-epdc/docker-compose/jinshui/node03/5-seata/docker-compose.yml similarity index 66% rename from esua-epdc/docker-compose/prod/master/db/10.5.34.164/docker-compose.yml rename to esua-epdc/docker-compose/jinshui/node03/5-seata/docker-compose.yml index b69d7d59c..359354457 100644 --- a/esua-epdc/docker-compose/prod/master/db/10.5.34.164/docker-compose.yml +++ b/esua-epdc/docker-compose/jinshui/node03/5-seata/docker-compose.yml @@ -21,15 +21,20 @@ version: "3.7" services: - seata-server: + seata-server2: + container_name: seata-server2 image: seataio/seata-server:latest - hostname: seata-server - ports: - - 9101:8091 environment: - - SEATA_PORT=8091 - - SEATA_IP=10.5.34.164 - - STORE_MODE=db - - SERVER_NODE=1 - expose: - - 8091 + SEATA_IP: 172.20.0.21 + SEATA_PORT: 8091 + STORE_MODE: db + SERVER_NODE: 2 + SEATA_CONFIG_NAME: file:/root/seata-config/registry + volumes: + - /mnt/epdc/seata/seata-config:/root/seata-config + networks: + epdc_network: + ipv4_address: 172.20.0.21 +networks: + epdc_network: + external: true diff --git a/esua-epdc/docker-compose/jinshui/node03/Readme.md b/esua-epdc/docker-compose/jinshui/node03/Readme.md new file mode 100644 index 000000000..e00b8b109 --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node03/Readme.md @@ -0,0 +1,9 @@ +1. 创建网络: + +``` +docker network create -d bridge --subnet 172.20.0.0/24 epdc_network +``` + +2. 执行1-mysql中的docker-compose.yml +3. 执行2-nacos中的docker-compose.yml +https://github.com/alibaba/nacos/blob/master/distribution/conf/nacos-mysql.sql diff --git a/esua-epdc/docker-compose/jinshui/node04/1-mysql/conf/mysql.conf.cnf b/esua-epdc/docker-compose/jinshui/node04/1-mysql/conf/mysql.conf.cnf new file mode 100644 index 000000000..02810e63e --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node04/1-mysql/conf/mysql.conf.cnf @@ -0,0 +1,36 @@ +[client] + +default-character-set=utf8 + +[mysqld] + +character-set-server=utf8 + +##### 这两部操作可以解决mysql连接很慢的问题 ##### +# 根据官方文档说明,如果你的mysql主机查询DNS很慢或是有很多客户端主机时会导致连接很慢,由于我们的开发机器是不能够连接外网的, +# 所以DNS解析是不可能完成的,从而也就明白了为什么连接那么慢了。同时,请注意在增加该配置参数后,mysql的授权表中的host字段就 +# 不能够使用域名而只能够使用 ip地址了,因为这是禁止了域名解析的结果。 + +# 1.禁止域名解析 +skip-host-cache + +# 2.禁用dns解析,但是,这样不能在mysql的授权表中使用主机名了,只能使用IP。 +skip-name-resolve + +# 数据库编号, 要具有唯一性, 不能跟其他数据库重复, 方便同步区分 +server-id = 11 + +# mysql日志 +log_bin = /var/lib/mysql/master-bin.log +log-bin-index=master-bin.index + +# binlog日志格式,mysql默认采用statement,建议使用 mixed(是statement和row模式的结合) +binlog_format = mixed + +#单个日志文件最大 +max_binlog_size = 512M + +# Disabling symbolic-links is recommended to prevent assorted security risks +symbolic-links=0 + +sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION diff --git a/esua-epdc/docker-compose/jinshui/node04/1-mysql/docker-compose.yml b/esua-epdc/docker-compose/jinshui/node04/1-mysql/docker-compose.yml new file mode 100644 index 000000000..287533d89 --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node04/1-mysql/docker-compose.yml @@ -0,0 +1,22 @@ +version: "3.7" +services: + mysql-master: + container_name: mysql-master + image: mysql:5.7 + environment: + TZ: Asia/Shanghai + MYSQL_ROOT_PASSWORD: epdc!elink1405 + MYSQL_LOWER_CASE_TABLE_NAMES: 1 + volumes: + - /etc/localtime:/etc/localtime + - /etc/timezone:/etc/timezone + - /mnt/epdc/mysql/data:/var/lib/mysql + - /mnt/epdc/mysql/conf/mysql.conf.cnf:/etc/mysql/conf.d/mysql.conf.cnf + restart: always + networks: + epdc_network: + ipv4_address: 172.19.0.2 +networks: + epdc_network: + external: true + diff --git a/esua-epdc/docker-compose/jinshui/node04/2-nacos/docker-compose.yml b/esua-epdc/docker-compose/jinshui/node04/2-nacos/docker-compose.yml new file mode 100644 index 000000000..d68fe54a6 --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node04/2-nacos/docker-compose.yml @@ -0,0 +1,50 @@ +version: "3.7" +services: + nacos1: + image: nacos/nacos-server:latest + container_name: nacos1 + networks: + epdc_network: + ipv4_address: 172.19.0.3 + volumes: + - /mnt/epdc/nacos/logs/nacos1:/home/nacos/logs + - /mnt/epdc/nacos/init.d/custom.properties:/home/nacos/init.d/custom.properties + environment: + PREFER_HOST_MODE: ip #如果支持主机名可以使用hostname,否则使用ip,默认也是ip + SPRING_DATASOURCE_PLATFORM: mysql #数据源平台 仅支持mysql或不保存empty + NACOS_SERVER_IP: 172.19.0.3 #多网卡情况下,指定ip或网卡 + NACOS_SERVERS: 172.20.0.5:8848 172.19.0.3:8848 172.19.0.4:8848 #集群中其它节点[ip1:port ip2:port ip3:port] + MYSQL_MASTER_SERVICE_HOST: 172.19.0.2 #mysql配置,Master为主节点,Slave为从节点 + MYSQL_MASTER_SERVICE_PORT: 3306 + MYSQL_MASTER_SERVICE_DB_NAME: epdc_nacos + MYSQL_MASTER_SERVICE_USER: nacos + MYSQL_MASTER_SERVICE_PASSWORD: elink!nacos888 + MYSQL_SLAVE_SERVICE_HOST: 172.20.0.3 + MYSQL_SLAVE_SERVICE_PORT: 3306 + restart: on-failure + + nacos2: + image: nacos/nacos-server:latest + container_name: nacos2 + networks: + epdc_network: + ipv4_address: 172.19.0.4 + volumes: + - /mnt/epdc/nacos/logs/nacos2:/home/nacos/logs + - /mnt/epdc/nacos/init.d/custom.properties:/home/nacos/init.d/custom.properties + environment: + PREFER_HOST_MODE: ip #如果支持主机名可以使用hostname,否则使用ip,默认也是ip + SPRING_DATASOURCE_PLATFORM: mysql #数据源平台 仅支持mysql或不保存empty + NACOS_SERVER_IP: 172.19.0.4 #多网卡情况下,指定ip或网卡 + NACOS_SERVERS: 172.20.0.5:8848 172.19.0.3:8848 172.19.0.4:8848 #集群中其它节点[ip1:port ip2:port ip3:port] + MYSQL_MASTER_SERVICE_HOST: 172.19.0.2 #mysql配置,Master为主节点,Slave为从节点 + MYSQL_MASTER_SERVICE_PORT: 3306 + MYSQL_MASTER_SERVICE_DB_NAME: epdc_nacos + MYSQL_MASTER_SERVICE_USER: nacos + MYSQL_MASTER_SERVICE_PASSWORD: elink!nacos888 + MYSQL_SLAVE_SERVICE_HOST: 172.20.0.3 + MYSQL_SLAVE_SERVICE_PORT: 3306 + restart: always +networks: + epdc_network: + external: true diff --git a/esua-epdc/docker-compose/jinshui/node04/3-seata/conf/registry.conf b/esua-epdc/docker-compose/jinshui/node04/3-seata/conf/registry.conf new file mode 100644 index 000000000..b54576988 --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node04/3-seata/conf/registry.conf @@ -0,0 +1,73 @@ +registry { + # file 、nacos 、eureka、redis、zk、consul、etcd3、sofa + type = "nacos" + + nacos { + serverAddr = "47.104.208.104:80" + namespace = "" + cluster = "default" + } + eureka { + serviceUrl = "http://localhost:8761/eureka" + application = "default" + weight = "1" + } + redis { + serverAddr = "localhost:6379" + db = "0" + } + zk { + cluster = "default" + serverAddr = "127.0.0.1:2181" + session.timeout = 6000 + connect.timeout = 2000 + } + consul { + cluster = "default" + serverAddr = "127.0.0.1:8500" + } + etcd3 { + cluster = "default" + serverAddr = "http://localhost:2379" + } + sofa { + serverAddr = "127.0.0.1:9603" + application = "default" + region = "DEFAULT_ZONE" + datacenter = "DefaultDataCenter" + cluster = "default" + group = "SEATA_GROUP" + addressWaitTime = "3000" + } + file { + name = "file.conf" + } +} + +config { + # file、nacos 、apollo、zk、consul、etcd3 + type = "nacos" + + nacos { + serverAddr = "47.104.208.104:80" + namespace = "" + } + consul { + serverAddr = "127.0.0.1:8500" + } + apollo { + app.id = "seata-server" + apollo.meta = "http://192.168.1.204:8801" + } + zk { + serverAddr = "127.0.0.1:2181" + session.timeout = 6000 + connect.timeout = 2000 + } + etcd3 { + serverAddr = "http://localhost:2379" + } + file { + name = "file.conf" + } +} diff --git a/esua-epdc/docker-compose/prod/master/db/10.5.34.166/docker-compose.yml b/esua-epdc/docker-compose/jinshui/node04/3-seata/docker-compose.yml similarity index 66% rename from esua-epdc/docker-compose/prod/master/db/10.5.34.166/docker-compose.yml rename to esua-epdc/docker-compose/jinshui/node04/3-seata/docker-compose.yml index 8a28de264..5eb137479 100644 --- a/esua-epdc/docker-compose/prod/master/db/10.5.34.166/docker-compose.yml +++ b/esua-epdc/docker-compose/jinshui/node04/3-seata/docker-compose.yml @@ -21,15 +21,20 @@ version: "3.7" services: - seata-server: + seata-server1: + container_name: seata-server1 image: seataio/seata-server:latest - hostname: seata-server - ports: - - 9101:8091 environment: - - SEATA_PORT=8091 - - SEATA_IP=10.5.34.166 - - STORE_MODE=db - - SERVER_NODE=1 - expose: - - 8091 + SEATA_IP: 172.19.0.21 + SEATA_PORT: 8091 + STORE_MODE: db + SERVER_NODE: 1 + SEATA_CONFIG_NAME: file:/root/seata-config/registry + volumes: + - /mnt/epdc/seata/seata-config:/root/seata-config + networks: + epdc_network: + ipv4_address: 172.19.0.21 +networks: + epdc_network: + external: true diff --git a/esua-epdc/docker-compose/jinshui/node04/3-seata/script/config.txt b/esua-epdc/docker-compose/jinshui/node04/3-seata/script/config.txt new file mode 100644 index 000000000..bbdbaf627 --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node04/3-seata/script/config.txt @@ -0,0 +1,81 @@ +transport.type=TCP +transport.server=NIO +transport.heartbeat=true +transport.enable-client-batch-send-request=false +transport.thread-factory.boss-thread-prefix=NettyBoss +transport.thread-factory.worker-thread-prefix=NettyServerNIOWorker +transport.thread-factory.server-executor-thread-prefix=NettyServerBizHandler +transport.thread-factory.share-boss-worker=false +transport.thread-factory.client-selector-thread-prefix=NettyClientSelector +transport.thread-factory.client-selector-thread-size=1 +transport.thread-factory.client-worker-thread-prefix=NettyClientWorkerThread +transport.thread-factory.boss-thread-size=1 +transport.thread-factory.worker-thread-size=8 +transport.shutdown.wait=3 +service.vgroup_mapping.my_test_tx_group=default +service.vgroup_mapping.epdc-api-server-fescar-service-group=default +service.vgroup_mapping.epdc-demo-server-fescar-service-group=default +service.vgroup_mapping.epdc-user-server-fescar-service-group=default +service.vgroup_mapping.epdc-services-server-fescar-service-group=default +service.vgroup_mapping.epdc-party-server-fescar-service-group=default +service.vgroup_mapping.epdc-heart-server-fescar-service-group=default +service.vgroup_mapping.epdc-neighbor-server-fescar-service-group=default +service.vgroup_mapping.epdc-oss-server-fescar-service-group=default +service.vgroup_mapping.epdc-message-server-fescar-service-group=default +service.vgroup_mapping.epdc-news-server-fescar-service-group=default +service.vgroup_mapping.epdc-job-server-fescar-service-group=default +service.vgroup_mapping.epdc-admin-server-fescar-service-group=default +service.vgroup_mapping.epdc-activiti-server-fescar-service-group=default +service.vgroup_mapping.epdc-kpi-server-fescar-service-group=default +service.vgroup_mapping.epdc-points-server-fescar-service-group=default +service.vgroup_mapping.epdc-webservice-server-fescar-service-group=default +service.vgroup_mapping.epdc-events-server-fescar-service-group=default +service.enableDegrade=false +service.disableGlobalTransaction=false +client.rm.async.commit.buffer.limit=10000 +client.rm.lock.retry.internal=10 +client.rm.lock.retry.times=30 +client.rm.report.retry.count=5 +client.rm.lock.retry.policy.branch-rollback-on-conflict=true +client.rm.table.meta.check.enable=false +client.rm.report.success.enable=true +client.tm.commit.retry.count=5 +client.tm.rollback.retry.count=5 +store.mode=db +store.file.dir=file_store/data +store.file.max-branch-session-size=16384 +store.file.max-global-session-size=512 +store.file.file-write-buffer-cache-size=16384 +store.file.flush-disk-mode=async +store.file.session.reload.read_size=100 +store.db.datasource=dbcp +store.db.db-type=mysql +store.db.driver-class-name=com.mysql.jdbc.Driver +store.db.url=jdbc:mysql://172.19.0.2:3306/seata?useUnicode=true +store.db.user=epdc +store.db.password=Elink@833066 +store.db.min-conn=1 +store.db.max-conn=3 +store.db.global.table=global_table +store.db.branch.table=branch_table +store.db.query-limit=100 +store.db.lock-table=lock_table +server.recovery.committing-retry-period=1000 +server.recovery.asyn-committing-retry-period=1000 +server.recovery.rollbacking-retry-period=1000 +server.recovery.timeout-retry-period=1000 +server.max.commit.retry.timeout=-1 +server.max.rollback.retry.timeout=-1 +server.rollback.retry.timeout.unlock.enable=false +client.undo.data.validation=true +client.undo.log.serialization=jackson +server.undo.log.save.days=7 +server.undo.log.delete.period=86400000 +client.undo.log.table=undo_log +client.log.exceptionRate=100 +transport.serialization=seata +transport.compressor=none +metrics.enabled=false +metrics.registry-type=compact +metrics.exporter-list=prometheus +metrics.exporter-prometheus-port=9898 diff --git a/esua-epdc/docker-compose/jinshui/node04/3-seata/script/nacos-config.sh b/esua-epdc/docker-compose/jinshui/node04/3-seata/script/nacos-config.sh new file mode 100644 index 000000000..15edf8555 --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node04/3-seata/script/nacos-config.sh @@ -0,0 +1,89 @@ +#!/usr/bin/env bash +# Copyright 1999-2019 Seata.io Group. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at、 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +while getopts ":h:p:g:t:" opt +do + case $opt in + h) + host=$OPTARG + ;; + p) + port=$OPTARG + ;; + g) + group=$OPTARG + ;; + t) + tenant=$OPTARG + ;; + ?) + echo "\033[31m USAGE OPTION: $0 [-h host] [-p port] [-g group] [-t tenant] \033[0m" + exit 1 + ;; + esac +done + +if [[ -z ${host} ]]; then + host=localhost +fi +if [[ -z ${port} ]]; then + port=8848 +fi +if [[ -z ${group} ]]; then + group="SEATA_GROUP" +fi +if [[ -z ${tenant} ]]; then + tenant="" +fi + +nacosAddr=$host:$port +contentType="content-type:application/json;charset=UTF-8" + +echo "set nacosAddr=$nacosAddr" +echo "set group=$group" + +failCount=0 +tempLog=$(mktemp -u) +function addConfig() { + curl -X POST -H "${1}" "http://$2/nacos/v1/cs/configs?dataId=$3&group=$group&content=$4&tenant=$tenant" >"${tempLog}" 2>/dev/null + if [[ -z $(cat "${tempLog}") ]]; then + echo "\033[31m Please check the cluster status. \033[0m" + exit 1 + fi + if [[ $(cat "${tempLog}") =~ "true" ]]; then + echo "Set $3=$4\033[32m successfully \033[0m" + else + echo "Set $3=$4\033[31m failure \033[0m" + (( failCount++ )) + fi +} + +count=0 +for line in $(cat $(dirname "$PWD")/config.txt); do + (( count++ )) + key=${line%%=*} + value=${line#*=} + addConfig "${contentType}" "${nacosAddr}" "${key}" "${value}" +done + +echo "=========================================================================" +echo " Complete initialization parameters, \033[32m total-count:$count \033[0m, \033[31m failure-count:$failCount \033[0m" +echo "=========================================================================" + +if [[ ${failCount} -eq 0 ]]; then + echo "\033[32m Init nacos config finished, please start seata-server. \033[0m" +else + echo "\033[31m init nacos config fail. \033[0m" +fi diff --git a/esua-epdc/docker-compose/jinshui/node04/4-redis/docker-compose.yml b/esua-epdc/docker-compose/jinshui/node04/4-redis/docker-compose.yml new file mode 100644 index 000000000..05b3cc38d --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node04/4-redis/docker-compose.yml @@ -0,0 +1,29 @@ +version: '3.7' +services: + master: + image: redis + container_name: redis-master + command: redis-server --requirepass epdc!redis@master1405 --logfile /data/log/redis-master.log + restart: always + volumes: + - /mnt/epdc/redis/log:/data/log + - /mnt/epdc/redis/data:/data + networks: + epdc_network: + ipv4_address: 172.19.0.11 + + slave1: + image: redis + container_name: redis-slave-1 + command: redis-server --slaveof 172.19.0.11 6379 --requirepass epdc!redis@slave1405 --masterauth epdc!redis@master1405 --logfile /data/log/redis-slave1.log + restart: always + volumes: + - /mnt/epdc/redis/log:/data/log + - /mnt/epdc/redis/data:/data + networks: + epdc_network: + ipv4_address: 172.19.0.12 + +networks: + epdc_network: + external: true diff --git a/esua-epdc/docker-compose/jinshui/node04/4-redis/sentinel/conf/sentinel1.conf b/esua-epdc/docker-compose/jinshui/node04/4-redis/sentinel/conf/sentinel1.conf new file mode 100644 index 000000000..a19d1e21b --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node04/4-redis/sentinel/conf/sentinel1.conf @@ -0,0 +1,9 @@ +port 26379 +logfile "/usr/local/redis/sentinel/log/sentinel.log" +dir "/usr/local/redis/sentinel" +sentinel monitor epdcmaster 172.19.0.11 6379 2 +sentinel down-after-milliseconds epdcmaster 30000 +sentinel parallel-syncs epdcmaster 1 +sentinel failover-timeout epdcmaster 180000 +sentinel deny-scripts-reconfig yes +sentinel auth-pass epdcmaster epdc!redis@master1405 diff --git a/esua-epdc/docker-compose/jinshui/node04/4-redis/sentinel/conf/sentinel2.conf b/esua-epdc/docker-compose/jinshui/node04/4-redis/sentinel/conf/sentinel2.conf new file mode 100644 index 000000000..a19d1e21b --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node04/4-redis/sentinel/conf/sentinel2.conf @@ -0,0 +1,9 @@ +port 26379 +logfile "/usr/local/redis/sentinel/log/sentinel.log" +dir "/usr/local/redis/sentinel" +sentinel monitor epdcmaster 172.19.0.11 6379 2 +sentinel down-after-milliseconds epdcmaster 30000 +sentinel parallel-syncs epdcmaster 1 +sentinel failover-timeout epdcmaster 180000 +sentinel deny-scripts-reconfig yes +sentinel auth-pass epdcmaster epdc!redis@master1405 diff --git a/esua-epdc/docker-compose/jinshui/node04/4-redis/sentinel/docker-compose.yml b/esua-epdc/docker-compose/jinshui/node04/4-redis/sentinel/docker-compose.yml new file mode 100644 index 000000000..855bd32be --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node04/4-redis/sentinel/docker-compose.yml @@ -0,0 +1,31 @@ +version: '3.7' +services: + sentinel1: + image: redis + container_name: redis-sentinel-1 + command: redis-sentinel /usr/local/etc/redis/sentinel.conf + volumes: + - /mnt/epdc/redis/sentinel/conf/sentinel1.conf:/usr/local/etc/redis/sentinel.conf + - /mnt/epdc/redis/sentinel/data:/data + - /mnt/epdc/redis/sentinel/log:/usr/local/redis/sentinel/log + - /mnt/epdc/redis/sentinel/dir:/usr/local/redis/sentinel + networks: + epdc_network: + ipv4_address: 172.19.0.13 + + sentinel3: + image: redis + container_name: redis-sentinel-3 + command: redis-sentinel /usr/local/etc/redis/sentinel.conf + volumes: + - /mnt/epdc/redis/sentinel/conf/sentinel2.conf:/usr/local/etc/redis/sentinel.conf + - /mnt/epdc/redis/sentinel/data2:/data + - /mnt/epdc/redis/sentinel/log2:/usr/local/redis/sentinel/log + - /mnt/epdc/redis/sentinel/dir2:/usr/local/redis/sentinel + networks: + epdc_network: + ipv4_address: 172.19.0.14 + +networks: + epdc_network: + external: true diff --git a/esua-epdc/docker-compose/jinshui/node04/Readme.md b/esua-epdc/docker-compose/jinshui/node04/Readme.md new file mode 100644 index 000000000..a8b2fa7d6 --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node04/Readme.md @@ -0,0 +1,8 @@ +1. 创建网络: + +``` +docker network create -d bridge --subnet 172.19.0.0/24 epdc_network +``` + +2. 执行1-mysql中的docker-compose.yml +3. 执行2-nacos中的docker-compose.yml diff --git a/esua-epdc/docker-compose/jinshui/node04/fastdfs/Dockerfile b/esua-epdc/docker-compose/jinshui/node04/fastdfs/Dockerfile new file mode 100644 index 000000000..8a7bdb353 --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node04/fastdfs/Dockerfile @@ -0,0 +1,39 @@ +# centos 7 +FROM centos:7 +# 添加配置文件 +ADD conf/client.conf /etc/fdfs/ +ADD conf/http.conf /etc/fdfs/ +ADD conf/mime.types /etc/fdfs/ +ADD conf/storage.conf /etc/fdfs/ +ADD conf/tracker.conf /etc/fdfs/ +ADD fastdfs.sh /home +ADD conf/nginx.conf /etc/fdfs/ +ADD conf/mod_fastdfs.conf /etc/fdfs + +# run +RUN yum install git gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zlib zlib-devel openssl-devel wget vim -y \ + && cd /usr/local/src \ + && git clone https://github.com/happyfish100/libfastcommon.git --depth 1 \ + && git clone https://github.com/happyfish100/fastdfs.git --depth 1 \ + && git clone https://github.com/happyfish100/fastdfs-nginx-module.git --depth 1 \ + && wget http://nginx.org/download/nginx-1.15.4.tar.gz \ + && tar -zxvf nginx-1.15.4.tar.gz \ + && mkdir /home/dfs \ + && cd /usr/local/src/ \ + && cd libfastcommon/ \ + && ./make.sh && ./make.sh install \ + && cd ../ \ + && cd fastdfs/ \ + && ./make.sh && ./make.sh install \ + && cd ../ \ + && cd nginx-1.15.4/ \ + && ./configure --add-module=/usr/local/src/fastdfs-nginx-module/src/ \ + && make && make install \ + && chmod +x /home/fastdfs.sh + + +# export config +VOLUME /etc/fdfs + +EXPOSE 22122 23000 8888 80 +ENTRYPOINT ["/home/fastdfs.sh"] diff --git a/esua-epdc/docker-compose/jinshui/node04/fastdfs/README.md b/esua-epdc/docker-compose/jinshui/node04/fastdfs/README.md new file mode 100644 index 000000000..a3570545d --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node04/fastdfs/README.md @@ -0,0 +1,45 @@ +# FastDFS Dockerfile network (网络版本) + +## 声明 +其实并没什么区别 教程是在上一位huayanYu(小锅盖)和 Wiki的作者 的基础上进行了一些修改,本质上还是huayanYu(小锅盖) 和 Wiki 上的作者写的教程 + + +## 目录介绍 +### conf +Dockerfile 所需要的一些配置文件 +当然你也可以对这些文件进行一些修改 比如 storage.conf 里面的 bast_path 等相关 + +## 使用方法 +需要注意的是 你需要在运行容器的时候制定宿主机的ip 用参数 FASTDFS_IPADDR 来指定 + + + +``` +docker run -d -e FASTDFS_IPADDR=192.168.1.234 -p 8888:8888 -p 22122:22122 -p 23000:23000 -p 8011:80 --name test-fast 镜像id/镜像名称 +``` + + +## 后记 +本质上 local 版本与 network 版本无区别 + + + + +## Statement +In fact, there is no difference between the tutorials written by Huayan Yu and Wiki on the basis of their previous authors. In essence, they are also tutorials written by the authors of Huayan Yu and Wiki. + +## Catalogue introduction +### conf +Dockerfile Some configuration files needed +Of course, you can also make some modifications to these files, such as bast_path in storage. conf, etc. + +## Usage method +Note that you need to specify the host IP when running the container with the parameter FASTDFS_IPADDR +Here's a sample docker run instruction +``` +docker run -d -e FASTDFS_IPADDR=192.168.1.234 -p 8888:8888 -p 22122:22122 -p 23000:23000 -p 8011:80 --name test-fast 镜像id/镜像名称 +``` + +## Epilogue +Essentially, there is no difference between the local version and the network version. + diff --git a/esua-epdc/docker-compose/jinshui/node04/fastdfs/conf/client.conf b/esua-epdc/docker-compose/jinshui/node04/fastdfs/conf/client.conf new file mode 100644 index 000000000..8ddfc54c1 --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node04/fastdfs/conf/client.conf @@ -0,0 +1,63 @@ +# connect timeout in seconds +# default value is 30s +connect_timeout=30 + +# network timeout in seconds +# default value is 30s +network_timeout=60 + +# the base path to store log files +base_path=/home/dfs + +# tracker_server can ocur more than once, and tracker_server format is +# "host:port", host can be hostname or ip address +tracker_server=172.19.0.30:22122 +tracker_server=172.20.0.30:22122 + +#standard log level as syslog, case insensitive, value list: +### emerg for emergency +### alert +### crit for critical +### error +### warn for warning +### notice +### info +### debug +log_level=info + +# if use connection pool +# default value is false +# since V4.05 +use_connection_pool = false + +# connections whose the idle time exceeds this time will be closed +# unit: second +# default value is 3600 +# since V4.05 +connection_pool_max_idle_time = 3600 + +# if load FastDFS parameters from tracker server +# since V4.05 +# default value is false +load_fdfs_parameters_from_tracker=false + +# if use storage ID instead of IP address +# same as tracker.conf +# valid only when load_fdfs_parameters_from_tracker is false +# default value is false +# since V4.05 +use_storage_id = false + +# specify storage ids filename, can use relative or absolute path +# same as tracker.conf +# valid only when load_fdfs_parameters_from_tracker is false +# since V4.05 +storage_ids_filename = storage_ids.conf + + +#HTTP settings +http.tracker_server_port=80 + +#use "#include" directive to include HTTP other settiongs +##include http.conf + diff --git a/esua-epdc/docker-compose/jinshui/node04/fastdfs/conf/http.conf b/esua-epdc/docker-compose/jinshui/node04/fastdfs/conf/http.conf new file mode 100644 index 000000000..4d055f983 --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node04/fastdfs/conf/http.conf @@ -0,0 +1,29 @@ +# HTTP default content type +http.default_content_type = application/octet-stream + +# MIME types mapping filename +# MIME types file format: MIME_type extensions +# such as: image/jpeg jpeg jpg jpe +# you can use apache's MIME file: mime.types +http.mime_types_filename=mime.types + +# if use token to anti-steal +# default value is false (0) +http.anti_steal.check_token=false + +# token TTL (time to live), seconds +# default value is 600 +http.anti_steal.token_ttl=900 + +# secret key to generate anti-steal token +# this parameter must be set when http.anti_steal.check_token set to true +# the length of the secret key should not exceed 128 bytes +http.anti_steal.secret_key=FastDFS1234567890 + +# return the content of the file when check token fail +# default value is empty (no file sepecified) +http.anti_steal.token_check_fail=/home/yuqing/fastdfs/conf/anti-steal.jpg + +# if support multi regions for HTTP Range +# default value is true +http.multi_range.enabed = true diff --git a/esua-epdc/docker-compose/jinshui/node04/fastdfs/conf/mime.types b/esua-epdc/docker-compose/jinshui/node04/fastdfs/conf/mime.types new file mode 100644 index 000000000..07b4465ef --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node04/fastdfs/conf/mime.types @@ -0,0 +1,1065 @@ +# This is a comment. I love comments. + +# This file controls what Internet media types are sent to the client for +# given file extension(s). Sending the correct media type to the client +# is important so they know how to handle the content of the file. +# Extra types can either be added here or by using an AddType directive +# in your config files. For more information about Internet media types, +# please read RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type +# registry is at . + +# MIME type Extensions +application/activemessage +application/andrew-inset ez +application/applefile +application/atom+xml atom +application/atomcat+xml atomcat +application/atomicmail +application/atomsvc+xml atomsvc +application/auth-policy+xml +application/batch-smtp +application/beep+xml +application/cals-1840 +application/ccxml+xml ccxml +application/cellml+xml +application/cnrp+xml +application/commonground +application/conference-info+xml +application/cpl+xml +application/csta+xml +application/cstadata+xml +application/cybercash +application/davmount+xml davmount +application/dca-rft +application/dec-dx +application/dialog-info+xml +application/dicom +application/dns +application/dvcs +application/ecmascript ecma +application/edi-consent +application/edi-x12 +application/edifact +application/epp+xml +application/eshop +application/fastinfoset +application/fastsoap +application/fits +application/font-tdpfr pfr +application/h224 +application/http +application/hyperstudio stk +application/iges +application/im-iscomposing+xml +application/index +application/index.cmd +application/index.obj +application/index.response +application/index.vnd +application/iotp +application/ipp +application/isup +application/javascript js +application/json json +application/kpml-request+xml +application/kpml-response+xml +application/lost+xml lostxml +application/mac-binhex40 hqx +application/mac-compactpro cpt +application/macwriteii +application/marc mrc +application/mathematica ma nb mb +application/mathml+xml mathml +application/mbms-associated-procedure-description+xml +application/mbms-deregister+xml +application/mbms-envelope+xml +application/mbms-msk+xml +application/mbms-msk-response+xml +application/mbms-protection-description+xml +application/mbms-reception-report+xml +application/mbms-register+xml +application/mbms-register-response+xml +application/mbms-user-service-description+xml +application/mbox mbox +application/media_control+xml +application/mediaservercontrol+xml mscml +application/mikey +application/moss-keys +application/moss-signature +application/mosskey-data +application/mosskey-request +application/mp4 mp4s +application/mpeg4-generic +application/mpeg4-iod +application/mpeg4-iod-xmt +application/msword doc dot +application/mxf mxf +application/nasdata +application/news-transmission +application/nss +application/ocsp-request +application/ocsp-response +application/octet-stream bin dms lha lzh class so iso dmg dist distz pkg bpk dump elc +application/oda oda +application/oebps-package+xml +application/ogg ogx +application/parityfec +application/patch-ops-error+xml xer +application/pdf pdf +application/pgp-encrypted pgp +application/pgp-keys +application/pgp-signature asc sig +application/pics-rules prf +application/pidf+xml +application/pidf-diff+xml +application/pkcs10 p10 +application/pkcs7-mime p7m p7c +application/pkcs7-signature p7s +application/pkix-cert cer +application/pkix-crl crl +application/pkix-pkipath pkipath +application/pkixcmp pki +application/pls+xml pls +application/poc-settings+xml +application/postscript ai eps ps +application/prs.alvestrand.titrax-sheet +application/prs.cww cww +application/prs.nprend +application/prs.plucker +application/qsig +application/rdf+xml rdf +application/reginfo+xml rif +application/relax-ng-compact-syntax rnc +application/remote-printing +application/resource-lists+xml rl +application/resource-lists-diff+xml rld +application/riscos +application/rlmi+xml +application/rls-services+xml rs +application/rsd+xml rsd +application/rss+xml rss +application/rtf rtf +application/rtx +application/samlassertion+xml +application/samlmetadata+xml +application/sbml+xml sbml +application/scvp-cv-request scq +application/scvp-cv-response scs +application/scvp-vp-request spq +application/scvp-vp-response spp +application/sdp sdp +application/set-payment +application/set-payment-initiation setpay +application/set-registration +application/set-registration-initiation setreg +application/sgml +application/sgml-open-catalog +application/shf+xml shf +application/sieve +application/simple-filter+xml +application/simple-message-summary +application/simplesymbolcontainer +application/slate +application/smil +application/smil+xml smi smil +application/soap+fastinfoset +application/soap+xml +application/sparql-query rq +application/sparql-results+xml srx +application/spirits-event+xml +application/srgs gram +application/srgs+xml grxml +application/ssml+xml ssml +application/timestamp-query +application/timestamp-reply +application/tve-trigger +application/ulpfec +application/vemmi +application/vividence.scriptfile +application/vnd.3gpp.bsf+xml +application/vnd.3gpp.pic-bw-large plb +application/vnd.3gpp.pic-bw-small psb +application/vnd.3gpp.pic-bw-var pvb +application/vnd.3gpp.sms +application/vnd.3gpp2.bcmcsinfo+xml +application/vnd.3gpp2.sms +application/vnd.3gpp2.tcap tcap +application/vnd.3m.post-it-notes pwn +application/vnd.accpac.simply.aso aso +application/vnd.accpac.simply.imp imp +application/vnd.acucobol acu +application/vnd.acucorp atc acutc +application/vnd.adobe.xdp+xml xdp +application/vnd.adobe.xfdf xfdf +application/vnd.aether.imp +application/vnd.americandynamics.acc acc +application/vnd.amiga.ami ami +application/vnd.anser-web-certificate-issue-initiation cii +application/vnd.anser-web-funds-transfer-initiation fti +application/vnd.antix.game-component atx +application/vnd.apple.installer+xml mpkg +application/vnd.arastra.swi swi +application/vnd.audiograph aep +application/vnd.autopackage +application/vnd.avistar+xml +application/vnd.blueice.multipass mpm +application/vnd.bmi bmi +application/vnd.businessobjects rep +application/vnd.cab-jscript +application/vnd.canon-cpdl +application/vnd.canon-lips +application/vnd.cendio.thinlinc.clientconf +application/vnd.chemdraw+xml cdxml +application/vnd.chipnuts.karaoke-mmd mmd +application/vnd.cinderella cdy +application/vnd.cirpack.isdn-ext +application/vnd.claymore cla +application/vnd.clonk.c4group c4g c4d c4f c4p c4u +application/vnd.commerce-battelle +application/vnd.commonspace csp cst +application/vnd.contact.cmsg cdbcmsg +application/vnd.cosmocaller cmc +application/vnd.crick.clicker clkx +application/vnd.crick.clicker.keyboard clkk +application/vnd.crick.clicker.palette clkp +application/vnd.crick.clicker.template clkt +application/vnd.crick.clicker.wordbank clkw +application/vnd.criticaltools.wbs+xml wbs +application/vnd.ctc-posml pml +application/vnd.ctct.ws+xml +application/vnd.cups-pdf +application/vnd.cups-postscript +application/vnd.cups-ppd ppd +application/vnd.cups-raster +application/vnd.cups-raw +application/vnd.curl curl +application/vnd.cybank +application/vnd.data-vision.rdz rdz +application/vnd.denovo.fcselayout-link fe_launch +application/vnd.dna dna +application/vnd.dolby.mlp mlp +application/vnd.dpgraph dpg +application/vnd.dreamfactory dfac +application/vnd.dvb.esgcontainer +application/vnd.dvb.ipdcesgaccess +application/vnd.dvb.iptv.alfec-base +application/vnd.dvb.iptv.alfec-enhancement +application/vnd.dxr +application/vnd.ecdis-update +application/vnd.ecowin.chart mag +application/vnd.ecowin.filerequest +application/vnd.ecowin.fileupdate +application/vnd.ecowin.series +application/vnd.ecowin.seriesrequest +application/vnd.ecowin.seriesupdate +application/vnd.enliven nml +application/vnd.epson.esf esf +application/vnd.epson.msf msf +application/vnd.epson.quickanime qam +application/vnd.epson.salt slt +application/vnd.epson.ssf ssf +application/vnd.ericsson.quickcall +application/vnd.eszigno3+xml es3 et3 +application/vnd.eudora.data +application/vnd.ezpix-album ez2 +application/vnd.ezpix-package ez3 +application/vnd.fdf fdf +application/vnd.ffsns +application/vnd.fints +application/vnd.flographit gph +application/vnd.fluxtime.clip ftc +application/vnd.font-fontforge-sfd +application/vnd.framemaker fm frame maker +application/vnd.frogans.fnc fnc +application/vnd.frogans.ltf ltf +application/vnd.fsc.weblaunch fsc +application/vnd.fujitsu.oasys oas +application/vnd.fujitsu.oasys2 oa2 +application/vnd.fujitsu.oasys3 oa3 +application/vnd.fujitsu.oasysgp fg5 +application/vnd.fujitsu.oasysprs bh2 +application/vnd.fujixerox.art-ex +application/vnd.fujixerox.art4 +application/vnd.fujixerox.hbpl +application/vnd.fujixerox.ddd ddd +application/vnd.fujixerox.docuworks xdw +application/vnd.fujixerox.docuworks.binder xbd +application/vnd.fut-misnet +application/vnd.fuzzysheet fzs +application/vnd.genomatix.tuxedo txd +application/vnd.gmx gmx +application/vnd.google-earth.kml+xml kml +application/vnd.google-earth.kmz kmz +application/vnd.grafeq gqf gqs +application/vnd.gridmp +application/vnd.groove-account gac +application/vnd.groove-help ghf +application/vnd.groove-identity-message gim +application/vnd.groove-injector grv +application/vnd.groove-tool-message gtm +application/vnd.groove-tool-template tpl +application/vnd.groove-vcard vcg +application/vnd.handheld-entertainment+xml zmm +application/vnd.hbci hbci +application/vnd.hcl-bireports +application/vnd.hhe.lesson-player les +application/vnd.hp-hpgl hpgl +application/vnd.hp-hpid hpid +application/vnd.hp-hps hps +application/vnd.hp-jlyt jlt +application/vnd.hp-pcl pcl +application/vnd.hp-pclxl pclxl +application/vnd.httphone +application/vnd.hydrostatix.sof-data sfd-hdstx +application/vnd.hzn-3d-crossword x3d +application/vnd.ibm.afplinedata +application/vnd.ibm.electronic-media +application/vnd.ibm.minipay mpy +application/vnd.ibm.modcap afp listafp list3820 +application/vnd.ibm.rights-management irm +application/vnd.ibm.secure-container sc +application/vnd.iccprofile icc icm +application/vnd.igloader igl +application/vnd.immervision-ivp ivp +application/vnd.immervision-ivu ivu +application/vnd.informedcontrol.rms+xml +application/vnd.intercon.formnet xpw xpx +application/vnd.intertrust.digibox +application/vnd.intertrust.nncp +application/vnd.intu.qbo qbo +application/vnd.intu.qfx qfx +application/vnd.iptc.g2.conceptitem+xml +application/vnd.iptc.g2.knowledgeitem+xml +application/vnd.iptc.g2.newsitem+xml +application/vnd.iptc.g2.packageitem+xml +application/vnd.ipunplugged.rcprofile rcprofile +application/vnd.irepository.package+xml irp +application/vnd.is-xpr xpr +application/vnd.jam jam +application/vnd.japannet-directory-service +application/vnd.japannet-jpnstore-wakeup +application/vnd.japannet-payment-wakeup +application/vnd.japannet-registration +application/vnd.japannet-registration-wakeup +application/vnd.japannet-setstore-wakeup +application/vnd.japannet-verification +application/vnd.japannet-verification-wakeup +application/vnd.jcp.javame.midlet-rms rms +application/vnd.jisp jisp +application/vnd.joost.joda-archive joda +application/vnd.kahootz ktz ktr +application/vnd.kde.karbon karbon +application/vnd.kde.kchart chrt +application/vnd.kde.kformula kfo +application/vnd.kde.kivio flw +application/vnd.kde.kontour kon +application/vnd.kde.kpresenter kpr kpt +application/vnd.kde.kspread ksp +application/vnd.kde.kword kwd kwt +application/vnd.kenameaapp htke +application/vnd.kidspiration kia +application/vnd.kinar kne knp +application/vnd.koan skp skd skt skm +application/vnd.kodak-descriptor sse +application/vnd.liberty-request+xml +application/vnd.llamagraphics.life-balance.desktop lbd +application/vnd.llamagraphics.life-balance.exchange+xml lbe +application/vnd.lotus-1-2-3 123 +application/vnd.lotus-approach apr +application/vnd.lotus-freelance pre +application/vnd.lotus-notes nsf +application/vnd.lotus-organizer org +application/vnd.lotus-screencam scm +application/vnd.lotus-wordpro lwp +application/vnd.macports.portpkg portpkg +application/vnd.marlin.drm.actiontoken+xml +application/vnd.marlin.drm.conftoken+xml +application/vnd.marlin.drm.license+xml +application/vnd.marlin.drm.mdcf +application/vnd.mcd mcd +application/vnd.medcalcdata mc1 +application/vnd.mediastation.cdkey cdkey +application/vnd.meridian-slingshot +application/vnd.mfer mwf +application/vnd.mfmp mfm +application/vnd.micrografx.flo flo +application/vnd.micrografx.igx igx +application/vnd.mif mif +application/vnd.minisoft-hp3000-save +application/vnd.mitsubishi.misty-guard.trustweb +application/vnd.mobius.daf daf +application/vnd.mobius.dis dis +application/vnd.mobius.mbk mbk +application/vnd.mobius.mqy mqy +application/vnd.mobius.msl msl +application/vnd.mobius.plc plc +application/vnd.mobius.txf txf +application/vnd.mophun.application mpn +application/vnd.mophun.certificate mpc +application/vnd.motorola.flexsuite +application/vnd.motorola.flexsuite.adsi +application/vnd.motorola.flexsuite.fis +application/vnd.motorola.flexsuite.gotap +application/vnd.motorola.flexsuite.kmr +application/vnd.motorola.flexsuite.ttc +application/vnd.motorola.flexsuite.wem +application/vnd.motorola.iprm +application/vnd.mozilla.xul+xml xul +application/vnd.ms-artgalry cil +application/vnd.ms-asf asf +application/vnd.ms-cab-compressed cab +application/vnd.ms-excel xls xlm xla xlc xlt xlw +application/vnd.ms-fontobject eot +application/vnd.ms-htmlhelp chm +application/vnd.ms-ims ims +application/vnd.ms-lrm lrm +application/vnd.ms-playready.initiator+xml +application/vnd.ms-powerpoint ppt pps pot +application/vnd.ms-project mpp mpt +application/vnd.ms-tnef +application/vnd.ms-wmdrm.lic-chlg-req +application/vnd.ms-wmdrm.lic-resp +application/vnd.ms-wmdrm.meter-chlg-req +application/vnd.ms-wmdrm.meter-resp +application/vnd.ms-works wps wks wcm wdb +application/vnd.ms-wpl wpl +application/vnd.ms-xpsdocument xps +application/vnd.mseq mseq +application/vnd.msign +application/vnd.multiad.creator +application/vnd.multiad.creator.cif +application/vnd.music-niff +application/vnd.musician mus +application/vnd.muvee.style msty +application/vnd.ncd.control +application/vnd.ncd.reference +application/vnd.nervana +application/vnd.netfpx +application/vnd.neurolanguage.nlu nlu +application/vnd.noblenet-directory nnd +application/vnd.noblenet-sealer nns +application/vnd.noblenet-web nnw +application/vnd.nokia.catalogs +application/vnd.nokia.conml+wbxml +application/vnd.nokia.conml+xml +application/vnd.nokia.isds-radio-presets +application/vnd.nokia.iptv.config+xml +application/vnd.nokia.landmark+wbxml +application/vnd.nokia.landmark+xml +application/vnd.nokia.landmarkcollection+xml +application/vnd.nokia.n-gage.ac+xml +application/vnd.nokia.n-gage.data ngdat +application/vnd.nokia.n-gage.symbian.install n-gage +application/vnd.nokia.ncd +application/vnd.nokia.pcd+wbxml +application/vnd.nokia.pcd+xml +application/vnd.nokia.radio-preset rpst +application/vnd.nokia.radio-presets rpss +application/vnd.novadigm.edm edm +application/vnd.novadigm.edx edx +application/vnd.novadigm.ext ext +application/vnd.oasis.opendocument.chart odc +application/vnd.oasis.opendocument.chart-template otc +application/vnd.oasis.opendocument.formula odf +application/vnd.oasis.opendocument.formula-template otf +application/vnd.oasis.opendocument.graphics odg +application/vnd.oasis.opendocument.graphics-template otg +application/vnd.oasis.opendocument.image odi +application/vnd.oasis.opendocument.image-template oti +application/vnd.oasis.opendocument.presentation odp +application/vnd.oasis.opendocument.presentation-template otp +application/vnd.oasis.opendocument.spreadsheet ods +application/vnd.oasis.opendocument.spreadsheet-template ots +application/vnd.oasis.opendocument.text odt +application/vnd.oasis.opendocument.text-master otm +application/vnd.oasis.opendocument.text-template ott +application/vnd.oasis.opendocument.text-web oth +application/vnd.obn +application/vnd.olpc-sugar xo +application/vnd.oma-scws-config +application/vnd.oma-scws-http-request +application/vnd.oma-scws-http-response +application/vnd.oma.bcast.associated-procedure-parameter+xml +application/vnd.oma.bcast.drm-trigger+xml +application/vnd.oma.bcast.imd+xml +application/vnd.oma.bcast.ltkm +application/vnd.oma.bcast.notification+xml +application/vnd.oma.bcast.provisioningtrigger +application/vnd.oma.bcast.sgboot +application/vnd.oma.bcast.sgdd+xml +application/vnd.oma.bcast.sgdu +application/vnd.oma.bcast.simple-symbol-container +application/vnd.oma.bcast.smartcard-trigger+xml +application/vnd.oma.bcast.sprov+xml +application/vnd.oma.bcast.stkm +application/vnd.oma.dcd +application/vnd.oma.dcdc +application/vnd.oma.dd2+xml dd2 +application/vnd.oma.drm.risd+xml +application/vnd.oma.group-usage-list+xml +application/vnd.oma.poc.detailed-progress-report+xml +application/vnd.oma.poc.final-report+xml +application/vnd.oma.poc.groups+xml +application/vnd.oma.poc.invocation-descriptor+xml +application/vnd.oma.poc.optimized-progress-report+xml +application/vnd.oma.xcap-directory+xml +application/vnd.omads-email+xml +application/vnd.omads-file+xml +application/vnd.omads-folder+xml +application/vnd.omaloc-supl-init +application/vnd.openofficeorg.extension oxt +application/vnd.osa.netdeploy +application/vnd.osgi.dp dp +application/vnd.otps.ct-kip+xml +application/vnd.palm prc pdb pqa oprc +application/vnd.paos.xml +application/vnd.pg.format str +application/vnd.pg.osasli ei6 +application/vnd.piaccess.application-licence +application/vnd.picsel efif +application/vnd.poc.group-advertisement+xml +application/vnd.pocketlearn plf +application/vnd.powerbuilder6 pbd +application/vnd.powerbuilder6-s +application/vnd.powerbuilder7 +application/vnd.powerbuilder7-s +application/vnd.powerbuilder75 +application/vnd.powerbuilder75-s +application/vnd.preminet +application/vnd.previewsystems.box box +application/vnd.proteus.magazine mgz +application/vnd.publishare-delta-tree qps +application/vnd.pvi.ptid1 ptid +application/vnd.pwg-multiplexed +application/vnd.pwg-xhtml-print+xml +application/vnd.qualcomm.brew-app-res +application/vnd.quark.quarkxpress qxd qxt qwd qwt qxl qxb +application/vnd.rapid +application/vnd.recordare.musicxml mxl +application/vnd.recordare.musicxml+xml +application/vnd.renlearn.rlprint +application/vnd.rn-realmedia rm +application/vnd.route66.link66+xml link66 +application/vnd.ruckus.download +application/vnd.s3sms +application/vnd.sbm.mid2 +application/vnd.scribus +application/vnd.sealed.3df +application/vnd.sealed.csf +application/vnd.sealed.doc +application/vnd.sealed.eml +application/vnd.sealed.mht +application/vnd.sealed.net +application/vnd.sealed.ppt +application/vnd.sealed.tiff +application/vnd.sealed.xls +application/vnd.sealedmedia.softseal.html +application/vnd.sealedmedia.softseal.pdf +application/vnd.seemail see +application/vnd.sema sema +application/vnd.semd semd +application/vnd.semf semf +application/vnd.shana.informed.formdata ifm +application/vnd.shana.informed.formtemplate itp +application/vnd.shana.informed.interchange iif +application/vnd.shana.informed.package ipk +application/vnd.simtech-mindmapper twd twds +application/vnd.smaf mmf +application/vnd.software602.filler.form+xml +application/vnd.software602.filler.form-xml-zip +application/vnd.solent.sdkm+xml sdkm sdkd +application/vnd.spotfire.dxp dxp +application/vnd.spotfire.sfs sfs +application/vnd.sss-cod +application/vnd.sss-dtf +application/vnd.sss-ntf +application/vnd.street-stream +application/vnd.sun.wadl+xml +application/vnd.sus-calendar sus susp +application/vnd.svd svd +application/vnd.swiftview-ics +application/vnd.syncml+xml xsm +application/vnd.syncml.dm+wbxml bdm +application/vnd.syncml.dm+xml xdm +application/vnd.syncml.ds.notification +application/vnd.tao.intent-module-archive tao +application/vnd.tmobile-livetv tmo +application/vnd.trid.tpt tpt +application/vnd.triscape.mxs mxs +application/vnd.trueapp tra +application/vnd.truedoc +application/vnd.ufdl ufd ufdl +application/vnd.uiq.theme utz +application/vnd.umajin umj +application/vnd.unity unityweb +application/vnd.uoml+xml uoml +application/vnd.uplanet.alert +application/vnd.uplanet.alert-wbxml +application/vnd.uplanet.bearer-choice +application/vnd.uplanet.bearer-choice-wbxml +application/vnd.uplanet.cacheop +application/vnd.uplanet.cacheop-wbxml +application/vnd.uplanet.channel +application/vnd.uplanet.channel-wbxml +application/vnd.uplanet.list +application/vnd.uplanet.list-wbxml +application/vnd.uplanet.listcmd +application/vnd.uplanet.listcmd-wbxml +application/vnd.uplanet.signal +application/vnd.vcx vcx +application/vnd.vd-study +application/vnd.vectorworks +application/vnd.vidsoft.vidconference +application/vnd.visio vsd vst vss vsw +application/vnd.visionary vis +application/vnd.vividence.scriptfile +application/vnd.vsf vsf +application/vnd.wap.sic +application/vnd.wap.slc +application/vnd.wap.wbxml wbxml +application/vnd.wap.wmlc wmlc +application/vnd.wap.wmlscriptc wmlsc +application/vnd.webturbo wtb +application/vnd.wfa.wsc +application/vnd.wmc +application/vnd.wmf.bootstrap +application/vnd.wordperfect wpd +application/vnd.wqd wqd +application/vnd.wrq-hp3000-labelled +application/vnd.wt.stf stf +application/vnd.wv.csp+wbxml +application/vnd.wv.csp+xml +application/vnd.wv.ssp+xml +application/vnd.xara xar +application/vnd.xfdl xfdl +application/vnd.xmi+xml +application/vnd.xmpie.cpkg +application/vnd.xmpie.dpkg +application/vnd.xmpie.plan +application/vnd.xmpie.ppkg +application/vnd.xmpie.xlim +application/vnd.yamaha.hv-dic hvd +application/vnd.yamaha.hv-script hvs +application/vnd.yamaha.hv-voice hvp +application/vnd.yamaha.smaf-audio saf +application/vnd.yamaha.smaf-phrase spf +application/vnd.yellowriver-custom-menu cmp +application/vnd.zzazz.deck+xml zaz +application/voicexml+xml vxml +application/watcherinfo+xml +application/whoispp-query +application/whoispp-response +application/winhlp hlp +application/wita +application/wordperfect5.1 +application/wsdl+xml wsdl +application/wspolicy+xml wspolicy +application/x-ace-compressed ace +application/x-bcpio bcpio +application/x-bittorrent torrent +application/x-bzip bz +application/x-bzip2 bz2 boz +application/x-cdlink vcd +application/x-chat chat +application/x-chess-pgn pgn +application/x-compress +application/x-cpio cpio +application/x-csh csh +application/x-director dcr dir dxr fgd +application/x-dvi dvi +application/x-futuresplash spl +application/x-gtar gtar +application/x-gzip +application/x-hdf hdf +application/x-latex latex +application/x-ms-wmd wmd +application/x-ms-wmz wmz +application/x-msaccess mdb +application/x-msbinder obd +application/x-mscardfile crd +application/x-msclip clp +application/x-msdownload exe dll com bat msi +application/x-msmediaview mvb m13 m14 +application/x-msmetafile wmf +application/x-msmoney mny +application/x-mspublisher pub +application/x-msschedule scd +application/x-msterminal trm +application/x-mswrite wri +application/x-netcdf nc cdf +application/x-pkcs12 p12 pfx +application/x-pkcs7-certificates p7b spc +application/x-pkcs7-certreqresp p7r +application/x-rar-compressed rar +application/x-sh sh +application/x-shar shar +application/x-shockwave-flash swf +application/x-stuffit sit +application/x-stuffitx sitx +application/x-sv4cpio sv4cpio +application/x-sv4crc sv4crc +application/x-tar tar +application/x-tcl tcl +application/x-tex tex +application/x-texinfo texinfo texi +application/x-ustar ustar +application/x-wais-source src +application/x-x509-ca-cert der crt +application/x400-bp +application/xcap-att+xml +application/xcap-caps+xml +application/xcap-el+xml +application/xcap-error+xml +application/xcap-ns+xml +application/xenc+xml xenc +application/xhtml+xml xhtml xht +application/xml xml xsl +application/xml-dtd dtd +application/xml-external-parsed-entity +application/xmpp+xml +application/xop+xml xop +application/xslt+xml xslt +application/xspf+xml xspf +application/xv+xml mxml xhvml xvml xvm +application/zip zip +audio/32kadpcm +audio/3gpp +audio/3gpp2 +audio/ac3 +audio/amr +audio/amr-wb +audio/amr-wb+ +audio/asc +audio/basic au snd +audio/bv16 +audio/bv32 +audio/clearmode +audio/cn +audio/dat12 +audio/dls +audio/dsr-es201108 +audio/dsr-es202050 +audio/dsr-es202211 +audio/dsr-es202212 +audio/dvi4 +audio/eac3 +audio/evrc +audio/evrc-qcp +audio/evrc0 +audio/evrc1 +audio/evrcb +audio/evrcb0 +audio/evrcb1 +audio/evrcwb +audio/evrcwb0 +audio/evrcwb1 +audio/g722 +audio/g7221 +audio/g723 +audio/g726-16 +audio/g726-24 +audio/g726-32 +audio/g726-40 +audio/g728 +audio/g729 +audio/g7291 +audio/g729d +audio/g729e +audio/gsm +audio/gsm-efr +audio/ilbc +audio/l16 +audio/l20 +audio/l24 +audio/l8 +audio/lpc +audio/midi mid midi kar rmi +audio/mobile-xmf +audio/mp4 mp4a +audio/mp4a-latm +audio/mpa +audio/mpa-robust +audio/mpeg mpga mp2 mp2a mp3 m2a m3a +audio/mpeg4-generic +audio/ogg oga ogg spx +audio/parityfec +audio/pcma +audio/pcmu +audio/prs.sid +audio/qcelp +audio/red +audio/rtp-enc-aescm128 +audio/rtp-midi +audio/rtx +audio/smv +audio/smv0 +audio/smv-qcp +audio/sp-midi +audio/t140c +audio/t38 +audio/telephone-event +audio/tone +audio/ulpfec +audio/vdvi +audio/vmr-wb +audio/vnd.3gpp.iufp +audio/vnd.4sb +audio/vnd.audiokoz +audio/vnd.celp +audio/vnd.cisco.nse +audio/vnd.cmles.radio-events +audio/vnd.cns.anp1 +audio/vnd.cns.inf1 +audio/vnd.digital-winds eol +audio/vnd.dlna.adts +audio/vnd.dolby.mlp +audio/vnd.dts dts +audio/vnd.dts.hd dtshd +audio/vnd.everad.plj +audio/vnd.hns.audio +audio/vnd.lucent.voice lvp +audio/vnd.ms-playready.media.pya pya +audio/vnd.nokia.mobile-xmf +audio/vnd.nortel.vbk +audio/vnd.nuera.ecelp4800 ecelp4800 +audio/vnd.nuera.ecelp7470 ecelp7470 +audio/vnd.nuera.ecelp9600 ecelp9600 +audio/vnd.octel.sbc +audio/vnd.qcelp +audio/vnd.rhetorex.32kadpcm +audio/vnd.sealedmedia.softseal.mpeg +audio/vnd.vmx.cvsd +audio/vorbis +audio/vorbis-config +audio/wav wav +audio/x-aiff aif aiff aifc +audio/x-mpegurl m3u +audio/x-ms-wax wax +audio/x-ms-wma wma +audio/x-pn-realaudio ram ra +audio/x-pn-realaudio-plugin rmp +audio/x-wav wav +chemical/x-cdx cdx +chemical/x-cif cif +chemical/x-cmdf cmdf +chemical/x-cml cml +chemical/x-csml csml +chemical/x-pdb pdb +chemical/x-xyz xyz +image/bmp bmp +image/cgm cgm +image/fits +image/g3fax g3 +image/gif gif +image/ief ief +image/jp2 +image/jpeg jpeg jpg jpe +image/jpm +image/jpx +image/naplps +image/png png +image/prs.btif btif +image/prs.pti +image/svg+xml svg svgz +image/t38 +image/tiff tiff tif +image/tiff-fx +image/vnd.adobe.photoshop psd +image/vnd.cns.inf2 +image/vnd.djvu djvu djv +image/vnd.dwg dwg +image/vnd.dxf dxf +image/vnd.fastbidsheet fbs +image/vnd.fpx fpx +image/vnd.fst fst +image/vnd.fujixerox.edmics-mmr mmr +image/vnd.fujixerox.edmics-rlc rlc +image/vnd.globalgraphics.pgb +image/vnd.microsoft.icon +image/vnd.mix +image/vnd.ms-modi mdi +image/vnd.net-fpx npx +image/vnd.sealed.png +image/vnd.sealedmedia.softseal.gif +image/vnd.sealedmedia.softseal.jpg +image/vnd.svf +image/vnd.wap.wbmp wbmp +image/vnd.xiff xif +image/x-cmu-raster ras +image/x-cmx cmx +image/x-icon ico +image/x-pcx pcx +image/x-pict pic pct +image/x-portable-anymap pnm +image/x-portable-bitmap pbm +image/x-portable-graymap pgm +image/x-portable-pixmap ppm +image/x-rgb rgb +image/x-xbitmap xbm +image/x-xpixmap xpm +image/x-xwindowdump xwd +message/cpim +message/delivery-status +message/disposition-notification +message/external-body +message/global +message/global-delivery-status +message/global-disposition-notification +message/global-headers +message/http +message/news +message/partial +message/rfc822 eml mime +message/s-http +message/sip +message/sipfrag +message/tracking-status +message/vnd.si.simp +model/iges igs iges +model/mesh msh mesh silo +model/vnd.dwf dwf +model/vnd.flatland.3dml +model/vnd.gdl gdl +model/vnd.gs.gdl +model/vnd.gtw gtw +model/vnd.moml+xml +model/vnd.mts mts +model/vnd.parasolid.transmit.binary +model/vnd.parasolid.transmit.text +model/vnd.vtu vtu +model/vrml wrl vrml +multipart/alternative +multipart/appledouble +multipart/byteranges +multipart/digest +multipart/encrypted +multipart/form-data +multipart/header-set +multipart/mixed +multipart/parallel +multipart/related +multipart/report +multipart/signed +multipart/voice-message +text/calendar ics ifb +text/css css +text/csv csv +text/directory +text/dns +text/enriched +text/html html htm +text/parityfec +text/plain txt text conf def list log in +text/prs.fallenstein.rst +text/prs.lines.tag dsc +text/red +text/rfc822-headers +text/richtext rtx +text/rtf +text/rtp-enc-aescm128 +text/rtx +text/sgml sgml sgm +text/t140 +text/tab-separated-values tsv +text/troff t tr roff man me ms +text/ulpfec +text/uri-list uri uris urls +text/vnd.abc +text/vnd.curl +text/vnd.dmclientscript +text/vnd.esmertec.theme-descriptor +text/vnd.fly fly +text/vnd.fmi.flexstor flx +text/vnd.graphviz gv +text/vnd.in3d.3dml 3dml +text/vnd.in3d.spot spot +text/vnd.iptc.newsml +text/vnd.iptc.nitf +text/vnd.latex-z +text/vnd.motorola.reflex +text/vnd.ms-mediapackage +text/vnd.net2phone.commcenter.command +text/vnd.si.uricatalogue +text/vnd.sun.j2me.app-descriptor jad +text/vnd.trolltech.linguist +text/vnd.wap.si +text/vnd.wap.sl +text/vnd.wap.wml wml +text/vnd.wap.wmlscript wmls +text/x-asm s asm +text/x-c c cc cxx cpp h hh dic +text/x-fortran f for f77 f90 +text/x-pascal p pas +text/x-java-source java +text/x-setext etx +text/x-uuencode uu +text/x-vcalendar vcs +text/x-vcard vcf +text/xml +text/xml-external-parsed-entity +video/3gpp 3gp +video/3gpp-tt +video/3gpp2 3g2 +video/bmpeg +video/bt656 +video/celb +video/dv +video/h261 h261 +video/h263 h263 +video/h263-1998 +video/h263-2000 +video/h264 h264 +video/jpeg jpgv +video/jpeg2000 +video/jpm jpm jpgm +video/mj2 mj2 mjp2 +video/mp1s +video/mp2p +video/mp2t +video/mp4 mp4 mp4v mpg4 +video/mp4v-es +video/mpeg mpeg mpg mpe m1v m2v +video/mpeg4-generic +video/mpv +video/nv +video/ogg ogv +video/parityfec +video/pointer +video/quicktime qt mov +video/raw +video/rtp-enc-aescm128 +video/rtx +video/smpte292m +video/ulpfec +video/vc1 +video/vnd.cctv +video/vnd.dlna.mpeg-tts +video/vnd.fvt fvt +video/vnd.hns.video +video/vnd.iptvforum.1dparityfec-1010 +video/vnd.iptvforum.1dparityfec-2005 +video/vnd.iptvforum.2dparityfec-1010 +video/vnd.iptvforum.2dparityfec-2005 +video/vnd.iptvforum.ttsavc +video/vnd.iptvforum.ttsmpeg2 +video/vnd.motorola.video +video/vnd.motorola.videop +video/vnd.mpegurl mxu m4u +video/vnd.ms-playready.media.pyv pyv +video/vnd.nokia.interleaved-multimedia +video/vnd.nokia.videovoip +video/vnd.objectvideo +video/vnd.sealed.mpeg1 +video/vnd.sealed.mpeg4 +video/vnd.sealed.swf +video/vnd.sealedmedia.softseal.mov +video/vnd.vivo viv +video/x-fli fli +video/x-ms-asf asf asx +video/x-ms-wm wm +video/x-ms-wmv wmv +video/x-ms-wmx wmx +video/x-ms-wvx wvx +video/x-msvideo avi +video/x-sgi-movie movie +x-conference/x-cooltalk ice diff --git a/esua-epdc/docker-compose/jinshui/node04/fastdfs/conf/mod_fastdfs.conf b/esua-epdc/docker-compose/jinshui/node04/fastdfs/conf/mod_fastdfs.conf new file mode 100644 index 000000000..9f989bf40 --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node04/fastdfs/conf/mod_fastdfs.conf @@ -0,0 +1,134 @@ +# connect timeout in seconds +# default value is 30s +connect_timeout=2 + +# network recv and send timeout in seconds +# default value is 30s +network_timeout=30 + +# the base path to store log files +base_path=/tmp + +# if load FastDFS parameters from tracker server +# since V1.12 +# default value is false +load_fdfs_parameters_from_tracker=true + +# storage sync file max delay seconds +# same as tracker.conf +# valid only when load_fdfs_parameters_from_tracker is false +# since V1.12 +# default value is 86400 seconds (one day) +storage_sync_file_max_delay = 86400 + +# if use storage ID instead of IP address +# same as tracker.conf +# valid only when load_fdfs_parameters_from_tracker is false +# default value is false +# since V1.13 +use_storage_id = false + +# specify storage ids filename, can use relative or absolute path +# same as tracker.conf +# valid only when load_fdfs_parameters_from_tracker is false +# since V1.13 +storage_ids_filename = storage_ids.conf + +# FastDFS tracker_server can ocur more than once, and tracker_server format is +# "host:port", host can be hostname or ip address +# valid only when load_fdfs_parameters_from_tracker is true +tracker_server=172.19.0.30:22122 +tracker_server=172.20.0.30:22122 + +# the port of the local storage server +# the default value is 23000 +storage_server_port=23000 + +# the group name of the local storage server +group_name=group1 + +# if the url / uri including the group name +# set to false when uri like /M00/00/00/xxx +# set to true when uri like ${group_name}/M00/00/00/xxx, such as group1/M00/xxx +# default value is false +url_have_group_name = true + +# path(disk or mount point) count, default value is 1 +# must same as storage.conf +store_path_count=1 + +# store_path#, based 0, if store_path0 not exists, it's value is base_path +# the paths must be exist +# must same as storage.conf +store_path0=/home/dfs +#store_path1=/home/yuqing/fastdfs1 + +# standard log level as syslog, case insensitive, value list: +### emerg for emergency +### alert +### crit for critical +### error +### warn for warning +### notice +### info +### debug +log_level=info + +# set the log filename, such as /usr/local/apache2/logs/mod_fastdfs.log +# empty for output to stderr (apache and nginx error_log file) +log_filename= + +# response mode when the file not exist in the local file system +## proxy: get the content from other storage server, then send to client +## redirect: redirect to the original storage server (HTTP Header is Location) +response_mode=proxy + +# the NIC alias prefix, such as eth in Linux, you can see it by ifconfig -a +# multi aliases split by comma. empty value means auto set by OS type +# this paramter used to get all ip address of the local host +# default values is empty +if_alias_prefix= + +# use "#include" directive to include HTTP config file +# NOTE: #include is an include directive, do NOT remove the # before include +#include http.conf + + +# if support flv +# default value is false +# since v1.15 +flv_support = true + +# flv file extension name +# default value is flv +# since v1.15 +flv_extension = flv + + +# set the group count +# set to none zero to support multi-group on this storage server +# set to 0 for single group only +# groups settings section as [group1], [group2], ..., [groupN] +# default value is 0 +# since v1.14 +group_count = 0 + +# group settings for group #1 +# since v1.14 +# when support multi-group on this storage server, uncomment following section +#[group1] +#group_name=group1 +#storage_server_port=23000 +#store_path_count=2 +#store_path0=/home/yuqing/fastdfs +#store_path1=/home/yuqing/fastdfs1 + +# group settings for group #2 +# since v1.14 +# when support multi-group, uncomment following section as neccessary +#[group2] +#group_name=group2 +#storage_server_port=23000 +#store_path_count=1 +#store_path0=/home/yuqing/fastdfs + diff --git a/esua-epdc/docker-compose/jinshui/node04/fastdfs/conf/nginx.conf b/esua-epdc/docker-compose/jinshui/node04/fastdfs/conf/nginx.conf new file mode 100644 index 000000000..62b5d0bf2 --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node04/fastdfs/conf/nginx.conf @@ -0,0 +1,127 @@ + +#user nobody; +worker_processes 1; + +#error_log logs/error.log; +#error_log logs/error.log notice; +#error_log logs/error.log info; + +#pid logs/nginx.pid; + + +events { + worker_connections 1024; +} + + +http { + include mime.types; + default_type application/octet-stream; + + #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + # '$status $body_bytes_sent "$http_referer" ' + # '"$http_user_agent" "$http_x_forwarded_for"'; + + #access_log logs/access.log main; + + sendfile on; + #tcp_nopush on; + + #keepalive_timeout 0; + keepalive_timeout 65; + + #gzip on; + + server { + listen 80; + server_name localhost; + + #charset koi8-r; + + #access_log logs/host.access.log main; + + location / { + root html; + index index.html index.htm; + } + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root html; + } + + # proxy the PHP scripts to Apache listening on 127.0.0.1:80 + # + #location ~ \.php$ { + # proxy_pass http://127.0.0.1; + #} + + # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 + # + #location ~ \.php$ { + # root html; + # fastcgi_pass 127.0.0.1:9000; + # fastcgi_index index.php; + # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; + # include fastcgi_params; + #} + + # deny access to .htaccess files, if Apache's document root + # concurs with nginx's one + # + #location ~ /\.ht { + # deny all; + #} + } + server { + listen 8888; + server_name localhost; + location ~/group[0-9]/ { + ngx_fastdfs_module; + } + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root html; + } + } + + # another virtual host using mix of IP-, name-, and port-based configuration + # + #server { + # listen 8000; + # listen somename:8080; + # server_name somename alias another.alias; + + # location / { + # root html; + # index index.html index.htm; + # } + #} + + + # HTTPS server + # + #server { + # listen 443 ssl; + # server_name localhost; + + # ssl_certificate cert.pem; + # ssl_certificate_key cert.key; + + # ssl_session_cache shared:SSL:1m; + # ssl_session_timeout 5m; + + # ssl_ciphers HIGH:!aNULL:!MD5; + # ssl_prefer_server_ciphers on; + + # location / { + # root html; + # index index.html index.htm; + # } + #} + +} diff --git a/esua-epdc/docker-compose/jinshui/node04/fastdfs/conf/storage.conf b/esua-epdc/docker-compose/jinshui/node04/fastdfs/conf/storage.conf new file mode 100644 index 000000000..58686b8bb --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node04/fastdfs/conf/storage.conf @@ -0,0 +1,287 @@ +# is this config file disabled +# false for enabled +# true for disabled +disabled=false + +# the name of the group this storage server belongs to +# +# comment or remove this item for fetching from tracker server, +# in this case, use_storage_id must set to true in tracker.conf, +# and storage_ids.conf must be configed correctly. +group_name=epdcFile + +# bind an address of this host +# empty for bind all addresses of this host +bind_addr= + +# if bind an address of this host when connect to other servers +# (this storage server as a client) +# true for binding the address configed by above parameter: "bind_addr" +# false for binding any address of this host +client_bind=true + +# the storage server port +port=23000 + +# connect timeout in seconds +# default value is 30s +connect_timeout=10 + +# network timeout in seconds +# default value is 30s +network_timeout=60 + +# heart beat interval in seconds +heart_beat_interval=30 + +# disk usage report interval in seconds +stat_report_interval=60 + +# the base path to store data and log files +base_path=/home/dfs + +# max concurrent connections the server supported +# default value is 256 +# more max_connections means more memory will be used +# you should set this parameter larger, eg. 10240 +max_connections=1024 + +# the buff size to recv / send data +# this parameter must more than 8KB +# default value is 64KB +# since V2.00 +buff_size = 256KB + +# accept thread count +# default value is 1 +# since V4.07 +accept_threads=1 + +# work thread count, should <= max_connections +# work thread deal network io +# default value is 4 +# since V2.00 +work_threads=4 + +# if disk read / write separated +## false for mixed read and write +## true for separated read and write +# default value is true +# since V2.00 +disk_rw_separated = true + +# disk reader thread count per store base path +# for mixed read / write, this parameter can be 0 +# default value is 1 +# since V2.00 +disk_reader_threads = 1 + +# disk writer thread count per store base path +# for mixed read / write, this parameter can be 0 +# default value is 1 +# since V2.00 +disk_writer_threads = 1 + +# when no entry to sync, try read binlog again after X milliseconds +# must > 0, default value is 200ms +sync_wait_msec=50 + +# after sync a file, usleep milliseconds +# 0 for sync successively (never call usleep) +sync_interval=0 + +# storage sync start time of a day, time format: Hour:Minute +# Hour from 0 to 23, Minute from 0 to 59 +sync_start_time=00:00 + +# storage sync end time of a day, time format: Hour:Minute +# Hour from 0 to 23, Minute from 0 to 59 +sync_end_time=23:59 + +# write to the mark file after sync N files +# default value is 500 +write_mark_file_freq=500 + +# path(disk or mount point) count, default value is 1 +store_path_count=1 + +# store_path#, based 0, if store_path0 not exists, it's value is base_path +# the paths must be exist +store_path0=/home/dfs +#store_path1=/home/dfs2 + +# subdir_count * subdir_count directories will be auto created under each +# store_path (disk), value can be 1 to 256, default value is 256 +subdir_count_per_path=256 + +# tracker_server can ocur more than once, and tracker_server format is +# "host:port", host can be hostname or ip address +tracker_server=172.19.0.30:22122 +tracker_server=172.20.0.30:22122 + +#standard log level as syslog, case insensitive, value list: +### emerg for emergency +### alert +### crit for critical +### error +### warn for warning +### notice +### info +### debug +log_level=info + +#unix group name to run this program, +#not set (empty) means run by the group of current user +run_by_group= + +#unix username to run this program, +#not set (empty) means run by current user +run_by_user= + +# allow_hosts can ocur more than once, host can be hostname or ip address, +# "*" (only one asterisk) means match all ip addresses +# we can use CIDR ips like 192.168.5.64/26 +# and also use range like these: 10.0.1.[0-254] and host[01-08,20-25].domain.com +# for example: +# allow_hosts=10.0.1.[1-15,20] +# allow_hosts=host[01-08,20-25].domain.com +# allow_hosts=192.168.5.64/26 +allow_hosts=* + +# the mode of the files distributed to the data path +# 0: round robin(default) +# 1: random, distributted by hash code +file_distribute_path_mode=0 + +# valid when file_distribute_to_path is set to 0 (round robin), +# when the written file count reaches this number, then rotate to next path +# default value is 100 +file_distribute_rotate_count=100 + +# call fsync to disk when write big file +# 0: never call fsync +# other: call fsync when written bytes >= this bytes +# default value is 0 (never call fsync) +fsync_after_written_bytes=0 + +# sync log buff to disk every interval seconds +# must > 0, default value is 10 seconds +sync_log_buff_interval=10 + +# sync binlog buff / cache to disk every interval seconds +# default value is 60 seconds +sync_binlog_buff_interval=10 + +# sync storage stat info to disk every interval seconds +# default value is 300 seconds +sync_stat_file_interval=300 + +# thread stack size, should >= 512KB +# default value is 512KB +thread_stack_size=512KB + +# the priority as a source server for uploading file. +# the lower this value, the higher its uploading priority. +# default value is 10 +upload_priority=10 + +# the NIC alias prefix, such as eth in Linux, you can see it by ifconfig -a +# multi aliases split by comma. empty value means auto set by OS type +# default values is empty +if_alias_prefix= + +# if check file duplicate, when set to true, use FastDHT to store file indexes +# 1 or yes: need check +# 0 or no: do not check +# default value is 0 +check_file_duplicate=0 + +# file signature method for check file duplicate +## hash: four 32 bits hash code +## md5: MD5 signature +# default value is hash +# since V4.01 +file_signature_method=hash + +# namespace for storing file indexes (key-value pairs) +# this item must be set when check_file_duplicate is true / on +key_namespace=FastDFS + +# set keep_alive to 1 to enable persistent connection with FastDHT servers +# default value is 0 (short connection) +keep_alive=0 + +# you can use "#include filename" (not include double quotes) directive to +# load FastDHT server list, when the filename is a relative path such as +# pure filename, the base path is the base path of current/this config file. +# must set FastDHT server list when check_file_duplicate is true / on +# please see INSTALL of FastDHT for detail +##include /home/yuqing/fastdht/conf/fdht_servers.conf + +# if log to access log +# default value is false +# since V4.00 +use_access_log = false + +# if rotate the access log every day +# default value is false +# since V4.00 +rotate_access_log = false + +# rotate access log time base, time format: Hour:Minute +# Hour from 0 to 23, Minute from 0 to 59 +# default value is 00:00 +# since V4.00 +access_log_rotate_time=00:00 + +# if rotate the error log every day +# default value is false +# since V4.02 +rotate_error_log = false + +# rotate error log time base, time format: Hour:Minute +# Hour from 0 to 23, Minute from 0 to 59 +# default value is 00:00 +# since V4.02 +error_log_rotate_time=00:00 + +# rotate access log when the log file exceeds this size +# 0 means never rotates log file by log file size +# default value is 0 +# since V4.02 +rotate_access_log_size = 0 + +# rotate error log when the log file exceeds this size +# 0 means never rotates log file by log file size +# default value is 0 +# since V4.02 +rotate_error_log_size = 0 + +# keep days of the log files +# 0 means do not delete old log files +# default value is 0 +log_file_keep_days = 0 + +# if skip the invalid record when sync file +# default value is false +# since V4.02 +file_sync_skip_invalid_record=false + +# if use connection pool +# default value is false +# since V4.05 +use_connection_pool = false + +# connections whose the idle time exceeds this time will be closed +# unit: second +# default value is 3600 +# since V4.05 +connection_pool_max_idle_time = 3600 + +# use the ip address of this storage server if domain_name is empty, +# else this domain name will ocur in the url redirected by the tracker server +http.domain_name= + +# the port of the web server on this storage server +http.server_port=8888 + diff --git a/esua-epdc/docker-compose/jinshui/node04/fastdfs/conf/tracker.conf b/esua-epdc/docker-compose/jinshui/node04/fastdfs/conf/tracker.conf new file mode 100644 index 000000000..22e191560 --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node04/fastdfs/conf/tracker.conf @@ -0,0 +1,278 @@ +# is this config file disabled +# false for enabled +# true for disabled +disabled=false + +# bind an address of this host +# empty for bind all addresses of this host +bind_addr= + +# the tracker server port +port=22122 + +# connect timeout in seconds +# default value is 30s +connect_timeout=10 + +# network timeout in seconds +# default value is 30s +network_timeout=60 + +# the base path to store data and log files +base_path=/home/dfs + +# max concurrent connections this server supported +# you should set this parameter larger, eg. 102400 +max_connections=1024 + +# accept thread count +# default value is 1 +# since V4.07 +accept_threads=1 + +# work thread count, should <= max_connections +# default value is 4 +# since V2.00 +work_threads=4 + +# min buff size +# default value 8KB +min_buff_size = 8KB + +# max buff size +# default value 128KB +max_buff_size = 128KB + +# the method of selecting group to upload files +# 0: round robin +# 1: specify group +# 2: load balance, select the max free space group to upload file +store_lookup=2 + +# which group to upload file +# when store_lookup set to 1, must set store_group to the group name +store_group=group2 + +# which storage server to upload file +# 0: round robin (default) +# 1: the first server order by ip address +# 2: the first server order by priority (the minimal) +# Note: if use_trunk_file set to true, must set store_server to 1 or 2 +store_server=0 + +# which path(means disk or mount point) of the storage server to upload file +# 0: round robin +# 2: load balance, select the max free space path to upload file +store_path=0 + +# which storage server to download file +# 0: round robin (default) +# 1: the source storage server which the current file uploaded to +download_server=0 + +# reserved storage space for system or other applications. +# if the free(available) space of any stoarge server in +# a group <= reserved_storage_space, +# no file can be uploaded to this group. +# bytes unit can be one of follows: +### G or g for gigabyte(GB) +### M or m for megabyte(MB) +### K or k for kilobyte(KB) +### no unit for byte(B) +### XX.XX% as ratio such as reserved_storage_space = 10% +reserved_storage_space = 1% + +#standard log level as syslog, case insensitive, value list: +### emerg for emergency +### alert +### crit for critical +### error +### warn for warning +### notice +### info +### debug +log_level=info + +#unix group name to run this program, +#not set (empty) means run by the group of current user +run_by_group= + +#unix username to run this program, +#not set (empty) means run by current user +run_by_user= + +# allow_hosts can ocur more than once, host can be hostname or ip address, +# "*" (only one asterisk) means match all ip addresses +# we can use CIDR ips like 192.168.5.64/26 +# and also use range like these: 10.0.1.[0-254] and host[01-08,20-25].domain.com +# for example: +# allow_hosts=10.0.1.[1-15,20] +# allow_hosts=host[01-08,20-25].domain.com +# allow_hosts=192.168.5.64/26 +allow_hosts=* + +# sync log buff to disk every interval seconds +# default value is 10 seconds +sync_log_buff_interval = 10 + +# check storage server alive interval seconds +check_active_interval = 120 + +# thread stack size, should >= 64KB +# default value is 64KB +thread_stack_size = 64KB + +# auto adjust when the ip address of the storage server changed +# default value is true +storage_ip_changed_auto_adjust = true + +# storage sync file max delay seconds +# default value is 86400 seconds (one day) +# since V2.00 +storage_sync_file_max_delay = 86400 + +# the max time of storage sync a file +# default value is 300 seconds +# since V2.00 +storage_sync_file_max_time = 300 + +# if use a trunk file to store several small files +# default value is false +# since V3.00 +use_trunk_file = false + +# the min slot size, should <= 4KB +# default value is 256 bytes +# since V3.00 +slot_min_size = 256 + +# the max slot size, should > slot_min_size +# store the upload file to trunk file when it's size <= this value +# default value is 16MB +# since V3.00 +slot_max_size = 16MB + +# the trunk file size, should >= 4MB +# default value is 64MB +# since V3.00 +trunk_file_size = 64MB + +# if create trunk file advancely +# default value is false +# since V3.06 +trunk_create_file_advance = false + +# the time base to create trunk file +# the time format: HH:MM +# default value is 02:00 +# since V3.06 +trunk_create_file_time_base = 02:00 + +# the interval of create trunk file, unit: second +# default value is 38400 (one day) +# since V3.06 +trunk_create_file_interval = 86400 + +# the threshold to create trunk file +# when the free trunk file size less than the threshold, will create +# the trunk files +# default value is 0 +# since V3.06 +trunk_create_file_space_threshold = 20G + +# if check trunk space occupying when loading trunk free spaces +# the occupied spaces will be ignored +# default value is false +# since V3.09 +# NOTICE: set this parameter to true will slow the loading of trunk spaces +# when startup. you should set this parameter to true when neccessary. +trunk_init_check_occupying = false + +# if ignore storage_trunk.dat, reload from trunk binlog +# default value is false +# since V3.10 +# set to true once for version upgrade when your version less than V3.10 +trunk_init_reload_from_binlog = false + +# the min interval for compressing the trunk binlog file +# unit: second +# default value is 0, 0 means never compress +# FastDFS compress the trunk binlog when trunk init and trunk destroy +# recommand to set this parameter to 86400 (one day) +# since V5.01 +trunk_compress_binlog_min_interval = 0 + +# if use storage ID instead of IP address +# default value is false +# since V4.00 +use_storage_id = false + +# specify storage ids filename, can use relative or absolute path +# since V4.00 +storage_ids_filename = storage_ids.conf + +# id type of the storage server in the filename, values are: +## ip: the ip address of the storage server +## id: the server id of the storage server +# this paramter is valid only when use_storage_id set to true +# default value is ip +# since V4.03 +id_type_in_filename = ip + +# if store slave file use symbol link +# default value is false +# since V4.01 +store_slave_file_use_link = false + +# if rotate the error log every day +# default value is false +# since V4.02 +rotate_error_log = false + +# rotate error log time base, time format: Hour:Minute +# Hour from 0 to 23, Minute from 0 to 59 +# default value is 00:00 +# since V4.02 +error_log_rotate_time=00:00 + +# rotate error log when the log file exceeds this size +# 0 means never rotates log file by log file size +# default value is 0 +# since V4.02 +rotate_error_log_size = 0 + +# keep days of the log files +# 0 means do not delete old log files +# default value is 0 +log_file_keep_days = 0 + +# if use connection pool +# default value is false +# since V4.05 +use_connection_pool = false + +# connections whose the idle time exceeds this time will be closed +# unit: second +# default value is 3600 +# since V4.05 +connection_pool_max_idle_time = 3600 + +# HTTP port on this tracker server +http.server_port=8080 + +# check storage HTTP server alive interval seconds +# <= 0 for never check +# default value is 30 +http.check_alive_interval=30 + +# check storage HTTP server alive type, values are: +# tcp : connect to the storge server with HTTP port only, +# do not request and get response +# http: storage check alive url must return http status 200 +# default value is tcp +http.check_alive_type=tcp + +# check storage HTTP server alive uri/url +# NOTE: storage embed HTTP server support uri: /status.html +http.check_alive_uri=/status.html + diff --git a/esua-epdc/docker-compose/jinshui/node04/fastdfs/fastdfs.sh b/esua-epdc/docker-compose/jinshui/node04/fastdfs/fastdfs.sh new file mode 100644 index 000000000..7234b8c05 --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node04/fastdfs/fastdfs.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +new_val=$FASTDFS_IPADDR +old="com.ikingtech.ch116221" + +sed -i "s/$old/$new_val/g" /etc/fdfs/client.conf +sed -i "s/$old/$new_val/g" /etc/fdfs/storage.conf +sed -i "s/$old/$new_val/g" /etc/fdfs/mod_fastdfs.conf + +cat /etc/fdfs/client.conf > /etc/fdfs/client.txt +cat /etc/fdfs/storage.conf > /etc/fdfs/storage.txt +cat /etc/fdfs/mod_fastdfs.conf > /etc/fdfs/mod_fastdfs.txt + +mv /usr/local/nginx/conf/nginx.conf /usr/local/nginx/conf/nginx.conf.t +cp /etc/fdfs/nginx.conf /usr/local/nginx/conf + +echo "start trackerd" +/etc/init.d/fdfs_trackerd start + +echo "start storage" +/etc/init.d/fdfs_storaged start + +echo "start nginx" +/usr/local/nginx/sbin/nginx + +tail -f /dev/null \ No newline at end of file diff --git a/esua-epdc/docker-compose/jinshui/node04/fastdfs/nginx/docker-compose.yml b/esua-epdc/docker-compose/jinshui/node04/fastdfs/nginx/docker-compose.yml new file mode 100644 index 000000000..01f88947d --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node04/fastdfs/nginx/docker-compose.yml @@ -0,0 +1,47 @@ +version: '3.7' +services: + fastdfs-tracker: + image: season/fastdfs + restart: always + volumes: + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + - /mnt/epdc/fdfs/tracker_data:/fastdfs/tracker/data + command: tracker + networks: + epdc_network: + ipv4_address: 172.19.0.30 + + fastdfs-storage: + image: season/fastdfs + restart: always + volumes: + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + - /mnt/epdc/fdfs/storage_data:/fastdfs/storage/data + - /mnt/epdc/fdfs/store_path:/fastdfs/store_path + environment: + TRACKER_SERVER: 172.19.0.30:22122 + command: storage + networks: + epdc_network: + ipv4_address: 172.19.0.31 + + fastdfs-nginx: + image: season/fastdfs + restart: always + volumes: + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + - /mnt/epdc/fdfs/nginx/nginx.conf:/etc/nginx/conf/nginx.conf + - /mnt/epdc/fdfs/store_path:/fastdfs/store_path + environment: + TRACKER_SERVER: 172.19.0.30:22122 + command: nginx + networks: + epdc_network: + ipv4_address: 172.19.0.32 + +networks: + epdc_network: + external: true diff --git a/esua-epdc/docker-compose/jinshui/node04/fastdfs/storage/docker-compose.yml b/esua-epdc/docker-compose/jinshui/node04/fastdfs/storage/docker-compose.yml new file mode 100644 index 000000000..01f88947d --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node04/fastdfs/storage/docker-compose.yml @@ -0,0 +1,47 @@ +version: '3.7' +services: + fastdfs-tracker: + image: season/fastdfs + restart: always + volumes: + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + - /mnt/epdc/fdfs/tracker_data:/fastdfs/tracker/data + command: tracker + networks: + epdc_network: + ipv4_address: 172.19.0.30 + + fastdfs-storage: + image: season/fastdfs + restart: always + volumes: + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + - /mnt/epdc/fdfs/storage_data:/fastdfs/storage/data + - /mnt/epdc/fdfs/store_path:/fastdfs/store_path + environment: + TRACKER_SERVER: 172.19.0.30:22122 + command: storage + networks: + epdc_network: + ipv4_address: 172.19.0.31 + + fastdfs-nginx: + image: season/fastdfs + restart: always + volumes: + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + - /mnt/epdc/fdfs/nginx/nginx.conf:/etc/nginx/conf/nginx.conf + - /mnt/epdc/fdfs/store_path:/fastdfs/store_path + environment: + TRACKER_SERVER: 172.19.0.30:22122 + command: nginx + networks: + epdc_network: + ipv4_address: 172.19.0.32 + +networks: + epdc_network: + external: true diff --git a/esua-epdc/docker-compose/jinshui/node04/fastdfs/tracker/docker-compose.yml b/esua-epdc/docker-compose/jinshui/node04/fastdfs/tracker/docker-compose.yml new file mode 100644 index 000000000..01f88947d --- /dev/null +++ b/esua-epdc/docker-compose/jinshui/node04/fastdfs/tracker/docker-compose.yml @@ -0,0 +1,47 @@ +version: '3.7' +services: + fastdfs-tracker: + image: season/fastdfs + restart: always + volumes: + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + - /mnt/epdc/fdfs/tracker_data:/fastdfs/tracker/data + command: tracker + networks: + epdc_network: + ipv4_address: 172.19.0.30 + + fastdfs-storage: + image: season/fastdfs + restart: always + volumes: + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + - /mnt/epdc/fdfs/storage_data:/fastdfs/storage/data + - /mnt/epdc/fdfs/store_path:/fastdfs/store_path + environment: + TRACKER_SERVER: 172.19.0.30:22122 + command: storage + networks: + epdc_network: + ipv4_address: 172.19.0.31 + + fastdfs-nginx: + image: season/fastdfs + restart: always + volumes: + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + - /mnt/epdc/fdfs/nginx/nginx.conf:/etc/nginx/conf/nginx.conf + - /mnt/epdc/fdfs/store_path:/fastdfs/store_path + environment: + TRACKER_SERVER: 172.19.0.30:22122 + command: nginx + networks: + epdc_network: + ipv4_address: 172.19.0.32 + +networks: + epdc_network: + external: true diff --git a/esua-epdc/docker-compose/prod/master/application/10.5.34.162-master/docker-compose.yml b/esua-epdc/docker-compose/prod/master/application/10.5.34.162-master/docker-compose.yml deleted file mode 100644 index 020aa2d1b..000000000 --- a/esua-epdc/docker-compose/prod/master/application/10.5.34.162-master/docker-compose.yml +++ /dev/null @@ -1,14 +0,0 @@ -version: '3.7' -services: - web: - image: nginx - ports: - - 443:443 - volumes: - - /mnt/nginx/html:/usr/share/nginx/html - - /mnt/nginx/conf/nginx.conf:/etc/nginx/nginx.conf - - /mnt/nginx/conf.d:/etc/nginx/conf.d - - /mnt/nginx/logs:/var/log/nginx - restart: always - container_name: nginx_master - diff --git a/esua-epdc/docker-compose/prod/master/picture/10.5.34.166/docker-compose.yml b/esua-epdc/docker-compose/prod/master/picture/10.5.34.166/docker-compose.yml deleted file mode 100644 index 0f0a6d956..000000000 --- a/esua-epdc/docker-compose/prod/master/picture/10.5.34.166/docker-compose.yml +++ /dev/null @@ -1,50 +0,0 @@ -version: '3.7' -services: - epdc-events-server: - image: registry.cn-qingdao.aliyuncs.com/esua-epdc-shibei/epdc-events-server:prod - ports: - - "9066:9066" - epdc-gateway: - image: registry.cn-qingdao.aliyuncs.com/esua-epdc-shibei/epdc-gateway:prod - ports: - - "9094:9094" - epdc-auth: - image: registry.cn-qingdao.aliyuncs.com/esua-epdc-shibei/epdc-auth:prod - ports: - - "9056:9056" - epdc-admin-server: - image: registry.cn-qingdao.aliyuncs.com/esua-epdc-shibei/epdc-admin-server:prod - ports: - - "9055:9055" - epdc-oss-server: - image: registry.cn-qingdao.aliyuncs.com/esua-epdc-shibei/epdc-oss-server:prod - ports: - - "9065:9065" - epdc-api-server: - image: registry.cn-qingdao.aliyuncs.com/esua-epdc-shibei/epdc-api-server:prod - ports: - - "9040:9040" - epdc-news-server: - image: registry.cn-qingdao.aliyuncs.com/esua-epdc-shibei/epdc-news-server:prod - prort: - - "9064:9064" - epdc-user-server: - image: registry.cn-qingdao.aliyuncs.com/esua-epdc-shibei/epdc-user-server:prod - prort: - - "9068:9068" - epdc-websocket-server: - image: registry.cn-qingdao.aliyuncs.com/esua-epdc-shibei/epdc-websocket-server:prod - prort: - - "9988:9988" - epdc-kpi-server: - image: registry.cn-qingdao.aliyuncs.com/esua-epdc-shibei/epdc-kpi-server:prod - prort: - - "9987:9987" - epdc-group-server: - image: registry.cn-qingdao.aliyuncs.com/esua-epdc-shibei/epdc-group-server:prod - prort: - - "9063:9063" - epdc-message-server: - image: registry.cn-qingdao.aliyuncs.com/esua-epdc-shibei/epdc-message-server:prod - prort: - - "9062:9062" diff --git a/esua-epdc/docker-compose/prod/node01/3-nacos/docker-compose.yml b/esua-epdc/docker-compose/prod/node01/3-nacos/docker-compose.yml new file mode 100644 index 000000000..7e87c51d2 --- /dev/null +++ b/esua-epdc/docker-compose/prod/node01/3-nacos/docker-compose.yml @@ -0,0 +1,25 @@ +version: "3.7" +services: + nacos1: + image: nacos/nacos-server:latest + container_name: nacos1 + ports: + - 10001:10001 + volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + - /mnt/epdc/nacos/logs/nacos1:/home/nacos/logs + - /mnt/epdc/nacos/init.d/custom.properties:/home/nacos/init.d/custom.properties + environment: + PREFER_HOST_MODE: ip #如果支持主机名可以使用hostname,否则使用ip,默认也是ip + SPRING_DATASOURCE_PLATFORM: mysql #数据源平台 仅支持mysql或不保存empty + NACOS_SERVER_PORT: 10001 + NACOS_SERVER_IP: 172.16.0.53 #多网卡情况下,指定ip或网卡 + NACOS_SERVERS: 172.16.0.53:10001 172.16.0.51:10001 172.16.0.51:10002 #集群中其它节点[ip1:port ip2:port ip3:port] + MYSQL_SERVICE_HOST: 172.16.0.52 #mysql配置,Master为主节点,Slave为从节点 + MYSQL_SERVICE_PORT: 3306 + MYSQL_SERVICE_DB_NAME: esua_epdc_nacos + MYSQL_SERVICE_USER: epdc + MYSQL_SERVICE_PASSWORD: Elink@833066 + MYSQL_DATABASE_NUM: 2 + restart: always diff --git a/esua-epdc/docker-compose/prod/node01/4-seata/conf/registry.conf b/esua-epdc/docker-compose/prod/node01/4-seata/conf/registry.conf new file mode 100644 index 000000000..b54576988 --- /dev/null +++ b/esua-epdc/docker-compose/prod/node01/4-seata/conf/registry.conf @@ -0,0 +1,73 @@ +registry { + # file 、nacos 、eureka、redis、zk、consul、etcd3、sofa + type = "nacos" + + nacos { + serverAddr = "47.104.208.104:80" + namespace = "" + cluster = "default" + } + eureka { + serviceUrl = "http://localhost:8761/eureka" + application = "default" + weight = "1" + } + redis { + serverAddr = "localhost:6379" + db = "0" + } + zk { + cluster = "default" + serverAddr = "127.0.0.1:2181" + session.timeout = 6000 + connect.timeout = 2000 + } + consul { + cluster = "default" + serverAddr = "127.0.0.1:8500" + } + etcd3 { + cluster = "default" + serverAddr = "http://localhost:2379" + } + sofa { + serverAddr = "127.0.0.1:9603" + application = "default" + region = "DEFAULT_ZONE" + datacenter = "DefaultDataCenter" + cluster = "default" + group = "SEATA_GROUP" + addressWaitTime = "3000" + } + file { + name = "file.conf" + } +} + +config { + # file、nacos 、apollo、zk、consul、etcd3 + type = "nacos" + + nacos { + serverAddr = "47.104.208.104:80" + namespace = "" + } + consul { + serverAddr = "127.0.0.1:8500" + } + apollo { + app.id = "seata-server" + apollo.meta = "http://192.168.1.204:8801" + } + zk { + serverAddr = "127.0.0.1:2181" + session.timeout = 6000 + connect.timeout = 2000 + } + etcd3 { + serverAddr = "http://localhost:2379" + } + file { + name = "file.conf" + } +} diff --git a/esua-epdc/docker-compose/prod/node01/4-seata/docker-compose.yml b/esua-epdc/docker-compose/prod/node01/4-seata/docker-compose.yml new file mode 100644 index 000000000..dbe74a026 --- /dev/null +++ b/esua-epdc/docker-compose/prod/node01/4-seata/docker-compose.yml @@ -0,0 +1,39 @@ +#环境变量 +#seata-server 支持以下环境变量: +# +#SEATA_IP +#可选, 指定seata-server启动的IP, 该IP用于向注册中心注册时使用, 如eureka等 +# +#SEATA_PORT +#可选, 指定seata-server启动的端口, 默认为 8091 +# +#STORE_MODE +#可选, 指定seata-server的事务日志存储方式, 支持db 和 file, 默认是 file +# +#SERVER_NODE +#可选, 用于指定seata-server节点ID, 如 1,2,3..., 默认为 1 +# +#SEATA_ENV +#可选, 指定 seata-server 运行环境, 如 dev, test 等, 服务启动时会使用 registry-dev.conf 这样的配置 +# +#SEATA_CONFIG_NAME +#可选, 指定配置文件位置, 如 file:/root/registry, 将会加载 /root/registry.conf 作为配置文件 +version: "3.7" + +services: + seata-server1: + container_name: seata-server1 + image: seataio/seata-server:latest + ports: + - 9608:9608 + environment: + SEATA_IP: 47.104.85.99 + SEATA_PORT: 9608 + STORE_MODE: db + SERVER_NODE: 1 + SEATA_CONFIG_NAME: file:/root/seata-config/registry + volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + - /opt/epdc/seata/seata-config:/root/seata-config + - /opt/epdc/seata/logs:/root/logs/seata diff --git a/esua-epdc/docker-compose/prod/node01/4-seata/script/config.txt b/esua-epdc/docker-compose/prod/node01/4-seata/script/config.txt new file mode 100644 index 000000000..859bc2ffd --- /dev/null +++ b/esua-epdc/docker-compose/prod/node01/4-seata/script/config.txt @@ -0,0 +1,84 @@ +transport.type=TCP +transport.server=NIO +transport.heartbeat=true +transport.enableClientBatchSendRequest=false +transport.threadFactory.bossThreadPrefix=NettyBoss +transport.threadFactory.workerThreadPrefix=NettyServerNIOWorker +transport.threadFactory.serverExecutorThreadPrefix=NettyServerBizHandler +transport.threadFactory.shareBossWorker=false +transport.threadFactory.clientSelectorThreadPrefix=NettyClientSelector +transport.threadFactory.clientSelectorThread-size=1 +transport.threadFactory.clientWorkerThreadPrefix=NettyClientWorkerThread +transport.threadFactory.bossThreadSize=1 +transport.threadFactory.workerThreadSize=8 +transport.shutdown.wait=3 +service.vgroup_mapping.my_test_tx_group=default +service.vgroup_mapping.epdc-api-server-fescar-service-group=default +service.vgroup_mapping.epdc-demo-server-fescar-service-group=default +service.vgroup_mapping.epdc-user-server-fescar-service-group=default +service.vgroup_mapping.epdc-services-server-fescar-service-group=default +service.vgroup_mapping.epdc-party-server-fescar-service-group=default +service.vgroup_mapping.epdc-heart-server-fescar-service-group=default +service.vgroup_mapping.epdc-neighbor-server-fescar-service-group=default +service.vgroup_mapping.epdc-oss-server-fescar-service-group=default +service.vgroup_mapping.epdc-message-server-fescar-service-group=default +service.vgroup_mapping.epdc-news-server-fescar-service-group=default +service.vgroup_mapping.epdc-job-server-fescar-service-group=default +service.vgroup_mapping.epdc-admin-server-fescar-service-group=default +service.vgroup_mapping.epdc-activiti-server-fescar-service-group=default +service.vgroup_mapping.epdc-kpi-server-fescar-service-group=default +service.vgroup_mapping.epdc-points-server-fescar-service-group=default +service.vgroup_mapping.epdc-webservice-server-fescar-service-group=default +service.vgroup_mapping.epdc-events-server-fescar-service-group=default +service.vgroup_mapping.epdc-custom-server-fescar-service-group=default +service.vgroup_mapping.epdc-analysis-server-fescar-service-group=default +service.vgroup_mapping.epdc-group-server-fescar-service-group=default +service.enableDegrade=false +service.disableGlobalTransaction=false +client.rm.async.commit.buffer.limit=10000 +client.rm.lock.retry.internal=10 +client.rm.lock.retry.times=30 +client.rm.report.retry.count=5 +client.rm.lock.retry.policy.branch-rollback-on-conflict=true +client.rm.table.meta.check.enable=false +client.rm.report.success.enable=true +client.tm.commit.retry.count=5 +client.tm.rollback.retry.count=5 +store.mode=db +store.file.dir=file_store/data +store.file.maxBranchSessionSize=16384 +store.file.maxGlobalSessionSize=512 +store.file.fileWriteBufferCacheSize=16384 +store.file.flushDiskMode=async +store.file.session.reload.read_size=100 +store.db.datasource=dbcp +store.db.dbType=mysql +store.db.driverClassName=com.mysql.jdbc.Driver +store.db.url=jdbc:mysql://172.31.171.61:9600/epdc_seata?useUnicode=true +store.db.user=seata +store.db.password=elink888 +store.db.minConn=1 +store.db.maxConn=3 +store.db.global.table=global_table +store.db.branch.table=branch_table +store.db.queryLimit=100 +store.db.lockTable=lock_table +server.recovery.committingRetryPeriod=1000 +server.recovery.asynCommittingRetryPeriod=1000 +server.recovery.rollbackingRetryPeriod=1000 +server.recovery.timeoutRetryPeriod=1000 +server.max.commit.retry.timeout=-1 +server.max.rollback.retry.timeout=-1 +server.rollback.retry.timeout.unlock.enable=false +client.undo.data.validation=true +client.undo.log.serialization=jackson +server.undo.log.save.days=7 +server.undo.log.delete.period=86400000 +client.undo.log.table=undo_log +client.log.exceptionRate=100 +transport.serialization=seata +transport.compressor=none +metrics.enabled=false +metrics.registryType=compact +metrics.exporterList=prometheus +metrics.exporterPrometheusPort=9898 diff --git a/esua-epdc/docker-compose/prod/node01/4-seata/script/nacos-config.sh b/esua-epdc/docker-compose/prod/node01/4-seata/script/nacos-config.sh new file mode 100644 index 000000000..15edf8555 --- /dev/null +++ b/esua-epdc/docker-compose/prod/node01/4-seata/script/nacos-config.sh @@ -0,0 +1,89 @@ +#!/usr/bin/env bash +# Copyright 1999-2019 Seata.io Group. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at、 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +while getopts ":h:p:g:t:" opt +do + case $opt in + h) + host=$OPTARG + ;; + p) + port=$OPTARG + ;; + g) + group=$OPTARG + ;; + t) + tenant=$OPTARG + ;; + ?) + echo "\033[31m USAGE OPTION: $0 [-h host] [-p port] [-g group] [-t tenant] \033[0m" + exit 1 + ;; + esac +done + +if [[ -z ${host} ]]; then + host=localhost +fi +if [[ -z ${port} ]]; then + port=8848 +fi +if [[ -z ${group} ]]; then + group="SEATA_GROUP" +fi +if [[ -z ${tenant} ]]; then + tenant="" +fi + +nacosAddr=$host:$port +contentType="content-type:application/json;charset=UTF-8" + +echo "set nacosAddr=$nacosAddr" +echo "set group=$group" + +failCount=0 +tempLog=$(mktemp -u) +function addConfig() { + curl -X POST -H "${1}" "http://$2/nacos/v1/cs/configs?dataId=$3&group=$group&content=$4&tenant=$tenant" >"${tempLog}" 2>/dev/null + if [[ -z $(cat "${tempLog}") ]]; then + echo "\033[31m Please check the cluster status. \033[0m" + exit 1 + fi + if [[ $(cat "${tempLog}") =~ "true" ]]; then + echo "Set $3=$4\033[32m successfully \033[0m" + else + echo "Set $3=$4\033[31m failure \033[0m" + (( failCount++ )) + fi +} + +count=0 +for line in $(cat $(dirname "$PWD")/config.txt); do + (( count++ )) + key=${line%%=*} + value=${line#*=} + addConfig "${contentType}" "${nacosAddr}" "${key}" "${value}" +done + +echo "=========================================================================" +echo " Complete initialization parameters, \033[32m total-count:$count \033[0m, \033[31m failure-count:$failCount \033[0m" +echo "=========================================================================" + +if [[ ${failCount} -eq 0 ]]; then + echo "\033[32m Init nacos config finished, please start seata-server. \033[0m" +else + echo "\033[31m init nacos config fail. \033[0m" +fi diff --git a/esua-epdc/docker-compose/prod/node02/2-nacos/docker-compose.yml b/esua-epdc/docker-compose/prod/node02/2-nacos/docker-compose.yml new file mode 100644 index 000000000..532e76ee2 --- /dev/null +++ b/esua-epdc/docker-compose/prod/node02/2-nacos/docker-compose.yml @@ -0,0 +1,48 @@ +version: "3.7" +services: + nacos2: + image: nacos/nacos-server:latest + container_name: nacos2 + ports: + - 10001:10001 + volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + - /opt/epdc/nacos/logs/nacos2:/home/nacos/logs + - /opt/epdc/nacos/init.d/custom.properties:/home/nacos/init.d/custom.properties + environment: + PREFER_HOST_MODE: ip #如果支持主机名可以使用hostname,否则使用ip,默认也是ip + SPRING_DATASOURCE_PLATFORM: mysql #数据源平台 仅支持mysql或不保存empty + NACOS_SERVER_PORT: 9602 + NACOS_SERVER_IP: 172.31.171.61 #多网卡情况下,指定ip或网卡 + NACOS_SERVERS: 172.31.171.61:9601 172.31.171.61:9602 172.31.171.62:9601 #集群中其它节点[ip1:port ip2:port ip3:port] + MYSQL_SERVICE_HOST: 172.31.171.61 #mysql配置,Master为主节点,Slave为从节点 + MYSQL_SERVICE_PORT: 9600 + MYSQL_SERVICE_DB_NAME: epdc_nacos + MYSQL_SERVICE_USER: nacos + MYSQL_SERVICE_PASSWORD: elink888 + MYSQL_DATABASE_NUM: 2 + restart: always + nacos3: + image: nacos/nacos-server:latest + container_name: nacos3 + ports: + - 9601:9601 + volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + - /opt/epdc/nacos/logs:/home/nacos/logs + - /opt/epdc/nacos/init.d/custom.properties:/home/nacos/init.d/custom.properties + environment: + PREFER_HOST_MODE: ip #如果支持主机名可以使用hostname,否则使用ip,默认也是ip + SPRING_DATASOURCE_PLATFORM: mysql #数据源平台 仅支持mysql或不保存empty + NACOS_SERVER_PORT: 9601 + NACOS_SERVER_IP: 172.31.171.62 #多网卡情况下,指定ip或网卡 + NACOS_SERVERS: 172.31.171.61:9601 172.31.171.61:9602 172.31.171.62:9601 #集群中其它节点[ip1:port ip2:port ip3:port] + MYSQL_SERVICE_HOST: 172.31.171.61 #mysql配置,Master为主节点,Slave为从节点 + MYSQL_SERVICE_PORT: 9600 + MYSQL_SERVICE_DB_NAME: epdc_nacos + MYSQL_SERVICE_USER: nacos + MYSQL_SERVICE_PASSWORD: elink888 + MYSQL_DATABASE_NUM: 2 + restart: always diff --git a/esua-epdc/docker-compose/prod/node02/5-seata/conf/registry.conf b/esua-epdc/docker-compose/prod/node02/5-seata/conf/registry.conf new file mode 100644 index 000000000..c5c111f63 --- /dev/null +++ b/esua-epdc/docker-compose/prod/node02/5-seata/conf/registry.conf @@ -0,0 +1,73 @@ +registry { + # file 、nacos 、eureka、redis、zk、consul、etcd3、sofa + type = "nacos" + + nacos { + serverAddr = "172.31.171.61:80" + namespace = "" + cluster = "default" + } + eureka { + serviceUrl = "http://localhost:8761/eureka" + application = "default" + weight = "1" + } + redis { + serverAddr = "localhost:6379" + db = "0" + } + zk { + cluster = "default" + serverAddr = "127.0.0.1:2181" + session.timeout = 6000 + connect.timeout = 2000 + } + consul { + cluster = "default" + serverAddr = "127.0.0.1:8500" + } + etcd3 { + cluster = "default" + serverAddr = "http://localhost:2379" + } + sofa { + serverAddr = "127.0.0.1:9603" + application = "default" + region = "DEFAULT_ZONE" + datacenter = "DefaultDataCenter" + cluster = "default" + group = "SEATA_GROUP" + addressWaitTime = "3000" + } + file { + name = "file.conf" + } +} + +config { + # file、nacos 、apollo、zk、consul、etcd3 + type = "nacos" + + nacos { + serverAddr = "172.31.171.61:80" + namespace = "" + } + consul { + serverAddr = "127.0.0.1:8500" + } + apollo { + app.id = "seata-server" + apollo.meta = "http://192.168.1.204:8801" + } + zk { + serverAddr = "127.0.0.1:2181" + session.timeout = 6000 + connect.timeout = 2000 + } + etcd3 { + serverAddr = "http://localhost:2379" + } + file { + name = "file.conf" + } +} diff --git a/esua-epdc/docker-compose/prod/master/application/10.5.34.163-slave/docker-compose.yml b/esua-epdc/docker-compose/prod/node02/5-seata/docker-compose.yml similarity index 67% rename from esua-epdc/docker-compose/prod/master/application/10.5.34.163-slave/docker-compose.yml rename to esua-epdc/docker-compose/prod/node02/5-seata/docker-compose.yml index a3d22f77c..0629cda2d 100644 --- a/esua-epdc/docker-compose/prod/master/application/10.5.34.163-slave/docker-compose.yml +++ b/esua-epdc/docker-compose/prod/node02/5-seata/docker-compose.yml @@ -21,15 +21,18 @@ version: "3.7" services: - seata-server: + seata-server2: + container_name: seata-server2 image: seataio/seata-server:latest - hostname: seata-server ports: - - 9001:8091 + - 9608:9608 environment: - - SEATA_PORT=8091 - - SEATA_IP= - - STORE_MODE=db - - SERVER_NODE=1 - expose: - - 8091 + SEATA_IP: 114.215.125.123 + SEATA_PORT: 9608 + STORE_MODE: db + SERVER_NODE: 2 + SEATA_CONFIG_NAME: file:/root/seata-config/registry + volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + - /opt/epdc/seata/seata-config:/root/seata-config diff --git a/esua-epdc/docker-compose/test/node01/1-mysql/conf/mysql.conf.cnf b/esua-epdc/docker-compose/test/node01/1-mysql/conf/mysql.conf.cnf index 281bd42b5..42c62c8e8 100644 --- a/esua-epdc/docker-compose/test/node01/1-mysql/conf/mysql.conf.cnf +++ b/esua-epdc/docker-compose/test/node01/1-mysql/conf/mysql.conf.cnf @@ -18,28 +18,53 @@ skip-host-cache skip-name-resolve # 数据库编号, 要具有唯一性, 不能跟其他数据库重复, 方便同步区分 -server-id = 21 +server-id = 2 # mysql日志 log_bin = /var/lib/mysql/mysql-bin.log -log-bin-index=slave-relay-bin.index +log-bin-index=/var/lib/mysql/slave-relay-bin.index #日志记录的格式 -binlog_format=MIXED +binlog_format=mixed #单个日志文件最大 -max_binlog_size = 100M  +max_binlog_size=100M  #从库建议开启,有利于数据一致性 -relay_log_recovery = 1    +relay_log_recovery=1    #如果从库还会用做主库,建议开启 -log_slave_updates = 1    +log_slave_updates=1    # 中继日志:存储所有主库TP过来的binlog事件主库binlog:记录主库发生过的修改事件 -# relay-log = /var/lib/mysql/mysql-relay-bin.log +relay-log=/var/lib/mysql/mysql-relay-bin.log +relay-log-index=relay-log.index # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION + +# 慢查询 +slow_query_log=on +long_query_time=3 +slow_query_log_file=/var/lib/mysql/mysql-slow.log + +# GTID +gtid_mode=on +enforce_gtid_consistency=on + +# 此参数设置为ON时,新创建的InnoDB 数据表的数据会存储于一个单独的文件中,而不是存储于共享的ibdata表空间。 +innodb-file-per-table=1 +innodb_flush_log_at_trx_commit=2 +log_warnings=1 + +# 只读配置 +read_only=1 + +[mysqld_safe] +log-error=/var/lib/mysql/mysqld.log +pid-file=/var/lib/mysql/mysqld.pid + + +INSERT INTO esua_epdc_events.epdc_events VALUES ('78e89fe1d35170ed3b159a5abdf6eaf0','a897d6b6d8b97bfaaafbb031d9a3d7a2','郭口路3号-马女士','https://wx.qlogo.cn/mmopen/vi_32/q5bEiaAeUgBDj5VbESXLicsic9CSpOeqCGCQLBWXic4lLCf5ayqib5e3DRAeNBc7zCzRMxFyuE5ZhwbyYtuJyTHQZdg/132','1','13156396355','春江水暖鸭先知','青啤社区第四网格',1222016013611073538,'山东省青岛市市北区丹山路88号',36.0762400000,120.3402690000,4,'生机勃勃',0,0,0,0,'0',0,'APP_USER','2020-04-09 15:41:56','1222040755663568897','2020-04-09 18:35:45','0','','','','1175270520603930625,1202809196967714817,1202809398139117570','市北区党委-登州路街道-青啤社区','13','13','其它','1175270520603930625,1202809196967714817,1202809398139117570,1222016013611073538','市北区党委-登州路街道-青啤社区-青啤社区第四网格'); diff --git a/esua-epdc/docker-compose/test/node01/2-nginx/docker-compose.yml b/esua-epdc/docker-compose/test/node01/2-nginx/docker-compose.yml index 979d14090..a144a4426 100644 --- a/esua-epdc/docker-compose/test/node01/2-nginx/docker-compose.yml +++ b/esua-epdc/docker-compose/test/node01/2-nginx/docker-compose.yml @@ -7,6 +7,7 @@ services: - 443:443 volumes: - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro - /opt/epdc/nginx/html:/usr/share/nginx/html - /opt/epdc/nginx/conf/nginx.conf:/etc/nginx/nginx.conf:ro - /opt/epdc/nginx/conf.d:/etc/nginx/conf.d:ro diff --git a/esua-epdc/docker-compose/test/node01/3-nacos/docker-compose.yml b/esua-epdc/docker-compose/test/node01/3-nacos/docker-compose.yml index 04c6ed59e..d563ae148 100644 --- a/esua-epdc/docker-compose/test/node01/3-nacos/docker-compose.yml +++ b/esua-epdc/docker-compose/test/node01/3-nacos/docker-compose.yml @@ -7,6 +7,7 @@ services: - 9601:9601 volumes: - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro - /opt/epdc/nacos/logs:/home/nacos/logs - /opt/epdc/nacos/init.d/custom.properties:/home/nacos/init.d/custom.properties environment: diff --git a/esua-epdc/docker-compose/test/node01/4-redis/docker-compose.yml b/esua-epdc/docker-compose/test/node01/4-redis/docker-compose.yml index 9775e0e3f..6508263ac 100644 --- a/esua-epdc/docker-compose/test/node01/4-redis/docker-compose.yml +++ b/esua-epdc/docker-compose/test/node01/4-redis/docker-compose.yml @@ -9,6 +9,7 @@ services: restart: always volumes: - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro - /opt/epdc/redis/log:/data/log - /opt/epdc/redis/data:/data - /opt/epdc/redis/conf/redis-slave01.conf:/usr/local/etc/redis/redis.conf @@ -22,6 +23,7 @@ services: restart: always volumes: - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro - /opt/epdc/redis/log:/data/log - /opt/epdc/redis/data:/data - /opt/epdc/redis/conf/redis-slave02.conf:/usr/local/etc/redis/redis.conf @@ -35,6 +37,7 @@ services: restart: always volumes: - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro - /opt/epdc/redis/log:/data/log - /opt/epdc/redis/data:/data - /opt/epdc/redis/conf/redis-slave03.conf:/usr/local/etc/redis/redis.conf diff --git a/esua-epdc/docker-compose/test/node01/5-seata/docker-compose.yml b/esua-epdc/docker-compose/test/node01/5-seata/docker-compose.yml index 0543e5f02..0629cda2d 100644 --- a/esua-epdc/docker-compose/test/node01/5-seata/docker-compose.yml +++ b/esua-epdc/docker-compose/test/node01/5-seata/docker-compose.yml @@ -34,4 +34,5 @@ services: SEATA_CONFIG_NAME: file:/root/seata-config/registry volumes: - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro - /opt/epdc/seata/seata-config:/root/seata-config diff --git a/esua-epdc/docker-compose/test/node02/1-mysql/conf/mysql.conf.cnf b/esua-epdc/docker-compose/test/node02/1-mysql/conf/mysql.conf.cnf index 3acffaa32..9680a4543 100644 --- a/esua-epdc/docker-compose/test/node02/1-mysql/conf/mysql.conf.cnf +++ b/esua-epdc/docker-compose/test/node02/1-mysql/conf/mysql.conf.cnf @@ -18,19 +18,44 @@ skip-host-cache skip-name-resolve # 数据库编号, 要具有唯一性, 不能跟其他数据库重复, 方便同步区分 -server-id = 11 +server-id=1 + +#如果从库还会用做主库,建议开启 +log_slave_updates=1 # mysql日志 -log_bin = /var/lib/mysql/master-bin.log -log-bin-index=master-bin.index +log_bin=/var/lib/mysql/master-bin.log +log-bin-index=/var/lib/mysql/master-bin.index # binlog日志格式,mysql默认采用statement,建议使用 mixed(是statement和row模式的结合) -binlog_format = mixed +binlog_format=mixed + +# 中继日志:存储所有主库TP过来的binlog事件主库binlog:记录主库发生过的修改事件 +relay-log=/var/lib/mysql/relay-log +relay-log-index=/var/lib/mysql/relay-log.index #单个日志文件最大 -max_binlog_size = 100M +max_binlog_size=100M # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION + +# 慢查询 +slow_query_log=on +long_query_time=1 +slow_query_log_file=/data/mysql/mysql-slow.log + +# GTID +gtid_mode=on +enforce_gtid_consistency=on + +# 此参数设置为ON时,新创建的InnoDB 数据表的数据会存储于一个单独的文件中,而不是存储于共享的ibdata表空间。 +innodb-file-per-table=1 +innodb_flush_log_at_trx_commit=2 +log_warnings=1 + +[mysqld_safe] +log-error=/var/lib/mysql/mysqld.log +pid-file=/var/lib/mysql/mysqld.pid diff --git a/esua-epdc/docker-compose/test/node02/1-mysql/docker-compose.yml b/esua-epdc/docker-compose/test/node02/1-mysql/docker-compose.yml index 3ab10d545..c0dd9f1ce 100644 --- a/esua-epdc/docker-compose/test/node02/1-mysql/docker-compose.yml +++ b/esua-epdc/docker-compose/test/node02/1-mysql/docker-compose.yml @@ -15,3 +15,6 @@ services: - /opt/epdc/mysql/data:/var/lib/mysql - /opt/epdc/mysql/conf/mysql.conf.cnf:/etc/mysql/conf.d/mysql.conf.cnf restart: always + + + mysql -e "show databases;" -uroot -p| grep -Ev "Database|information_schema|mysql|performance_schema" |xargs mysqldump -uroot -p --single-transaction --master-data=2 --no-autocommit --databases --default-character-set=utf8 > mysql_dump.sql diff --git a/esua-epdc/docker-compose/test/node02/2-nacos/docker-compose.yml b/esua-epdc/docker-compose/test/node02/2-nacos/docker-compose.yml index 2320d188a..1dfc6ed2c 100644 --- a/esua-epdc/docker-compose/test/node02/2-nacos/docker-compose.yml +++ b/esua-epdc/docker-compose/test/node02/2-nacos/docker-compose.yml @@ -6,6 +6,8 @@ services: ports: - 9601:9601 volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro - /opt/epdc/nacos/logs/nacos1:/home/nacos/logs - /opt/epdc/nacos/init.d/custom.properties:/home/nacos/init.d/custom.properties environment: @@ -28,6 +30,8 @@ services: ports: - 9602:9602 volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro - /opt/epdc/nacos/logs/nacos2:/home/nacos/logs - /opt/epdc/nacos/init.d/custom.properties:/home/nacos/init.d/custom.properties environment: diff --git a/esua-epdc/docker-compose/test/node02/3-seata/docker-compose.yml b/esua-epdc/docker-compose/test/node02/3-seata/docker-compose.yml index b42bdba2f..dbe74a026 100644 --- a/esua-epdc/docker-compose/test/node02/3-seata/docker-compose.yml +++ b/esua-epdc/docker-compose/test/node02/3-seata/docker-compose.yml @@ -33,5 +33,7 @@ services: SERVER_NODE: 1 SEATA_CONFIG_NAME: file:/root/seata-config/registry volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro - /opt/epdc/seata/seata-config:/root/seata-config - /opt/epdc/seata/logs:/root/logs/seata diff --git a/esua-epdc/docker-compose/test/node02/4-redis/docker-compose.yml b/esua-epdc/docker-compose/test/node02/4-redis/docker-compose.yml index 7588207e7..0422bca0f 100644 --- a/esua-epdc/docker-compose/test/node02/4-redis/docker-compose.yml +++ b/esua-epdc/docker-compose/test/node02/4-redis/docker-compose.yml @@ -8,6 +8,8 @@ services: command: redis-server /usr/local/etc/redis/redis.conf restart: always volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro - /opt/epdc/redis/log:/data/log - /opt/epdc/redis/data:/data - /opt/epdc/redis/conf/redis-master01.conf:/usr/local/etc/redis/redis.conf @@ -20,6 +22,8 @@ services: command: redis-server /usr/local/etc/redis/redis.conf restart: always volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro - /opt/epdc/redis/log:/data/log - /opt/epdc/redis/data:/data - /opt/epdc/redis/conf/redis-master02.conf:/usr/local/etc/redis/redis.conf @@ -32,6 +36,8 @@ services: command: redis-server /usr/local/etc/redis/redis.conf restart: always volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro - /opt/epdc/redis/log:/data/log - /opt/epdc/redis/data:/data - /opt/epdc/redis/conf/redis-master03.conf:/usr/local/etc/redis/redis.conf diff --git a/esua-epdc/epdc-admin/epdc-admin-server/Dockerfile b/esua-epdc/epdc-admin/epdc-admin-server/Dockerfile index 9e1c30f4f..f9ca92438 100755 --- a/esua-epdc/epdc-admin/epdc-admin-server/Dockerfile +++ b/esua-epdc/epdc-admin/epdc-admin-server/Dockerfile @@ -1,5 +1,5 @@ # 基础镜像 -FROM openjdk:8u242-jdk-buster +FROM openjdk:8 # 作者 MAINTAINER rongchao@elink-cn.com # 对应pom.xml文件中的dockerfile-maven-plugin插件JAR_FILE的值 @@ -16,5 +16,5 @@ ENV DATAPATH /data # 挂载/data目录到主机 VOLUME $DATAPATH # 启动容器时执行 -ENTRYPOINT java -jar -Xmx1024m $JAR_PATH +ENTRYPOINT java -jar $JAR_CONFIG $JAR_PATH EXPOSE ${SERVER_PORT} diff --git a/esua-epdc/epdc-admin/epdc-admin-server/pom.xml b/esua-epdc/epdc-admin/epdc-admin-server/pom.xml index 5418ca548..2a12ee238 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/pom.xml +++ b/esua-epdc/epdc-admin/epdc-admin-server/pom.xml @@ -153,8 +153,8 @@ wx29b074840ef4bfd9 4adb1afccc69f205cdf5b521d74e2aca - wx9b6102a8ee5add65 - 394f47d4e08fc0fd629231d3f68a34dc + wxfa4afaa2b5f9c876 + 7db9f049c78c9a6cafa673deebe8330d 47.104.85.99:9876;114.215.125.123:9876 organizationGroup @@ -171,8 +171,8 @@ true 47.104.224.45:8848 - 219.146.91.110 - a746dde3-7a13-4521-b986-7369b0b7c269 + 47.104.85.99 + 6a3577b4-7b79-43f6-aebb-9c3f31263f6a http://localhost:9411 @@ -186,8 +186,8 @@ wx9f20a46906ab2c3e dc13065f79429979d9f687d249eb5c4e - wx9b6102a8ee5add65 - 394f47d4e08fc0fd629231d3f68a34dc + wxfa4afaa2b5f9c876 + 7db9f049c78c9a6cafa673deebe8330d 47.104.85.99:9876;114.215.125.123:9876 organizationGroup @@ -225,8 +225,8 @@ wx9f20a46906ab2c3e dc13065f79429979d9f687d249eb5c4e - wx9b6102a8ee5add65 - 394f47d4e08fc0fd629231d3f68a34dc + wxfa4afaa2b5f9c876 + 7db9f049c78c9a6cafa673deebe8330d diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/application-test.yml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/application-test.yml index f47bc0a4b..42caef6e9 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/application-test.yml +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/application-test.yml @@ -33,4 +33,4 @@ spring: stat: log-slow-sql: true slow-sql-millis: 1000 - merge-sql: false \ No newline at end of file + merge-sql: false diff --git a/esua-epdc/epdc-auth/Dockerfile b/esua-epdc/epdc-auth/Dockerfile index 9e1c30f4f..f9ca92438 100755 --- a/esua-epdc/epdc-auth/Dockerfile +++ b/esua-epdc/epdc-auth/Dockerfile @@ -1,5 +1,5 @@ # 基础镜像 -FROM openjdk:8u242-jdk-buster +FROM openjdk:8 # 作者 MAINTAINER rongchao@elink-cn.com # 对应pom.xml文件中的dockerfile-maven-plugin插件JAR_FILE的值 @@ -16,5 +16,5 @@ ENV DATAPATH /data # 挂载/data目录到主机 VOLUME $DATAPATH # 启动容器时执行 -ENTRYPOINT java -jar -Xmx1024m $JAR_PATH +ENTRYPOINT java -jar $JAR_CONFIG $JAR_PATH EXPOSE ${SERVER_PORT} diff --git a/esua-epdc/epdc-auth/pom.xml b/esua-epdc/epdc-auth/pom.xml index d5a7a67d3..af534db6b 100644 --- a/esua-epdc/epdc-auth/pom.xml +++ b/esua-epdc/epdc-auth/pom.xml @@ -132,9 +132,9 @@ 2 - 47.104.224.45 - 6379 - elink@888 + 114.215.125.123 + 9603 + epdc!redis@master1405 true diff --git a/esua-epdc/epdc-auth/src/main/resources/logback-spring.xml b/esua-epdc/epdc-auth/src/main/resources/logback-spring.xml index 148187e70..328698a0c 100644 --- a/esua-epdc/epdc-auth/src/main/resources/logback-spring.xml +++ b/esua-epdc/epdc-auth/src/main/resources/logback-spring.xml @@ -144,10 +144,10 @@ - - - - + + + + @@ -156,4 +156,4 @@ - \ No newline at end of file + diff --git a/esua-epdc/epdc-commons/epdc-common-clienttoken/pom.xml b/esua-epdc/epdc-commons/epdc-common-clienttoken/pom.xml index dd4f4e01c..07d4a1526 100644 --- a/esua-epdc/epdc-commons/epdc-common-clienttoken/pom.xml +++ b/esua-epdc/epdc-commons/epdc-common-clienttoken/pom.xml @@ -23,6 +23,12 @@ ${project.version} + + com.esua.epdc + epdc-user-client + ${project.version} + + org.springframework.boot spring-boot-starter-web diff --git a/esua-epdc/epdc-commons/epdc-common-clienttoken/src/main/java/com/elink/esua/epdc/common/token/dto/TokenDto.java b/esua-epdc/epdc-commons/epdc-common-clienttoken/src/main/java/com/elink/esua/epdc/common/token/dto/TokenDto.java index b0989145e..b530dc903 100644 --- a/esua-epdc/epdc-commons/epdc-common-clienttoken/src/main/java/com/elink/esua/epdc/common/token/dto/TokenDto.java +++ b/esua-epdc/epdc-commons/epdc-common-clienttoken/src/main/java/com/elink/esua/epdc/common/token/dto/TokenDto.java @@ -1,8 +1,11 @@ package com.elink.esua.epdc.common.token.dto; +import com.elink.esua.epdc.dto.UserTagInfo; import lombok.Data; import java.io.Serializable; +import java.util.Date; +import java.util.List; /** * 用户token @@ -46,7 +49,12 @@ public class TokenDto implements Serializable { private Long gridId; /** - * 党员标识 0:否、1:是 + * 性别(女性-0,男性-1) */ - private String partyFlag; + private String sex; + + /** + * 用户标签信息列表 + */ + private List userTagInfos; } diff --git a/esua-epdc/epdc-commons/epdc-common-clienttoken/src/main/java/com/elink/esua/epdc/common/token/util/CpUserDetailRedis.java b/esua-epdc/epdc-commons/epdc-common-clienttoken/src/main/java/com/elink/esua/epdc/common/token/util/CpUserDetailRedis.java index 791e89b9c..178c4a29d 100644 --- a/esua-epdc/epdc-commons/epdc-common-clienttoken/src/main/java/com/elink/esua/epdc/common/token/util/CpUserDetailRedis.java +++ b/esua-epdc/epdc-commons/epdc-common-clienttoken/src/main/java/com/elink/esua/epdc/common/token/util/CpUserDetailRedis.java @@ -40,6 +40,26 @@ public class CpUserDetailRedis { redisUtils.hMSet(key, map, expire); } + /** + * 缓存用户信息,不同于{@link CpUserDetailRedis#set(TokenDto, long)}之处在于存放进redis时,拼接key的后缀可以自定义 + * + * @param user 用户信息 + * @param expire 超时时长 + * @param redisKeySuffix redis的key的后缀 + * @return void + * @author work@yujt.net.cn + * @date 2020/1/31 15:13 + */ + public void set(TokenDto user, long expire, String redisKeySuffix) { + if (user == null) { + return; + } + String key = RedisKeys.getCpUserKey(redisKeySuffix); + //bean to map + Map map = BeanUtil.beanToMap(user, false, true); + redisUtils.hMSet(key, map, expire); + } + /** * 获取token信息 * diff --git a/esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/entity/DeptScope.java b/esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/entity/DeptScope.java new file mode 100644 index 000000000..cc66e73e9 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/entity/DeptScope.java @@ -0,0 +1,36 @@ +package com.elink.esua.epdc.commons.mybatis.entity; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 部门冗余字段基类 + * + * @author rongchao + * @Date 19-12-18 + */ +@Data +public abstract class DeptScope extends BaseEpdcEntity implements Serializable { + + /*** + *所有部门名称 + */ + private String allDeptNames; + + /*** + *所有部门ID + */ + private String allDeptIds; + + /*** + *父所有部门 + */ + private String parentDeptNames; + + /*** + *父所有部门 + */ + private String parentDeptIds; + +} diff --git a/esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/utils/DeptEntityUtils.java b/esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/utils/DeptEntityUtils.java new file mode 100644 index 000000000..b4d4c792e --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/utils/DeptEntityUtils.java @@ -0,0 +1,74 @@ +package com.elink.esua.epdc.commons.mybatis.utils; + +import com.elink.esua.epdc.commons.mybatis.entity.DeptScope; +import lombok.Data; + +/** + * 部门信息实体工具类 + * + * @author rongchao + * @Date 19-12-18 + */ +public class DeptEntityUtils { + + @Data + public static class DeptDto { + /** + * 父所有部门ID + */ + private String parentDeptIds; + /** + * 父所有部门 + */ + private String parentDeptNames; + /** + * 所有部门ID + */ + private String allDeptIds; + /** + * 所有部门 + */ + private String allDeptNames; + } + + /** + * 装载部门信息 + * + * @param dto + * @param entityClass + * @return T + * @author rongchao + * @since 2019-12-18 + */ + public static T loadDeptInfo(DeptDto dto, Class entityClass) { + try { + T t = entityClass.newInstance(); + t.setAllDeptIds(dto.getAllDeptIds()); + t.setAllDeptNames(dto.getAllDeptNames()); + t.setParentDeptIds(dto.getParentDeptIds()); + t.setParentDeptNames(dto.getParentDeptNames()); + return t; + } catch (InstantiationException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + return null; + } + + /** + * 装载部门信息 + * + * @param dto + * @param entity + * @return void + * @author rongchao + * @since 2019-12-18 + */ + public static void loadDeptInfo(DeptDto dto, T entity) { + entity.setAllDeptIds(dto.getAllDeptIds()); + entity.setAllDeptNames(dto.getAllDeptNames()); + entity.setParentDeptIds(dto.getParentDeptIds()); + entity.setParentDeptNames(dto.getParentDeptNames()); + } +} diff --git a/esua-epdc/epdc-commons/epdc-commons-tools-wx-ma/pom.xml b/esua-epdc/epdc-commons/epdc-commons-tools-wx-ma/pom.xml index b427bed4b..e7e900877 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools-wx-ma/pom.xml +++ b/esua-epdc/epdc-commons/epdc-commons-tools-wx-ma/pom.xml @@ -31,4 +31,4 @@ - \ No newline at end of file + diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NacosConfigConstant.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NacosConfigConstant.java new file mode 100644 index 000000000..c3c2d716f --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NacosConfigConstant.java @@ -0,0 +1,12 @@ +package com.elink.esua.epdc.commons.tools.constant; + +/** + * Nacos配置中心相关常量 + * + * @author rongchao + * @Date 20-1-15 + */ +public interface NacosConfigConstant { + + String CONFIG_GROUP = "EPDC_CONFIG_GROUP"; +} diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NumConstant.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NumConstant.java index b7902105d..644503452 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NumConstant.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NumConstant.java @@ -29,6 +29,7 @@ public interface NumConstant { int THIRTY = 30; int FORTY = 40; int FIFTY = 50; + int SIXTY = 60; int ONE_HUNDRED = 100; long ZERO_L = 0L; diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/PointsConstant.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/PointsConstant.java new file mode 100644 index 000000000..f5eb87209 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/PointsConstant.java @@ -0,0 +1,13 @@ +package com.elink.esua.epdc.commons.tools.constant; + +/** + * @Auther: yinzuomei + * @Date: 2019/12/16 19:38 + * @Description: 积分用 + */ +public interface PointsConstant { + /** + * 手动调整积分编码 + */ + String ruleCode ="hand_regulation"; +} diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/StrConstant.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/StrConstant.java index 583d683f6..ee9566ee9 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/StrConstant.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/StrConstant.java @@ -38,4 +38,9 @@ public interface StrConstant { * 冒号 */ String COLON = ":"; + + /** + * 问号 + */ + String QUESTION_MARK = "?"; } diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/UserAuthTypeEnum.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/UserAuthTypeEnum.java new file mode 100644 index 000000000..3c372e4f2 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/UserAuthTypeEnum.java @@ -0,0 +1,35 @@ +package com.elink.esua.epdc.commons.tools.enums; + +/** + * 用户认证类别枚举类 + * + * @author rongchao + * @Date 19-12-19 + */ +public enum UserAuthTypeEnum { + + /** + * 居民认证 + */ + RESIDENT_AUTH("0"), + + /** + * 党员认证 + */ + PARTY_AUTH("1"), + + /** + * 志愿者认证 + */ + VOLUNTEER_AUTH("2"); + + private String value; + + UserAuthTypeEnum(String value) { + this.value = value; + } + + public String value() { + return this.value; + } +} diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/UserTagEnum.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/UserTagEnum.java new file mode 100644 index 000000000..a03ca4e29 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/UserTagEnum.java @@ -0,0 +1,28 @@ +package com.elink.esua.epdc.commons.tools.enums; + +/** + * @Author: yinzuomei + * @Date: 2019/12/17 19:11 + * @Description: 用户身份枚举类 + */ +public enum UserTagEnum { + /** + * 党员 + */ + PARTY_MEMBER("partymember"), + + /** + * 志愿者 + */ + VOLUNTEER("volunteer"); + + private String value; + + UserTagEnum(String value) { + this.value = value; + } + + public String value() { + return this.value; + } +} diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsBehaviorCodeEnum.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsBehaviorCodeEnum.java new file mode 100644 index 000000000..dfaab97d3 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsBehaviorCodeEnum.java @@ -0,0 +1,40 @@ +package com.elink.esua.epdc.commons.tools.enums.pointsenum; + +/** + * @Auther: yinzuomei + * @Date: 2020/2/6 14:01 + * @Description: 积分行为编码 + */ +public enum PointsBehaviorCodeEnum { + LIKE("like", "赞"), + DISLIKE("dislike", "踩"), + SHARE("share", "分享"), + CLOCK("clock", "打卡"), + COMMENT("comment", "评论"), + BREAK_PROMISE("break_promise", "爽约"), + JOIN_ACT("join_act", "活动积分"); + + private String behaviorCode; + private String name; + + PointsBehaviorCodeEnum(String behaviorCode, String name) { + this.behaviorCode = behaviorCode; + this.name = name; + } + + public String getBehaviorCode() { + return behaviorCode; + } + + public void setBehaviorCode(String behaviorCode) { + this.behaviorCode = behaviorCode; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsLimitTimeEnum.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsLimitTimeEnum.java new file mode 100644 index 000000000..a3092ed46 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsLimitTimeEnum.java @@ -0,0 +1,27 @@ +package com.elink.esua.epdc.commons.tools.enums.pointsenum; + +/** + * @Auther: yinzuomei + * @Date: 2019/12/13 09:43 + * @Description: 积分规则限制时限枚举类 + */ +public enum PointsLimitTimeEnum { + /** + * 限制时限(0-分钟,1-小时,2-日,3-月,4-年) + */ + LIMIT_TIME_MINUTE("0"), + LIMIT_TIME_HOUR("1"), + LIMIT_TIME_DAY("2"), + LIMIT_TIME_MONTH("3"), + LIMIT_TIME_YEAR("4"); + + private String value; + + PointsLimitTimeEnum(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsOperationEnum.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsOperationEnum.java new file mode 100644 index 000000000..6aa3fa9e3 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsOperationEnum.java @@ -0,0 +1,24 @@ +package com.elink.esua.epdc.commons.tools.enums.pointsenum; + +/** + * @Auther: yinzuomei + * @Date: 2019/12/13 09:31 + * @Description: 积分操作类型枚举类 + */ +public enum PointsOperationEnum { + /** + * 规则操作类型(0-减积分,1-加积分) + */ + OPERATION_TYPE_ADD("1"), + OPERATION_TYPE_SUBSTRACT("0"); + + private String operationType; + + PointsOperationEnum(String operationType) { + this.operationType = operationType; + } + + public String getOperationType() { + return operationType; + } +} diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsOperationModeEnum.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsOperationModeEnum.java new file mode 100644 index 000000000..c486cfb7a --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsOperationModeEnum.java @@ -0,0 +1,34 @@ +package com.elink.esua.epdc.commons.tools.enums.pointsenum; + +/** + * @Auther: yinzuomei + * @Date: 2019/12/13 09:33 + * @Description: 积分操作方式枚举类 + */ +public enum PointsOperationModeEnum { + + /** + * user-用户操作 + */ + OPERATION_MODE_USER("user"), + + /** + * admin-管理员操作 + */ + OPERATION_MODE_ADMIN("admin"), + + /** + * sys-系统操作 + */ + OPERATION_MODE_SYS("sys"); + + private String operationMode; + + PointsOperationModeEnum(String operationMode) { + this.operationMode = operationMode; + } + + public String getOperationMode() { + return operationMode; + } +} diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsRuleAvailableEnum.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsRuleAvailableEnum.java new file mode 100644 index 000000000..0ed15d169 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsRuleAvailableEnum.java @@ -0,0 +1,26 @@ +package com.elink.esua.epdc.commons.tools.enums.pointsenum; + +/** + * @Auther: yinzuomei + * @Date: 2019/12/12 15:04 + * @Description: 积分规则可用标志枚举类 + */ +public enum PointsRuleAvailableEnum { + + + /** + * 可用标记(0-不可用,1-可用) + */ + AVAILABLE_TRUE("1"), + AVAILABLE_FALSE("0"); + + private String value; + + PointsRuleAvailableEnum(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsRuleCodeEnum.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsRuleCodeEnum.java new file mode 100644 index 000000000..280e37b87 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsRuleCodeEnum.java @@ -0,0 +1,36 @@ +package com.elink.esua.epdc.commons.tools.enums.pointsenum; + +/** + * @Auther: yinzuomei + * @Date: 2020/2/6 14:00 + * @Description: 积分规则编码 + */ +public enum PointsRuleCodeEnum { + CANCEL_ACT("cancel_act", "取消报名系统扣减积分"), + CONFIRM_JOIN_ACT("confirm_join_act", "参与活动确认积分"); + + private String ruleCode; + private String name; + + PointsRuleCodeEnum(String ruleCode, String name) { + this.ruleCode = ruleCode; + this.name = name; + } + + public String getRuleCode() { + return ruleCode; + } + + public void setRuleCode(String ruleCode) { + this.ruleCode = ruleCode; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} + diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsUpperLimitEnum.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsUpperLimitEnum.java new file mode 100644 index 000000000..d65c768a1 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/pointsenum/PointsUpperLimitEnum.java @@ -0,0 +1,28 @@ +package com.elink.esua.epdc.commons.tools.enums.pointsenum; + +/** + * @Auther: yinzuomei + * @Date: 2019/12/13 09:48 + * @Description: 积分是否有上限限制 枚举类 + */ +public enum PointsUpperLimitEnum { + /** + * 是 + */ + YES("1"), + + /** + * 否 + */ + NO("0"); + + private String value; + + PointsUpperLimitEnum(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/GPSUtils.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/GPSUtils.java index 4a7b6fecd..ad1e5f979 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/GPSUtils.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/GPSUtils.java @@ -1,146 +1,155 @@ package com.elink.esua.epdc.commons.tools.utils; /** - * @Description TODO + * @Description * @Author yinzuomei * @Date 2019/12/27 10:00 */ public class GPSUtils { - public static double pi = 3.1415926535897932384626; - public static double x_pi = 3.14159265358979324 * 3000.0 / 180.0; - public static double a = 6378245.0; - public static double ee = 0.00669342162296594323; + public static double pi = 3.1415926535897932384626; + public static double x_pi = 3.14159265358979324 * 3000.0 / 180.0; + public static double a = 6378245.0; + public static double ee = 0.00669342162296594323; - public static double transformLat(double x, double y) { - double ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y - + 0.2 * Math.sqrt(Math.abs(x)); - ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0; - ret += (20.0 * Math.sin(y * pi) + 40.0 * Math.sin(y / 3.0 * pi)) * 2.0 / 3.0; - ret += (160.0 * Math.sin(y / 12.0 * pi) + 320 * Math.sin(y * pi / 30.0)) * 2.0 / 3.0; - return ret; - } + public static double transformLat(double x, double y) { + double ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + + 0.2 * Math.sqrt(Math.abs(x)); + ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0; + ret += (20.0 * Math.sin(y * pi) + 40.0 * Math.sin(y / 3.0 * pi)) * 2.0 / 3.0; + ret += (160.0 * Math.sin(y / 12.0 * pi) + 320 * Math.sin(y * pi / 30.0)) * 2.0 / 3.0; + return ret; + } - public static double transformLon(double x, double y) { - double ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 - * Math.sqrt(Math.abs(x)); - ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0; - ret += (20.0 * Math.sin(x * pi) + 40.0 * Math.sin(x / 3.0 * pi)) * 2.0 / 3.0; - ret += (150.0 * Math.sin(x / 12.0 * pi) + 300.0 * Math.sin(x / 30.0 - * pi)) * 2.0 / 3.0; - return ret; - } - public static double[] transform(double lat, double lon) { - if (outOfChina(lat, lon)) { - return new double[]{lat,lon}; - } - double dLat = transformLat(lon - 105.0, lat - 35.0); - double dLon = transformLon(lon - 105.0, lat - 35.0); - double radLat = lat / 180.0 * pi; - double magic = Math.sin(radLat); - magic = 1 - ee * magic * magic; - double sqrtMagic = Math.sqrt(magic); - dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi); - dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi); - double mgLat = lat + dLat; - double mgLon = lon + dLon; - return new double[]{mgLat,mgLon}; - } - public static boolean outOfChina(double lat, double lon) { - if (lon < 72.004 || lon > 137.8347) - return true; - if (lat < 0.8293 || lat > 55.8271) - return true; - return false; - } - /** - * 84 to 火星坐标系 (GCJ-02) World Geodetic System ==> Mars Geodetic System - * - * @param lat - * @param lon - * @return - */ - public static double[] gps84_To_Gcj02(double lat, double lon) { - if (outOfChina(lat, lon)) { - return new double[]{lat,lon}; - } - double dLat = transformLat(lon - 105.0, lat - 35.0); - double dLon = transformLon(lon - 105.0, lat - 35.0); - double radLat = lat / 180.0 * pi; - double magic = Math.sin(radLat); - magic = 1 - ee * magic * magic; - double sqrtMagic = Math.sqrt(magic); - dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi); - dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi); - double mgLat = lat + dLat; - double mgLon = lon + dLon; - return new double[]{mgLat, mgLon}; - } + public static double transformLon(double x, double y) { + double ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 + * Math.sqrt(Math.abs(x)); + ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0; + ret += (20.0 * Math.sin(x * pi) + 40.0 * Math.sin(x / 3.0 * pi)) * 2.0 / 3.0; + ret += (150.0 * Math.sin(x / 12.0 * pi) + 300.0 * Math.sin(x / 30.0 + * pi)) * 2.0 / 3.0; + return ret; + } - /** - * * 火星坐标系 (GCJ-02) to 84 * * @param lon * @param lat * @return - * */ - public static double[] gcj02_To_Gps84(double lat, double lon) { - double[] gps = transform(lat, lon); - double lontitude = lon * 2 - gps[1]; - double latitude = lat * 2 - gps[0]; - return new double[]{latitude, lontitude}; - } - /** - * 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法 将 GCJ-02 坐标转换成 BD-09 坐标 - * - * @param lat - * @param lon - */ - public static double[] gcj02_To_Bd09(double lat, double lon) { - double x = lon, y = lat; - double z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi); - double theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi); - double tempLon = z * Math.cos(theta) + 0.0065; - double tempLat = z * Math.sin(theta) + 0.006; - double[] gps = {tempLat,tempLon}; - return gps; - } + public static double[] transform(double lat, double lon) { + if (outOfChina(lat, lon)) { + return new double[]{lat, lon}; + } + double dLat = transformLat(lon - 105.0, lat - 35.0); + double dLon = transformLon(lon - 105.0, lat - 35.0); + double radLat = lat / 180.0 * pi; + double magic = Math.sin(radLat); + magic = 1 - ee * magic * magic; + double sqrtMagic = Math.sqrt(magic); + dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi); + dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi); + double mgLat = lat + dLat; + double mgLon = lon + dLon; + return new double[]{mgLat, mgLon}; + } - /** - * * 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法 * * 将 BD-09 坐标转换成GCJ-02 坐标 * * @param - * bd_lat * @param bd_lon * @return - */ - public static double[] bd09_To_Gcj02(double lat, double lon) { - double x = lon - 0.0065, y = lat - 0.006; - double z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi); - double theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi); - double tempLon = z * Math.cos(theta); - double tempLat = z * Math.sin(theta); - double[] gps = {tempLat,tempLon}; - return gps; - } + public static boolean outOfChina(double lat, double lon) { + if (lon < 72.004 || lon > 137.8347) + return true; + if (lat < 0.8293 || lat > 55.8271) + return true; + return false; + } - /**将gps84转为bd09 - * @param lat - * @param lon - * @return - */ - public static double[] gps84_To_bd09(double lat,double lon){ - double[] gcj02 = gps84_To_Gcj02(lat,lon); - double[] bd09 = gcj02_To_Bd09(gcj02[0],gcj02[1]); - return bd09; - } - public static double[] bd09_To_gps84(double lat,double lon){ - double[] gcj02 = bd09_To_Gcj02(lat, lon); - double[] gps84 = gcj02_To_Gps84(gcj02[0], gcj02[1]); - //保留小数点后六位 - gps84[0] = retain6(gps84[0]); - gps84[1] = retain6(gps84[1]); - return gps84; - } + /** + * 84 to 火星坐标系 (GCJ-02) World Geodetic System ==> Mars Geodetic System + * + * @param lat + * @param lon + * @return + */ + public static double[] gps84_To_Gcj02(double lat, double lon) { + if (outOfChina(lat, lon)) { + return new double[]{lat, lon}; + } + double dLat = transformLat(lon - 105.0, lat - 35.0); + double dLon = transformLon(lon - 105.0, lat - 35.0); + double radLat = lat / 180.0 * pi; + double magic = Math.sin(radLat); + magic = 1 - ee * magic * magic; + double sqrtMagic = Math.sqrt(magic); + dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi); + dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi); + double mgLat = lat + dLat; + double mgLon = lon + dLon; + return new double[]{mgLat, mgLon}; + } - /**保留小数点后六位 - * @param num - * @return - */ - private static double retain6(double num){ - String result = String .format("%.6f", num); - return Double.valueOf(result); - } + /** + * * 火星坐标系 (GCJ-02) to 84 * * @param lon * @param lat * @return + */ + public static double[] gcj02_To_Gps84(double lat, double lon) { + double[] gps = transform(lat, lon); + double lontitude = lon * 2 - gps[1]; + double latitude = lat * 2 - gps[0]; + return new double[]{latitude, lontitude}; + } + + /** + * 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法 将 GCJ-02 坐标转换成 BD-09 坐标 + * + * @param lat + * @param lon + */ + public static double[] gcj02_To_Bd09(double lat, double lon) { + double x = lon, y = lat; + double z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi); + double theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi); + double tempLon = z * Math.cos(theta) + 0.0065; + double tempLat = z * Math.sin(theta) + 0.006; + double[] gps = {tempLat, tempLon}; + return gps; + } + + /** + * * 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法 * * 将 BD-09 坐标转换成GCJ-02 坐标 * * @param + * bd_lat * @param bd_lon * @return + */ + public static double[] bd09_To_Gcj02(double lat, double lon) { + double x = lon - 0.0065, y = lat - 0.006; + double z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi); + double theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi); + double tempLon = z * Math.cos(theta); + double tempLat = z * Math.sin(theta); + double[] gps = {tempLat, tempLon}; + return gps; + } + + /** + * 将gps84转为bd09 + * + * @param lat + * @param lon + * @return + */ + public static double[] gps84_To_bd09(double lat, double lon) { + double[] gcj02 = gps84_To_Gcj02(lat, lon); + double[] bd09 = gcj02_To_Bd09(gcj02[0], gcj02[1]); + return bd09; + } + + public static double[] bd09_To_gps84(double lat, double lon) { + double[] gcj02 = bd09_To_Gcj02(lat, lon); + double[] gps84 = gcj02_To_Gps84(gcj02[0], gcj02[1]); + //保留小数点后六位 + gps84[0] = retain6(gps84[0]); + gps84[1] = retain6(gps84[1]); + return gps84; + } + + /** + * 保留小数点后六位 + * + * @param num + * @return + */ + private static double retain6(double num) { + String result = String.format("%.6f", num); + return Double.valueOf(result); + } } diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/LocalDateUtils.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/LocalDateUtils.java index 133340b24..f5e8324c5 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/LocalDateUtils.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/LocalDateUtils.java @@ -1,6 +1,9 @@ package com.elink.esua.epdc.commons.tools.utils; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; + +import java.math.BigDecimal; import java.time.*; import java.util.Date; @@ -48,4 +51,37 @@ public class LocalDateUtils { return Date.from(instant); } + + /** + * 计算两个时间间隔小时数 + * + * @param start 早的时间点 + * @param end 晚的时间点 + * @param scale 保留几位小数 + * @return java.math.BigDecimal + * @author work@yujt.net.cn + * @date 2020/4/3 17:27 + */ + public static BigDecimal durationHours(Date start, Date end, int scale) { + return durationHours(dateToLocalDateTime(start), dateToLocalDateTime(end), scale); + } + + /** + * {@link LocalDateUtils#durationHours(Date, Date, int)} + * + * @param start + * @param end + * @param scale + * @return java.math.BigDecimal + * @author work@yujt.net.cn + * @date 2020/4/3 17:33 + */ + public static BigDecimal durationHours(LocalDateTime start, LocalDateTime end, int scale) { + // 两个时间的间隔,早的时间点在前,晚的再后,否则为负数 + Duration duration = Duration.between(start, end); + // 间隔多少分钟, + long minutes = duration.toMinutes(); + return BigDecimal.valueOf(minutes).divide(BigDecimal.valueOf(NumConstant.SIXTY), scale, BigDecimal.ROUND_HALF_UP); + } + } diff --git a/esua-epdc/epdc-gateway/pom.xml b/esua-epdc/epdc-gateway/pom.xml deleted file mode 100644 index 922d20d50..000000000 --- a/esua-epdc/epdc-gateway/pom.xml +++ /dev/null @@ -1,246 +0,0 @@ - - - 4.0.0 - - - com.esua.epdc - esua-epdc - 1.0.0 - - - epdc-gateway - jar - - - - com.esua.epdc - epdc-commons-tools - 1.0.0 - - - org.springframework.cloud - spring-cloud-starter-gateway - - - com.alibaba.cloud - spring-cloud-starter-alibaba-nacos-discovery - - - org.springframework.cloud - spring-cloud-starter-netflix-hystrix - - - de.codecentric - spring-boot-admin-starter-client - ${spring.boot.admin.version} - - - - org.springframework.cloud - spring-cloud-starter-zipkin - - - com.esua.epdc - epdc-common-clienttoken - 1.0.0 - compile - - - - com.esua.epdc - epdc-common-clienttoken - 1.0.0 - - - - - ${project.artifactId} - - - org.springframework.boot - spring-boot-maven-plugin - - - org.apache.maven.plugins - maven-surefire-plugin - - true - - - - org.apache.maven.plugins - maven-deploy-plugin - - true - - - - com.spotify - dockerfile-maven-plugin - - - - - - - dev - - true - - - 9094 - dev - dev - - - 2 - 47.104.224.45 - 6379 - elink@888 - - - lb://epdc-auth-server - - http://127.0.0.1:9092 - lb://epdc-activiti-server - - lb://epdc-api-server - - lb://epdc-app-server - - lb://epdc-heart-server - - lb://epdc-job-server - - lb://epdc-message-server - - - http://127.0.0.1:9064 - lb://epdc-oss-server - lb://epdc-events-server - - http://127.0.0.1:9060 - - http://127.0.0.1:9085 - - lb://epdc-services-server - - - - http://127.0.0.1:9068 - lb://epdc-demo-server - http://127.0.0.1:9063 - - lb://epdc-websocket-server - lb://epdc-kpi-server - - lb://epdc-custom-server - - lb://epdc-analysis-server - - false - 47.104.224.45:8848 - - 6a3577b4-7b79-43f6-aebb-9c3f31263f6a - - http://localhost:9411 - - - - test - - 10000 - test - test - - - 2 - 47.104.224.45 - 6379 - elink@888 - - - lb://epdc-auth-server - lb://epdc-admin-server - lb://epdc-activiti-server - - lb://epdc-api-server - lb://epdc-app-server - lb://epdc-heart-server - lb://epdc-job-server - lb://epdc-message-server - - lb://epdc-news-server - lb://epdc-oss-server - lb://epdc-events-server - lb://epdc-cloud-analysis-server - lb://epdc-work-record-server - lb://epdc-services-server - - lb://epdc-user-server - lb://epdc-demo-server - lb://epdc-group-server - lb://epdc-websocket-server - lb://epdc-kpi-server - lb://epdc-custom-server - lb://epdc-analysis-server - - - true - 47.104.224.45:8848 - 47.104.85.99 - 6a3577b4-7b79-43f6-aebb-9c3f31263f6a - - http://localhost:9411 - - - - - prod - - 9094 - prod - prod - - - lb://epdc-auth-server - lb://epdc-admin-server - lb://epdc-activiti-server - lb://epdc-api-server - lb://epdc-app-server - lb://epdc-heart-server - lb://epdc-job-server - lb://epdc-message-server - lb://epdc-news-server - lb://epdc-oss-server - lb://epdc-cloud-analysis-server - lb://epdc-work-record-server - lb://epdc-events-server - lb://epdc-services-server - lb://epdc-user-server - lb://epdc-demo-server - lb://epdc-group-server - lb://epdc-websocket-server - lb://epdc-kpi-server - lb://epdc-custom-server - lb://epdc-analysis-server - - - 0 - 172.16.0.54 - 6379 - Elink833066 - - - true - 172.16.0.52:8848 - - - - http://localhost:9411 - - - - - diff --git a/esua-epdc/epdc-gateway/src/main/java/com/elink/esua/epdc/config/CorsConfig.java b/esua-epdc/epdc-gateway/src/main/java/com/elink/esua/epdc/config/CorsConfig.java deleted file mode 100644 index 5f0515c53..000000000 --- a/esua-epdc/epdc-gateway/src/main/java/com/elink/esua/epdc/config/CorsConfig.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Copyright (c) 2018 人人开源 All rights reserved. - *

- * https://www.renren.io - *

- * 版权所有,侵权必究! - */ - -package com.elink.esua.epdc.config; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.web.ServerProperties; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.HttpStatus; -import org.springframework.http.server.reactive.ServerHttpRequest; -import org.springframework.http.server.reactive.ServerHttpResponse; -import org.springframework.web.cors.reactive.CorsUtils; -import org.springframework.web.server.ServerWebExchange; -import org.springframework.web.server.WebFilter; -import org.springframework.web.server.WebFilterChain; -import reactor.core.publisher.Mono; - -/** - * Cors跨域 - * - * @author Mark sunlightcs@gmail.com - * @since 1.0.0 - */ -@Configuration -public class CorsConfig { - - private static final String MAX_AGE = "18000L"; - - @Autowired - private ServerProperties serverProperties; - - @Bean - public WebFilter corsFilter() { - return (ServerWebExchange ctx, WebFilterChain chain) -> { - ServerHttpRequest request = ctx.getRequest(); - if (!CorsUtils.isCorsRequest(request)) { - return chain.filter(ctx); - } - HttpHeaders requestHeaders = request.getHeaders(); - ServerHttpResponse response = ctx.getResponse(); - HttpMethod requestMethod = requestHeaders.getAccessControlRequestMethod(); - HttpHeaders headers = response.getHeaders(); - if (!request.getURI().getPath().startsWith(serverProperties.getServlet().getContextPath().concat("/ws"))) { - headers.add(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, requestHeaders.getOrigin()); - headers.add(HttpHeaders.ACCESS_CONTROL_ALLOW_CREDENTIALS, "true"); - } - headers.addAll(HttpHeaders.ACCESS_CONTROL_ALLOW_HEADERS, requestHeaders.getAccessControlRequestHeaders()); - if (requestMethod != null) { - headers.add(HttpHeaders.ACCESS_CONTROL_ALLOW_METHODS, requestMethod.name()); - } - headers.add(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "*"); - headers.add(HttpHeaders.ACCESS_CONTROL_MAX_AGE, MAX_AGE); - if (request.getMethod() == HttpMethod.OPTIONS) { - response.setStatusCode(HttpStatus.OK); - return Mono.empty(); - } - return chain.filter(ctx); - }; - } - -} diff --git a/esua-epdc/epdc-gateway/src/main/java/com/elink/esua/epdc/feign/ResourceFeignClient.java b/esua-epdc/epdc-gateway/src/main/java/com/elink/esua/epdc/feign/ResourceFeignClient.java deleted file mode 100644 index b52b556f8..000000000 --- a/esua-epdc/epdc-gateway/src/main/java/com/elink/esua/epdc/feign/ResourceFeignClient.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Copyright (c) 2018 人人开源 All rights reserved. - *

- * https://www.renren.io - *

- * 版权所有,侵权必究! - */ - -package com.elink.esua.epdc.feign; - -import com.elink.esua.epdc.common.token.dto.TokenDto; -import com.elink.esua.epdc.feign.fallback.ResourceFeignClientFallback; -import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; -import com.elink.esua.epdc.commons.tools.security.user.UserDetail; -import com.elink.esua.epdc.commons.tools.utils.Result; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.http.HttpHeaders; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestParam; - -/** - * 资源接口 - * - * @author Mark sunlightcs@gmail.com - * @since 1.0.0 - */ -@FeignClient(name = ServiceConstant.EPDC_AUTH_SERVER, fallback = ResourceFeignClientFallback.class) -public interface ResourceFeignClient { - - /** - * 是否有资源访问权限 - * - * @param token token - * @param url 资源URL - * @param method 请求方式 - * @return 有访问权限,则返回用户信息 - */ - @PostMapping("auth/resource") - Result resource(@RequestHeader(HttpHeaders.ACCEPT_LANGUAGE) String language, @RequestParam("token") String token, - @RequestParam("url") String url, @RequestParam("method") String method); - - /** - * 获取登录用户信息 - * - * @param token - * @return com.elink.esua.epdc.commons.tools.utils.Result - * @author - * @date 2019/8/19 17:19 - */ - @GetMapping("auth/getLoginUserInfo") - Result getLoginUserInfo(@RequestParam("token") String token); -} diff --git a/esua-epdc/epdc-gateway/src/main/java/com/elink/esua/epdc/feign/fallback/ResourceFeignClientFallback.java b/esua-epdc/epdc-gateway/src/main/java/com/elink/esua/epdc/feign/fallback/ResourceFeignClientFallback.java deleted file mode 100644 index 987d2ff79..000000000 --- a/esua-epdc/epdc-gateway/src/main/java/com/elink/esua/epdc/feign/fallback/ResourceFeignClientFallback.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (c) 2018 人人开源 All rights reserved. - *

- * https://www.renren.io - *

- * 版权所有,侵权必究! - */ - -package com.elink.esua.epdc.feign.fallback; - -import com.elink.esua.epdc.common.token.dto.TokenDto; -import com.elink.esua.epdc.commons.tools.security.user.UserDetail; -import com.elink.esua.epdc.commons.tools.utils.Result; -import com.elink.esua.epdc.feign.ResourceFeignClient; -import org.springframework.stereotype.Component; - -/** - * 资源接口 Fallback - * - * @author Mark sunlightcs@gmail.com - * @since 1.0.0 - */ -@Component -public class ResourceFeignClientFallback implements ResourceFeignClient { - - @Override - public Result resource(String language, String token, String url, String method) { - return new Result().error(); - } - - @Override - public Result getLoginUserInfo(String token) { - return new Result().error(); - } -} diff --git a/esua-epdc/epdc-gateway/src/main/java/com/elink/esua/epdc/filter/AuthFilter.java b/esua-epdc/epdc-gateway/src/main/java/com/elink/esua/epdc/filter/AuthFilter.java deleted file mode 100644 index 864cf6fcc..000000000 --- a/esua-epdc/epdc-gateway/src/main/java/com/elink/esua/epdc/filter/AuthFilter.java +++ /dev/null @@ -1,154 +0,0 @@ -/** - * Copyright (c) 2018 人人开源 All rights reserved. - * - * https://www.renren.io - * - * 版权所有,侵权必究! - */ - -package com.elink.esua.epdc.filter; - -import com.alibaba.fastjson.JSON; -import com.elink.esua.epdc.feign.ResourceFeignClient; -import com.elink.esua.epdc.commons.tools.constant.Constant; -import com.elink.esua.epdc.commons.tools.security.user.UserDetail; -import com.elink.esua.epdc.commons.tools.utils.Result; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.cloud.gateway.filter.GatewayFilterChain; -import org.springframework.cloud.gateway.filter.GlobalFilter; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.io.buffer.DataBuffer; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.server.reactive.ServerHttpRequest; -import org.springframework.util.AntPathMatcher; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.nio.charset.StandardCharsets; -import java.util.List; - -/** - * 权限过滤器 - * - * @author Mark sunlightcs@gmail.com - * @since 1.0.0 - */ -@Configuration -@ConfigurationProperties(prefix = "renren") -public class AuthFilter implements GlobalFilter { - - private final AntPathMatcher antPathMatcher = new AntPathMatcher(); - - @Autowired - private ResourceFeignClient resourceFeignClient; - /** - * 不拦截的urls - */ - private List urls; - - /** - * 不拦截工作端urls - */ - private List workLoginUrls; - - /** - * 拦截的工作端urls - */ - private List workUrls; - - @Override - public Mono filter(ServerWebExchange exchange, GatewayFilterChain chain) { - ServerHttpRequest request = exchange.getRequest(); - String requestUri = request.getPath().pathWithinApplication().value(); - - //请求放行,无需验证权限 - if(pathMatcher(requestUri)){ - return chain.filter(exchange); - } - - //获取用户token - String token = request.getHeaders().getFirst(Constant.TOKEN_HEADER); - if(StringUtils.isBlank(token)){ - token = request.getHeaders().getFirst(Constant.AUTHORIZATION_HEADER); - if (StringUtils.isBlank(token)) { - token = request.getQueryParams().getFirst(Constant.TOKEN_HEADER); - } - } - - //资源访问权限 - String language = request.getHeaders().getFirst(HttpHeaders.ACCEPT_LANGUAGE); - Result result = resourceFeignClient.resource(language, token, requestUri, request.getMethod().toString()); - //没权限访问,直接返回 - if(!result.success()){ - return response(exchange, result); - } - - //获取用户信息 - UserDetail userDetail = result.getData(); - if(userDetail != null){ - //当前登录用户userId,添加到header中 - ServerHttpRequest build = exchange.getRequest().mutate().header(Constant.USER_KEY, userDetail.getId()+"").build(); - return chain.filter(exchange.mutate().request(build).build()); - } - - return chain.filter(exchange); - } - - private Mono response(ServerWebExchange exchange, Object object) { - String json = JSON.toJSONString(object); - DataBuffer buffer = exchange.getResponse().bufferFactory().wrap(json.getBytes(StandardCharsets.UTF_8)); - exchange.getResponse().getHeaders().setContentType(MediaType.APPLICATION_JSON_UTF8); - exchange.getResponse().setStatusCode(HttpStatus.OK); - return exchange.getResponse().writeWith(Flux.just(buffer)); - } - - private boolean pathMatcher(String requestUri){ - for (String url : workLoginUrls) { - if(antPathMatcher.match(url, requestUri)){ - return true; - } - } - - for (String url : workUrls) { - if(antPathMatcher.match(url, requestUri)){ - return false; - } - } - - for (String url : urls) { - if(antPathMatcher.match(url, requestUri)){ - return true; - } - } - return false; - } - - public List getUrls() { - return urls; - } - - public void setUrls(List urls) { - this.urls = urls; - } - - public List getWorkLoginUrls() { - return workLoginUrls; - } - - public void setWorkLoginUrls(List workLoginUrls) { - this.workLoginUrls = workLoginUrls; - } - - public List getWorkUrls() { - return workUrls; - } - - public void setWorkUrls(List workUrls) { - this.workUrls = workUrls; - } -} diff --git a/esua-epdc/epdc-gateway/src/main/java/com/elink/esua/epdc/filter/CpAuthGatewayFilterFactory.java b/esua-epdc/epdc-gateway/src/main/java/com/elink/esua/epdc/filter/CpAuthGatewayFilterFactory.java deleted file mode 100644 index eb394b104..000000000 --- a/esua-epdc/epdc-gateway/src/main/java/com/elink/esua/epdc/filter/CpAuthGatewayFilterFactory.java +++ /dev/null @@ -1,131 +0,0 @@ - -package com.elink.esua.epdc.filter; - -import com.alibaba.fastjson.JSON; -import com.elink.esua.epdc.common.token.dto.TokenDto; -import com.elink.esua.epdc.commons.tools.constant.Constant; -import com.elink.esua.epdc.commons.tools.utils.Result; -import com.elink.esua.epdc.feign.ResourceFeignClient; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.cloud.gateway.filter.GatewayFilter; -import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory; -import org.springframework.core.io.buffer.DataBuffer; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.server.reactive.ServerHttpRequest; -import org.springframework.stereotype.Component; -import org.springframework.util.AntPathMatcher; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.nio.charset.StandardCharsets; -import java.util.Arrays; -import java.util.List; - -/** - * app接口权限过滤器 - * - * @author Mark sunlightcs@gmail.com - * @since 1.0.0 - */ -@Component("CpAuth") -public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory { - - @Autowired - private ResourceFeignClient resourceFeignClient; - - @Autowired - private CpProperty cpProperty; - - private final AntPathMatcher antPathMatcher = new AntPathMatcher(); - - @Override - public List shortcutFieldOrder() { - return Arrays.asList("enabled"); - } - - public CpAuthGatewayFilterFactory() { - super(CpAuthGatewayFilterFactory.CpAuthConfig.class); - } - - @Override - public GatewayFilter apply(CpAuthConfig config) { - return (exchange, chain) -> { - if (!config.isEnabled()) { - return chain.filter(exchange); - } - - ServerHttpRequest request = exchange.getRequest(); - String requestUri = request.getPath().pathWithinApplication().value(); - - //请求放行,无需验证权限 - if (!pathMatcher(requestUri)) { - return chain.filter(exchange); - } - - HttpHeaders headers = request.getHeaders(); - String token = headers.getFirst(Constant.AUTHORIZATION_HEADER); - if (StringUtils.isBlank(token)) { - token = request.getQueryParams().getFirst(Constant.AUTHORIZATION_HEADER); - if (StringUtils.isBlank(token)) { - return chain.filter(exchange); - } - } - Result result = resourceFeignClient.getLoginUserInfo(token); - if (!result.success()) { - return response(exchange, result); - } - TokenDto user = result.getData(); - //当前登录用户userId,添加到header中 - if (user != null) { - ServerHttpRequest build = exchange.getRequest().mutate().header(Constant.APP_USER_KEY, user.getUserId()).build(); - return chain.filter(exchange.mutate().request(build).build()); - } - return chain.filter(exchange); - }; - } - - private Mono response(ServerWebExchange exchange, Object object) { - String json = JSON.toJSONString(object); - DataBuffer buffer = exchange.getResponse().bufferFactory().wrap(json.getBytes(StandardCharsets.UTF_8)); - exchange.getResponse().getHeaders().setContentType(MediaType.APPLICATION_JSON_UTF8); - exchange.getResponse().setStatusCode(HttpStatus.OK); - return exchange.getResponse().writeWith(Flux.just(buffer)); - } - - private boolean pathMatcher(String requestUri) { - for (String url : cpProperty.getSwaggerUrls()) { - if (antPathMatcher.match(url, requestUri)) { - return false; - } - } - for (String url : cpProperty.getUrls()) { - if (antPathMatcher.match(url, requestUri)) { - return true; - } - } - return false; - } - - public static class CpAuthConfig { - - /** - * 控制是否开启认证 - */ - private boolean enabled; - - public CpAuthConfig() { - } - - public boolean isEnabled() { - return enabled; - } - - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } - } -} diff --git a/esua-epdc/epdc-gateway/src/main/java/com/elink/esua/epdc/filter/CpProperty.java b/esua-epdc/epdc-gateway/src/main/java/com/elink/esua/epdc/filter/CpProperty.java deleted file mode 100644 index b15e785e7..000000000 --- a/esua-epdc/epdc-gateway/src/main/java/com/elink/esua/epdc/filter/CpProperty.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.elink.esua.epdc.filter; - -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * @author rongchao - * @Date 19-5-17 - */ -@Data -@Component -@EnableConfigurationProperties -@ConfigurationProperties(prefix = "epdc") -public class CpProperty { - - private List urls; - - /** - * 不处理token,直接通过 - */ - private List swaggerUrls; - -} diff --git a/esua-epdc/epdc-gateway/src/main/resources/application.yml b/esua-epdc/epdc-gateway/src/main/resources/application.yml deleted file mode 100644 index 3cda8ce6d..000000000 --- a/esua-epdc/epdc-gateway/src/main/resources/application.yml +++ /dev/null @@ -1,280 +0,0 @@ -server: - tomcat: - max-swallow-size: 100MB - port: @server.port@ - servlet: - context-path: /epdc-api - -spring: - application: - name: epdc-gateway-server - #环境 dev|test|prod - profiles: - active: @spring.profiles.active@ - servlet: - multipart: - enabled: true - file-size-threshold: 0 - max-file-size: 100MB - max-request-size: 100MB - redis: - database: @spring.redis.index@ - host: @spring.redis.host@ - timeout: 30s - port: @spring.redis.port@ - password: @spring.redis.password@ - cloud: - gateway: - locator: - enabled: true - routes: - #认证服务 - - id: epdc-auth-server - uri: @gateway.routes.epdc-auth-server.uri@ - order: 1 - predicates: - - Path=${server.servlet.context-path}/auth/** - filters: - - StripPrefix=1 - #Admin服务 - - id: epdc-admin-server - uri: @gateway.routes.epdc-admin-server.uri@ - order: 2 - predicates: - - Path=${server.servlet.context-path}/sys/** - filters: - - StripPrefix=1 - #OSS服务 - - id: epdc-oss-server - uri: @gateway.routes.epdc-oss-server.uri@ - order: 3 - predicates: - - Path=${server.servlet.context-path}/oss/** - filters: - - StripPrefix=1 - #消息服务 - - id: epdc-message-server - uri: @gateway.routes.epdc-message-server.uri@ - order: 4 - predicates: - - Path=${server.servlet.context-path}/message/** - filters: - - StripPrefix=1 - #工作流服务 - - id: epdc-activiti-server - uri: @gateway.routes.epdc-activiti-server.uri@ - order: 5 - predicates: - - Path=${server.servlet.context-path}/activiti/** - filters: - - StripPrefix=1 - #定时任务服务 - - id: epdc-job-server - uri: @gateway.routes.epdc-job-server.uri@ - order: 6 - predicates: - - Path=${server.servlet.context-path}/job/** - filters: - - StripPrefix=1 - #APP流服务 - - id: epdc-api-server - uri: @gateway.routes.epdc-api-server.uri@ - order: 7 - predicates: - - Path=${server.servlet.context-path}/api/** - filters: - - StripPrefix=1 - - CpAuth=true - #爱心互助模块 - - id: epdc-heart-server - uri: @gateway.routes.epdc-heart-server.uri@ - order: 8 - predicates: - - Path=${server.servlet.context-path}/heart/** - filters: - - StripPrefix=1 - #友邻社群模块 - - id: epdc-group-server - uri: @gateway.routes.epdc-group-server.uri@ - order: 9 - predicates: - - Path=${server.servlet.context-path}/group/** - filters: - - StripPrefix=1 - #新闻公告模块 - - id: epdc-news-server - uri: @gateway.routes.epdc-news-server.uri@ - order: 10 - predicates: - - Path=${server.servlet.context-path}/news/** - filters: - - StripPrefix=1 - #党群议事模块 - - id: epdc-events-server - uri: @gateway.routes.epdc-events-server.uri@ - order: 11 - predicates: - - Path=${server.servlet.context-path}/events/** - filters: - - StripPrefix=1 - #生活服务模块 - - id: epdc-services-server - uri: @gateway.routes.epdc-services-server.uri@ - order: 12 - predicates: - - Path=${server.servlet.context-path}/services/** - filters: - - StripPrefix=1 - #APP用户模块 - - id: epdc-user-server - uri: @gateway.routes.epdc-user-server.uri@ - order: 13 - predicates: - - Path=${server.servlet.context-path}/app-user/** - filters: - - StripPrefix=1 - #DEMO服务 - - id: epdc-demo-server - uri: @gateway.routes.epdc-demo-server.uri@ - order: 14 - predicates: - - Path=${server.servlet.context-path}/demo/** - filters: - - StripPrefix=1 - #websocket服务 - - id: epdc-websocket-server - uri: @gateway.routes.epdc-websocket-server.uri@ - order: 15 - predicates: - - Path=${server.servlet.context-path}/ws/** - filters: - - StripPrefix=1 - #绩效考核模块 - - id: epdc-kpi-server - uri: @gateway.routes.epdc-kpi-server.uri@ - order: 16 - predicates: - - Path=${server.servlet.context-path}/kpi/** - filters: - - StripPrefix=1 - #定制模块 - - id: epdc-custom-server - uri: @gateway.routes.epdc-custom-server.uri@ - order: 17 - predicates: - - Path=${server.servlet.context-path}/custom/** - filters: - - StripPrefix=1 - #数据分析模块 - - id: epdc-analysis-server - uri: @gateway.routes.epdc-analysis-server.uri@ - order: 18 - predicates: - - Path=${server.servlet.context-path}/analysis/** - filters: - - StripPrefix=1 - - id: epdc-cloud-analysis-server - uri: @gateway.routes.epdc-cloud-analysis-server.uri@ - order: 19 - predicates: - - Path=${server.servlet.context-path}/cloudAnalysis/** - filters: - - StripPrefix=1 - #工作日志 - - id: epdc-work-record-server - uri: @gateway.routes.epdc-work-record-server.uri@ - order: 20 - predicates: - - Path=${server.servlet.context-path}/workRecord/** - filters: - - StripPrefix=1 - nacos: - discovery: - server-addr: @nacos.server-addr@ - register-enabled: @nacos.register-enabled@ - ip: @nacos.ip@ - namespace: @nacos.namespace@ - zipkin: - # 指定了 zipkin 服务器的地址 - base-url: @spring.zipkin.base-url@ - sleuth: - sampler: - # 将采样比例设置为 1.0,也就是全部都需要。默认是 0.1 - probability: 1.0 -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: ALWAYS - - -feign: - hystrix: - enabled: true - -hystrix: - command: - default: - execution: - isolation: - thread: - timeoutInMilliseconds: 60000 #缺省为1000 - -ribbon: - ReadTimeout: 300000 - ConnectTimeout: 300000 - -renren: - urls: - - /auth/captcha - - /auth/login - - /*/swagger-resources/** - - /*/swagger-ui.html - - /*/webjars/** - - /*/v2/api-docs - - /*/swagger/api-docs - - /monitor/** - - /api/** - - /activiti/modeler.html - - /activiti/service/** - - /activiti/editor-app/** - - /message/sms/sendCode #发送验证码 - - /heart/** - - /oss/file/download - - /ws/** - - /custom/epidemicSentryPost/downloadQRCode/** - workLoginUrls: - - /api/work/user/getToken #工作端-获取token - - /api/work/user/login #工作端-登录 - - /api/analysis/user/getToken #数据分析端-获取token - - /api/analysis/user/login #数据分析端-登录 - - /api/work/*/swagger/** - workUrls: - - /api/work/** #工作端接口 - - /api/analysis/** #数据端接口 - - /cloudAnalysis/** #数据端接口 - - /workRecord/** #工作日志接口 - -epdc: - # 党建e家接口 - urls: - - /api/** - # 不处理token,直接通过 - swaggerUrls: - - /api/wx/getWxConfig # 获取微信公众号配置 - - /api/admin/dept/completeName # 获取完整部门名称 - - /api/message/sms/sendCode # 发送短信验证码 - - /api/message/sms/registerResult # 发送用户注册审核结果 - - /api/events/issue/upload # 上传图片 - - /api/app-user/user/mp/regist # 公众号用户注册 - - /api/app-user/user/ma/getToken # 小程序用户 登录 - - /api/app-user/user/ma/regist # 小程序用户 注册 - - /api/app-user/user/ma/gridLeaderRegister # 小程序用户 网格长注册 - - /api/app-user/user/ma/v2/getToken # 小程序用户 注册或登录(版本v2) - - /api/work/** #工作端接口不拦截 - - /api/analysis/** #数据端接口不拦截 - - /cloudAnalysis/** #数据端接口 - - /workRecord/** #工作日志接口 diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/pom.xml b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/pom.xml index f3e4850f0..115f0640d 100644 --- a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/pom.xml @@ -149,9 +149,9 @@ 2 - 47.104.224.45 - 6379 - elink@888 + 114.215.125.123 + 9603 + epdc!redis@master1405 true diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppActUserCancelsignupDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppActUserCancelsignupDTO.java new file mode 100644 index 000000000..fee9ec4fb --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppActUserCancelsignupDTO.java @@ -0,0 +1,53 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto.form; + +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 取消报名参数 + * + * @author wanggongfeng + * @since v1.0.0 2019-12-17 + */ +@Data +public class EpdcAppActUserCancelsignupDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private String userId; + /** + * 活动ID + */ + @NotBlank(message = "活动ID不能为空") + private String actId; + + /** + * 取消报名原因 + */ + @NotBlank(message = "取消报名原因不能为空") + @Length(max = 150, message = "取消报名原因不能超过150字") + private String failureReason; +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppActUserClockLogDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppActUserClockLogDTO.java new file mode 100644 index 000000000..2d30a4525 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppActUserClockLogDTO.java @@ -0,0 +1,80 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; + +/** + * 用户打卡参数 + * + * @author wanggongfeng + * @since v1.0.0 2019-12-17 + */ +@Data +public class EpdcAppActUserClockLogDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private String userId; + /** + * 活动ID + */ + @NotBlank(message = "活动ID不能为空") + private String actId; + /** + * 打卡描述 + */ + @NotBlank(message = "打卡描述不能为空") + private String clockDesc; + /** + * 打卡位置经度 + */ + private BigDecimal clockLongitude; + /** + * 打卡位置纬度 + */ + private BigDecimal clockLatitude; + /** + * 打卡地址 + */ + @NotBlank(message = "打卡地址不能为空") + private String clockAddress; + /** + * 打卡图片 + */ + private ArrayList images; + /** + * 打卡类型(0-打卡,1-更新打卡) + */ + @NotBlank(message = "打卡类型不能为空") + private String clockType; + /** + * 打卡是否有效(0-否,1-是) + */ + @NotBlank(message = "打卡是否有效不能为空") + private String effectiveFlag; + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcCompleteUserInfoFormDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcCompleteUserInfoFormDTO.java index ca49d2f3e..6c3ccb3ec 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcCompleteUserInfoFormDTO.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcCompleteUserInfoFormDTO.java @@ -23,6 +23,7 @@ public class EpdcCompleteUserInfoFormDTO implements Serializable { * 身份证号码 */ private String identityNo; + /** * 手机号 */ diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/v2/EpdcCompleteUserInfoFormV2DTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/v2/EpdcCompleteUserInfoFormV2DTO.java index f4094c08c..30262ad20 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/v2/EpdcCompleteUserInfoFormV2DTO.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/v2/EpdcCompleteUserInfoFormV2DTO.java @@ -72,4 +72,10 @@ public class EpdcCompleteUserInfoFormV2DTO implements Serializable { * 居住网格id */ private Long gridId; + + /////////////////////////////////////////非必要字段,特殊场景使用 + /** + * 认证类型 参考 UserAuthTypeEnum + */ + private String userAuthType; } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcAppClockListDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcAppClockListDTO.java new file mode 100644 index 000000000..8cfa70ea3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcAppClockListDTO.java @@ -0,0 +1,48 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 打卡列表 + * + * @author wanggongfeng + * @since v1.0.0 2019-12-18 + */ +@Data +public class EpdcAppClockListDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 活动打卡人次 + */ + private int clockNum; + + /** + * 打卡列表 + */ + private List clocks; + + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcAppVolunteerRankDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcAppVolunteerRankDTO.java new file mode 100644 index 000000000..d589c4f99 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcAppVolunteerRankDTO.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 志愿者排名 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-18 + */ +@Data +public class EpdcAppVolunteerRankDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 排名 + */ + private Integer sort; + + /** + * 头像 + */ + private String faceImg; + + /** + * 用户名 + */ + private String nickname; + + /** + * 是否党员(0-否,1-是) + */ + private String partyFlag; + + /** + * 爱心时长(单位:小时) + */ + private BigDecimal kindnessTime; + + /** + * 参加次数 + */ + private Integer participationNum; + + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/pom.xml b/esua-epdc/epdc-module/epdc-api/epdc-api-server/pom.xml index cc8a167fb..28b5823bf 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/pom.xml @@ -13,7 +13,6 @@ jar - @@ -22,6 +21,7 @@ epdc-api-client 1.0.0 + com.esua.epdc epdc-analysis-client @@ -32,30 +32,36 @@ epdc-commons-tools 1.0.0 + com.esua.epdc epdc-commons-mybatis 1.0.0 + org.springframework.boot spring-boot-starter-web + org.springframework spring-context-support + de.codecentric spring-boot-admin-starter-client ${spring.boot.admin.version} + com.alibaba.cloud spring-cloud-starter-alibaba-nacos-discovery + com.esua.epdc @@ -91,6 +97,10 @@ 1.0.0 compile + @@ -199,9 +209,9 @@ 10004 2 - 47.104.224.45 - 6379 - elink@888 + 114.215.125.123 + 9603 + epdc!redis@master1405 diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/ApiApplication.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/ApiApplication.java index 96d647692..cf7c97661 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/ApiApplication.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/ApiApplication.java @@ -1,11 +1,3 @@ -/** - * Copyright (c) 2018 人人开源 All rights reserved. - *

- * https://www.renren.io - *

- * 版权所有,侵权必究! - */ - package com.elink.esua.epdc; import org.springframework.boot.SpringApplication; @@ -16,8 +8,8 @@ import org.springframework.cloud.openfeign.EnableFeignClients; /** * API模块 * - * @author Mark sunlightcs@gmail.com - * @since 1.0.0 + * @author rongchao + * @Date 20-1-15 */ @SpringBootApplication @EnableDiscoveryClient diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActPhraseController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActPhraseController.java new file mode 100644 index 000000000..0a563cdf9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActPhraseController.java @@ -0,0 +1,47 @@ +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.service.ActPhraseService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * APP常用语相关接口 + * + * @author wanggongfeng + * @date 2019/12/17 10:30 + */ +@RestController +@RequestMapping("heart/phrase") +public class ApiActPhraseController { + + @Autowired + private ActPhraseService actPhraseService; + + /** + * 使用次数加一 + * @param id + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author wanggongfeng + * @date 2019/12/13 14:41 + */ + @PostMapping("sagenumAddOne") + public Result sagenumAddOneById(String id) { + return actPhraseService.sagenumAddOneById(id); + } + + /** + * 获取常用语列表 + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author wanggongfeng + * @date 2019/12/13 14:41 + */ + @GetMapping("getPhraseList") + public Result getPhraseList() { + return actPhraseService.getPhraseList(); + + } + + + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java new file mode 100644 index 000000000..0ccfad84a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java @@ -0,0 +1,166 @@ +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.activity.ActUserRelationDTO; +import com.elink.esua.epdc.activity.AppActUserCancelsignupDTO; +import com.elink.esua.epdc.activity.AppActUserClockLogDTO; +import com.elink.esua.epdc.activity.AppClockListDTO; +import com.elink.esua.epdc.activity.result.AppActInfoDTO; +import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.annotation.LoginUser; +import com.elink.esua.epdc.commons.tools.enums.UserTagEnum; +import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.IdentityNoUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO; +import com.elink.esua.epdc.dto.form.EpdcAppActUserCancelsignupDTO; +import com.elink.esua.epdc.dto.form.EpdcAppActUserClockLogDTO; +import com.elink.esua.epdc.dto.result.EpdcAppClockListDTO; +import com.elink.esua.epdc.service.ActUserRelationService; +import com.elink.esua.epdc.service.AppUserService; +import com.elink.esua.epdc.utils.UserTagUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Date; + +/** + * APP活动相关接口 + * + * @author wanggongfeng + * @date 2019/12/17 10:30 + */ +@RestController +@RequestMapping("heart/act") +public class ApiActUserRelationController { + + @Autowired + private ActUserRelationService actUserRelationService; + + @Autowired + private AppUserService appUserService; + + /** + * 活动报名 + * + * @param tokenDto + * @param actId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author wanggongfeng + * @date 2019/12/13 14:41 + */ + @PostMapping("signup") + public Result activitySignUp(@LoginUser TokenDto tokenDto, String actId) { + if (StringUtils.isBlank(actId)) { + return new Result().error("活动id不能为空"); + } + //验证是否为志愿者 + Result isVolunteer = appUserService.getVolunteerCountById(tokenDto); + int code = isVolunteer.getCode(); + if (code != 0) { + //不是志愿者 + return isVolunteer; + } + Result userInfo = appUserService.getInfoById(tokenDto); + EpdcUserInfoResultDTO epdcUserInfoResultDTO = userInfo.getData(); + + ActUserRelationDTO actUserRelationDTO = new ActUserRelationDTO(); + actUserRelationDTO.setActId(actId); + actUserRelationDTO.setUserId(tokenDto.getUserId()); + actUserRelationDTO.setNickname(tokenDto.getNickname()); + actUserRelationDTO.setFaceImg(tokenDto.getFaceImg()); + if (UserTagUtils.containIdentity(tokenDto.getUserTagInfos(), UserTagEnum.PARTY_MEMBER)) { + actUserRelationDTO.setPartyFlag(YesOrNoEnum.YES.value()); + } else { + actUserRelationDTO.setPartyFlag(YesOrNoEnum.NO.value()); + } + + + String identityNo = epdcUserInfoResultDTO.getIdentityNo(); + String identityNoVerification = IdentityNoUtils.IdentityNoVerification(identityNo); + if (StringUtils.isNotBlank(identityNoVerification)) { + return new Result().error(identityNoVerification); + } + actUserRelationDTO.setRealName(tokenDto.getRealName()); + String sex = IdentityNoUtils.getSex(identityNo); // 身份证解析性别 + actUserRelationDTO.setSex(sex); + actUserRelationDTO.setAge(IdentityNoUtils.getAge(identityNo)); + actUserRelationDTO.setMobile(tokenDto.getMobile()); + actUserRelationDTO.setIdentityNo(identityNo); + actUserRelationDTO.setStatus("0"); + actUserRelationDTO.setSignupTime(new Date()); + return actUserRelationService.activitySignUp(actUserRelationDTO); + + } + + /** + * 取消活动报名 + * + * @param tokenDto + * @param epdcAppActUserCancelsignupDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author wanggongfeng + * @date 2019/12/13 14:41 + */ + @PostMapping("cancelsignup") + public Result activityCancelSignUp(@LoginUser TokenDto tokenDto, @RequestBody EpdcAppActUserCancelsignupDTO epdcAppActUserCancelsignupDTO) { + ValidatorUtils.validateEntity(epdcAppActUserCancelsignupDTO); + epdcAppActUserCancelsignupDTO.setUserId(tokenDto.getUserId()); + AppActUserCancelsignupDTO actUserCancelsignupDTO = ConvertUtils.sourceToTarget(epdcAppActUserCancelsignupDTO, AppActUserCancelsignupDTO.class); + return actUserRelationService.activityCancelSignUp(actUserCancelsignupDTO); + + } + + /** + * 活动打卡 + * + * @param tokenDto + * @param epdcAppActUserClockLogDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author wanggongfeng + * @date 2019/12/13 14:41 + */ + @PostMapping("clock") + public Result activityClock(@LoginUser TokenDto tokenDto, @RequestBody EpdcAppActUserClockLogDTO epdcAppActUserClockLogDTO) { + ValidatorUtils.validateEntity(epdcAppActUserClockLogDTO); + AppActUserClockLogDTO appActUserClockLogDTO = ConvertUtils.sourceToTarget(epdcAppActUserClockLogDTO, AppActUserClockLogDTO.class); + appActUserClockLogDTO.setUserId(tokenDto.getUserId()); + return actUserRelationService.activityClock(appActUserClockLogDTO); + + } + + /** + * 获取打卡列表 + * + * @param tokenDto + * @param actId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author wanggongfeng + * @date 2019/12/13 14:41 + */ + @GetMapping("clockList") + public Result getClockList(@LoginUser TokenDto tokenDto, String actId) { + Result result = actUserRelationService.getClockList(actId); + EpdcAppClockListDTO epdcAppClockListDTO = ConvertUtils.sourceToTarget(result.getData(), EpdcAppClockListDTO.class); + Result result1 = new Result(); + result1.setData(epdcAppClockListDTO); + return result1; + + } + + /** + * 获取活动打卡地点详情 + * + * @param actId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author wanggongfeng + * @date 2019/12/13 14:41 + */ + @GetMapping("clockAddressDetail") + public Result clockAddressDetail(String actId) { + return actUserRelationService.clockAddressDetail(actId); + + } +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppActInfoController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppActInfoController.java new file mode 100644 index 000000000..cb152614a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppActInfoController.java @@ -0,0 +1,115 @@ +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.activity.ActBannerDTO; +import com.elink.esua.epdc.activity.form.ActInfoAppFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoAppResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoDetailAppResultDTO; +import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.annotation.LoginUser; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.service.ActInfoService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 移动端接口-项目模块 + * + * @Author LPF + * @Date 2019/11/18 13:32 + */ +@RestController +@RequestMapping("heart/act") +public class ApiAppActInfoController { + + @Autowired + private ActInfoService actInfoService; + + + /** + * 活动列表 + * + * @Params: [ formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: lipengfei + * @Date: 2019/11/19 16:34 + */ + @GetMapping("list") + public Result> listItems(ActInfoAppFormDTO formDto, @LoginUser TokenDto tokenDto) { + formDto.setUserId(tokenDto.getUserId()); + return actInfoService.listItems(formDto); + } + + /** + * 活动列表 + * + * @Params: [ formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: lipengfei + * @Date: 2019/11/19 16:34 + */ + @GetMapping("signupList") + public Result> signupListItems(ActInfoAppFormDTO formDto, @LoginUser TokenDto tokenDto) { + formDto.setUserId(tokenDto.getUserId()); + return actInfoService.signupListItems(formDto); + } + + /** + * 项目详情 + * + * @Params: [id] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result + * @Author: lipengfei + * @Date: 2019/11/19 16:34 + */ + @GetMapping("detail/{id}") + public Result detail(@PathVariable String id, @LoginUser TokenDto tokenDto) { + if (StringUtils.isBlank(id)) { + return new Result().error("id不能为空"); + } + ActInfoAppFormDTO formDto = new ActInfoAppFormDTO(); + formDto.setId(id); + formDto.setUserId(tokenDto.getUserId()); + return actInfoService.getDetail(formDto); + } + + /** + * 获取活动报名审核失败记录 + * + * @param id + * @param tokenDto + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2020/4/7 10:08 + */ + @GetMapping("rejectDetail/{id}") + public Result rejectDetail(@PathVariable String id, @LoginUser TokenDto tokenDto) { + ActInfoAppFormDTO formDto = new ActInfoAppFormDTO(); + formDto.setId(id); + formDto.setUserId(tokenDto.getUserId()); + return actInfoService.getRejectDetail(formDto); + } + + /** + * 项目详情 + * + * @Params: [id] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result + * @Author: lipengfei + * @Date: 2019/11/19 16:34 + */ + @GetMapping("cancelDetail/{id}") + public Result cancelDetail(@PathVariable String id) { + return actInfoService.getCancelDetail(id); + } + + @GetMapping("banner/list") + public Result> bannerList() { + return actInfoService.getBannerList(); + } +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppUserController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppUserController.java index 435ad40f0..4e48eee3a 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppUserController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppUserController.java @@ -22,7 +22,7 @@ import java.util.List; * 用户模块 * * @author yujintao - * @email yujintao@elink-cn.com + * @email yujintao@elink-cn.comuser/completeInfo * @date 2019/9/6 19:30 */ @RestController @@ -129,6 +129,7 @@ public class ApiAppUserController { * @author yujintao * @date 2019/9/9 10:52 */ + @Deprecated @GetMapping("user/mp/getToken") public Result getToken(EpdcAppUserTokenFormDTO formDto) { ValidatorUtils.validateEntity(formDto); @@ -270,6 +271,23 @@ public class ApiAppUserController { return appUserService.checkWxUnionId(tokenDto); } + /** + * 志愿者认证 + * + * @param tokenDto + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author wanggongfeng + * @date 2019/12/13 14:41 + */ + @PostMapping("volunteer/authenticate") + public Result volunteerAuthenticate(@LoginUser TokenDto tokenDto, @RequestBody EpdcCompleteVolunteerInfoFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + return appUserService.volunteerAuthenticate(tokenDto, formDto); + + } + + /** * 获取用户微信手机号 * diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiEvaluateController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiEvaluateController.java index 9bbadb612..18bf3b70c 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiEvaluateController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiEvaluateController.java @@ -10,7 +10,6 @@ import com.elink.esua.epdc.dto.evaluate.result.EvaluateOfficerAppResultDTO; import com.elink.esua.epdc.dto.evaluate.result.EvaluateOptionAppResultDTO; import com.elink.esua.epdc.dto.evaluate.result.RoleResultDTO; import com.elink.esua.epdc.service.EvaluateService; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -18,6 +17,7 @@ import java.util.List; /** * 移动端接口-项目模块 + * * @Author LPF * @Date 2019/11/18 13:32 */ @@ -31,20 +31,23 @@ public class ApiEvaluateController { /** * 街道干部列表 + * * @Params: [ formDto] - * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> * @Author: lipengfei * @Date: 2019/11/19 16:34 */ @GetMapping("getDeptOfficer") - public Result> getDeptOfficer(EvaluateOfficerAppFormDTO formDto,@LoginUser TokenDto tokenDto) { + public Result> getDeptOfficer(EvaluateOfficerAppFormDTO formDto, @LoginUser TokenDto tokenDto) { formDto.setGridId(tokenDto.getGridId()); return evaluateService.getDeptOfficer(formDto); } + /** * 评价列表 + * * @Params: [ formDto] - * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> * @Author: lipengfei * @Date: 2019/11/19 16:34 */ @@ -52,8 +55,10 @@ public class ApiEvaluateController { public Result> getOptionList(EvaluateOptionAppFormDTO formDto) { return evaluateService.getOptionList(formDto); } + /** * 评价状态 + * * @Params: [ formDto] * @Return: com.elink.esua.epdc.commons.tools.utils.Result<> * @Author: lipengfei @@ -63,10 +68,12 @@ public class ApiEvaluateController { public Result getAvailable() { return evaluateService.getAvailable(); } + /** * 评价提交 + * * @Params: [ formDto] - * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> * @Author: lipengfei * @Date: 2019/11/19 16:34 */ diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScanSwitchController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScanSwitchController.java index 137b8ffb6..5f9443486 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScanSwitchController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScanSwitchController.java @@ -43,7 +43,7 @@ import java.util.Map; @RestController @RequestMapping("ma") public class ApiScanSwitchController { - + @Autowired private ScanSwitchService scanSwitchService; diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiVolunteerRankController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiVolunteerRankController.java new file mode 100644 index 000000000..a0c104bdf --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiVolunteerRankController.java @@ -0,0 +1,42 @@ +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.result.EpdcAppVolunteerRankDTO; +import com.elink.esua.epdc.service.AppVolunteerRankService; +import com.elink.esua.epdc.volunteer.EpdcVolunteerRankDTO; +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; + +import java.util.List; + +/** + * APP爱心排名 + * + * @author wanggongfeng + * @date 2019/12/17 10:30 + */ +@RestController +@RequestMapping("heart/volunteer") +public class ApiVolunteerRankController { + + @Autowired + private AppVolunteerRankService appVolunteerRankService; + + /** + * 获取排行榜 + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author wanggongfeng + * @date 2019/12/13 14:41 + */ + @GetMapping("leaderboard") + public Result> leaderboard() { + Result> data = appVolunteerRankService.leaderboard(); + List list2 = ConvertUtils.sourceToTarget(data.getData(), EpdcAppVolunteerRankDTO.class); + return new Result().ok(list2); + + } + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/DemoController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/DemoController.java new file mode 100644 index 000000000..aaa4418c6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/DemoController.java @@ -0,0 +1,37 @@ +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.service.DemoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Map; + +/** + * 移动端接口-评论模块 + * + * @Author WJP + * @Date 2019/9/9 09:45 + */ +@RestController +@RequestMapping("demo") +public class DemoController { + + @Autowired + private DemoService demoService; + + /** + * 事务 + * + * @return + */ + @PostMapping("seata") + public Result demo(@RequestBody Map map) { + return demoService.demo(map); + } + + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/ActInfoFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/ActInfoFeignClient.java new file mode 100644 index 000000000..95fd6e0e1 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/ActInfoFeignClient.java @@ -0,0 +1,68 @@ +package com.elink.esua.epdc.feign; + +import com.elink.esua.epdc.activity.ActBannerDTO; +import com.elink.esua.epdc.activity.form.ActInfoAppFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoAppResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoDetailAppResultDTO; +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.config.FeignRequestInterceptor; +import com.elink.esua.epdc.feign.fallback.ActInfoFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; + +import java.util.List; + +/** + * 活动模块调用-移动app端 + * @Author LPF + * @Date 2019/11/18 16:39 + */ +@FeignClient(name = ServiceConstant.EPDC_HEART_SERVER, fallback = ActInfoFeignClientFallback.class, configuration = FeignRequestInterceptor.class) +public interface ActInfoFeignClient { + + + + /** + * 活动列表 + * @Params: [formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: lipengfei + * @Date: 2019/11/19 16:42 + */ + @GetMapping(value = "heart/appactinfo/list", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> listItems(ActInfoAppFormDTO formDto); + + /** + * 活动列表(已报名) + * @Params: [formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: lipengfei + * @Date: 2019/11/19 16:42 + */ + @GetMapping(value = "heart/appactinfo/signupList", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> signupListItems(ActInfoAppFormDTO formDto); + /** + * 活动详情 + * @Params: [formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: lipengfei + * @Date: 2019/11/19 16:42 + */ + @GetMapping(value = "heart/appactinfo/detail", consumes = MediaType.APPLICATION_JSON_VALUE) + Result getDetail(ActInfoAppFormDTO formDto); + + @GetMapping(value = "heart/appactinfo/rejectdetail", consumes = MediaType.APPLICATION_JSON_VALUE) + Result getRejectDetail(ActInfoAppFormDTO formDto); + + @GetMapping(value = "heart/appactinfo/canceldetail/{id}", consumes = MediaType.APPLICATION_JSON_VALUE) + Result getCancelDetail(@PathVariable String id); + + @GetMapping(value = "heart/actbanner/bannerlist", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> getBannerList(); + + + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java index 8c4f6d000..f48914a43 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java @@ -62,11 +62,10 @@ public interface AdminFeignClient { Result listGridWhileLeaderRegister(@PathVariable("mobile") String mobile); /** - * * 根据openId获取用户信息 * - * @params [openId] * @return com.elink.esua.epdc.commons.tools.utils.Result + * @params [openId] * @author liuchuang * @since 2019/11/19 17:43 */ diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActPhraseFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActPhraseFeignClient.java new file mode 100644 index 000000000..9115db045 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActPhraseFeignClient.java @@ -0,0 +1,35 @@ +package com.elink.esua.epdc.feign; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.feign.fallback.AppActPhraseFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; + +/** + * + * 活动报名管理 + * + * @Author:wanggongfeng + * @Date:2019/12/16 17:36 + */ +@FeignClient(name = ServiceConstant.EPDC_HEART_SERVER, fallback = AppActPhraseFeignClientFallback.class) +public interface AppActPhraseFeignClient { + + /** + * 常用语加一 + * + * @param id + * @return + */ + @GetMapping("heart/appactphrase/sagenumAddOneById/{id}") + Result sagenumAddOneById(@PathVariable("id")String id); + + /** + * redis获取常用语列表 + * @return + */ + @GetMapping("heart/appactphrase/getPhraseList") + Result getPhraseList(); +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActUserRelationFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActUserRelationFeignClient.java new file mode 100644 index 000000000..00f257f18 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActUserRelationFeignClient.java @@ -0,0 +1,66 @@ +package com.elink.esua.epdc.feign; + +import com.elink.esua.epdc.activity.ActUserRelationDTO; +import com.elink.esua.epdc.activity.AppActUserCancelsignupDTO; +import com.elink.esua.epdc.activity.AppActUserClockLogDTO; +import com.elink.esua.epdc.activity.AppClockListDTO; +import com.elink.esua.epdc.activity.result.AppActInfoDTO; +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.feign.fallback.AppActUserRelationFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; + +/** + * + * 活动报名管理 + * + * @Author:wanggongfeng + * @Date:2019/12/16 17:36 + */ +@FeignClient(name = ServiceConstant.EPDC_HEART_SERVER, fallback = AppActUserRelationFeignClientFallback.class) +public interface AppActUserRelationFeignClient { + + /** + * 活动报名 + * @param actUserRelationDTO + * @return + */ + @GetMapping(value = "heart/appactuserrelation/activitySignUp",consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result activitySignUp(ActUserRelationDTO actUserRelationDTO); + + /** + * 取消活动报名 + * @param epdcAppActUserCancelsignupDTO + * @return + */ + @GetMapping("heart/appactuserrelation/activityCancelSignUp") + Result activityCancelSignUp(AppActUserCancelsignupDTO epdcAppActUserCancelsignupDTO); + + /** + * 活动打卡 + * @param appActUserClockLogDTO + * @return + */ + @GetMapping(value = "heart/appactuserclocklog/activityClock",consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result activityClock(AppActUserClockLogDTO appActUserClockLogDTO); + + /** + * 通过活动ID查询打卡列表 + * @param actId + * @return + */ + @GetMapping(value = "heart/appactuserrelation/selectListActUserRelation/{actId}") + Result selectListActUserRelation(@PathVariable("actId") String actId); + + /** + * 获取活动打卡地点详情 + * @param actId + * @return + */ + @GetMapping("heart/appactinfo/clockAddressDetail/{actId}") + Result clockAddressDetail(@PathVariable("actId") String actId); + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppVolunteerRankFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppVolunteerRankFeignClient.java new file mode 100644 index 000000000..be3999ed3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppVolunteerRankFeignClient.java @@ -0,0 +1,28 @@ +package com.elink.esua.epdc.feign; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.feign.fallback.AppVolunteerRankFeignClientFallback; +import com.elink.esua.epdc.volunteer.EpdcVolunteerRankDTO; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; + +import java.util.List; + +/** + * + * 活动报名管理 + * + * @Author:wanggongfeng + * @Date:2019/12/16 17:36 + */ +@FeignClient(name = ServiceConstant.EPDC_HEART_SERVER, fallback = AppVolunteerRankFeignClientFallback.class) +public interface AppVolunteerRankFeignClient { + + /** + * 获取排行榜 + * @return + */ + @GetMapping("heart/volunteer/leaderboard") + Result> leaderboard(); +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CommentFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CommentFeignClient.java index dd428c14b..752921c9c 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CommentFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CommentFeignClient.java @@ -3,8 +3,8 @@ package com.elink.esua.epdc.feign; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.comment.CommentStatementFormDTO; -import com.elink.esua.epdc.dto.comment.form.CommentFormDTO; import com.elink.esua.epdc.dto.comment.form.EventCommentsFormDTO; +import com.elink.esua.epdc.dto.comment.form.SubmitCommentFormDTO; import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO; import com.elink.esua.epdc.feign.fallback.CommentFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; @@ -22,7 +22,7 @@ public interface CommentFeignClient { @PostMapping(value = "events/epdc-app/comment/submit", consumes = MediaType.APPLICATION_JSON_VALUE) - Result submit(CommentFormDTO commentFormDTO); + Result submit(SubmitCommentFormDTO submitCommentFormDTO); /** * 评论列表 diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/EvaluateFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/EvaluateFeignClient.java index ec9acb8a1..54693032a 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/EvaluateFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/EvaluateFeignClient.java @@ -13,13 +13,13 @@ import com.elink.esua.epdc.feign.fallback.EvaluateFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import java.util.List; /** * 评价模块调用-移动app端 + * * @Author LPF * @Date 2019/11/18 16:39 */ @@ -27,11 +27,11 @@ import java.util.List; public interface EvaluateFeignClient { - /** * 街道干部列表 + * * @Params: [formDto] - * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> * @Author: lipengfei * @Date: 2019/11/19 16:42 */ @@ -40,15 +40,18 @@ public interface EvaluateFeignClient { /** * 评价列表 + * * @Params: [formDto] - * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> * @Author: lipengfei * @Date: 2019/11/19 16:42 */ @GetMapping(value = "custom/evaluateoption/getOptionList", consumes = MediaType.APPLICATION_JSON_VALUE) Result> getOptionList(EvaluateOptionAppFormDTO formDto); + /** * 评价提交 + * * @Params: [formDto] * @Return: com.elink.esua.epdc.commons.tools.utils.Result<> * @Author: lipengfei @@ -59,6 +62,7 @@ public interface EvaluateFeignClient { /** * 评价状态 + * * @Params: [formDto] * @Return: com.elink.esua.epdc.commons.tools.utils.Result<> * @Author: lipengfei @@ -68,7 +72,4 @@ public interface EvaluateFeignClient { Result getAvailable(); - - - } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/OssFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/OssFeignClient.java index 875445a57..b79ea6c38 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/OssFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/OssFeignClient.java @@ -2,12 +2,15 @@ package com.elink.esua.epdc.feign; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.UploadDTO; import com.elink.esua.epdc.dto.UploadFormDTO; import com.elink.esua.epdc.dto.UploadToOssDTO; import com.elink.esua.epdc.feign.fallback.OssFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; /** * 文件对象模块 @@ -38,4 +41,14 @@ public interface OssFeignClient { */ @PostMapping(value = "oss/file/uploadFile", consumes = MediaType.APPLICATION_JSON_VALUE) Result uploadFile(UploadToOssDTO uploadToOssDto); + + /** + * @param avatarUrl + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 上传微信头像 + * @Date 2019/12/20 9:33 + **/ + @GetMapping(value="oss/file/saveWeChatFaceImg") + Result saveWeChatFaceImg(@RequestParam("avatarUrl")String avatarUrl); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java index f2025126f..95bdf502a 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java @@ -2,6 +2,7 @@ package com.elink.esua.epdc.feign; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.CachingUserInfoDTO; import com.elink.esua.epdc.dto.UserDTO; import com.elink.esua.epdc.dto.UserGridInvitationCodeDTO; import com.elink.esua.epdc.dto.UserGridRelationDTO; @@ -224,14 +225,14 @@ public interface UserFeignClient { * 更新用户微信信息 *

在完善个人信息时进行更新微信信息,不再单独更新。

* + * @param userDTO * @return com.elink.esua.epdc.commons.tools.utils.Result - * @params [userDTO] * @author liuchuang * @since 2019/10/25 17:07 */ @Deprecated @PostMapping("app-user/epdc-app/user/updateWxInfo") - Result updateWxInfo(UserDTO userDTO); + Result updateWxInfo(UserDTO userDTO); /** * 获取居民详情(已认证或待认证(提交信息待审核)的居民用户) @@ -342,6 +343,47 @@ public interface UserFeignClient { @PostMapping(value = "app-user/epdc-app/user/sentryPost/completeInfo", consumes = MediaType.APPLICATION_JSON_VALUE) Result createPidemicInfo(EpdcAppPidemicCompleteInfoFromDTO formDTO); + /** + * 需要缓存的用户信息 + * + * @param formDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author rongchao + * @since 2019-12-18 + */ + @PostMapping(value = "app-user/epdc-app/user/needCachingUserInfo", consumes = MediaType.APPLICATION_JSON_VALUE) + Result needCachingUserInfo(EpdcAppQueryUserInfoFormDTO formDTO); + + /** + * 根据用户ID需要缓存的用户信息 + * + * @param userId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author rongchao + * @since 2019-12-19 + */ + @GetMapping(value = "app-user/epdc-app/user/needCachingUserInfoByUserId/{userId}") + Result needCachingUserInfoByUserId(@PathVariable("userId") String userId); + + /** + * 志愿者认证 + * + * @param userId + * @return + */ + @GetMapping("app-user/epdc-app/volunteerinfo/getVolunteerCountById/{userId}") + Result getVolunteerCountById(@PathVariable("userId") String userId); + + /** + * 添加志愿者 + * + * @param epdcCompleteVolunteerInfoFormDTO + * @return + */ + @GetMapping("app-user/epdc-app/volunteerinfo/insertVolunteerInfo") + Result insertVolunteerInfo(EpdcCompleteVolunteerInfoFormDTO epdcCompleteVolunteerInfoFormDTO); + + /** * @param id * @return com.elink.esua.epdc.commons.tools.utils.Result diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/ActInfoFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/ActInfoFeignClientFallback.java new file mode 100644 index 000000000..b83175a18 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/ActInfoFeignClientFallback.java @@ -0,0 +1,54 @@ +package com.elink.esua.epdc.feign.fallback; + +import com.elink.esua.epdc.activity.ActBannerDTO; +import com.elink.esua.epdc.activity.form.ActInfoAppFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoAppResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoDetailAppResultDTO; +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.item.ItemEvaluateDeptDTO; +import com.elink.esua.epdc.dto.item.form.*; +import com.elink.esua.epdc.dto.item.result.*; +import com.elink.esua.epdc.feign.ActInfoFeignClient; +import com.elink.esua.epdc.feign.WorkItemFeignClient; +import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.PathVariable; + +import java.util.List; + +/** + * @Author LPF + * @Date 2019/11/18 16:39 + */ +@Component +public class ActInfoFeignClientFallback implements ActInfoFeignClient { + + + @Override + public Result> listItems(ActInfoAppFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "listItems", formDto); + } + @Override + public Result> signupListItems(ActInfoAppFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "signupListItems", formDto); + } + @Override + public Result getDetail(ActInfoAppFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "getDetail", formDto); + } + @Override + public Result getRejectDetail(ActInfoAppFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "getRejectDetail", formDto); + } + @Override + public Result getCancelDetail(@PathVariable String id) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "getCancelDetail", id); + } + @Override + public Result> getBannerList() { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "getBannerList"); + } + + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActPhraseFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActPhraseFeignClientFallback.java new file mode 100644 index 000000000..145640506 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActPhraseFeignClientFallback.java @@ -0,0 +1,25 @@ +package com.elink.esua.epdc.feign.fallback; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.feign.AppActPhraseFeignClient; +import org.springframework.stereotype.Component; + +/** + * @Author:wanggongfeng + * @Date:2019/12/16 15:11 + */ +@Component +public class AppActPhraseFeignClientFallback implements AppActPhraseFeignClient { + + @Override + public Result sagenumAddOneById(String id) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "sagenumAddOneById", id); + } + @Override + public Result getPhraseList() { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "getPhraseList"); + } + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActUserRelationFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActUserRelationFeignClientFallback.java new file mode 100644 index 000000000..3954ce303 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActUserRelationFeignClientFallback.java @@ -0,0 +1,44 @@ +package com.elink.esua.epdc.feign.fallback; + +import com.elink.esua.epdc.activity.ActUserRelationDTO; +import com.elink.esua.epdc.activity.AppActUserCancelsignupDTO; +import com.elink.esua.epdc.activity.AppActUserClockLogDTO; +import com.elink.esua.epdc.activity.result.AppActInfoDTO; +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.feign.AppActUserRelationFeignClient; +import org.springframework.stereotype.Component; + +/** + * @Author:wanggongfeng + * @Date:2019/12/16 15:11 + */ +@Component +public class AppActUserRelationFeignClientFallback implements AppActUserRelationFeignClient { + + @Override + public Result activitySignUp(ActUserRelationDTO actUserRelationDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "activitySignUp", actUserRelationDTO); + } + @Override + public Result activityCancelSignUp(AppActUserCancelsignupDTO epdcAppActUserCancelsignupDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "activityCancelSignUp", epdcAppActUserCancelsignupDTO); + } + + @Override + public Result activityClock(AppActUserClockLogDTO appActUserClockLogDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "activityClock", appActUserClockLogDTO); + } + + @Override + public Result selectListActUserRelation(String actId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "selectListActUserRelation", actId); + } + + @Override + public Result clockAddressDetail(String actId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "clockAddressDetail", actId); + } + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppVolunteerRankFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppVolunteerRankFeignClientFallback.java new file mode 100644 index 000000000..831adce1b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppVolunteerRankFeignClientFallback.java @@ -0,0 +1,25 @@ +package com.elink.esua.epdc.feign.fallback; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.feign.AppVolunteerRankFeignClient; +import com.elink.esua.epdc.volunteer.EpdcVolunteerRankDTO; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @Author:wanggongfeng + * @Date:2019/12/16 15:11 + */ +@Component +public class AppVolunteerRankFeignClientFallback implements AppVolunteerRankFeignClient { + + @Override + public Result> leaderboard() { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "leaderboard"); + } + + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CommentFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CommentFeignClientFallback.java index 1e37ebca4..bfa24b371 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CommentFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CommentFeignClientFallback.java @@ -4,8 +4,8 @@ import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.comment.CommentStatementFormDTO; -import com.elink.esua.epdc.dto.comment.form.CommentFormDTO; import com.elink.esua.epdc.dto.comment.form.EventCommentsFormDTO; +import com.elink.esua.epdc.dto.comment.form.SubmitCommentFormDTO; import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO; import com.elink.esua.epdc.feign.CommentFeignClient; import org.springframework.stereotype.Component; @@ -15,8 +15,8 @@ import org.springframework.stereotype.Component; public class CommentFeignClientFallback implements CommentFeignClient { @Override - public Result submit(CommentFormDTO commentFormDTO) { - return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "submit", commentFormDTO); + public Result submit(SubmitCommentFormDTO submitCommentFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "submit", submitCommentFormDTO); } @Override diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/EvaluateFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/EvaluateFeignClientFallback.java index 6c1204623..316543f72 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/EvaluateFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/EvaluateFeignClientFallback.java @@ -1,6 +1,10 @@ package com.elink.esua.epdc.feign.fallback; +import com.elink.esua.epdc.activity.ActBannerDTO; +import com.elink.esua.epdc.activity.form.ActInfoAppFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoAppResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoDetailAppResultDTO; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; import com.elink.esua.epdc.commons.tools.utils.Result; @@ -10,6 +14,7 @@ import com.elink.esua.epdc.dto.evaluate.form.EvaluateSubmitFormDTO; import com.elink.esua.epdc.dto.evaluate.result.EvaluateOfficerAppResultDTO; import com.elink.esua.epdc.dto.evaluate.result.EvaluateOptionAppResultDTO; import com.elink.esua.epdc.dto.evaluate.result.RoleResultDTO; +import com.elink.esua.epdc.feign.ActInfoFeignClient; import com.elink.esua.epdc.feign.EvaluateFeignClient; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.PathVariable; @@ -28,14 +33,17 @@ public class EvaluateFeignClientFallback implements EvaluateFeignClient { public Result> getDeptOfficer(EvaluateOfficerAppFormDTO formDto) { return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "getDeptOfficer", formDto); } + @Override public Result> getOptionList(EvaluateOptionAppFormDTO formDto) { return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "getOptionList", formDto); } + @Override public Result evaluateSubmit(EvaluateSubmitFormDTO formDto) { return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "evaluateSubmit", formDto); } + @Override public Result getAvailable() { return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "getAvailable"); diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/OssFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/OssFeignClientFallback.java index 8925de8fb..4766822ff 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/OssFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/OssFeignClientFallback.java @@ -3,6 +3,7 @@ package com.elink.esua.epdc.feign.fallback; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.UploadDTO; import com.elink.esua.epdc.dto.UploadFormDTO; import com.elink.esua.epdc.dto.UploadToOssDTO; import com.elink.esua.epdc.feign.OssFeignClient; @@ -25,4 +26,9 @@ public class OssFeignClientFallback implements OssFeignClient { public Result uploadFile(UploadToOssDTO uploadToOssDto) { return ModuleUtils.feignConError(ServiceConstant.EPDC_OSS_SERVER, "uploadFile", uploadToOssDto); } + + @Override + public Result saveWeChatFaceImg(String avatarUrl) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_OSS_SERVER, "saveWeChatFaceImg", avatarUrl); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java index 1507ab5e1..447b8d6ee 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java @@ -3,6 +3,7 @@ package com.elink.esua.epdc.feign.fallback; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.CachingUserInfoDTO; import com.elink.esua.epdc.dto.UserDTO; import com.elink.esua.epdc.dto.UserGridInvitationCodeDTO; import com.elink.esua.epdc.dto.UserGridRelationDTO; @@ -108,7 +109,7 @@ public class UserFeignClientFallback implements UserFeignClient { } @Override - public Result updateWxInfo(UserDTO userDTO) { + public Result updateWxInfo(UserDTO userDTO) { return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "updateWxInfo", userDTO); } @@ -167,6 +168,26 @@ public class UserFeignClientFallback implements UserFeignClient { return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "createPidemicInfo", formDTO); } + @Override + public Result needCachingUserInfo(EpdcAppQueryUserInfoFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "needCachingUserInfo", formDTO); + } + + @Override + public Result needCachingUserInfoByUserId(String userId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "needCachingUserInfoByUserId", userId); + } + + @Override + public Result getVolunteerCountById(String userId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "getVolunteerCountById", userId); + } + + @Override + public Result insertVolunteerInfo(EpdcCompleteVolunteerInfoFormDTO epdcCompleteVolunteerInfoFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "insertVolunteerInfo", epdcCompleteVolunteerInfoFormDTO); + } + @Override public Result queryUserGridInvitationCodeDTO(String id) { return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "queryUserGridInvitationCodeDTO", id); diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/rest/v2/DemoV2Controller.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/rest/v2/DemoV2Controller.java index b6d7d114f..ac1c1f3fe 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/rest/v2/DemoV2Controller.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/rest/v2/DemoV2Controller.java @@ -15,4 +15,5 @@ import org.springframework.web.bind.annotation.RestController; @RequestMapping("/demo" + Constant.VERSION_CONTROL) public class DemoV2Controller { + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActInfoService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActInfoService.java new file mode 100644 index 000000000..ffde98c20 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActInfoService.java @@ -0,0 +1,53 @@ +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.activity.ActBannerDTO; +import com.elink.esua.epdc.activity.form.ActInfoAppFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoAppResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoDetailAppResultDTO; +import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.item.result.*; + +import java.util.List; + +/** + * 项目模块-移动App端 + * @Author LPF + * @Date 2019/11/18 13:34 + */ +public interface ActInfoService { + + + /** + * 活动列表 + * @Params: [userDetail, formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: lipengfei + * @Date: 2019/11/19 16:37 + */ + Result> listItems(ActInfoAppFormDTO formDto); + /** + * 活动列表(已报名) + * @Params: [userDetail, formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: lipengfei + * @Date: 2019/11/19 16:37 + */ + Result> signupListItems(ActInfoAppFormDTO formDto); + /** + * 项目详情 + * @Params: [userDetail, itemId] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result + * @Author: lipengfei + * @Date: 2019/11/19 16:34 + */ + Result getDetail(ActInfoAppFormDTO formDto); + + Result getRejectDetail(ActInfoAppFormDTO formDto); + + Result getCancelDetail(String itemId); + + Result> getBannerList(); + + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActPhraseService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActPhraseService.java new file mode 100644 index 000000000..9d249e4cb --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActPhraseService.java @@ -0,0 +1,30 @@ +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.tools.utils.Result; + +/** + * @author wanggongfeng + * @date 2019/12/17 9:50 + */ +public interface ActPhraseService { + + /** + * 常用语使用次数加一 + * @param id + * @Author wanggongfeng + * @return + */ + Result sagenumAddOneById(String id); + + /** + * redis获取常用语 + * @Author wanggongfeng + * @return + */ + Result getPhraseList(); + + + + + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActUserRelationService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActUserRelationService.java new file mode 100644 index 000000000..d85f6ba4a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActUserRelationService.java @@ -0,0 +1,56 @@ +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.activity.ActUserRelationDTO; +import com.elink.esua.epdc.activity.AppActUserCancelsignupDTO; +import com.elink.esua.epdc.activity.AppActUserClockLogDTO; +import com.elink.esua.epdc.activity.AppClockListDTO; +import com.elink.esua.epdc.activity.result.AppActInfoDTO; +import com.elink.esua.epdc.commons.tools.utils.Result; + +/** + * @author wanggongfeng + * @date 2019/12/17 9:50 + */ +public interface ActUserRelationService { + + /** + * 活动报名 + * @param actUserRelationDTO + * @Author wanggongfeng + * @return + */ + Result activitySignUp(ActUserRelationDTO actUserRelationDTO); + + /** + * 取消活动报名 + * @param epdcAppActUserCancelsignupDTO + * @Author wanggongfeng + * @return + */ + Result activityCancelSignUp(AppActUserCancelsignupDTO epdcAppActUserCancelsignupDTO); + + /** + * 活动打卡 + * @param appActUserClockLogDTO + * @Author wanggongfeng + * @return + */ + Result activityClock(AppActUserClockLogDTO appActUserClockLogDTO); + + /** + * 获取打卡列表 + * @param actId + * @Author wanggongfeng + * @return + */ + Result getClockList(String actId); + + /** + * 获取活动打卡地点详情 + * @param actId + * @Author wanggongfeng + * @return + */ + Result clockAddressDetail(String actId); + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java index 80cba6fd8..c696361b5 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java @@ -251,6 +251,26 @@ public interface AppUserService { **/ Result checkWxUnionId(TokenDto tokenDto); + /** + * 志愿者认证 + * + * @param tokenDto + * @param formDto + * @return + * @Author wanggongfeng + */ + Result volunteerAuthenticate(TokenDto tokenDto, EpdcCompleteVolunteerInfoFormDTO formDto); + + /** + * 验证是否为志愿者 + * + * @param tokenDto + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author wanggongfeng + * @date 2019/12/13 14:41 + */ + Result getVolunteerCountById(TokenDto tokenDto); + /** * 获取用户微信手机号 * diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppVolunteerRankService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppVolunteerRankService.java new file mode 100644 index 000000000..1457bf53f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppVolunteerRankService.java @@ -0,0 +1,22 @@ +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.volunteer.EpdcVolunteerRankDTO; + +import java.util.List; + +/** + * @author wanggongfeng + * @date 2019/12/17 9:50 + */ +public interface AppVolunteerRankService { + + /** + * 获取排行榜 + * @Author wanggongfeng + * @return + */ + Result> leaderboard(); + + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/DemoService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/DemoService.java new file mode 100644 index 000000000..4f6a10fd5 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/DemoService.java @@ -0,0 +1,26 @@ +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.tools.utils.Result; + +import java.util.Map; + +/** + * Demo + * + * @author yujintao + * @email yujintao@elink-cn.com + * @date 2019/6/5 14:10 + */ +public interface DemoService { + + /** + * 测试分布式事务 + * + * @param map + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author rongchao + * @since 2020-01-09 + */ + Result demo(Map map); + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/EvaluateService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/EvaluateService.java index fdba0cfb8..7a0a11305 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/EvaluateService.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/EvaluateService.java @@ -12,6 +12,7 @@ import java.util.List; /** * 项目模块-移动App端 + * * @Author LPF * @Date 2019/11/18 13:34 */ @@ -20,24 +21,29 @@ public interface EvaluateService { /** * 街道干部列表 + * * @Params: [userDetail, formDto] - * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> * @Author: lipengfei * @Date: 2019/11/19 16:37 */ Result> getDeptOfficer(EvaluateOfficerAppFormDTO formDto); + /** * 评价列表 + * * @Params: [userDetail, formDto] - * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> * @Author: lipengfei * @Date: 2019/11/19 16:37 */ Result> getOptionList(EvaluateOptionAppFormDTO formDto); Result getAvailable(); + /** * 评价提交 + * * @Params: [userDetail, itemId] * @Return: com.elink.esua.epdc.commons.tools.utils.Result * @Author: lipengfei @@ -46,6 +52,4 @@ public interface EvaluateService { Result evaluateSubmit(EvaluateSubmitFormDTO formDto); - - } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActInfoServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActInfoServiceImpl.java new file mode 100644 index 000000000..729c15dc3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActInfoServiceImpl.java @@ -0,0 +1,59 @@ +package com.elink.esua.epdc.service.impl; + +import com.elink.esua.epdc.activity.ActBannerDTO; +import com.elink.esua.epdc.activity.form.ActInfoAppFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoAppResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoDetailAppResultDTO; +import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.item.ItemEvaluateDeptDTO; +import com.elink.esua.epdc.dto.item.form.*; +import com.elink.esua.epdc.dto.item.result.*; +import com.elink.esua.epdc.feign.ActInfoFeignClient; +import com.elink.esua.epdc.feign.WorkItemFeignClient; +import com.elink.esua.epdc.service.ActInfoService; +import com.elink.esua.epdc.service.WorkItemService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 项目模块-移动app端 + * @Author LPF + * @Date 2019/11/18 16:34 + */ +@Service +public class ActInfoServiceImpl implements ActInfoService { + + @Autowired + private ActInfoFeignClient actInfoFeignClient; + + + + @Override + public Result> listItems(ActInfoAppFormDTO formDto) { + return actInfoFeignClient.listItems(formDto); + } + @Override + public Result> signupListItems(ActInfoAppFormDTO formDto) { + return actInfoFeignClient.signupListItems(formDto); + } + + @Override + public Result getDetail(ActInfoAppFormDTO formDto) { + return actInfoFeignClient.getDetail(formDto); + } + @Override + public Result getRejectDetail(ActInfoAppFormDTO formDto) { + return actInfoFeignClient.getRejectDetail(formDto); + } + @Override + public Result getCancelDetail(String itemId) { + return actInfoFeignClient.getCancelDetail(itemId); + } + @Override + public Result> getBannerList() { + return actInfoFeignClient.getBannerList(); + } +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActPhraseServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActPhraseServiceImpl.java new file mode 100644 index 000000000..c6e92b1d8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActPhraseServiceImpl.java @@ -0,0 +1,36 @@ +package com.elink.esua.epdc.service.impl; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.feign.AppActPhraseFeignClient; +import com.elink.esua.epdc.service.ActPhraseService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +/** + * @author wanggongfeng + * @date 2019/12/16 17:50 + */ +@Slf4j +@Service +public class ActPhraseServiceImpl implements ActPhraseService { + + @Autowired + private AppActPhraseFeignClient appActPhraseFeignClient; + + @Override + public Result sagenumAddOneById(String id) { + Result dataResult = appActPhraseFeignClient.sagenumAddOneById(id); + return dataResult; + } + + @Override + public Result getPhraseList() { + Result dataResult = appActPhraseFeignClient.getPhraseList(); + return dataResult; + } + + + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActUserRelationServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActUserRelationServiceImpl.java new file mode 100644 index 000000000..26d89d255 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActUserRelationServiceImpl.java @@ -0,0 +1,57 @@ +package com.elink.esua.epdc.service.impl; + +import com.elink.esua.epdc.activity.ActUserRelationDTO; +import com.elink.esua.epdc.activity.AppActUserCancelsignupDTO; +import com.elink.esua.epdc.activity.AppActUserClockLogDTO; +import com.elink.esua.epdc.activity.AppClockListDTO; +import com.elink.esua.epdc.activity.result.AppActInfoDTO; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.feign.AppActUserRelationFeignClient; +import com.elink.esua.epdc.service.ActUserRelationService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +/** + * @author wanggongfeng + * @date 2019/12/16 17:50 + */ +@Slf4j +@Service +public class ActUserRelationServiceImpl implements ActUserRelationService { + + @Autowired + private AppActUserRelationFeignClient actInfoFeignClient; + + @Override + public Result activitySignUp(ActUserRelationDTO actUserRelationDTO) { + Result dataResult = actInfoFeignClient.activitySignUp(actUserRelationDTO); + return dataResult; + } + + @Override + public Result activityCancelSignUp(AppActUserCancelsignupDTO epdcAppActUserCancelsignupDTO) { + Result dataResult = actInfoFeignClient.activityCancelSignUp(epdcAppActUserCancelsignupDTO); + return dataResult; + } + + @Override + public Result activityClock(AppActUserClockLogDTO appActUserClockLogDTO) { + Result dataResult = actInfoFeignClient.activityClock(appActUserClockLogDTO); + return dataResult; + } + + @Override + public Result getClockList(String actId) { + Result result = actInfoFeignClient.selectListActUserRelation(actId); + return result; + } + + @Override + public Result clockAddressDetail(String actId) { + Result dataResult = actInfoFeignClient.clockAddressDetail(actId); + return dataResult; + } + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java index e18dde34f..a79a8628c 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java @@ -10,7 +10,9 @@ import com.elink.esua.epdc.async.GroupTask; import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.common.token.util.CpUserDetailRedis; import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.enums.UserAuthTypeEnum; import com.elink.esua.epdc.commons.tools.enums.UserSexEnum; +import com.elink.esua.epdc.commons.tools.enums.UserTagEnum; import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; import com.elink.esua.epdc.commons.tools.exception.RenException; import com.elink.esua.epdc.commons.tools.redis.RedisUtils; @@ -44,14 +46,16 @@ import com.elink.esua.epdc.jwt.JwtTokenProperties; import com.elink.esua.epdc.jwt.JwtTokenUtils; import com.elink.esua.epdc.redis.AppUserRedis; import com.elink.esua.epdc.service.AppUserService; +import com.elink.esua.epdc.utils.UserTagUtils; import com.elink.esua.epdc.utils.WxMaServiceUtils; -import com.sun.org.apache.regexp.internal.RE; import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.mp.api.WxMpService; import me.chanjar.weixin.mp.bean.result.WxMpOAuth2AccessToken; import me.chanjar.weixin.mp.bean.result.WxMpUser; import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -73,7 +77,7 @@ import java.util.List; @Slf4j @Service public class AppUserServiceImpl implements AppUserService { - + private static final Logger logger = LoggerFactory.getLogger(AppUserServiceImpl.class); @Autowired private AppUserRedis appUserRedis; @@ -94,6 +98,7 @@ public class AppUserServiceImpl implements AppUserService { @Autowired private JwtTokenProperties jwtTokenProperties; + @Autowired private OssFeignClient ossFeignClient; @@ -260,7 +265,7 @@ public class AppUserServiceImpl implements AppUserService { EpdcAppQueryUserInfoFormDTO formDTO = new EpdcAppQueryUserInfoFormDTO(); formDTO.setOpenId(wxMaJscode2SessionResult.getOpenid()); formDTO.setUnionId(wxMaJscode2SessionResult.getUnionid()); - Result userInfoResult = userFeignClient.queryUserDto(formDTO); + Result userInfoResult = userFeignClient.needCachingUserInfo(formDTO); if (!userInfoResult.success()) { return new Result().error(userInfoResult.getMsg()); } @@ -275,7 +280,7 @@ public class AppUserServiceImpl implements AppUserService { * @author work@yujt.net.cn * @date 2019/9/19 19:17 */ - private Result getTokenByUserDto(UserDTO userDto) { + private Result getTokenByUserDto(CachingUserInfoDTO userDto) { EpdcAppAuthorizationDTO authorization = new EpdcAppAuthorizationDTO(); // 用户未注册 @@ -284,10 +289,9 @@ public class AppUserServiceImpl implements AppUserService { return new Result().ok(authorization); } TokenDto tokenDto = ConvertUtils.sourceToTarget(userDto, TokenDto.class); - tokenDto.setUserId(userDto.getId()); String state = userDto.getState(); - authorization = this.packageEpdcAppAuthorization(tokenDto, userDto.getGrid(), userDto.getState()); + authorization = this.packageEpdcAppAuthorization(tokenDto, userDto.getGrid(), state); Result result = new Result().ok(authorization); // 已注册,未完善信息 @@ -337,12 +341,6 @@ public class AppUserServiceImpl implements AppUserService { // 组装用户注册信息 EpdcGridLeaderRegisterDTO gridLeaderRegister = this.packageGridLeaderWhileRegister(leaderRegisterDto.getSysUser(), formDto.getWxCode()); List userGridList = ConvertUtils.sourceToTarget(leaderRegisterDto.getLeaderGridList(), UserGridRelationDTO.class); - for (UserGridRelationDTO item : userGridList) { - item.setAllDeptNames(item.getDistrict() + "-" + item.getStreet() + "-" + item.getCommunity() + "-" + item.getGrid()); - item.setAllDeptIds(item.getDistrictId() + "," + item.getStreetId() + "," + item.getCommunityId() + "," + item.getGridId()); - item.setParentDeptIds(item.getDistrict() + "-" + item.getStreet() + "-" + item.getCommunity()); - item.setParentDeptNames(item.getDistrictId() + "," + item.getStreetId() + "," + item.getCommunityId()); - } EpdcGridLeaderRegisterFormDTO registerDto = new EpdcGridLeaderRegisterFormDTO(); registerDto.setGridLeader(gridLeaderRegister); registerDto.setUserGridList(userGridList); @@ -613,11 +611,13 @@ public class AppUserServiceImpl implements AppUserService { try { wxMaJscode2SessionResult = wxMaServiceUtils.normalWxMaService().jsCode2SessionInfo(wxCode); } catch (WxErrorException e) { + e.printStackTrace(); log.error("->[getMaOpenId]::error[{}]", "解析微信code失败"); + if (e.getError().getErrorCode() == 40163) { + throw new RenException("禁止重复提交,请刷新页面后重试"); + } } - if (null == wxMaJscode2SessionResult) { - throw new RenException("解析微信用户信息失败"); - } else if (StringUtils.isBlank(wxMaJscode2SessionResult.getOpenid())) { + if (null == wxMaJscode2SessionResult || StringUtils.isBlank(wxMaJscode2SessionResult.getOpenid())) { throw new RenException("获取微信openid失败"); } return wxMaJscode2SessionResult; @@ -870,7 +870,10 @@ public class AppUserServiceImpl implements AppUserService { if (YesOrNoEnum.NO.value().equals(partyFlag)) { return null; } - // 党员提交,验证身份证号 + return fixAndCheckIdentityNo(identityNo); + } + + private String fixAndCheckIdentityNo(String identityNo) { identityNo = ModuleUtils.replaceIllegalCharacter(identityNo); if (StringUtils.isBlank(identityNo)) { throw new RenException("身份证号不能为空"); @@ -901,90 +904,99 @@ public class AppUserServiceImpl implements AppUserService { String wxCode = infoDto.getWxCode(); String iv = infoDto.getIv(); String encryptedData = infoDto.getEncryptedData(); - if (StringUtils.isNotBlank(wxCode) && StringUtils.isNotBlank(iv) && StringUtils.isNotBlank(encryptedData)) { - WxMaUserInfo wxMaUserInfo = null; - String decrypt = null; - try { - decrypt = WxMaCryptUtils.decrypt(this.getUserSessionKey(wxCode), encryptedData, iv); - if (StringUtils.isNotBlank(decrypt)) { - wxMaUserInfo = JSONObject.parseObject(decrypt, WxMaUserInfo.class); + if (StringUtils.isNotBlank(wxCode)) { + // 解析微信用户openid + WxMaJscode2SessionResult maJscode2SessionResult = getWxMaUser(wxCode); + userDto.setWxOpenId(maJscode2SessionResult.getOpenid()); + // 解析微信用户加密数据 + if (StringUtils.isNotBlank(iv) && StringUtils.isNotBlank(encryptedData)) { + WxMaUserInfo wxMaUserInfo = null; + String decrypt = null; + try { + decrypt = WxMaCryptUtils.decrypt(maJscode2SessionResult.getSessionKey(), encryptedData, iv); + if (StringUtils.isNotBlank(decrypt)) { + wxMaUserInfo = JSONObject.parseObject(decrypt, WxMaUserInfo.class); + } + } catch (Exception e) { + log.error("解析或组装用户微信信息失败,用户id:::::{},解密数据:::::{}", userId, decrypt); + log.error(e.getMessage()); } - } catch (Exception e) { - log.error("解析或组装用户微信信息失败,用户id:::::{},解密数据:::::{}", userId, decrypt); - log.error(e.getMessage()); - } - if (null == wxMaUserInfo || StringUtils.isBlank(wxMaUserInfo.getUnionId())) { - throw new RenException("解析微信数据失败,请刷新后重试"); + if (null == wxMaUserInfo || StringUtils.isBlank(wxMaUserInfo.getUnionId())) { + throw new RenException("解析微信数据失败,请刷新后重试"); + } + userDto.setWxUnionId(wxMaUserInfo.getUnionId()); + userDto.setFaceImg(wxMaUserInfo.getAvatarUrl()); } - - userDto.setWxUnionId(wxMaUserInfo.getUnionId()); - userDto.setFaceImg(wxMaUserInfo.getAvatarUrl()); } - EpdcCompleteAppUserDTO completeAppUserDto = ConvertUtils.sourceToTarget(userDto, EpdcCompleteAppUserDTO.class); + completeAppUserDto.setUserAuthType(infoDto.getUserAuthType()); return this.packageUserCompleteInfo(completeAppUserDto, userState); } + @Override + public Result completeUserInfo(TokenDto tokenDto, EpdcCompleteUserInfoFormDTO infoDto) { + // 验证手机号、验证码 + this.checkSmsCode(infoDto.getMobile(), infoDto.getSmsCode()); + return this.completeUserInfo(tokenDto, ConvertUtils.sourceToTarget(infoDto, EpdcCompleteUserInfoFormV2DTO.class)); + } @Override public Result completeUserInfo(TokenDto tokenDto, EpdcCompleteUserInfoFormV2DTO infoDto) { - String userId = tokenDto.getUserId(); // 验证身份证号格式,身份证号码字符串校正 String identityNo = fixAndCheckIdentityNo(infoDto.getIdentityNo(), infoDto.getPartyFlag()); + infoDto.setIdentityNo(identityNo); + return completeUserInfoNormally(tokenDto, infoDto); + } + + private Result completeUserInfoNormally(TokenDto tokenDto, EpdcCompleteUserInfoFormV2DTO infoDto) { + String userId = tokenDto.getUserId(); // 验证手机号身份证号是否已被注册,若未被注册,返回当前用户的状态 - String userState = checkMobileAndIdentityNo(userId, infoDto.getMobile(), infoDto.getPartyFlag(), identityNo); + String userState = checkMobileAndIdentityNo(userId, infoDto.getMobile(), infoDto.getPartyFlag(), infoDto.getIdentityNo()); Long gridId = getGridId(infoDto.getGridId(), tokenDto.getGridId(), userId); infoDto.setGridId(gridId); - infoDto.setIdentityNo(identityNo); + infoDto.setIdentityNo(infoDto.getIdentityNo()); // 组装对象,准备保存用户信息与网格信息 EpdcAppUserCompleteInfoFormDTO dto = new EpdcAppUserCompleteInfoFormDTO(); dto.setUserGridRelation(this.packageUserGridRelationInfo(gridId)); dto.setCompleteAppUser(this.packageUserCompleteInfo(userId, userState, infoDto)); - Result completeResult = userFeignClient.completeUserInfo(dto); - if (!completeResult.success()) { - //党员认证失败 - if (100006001 == completeResult.getCode()) { - EpdcAppAuthorizationDTO authorizationDto = new EpdcAppAuthorizationDTO(); - authorizationDto.setResultCode(YesOrNoEnum.YES.value()); - authorizationDto.setResultMsg(completeResult.getMsg()); - return new Result().ok(authorizationDto); - } + + // 用户认证失败,且不是因为党员匹配失败(未知异常导致流程出错) + if (!completeResult.success() && 100006001 != completeResult.getCode()) { return new Result().error(completeResult.getMsg()); } - UserDTO user = completeResult.getData(); - tokenDto.setRealName(user.getRealName()); - tokenDto.setNickname(user.getNickname()); - tokenDto.setMobile(user.getMobile()); - tokenDto.setPartyFlag(user.getPartyFlag()); - EpdcAppAuthorizationDTO authorizationDto = this.packageEpdcAppAuthorization(tokenDto, String.valueOf(gridId), user.getState()); - + // 完善信息后的用户状态 + userState = completeResult.getData().getState(); + // 更新用户缓存信息 + Result cachingUserResult = userFeignClient.needCachingUserInfoByUserId(tokenDto.getUserId()); + CachingUserInfoDTO cachingUserInfoDTO = cachingUserResult.getData(); + TokenDto newTokenDto = ConvertUtils.sourceToTarget(cachingUserInfoDTO, TokenDto.class); + EpdcAppAuthorizationDTO authorizationDto = this.packageEpdcAppAuthorization(newTokenDto, String.valueOf(gridId), userState); + + // 党员认证失败 + if (100006001 == completeResult.getCode()) { + authorizationDto.setResultCode(YesOrNoEnum.YES.value()); + authorizationDto.setResultMsg(completeResult.getMsg()); + return new Result().ok(authorizationDto); + } // 更新社群用户党员标识并加入关联的所有网格党员群 - if (YesOrNoEnum.YES.value().equals(user.getPartyFlag())) { + boolean partyFlag = UserTagUtils.containIdentity(cachingUserInfoDTO.getUserTagInfos(), UserTagEnum.PARTY_MEMBER); + if (partyFlag) { GroupUserPartyMemberFormDTO formDto = new GroupUserPartyMemberFormDTO(); - formDto.setUserId(user.getId()); - formDto.setPartyMember(user.getPartyFlag()); - formDto.setNickname(user.getNickname()); - formDto.setUserAvatar(user.getFaceImg()); - formDto.setMobile(user.getMobile()); - formDto.setDeptId(user.getDeptId()); + formDto.setUserId(cachingUserInfoDTO.getUserId()); + formDto.setPartyMember(YesOrNoEnum.YES.value()); + formDto.setNickname(cachingUserInfoDTO.getNickname()); + formDto.setUserAvatar(cachingUserInfoDTO.getFaceImg()); + formDto.setMobile(cachingUserInfoDTO.getMobile()); + formDto.setDeptId(cachingUserInfoDTO.getGridId()); formDto.setState(GroupUserStateEnum.GROUP_USER_STATE_EXAMINATION_PASSED.getValue()); - groupFeignClient.updateUserPartyMember(formDto); } - return new Result().ok(authorizationDto); } - @Override - public Result completeUserInfo(TokenDto tokenDto, EpdcCompleteUserInfoFormDTO infoDto) { - // 验证手机号、验证码 - this.checkSmsCode(infoDto.getMobile(), infoDto.getSmsCode()); - return this.completeUserInfo(tokenDto, ConvertUtils.sourceToTarget(infoDto, EpdcCompleteUserInfoFormV2DTO.class)); - } - /** * 判断用户居住网格id * @@ -1077,17 +1089,9 @@ public class AppUserServiceImpl implements AppUserService { String identityNo = dto.getIdentityNo(); if (YesOrNoEnum.YES.value().equals(dto.getPartyFlag())) { - dto.setState(AppUserStatesEnum.STATE_INFORMATION_PASSED.value()); dto.setSex(IdentityNoUtils.getSex(identityNo)); dto.setBirthday(DateUtils.parse(IdentityNoUtils.getBirthday(identityNo), DateUtils.DATE_PATTERN)); - } else { - dto.setState(AppUserStatesEnum.STATE_COMPLETED_INFORMATION_PENDING_REVIEW.value()); - } - // 用户不是第一次完善信息,保持现在的用户状态不变 - if (!AppUserStatesEnum.STATE_REGISTERED.value().equals(userState)) { - dto.setState(userState); } - String address = road .concat(StringUtils.isNotBlank(villageName) ? villageName : "") .concat(StringUtils.isNotBlank(dwellingPlace) ? dwellingPlace : ""); @@ -1100,6 +1104,8 @@ public class AppUserServiceImpl implements AppUserService { dto.setMobileProvince(phoneDto.getProvinceName()); } + // 用户信息置为 1:已完善信息待审核 + dto.setState(AppUserStatesEnum.STATE_COMPLETED_INFORMATION_PENDING_REVIEW.value()); return dto; } @@ -1145,7 +1151,13 @@ public class AppUserServiceImpl implements AppUserService { UserDTO userDTO = new UserDTO(); userDTO.setId(userDetail.getUserId()); userDTO.setNickname(wxMaUserInfo.getNickName()); - userDTO.setFaceImg(wxMaUserInfo.getAvatarUrl()); + //上传微信头像 + Result uploadDTOResult = ossFeignClient.saveWeChatFaceImg(wxMaUserInfo.getAvatarUrl()); + if (uploadDTOResult.success()) { + userDTO.setFaceImg(uploadDTOResult.getData().getUrl()); + } else { + userDTO.setFaceImg(USER_FACE); + } //微信性别0未知 1:男 2:女 本系统:1男,0女 if (UserSexEnum.WX_MALE.sex().equals(wxMaUserInfo.getGender())) { userDTO.setSex(UserSexEnum.MALE.sex()); @@ -1156,21 +1168,28 @@ public class AppUserServiceImpl implements AppUserService { userDTO.setSex(""); } userDTO.setWxUnionId(wxMaUserInfo.getUnionId()); - Result updateWxInfoResult = userFeignClient.updateWxInfo(userDTO); + userDTO.setWxOpenId(wxMaUserInfo.getOpenId()); + Result updateWxInfoResult = userFeignClient.updateWxInfo(userDTO); if (!updateWxInfoResult.success()) { return new Result().error("更新用户信息失败"); } + UserDTO oldUser = updateWxInfoResult.getData(); + // 注销原来的登录信息 + cpUserDetailRedis.logout(userDetail.getUserId()); + // 更新用户缓存信息 TokenDto tokenDto = ConvertUtils.sourceToTarget(userDTO, TokenDto.class); - tokenDto.setUserId(userDetail.getUserId()); + // 在迁移小程序后,olduser的id和userDetail的id可能不一样。 + tokenDto.setUserId(oldUser.getId()); tokenDto.setGridId(userDetail.getGridId()); tokenDto.setMobile(userDetail.getMobile()); - tokenDto.setPartyFlag(userDetail.getPartyFlag()); + tokenDto.setUserTagInfos(userDetail.getUserTagInfos()); tokenDto.setRealName(userDetail.getRealName()); - long expire = cpUserDetailRedis.getExpire(userDetail.getUserId()); - cpUserDetailRedis.logout(userDetail.getUserId()); - cpUserDetailRedis.set(tokenDto, expire); + tokenDto.setMobile(oldUser.getMobile()); + tokenDto.setRealName(oldUser.getRealName()); + // 保证用户手机上的token仍然可用 + cpUserDetailRedis.set(tokenDto, jwtTokenProperties.getExpire(), userDetail.getUserId()); return new Result(); } @@ -1255,6 +1274,142 @@ public class AppUserServiceImpl implements AppUserService { return result; } + /** + * 志愿者认证 + * + * @param tokenDto + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author wanggongfeng + * @date 2019/12/13 14:41 + */ + @Override + public Result volunteerAuthenticate(TokenDto tokenDto, EpdcCompleteVolunteerInfoFormDTO formDto) { + logger.info("志愿者认证wxCode=" + formDto.getWxCode() + ";userId=" + tokenDto.getUserId()); + + if (StringUtils.isNotBlank(formDto.getSmsCode())) { + this.checkSmsCode(formDto.getMobile(), formDto.getSmsCode()); + } + + // 验证是否为志愿者 + Result volunteerCountResult = userFeignClient.getVolunteerCountById(tokenDto.getUserId()); + if (!volunteerCountResult.success() || null == volunteerCountResult.getData()) { + return new Result().error("志愿者认证失败"); + } else if (volunteerCountResult.getData() == 0) { + // 处理和验证身份证号码 + String identityNo = fixAndCheckIdentityNo(formDto.getIdentityNo()); + formDto.setSex(IdentityNoUtils.getSex(identityNo)); // 性别 + formDto.setBirthday(DateUtils.parse(IdentityNoUtils.getBirthday(identityNo), DateUtils.DATE_PATTERN)); // 生日 + formDto.setUserId(tokenDto.getUserId()); // 用户ID + // 添加志愿者 + Result insertCountResult = userFeignClient.insertVolunteerInfo(formDto); + } + + // 调用用户完善个人信息-保存 + EpdcCompleteUserInfoFormV2DTO epdcCompleteUserInfoFormDTO = ConvertUtils.sourceToTarget(formDto, EpdcCompleteUserInfoFormV2DTO.class); + // set 党员标识,将志愿者完善信息视为党员完善信息,方便身份证号码唯一校验等操作 + epdcCompleteUserInfoFormDTO.setPartyFlag(YesOrNoEnum.YES.value()); + epdcCompleteUserInfoFormDTO.setUserAuthType(UserAuthTypeEnum.VOLUNTEER_AUTH.value()); + Result result = completeUserInfoNormally(tokenDto, epdcCompleteUserInfoFormDTO); + + return result; + } + + /** + * 查询是否为志愿者 + * + * @param tokenDto + * @return + */ + @Override + public Result getVolunteerCountById(TokenDto tokenDto) { + Result result = new Result(); + Result volunteerCountResult = userFeignClient.getVolunteerCountById(tokenDto.getUserId()); + if (!volunteerCountResult.success() || null == volunteerCountResult.getData()) { + result.error("志愿者验证错误"); + } else { + if (volunteerCountResult.getData() == 0) { + result.error("该用户不是志愿者"); + } else { + result.setMsg("志愿者认证通过"); + } + } + return result; + } + + /*private Result completeUserInfoNoVerifyCode(TokenDto tokenDto, EpdcCompleteUserInfoFormDTO infoDto) { + + UserDTO userDto = ConvertUtils.sourceToTarget(infoDto, UserDTO.class); + userDto.setDeptId(Long.valueOf(infoDto.getGridId())); + userDto.setId(tokenDto.getUserId()); + + if (StringUtils.isNotBlank(infoDto.getWxCode())) { + String sessionKey = this.getUserSessionKey(infoDto.getWxCode()); + WxMaUserInfo wxMaUserInfo = wxMaServiceUtils.normalWxMaService().getUserService().getUserInfo(sessionKey, infoDto.getEncryptedData(), infoDto.getIv()); + if (StringUtils.isBlank(wxMaUserInfo.getUnionId())) { + return new Result().error("解析微信开放平台ID失败"); + } + userDto.setWxUnionId(wxMaUserInfo.getUnionId()); + userDto.setWxOpenId(wxMaUserInfo.getOpenId()); + } + + // 党员提交,验证身份证号 + if (YesOrNoEnum.YES.value().equals(userDto.getPartyFlag())) { + String identityNo = userDto.getIdentityNo(); + if (StringUtils.isBlank(identityNo)) { + return new Result().error("身份证号不能为空"); + } else { + String verification = IdentityNoUtils.IdentityNoVerification(identityNo); + if (StringUtils.isNotBlank(verification)) { + return new Result().error(verification); + } + } + } + // 验证手机号验证码 + //this.checkSmsCode(userDto.getMobile(), infoDto.getSmsCode()); + // 验证用户提交的信息 + Result verifyResult = userFeignClient.verifyUserCompleteData(userDto); + if (!verifyResult.success()) { + return new Result().error(verifyResult.getMsg()); + } + String userState = verifyResult.getData(); + + UserGridRelationDTO userGrid = this.packageUserGridRelationInfo(infoDto.getGridId()); + EpdcCompleteAppUserDTO completeAppUserDto = ConvertUtils.sourceToTarget(userDto, EpdcCompleteAppUserDTO.class); + completeAppUserDto = this.packageUserCompleteInfo(completeAppUserDto, userState); + // 组装对象,准备保存用户信息 + EpdcAppUserCompleteInfoFormDTO dto = new EpdcAppUserCompleteInfoFormDTO(); + dto.setCompleteAppUser(completeAppUserDto); + dto.setUserGridRelation(userGrid); + + Result completeResult = userFeignClient.completeUserInfo(dto); + if (!completeResult.success()) { + return new Result().error(completeResult.getMsg()); + } + UserDTO user = completeResult.getData(); + tokenDto.setRealName(user.getRealName()); + tokenDto.setNickname(user.getNickname()); + tokenDto.setMobile(user.getMobile()); + EpdcAppAuthorizationDTO authorizationDto = this.packageEpdcAppAuthorization(tokenDto, userGrid.getGrid(), userDto.getState()); + + // 更新社群用户党员标识并加入关联的所有网格党员群 + if (NumConstant.ONE_STR.equals(user.getPartyFlag())) { + GroupUserPartyMemberFormDTO formDto = new GroupUserPartyMemberFormDTO(); + formDto.setUserId(user.getId()); + formDto.setPartyMember(user.getPartyFlag()); + formDto.setNickname(user.getNickname()); + formDto.setUserAvatar(user.getFaceImg()); + formDto.setMobile(user.getMobile()); + formDto.setDeptId(user.getGridId()); + formDto.setState(GroupUserStateEnum.GROUP_USER_STATE_EXAMINATION_PASSED.getValue()); + + groupTask.updateUserPartyMember(formDto); + } + + return new Result().ok(authorizationDto); + }*/ + + @Override public Result getUserWxPhone(EpdcAppUserMaInfoFormDTO formDto) { try { diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppVolunteerRankServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppVolunteerRankServiceImpl.java new file mode 100644 index 000000000..2f5012274 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppVolunteerRankServiceImpl.java @@ -0,0 +1,36 @@ +package com.elink.esua.epdc.service.impl; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.feign.AppVolunteerRankFeignClient; +import com.elink.esua.epdc.service.AppVolunteerRankService; +import com.elink.esua.epdc.volunteer.EpdcVolunteerRankDTO; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + + +/** + * @author wanggongfeng + * @date 2019/12/16 17:50 + */ +@Slf4j +@Service +public class AppVolunteerRankServiceImpl implements AppVolunteerRankService { + + @Autowired + private AppVolunteerRankFeignClient appVolunteerRankFeignClient; + + /** + * 获取排行榜 + * @Author wanggongfeng + * @return + */ + @Override + public Result> leaderboard() { + Result> dataResult = appVolunteerRankFeignClient.leaderboard(); + return dataResult; + } + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CommentServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CommentServiceImpl.java index 466c3ab54..d9163414b 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CommentServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CommentServiceImpl.java @@ -3,13 +3,18 @@ package com.elink.esua.epdc.service.impl; import com.elink.esua.epdc.async.WxMaSecCheckTask; import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.enums.UserTagEnum; +import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.comment.CommentStatementFormDTO; import com.elink.esua.epdc.dto.comment.form.CommentFormDTO; import com.elink.esua.epdc.dto.comment.form.EventCommentsFormDTO; +import com.elink.esua.epdc.dto.comment.form.SubmitCommentFormDTO; import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO; import com.elink.esua.epdc.feign.CommentFeignClient; import com.elink.esua.epdc.service.CommentService; +import com.elink.esua.epdc.utils.UserTagUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -37,7 +42,13 @@ public class CommentServiceImpl implements CommentService { commentFormDTO.setUserId(userDetail.getUserId()); commentFormDTO.setUserName(userDetail.getNickname()); commentFormDTO.setUserFace(userDetail.getFaceImg()); - return commentFeignClient.submit(commentFormDTO); + SubmitCommentFormDTO submitCommentFormDTO = ConvertUtils.sourceToTarget(commentFormDTO, SubmitCommentFormDTO.class); + if (UserTagUtils.containIdentity(userDetail.getUserTagInfos(), UserTagEnum.PARTY_MEMBER)) { + submitCommentFormDTO.setPartyFlag(YesOrNoEnum.YES.value()); + } else { + submitCommentFormDTO.setPartyFlag(YesOrNoEnum.NO.value()); + } + return commentFeignClient.submit(submitCommentFormDTO); } @Override diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/DemoServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/DemoServiceImpl.java new file mode 100644 index 000000000..530b4205a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/DemoServiceImpl.java @@ -0,0 +1,42 @@ +package com.elink.esua.epdc.service.impl; + +import com.elink.esua.epdc.commons.tools.exception.RenException; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.ScanSwitchDTO; +import com.elink.esua.epdc.feign.DemoFeignClient; +import com.elink.esua.epdc.service.DemoService; +import com.elink.esua.epdc.service.ScanSwitchService; +import io.seata.spring.annotation.GlobalTransactional; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * @author yujintao + * @email yujintao@elink-cn.com + * @date 2019/9/11 9:40 + */ +@Service +public class DemoServiceImpl implements DemoService { + + @Autowired + private ScanSwitchService scanSwitchService; + + @Autowired + private DemoFeignClient demoFeignClient; + + @GlobalTransactional(rollbackFor = Exception.class) + @Override + public Result demo(Map map) { + ScanSwitchDTO dto = new ScanSwitchDTO(); + dto.setId("54185412da2bea73804fc1de69827e18"); + dto.setMaintainInfo(map.get("username").toString()); + scanSwitchService.update(dto); + Result r = demoFeignClient.seata(map.get("username").toString(), Integer.parseInt(map.get("age").toString())); + if (!r.success()) { + throw new RenException("添加失败"); + } + return new Result(); + } +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/EvaluateServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/EvaluateServiceImpl.java index 57df991c4..eb463c0a2 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/EvaluateServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/EvaluateServiceImpl.java @@ -17,6 +17,7 @@ import java.util.List; /** * 项目模块-移动app端 + * * @Author LPF * @Date 2019/11/18 16:34 */ @@ -27,23 +28,23 @@ public class EvaluateServiceImpl implements EvaluateService { private EvaluateFeignClient evaluateFeignClient; - @Override public Result> getDeptOfficer(EvaluateOfficerAppFormDTO formDto) { return evaluateFeignClient.getDeptOfficer(formDto); } + @Override public Result> getOptionList(EvaluateOptionAppFormDTO formDto) { return evaluateFeignClient.getOptionList(formDto); } + @Override public Result getAvailable() { return evaluateFeignClient.getAvailable(); } - @Override - public Result evaluateSubmit(EvaluateSubmitFormDTO formDto){ + public Result evaluateSubmit(EvaluateSubmitFormDTO formDto) { return evaluateFeignClient.evaluateSubmit(formDto); } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/GroupServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/GroupServiceImpl.java index 294ed172a..8a91b534d 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/GroupServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/GroupServiceImpl.java @@ -2,20 +2,24 @@ package com.elink.esua.epdc.service.impl; import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.enums.UserTagEnum; +import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; import com.elink.esua.epdc.commons.tools.utils.Result; -import com.elink.esua.epdc.dto.CompleteDeptDTO; import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; +import com.elink.esua.epdc.dto.enums.GroupStateEnum; +import com.elink.esua.epdc.dto.enums.GroupUserStateEnum; import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO; import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; -import com.elink.esua.epdc.dto.enums.GroupStateEnum; -import com.elink.esua.epdc.dto.enums.GroupUserStateEnum; import com.elink.esua.epdc.dto.group.form.*; -import com.elink.esua.epdc.dto.group.result.*; +import com.elink.esua.epdc.dto.group.result.GroupDetailForMobileEndResultDTO; +import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; +import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; +import com.elink.esua.epdc.dto.group.result.GroupsOfRecommendResultDTO; import com.elink.esua.epdc.feign.AdminFeignClient; import com.elink.esua.epdc.feign.GroupFeignClient; import com.elink.esua.epdc.service.GroupService; -import org.apache.commons.lang3.StringUtils; +import com.elink.esua.epdc.utils.UserTagUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -63,10 +67,10 @@ public class GroupServiceImpl implements GroupService { groupUserFormDTO.setUserAvatar(userDetail.getFaceImg()); groupUserFormDTO.setMobile(userDetail.getMobile()); // 判断当前用户是否为党员 - if (!NumConstant.ONE_STR.equals(userDetail.getPartyFlag())) { + if (!UserTagUtils.containIdentity(userDetail.getUserTagInfos(), UserTagEnum.PARTY_MEMBER)) { return new Result().error("您当前身份不是党员,不能创建社群"); } - groupUserFormDTO.setPartyMember(userDetail.getPartyFlag()); + groupUserFormDTO.setPartyMember(YesOrNoEnum.YES.value()); groupUserFormDTO.setLordFlag(NumConstant.ONE_STR); groupUserFormDTO.setState(GroupUserStateEnum.GROUP_USER_STATE_EXAMINATION_PASSED.getValue()); formDto.setGroupUserFormDTO(groupUserFormDTO); @@ -187,7 +191,11 @@ public class GroupServiceImpl implements GroupService { formDto.setNickname(userDetail.getNickname()); formDto.setUserAvatar(userDetail.getFaceImg()); formDto.setMobile(userDetail.getMobile()); - formDto.setPartyMember(userDetail.getPartyFlag()); + if (UserTagUtils.containIdentity(userDetail.getUserTagInfos(), UserTagEnum.PARTY_MEMBER)) { + formDto.setPartyMember(YesOrNoEnum.YES.value()); + } else { + formDto.setPartyMember(YesOrNoEnum.NO.value()); + } return groupFeignClient.applyForGroup(formDto); } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/IssueServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/IssueServiceImpl.java index a5575b0db..74c9b43af 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/IssueServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/IssueServiceImpl.java @@ -2,8 +2,9 @@ package com.elink.esua.epdc.service.impl; import com.elink.esua.epdc.async.WxMaSecCheckTask; import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.enums.UserTagEnum; +import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; import com.elink.esua.epdc.commons.tools.utils.Result; -import com.elink.esua.epdc.dto.CompleteDeptDTO; import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; import com.elink.esua.epdc.dto.UploadFormDTO; import com.elink.esua.epdc.dto.category.CategoryDTO; @@ -15,9 +16,9 @@ import com.elink.esua.epdc.feign.AdminFeignClient; import com.elink.esua.epdc.feign.IssueFeignClient; import com.elink.esua.epdc.feign.OssFeignClient; import com.elink.esua.epdc.service.IssueService; +import com.elink.esua.epdc.utils.UserTagUtils; import me.chanjar.weixin.mp.api.WxMpMaterialService; import me.chanjar.weixin.mp.api.WxMpService; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -86,7 +87,11 @@ public class IssueServiceImpl implements IssueService { formDto.setUserId(userDetail.getUserId()); formDto.setNickName(userDetail.getNickname()); formDto.setUserFace(userDetail.getFaceImg()); - formDto.setIsPartyMember(userDetail.getPartyFlag()); + if (UserTagUtils.containIdentity(userDetail.getUserTagInfos(), UserTagEnum.PARTY_MEMBER)) { + formDto.setIsPartyMember(YesOrNoEnum.YES.value()); + } else { + formDto.setIsPartyMember(YesOrNoEnum.NO.value()); + } formDto.setMobile(userDetail.getMobile()); return issueFeignClient.submitEvent(formDto); diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/NewsServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/NewsServiceImpl.java index f09fce3c5..3083efd38 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/NewsServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/NewsServiceImpl.java @@ -1,8 +1,6 @@ package com.elink.esua.epdc.service.impl; import com.elink.esua.epdc.common.token.dto.TokenDto; -import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; -import com.elink.esua.epdc.commons.tools.redis.RedisUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.epdc.form.*; import com.elink.esua.epdc.dto.epdc.result.*; @@ -11,7 +9,6 @@ import com.elink.esua.epdc.service.NewsService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.ArrayList; import java.util.List; /** @@ -27,9 +24,6 @@ public class NewsServiceImpl implements NewsService { @Autowired private NewsFeignClient newsFeignClient; - @Autowired - private RedisUtils redisUtils; - @Override public Result> listNotice(TokenDto userDetail, EpdcNoticeListFormDTO formDto) { formDto.setDeptId(userDetail.getGridId()); @@ -48,10 +42,6 @@ public class NewsServiceImpl implements NewsService { @Override public Result> listNews(TokenDto userDetail, EpdcNewsListFromDTO formDto) { - Object requireNewsList = redisUtils.get("epdc:switch:require:newsList"); - if (null != requireNewsList && YesOrNoEnum.NO.value().equals(requireNewsList.toString())) { - return new Result().ok(new ArrayList()); - } formDto.setDeptId(userDetail.getGridId()); return newsFeignClient.listNews(formDto); diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/TopicCommentServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/TopicCommentServiceImpl.java index c878f58c5..e3eededb8 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/TopicCommentServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/TopicCommentServiceImpl.java @@ -3,6 +3,8 @@ package com.elink.esua.epdc.service.impl; import com.elink.esua.epdc.async.WxMaSecCheckTask; import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.enums.UserTagEnum; +import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.comment.TopicCommentFormDTO; import com.elink.esua.epdc.dto.comment.TopicCommentStatementFormDTO; @@ -10,8 +12,8 @@ import com.elink.esua.epdc.dto.comment.TopicCommentsFormDTO; import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO; import com.elink.esua.epdc.feign.TopicCommentFeignClient; import com.elink.esua.epdc.service.TopicCommentService; +import com.elink.esua.epdc.utils.UserTagUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.listener.Topic; import org.springframework.stereotype.Service; /** @@ -38,6 +40,11 @@ public class TopicCommentServiceImpl implements TopicCommentService { topicCommentFormDTO.setUserId(userDetail.getUserId()); topicCommentFormDTO.setUserName(userDetail.getNickname()); topicCommentFormDTO.setUserFace(userDetail.getFaceImg()); + if (UserTagUtils.containIdentity(userDetail.getUserTagInfos(), UserTagEnum.PARTY_MEMBER)) { + topicCommentFormDTO.setPartyFlag(YesOrNoEnum.YES.value()); + } else { + topicCommentFormDTO.setPartyFlag(YesOrNoEnum.NO.value()); + } return topicCommentFeignClient.submit(topicCommentFormDTO); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/TopicServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/TopicServiceImpl.java index 1ca2ad161..a0bd8b78b 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/TopicServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/TopicServiceImpl.java @@ -1,6 +1,8 @@ package com.elink.esua.epdc.service.impl; import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.enums.UserTagEnum; +import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; import com.elink.esua.epdc.dto.UploadToOssDTO; @@ -13,6 +15,7 @@ import com.elink.esua.epdc.feign.AdminFeignClient; import com.elink.esua.epdc.feign.OssFeignClient; import com.elink.esua.epdc.feign.TopicFeignClient; import com.elink.esua.epdc.service.TopicService; +import com.elink.esua.epdc.utils.UserTagUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; @@ -58,7 +61,11 @@ public class TopicServiceImpl implements TopicService { formDto.setUserId(userDetail.getUserId()); formDto.setUserFace(userDetail.getFaceImg()); formDto.setNickname(userDetail.getNickname()); - formDto.setPartyMember(userDetail.getPartyFlag()); + if (UserTagUtils.containIdentity(userDetail.getUserTagInfos(), UserTagEnum.PARTY_MEMBER)) { + formDto.setPartyMember(YesOrNoEnum.YES.value()); + } else { + formDto.setPartyMember(YesOrNoEnum.NO.value()); + } formDto.setMobile(userDetail.getMobile()); formDto.setState(TopicStateEnum.TOPIC_STATE_IN_CONVERSATION.getValue()); diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/utils/UserTagUtils.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/utils/UserTagUtils.java new file mode 100644 index 000000000..cdcd3d8b4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/utils/UserTagUtils.java @@ -0,0 +1,55 @@ +package com.elink.esua.epdc.utils; + +import com.elink.esua.epdc.commons.tools.enums.UserTagEnum; +import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; +import com.elink.esua.epdc.dto.UserTagInfo; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; + + +/** + * @Description 判断用户身份工具类 + * @Author yinzuomei + * @Date 2019/12/18 17:15 + */ +public class UserTagUtils { + private static Logger logger = LoggerFactory.getLogger(UserTagUtils.class); + +// /** +// * @param userTagInfos +// * @return java.lang.String +// * @Author yinzuomei +// * @Description 党员标识 0:否,1:是 +// * @Date 2019/12/18 17:23 +// **/ +// public static String getUserPartyFlag(List userTagInfos) { +// for (UserTagInfo userTagInfo : userTagInfos) { +// if (UserTagEnum.PARTY_MEMBER.value().equals(userTagInfo.getTagCode())) { +// return YesOrNoEnum.YES.value(); +// } +// } +// return YesOrNoEnum.NO.value(); +// } + + /** + * 判断用户是否有该身份 + * + * @param userTagInfos + * @param userTagEnum + * @return boolean + * @author rongchao + * @since 2019-12-19 + */ + public static boolean containIdentity(List userTagInfos, UserTagEnum userTagEnum) { + boolean flag = Boolean.FALSE; + for (UserTagInfo userTagInfo : userTagInfos) { + if (userTagEnum.value().equals(userTagInfo.getTagCode())) { + flag = Boolean.TRUE; + break; + } + } + return flag; + } +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application-dev.yml b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application-dev.yml new file mode 100644 index 000000000..e69de29bb diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application-prod.yml b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application-prod.yml new file mode 100644 index 000000000..cae812087 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application-prod.yml @@ -0,0 +1,3 @@ +nacos: + config: + server-addr: 47.104.224.45:8848 diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application-test.yml b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application-test.yml new file mode 100644 index 000000000..8a46445fc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application-test.yml @@ -0,0 +1,4 @@ +nacos: + config: + server-addr: 47.104.224.45:8848 + namespace: 6a3577b4-7b79-43f6-aebb-9c3f31263f6a diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application.yml index a933398e1..f8ff3c108 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application.yml +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application.yml @@ -1,3 +1,31 @@ +#server: +# port: 9700 +# servlet: +# context-path: /api +# +#spring: +# application: +# name: epdc-api-server +# profiles: +# active: @spring.profiles.active@ +# cloud: +# nacos: +# config: +# server-addr: 47.104.224.45:8848 +# namespace: 513d6635-3cfe-401f-b8b6-a04417288f47 +# group: EPDC_CONFIG_GROUP +# file-exetension: yaml +# enabled: true +# +#management: +# endpoints: +# web: +# exposure: +# include: * +# +#logging: +# config: classpath:logback-spring.xml + server: port: @server.port@ servlet: @@ -10,7 +38,7 @@ spring: name: epdc-api-server # 环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages,i18n/messages_common diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/logback-spring.xml b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/logback-spring.xml index 44493e410..9e01e480e 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/logback-spring.xml +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/logback-spring.xml @@ -144,10 +144,10 @@ - - - - + + + + @@ -156,4 +156,4 @@ - \ No newline at end of file + diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/test/java/com/elink/esua/epdc/UserTest.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/test/java/com/elink/esua/epdc/UserTest.java index 5f659ea76..04726e4b2 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/test/java/com/elink/esua/epdc/UserTest.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/test/java/com/elink/esua/epdc/UserTest.java @@ -38,7 +38,6 @@ public class UserTest { tokenDto.setGridId(1169158285790900226L); tokenDto.setMobile("15555555555"); tokenDto.setNickname("测试用户"); - tokenDto.setPartyFlag(YesOrNoEnum.YES.value()); tokenDto.setRealName("无名氏"); String token = jwtTokenUtils.generateToken(tokenDto.getUserId()); diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/evaluate/EvaluateOptionDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/evaluate/EvaluateOptionDTO.java index 627098785..c9949097d 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/evaluate/EvaluateOptionDTO.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/evaluate/EvaluateOptionDTO.java @@ -32,62 +32,62 @@ import java.util.Date; @Data public class EvaluateOptionDTO implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 3560066231753284041L; /** * 主键 */ - private String id; + private String id; /** * 权限编码(1.点赞,2.吐槽) */ - private Integer roleCode; + private Integer roleCode; /** * 评价选项 */ - private String optionContent; + private String optionContent; /** * 显示顺序 */ - private Integer sort; + private Integer sort; /** * 可用标记(0-不可用,1-可用) */ - private String available; + private String available; /** * 乐观锁 */ - private Integer revision; + private Integer revision; /** * 删除标识 0:否,1:是 */ - private String delFlag; + private String delFlag; /** * 创建人 */ - private String createdBy; + private String createdBy; /** * 创建时间 */ - private Date createdTime; + private Date createdTime; /** * 更新人 */ - private String updatedBy; + private String updatedBy; /** * 更新时间 */ - private Date updatedTime; + private Date updatedTime; /** * 一致性ID diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/evaluate/EvaluateSelectOption.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/evaluate/EvaluateSelectOption.java index 63c91d36a..61764b5f8 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/evaluate/EvaluateSelectOption.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/evaluate/EvaluateSelectOption.java @@ -2,7 +2,6 @@ package com.elink.esua.epdc.dto.evaluate; import lombok.Data; -import java.util.List; /** * 评价选项 @@ -21,6 +20,7 @@ public class EvaluateSelectOption { * 选中状态 */ private String selectFlag; + /** * 选中选项 */ diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/evaluate/form/EvaluateOfficerAppFormDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/evaluate/form/EvaluateOfficerAppFormDTO.java index 61c651536..21014e7e6 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/evaluate/form/EvaluateOfficerAppFormDTO.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/evaluate/form/EvaluateOfficerAppFormDTO.java @@ -20,7 +20,6 @@ package com.elink.esua.epdc.dto.evaluate.form; import lombok.Data; import javax.validation.constraints.Min; -import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import java.io.Serializable; @@ -34,13 +33,13 @@ import java.io.Serializable; @Data public class EvaluateOfficerAppFormDTO implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 895858029611488210L; /** * 网格Id */ @NotNull(message = "网格Id不能为空") - private Long gridId; + private Long gridId; /** * 页码,从1开始 diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/evaluate/form/EvaluateSubmitFormDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/evaluate/form/EvaluateSubmitFormDTO.java index 21a403e31..a44894854 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/evaluate/form/EvaluateSubmitFormDTO.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/evaluate/form/EvaluateSubmitFormDTO.java @@ -24,7 +24,6 @@ import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import java.io.Serializable; -import java.util.Date; import java.util.List; @@ -37,38 +36,38 @@ import java.util.List; @Data public class EvaluateSubmitFormDTO implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1946721516617534087L; /** * 提交人姓名 */ @NotBlank(message = "姓名不能为空") - private String fullName; + private String fullName; /** * 联系电话 */ @NotBlank(message = "联系电话不能为空") - private String mobile; + private String mobile; /** * 干部ID 干部信息表主键 */ @NotBlank(message = "干部ID不能为空") - private String officerId; + private String officerId; /** * 评价类别(1.点赞,2.吐槽) */ @NotNull(message = "评价类别不能为空") - private Integer roleCode; + private Integer roleCode; /** * 评价内容 */ @Size(min = 0, max = 200, message = "评价内容在200字以内") - private String content; + private String content; /** * 评价选项 diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/pom.xml b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/pom.xml index 1cfb3681c..b4c1858ff 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/pom.xml @@ -198,9 +198,9 @@ 10005 2 - 47.104.224.45 - 6379 - elink@888 + 114.215.125.123 + 9603 + epdc!redis@master1405 diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/controller/EvaluateDeptController.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/controller/EvaluateDeptController.java index 436ef758a..abee743f5 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/controller/EvaluateDeptController.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/controller/EvaluateDeptController.java @@ -47,25 +47,25 @@ import java.util.Map; @RestController @RequestMapping("evaluatedept") public class EvaluateDeptController { - + @Autowired private EvaluateDeptService evaluateDeptService; @GetMapping("page") - public Result> page(@RequestParam Map params){ + public Result> page(@RequestParam Map params) { //PageData page = evaluateDeptService.page(params); PageData page = evaluateDeptService.getDeptPage(params); return new Result>().ok(page); } @GetMapping("{id}") - public Result get(@PathVariable("id") String id){ + public Result get(@PathVariable("id") String id) { EvaluateDeptDTO data = evaluateDeptService.get(id); return new Result().ok(data); } @PostMapping - public Result save(@RequestBody EvaluateDeptDTO dto){ + public Result save(@RequestBody EvaluateDeptDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); evaluateDeptService.save(dto); @@ -73,7 +73,7 @@ public class EvaluateDeptController { } @PutMapping - public Result update(@RequestBody EvaluateDeptDTO dto){ + public Result update(@RequestBody EvaluateDeptDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); evaluateDeptService.update(dto); @@ -81,23 +81,26 @@ public class EvaluateDeptController { } @DeleteMapping - public Result delete(@RequestBody String[] ids){ + public Result delete(@RequestBody String[] ids) { //效验数据 AssertUtils.isArrayEmpty(ids, "id"); evaluateDeptService.delete(ids); return new Result(); } + @GetMapping("countPage") - public Result> countPage(@RequestParam Map params){ + public Result> countPage(@RequestParam Map params) { PageData page = evaluateDeptService.getEvaluateDeptCountPage(params); System.out.println(params); return new Result>().ok(page); } + @GetMapping("deptUpdate") - public Result deptUpdate(){ + public Result deptUpdate() { evaluateDeptService.deptUpdate(); return new Result(); } + @GetMapping("countExport") public void countExport(@RequestParam Map params, HttpServletResponse response) throws Exception { List list = evaluateDeptService.countExport(params); diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/controller/EvaluateInfoController.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/controller/EvaluateInfoController.java index b9c67e152..6de9ed562 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/controller/EvaluateInfoController.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/controller/EvaluateInfoController.java @@ -29,7 +29,6 @@ import com.elink.esua.epdc.dto.evaluate.EvaluateInfoDTO; import com.elink.esua.epdc.dto.evaluate.form.EvaluateSubmitFormDTO; import com.elink.esua.epdc.dto.evaluate.result.EvaluateInfoResultDTO; import com.elink.esua.epdc.modules.evaluate.excel.EvaluateInfoExcel; -import com.elink.esua.epdc.modules.evaluate.service.EvaluateDetailService; import com.elink.esua.epdc.modules.evaluate.service.EvaluateInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -48,30 +47,31 @@ import java.util.Map; @RestController @RequestMapping("evaluateinfo") public class EvaluateInfoController { - + @Autowired private EvaluateInfoService evaluateInfoService; @GetMapping("page") - public Result> page(@RequestParam Map params){ + public Result> page(@RequestParam Map params) { PageData page = evaluateInfoService.infoPage(params); return new Result>().ok(page); } @GetMapping("{id}") - public Result get(@PathVariable("id") String id){ + public Result get(@PathVariable("id") String id) { EvaluateInfoDTO data = evaluateInfoService.get(id); return new Result().ok(data); } + @PostMapping("evaluateSubmit") - public Result evaluateSubmit(@RequestBody EvaluateSubmitFormDTO formDto){ + public Result evaluateSubmit(@RequestBody EvaluateSubmitFormDTO formDto) { ValidatorUtils.validateEntity(formDto); return evaluateInfoService.evaluateSubmit(formDto); } @PostMapping - public Result save(@RequestBody EvaluateInfoDTO dto){ + public Result save(@RequestBody EvaluateInfoDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); evaluateInfoService.save(dto); @@ -79,7 +79,7 @@ public class EvaluateInfoController { } @PutMapping - public Result update(@RequestBody EvaluateInfoDTO dto){ + public Result update(@RequestBody EvaluateInfoDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); evaluateInfoService.update(dto); @@ -87,7 +87,7 @@ public class EvaluateInfoController { } @DeleteMapping - public Result delete(@RequestBody String[] ids){ + public Result delete(@RequestBody String[] ids) { //效验数据 AssertUtils.isArrayEmpty(ids, "id"); evaluateInfoService.deleteEvaluate(ids[0]); diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/controller/EvaluateOptionController.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/controller/EvaluateOptionController.java index 7d6a636cd..51c46f547 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/controller/EvaluateOptionController.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/controller/EvaluateOptionController.java @@ -40,7 +40,6 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.util.List; import java.util.Map; -import java.util.UUID; /** @@ -52,25 +51,25 @@ import java.util.UUID; @RestController @RequestMapping("evaluateoption") public class EvaluateOptionController { - + @Autowired private EvaluateOptionService evaluateOptionService; @GetMapping("page") - public Result> page(@RequestParam Map params){ + public Result> page(@RequestParam Map params) { //PageData page = evaluateOptionService.page(params); PageData page = evaluateOptionService.getOptionPage(params); return new Result>().ok(page); } @GetMapping("{id}") - public Result get(@PathVariable("id") String id){ + public Result get(@PathVariable("id") String id) { EvaluateOptionDTO data = evaluateOptionService.get(id); return new Result().ok(data); } @PostMapping - public Result save(@RequestBody EvaluateOptionDTO dto){ + public Result save(@RequestBody EvaluateOptionDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); evaluateOptionService.save(dto); @@ -78,7 +77,7 @@ public class EvaluateOptionController { } @PutMapping - public Result update(@RequestBody EvaluateOptionDTO dto){ + public Result update(@RequestBody EvaluateOptionDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); evaluateOptionService.update(dto); @@ -86,7 +85,7 @@ public class EvaluateOptionController { } @DeleteMapping - public Result delete(@RequestBody String[] ids){ + public Result delete(@RequestBody String[] ids) { //效验数据 AssertUtils.isArrayEmpty(ids, "id"); evaluateOptionService.delete(ids); @@ -98,14 +97,16 @@ public class EvaluateOptionController { List list = evaluateOptionService.list(params); ExcelUtils.exportExcelToTarget(response, null, list, EvaluateOptionExcel.class); } + @GetMapping("getOptionList") - public Result> getOptionList(@RequestBody EvaluateOptionAppFormDTO formDto){ + public Result> getOptionList(@RequestBody EvaluateOptionAppFormDTO formDto) { ValidatorUtils.validateEntity(formDto); List list = evaluateOptionService.getOptionList(formDto); return new Result>().ok(list); } + @GetMapping("optionShowList") - public Result optionShowList(){ + public Result optionShowList() { List optionList = evaluateOptionService.optionShowList(); EvaluateOptions evalOption = new EvaluateOptions(); evalOption.setOptionList(optionList); @@ -114,12 +115,13 @@ public class EvaluateOptionController { /** * 更新可用标记 + * * @param evaluateOptionFormDTO - * @Author: wanggongfeng * @return + * @Author: wanggongfeng */ @PostMapping("updateOptionInfo") - public Result updateOptionInfo(@RequestBody EvaluateOptionFormDTO evaluateOptionFormDTO){ + public Result updateOptionInfo(@RequestBody EvaluateOptionFormDTO evaluateOptionFormDTO) { EvaluateOptionDTO dto = ConvertUtils.sourceToTarget(evaluateOptionFormDTO, EvaluateOptionDTO.class); evaluateOptionService.update(dto); return new Result(); @@ -127,6 +129,7 @@ public class EvaluateOptionController { /** * role表查询评价类别 + * * @return */ @GetMapping("listSimple") diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/controller/EvaluateRoleController.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/controller/EvaluateRoleController.java index 12b46ff24..9285b9b22 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/controller/EvaluateRoleController.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/controller/EvaluateRoleController.java @@ -47,24 +47,24 @@ import java.util.Map; @RestController @RequestMapping("evaluaterole") public class EvaluateRoleController { - + @Autowired private EvaluateRoleService evaluateRoleService; @GetMapping("page") - public Result> page(@RequestParam Map params){ + public Result> page(@RequestParam Map params) { PageData page = evaluateRoleService.page(params); return new Result>().ok(page); } @GetMapping("{id}") - public Result get(@PathVariable("id") String id){ + public Result get(@PathVariable("id") String id) { EvaluateRoleDTO data = evaluateRoleService.get(id); return new Result().ok(data); } @PostMapping - public Result save(@RequestBody EvaluateRoleDTO dto){ + public Result save(@RequestBody EvaluateRoleDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); evaluateRoleService.save(dto); @@ -72,7 +72,7 @@ public class EvaluateRoleController { } @PutMapping - public Result update(@RequestBody EvaluateRoleDTO dto){ + public Result update(@RequestBody EvaluateRoleDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); evaluateRoleService.update(dto); @@ -80,7 +80,7 @@ public class EvaluateRoleController { } @DeleteMapping - public Result delete(@RequestBody String[] ids){ + public Result delete(@RequestBody String[] ids) { //效验数据 AssertUtils.isArrayEmpty(ids, "id"); evaluateRoleService.delete(ids); @@ -95,21 +95,24 @@ public class EvaluateRoleController { /** * 获取可用标记 - * @Author: wanggongfeng + * * @return + * @Author: wanggongfeng */ @GetMapping("getAvailable") - public Result getAvailable(){ + public Result getAvailable() { EvaluateRoleDTO data = evaluateRoleService.getAvailable(); return new Result().ok(data); } + /** * 获取可用标记 - * @Author: wanggongfeng + * * @return + * @Author: wanggongfeng */ @GetMapping("getAppAvailable") - public Result getAppAvailable(){ + public Result getAppAvailable() { EvaluateRoleDTO data = evaluateRoleService.getAvailable(); RoleResultDTO role = new RoleResultDTO(); role.setAvailable(data.getAvailable()); @@ -118,12 +121,13 @@ public class EvaluateRoleController { /** * 更新可用标记 + * * @param evaluateRoleFormDTO - * @Author: wanggongfeng * @return + * @Author: wanggongfeng */ @PostMapping("updateRoleInfo") - public Result updateRoleInfo(@RequestBody EvaluateRoleFormDTO evaluateRoleFormDTO){ + public Result updateRoleInfo(@RequestBody EvaluateRoleFormDTO evaluateRoleFormDTO) { evaluateRoleService.updateAll(evaluateRoleFormDTO); return new Result(); } diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/dao/EvaluateDeptDao.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/dao/EvaluateDeptDao.java index bc7c8a52a..575722b39 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/dao/EvaluateDeptDao.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/dao/EvaluateDeptDao.java @@ -36,12 +36,15 @@ import java.util.Map; public interface EvaluateDeptDao extends BaseDao { /** * 条件查询 + * * @param params * @return */ List getDeptPage(Map params); + /** * 部门统计列表 + * * @Params: [params] * @Return: java.util.List * @Author: liuchuang diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/dao/EvaluateOfficerDao.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/dao/EvaluateOfficerDao.java index 237609bfa..36ddb3eff 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/dao/EvaluateOfficerDao.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/dao/EvaluateOfficerDao.java @@ -40,26 +40,31 @@ import java.util.Map; public interface EvaluateOfficerDao extends BaseDao { /** * 条件查询 + * * @param params * @return */ List getOfficerPage(Map params); - void updateCount(@Param("id")String id,@Param("type")String type); + void updateCount(@Param("id") String id, @Param("type") String type); /** * 数据批量插入 + * * @param evaluateOfficerEntities */ - void insertList(@Param("evaluateOfficerEntities")EvaluateOfficerEntity[] evaluateOfficerEntities); + void insertList(@Param("evaluateOfficerEntities") EvaluateOfficerEntity[] evaluateOfficerEntities); /** * 清空当前街道数据 + * * @param deptId */ - void deleteByDeptId(@Param("deptId")String deptId); + void deleteByDeptId(@Param("deptId") String deptId); + /** * 干部统计列表 + * * @Params: [params] * @Return: java.util.List * @Author: liuchuang @@ -69,34 +74,38 @@ public interface EvaluateOfficerDao extends BaseDao { /** * 干部列表 + * * @param formDto */ List getDeptOfficer(EvaluateOfficerAppFormDTO formDto); /** * 街道干部管理表干部人数加1 + * * @param deptId */ - void officerCountAddOne(@Param("deptId")String deptId); + void officerCountAddOne(@Param("deptId") String deptId); /** * 街道干部管理表干部人数减少对应数量 + * * @param evaluateUpdateDeptOfficerCountDTO */ void updateOfficerCount(EvaluateUpdateDeptOfficerCountDTO evaluateUpdateDeptOfficerCountDTO); /** * 导入操作时更新街道干部管理表干部人数 + * * @param evaluateUpdateDeptOfficerCountDTO */ void updateOfficerCountByDeptId(EvaluateUpdateDeptOfficerCountDTO evaluateUpdateDeptOfficerCountDTO); // 清空该人员相关评价数据 - void deleteEvaluateInfoById(@Param("ids")String[] ids); + void deleteEvaluateInfoById(@Param("ids") String[] ids); - void deleteEvaluateDetailById(@Param("ids")String[] ids); + void deleteEvaluateDetailById(@Param("ids") String[] ids); - void deleteEvaluateDetailByDeptId(@Param("deptId")String deptId); + void deleteEvaluateDetailByDeptId(@Param("deptId") String deptId); - void deleteEvaluateInfoByDeptId(@Param("deptId")String deptId); + void deleteEvaluateInfoByDeptId(@Param("deptId") String deptId); } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/dao/EvaluateOptionDao.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/dao/EvaluateOptionDao.java index 429b53d93..641e81fa2 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/dao/EvaluateOptionDao.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/dao/EvaluateOptionDao.java @@ -38,6 +38,7 @@ import java.util.Map; public interface EvaluateOptionDao extends BaseDao { /** * 条件查询 + * * @param params * @return */ @@ -45,18 +46,22 @@ public interface EvaluateOptionDao extends BaseDao { /** * 选项列表 + * * @param formDto * @return */ List getOptionList(EvaluateOptionAppFormDTO formDto); + /** * 选项显示列表(后台) + * * @return */ List optionShowList(); /** * role表查询评价类别(后台) + * * @return */ List listSimpleDictInfo(); diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/dao/EvaluateRoleDao.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/dao/EvaluateRoleDao.java index 8245eb2c3..ebb9773a6 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/dao/EvaluateRoleDao.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/dao/EvaluateRoleDao.java @@ -31,13 +31,16 @@ import org.apache.ibatis.annotations.Mapper; public interface EvaluateRoleDao extends BaseDao { /** * 获取启用状态 + * * @return */ EvaluateRoleEntity getAvailable(); /** * 更新全部 + * * @param entity */ void updateAll(EvaluateRoleEntity entity); + } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/entity/EvaluateOptionEntity.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/entity/EvaluateOptionEntity.java index 0f9380b62..c03a36cd7 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/entity/EvaluateOptionEntity.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/entity/EvaluateOptionEntity.java @@ -29,34 +29,35 @@ import lombok.EqualsAndHashCode; * @since v1.0.0 2020-02-05 */ @Data -@EqualsAndHashCode(callSuper=false) +@EqualsAndHashCode(callSuper = false) @TableName("epdc_evaluate_option") public class EvaluateOptionEntity extends BaseEpdcEntity { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 8924910114578173436L; /** * 权限编码(1.点赞,2.吐槽) */ - private Integer roleCode; + private Integer roleCode; /** * 评价选项 */ - private String optionContent; + private String optionContent; /** * 显示顺序 */ - private Integer sort; + private Integer sort; /** * 可用标记(0-不可用,1-可用) */ - private String available; - /** - * 一致性ID - */ - private String pid; + private String available; + + /** + * 一致性ID + */ + private String pid; } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/excel/EvaluateDeptCountExcel.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/excel/EvaluateDeptCountExcel.java index cc5e872f8..8209b6f07 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/excel/EvaluateDeptCountExcel.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/excel/EvaluateDeptCountExcel.java @@ -20,7 +20,6 @@ package com.elink.esua.epdc.modules.evaluate.excel; import cn.afterturn.easypoi.excel.annotation.Excel; import lombok.Data; -import java.util.Date; /** * 评价部门表 评价部门表 diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/EvaluateDeptService.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/EvaluateDeptService.java index 87d836ec5..5e3a2c4f9 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/EvaluateDeptService.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/EvaluateDeptService.java @@ -47,13 +47,16 @@ public interface EvaluateDeptService extends BaseService { /** * 分页条件查询 + * * @param params * @return */ PageData getDeptPage(Map params); PageData getEvaluateDeptCountPage(Map params); + List countExport(Map params); + /** * 默认查询 * @@ -63,6 +66,7 @@ public interface EvaluateDeptService extends BaseService { * @date 2020-02-05 */ List list(Map params); + /** * 街道同步 * diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/EvaluateInfoService.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/EvaluateInfoService.java index dbaceeaa0..d7da2dac7 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/EvaluateInfoService.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/EvaluateInfoService.java @@ -79,6 +79,7 @@ public interface EvaluateInfoService extends BaseService { * @date 2020-02-06 */ void save(EvaluateInfoDTO dto); + /** * 评价提交 * @@ -108,5 +109,6 @@ public interface EvaluateInfoService extends BaseService { * @date 2020-02-06 */ void delete(String[] ids); + void deleteEvaluate(String id); } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/EvaluateOptionService.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/EvaluateOptionService.java index 1cf705db3..b29b3d082 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/EvaluateOptionService.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/EvaluateOptionService.java @@ -49,6 +49,7 @@ public interface EvaluateOptionService extends BaseService /** * 分页条件查询 + * * @param params * @return */ @@ -56,6 +57,7 @@ public interface EvaluateOptionService extends BaseService /** * 获取评价选项列表 + * * @param formDto * @return */ diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/impl/EvaluateDeptServiceImpl.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/impl/EvaluateDeptServiceImpl.java index dba8f20f8..955915314 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/impl/EvaluateDeptServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/impl/EvaluateDeptServiceImpl.java @@ -60,12 +60,14 @@ public class EvaluateDeptServiceImpl extends BaseServiceImpl getEvaluateDeptCountPage(Map params) { IPage page = getPage(params); List list = baseDao.getEvaluateDeptCount(params); return new PageData<>(list, page.getTotal()); } + @Override public List countExport(Map params) { List list = baseDao.getEvaluateDeptCount(params); @@ -75,6 +77,7 @@ public class EvaluateDeptServiceImpl extends BaseServiceImpl list = baseDao.getDeptPage(params); return new PageData<>(list, page.getTotal()); } + @Override @Transactional(rollbackFor = Exception.class) public void deptUpdate() { @@ -97,8 +101,8 @@ public class EvaluateDeptServiceImpl extends BaseServiceImpl getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/impl/EvaluateInfoServiceImpl.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/impl/EvaluateInfoServiceImpl.java index 2ea43f9bd..0c5350cc7 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/impl/EvaluateInfoServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/impl/EvaluateInfoServiceImpl.java @@ -70,11 +70,12 @@ public class EvaluateInfoServiceImpl extends BaseServiceImpl infoPage(Map params) { IPage page = getPage(params); List list = baseDao.getInfoPage(params); - for(EvaluateInfoResultDTO item :list){ + for (EvaluateInfoResultDTO item : list) { item.setOptionsList(baseDao.getInfoDetail(item.getId())); } return new PageData<>(list, page.getTotal()); @@ -93,8 +94,8 @@ public class EvaluateInfoServiceImpl extends BaseServiceImpl getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); @@ -114,13 +115,14 @@ public class EvaluateInfoServiceImpl extends BaseServiceImpl 0){ + if (times > 0) { return new Result().error("今天已评价过该干部。"); } EvaluateInfoDTO dto = new EvaluateInfoDTO(); @@ -135,7 +137,7 @@ public class EvaluateInfoServiceImpl extends BaseServiceImpl 0) { // 数据库操作 - dataOperation(list,deptId); - }else{ - return creatResult("defeat",1,"未检测到数据,数据导入失败!"); + dataOperation(list, deptId); + } else { + return creatResult("defeat", 1, "未检测到数据,数据导入失败!"); } - return creatResult("success",0,"数据导入成功!"); - + return creatResult("success", 0, "数据导入成功!"); } /** @@ -309,7 +308,7 @@ public class EvaluateOfficerServiceImpl extends BaseServiceImpl list,String deptId){ + public void dataOperation(List list, String deptId) { // 清空该人员相关评价数据 和 当前街道数据 deleteInfoByDeptId(deptId); diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/impl/EvaluateOptionServiceImpl.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/impl/EvaluateOptionServiceImpl.java index 949217e2f..73b3fb52f 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/impl/EvaluateOptionServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/impl/EvaluateOptionServiceImpl.java @@ -28,10 +28,14 @@ import com.elink.esua.epdc.dto.evaluate.EvaluateOptionDTO; import com.elink.esua.epdc.dto.evaluate.form.EvaluateOptionAppFormDTO; import com.elink.esua.epdc.dto.evaluate.result.EvaluateOptionAppResultDTO; import com.elink.esua.epdc.dto.evaluate.result.RoleDictDTO; +import com.elink.esua.epdc.dto.evaluate.EvaluateShowOption; +import com.elink.esua.epdc.dto.evaluate.form.EvaluateOptionAppFormDTO; +import com.elink.esua.epdc.dto.evaluate.result.EvaluateOptionAppResultDTO; import com.elink.esua.epdc.modules.evaluate.dao.EvaluateOptionDao; import com.elink.esua.epdc.modules.evaluate.entity.EvaluateOptionEntity; import com.elink.esua.epdc.modules.evaluate.redis.EvaluateOptionRedis; import com.elink.esua.epdc.modules.evaluate.service.EvaluateOptionService; +import com.elink.esua.epdc.dto.evaluate.EvaluateOptionDTO; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -62,11 +66,13 @@ public class EvaluateOptionServiceImpl extends BaseServiceImpl getOptionList(EvaluateOptionAppFormDTO formDto) { List list = baseDao.getOptionList(formDto); return list; } + @Override public List optionShowList() { List list = baseDao.optionShowList(); @@ -75,6 +81,7 @@ public class EvaluateOptionServiceImpl extends BaseServiceImpl getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); @@ -110,8 +117,7 @@ public class EvaluateOptionServiceImpl extends BaseServiceImplorika-spring-boot-starter 1.8.0 + + + org.flywaydb + flyway-core + @@ -86,10 +91,6 @@ true - - com.spotify - dockerfile-maven-plugin - diff --git a/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/java/com/elink/esua/epdc/entity/DemoEntity.java b/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/java/com/elink/esua/epdc/entity/DemoEntity.java index 2843c3c65..f5a4c074b 100644 --- a/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/java/com/elink/esua/epdc/entity/DemoEntity.java +++ b/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/java/com/elink/esua/epdc/entity/DemoEntity.java @@ -28,7 +28,7 @@ public class DemoEntity implements Serializable { * 用户ID */ @TableId - private Long id; + private String id; /** * 用户名 */ diff --git a/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/java/com/elink/esua/epdc/service/impl/DemoServiceImpl.java b/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/java/com/elink/esua/epdc/service/impl/DemoServiceImpl.java index b5620cd41..1546e86ce 100644 --- a/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/java/com/elink/esua/epdc/service/impl/DemoServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/java/com/elink/esua/epdc/service/impl/DemoServiceImpl.java @@ -16,7 +16,9 @@ import com.elink.esua.epdc.dao.DemoDao; import com.elink.esua.epdc.dto.DemoDto; import com.elink.esua.epdc.entity.DemoEntity; import com.elink.esua.epdc.service.DemoService; +import io.seata.spring.annotation.GlobalTransactional; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.List; @@ -36,6 +38,6 @@ public class DemoServiceImpl extends BaseServiceImpl implem public Result> demoService() { QueryWrapper demoEntityWrapper = new QueryWrapper<>(); List entityList = baseDao.selectList(demoEntityWrapper); - return new Result().ok(ConvertUtils.sourceToTarget(entityList,DemoDto.class)); + return new Result().ok(ConvertUtils.sourceToTarget(entityList, DemoDto.class)); } } diff --git a/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/resources/application.yml index 0b9d84ec4..72bd5fcc8 100644 --- a/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/resources/application.yml +++ b/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/resources/application.yml @@ -15,17 +15,11 @@ spring: jackson: time-zone: GMT+8 date-format: yyyy-MM-dd HH:mm:ss - redis: - database: 0 - host: 47.104.224.45 - timeout: 30s - port: 6379 - password: elink@888 datasource: type: com.alibaba.druid.pool.DruidDataSource druid: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://47.104.224.45:3308/epdc_demo?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=UTC + url: jdbc:mysql://47.104.224.45:3308/esua_epdc_demo?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=UTC username: root password: shibei@888 cloud: @@ -33,6 +27,7 @@ spring: discovery: server-addr: 47.104.224.45:8848 register-enabled: true + namespace: 6a3577b4-7b79-43f6-aebb-9c3f31263f6a alibaba: seata: tx-service-group: epdc-demo-server-fescar-service-group diff --git a/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/resources/db/migration/V1_1__INIT_DATABASE.sql b/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/resources/db/migration/V1_1__INIT_DATABASE.sql new file mode 100644 index 000000000..98c3f580c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/resources/db/migration/V1_1__INIT_DATABASE.sql @@ -0,0 +1,12 @@ +CREATE TABLE person ( + id int(11) NOT NULL AUTO_INCREMENT, + first varchar(100) NOT NULL, + last varchar(100) NOT NULL, + dateofbirth DATE DEFAULT null, + placeofbirth varchar(100) not null, + PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +insert into person (first,last,dateofbirth,placeofbirth) values('Dursun','KOC', STR_TO_DATE('02/10/1982', '%m/%d/%Y'),'Erzincan'); + +insert into person (first,last,dateofbirth,placeofbirth) values('Durseeun','KeeOC', STR_TO_DATE('05/10/1982', '%m/%d/%Y'),'Erzeeincan'); diff --git a/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/resources/registry.conf b/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/resources/registry.conf index 9cfedf9cc..c455f48c9 100644 --- a/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/resources/registry.conf +++ b/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/resources/registry.conf @@ -4,7 +4,7 @@ registry { nacos { serverAddr = "47.104.224.45" - namespace = "public" + namespace = "6a3577b4-7b79-43f6-aebb-9c3f31263f6a" cluster = "default" } } @@ -15,7 +15,7 @@ config { nacos { serverAddr = "47.104.224.45" - namespace = "public" + namespace = "6a3577b4-7b79-43f6-aebb-9c3f31263f6a" cluster = "default" } } diff --git a/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/test/java/com/elink/esua/epdc/OrikaTest.java b/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/test/java/com/elink/esua/epdc/OrikaTest.java index 59ef3f8a6..a3a158cef 100644 --- a/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/test/java/com/elink/esua/epdc/OrikaTest.java +++ b/esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/test/java/com/elink/esua/epdc/OrikaTest.java @@ -29,7 +29,7 @@ public class OrikaTest { @Test public void Test() { DemoEntity demoEntity = new DemoEntity(); - demoEntity.setId(1000L); +// demoEntity.setId(1000L); demoEntity.setName("name"); demoEntity.setAge(19); diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/category/form/CategoryInfoFormDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/category/form/CategoryInfoFormDTO.java deleted file mode 100644 index 0d5221077..000000000 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/category/form/CategoryInfoFormDTO.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.elink.esua.epdc.dto.category.form; - -import lombok.Data; - -import java.io.Serializable; - -/** - * @Description - * @Author yinzuomei - * @Date 2019/12/4 10:29 - */ -@Data -public class CategoryInfoFormDTO implements Serializable { - private static final long serialVersionUID = -8214790072156444793L; - - /** - * 主键集合 - */ - private Long[] ids; -} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/category/result/CategoryInfoResultDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/category/result/CategoryInfoResultDTO.java deleted file mode 100644 index dc7cdd7df..000000000 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/category/result/CategoryInfoResultDTO.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.elink.esua.epdc.dto.category.result; - -import lombok.Data; - -import java.io.Serializable; -import java.util.List; - -/** - * @Description - * @Author yinzuomei - * @Date 2019/12/4 9:05 - */ -@Data -public class CategoryInfoResultDTO implements Serializable { - private static final long serialVersionUID = 229431634619504645L; - - /** - * 主键 - */ - private Long id; - /** - * 分类名称 - */ - private String categoryName; - /** - * 上级分类ID - */ - private Long pid; - /** - * 所有上级分类ID,用逗号分开 - */ - private String pids; - - /** - * 所有上级分类名称,用逗号分开 - */ - private List parentNames; -} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/ReferenceTypeEnum.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/ReferenceTypeEnum.java deleted file mode 100644 index 6921bcdd3..000000000 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/ReferenceTypeEnum.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.elink.esua.epdc.enums; - -/** - * 议题或项目枚举 - * - * @author work@yujt.net.cn - * @date 2019/10/21 10:30 - */ -public enum ReferenceTypeEnum { - - /** - * 议题 - */ - ISSUE("issue"), - - /** - * 项目 - */ - ITEM("item"), - - /** - * 事件 - */ - EVENT("event"); - - private String name; - - ReferenceTypeEnum(String name) { - this.name = name; - } - - public String getName() { - return name; - } -} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml index 5d48d9bfa..4001c7ac8 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml @@ -199,9 +199,9 @@ 10006 2 - 47.104.224.45 - 6379 - elink@888 + 114.215.125.123 + 9603 + epdc!redis@master1405 diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentFormDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentFormDTO.java index d968ed85f..10424dd8f 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentFormDTO.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentFormDTO.java @@ -45,4 +45,9 @@ public class TopicCommentFormDTO { */ private String userFace; + /** + * 党员标识 0:否,1:是 + */ + private String partyFlag; + } diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/pom.xml b/esua-epdc/epdc-module/epdc-group/epdc-group-server/pom.xml index de1b2f150..fef7c8382 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/pom.xml @@ -51,6 +51,10 @@ feign-httpclient 10.3.0 + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + org.apache.rocketmq @@ -145,6 +149,21 @@ + + test @@ -154,9 +173,9 @@ 10007 2 - 47.104.224.45 - 6379 - elink@888 + 114.215.125.123 + 9603 + epdc!redis@master1405 @@ -172,6 +191,14 @@ 47.104.85.99:9876;114.215.125.123:9876 organizationGroup + diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/impl/TopicCommentServiceImpl.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/impl/TopicCommentServiceImpl.java index 5fd230415..2ca8e88bb 100755 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/impl/TopicCommentServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/impl/TopicCommentServiceImpl.java @@ -20,12 +20,11 @@ package com.elink.esua.epdc.modules.comment.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; import com.elink.esua.epdc.commons.tools.constant.NumConstant; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; -import com.elink.esua.epdc.commons.tools.constant.FieldConstant; import com.elink.esua.epdc.commons.tools.utils.Result; -import com.elink.esua.epdc.dto.UserDTO; import com.elink.esua.epdc.dto.comment.*; import com.elink.esua.epdc.dto.constant.TopicNoticeConstant; import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; @@ -35,9 +34,7 @@ import com.elink.esua.epdc.dto.topic.form.TopicReviewFormDTO; import com.elink.esua.epdc.modules.async.NewsTask; import com.elink.esua.epdc.modules.comment.dao.TopicCommentDao; import com.elink.esua.epdc.modules.comment.entity.TopicCommentEntity; -import com.elink.esua.epdc.modules.comment.redis.TopicCommentRedis; import com.elink.esua.epdc.modules.comment.service.TopicCommentService; -import com.elink.esua.epdc.modules.feign.UserFeignClient; import com.elink.esua.epdc.modules.topic.service.TopicService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -63,8 +60,6 @@ public class TopicCommentServiceImpl extends BaseServiceImpl page(Map params) { @@ -127,12 +122,7 @@ public class TopicCommentServiceImpl extends BaseServiceImpl userDTOResult=userFeignClient.getUserInfoById(commentFormDTO.getUserId()); - if(!userDTOResult.success()){ - return new Result().error("获取用户信息失败"); - } - commentEntity.setPartyFlag(userDTOResult.getData().getPartyFlag()); - + commentEntity.setPartyFlag(commentFormDTO.getPartyFlag()); boolean isComment = true; // 评论类型 0-评论 diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/application.yml index 8f4eda34f..70efc661f 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/application.yml +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/application.yml @@ -1,3 +1,23 @@ +#server: +# port: @server.port@ +# servlet: +# context-path: /group +# +#nacos: +# config: +# server-addr: @nacos.server-addr@ +# type: YAML +# namespace: @nacos.config.namespace@ +# group: @nacos.config.group@ +# dataId: epdc-group-server +# bootstrap: +# enable: true +# log: +# enable: @nacos.config.bootstrap.log.enable@ +# +#spring: +# application: +# name: epdc-group-server server: port: @server.port@ servlet: diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/pom.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/pom.xml index 43a03bffa..bbaf6ff33 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/pom.xml +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/pom.xml @@ -20,4 +20,6 @@ + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActBannerDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActBannerDTO.java new file mode 100644 index 000000000..fd850265a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActBannerDTO.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 爱心互助活动banner 爱心互助活动banner + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Data +public class ActBannerDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 活动ID + */ + private String actId; + + /** + * 标题 + */ + private String title; + + /** + * banner图片 + */ + private String bannerImg; + + /** + * banner类型 0-活动,1-连接 + */ + private String bannerType; + + /** + * 连接地址 + */ + private String url; + + /** + * 上下架状态 0-下架,1-上架 + */ + private String status; + + /** + * 上下架时间 + */ + private Date statusTime; + + /** + * banner位置 0-顶部 + */ + private String bannerPosition; + /** + * 默认状态 + */ + private String actUserDefaultState; + + /** + * 浏览数量 + */ + private Integer browseNum; + + /** + * 创建部门ID + */ + private Long deptId; + + /** + * 创建时间 + */ + private Date createdTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActClockListDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActClockListDTO.java new file mode 100644 index 000000000..3ef9e0844 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActClockListDTO.java @@ -0,0 +1,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 用户打卡列表 + * + * @author wanggongfeng + * @since v1.0.0 2019-12-17 + */ +@Data +public class ActClockListDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 打卡日志表主键ID + */ + private String id; + /** + * 用户姓名 + */ + private String nickname; + /** + * 头像 + */ + private String faceImg; + /** + * 党员标志 + */ + private String partyFlag; + /** + * 打卡时间 + */ + private Date clockTime; + /** + * 打卡描述 + */ + private String clockDesc; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActClockPicDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActClockPicDTO.java new file mode 100644 index 000000000..d91b37500 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActClockPicDTO.java @@ -0,0 +1,77 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 活动打卡图片表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-18 + */ +@Data +public class ActClockPicDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 打卡ID + */ + private String clockId; + + /** + * 图片地址 + */ + private String clockPic; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActInfoDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActInfoDTO.java new file mode 100644 index 000000000..379cdcf7d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActInfoDTO.java @@ -0,0 +1,219 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class ActInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 标题 + */ + private String title; + + /** + * 活动头图 + */ + private String headPic; + + /** + * 报名开始时间 + */ + private Date signupStartTime; + + /** + * 报名截止时间 + */ + private Date signupEndTime; + + /** + * 活动开始时间 + */ + private Date actStartTime; + + /** + * 打卡开始时间 + */ + private Date signinStartTime; + + /** + * 打卡截止时间 + */ + private Date signinEndTime; + + + + /** + * 活动结束时间 + */ + private Date actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动位置经度 + */ + private BigDecimal actLongitude; + + /** + * 活动位置纬度 + */ + private BigDecimal actLatitude; + + /** + *活动报名默认状态 + */ + private String actUserDefaultState; + + + /** + * 活动签到打卡地点 + */ + private String signinAddress; + + /** + * 活动签到打卡位置经度 + */ + private BigDecimal signinLongitude; + + /** + * 活动签到打卡位置纬度 + */ + private BigDecimal signinLatitude; + + /** + * 活动签到打卡半径(单位:米) + */ + private Integer clockRadius; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 已报名人数 + */ + private Integer signupNum; + + /** + * 活动打卡人数 + */ + private Integer clockNum; + + /** + * 活动分享数 + */ + private Integer actShareNum; + + /** + * 活动浏览数 + */ + private Integer actBrowseNum; + + /** + * 联系人 + */ + private String contacts; + + /** + * 联系电话 + */ + private String tel; + + /** + * 招募要求 + */ + private String requirement; + + /** + * 活动内容 + */ + private String actContent; + + /** + * 活动发布状态(0-下架,1上架) + */ + private String actStatus; + + /** + * 活动发布时间 + */ + private Date publishTime; + + /** + * 活动主办方 + */ + private String sponsor; + + /** + * 创建部门ID + */ + private Long deptId; + + /** + * 活动惩罚积分 + */ + private Integer punishmentPoints; + + /** + * 活动奖励积分 + */ + private Integer reward; + + /** + * 活动名额类型 + */ + private Integer actQuotaCategory; + /** + * 活动下架原因 + */ + private String cancelReason; + + /** + * 是否展示banner + */ + private String isBanner; + /** + * banner地址 + */ + private String bannerUrl; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserClockLogDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserClockLogDTO.java new file mode 100644 index 000000000..9551fad19 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserClockLogDTO.java @@ -0,0 +1,107 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 用户打卡日志表 用户打卡日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-17 + */ +@Data +public class ActUserClockLogDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 用户活动关系表ID + */ + private String actUserId; + + /** + * 打卡类型(0-打卡,1-更新打卡) + */ + private String clockType; + + /** + * 打卡时间 + */ + private Date clockTime; + + /** + * 打卡位置经度 + */ + private BigDecimal clockLongitude; + + /** + * 打卡位置纬度 + */ + private BigDecimal clockLatitude; + + /** + * 打卡地址 + */ + private String clockAddress; + + /** + * 打卡描述 + */ + private String clockDesc; + + /** + * 打卡是否有效(0-否,1-是) + */ + private String effectiveFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserLogDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserLogDTO.java new file mode 100644 index 000000000..8b29e8809 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserLogDTO.java @@ -0,0 +1,97 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 用户活动日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Data +public class ActUserLogDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 活动ID + */ +// private String actId; + + /** + * 用户ID + */ +// private String userId; + + /** + * 用户活动关系表主键ACT_USER_RELATION_ID + */ + private String actUserRelationId; + + /** + * 操作类别(0-报名,1-审核通过,2-打卡,3-取消报名,4-审核不通过,5-确认积分,6-拒绝加积分) + */ + private String operationType; + + /** + * 审核不通过的原因 + */ + private String failureReason; + + /** + * 操作时间 + */ + private Date operationTime; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserPointsLogDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserPointsLogDTO.java new file mode 100644 index 000000000..2b29726db --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserPointsLogDTO.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-21 + */ +@Data +public class ActUserPointsLogDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 用户活动关系表ID + */ + private String actUserId; + + /** + * 操作类型 0-系统确认积分,2-管理员确认积分,4-取消报名扣减积分,6-管理员扣减积分,8-拒绝积分 + */ + private String operationType; + + /** + * 操作积分类型 0-减积分,1-加积分 + */ + private String operationPointsType; + + /** + * 操作积分值 + */ + private Integer points; + + /** + * 处理原因 + */ + private String operationReason; + + /** + * 删除标识 0-否,1-是 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserRelationDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserRelationDTO.java new file mode 100644 index 000000000..e365873d9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserRelationDTO.java @@ -0,0 +1,137 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 用户活动关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Data +public class ActUserRelationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 活动ID + */ + private String actId; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户昵称 + */ + private String nickname; + + /** + * 用户头像 + */ + private String faceImg; + + /** + * 党员标识(0-否,1-是) + */ + private String partyFlag; + + /** + * 报名人真实姓名 + */ + private String realName; + + /** + * 性别(0-女,1-男) + */ + private String sex; + + /** + * 年龄 + */ + private Integer age; + + /** + * 联系电话 + */ + private String mobile; + + /** + * 身份证号 + */ + private String identityNo; + + /** + * 当前状态(0-报名,1-审核通过,2-打卡,3-取消报名,4-审核不通过) + */ + private String status; + + /** + * 未通过原因(仅当未通过时录入,并读取) + */ + private String failureReason; + + /** + * 审核时间 + */ + private Date auditTime; + + /** + * 报名时间 + */ + private Date signupTime; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppActUserCancelsignupDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppActUserCancelsignupDTO.java new file mode 100644 index 000000000..8ed743d9e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppActUserCancelsignupDTO.java @@ -0,0 +1,50 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 取消报名参数 + * + * @author wanggongfeng + * @since v1.0.0 2019-12-17 + */ +@Data +public class AppActUserCancelsignupDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private String userId; + /** + * 活动ID + */ + @NotBlank(message = "活动ID不能为空") + private String actId; + /** + * 取消报名原因 + */ + @NotBlank(message = "取消报名原因不能为空") + private String failureReason; +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppActUserClockLogDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppActUserClockLogDTO.java new file mode 100644 index 000000000..54a16100b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppActUserClockLogDTO.java @@ -0,0 +1,80 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; + +/** + * 用户打卡参数 + * + * @author wanggongfeng + * @since v1.0.0 2019-12-17 + */ +@Data +public class AppActUserClockLogDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private String userId; + /** + * 活动ID + */ + @NotBlank(message = "活动ID不能为空") + private String actId; + /** + * 打卡描述 + */ + @NotBlank(message = "打卡描述不能为空") + private String clockDesc; + /** + * 打卡位置经度 + */ + private BigDecimal clockLongitude; + /** + * 打卡位置纬度 + */ + private BigDecimal clockLatitude; + /** + * 打卡地址 + */ + @NotBlank(message = "打卡地址不能为空") + private String clockAddress; + /** + * 打卡图片 + */ + private ArrayList images; + /** + * 打卡类型(0-打卡,1-更新打卡) + */ + @NotBlank(message = "打卡类型不能为空") + private String clockType; + /** + * 打卡是否有效(0-否,1-是) + */ + @NotBlank(message = "打卡是否有效不能为空") + private String effectiveFlag; + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppClockListDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppClockListDTO.java new file mode 100644 index 000000000..1ad95cf1e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppClockListDTO.java @@ -0,0 +1,46 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 用户打卡列表 + * + * @author wanggongfeng + * @since v1.0.0 2019-12-17 + */ +@Data +public class AppClockListDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 活动打卡人次 + */ + private int clockNum; + + /** + * 打卡列表 + */ + private List clocks; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActInfoAppFormDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActInfoAppFormDTO.java new file mode 100644 index 000000000..a90e174a1 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActInfoAppFormDTO.java @@ -0,0 +1,70 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class ActInfoAppFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 页码,从1开始 + */ + @Min(value = 1, message = "页码必须大于0") + private int pageIndex; + + private String userId; + + private String id; + /** + * 页容量,默认20页 + */ + @Min(value = 1, message = "每页条数必须大于必须大于0") + private int pageSize = 20; + /** + * 第一页查询发起时的时间 + */ + @NotBlank(message = "时间戳不能为空") + private String timestamp; + + /** + * 活动列表类型 + */ + @NotBlank(message = "类型不能为空") + private String actType; + + /** + * 活动id + */ + private String actId; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActInfoFormDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActInfoFormDTO.java new file mode 100644 index 000000000..32f90f099 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActInfoFormDTO.java @@ -0,0 +1,210 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class ActInfoFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @NotBlank(message = "id不能为空") + private String id; + + /** + * 标题 + */ + private String title; + + /** + * 活动头图 + */ + private String headPic; + + /** + * 报名开始时间 + */ + private Date signupStartTime; + + /** + * 报名截止时间 + */ + private Date signupEndTime; + + /** + * 活动开始时间 + */ + private Date actStartTime; + /** + *活动报名默认状态 + */ + private String actUserDefaultState; + + /** + * 活动结束时间 + */ + private Date actEndTime; + /** + * 打卡开始时间 + */ + private Date signinStartTime; + + /** + * 打卡截止时间 + */ + private Date signinEndTime; + + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动位置经度 + */ + private BigDecimal actLongitude; + + /** + * 活动位置纬度 + */ + private BigDecimal actLatitude; + + /** + * 活动签到打卡地点 + */ + private String signinAddress; + + /** + * 活动签到打卡位置经度 + */ + private BigDecimal signinLongitude; + + /** + * 活动签到打卡位置纬度 + */ + private BigDecimal signinLatitude; + + /** + * 活动签到打卡半径(单位:米) + */ + private Integer clockRadius; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 已报名人数 + */ + private Integer signupNum; + + /** + * 活动打卡人数 + */ + private Integer clockNum; + + /** + * 活动分享数 + */ + private Integer actShareNum; + + /** + * 活动浏览数 + */ + private Integer actBrowseNum; + + /** + * 联系人 + */ + private String contacts; + + /** + * 联系电话 + */ + private String tel; + + /** + * 招募要求 + */ + private String requirement; + + /** + * 活动内容 + */ + private String actContent; + + /** + * 活动发布状态(0-下架,1上架) + */ + private String actStatus; + + /** + * 活动发布时间 + */ + private Date publishTime; + + /** + * 活动主办方 + */ + private String sponsor; + + /** + * 创建部门ID + */ + private Long deptId; + + /** + * 活动惩罚积分 + */ + private Integer punishmentPoints; + + /** + * 活动奖励积分 + */ + private Integer reward; + + /** + * 活动名额类型 + */ + private Integer actQuotaCategory; + + /** + * 活动下架原因 + */ + @NotBlank(message = "下架原因不能为空") + private String cancelReason; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActPointCheckFormDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActPointCheckFormDTO.java new file mode 100644 index 000000000..b47ed5f82 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActPointCheckFormDTO.java @@ -0,0 +1,58 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class ActPointCheckFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * epdc_act_user_relation表主键 + */ + @NotBlank(message = "id不能为空") + private String id; + /** + * 活动 + */ + private String actId; + + /** + * 状态 + */ + @NotBlank(message = "状态不能为空") + private String status; + /** + * 未通过原因(仅当未通过时录入,并读取) + */ + @NotBlank(message = "原因不能为空") + private String failureReason; + + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActUserRelationAuditFormDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActUserRelationAuditFormDTO.java new file mode 100644 index 000000000..190b1becc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActUserRelationAuditFormDTO.java @@ -0,0 +1,116 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + + +/** + * 用户活动关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Data +public class ActUserRelationAuditFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @NotBlank(message = "id不能为空") + private String id; + + /** + * 活动ID + */ + private String actId; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户昵称 + */ + private String nickname; + + /** + * 用户头像 + */ + private String faceImg; + + /** + * 党员标识(0-否,1-是) + */ + private String partyFlag; + + /** + * 报名人真实姓名 + */ + private String realName; + + /** + * 性别(0-女,1-男) + */ + private String sex; + + /** + * 年龄 + */ + private Integer age; + + /** + * 联系电话 + */ + private String mobile; + + /** + * 身份证号 + */ + private String identityNo; + + /** + * 当前状态(0-报名,1-审核通过,2-打卡,3-取消报名,4-审核不通过) + */ + private String status; + + /** + * 未通过原因(仅当未通过时录入,并读取) + */ + @NotBlank(message = "原因不能为空") + private String failureReason; + + /** + * 审核时间 + */ + private Date auditTime; + + /** + * 报名时间 + */ + private Date signupTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoAppResultDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoAppResultDTO.java new file mode 100644 index 000000000..a3f991333 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoAppResultDTO.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class ActInfoAppResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 标题 + */ + private String title; + + /** + * 活动开始时间 + */ + private String actStartTime; + + /** + * 活动结束时间 + */ + private String actEndTime; + + private String headPic; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 已报名人数 + */ + private Integer signupNum; + + /** + * 活动打卡人数 + */ + private Integer clockNum; + + /** + * 活动报名默认状态 + */ + private String actUserDefaultState; + + /** + * 活动当前状态(0-报名中,1-已报满,2-未开始,3-进行中,4-已结束) + */ + private String actCurrentState; + + /** + * 用户报名状态(0-未报名,1已报名) + */ + private String signupFlag; + + /** + * 用户打卡状态(0-未打卡,1-已打卡) + */ + private String clockFlag; + + /** + * 活动用户关联表ID + */ + private String actUserId; + + private String actQuotaCategory; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoClockResultDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoClockResultDTO.java new file mode 100644 index 000000000..510e144ea --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoClockResultDTO.java @@ -0,0 +1,80 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class ActInfoClockResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + /** + * 活动 + */ + private String actId; + + /** + * 活动签到打卡地点 + */ + private String address; + + /** + * 状态 + */ + private String status; + + /** + * pc前端详情需要的状态 + */ + private String oldStatus; + /** + * 原因 + */ + private String failureReason; + + /** + * 活动签到打卡位置经度 + */ + private BigDecimal longitude; + + /** + * 活动签到打卡位置纬度 + */ + private BigDecimal latitude; + + /** + * 活动签到打卡半径(单位:米) + */ + private Integer radius; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoDetailAppResultDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoDetailAppResultDTO.java new file mode 100644 index 000000000..d03cd1f68 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoDetailAppResultDTO.java @@ -0,0 +1,227 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class ActInfoDetailAppResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 标题 + */ + private String title; + + /** + * 联系人 + */ + private String contacts; + + /** + * 联系电话 + */ + private String tel; + + /** + * 报名开始时间(yyyy-MM-dd HH:ss) + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date signupStartTime; + + /** + * 报名截止时间(yyyy-MM-dd HH:ss) + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date signupEndTime; + + /** + * 活动开始时间(yyyy-MM-dd HH:ss) + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actStartTime; + + /** + * 活动结束时间(yyyy-MM-dd HH:ss) + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动名额类型 + */ + private Integer actQuotaCategory; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 已报名人数 + */ + private Integer signupNum; + + /** + * 活动奖励积分 + */ + private Integer reward; + + /** + * 活动惩罚积分 + */ + private Integer punishmentPoints; + + /** + * 招募要求 + */ + private String requirement; + + /** + * 活动内容 + */ + private String actContent; + + /** + * 用户当前状态(0-我要报名,1-取消报名,2-已报满,3-未开始,4-我要打卡,5-更新打卡,6-已结束,7-已取消) + */ + private String currentUserStatus; + + /** + * 用户认证志愿者标识(0-待审核,1-认证通过,2-待认证,3-黑名单) + */ + private String userVolunteerFlag; + +/**********************************************************************/ +/**********************************************************************/ +/**********************************************************************/ + /** + * 活动头图 + */ + private String headPic; + + /** + * 活动报名默认状态 + */ + private String actUserDefaultState; + + /** + * 打卡开始时间 + */ + private Date signinStartTime; + + /** + * 打卡截止时间 + */ + private Date signinEndTime; + + /** + * 活动位置经度 + */ + private BigDecimal actLongitude; + + /** + * 活动位置纬度 + */ + private BigDecimal actLatitude; + + /** + * 活动签到打卡地点 + */ + private String signinAddress; + + /** + * 活动签到打卡位置经度 + */ + private BigDecimal signinLongitude; + + /** + * 活动签到打卡位置纬度 + */ + private BigDecimal signinLatitude; + + /** + * 活动签到打卡半径(单位:米) + */ + private Integer clockRadius; + + /** + * 活动打卡人数 + */ + private Integer clockNum; + + /** + * 活动分享数 + */ + private Integer actShareNum; + + /** + * 活动浏览数 + */ + private Integer actBrowseNum; + + /** + * 活动发布状态(0-下架,1上架) + */ + private String actStatus; + + /** + * 活动发布时间 + */ + private Date publishTime; + + /** + * 活动主办方 + */ + private String sponsor; + + /** + * 创建部门ID + */ + private Long deptId; + + /** + * 活动下架原因 + */ + private String cancelReason; + + private String failureReason; + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoDetailResultDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoDetailResultDTO.java new file mode 100644 index 000000000..6c65730bd --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoDetailResultDTO.java @@ -0,0 +1,123 @@ +package com.elink.esua.epdc.activity.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description 爱心互助-活动详情接口反参DTO + * @Author yinzuomei + * @Date 2020/2/5 14:34 + */ +@Data +public class ActInfoDetailResultDTO implements Serializable { + private static final long serialVersionUID = -4313589227925153627L; + /** + * 主键 + */ + private String id; + + /** + * 标题 + */ + private String title; + + /** + * 联系人 + */ + private String contacts; + + /** + * 联系电话 + */ + private String tel; + + /** + * 报名开始时间(yyyy-MM-dd HH:ss) + */ + private Date signupStartTime; + + /** + * 报名截止时间(yyyy-MM-dd HH:ss) + */ + private Date signupEndTime; + + /** + * 活动开始时间(yyyy-MM-dd HH:ss) + */ + private Date actStartTime; + + /** + * 活动结束时间(yyyy-MM-dd HH:ss) + */ + private Date actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动名额类型 + */ + private Integer actQuotaCategory; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 已报名人数 + */ + private Integer signupNum; + + /** + * 活动奖励积分 + */ + private Integer reward; + + /** + * 活动惩罚积分 + */ + private Integer punishmentPoints; + + /** + * 招募要求 + */ + private String requirement; + + /** + * 活动内容 + */ + private String actContent; + + /** + * 用户当前状态(0-我要报名,1-取消报名,2-已报满,3-未开始,4-我要打卡,5-更新打卡,6-已结束,7-已取消) + */ + private String currentUserStatus; + + /** + * 用户认证志愿者标识(0-待审核,1-认证通过,2-待认证,3-黑名单) + */ + private String userVolunteerFlag; + + /***************以下是拓展字段 **************************************************/ + /***************以下是拓展字段 **************************************************/ + /***************以下是拓展字段 **************************************************/ + /** + * 活动发布状态(0-下架,1上架) + */ + private String actStatus; + + /** + * 打卡开始时间 + */ + private Date signinStartTime; + + /** + * 打卡截止时间 + */ + private Date signinEndTime; +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoResultDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoResultDTO.java new file mode 100644 index 000000000..8623a50b6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoResultDTO.java @@ -0,0 +1,208 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class ActInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 标题 + */ + private String title; + + /** + * 活动头图 + */ + private String headPic; + + /** + * 报名开始时间 + */ + private Date signupStartTime; + /** + *活动报名默认状态 + */ + private String actUserDefaultState; + + /** + * 报名截止时间 + */ + private Date signupEndTime; + + /** + * 活动开始时间 + */ + private Date actStartTime; + + /** + * 活动结束时间 + */ + private Date actEndTime; + + /** + * 打卡开始时间 + */ + private Date signinStartTime; + + /** + * 打卡截止时间 + */ + private Date signinEndTime; + + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动位置经度 + */ + private BigDecimal actLongitude; + + /** + * 活动位置纬度 + */ + private BigDecimal actLatitude; + + /** + * 活动签到打卡地点 + */ + private String signinAddress; + + /** + * 活动签到打卡位置经度 + */ + private BigDecimal signinLongitude; + + /** + * 活动签到打卡位置纬度 + */ + private BigDecimal signinLatitude; + + /** + * 活动签到打卡半径(单位:米) + */ + private Integer clockRadius; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 已报名人数 + */ + private Integer signupNum; + + /** + * 活动打卡人数 + */ + private Integer clockNum; + + /** + * 活动分享数 + */ + private Integer actShareNum; + + /** + * 活动浏览数 + */ + private Integer actBrowseNum; + + /** + * 联系人 + */ + private String contacts; + + /** + * 联系电话 + */ + private String tel; + + /** + * 招募要求 + */ + private String requirement; + + /** + * 活动内容 + */ + private String actContent; + + /** + * 活动发布状态(0-下架,1上架) + */ + private String actStatus; + + /** + * 活动发布时间 + */ + private Date publishTime; + + /** + * 活动主办方 + */ + private String sponsor; + + /** + * 创建部门ID + */ + private Long deptId; + + /** + * 活动惩罚积分 + */ + private Integer punishmentPoints; + + /** + * 活动奖励积分 + */ + private Integer reward; + + /** + * 活动名额类型 + */ + private Integer actQuotaCategory; + + /** + * 活动下架原因 + */ + private String cancelReason; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserClockLogResultDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserClockLogResultDTO.java new file mode 100644 index 000000000..09d78d872 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserClockLogResultDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 用户打卡日志表 用户打卡日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-17 + */ +@Data +public class ActUserClockLogResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + /** + * 打卡时间 + */ + private Date clockTime; + + /** + * 打卡位置经度 + */ + private BigDecimal clockLongitude; + + /** + * 打卡位置纬度 + */ + private BigDecimal clockLatitude; + + /** + * 打卡地址 + */ + private String clockAddress; + + /** + * 打卡描述 + */ + private String clockDesc; + + /** + * 报名人真实姓名 + */ + private String realName; + + /** + * 性别(0-女,1-男) + */ + private String sex; + + /** + * 年龄 + */ + private Integer age; + + /** + * 联系电话 + */ + private String mobile; + /** + * 打卡详情图片地址集合 + */ + private String[] clockPic; + private String clockPics; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserClockResultDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserClockResultDTO.java new file mode 100644 index 000000000..474db6acc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserClockResultDTO.java @@ -0,0 +1,131 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 用户活动关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Data +public class ActUserClockResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 活动ID + */ + private String actId; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户昵称 + */ + private String nickname; + + /** + * 用户头像 + */ + private String faceImg; + + /** + * 党员标识(0-否,1-是) + */ + private String partyFlag; + + /** + * 报名人真实姓名 + */ + private String realName; + + /** + * 性别(0-女,1-男) + */ + private String sex; + + /** + * 年龄 + */ + private Integer age; + + /** + * 联系电话 + */ + private String mobile; + /** + * 打卡地点 + */ + private String clockAddress; + + /** + * 打卡次数 + */ + private String clockCount; + + /** + * 是否发放积分 + */ + private String checkPoint; + /** + * 是否发放积分 + */ + private String point; + + /** + * 身份证号 + */ + private String identityNo; + + /** + * 当前状态(0-报名,1-审核通过,2-打卡,3-取消报名,4-审核不通过) + */ + private String status; + + /** + * 未通过原因(仅当未通过时录入,并读取) + */ + private String failureReason; + + /** + * 审核时间 + */ + private Date auditTime; + + /** + * 报名时间 + */ + private Date signupTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserRelationResultDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserRelationResultDTO.java new file mode 100644 index 000000000..e6b54b0c4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserRelationResultDTO.java @@ -0,0 +1,113 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 用户活动关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Data +public class ActUserRelationResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 活动ID + */ + private String actId; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户昵称 + */ + private String nickname; + + /** + * 用户头像 + */ + private String faceImg; + + /** + * 党员标识(0-否,1-是) + */ + private String partyFlag; + + /** + * 报名人真实姓名 + */ + private String realName; + + /** + * 性别(0-女,1-男) + */ + private String sex; + + /** + * 年龄 + */ + private Integer age; + + /** + * 联系电话 + */ + private String mobile; + + /** + * 身份证号 + */ + private String identityNo; + + /** + * 当前状态(0-报名,1-审核通过,2-打卡,3-取消报名,4-审核不通过) + */ + private String status; + + /** + * 未通过原因(仅当未通过时录入,并读取) + */ + private String failureReason; + + /** + * 审核时间 + */ + private Date auditTime; + + /** + * 报名时间 + */ + private Date signupTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/AppActInfoDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/AppActInfoDTO.java new file mode 100644 index 000000000..735ce1227 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/AppActInfoDTO.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.activity.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class AppActInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + /** + * 活动签到打卡地点 + */ + private String signinAddress; + + /** + * 活动签到打卡位置经度 + */ + private BigDecimal signinLongitude; + + /** + * 活动签到打卡位置纬度 + */ + private BigDecimal signinLatitude; + + /** + * 活动签到打卡半径(单位:米) + */ + private Integer clockRadius; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/ActStateConstant.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/ActStateConstant.java new file mode 100644 index 000000000..a5a06e49f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/ActStateConstant.java @@ -0,0 +1,87 @@ +package com.elink.esua.epdc.constant; + +public interface ActStateConstant { + /** + * 活动状态-上架 + */ + String ACT_INFO_STATUS_GROUNDING = "1"; + /** + * 活动状态-下架 + */ + String ACT_INFO_STATUS_UNDERCARRIAGE = "0"; + + /** + * 活动BANNER状态-上架 + */ + String ACT_BANNER_STATUS_GROUNDING = "1"; + /** + * 活动BANNER状态-下架 + */ + String ACT_BANNER_STATUS_UNDERCARRIAGE = "0"; + + /** + * 活动报名状态-报名 + */ + String ACT_USER_RELATION_STATUS_APPLY = "0"; + /** + * 活动报名状态-通过 + */ + String ACT_USER_RELATION_STATUS_AUDITPASS = "1"; + + /** + * 活动报名状态-打卡 + */ + String ACT_USER_RELATION_STATUS_CLOCK = "2"; + + /** + * 活动报名状态-取消 + */ + String ACT_USER_RELATION_STATUS_CANCEL = "3"; + /** + * 活动报名状态-审核驳回 + */ + String ACT_USER_RELATION_STATUS_AUDITREJECT = "4"; + + /** + * 活动报名状态-确认积分 + */ + String ACT_USER_RELATION_STATUS_POINTPASS = "5"; + + /** + * 活动报名状态-拒绝积分 + */ + String ACT_USER_RELATION_STATUS_POINTREJECT = "6"; + + /** + * 积分操作类型-系统通过 + */ + String POINT_OPERATION_TYPE_SYSTEMPASS = "0"; + + /** + * 积分操作类型-管理员通过 + */ + String POINT_OPERATION_TYPE_ADMINPASS = "1"; + /** + * 积分操作类型-取消扣除 + */ + String POINT_OPERATION_TYPE_CANCELDEDUCT = "4"; + /** + * 积分操作类型-管理员扣除 + */ + String POINT_OPERATION_TYPE_ADMINDEDUCT = "6"; + /** + * 积分操作类型-管理员拒绝 + */ + String POINT_OPERATION_TYPE_ADMINREJECT = "8"; + /** + * 积分类型-增加 + */ + String OPERATION_POINTS_TYPE_ADD = "1"; + /** + * 积分类型-扣除 + */ + String OPERATION_POINTS_TYPE_DEDUCT = "0"; + + +} + diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/ActUserPointsOperationTypeConstant.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/ActUserPointsOperationTypeConstant.java new file mode 100644 index 000000000..cfd1f7329 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/ActUserPointsOperationTypeConstant.java @@ -0,0 +1,31 @@ +package com.elink.esua.epdc.constant; + +/** + * @Description 操作类型 0-系统确认积分,2-管理员确认积分,4-取消报名扣减积分,6-管理员扣减积分,8-拒绝积分 + * @Author yinzuomei + * @Date 2020/2/6 12:03 + */ +public interface ActUserPointsOperationTypeConstant { + /** + * 系统确认积分 + */ + String SYS_CONFIRM_ADD = "0"; + + /** + * 管理员确认积分 + */ + String ADMIN_CONFIRM="2"; + /** + * 取消报名扣减积分 + */ + String CANCEL_ACT_SUBTRACT="4"; + + /** + * 管理员扣减积分 + */ + String ADMIN_OPERATE_POINTS="6"; + /** + * 拒绝积分 + */ + String REFUSE_POINTS="8"; +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/ActUserRelationStatusConstant.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/ActUserRelationStatusConstant.java new file mode 100644 index 000000000..e087f504f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/ActUserRelationStatusConstant.java @@ -0,0 +1,43 @@ +package com.elink.esua.epdc.constant; + +/** + * @Description 用户活动关系表当前状态(0-报名,1-审核通过,2-打卡,3-取消报名,4-审核不通过,5-确认积分,6-拒绝加积分) + * @Author yinzuomei + * @Date 2020/2/5 21:35 + */ +public interface ActUserRelationStatusConstant { + /** + * 报名 + */ + String SIGN_UP="0"; + + /** + * 审核通过 + */ + String APPROVED="1"; + + /** + * 打卡 + */ + String CLOCK="2"; + + /** + * 取消报名 + */ + String CANCEL_SIGN_UP = "3"; + + /** + * 审核不通过 + */ + String NOT_APPROVED = "4"; + + /** + * 确认积分 + */ + String CONFIRM_ADD_POINTS = "5"; + + /** + * 拒绝加积分 + */ + String REFUSE_ADD_POINTS = "6"; +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/ActUserStatusConstant.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/ActUserStatusConstant.java new file mode 100644 index 000000000..0afe1a3f8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/ActUserStatusConstant.java @@ -0,0 +1,56 @@ +package com.elink.esua.epdc.constant; + +/** + * @Description 用户当前状态(0-我要报名,1-取消报名,2-已报满,3-未开始,4-我要打卡,5-更新打卡,6-已结束,7-已取消) + * @Author yinzuomei + * @Date 2020/2/5 14:49 + */ +public interface ActUserStatusConstant { + /** + * 我要报名 + */ + String SIGN_UP = "0"; + + /** + * 取消报名 + */ + String CANCEL_SIGN_UP = "1"; + + /** + * 已报满 + */ + String FULL_SIGN_UP = "2"; + + /** + * 未开始 + */ + String NOT_STARTED = "3"; + + /** + * 我要打卡 + */ + String CLOCK = "4"; + + /** + * 更新打卡 + */ + String UPDATE_CLOCK = "5"; + /** + * 已结束 + */ + String FINISHED = "6"; + /** + * 已取消 + */ + String CANCELED = "7"; + + /** + * 进行中 + */ + String ON_GOING = "8"; + + /** + * 已确认积分 + */ + String POINTS_CONFIRM = "9"; +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/HeartNoticeConstant.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/HeartNoticeConstant.java new file mode 100644 index 000000000..4f3850b83 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/HeartNoticeConstant.java @@ -0,0 +1,73 @@ +package com.elink.esua.epdc.constant; + +/** + * @Description 爱心互助模块发送消息常量 + * @Author yinzuomei + * @Date 2020/2/7 20:14 + */ +public interface HeartNoticeConstant { + /** + * 活动报名审核未通过 + */ + String NOTICE_SIGN_UP_NOT_PASSED = "您报名的活动【审核未通过】"; + + /** + * 活动报名审核通过 + */ + String NOTICE_SIGN_UP_PASSED = "您报名的活动【审核通过】"; + + /** + * 活动取消 + */ + String NOTICE_CANCEL_ACT = "您报名的活动【已经取消】"; + + /** + * 消息所属业务类型:活动(报名失败) + */ + String NOTICE__BUSINESS_TYPE_ACT_FAILURE = "act_sign_up_failure"; + /** + * 消息所属业务类型:活动(报名成功) + */ + String NOTICE__BUSINESS_TYPE_ACT_SUCCESS = "act_sign_up_success"; + /** + * 消息所属业务类型:活动(活动取消) + */ + String NOTICE__BUSINESS_TYPE_ACT_CANCEL = "act_cancel"; + /** + * 消息所属业务类型:积分(取消活动报名) + */ + String NOTICE__BUSINESS_TYPE_POINTS_SIGN_OUT = "points_act_sign_out"; + /** + * 消息所属业务类型:积分(活动积分,确认/增加) + */ + String NOTICE__BUSINESS_TYPE_POINTS_PLUS = "points_act_plus"; + /** + * 消息所属业务类型:积分(活动积分,拒绝) + */ + String NOTICE__BUSINESS_TYPE_POINTS_REJECT = "points_act_reject"; + /** + * 我的消息类型:0审核通知 + */ + String NOTICE_TYPE_AUDIT_NOTICE = "0"; + + /** + * 我的消息类型:1互动通知 + */ + String NOTICE_TYPE_INTERACTIVE_NOTICE = "1"; + + /** + * 打卡积分-拒绝加积分 + */ + String NOTICE_REFUSE_ADD_ACT_POINTS = "您参与的活动【拒绝积分】"; + + /** + * 打卡积分-确认加积分 + */ + String NOTICE_CONFIRM_ADD_ACT_POINTS = "您参与的活动【确认积分】"; + + /** + * 取消报名title + */ + String CANCEL_ACT_TITLE = "取消报名【扣减积分】"; + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/phrases/ActPhraseDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/phrases/ActPhraseDTO.java new file mode 100644 index 000000000..cb1143675 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/phrases/ActPhraseDTO.java @@ -0,0 +1,92 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.phrases; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 常用语表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class ActPhraseDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 常用语 + */ + private String phrase; + + /** + * 显示顺序 + */ + private Integer sort; + + /** + * 是否显示(0-否,1-是) + */ + private String showFlag; + + /** + * 使用次数 0 + */ + private Integer usageNum; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * code + */ + private String code; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/EpdcVolunteerRankDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/EpdcVolunteerRankDTO.java new file mode 100644 index 000000000..c847ccd62 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/EpdcVolunteerRankDTO.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.volunteer; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 志愿者排名 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-18 + */ +@Data +public class EpdcVolunteerRankDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 排名 + */ + private Integer sort; + + /** + * 头像 + */ + private String faceImg; + + /** + * 用户名 + */ + private String nickname; + + /** + * 是否党员(0-否,1-是) + */ + private String partyFlag; + + /** + * 爱心时长(单位:小时) + */ + private BigDecimal kindnessTime; + + /** + * 参加次数 + */ + private Integer participationNum; + + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/VolunteerRankDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/VolunteerRankDTO.java new file mode 100644 index 000000000..ca09f0839 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/VolunteerRankDTO.java @@ -0,0 +1,122 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.volunteer; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 志愿者排名 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Data +public class VolunteerRankDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 排名 + */ + private Integer sort; + + /** + * 志愿者ID + */ + private String volunteerId; + + /** + * 用户ID + */ + private String userId; + + /** + * 头像 + */ + private String faceImg; + + /** + * 用户名 + */ + private String nickname; + + /** + * 是否党员(0-否,1-是) + */ + private String partyFlag; + + /** + * 爱心时长(单位:小时) + */ + private BigDecimal kindnessTime; + + /** + * 参加次数 + */ + private Integer participationNum; + + /** + * 排行生成日期 + */ + private Date generateDate; + + /** + * 是否显示(0-不显示,1-显示) + */ + private String showFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标志 + */ + private String delFlag; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/Dockerfile b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/Dockerfile old mode 100755 new mode 100644 diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml index df5c1652c..4fa3d9077 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml @@ -18,6 +18,11 @@ epdc-heart-client 1.0.0 + + com.esua.epdc + epdc-user-client + 1.0.0 + com.esua.epdc epdc-commons-tools @@ -50,6 +55,34 @@ org.springframework.cloud spring-cloud-starter-zipkin + + com.esua.epdc + epdc-points-client + 1.0.0 + compile + + + com.esua.epdc + epdc-job-client + 1.0.0 + compile + + + + com.esua.epdc + epdc-common-clienttoken + 1.0.0 + compile + + + com.esua.epdc + epdc-news-client + 1.0.0 + compile + @@ -115,7 +148,7 @@ dev dev - 9060 + 9072 2 47.104.224.45 @@ -123,18 +156,25 @@ elink@888 - + - root - shibei@888 + epdc + elink833066 - true + false 47.104.224.45:8848 6a3577b4-7b79-43f6-aebb-9c3f31263f6a http://localhost:9411 + @@ -146,20 +186,53 @@ 10008 2 - 47.104.224.45 - 6379 - elink@888 + 114.215.125.123 + 9603 + epdc!redis@master1405 - + epdc - elink888 + elink833066 - false + true 47.104.224.45:8848 47.104.85.99 + 6a3577b4-7b79-43f6-aebb-9c3f31263f6a + + http://localhost:9411 + + + + + prod + + prod + prod + + 10008 + + + 0 + 172.16.0.54 + 6379 + Elink833066 + + + + + epdc + Elink@833066 + + true + 172.16.0.52:8848 + + + 172.16.0.52:9876;172.16.0.54:9876 + organizationGroup + categoryGroup http://localhost:9411 diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/controller/DemoController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/controller/DemoController.java deleted file mode 100644 index 48e87c871..000000000 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/controller/DemoController.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.elink.esua.epdc.controller; - -import com.elink.esua.epdc.commons.tools.utils.Result; -import com.elink.esua.epdc.dto.DemoDto; -import com.elink.esua.epdc.feign.DemoFeignClient; -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; - -import java.util.List; - -/** - * - * @author yujintao - * @email yujintao@elink-cn.com - * @date 2019/8/23 10:59 - */ -@RestController -@RequestMapping("demo") -public class DemoController { - - - @Autowired - private DemoFeignClient demoFeignClient; - - - @GetMapping("listAll") - public Result> listDemo(){ - Result> listResult = demoFeignClient.listDemo(); - return listResult; - } -} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActBannerController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActBannerController.java new file mode 100644 index 000000000..19e430ff3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActBannerController.java @@ -0,0 +1,107 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.controller; + +import com.elink.esua.epdc.activity.ActBannerDTO; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.modules.activity.excel.ActBannerExcel; +import com.elink.esua.epdc.modules.activity.service.ActBannerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +/** + * 爱心互助活动banner 爱心互助活动banner + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@RestController +@RequestMapping("actbanner") +public class ActBannerController { + + @Autowired + private ActBannerService actBannerService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = actBannerService.getActBannerPage(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ActBannerDTO data = actBannerService.get(id); + return new Result().ok(data); + } + @GetMapping("grounding/{id}") + public Result grounding(@PathVariable("id") String id){ + return actBannerService.grounding(id); + } + + @GetMapping("bannerlist") + public Result> getBannerList(){ + Map params =new HashMap(); + params.put("status","1"); + List data = actBannerService.list(params); + return new Result>().ok(data); + } + + @PostMapping + public Result save(@RequestBody ActBannerDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + actBannerService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ActBannerDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + actBannerService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + actBannerService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = actBannerService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ActBannerExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActClockPicController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActClockPicController.java new file mode 100644 index 000000000..a974d5968 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActClockPicController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.activity.ActClockPicDTO; +import com.elink.esua.epdc.modules.activity.excel.ActClockPicExcel; +import com.elink.esua.epdc.modules.activity.service.ActClockPicService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 活动打卡图片表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-18 + */ +@RestController +@RequestMapping("actclockpic") +public class ActClockPicController { + + @Autowired + private ActClockPicService actClockPicService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = actClockPicService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ActClockPicDTO data = actClockPicService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ActClockPicDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + actClockPicService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ActClockPicDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + actClockPicService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + actClockPicService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = actClockPicService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ActClockPicExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActInfoController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActInfoController.java new file mode 100644 index 000000000..269974089 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActInfoController.java @@ -0,0 +1,135 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.controller; + +import com.elink.esua.epdc.activity.ActBannerDTO; +import com.elink.esua.epdc.activity.ActInfoDTO; +import com.elink.esua.epdc.activity.form.ActInfoFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoClockResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoResultDTO; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.constant.ActStateConstant; +import com.elink.esua.epdc.dto.ScheduleJobDTO; +import com.elink.esua.epdc.modules.activity.excel.ActInfoExcel; +import com.elink.esua.epdc.modules.activity.service.ActBannerService; +import com.elink.esua.epdc.modules.activity.service.ActInfoService; +import com.elink.esua.epdc.modules.feign.JobFeignClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Map; + + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@RestController +@RequestMapping("actinfo") +public class ActInfoController { + + @Autowired + private ActInfoService actInfoService; + + + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + if(SecurityUser.getDeptId() != null){ + params.put("deptId", SecurityUser.getDeptId()); + } + System.out.println(params); + PageData page = actInfoService.getActInfoPageFromPC(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ActInfoDTO data = actInfoService.get(id); + return new Result().ok(data); + } + + + @PostMapping + @Transactional(rollbackFor=Exception.class) + public Result save(@RequestBody ActInfoDTO dto){ + //效验数据 + dto.setActStatus(ActStateConstant.ACT_INFO_STATUS_GROUNDING); + dto.setPublishTime(new Date()); + if(SecurityUser.getDeptId() != null){ + dto.setDeptId(SecurityUser.getDeptId()); + } + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + return actInfoService.save(dto); + } + + @PutMapping + public Result update(@RequestBody ActInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + actInfoService.update(dto); + return new Result(); + } + + /** + * + * 取消活动 + * + * @params [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2020/2/6 21:18 + */ + @PostMapping("cancel") + public Result cancel(@RequestBody ActInfoFormDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + return actInfoService.cancel(dto); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + actInfoService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = actInfoService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ActInfoExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserClockLogController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserClockLogController.java new file mode 100644 index 000000000..98e078a22 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserClockLogController.java @@ -0,0 +1,122 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.controller; + +import com.elink.esua.epdc.activity.ActInfoDTO; +import com.elink.esua.epdc.activity.form.ActPointCheckFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoClockResultDTO; +import com.elink.esua.epdc.activity.result.ActUserClockLogResultDTO; +import com.elink.esua.epdc.activity.result.ActUserClockResultDTO; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.activity.ActUserClockLogDTO; +import com.elink.esua.epdc.modules.activity.excel.ActUserClockLogExcel; +import com.elink.esua.epdc.modules.activity.service.ActUserClockLogService; +import com.elink.esua.epdc.modules.activity.service.ActUserRelationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 用户打卡日志表 用户打卡日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-17 + */ +@RestController +@RequestMapping("actuserclocklog") +public class ActUserClockLogController { + + @Autowired + private ActUserClockLogService actUserClockLogService; + + @Autowired + private ActUserRelationService actUserRelationService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = actUserClockLogService.getActUserClockLogFromPC(params); + System.out.println(page); + return new Result>().ok(page); + } + + @GetMapping("clockPage") + public Result> clockPage(@RequestParam Map params){ + PageData page = actUserRelationService.getActUserClockPageFromPC(params); + return new Result>().ok(page); + } + @GetMapping("clockDetail/{id}") + public Result clockDetail(@PathVariable("id") String id){ + ActInfoClockResultDTO data = actUserRelationService.getActDetail(id); + return new Result().ok(data); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ActUserClockLogDTO data = actUserClockLogService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ActUserClockLogDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + actUserClockLogService.save(dto); + return new Result(); + } + @PostMapping("pointCheck") + public Result pointCheck(@RequestBody ActPointCheckFormDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + actUserClockLogService.pointCheck(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ActUserClockLogDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + actUserClockLogService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + actUserClockLogService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = actUserClockLogService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ActUserClockLogExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserLogController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserLogController.java new file mode 100644 index 000000000..50b8188f2 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserLogController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.activity.ActUserLogDTO; +import com.elink.esua.epdc.modules.activity.excel.ActUserLogExcel; +import com.elink.esua.epdc.modules.activity.service.ActUserLogService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 用户活动日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@RestController +@RequestMapping("actuserlog") +public class ActUserLogController { + + @Autowired + private ActUserLogService actUserLogService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = actUserLogService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ActUserLogDTO data = actUserLogService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ActUserLogDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + actUserLogService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ActUserLogDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + actUserLogService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + actUserLogService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = actUserLogService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ActUserLogExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserPointsLogController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserPointsLogController.java new file mode 100644 index 000000000..3407156a9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserPointsLogController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.controller; + +import com.elink.esua.epdc.activity.ActUserPointsLogDTO; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.modules.activity.excel.ActUserPointsLogExcel; +import com.elink.esua.epdc.modules.activity.service.ActUserPointsLogService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-21 + */ +@RestController +@RequestMapping("actuserpointslog") +public class ActUserPointsLogController { + + @Autowired + private ActUserPointsLogService actUserPointsLogService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = actUserPointsLogService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ActUserPointsLogDTO data = actUserPointsLogService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ActUserPointsLogDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + actUserPointsLogService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ActUserPointsLogDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + actUserPointsLogService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + actUserPointsLogService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = actUserPointsLogService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ActUserPointsLogExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserRelationController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserRelationController.java new file mode 100644 index 000000000..b71d136c4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserRelationController.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.controller; + +import com.elink.esua.epdc.activity.ActUserRelationDTO; +import com.elink.esua.epdc.activity.form.ActUserRelationAuditFormDTO; +import com.elink.esua.epdc.activity.result.ActUserRelationResultDTO; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.modules.activity.excel.ActUserRelationExcel; +import com.elink.esua.epdc.modules.activity.service.ActUserRelationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + +/** + * 用户活动关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@RestController +@RequestMapping("actuserrelation") +public class ActUserRelationController { + + @Autowired + private ActUserRelationService actUserRelationService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = actUserRelationService.getActUserRelationPageFromPC(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ActUserRelationDTO data = actUserRelationService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ActUserRelationDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + actUserRelationService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ActUserRelationDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + actUserRelationService.update(dto); + return new Result(); + } + @PostMapping("audit") + public Result audit(@RequestBody ActUserRelationAuditFormDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + return actUserRelationService.audit(dto); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + actUserRelationService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = actUserRelationService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ActUserRelationExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActInfoController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActInfoController.java new file mode 100644 index 000000000..4ea76f491 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActInfoController.java @@ -0,0 +1,128 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.controller; + +import com.elink.esua.epdc.activity.ActInfoDTO; +import com.elink.esua.epdc.activity.form.ActInfoAppFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoAppResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoDetailAppResultDTO; +import com.elink.esua.epdc.activity.result.AppActInfoDTO; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.modules.activity.service.ActInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@RestController +@RequestMapping("appactinfo") +public class AppActInfoController { + + @Autowired + private ActInfoService actInfoService; + + /** + * 获取活动打卡地点详情 + * + * @param actId + * @return + */ + @GetMapping("clockAddressDetail/{actId}") + public Result clockAddressDetail(@PathVariable("actId") String actId) { + ActInfoDTO actInfoDTO = actInfoService.get(actId); + AppActInfoDTO appActInfoDTO = ConvertUtils.sourceToTarget(actInfoDTO, AppActInfoDTO.class); + return new Result().ok(appActInfoDTO); + } + + /** + * 活动列表--App端 + * + * @Params: [formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: lipengfei + * @Date: 2019/11/19 16:46 + */ + @GetMapping("list") + public Result> listItems(@RequestBody ActInfoAppFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + return this.actInfoService.listItemsByApp(formDto); + } + + /** + * 活动列表--App端 + * + * @Params: [formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: lipengfei + * @Date: 2019/11/19 16:46 + */ + @GetMapping("signupList") + public Result> signupListItems(@RequestBody ActInfoAppFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + return this.actInfoService.signupListItemsByApp(formDto); + } + + /** + * 项目详情--移动端 + * + * @Params: [id] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result + * @Author: lipengfei + * @Date: 2019/11/19 16:46 + */ + @GetMapping("detail") + public Result getDetail(@RequestBody ActInfoAppFormDTO formDto) { + return this.actInfoService.queryActInfoDetail(formDto); + } + + /** + * 获取活动报名审核失败详情 + * + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2020/4/7 10:07 + */ + @GetMapping("rejectdetail") + public Result getRejectDetail(@RequestBody ActInfoAppFormDTO formDto) { + return this.actInfoService.getRejectDetailByApp(formDto); + } + + /** + * 项目详情--工作端 + * + * @Params: [id] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result + * @Author: lipengfei + * @Date: 2019/11/19 16:46 + */ + @GetMapping("canceldetail/{id}") + public Result getCancelDetail(@PathVariable String id) { + return this.actInfoService.getCancelDetailByApp(id); + } + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserClockLogController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserClockLogController.java new file mode 100644 index 000000000..909ab547a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserClockLogController.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.controller; + +import com.elink.esua.epdc.activity.AppActUserClockLogDTO; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.modules.activity.service.ActUserClockLogService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + + +/** + * App打卡操作 + * + * @author wanggongfeng + * @since v1.0.0 2019-12-17 + */ +@RestController +@RequestMapping("appactuserclocklog") +public class AppActUserClockLogController { + + @Autowired + private ActUserClockLogService actUserClockLogService; + + /** + * 活动打卡 + * @param appActUserClockLogDTO + * @return + */ + @GetMapping("activityClock") + public Result activityClock(@RequestBody AppActUserClockLogDTO appActUserClockLogDTO){ + //效验数据 + ValidatorUtils.validateEntity(appActUserClockLogDTO, UpdateGroup.class, DefaultGroup.class); + return actUserClockLogService.activityClock(appActUserClockLogDTO); + + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java new file mode 100644 index 000000000..d36946a8c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java @@ -0,0 +1,83 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.controller; + +import com.elink.esua.epdc.activity.ActUserRelationDTO; +import com.elink.esua.epdc.activity.AppActUserCancelsignupDTO; +import com.elink.esua.epdc.activity.AppClockListDTO; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.modules.activity.service.ActUserRelationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * 用户活动关系表 + * + * @author wanggongfeng + * @since v1.0.0 2019-12-16 + */ +@RestController +@RequestMapping("appactuserrelation") +public class AppActUserRelationController { + + @Autowired + private ActUserRelationService actUserRelationService; + + /** + * 活动报名 + * @param actUserRelationDTO + * @return + */ + @GetMapping("activitySignUp") + public Result activitySignUp(@RequestBody ActUserRelationDTO actUserRelationDTO){ + return actUserRelationService.activitySignUp(actUserRelationDTO); + } + + /** + * 取消活动报名 + * @param appActUserCancelsignupDTO + * @return + */ + @GetMapping("activityCancelSignUp") + public Result activityCancelSignUp(@RequestBody AppActUserCancelsignupDTO appActUserCancelsignupDTO){ + ValidatorUtils.validateEntity(appActUserCancelsignupDTO); + return actUserRelationService.activityCancelSignUp(appActUserCancelsignupDTO); + } + + /** + * 通过活动ID查询打卡列表 + * @param actId + * @return + */ + @GetMapping("selectListActUserRelation/{actId}") + public Result selectListActUserRelation(@PathVariable("actId")String actId){ + return actUserRelationService.selectListActUserRelation(actId); + } + + /** + * 活动时间到自动审核通过未审核的报名人员 + * @param actId + * @return + */ + @GetMapping("AutoAuditActUser/{actId}") + public Result AutoAuditActUser(@PathVariable("actId")String actId){ + return actUserRelationService.updateAuditDefaultStatus(actId); + } + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActBannerDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActBannerDao.java new file mode 100644 index 000000000..190060322 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActBannerDao.java @@ -0,0 +1,78 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.dao; + +import com.elink.esua.epdc.activity.ActBannerDTO; +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.activity.entity.ActBannerEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 爱心互助活动banner 爱心互助活动banner + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Mapper +public interface ActBannerDao extends BaseDao { + List getActBannerlist(Map params); + + /** + * 根据actId查询banner单条数据 + * + * @param actId + * @return ActBannerDTO + * @author zy + * @date 2020-02-06 + */ + ActBannerDTO getBannerInfo(String actId); + + /** + * + * 下架第十条及以后的banner数据 + * + * @params [] + * @return void + * @author liuchuang + * @since 2020/2/6 21:05 + */ + void takeOffOtherBanners(); + + /** + * + * 根据活动ID下架banner + * + * @params [actId] + * @return void + * @author liuchuang + * @since 2020/2/6 21:24 + */ + void updateBannerByActId(String actId); + + /** + * @Description: 手机端banner查询,根据创建时间 正序排列 + * @Param: [params] + * @return: java.util.List + * @Author: zy + * @Date: 2020-02-08 + */ + List getAppActBannerlist(Map params); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActClockPicDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActClockPicDao.java new file mode 100644 index 000000000..34b83b451 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActClockPicDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.activity.entity.ActClockPicEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 活动打卡图片表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-18 + */ +@Mapper +public interface ActClockPicDao extends BaseDao { + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActInfoDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActInfoDao.java new file mode 100644 index 000000000..bbd6463f9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActInfoDao.java @@ -0,0 +1,116 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.dao; + +import com.elink.esua.epdc.activity.ActInfoDTO; +import com.elink.esua.epdc.activity.form.ActInfoAppFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoAppResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoDetailAppResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoDetailResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoResultDTO; +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.activity.entity.ActInfoEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Mapper +public interface ActInfoDao extends BaseDao { + /** + * 活动列表 + * @Params: [params] + * @Return: java.util.List + * @Author: liuchuang + * @Date: 2019/9/5 19:42 + */ + List getActInfoPageFromPC(Map params); + + /** + * 移动端-活动列表 + * @Params: [formDto] + * @Return: java.util.List + * @Author: liuchuang + * @Date: 2019/9/9 16:50 + */ + List listItemsByApp(ActInfoAppFormDTO formDto); + /** + * 移动端-活动列表(已报名) + * @Params: [formDto] + * @Return: java.util.List + * @Author: liuchuang + * @Date: 2019/9/9 16:50 + */ + List signupListItemsByApp(ActInfoAppFormDTO formDto); + + /** + * 工作端-项目详情 + * @Params: [formDto] + * @Return: com.elink.esua.epdc.dto.item.result.ItemDetailResultDTO + * @Author: lipengfei + * @Date: 2019/9/10 20:57 + */ + ActInfoDetailAppResultDTO getDetailByApp(ActInfoAppFormDTO formDto); + + ActInfoDetailAppResultDTO getRejectDetailByApp(ActInfoAppFormDTO formDto); + + ActInfoDetailAppResultDTO getCancelDetailByApp(ActInfoAppFormDTO formDto); + + /** + * @Description: 根据活动id,查询活动已报名人数 + * @Param: [actId] + * @return: ActInfoDTO + * @Author: zy + * @Date: 2020-02-05 + */ + ActInfoDTO queryActSignupNum(String actId); + + /** + * @param actId + * @return com.elink.esua.epdc.activity.result.ActInfoDetailResultDTO + * @Author yinzuomei + * @Description 活动详情 + * @Date 2020/2/5 16:31 + **/ + ActInfoDetailResultDTO selectActInfoDetailResultDTO(String actId); + + /** + * @param actId + * @return void + * @Author yinzuomei + * @Description 活动打卡人数+1 + * @Date 2020/2/8 13:08 + **/ + void addClockNum(String actId); + + + /*** + * 报名审核不通过 活动报名数-1 + * @param + * @return void + * @author qushutong + * @date 2020/4/3 9:25 + */ + void minusSignUpNum(String actId); +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserClockLogDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserClockLogDao.java new file mode 100644 index 000000000..275f386ad --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserClockLogDao.java @@ -0,0 +1,39 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.dao; + +import com.elink.esua.epdc.activity.result.ActUserClockLogResultDTO; +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.activity.entity.ActUserClockLogEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 用户打卡日志表 用户打卡日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-17 + */ +@Mapper +public interface ActUserClockLogDao extends BaseDao { + + List getActUserClockLogFromPC(Map params); + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserLogDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserLogDao.java new file mode 100644 index 000000000..1fdf0379b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserLogDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.activity.entity.ActUserLogEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户活动日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Mapper +public interface ActUserLogDao extends BaseDao { + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserPointsLogDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserPointsLogDao.java new file mode 100644 index 000000000..623b6131c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserPointsLogDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.activity.entity.ActUserPointsLogEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-21 + */ +@Mapper +public interface ActUserPointsLogDao extends BaseDao { + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java new file mode 100644 index 000000000..a6fb4cad3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java @@ -0,0 +1,119 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.dao; + +import com.elink.esua.epdc.activity.ActClockListDTO; +import com.elink.esua.epdc.activity.ActClockPicDTO; +import com.elink.esua.epdc.activity.ActUserRelationDTO; +import com.elink.esua.epdc.activity.result.ActInfoClockResultDTO; +import com.elink.esua.epdc.activity.result.ActUserClockResultDTO; +import com.elink.esua.epdc.activity.result.ActUserRelationResultDTO; +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.activity.entity.ActUserRelationEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 用户活动关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Mapper +public interface ActUserRelationDao extends BaseDao { + /** + * 查询用户是否已报名活动 + * @param userId + * @param actId + * @return + */ + int isSignUp(@Param("userId")String userId, @Param("actId")String actId); + + /** + * 获取用户活动关系表主键ID + * + * @param userId + * @param actId + * @param statusList + * @return + */ + List selectOneActUserRelationInfo(@Param("userId") String userId, + @Param("actId") String actId, + @Param("statusList") List statusList); + + /** + * 通过活动ID查询人员活动关系信息 + * @param actId + * @return + */ + List selectListActUserRelation(@Param("actId")String actId); + + /** + * 通过人员活动关系信息 + * @param id + * @return + */ + ActInfoClockResultDTO getActDetail(@Param("id")String id); + + /** + * 查询打卡图片 + * @param idArr + * @return + */ + List selectListClockImg(@Param("idArr")String[] idArr); + /** + * 报名列表 + * @Params: [params] + * @Return: java.util.List + * @Author: liuchuang + * @Date: 2019/9/5 19:42 + */ + List getActUserRelationPageFromPC(Map params); + + /** + * 自动审核 + * + * @param actId + * @return + */ + List selectListActUserInfo(@Param("actId") String actId); + + List getActUserClockPageFromPC(Map params); + + /** + * @param userId 用户id + * @param actId 活动id + * @return com.elink.esua.epdc.modules.activity.entity.ActUserRelationEntity + * @Author yinzuomei + * @Description 根据用户id+活动id活动信息表 + * @Date 2020/2/6 0:10 + **/ + ActUserRelationEntity selectOneByUserIdAndActId(@Param("userId") String userId, @Param("actId") String actId); + + /** + * @param actId + * @return java.util.List + * @Author yinzuomei + * @Description 根据活动id查询所有已经报名的用户 + * @Date 2020/2/7 20:53 + **/ + List selectAllSignUpUsers(String actId); +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActBannerEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActBannerEntity.java new file mode 100644 index 000000000..ac89c08e3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActBannerEntity.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 爱心互助活动banner 爱心互助活动banner + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_act_banner") +public class ActBannerEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 活动ID + */ + private String actId; + + /** + * 标题 + */ + private String title; + + /** + * banner图片 + */ + private String bannerImg; + + /** + * banner类型 0-活动,1-连接 + */ + private String bannerType; + + /** + * 连接地址 + */ + private String url; + + /** + * 上下架状态 0-下架,1-上架 + */ + private String status; + + /** + * 上下架时间 + */ + private Date statusTime; + + /** + * banner位置 0-顶部 + */ + private String bannerPosition; + + /** + * 浏览数量 + */ + private Integer browseNum; + + /** + * 创建部门ID + */ + private Long deptId; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActClockPicEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActClockPicEntity.java new file mode 100644 index 000000000..924367c52 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActClockPicEntity.java @@ -0,0 +1,48 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 活动打卡图片表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_act_clock_pic") +public class ActClockPicEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 打卡ID + */ + private String clockId; + + /** + * 图片地址 + */ + private String clockPic; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActInfoEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActInfoEntity.java new file mode 100644 index 000000000..68e6cc86d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActInfoEntity.java @@ -0,0 +1,205 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_act_info") +public class ActInfoEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 标题 + */ + private String title; + + /** + * 活动头图 + */ + private String headPic; + + /** + * 报名开始时间 + */ + private Date signupStartTime; + + /** + * 报名截止时间 + */ + private Date signupEndTime; + + /** + * 活动开始时间 + */ + private Date actStartTime; + + /** + * 活动结束时间 + */ + private Date actEndTime; + /** + * 打卡开始时间 + */ + private Date signinStartTime; + + /** + * 打卡截止时间 + */ + private Date signinEndTime; + + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 默认状态 + */ + private String actUserDefaultState; + + /** + * 活动位置经度 + */ + private BigDecimal actLongitude; + + /** + * 活动位置纬度 + */ + private BigDecimal actLatitude; + + /** + * 活动签到打卡地点 + */ + private String signinAddress; + /** + * 活动下架原因 + */ + private String cancelReason; + + /** + * 活动签到打卡位置经度 + */ + private BigDecimal signinLongitude; + + /** + * 活动签到打卡位置纬度 + */ + private BigDecimal signinLatitude; + + /** + * 活动签到打卡半径(单位:米) + */ + private Integer clockRadius; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 已报名人数 + */ + private Integer signupNum; + + /** + * 活动打卡人数 + */ + private Integer clockNum; + + /** + * 活动分享数 + */ + private Integer actShareNum; + + /** + * 活动浏览数 + */ + private Integer actBrowseNum; + + /** + * 联系人 + */ + private String contacts; + + /** + * 联系电话 + */ + private String tel; + + /** + * 招募要求 + */ + private String requirement; + + /** + * 活动内容 + */ + private String actContent; + + /** + * 活动发布状态(0-下架,1上架) + */ + private String actStatus; + + /** + * 活动发布时间 + */ + private Date publishTime; + + /** + * 活动主办方 + */ + private String sponsor; + + /** + * 创建部门ID + */ + private Long deptId; + + /** + * 活动惩罚积分 + */ + private Integer punishmentPoints; + + /** + * 活动奖励积分 + */ + private Integer reward; + /** + * 活动名额类型(0-不限名额,1-固定名额) + */ + private Integer actQuotaCategory; + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserClockLogEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserClockLogEntity.java new file mode 100644 index 000000000..f4c15b077 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserClockLogEntity.java @@ -0,0 +1,82 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 用户打卡日志表 用户打卡日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_act_user_clock_log") +public class ActUserClockLogEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户活动关系表ID + */ + private String actUserId; + + /** + * 打卡类型(0-打卡,1-更新打卡) + */ + private String clockType; + + /** + * 打卡时间 + */ + private Date clockTime; + + /** + * 打卡位置经度 + */ + private BigDecimal clockLongitude; + + /** + * 打卡位置纬度 + */ + private BigDecimal clockLatitude; + + /** + * 打卡地址 + */ + private String clockAddress; + + /** + * 打卡描述 + */ + private String clockDesc; + + /** + * 打卡是否有效(0-否,1-是) + */ + private String effectiveFlag; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserLogEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserLogEntity.java new file mode 100644 index 000000000..46b6e18d0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserLogEntity.java @@ -0,0 +1,70 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户活动日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_act_user_log") +public class ActUserLogEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 活动ID + */ +// private String actId; + + /** + * 用户ID + */ +// private String userId; + + /** + * 用户活动关系表主键ACT_USER_RELATION_ID + */ + private String actUserRelationId; + + /** + * 操作类别(0-报名,1-审核通过,2-打卡,3-取消报名,4-审核不通过) + */ + private String operationType; + + /** + * 审核不通过的原因 + */ + private String failureReason; + + /** + * 操作时间 + */ + private Date operationTime; + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserPointsLogEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserPointsLogEntity.java new file mode 100644 index 000000000..57b080f0c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserPointsLogEntity.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_act_user_points_log") +public class ActUserPointsLogEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户活动关系表ID + */ + private String actUserId; + + /** + * 操作类型 0-系统确认积分,2-管理员确认积分,4-取消报名扣减积分,6-管理员扣减积分,8-拒绝积分 + */ + private String operationType; + + /** + * 操作积分类型 0-减积分,1-加积分 + */ + private String operationPointsType; + + /** + * 操作积分值 + */ + private Integer points; + + /** + * 处理原因 + */ + private String operationReason; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiManualScoreTempEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserRelationEntity.java similarity index 54% rename from esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiManualScoreTempEntity.java rename to esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserRelationEntity.java index 7c342660c..751a2c228 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/entity/KpiManualScoreTempEntity.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserRelationEntity.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.elink.esua.epdc.entity; +package com.elink.esua.epdc.modules.activity.entity; import com.baomidou.mybatisplus.annotation.TableName; @@ -26,101 +26,86 @@ import lombok.EqualsAndHashCode; import java.util.Date; /** - * 绩效考核手动打分记录 + * 用户活动关系表 * * @author qu qu@elink-cn.com - * @since v1.0.0 2019-12-06 + * @since v1.0.0 2019-12-16 */ @Data @EqualsAndHashCode(callSuper=false) -@TableName("epdc_kpi_manual_score_temp") -public class KpiManualScoreTempEntity extends BaseEpdcEntity { +@TableName("epdc_act_user_relation") +public class ActUserRelationEntity extends BaseEpdcEntity { private static final long serialVersionUID = 1L; /** - * epdc_kpi_rule表主键 + * 活动ID */ - private String ruleId; + private String actId; /** - * 被打分的部门id + * 用户ID */ - private String deptId; - - /** - * 得分 - */ - private Integer score; - - /** - * 考核起止日期yyyy-MM-dd - */ - private Date scoreStartDate; - - /** - * 考核终止日期yyyy-MM-dd - */ - private Date scoreEndDate; + private String userId; /** - * 所有父级部门id + * 用户昵称 */ - private String parentDeptIds; + private String nickname; /** - * 所有父级部门名称 + * 用户头像 */ - private String parentDeptNames; + private String faceImg; /** - * 完整部门名称 + * 党员标识(0-否,1-是) */ - private String allDeptNames; + private String partyFlag; /** - * 完整部门id + * 报名人真实姓名 */ - private String allDeptIds; + private String realName; /** - * 导出用户id + * 性别(0-女,1-男) */ - private String userId; + private String sex; /** - * 街道 + * 年龄 */ - private String street; + private Integer age; /** - * 社区 + * 联系电话 */ - private String community; + private String mobile; /** - * 网格 + * 身份证号 */ - private String grid; + private String identityNo; /** - * 规则名称 + * 当前状态(0-报名,1-审核通过,2-打卡,3-取消报名,4-审核不通过) */ - private String ruleName; + private String status; /** - * 考核周期 + * 未通过原因(仅当未通过时录入,并读取) */ - private String kpiCycleName; + private String failureReason; /** - * 考核起止日期 + * 审核时间 */ - private String scoreStartTime; + private Date auditTime; /** - * 考核终止日期 + * 报名时间 */ - private String scoreEndTime; + private Date signupTime; -} +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActBannerExcel.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActBannerExcel.java new file mode 100644 index 000000000..d0e75687d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActBannerExcel.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 爱心互助活动banner 爱心互助活动banner + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Data +public class ActBannerExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "活动ID") + private String actId; + + @Excel(name = "标题") + private String title; + + @Excel(name = "banner图片") + private String bannerImg; + + @Excel(name = "banner类型 0-活动,1-连接") + private String bannerType; + + @Excel(name = "连接地址") + private String url; + + @Excel(name = "上下架状态 0-下架,1-上架") + private String status; + + @Excel(name = "上下架时间") + private Date statusTime; + + @Excel(name = "banner位置 0-顶部") + private String bannerPosition; + + @Excel(name = "浏览数量") + private Integer browseNum; + + @Excel(name = "创建部门ID") + private Long deptId; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "删除标识 0-否,1-是") + private String delFlag; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActClockPicExcel.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActClockPicExcel.java new file mode 100644 index 000000000..658430b80 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActClockPicExcel.java @@ -0,0 +1,59 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 活动打卡图片表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-18 + */ +@Data +public class ActClockPicExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "打卡ID") + private String clockId; + + @Excel(name = "图片地址") + private String clockPic; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActInfoExcel.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActInfoExcel.java new file mode 100644 index 000000000..c34943fc3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActInfoExcel.java @@ -0,0 +1,138 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class ActInfoExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "标题") + private String title; + + @Excel(name = "活动头图") + private String headPic; + + @Excel(name = "报名开始时间") + private Date signupStartTime; + + @Excel(name = "报名截止时间") + private Date signupEndTime; + + @Excel(name = "活动开始时间") + private Date actStartTime; + + @Excel(name = "活动结束时间") + private Date actEndTime; + + @Excel(name = "活动地点") + private String actAddress; + + @Excel(name = "活动位置经度") + private BigDecimal actLongitude; + + @Excel(name = "活动位置纬度") + private BigDecimal actLatitude; + + @Excel(name = "活动签到打卡地点") + private String signinAddress; + + @Excel(name = "活动签到打卡位置经度") + private BigDecimal signinLongitude; + + @Excel(name = "活动签到打卡位置纬度") + private BigDecimal signinLatitude; + + @Excel(name = "活动签到打卡半径(单位:米)") + private Integer clockRadius; + + @Excel(name = "活动名额") + private Integer actQuota; + + @Excel(name = "已报名人数") + private Integer signupNum; + + @Excel(name = "活动打卡人数") + private Integer clockNum; + + @Excel(name = "活动分享数") + private Integer actShareNum; + + @Excel(name = "活动浏览数") + private Integer actBrowseNum; + + @Excel(name = "联系人") + private String contacts; + + @Excel(name = "联系电话") + private String tel; + + @Excel(name = "招募要求") + private String requirement; + + @Excel(name = "活动内容") + private String actContent; + + @Excel(name = "活动发布状态(0-下架,1上架)") + private String actStatus; + + @Excel(name = "活动发布时间") + private Date publishTime; + + @Excel(name = "活动主办方") + private String sponsor; + + @Excel(name = "创建部门ID") + private Long deptId; + + @Excel(name = "活动惩罚积分") + private Integer punishmentPoints; + + @Excel(name = "活动奖励积分") + private Integer reward; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserClockLogExcel.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserClockLogExcel.java new file mode 100644 index 000000000..a209bb495 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserClockLogExcel.java @@ -0,0 +1,75 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 用户打卡日志表 用户打卡日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-17 + */ +@Data +public class ActUserClockLogExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "用户活动关系表ID") + private String actUserId; + + @Excel(name = "打卡类型(0-打卡,1-更新打卡)") + private String clockType; + + @Excel(name = "打卡时间") + private Date clockTime; + + @Excel(name = "打卡位置经度") + private BigDecimal clockLongitude; + + @Excel(name = "打卡位置纬度") + private BigDecimal clockLatitude; + + @Excel(name = "打卡地址") + private String clockAddress; + + @Excel(name = "打卡描述") + private String clockDesc; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserLogExcel.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserLogExcel.java new file mode 100644 index 000000000..db0a0e475 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserLogExcel.java @@ -0,0 +1,74 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 用户活动日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Data +public class ActUserLogExcel { + + @Excel(name = "主键") + private String id; + +// @Excel(name = "活动ID") +// private String actId; +// +// @Excel(name = "用户ID") +// private String userId; + + /** + * 用户活动关系表主键ACT_USER_RELATION_ID + */ + @Excel(name = "用户活动关系表主键") + private String actUserRelationId; + + @Excel(name = "操作类别(0-报名,1-审核通过,2-打卡,3-取消报名,4-审核不通过)") + private String operationType; + + @Excel(name = "审核不通过的原因") + private String failureReason; + + @Excel(name = "操作时间") + private Date operationTime; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserPointsLogExcel.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserPointsLogExcel.java new file mode 100644 index 000000000..77a2aff46 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserPointsLogExcel.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-21 + */ +@Data +public class ActUserPointsLogExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "用户活动关系表ID") + private String actUserId; + + @Excel(name = "操作类型 0-系统确认积分,2-管理员确认积分,4-取消报名扣减积分,6-管理员扣减积分,8-拒绝积分") + private String operationType; + + @Excel(name = "操作积分类型 0-减积分,1-加积分") + private String operationPointsType; + + @Excel(name = "操作积分值") + private Integer points; + + @Excel(name = "处理原因") + private String operationReason; + + @Excel(name = "删除标识 0-否,1-是") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserRelationExcel.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserRelationExcel.java new file mode 100644 index 000000000..89fd60f88 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserRelationExcel.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 用户活动关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Data +public class ActUserRelationExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "活动ID") + private String actId; + + @Excel(name = "用户ID") + private String userId; + + @Excel(name = "用户昵称") + private String nickname; + + @Excel(name = "用户头像") + private String faceImg; + + @Excel(name = "党员标识(0-否,1-是)") + private String partyFlag; + + @Excel(name = "报名人真实姓名") + private String realName; + + @Excel(name = "性别(0-女,1-男)") + private String sex; + + @Excel(name = "年龄") + private Integer age; + + @Excel(name = "联系电话") + private String mobile; + + @Excel(name = "身份证号") + private String identityNo; + + @Excel(name = "当前状态(0-报名,1-审核通过,2-打卡,3-取消报名,4-审核不通过)") + private String status; + + @Excel(name = "未通过原因(仅当未通过时录入,并读取)") + private String failureReason; + + @Excel(name = "审核时间") + private Date auditTime; + + @Excel(name = "报名时间") + private Date signupTime; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActBannerRedis.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActBannerRedis.java new file mode 100644 index 000000000..c4e3632b2 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActBannerRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 爱心互助活动banner 爱心互助活动banner + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Component +public class ActBannerRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActClockPicRedis.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActClockPicRedis.java new file mode 100644 index 000000000..0e12109bc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActClockPicRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 活动打卡图片表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-18 + */ +@Component +public class ActClockPicRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActInfoRedis.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActInfoRedis.java new file mode 100644 index 000000000..8d00799c6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActInfoRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Component +public class ActInfoRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserClockLogRedis.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserClockLogRedis.java new file mode 100644 index 000000000..85757a14a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserClockLogRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 用户打卡日志表 用户打卡日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-17 + */ +@Component +public class ActUserClockLogRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserLogRedis.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserLogRedis.java new file mode 100644 index 000000000..165d528f0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserLogRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 用户活动日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Component +public class ActUserLogRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiTimeLimitIssueRedis.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserPointsLogRedis.java similarity index 90% rename from esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiTimeLimitIssueRedis.java rename to esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserPointsLogRedis.java index 5ceb44d25..d80d75161 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/redis/KpiTimeLimitIssueRedis.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserPointsLogRedis.java @@ -15,20 +15,20 @@ * along with this program. If not, see . */ -package com.elink.esua.epdc.redis; +package com.elink.esua.epdc.modules.activity.redis; import com.elink.esua.epdc.commons.tools.redis.RedisUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * 议题响应时限 + * * * @author qu qu@elink-cn.com - * @since v1.0.0 2019-12-02 + * @since v1.0.0 2019-12-21 */ @Component -public class KpiTimeLimitIssueRedis { +public class ActUserPointsLogRedis { @Autowired private RedisUtils redisUtils; diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserRelationRedis.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserRelationRedis.java new file mode 100644 index 000000000..e013353ff --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserRelationRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 用户活动关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Component +public class ActUserRelationRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActBannerService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActBannerService.java new file mode 100644 index 000000000..40b4d88cc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActBannerService.java @@ -0,0 +1,133 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.service; + +import com.elink.esua.epdc.activity.ActBannerDTO; +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.modules.activity.entity.ActBannerEntity; + +import java.util.List; +import java.util.Map; + +/** + * 爱心互助活动banner 爱心互助活动banner + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +public interface ActBannerService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-19 + */ + PageData page(Map params); + + PageData getActBannerPage(Map params); + + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActBannerDTO + * @author generator + * @date 2019-12-19 + */ + ActBannerDTO get(String id); + + Result grounding(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-19 + */ + void save(ActBannerDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-19 + */ + void update(ActBannerDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-19 + */ + void delete(String[] ids); + + /** + * 根据actId查询banner单条数据 + * + * @param actId + * @return ActBannerDTO + * @author zy + * @date 2020-02-06 + */ + ActBannerDTO getBannerInfo(String actId); + + /** + * + * 下架第十条及以后的banner数据 + * + * @params [] + * @return void + * @author liuchuang + * @since 2020/2/6 20:50 + */ + void takeOffOtherBanners(); + + /** + * + * 根据活动ID下架banner + * + * @params [actId] + * @return void + * @author liuchuang + * @since 2020/2/6 21:22 + */ + void takeOffBannerByActId(String actId); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiManualScoreTempService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActClockPicService.java similarity index 64% rename from esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiManualScoreTempService.java rename to esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActClockPicService.java index 2aa80f771..323ec9890 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/KpiManualScoreTempService.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActClockPicService.java @@ -15,53 +15,53 @@ * along with this program. If not, see . */ -package com.elink.esua.epdc.service; +package com.elink.esua.epdc.modules.activity.service; import com.elink.esua.epdc.commons.mybatis.service.BaseService; import com.elink.esua.epdc.commons.tools.page.PageData; -import com.elink.esua.epdc.dto.KpiManualScoreTempDTO; -import com.elink.esua.epdc.entity.KpiManualScoreTempEntity; +import com.elink.esua.epdc.activity.ActClockPicDTO; +import com.elink.esua.epdc.modules.activity.entity.ActClockPicEntity; import java.util.List; import java.util.Map; /** - * 绩效考核手动打分记录 + * 活动打卡图片表 * * @author qu qu@elink-cn.com - * @since v1.0.0 2019-12-06 + * @since v1.0.0 2019-12-18 */ -public interface KpiManualScoreTempService extends BaseService { +public interface ActClockPicService extends BaseService { /** * 默认分页 * * @param params - * @return PageData + * @return PageData * @author generator - * @date 2019-12-06 + * @date 2019-12-18 */ - PageData page(Map params); + PageData page(Map params); /** * 默认查询 * * @param params - * @return java.util.List + * @return java.util.List * @author generator - * @date 2019-12-06 + * @date 2019-12-18 */ - List list(Map params); + List list(Map params); /** * 单条查询 * * @param id - * @return KpiManualScoreTempDTO + * @return ActClockPicDTO * @author generator - * @date 2019-12-06 + * @date 2019-12-18 */ - KpiManualScoreTempDTO get(String id); + ActClockPicDTO get(String id); /** * 默认保存 @@ -69,9 +69,9 @@ public interface KpiManualScoreTempService extends BaseService + * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.service; + +import com.elink.esua.epdc.activity.ActInfoDTO; +import com.elink.esua.epdc.activity.form.ActInfoAppFormDTO; +import com.elink.esua.epdc.activity.form.ActInfoFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoAppResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoDetailAppResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoResultDTO; +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.modules.activity.entity.ActInfoEntity; + +import java.util.List; +import java.util.Map; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +public interface ActInfoService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-11 + */ + PageData page(Map params); + + PageData getActInfoPageFromPC(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-11 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActInfoDTO + * @author generator + * @date 2019-12-11 + */ + ActInfoDTO get(String id); + + /** + * 活动列表-移动app端用 + * @Params: [formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: lipengfei + * @Date: 2019/10/19 16:47 + */ + Result> listItemsByApp(ActInfoAppFormDTO formDto); + /** + * 活动列表(已报名)-移动app端用 + * @Params: [formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: lipengfei + * @Date: 2019/10/19 16:47 + */ + Result> signupListItemsByApp(ActInfoAppFormDTO formDto); + + /** + * 移动端-项目详情 + * + * @Params: [formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result + * @Author: liuchuang + * @Date: 2019/9/10 20:54 + */ + @Deprecated + Result getDetailByApp(ActInfoAppFormDTO formDto); + + /** + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 移动端-活动详情实现 + * @Date 2020/2/5 16:59 + **/ + Result queryActInfoDetail(ActInfoAppFormDTO formDto); + + /** + * 移动端-项目详情 + * + * @Params: [formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result + * @Author: liuchuang + * @Date: 2019/9/10 20:54 + */ + Result getRejectDetailByApp(ActInfoAppFormDTO formDto); + + /** + * 移动端-项目详情 + * @Params: [formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result + * @Author: liuchuang + * @Date: 2019/9/10 20:54 + */ + Result getCancelDetailByApp(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-11 + */ + Result save(ActInfoDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-11 + */ + void update(ActInfoDTO dto); + + /** + * + * 取消活动 + * + * @params [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2020/2/6 21:18 + */ + Result cancel(ActInfoFormDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-11 + */ + void delete(String[] ids); + + /** + * @param actId + * @return void + * @Author yinzuomei + * @Description 活动打卡人数+1 + * @Date 2020/2/8 13:07 + **/ + void addClockNum(String actId); + + /*** + * 报名审核不通过 报名数-1 + * @param actId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author qushutong + * @date 2020/4/3 9:23 + */ + void minusSignUpNum(String actId); +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserClockLogService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserClockLogService.java new file mode 100644 index 000000000..74379cd8b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserClockLogService.java @@ -0,0 +1,116 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.service; + +import com.elink.esua.epdc.activity.ActUserClockLogDTO; +import com.elink.esua.epdc.activity.AppActUserClockLogDTO; +import com.elink.esua.epdc.activity.form.ActPointCheckFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoResultDTO; +import com.elink.esua.epdc.activity.result.ActUserClockLogResultDTO; +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.modules.activity.entity.ActUserClockLogEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户打卡日志表 用户打卡日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-17 + */ +public interface ActUserClockLogService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-17 + */ + PageData page(Map params); + + PageData getActUserClockLogFromPC(Map params); + + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActUserClockLogDTO + * @author generator + * @date 2019-12-17 + */ + ActUserClockLogDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-17 + */ + void save(ActUserClockLogDTO dto); + + Result pointCheck(ActPointCheckFormDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-17 + */ + void update(ActUserClockLogDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-17 + */ + void delete(String[] ids); + + /** + * 活动打卡 + * + * @param appActUserClockLogDTO + * @author wanggongfeng + * @date 2019-12-16 + */ + Result activityClock(AppActUserClockLogDTO appActUserClockLogDTO); + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserLogService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserLogService.java new file mode 100644 index 000000000..4f25afed4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserLogService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.activity.ActUserLogDTO; +import com.elink.esua.epdc.modules.activity.entity.ActUserLogEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户活动日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +public interface ActUserLogService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActUserLogDTO + * @author generator + * @date 2019-12-16 + */ + ActUserLogDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-16 + */ + void save(ActUserLogDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-16 + */ + void update(ActUserLogDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-16 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserPointsLogService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserPointsLogService.java new file mode 100644 index 000000000..573c2f883 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserPointsLogService.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.service; + +import com.elink.esua.epdc.activity.ActUserPointsLogDTO; +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.modules.activity.entity.ActUserPointsLogEntity; + +import java.util.List; +import java.util.Map; + +/** + * + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-21 + */ +public interface ActUserPointsLogService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-21 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-21 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActUserPointsLogDTO + * @author generator + * @date 2019-12-21 + */ + ActUserPointsLogDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-21 + */ + void save(ActUserPointsLogDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-21 + */ + void update(ActUserPointsLogDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-21 + */ + void delete(String[] ids); + + /** + * @param actUserPointsLogDTO + * @return com.elink.esua.epdc.modules.activity.entity.ActUserPointsLogEntity + * @Author yinzuomei + * @Description 返回插入对象 + * @Date 2020/2/6 16:47 + **/ + ActUserPointsLogEntity insertActUserPointsLogDTO(ActUserPointsLogDTO actUserPointsLogDTO); +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java new file mode 100644 index 000000000..85b287273 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java @@ -0,0 +1,169 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.service; + +import com.elink.esua.epdc.activity.ActUserRelationDTO; +import com.elink.esua.epdc.activity.AppActUserCancelsignupDTO; +import com.elink.esua.epdc.activity.AppClockListDTO; +import com.elink.esua.epdc.activity.form.ActUserRelationAuditFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoClockResultDTO; +import com.elink.esua.epdc.activity.result.ActUserClockResultDTO; +import com.elink.esua.epdc.activity.result.ActUserRelationResultDTO; +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.modules.activity.entity.ActUserRelationEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户活动关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +public interface ActUserRelationService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActUserRelationDTO + * @author generator + * @date 2019-12-16 + */ + ActUserRelationDTO get(String id); + + PageData getActUserRelationPageFromPC (Map params); + + PageData getActUserClockPageFromPC (Map params); + + ActInfoClockResultDTO getActDetail(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-16 + */ + void save(ActUserRelationDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-16 + */ + void update(ActUserRelationDTO dto); + + Result audit(ActUserRelationAuditFormDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-16 + */ + void delete(String[] ids); + + /** + * 活动报名 + * + * @param actUserRelationDTO + * @author wanggongfeng + * @date 2019-12-16 + */ + Result activitySignUp(ActUserRelationDTO actUserRelationDTO); + + /** + * 取消活动报名 + * + * @param appActUserCancelsignupDTO + * @author wanggongfeng + * @date 2019-12-16 + */ + Result activityCancelSignUp(AppActUserCancelsignupDTO appActUserCancelsignupDTO); + + /** + * 查询人员活动关系Id + * + * @param userId + * @param actId + * @param statusList + * @return ActUserRelationDTO + * @author wanggongfeng + * @date 2019-12-16 + */ + ActUserRelationDTO getActUserRelationId(String userId, String actId, List statusList); + + /** + * 活动打卡,更新活动人员关系表当前状态 + * + * @param actUserRelationDTO + * @author wanggongfeng + * @date 2019-12-16 + */ + Result updateActivityStatus(ActUserRelationDTO actUserRelationDTO); + + /** + * 通过活动ID查询打卡列表 + * + * @param actId + * @return ActUserRelationDTO + * @author wanggongfeng + * @date 2019-12-16 + */ + Result selectListActUserRelation(String actId); + + /** + * 默认活动报名审核通过 + * + * @param actId + * @author wanggongfeng + * @date 2019-12-16 + */ + Result updateAuditDefaultStatus(String actId); + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActBannerServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActBannerServiceImpl.java new file mode 100644 index 000000000..4a16fe7bd --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActBannerServiceImpl.java @@ -0,0 +1,155 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.activity.ActBannerDTO; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.constant.ActStateConstant; +import com.elink.esua.epdc.modules.activity.dao.ActBannerDao; +import com.elink.esua.epdc.modules.activity.entity.ActBannerEntity; +import com.elink.esua.epdc.modules.activity.redis.ActBannerRedis; +import com.elink.esua.epdc.modules.activity.service.ActBannerService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 爱心互助活动banner 爱心互助活动banner + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Service +public class ActBannerServiceImpl extends BaseServiceImpl implements ActBannerService { + + @Autowired + private ActBannerRedis actBannerRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActBannerDTO.class); + } + @Override + public PageData getActBannerPage(Map params) { + IPage page = getPage(params); + List list = baseDao.getActBannerlist(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.getAppActBannerlist(params); + return entityList; + } + + private QueryWrapper getWrapper(Map params) { + String id = ""; + String status = ""; + if (params.containsKey(FieldConstant.ID_HUMP)) { + id = (String) params.get(FieldConstant.ID_HUMP); + } + if (params.containsKey("status")) { + status = params.get("status").toString(); + } + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id) + .eq(StringUtils.isNotBlank(status), "STATUS", status); + return wrapper; + } + + @Override + public ActBannerDTO get(String id) { + ActBannerEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActBannerDTO.class); + } + @Override + public Result grounding(String id) { + ActBannerEntity entity = baseDao.selectById(id); + ActBannerEntity updateEntity = new ActBannerEntity(); + updateEntity.setId(id); + updateEntity.setStatusTime(new Date()); + // 上架 + if (ActStateConstant.ACT_BANNER_STATUS_UNDERCARRIAGE.equals(entity.getStatus())) { + // 上架前banner表处理 + this.takeOffOtherBanners(); + updateEntity.setStatus(ActStateConstant.ACT_BANNER_STATUS_GROUNDING); + updateById(updateEntity); + // 下架 + } else if (ActStateConstant.ACT_BANNER_STATUS_GROUNDING.equals(entity.getStatus())) { + updateEntity.setStatus(ActStateConstant.ACT_BANNER_STATUS_UNDERCARRIAGE); + updateById(updateEntity); + } + return new Result(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActBannerDTO dto) { + ActBannerEntity entity = ConvertUtils.sourceToTarget(dto, ActBannerEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActBannerDTO dto) { + ActBannerEntity entity = ConvertUtils.sourceToTarget(dto, ActBannerEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public ActBannerDTO getBannerInfo(String actId) { + ActBannerDTO bannerDto = baseDao.getBannerInfo(actId); + return bannerDto; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void takeOffOtherBanners() { + // 下架第十条及以后的banner数据 + baseDao.takeOffOtherBanners(); + } + + @Override + public void takeOffBannerByActId(String actId) { + baseDao.updateBannerByActId(actId); + } + +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiManualScoreTempServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActClockPicServiceImpl.java similarity index 55% rename from esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiManualScoreTempServiceImpl.java rename to esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActClockPicServiceImpl.java index 2fc8daf95..489ff518e 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/service/impl/KpiManualScoreTempServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActClockPicServiceImpl.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.elink.esua.epdc.service.impl; +package com.elink.esua.epdc.modules.activity.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -23,11 +23,11 @@ import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; import com.elink.esua.epdc.commons.tools.constant.FieldConstant; -import com.elink.esua.epdc.dao.KpiManualScoreTempDao; -import com.elink.esua.epdc.dto.KpiManualScoreTempDTO; -import com.elink.esua.epdc.entity.KpiManualScoreTempEntity; -import com.elink.esua.epdc.redis.KpiManualScoreTempRedis; -import com.elink.esua.epdc.service.KpiManualScoreTempService; +import com.elink.esua.epdc.modules.activity.dao.ActClockPicDao; +import com.elink.esua.epdc.activity.ActClockPicDTO; +import com.elink.esua.epdc.modules.activity.entity.ActClockPicEntity; +import com.elink.esua.epdc.modules.activity.redis.ActClockPicRedis; +import com.elink.esua.epdc.modules.activity.service.ActClockPicService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -38,59 +38,59 @@ import java.util.List; import java.util.Map; /** - * 绩效考核手动打分记录 + * 活动打卡图片表 * * @author qu qu@elink-cn.com - * @since v1.0.0 2019-12-06 + * @since v1.0.0 2019-12-18 */ @Service -public class KpiManualScoreTempServiceImpl extends BaseServiceImpl implements KpiManualScoreTempService { +public class ActClockPicServiceImpl extends BaseServiceImpl implements ActClockPicService { @Autowired - private KpiManualScoreTempRedis kpiManualScoreTempRedis; + private ActClockPicRedis actClockPicRedis; @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( + public PageData page(Map params) { + IPage page = baseDao.selectPage( getPage(params, FieldConstant.CREATED_TIME, false), getWrapper(params) ); - return getPageData(page, KpiManualScoreTempDTO.class); + return getPageData(page, ActClockPicDTO.class); } @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); - return ConvertUtils.sourceToTarget(entityList, KpiManualScoreTempDTO.class); + return ConvertUtils.sourceToTarget(entityList, ActClockPicDTO.class); } - private QueryWrapper getWrapper(Map params){ + private QueryWrapper getWrapper(Map params){ String id = (String)params.get(FieldConstant.ID_HUMP); - QueryWrapper wrapper = new QueryWrapper<>(); + QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); return wrapper; } @Override - public KpiManualScoreTempDTO get(String id) { - KpiManualScoreTempEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, KpiManualScoreTempDTO.class); + public ActClockPicDTO get(String id) { + ActClockPicEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActClockPicDTO.class); } @Override @Transactional(rollbackFor = Exception.class) - public void save(KpiManualScoreTempDTO dto) { - KpiManualScoreTempEntity entity = ConvertUtils.sourceToTarget(dto, KpiManualScoreTempEntity.class); + public void save(ActClockPicDTO dto) { + ActClockPicEntity entity = ConvertUtils.sourceToTarget(dto, ActClockPicEntity.class); insert(entity); } @Override @Transactional(rollbackFor = Exception.class) - public void update(KpiManualScoreTempDTO dto) { - KpiManualScoreTempEntity entity = ConvertUtils.sourceToTarget(dto, KpiManualScoreTempEntity.class); + public void update(ActClockPicDTO dto) { + ActClockPicEntity entity = ConvertUtils.sourceToTarget(dto, ActClockPicEntity.class); updateById(entity); } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java new file mode 100644 index 000000000..1c900fc7a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java @@ -0,0 +1,529 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.activity.ActBannerDTO; +import com.elink.esua.epdc.activity.ActInfoDTO; +import com.elink.esua.epdc.activity.ActUserRelationDTO; +import com.elink.esua.epdc.activity.form.ActInfoAppFormDTO; +import com.elink.esua.epdc.activity.form.ActInfoFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoAppResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoDetailAppResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoDetailResultDTO; +import com.elink.esua.epdc.activity.result.ActInfoResultDTO; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.constant.StrConstant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.DateUtils; +import com.elink.esua.epdc.commons.tools.utils.LocalDateUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.constant.*; +import com.elink.esua.epdc.dto.ScheduleJobDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; +import com.elink.esua.epdc.modules.activity.dao.ActInfoDao; +import com.elink.esua.epdc.modules.activity.dao.ActUserClockLogDao; +import com.elink.esua.epdc.modules.activity.dao.ActUserRelationDao; +import com.elink.esua.epdc.modules.activity.entity.ActBannerEntity; +import com.elink.esua.epdc.modules.activity.entity.ActInfoEntity; +import com.elink.esua.epdc.modules.activity.entity.ActUserClockLogEntity; +import com.elink.esua.epdc.modules.activity.entity.ActUserRelationEntity; +import com.elink.esua.epdc.modules.activity.service.ActBannerService; +import com.elink.esua.epdc.modules.activity.service.ActInfoService; +import com.elink.esua.epdc.modules.async.NewsTask; +import com.elink.esua.epdc.modules.feign.JobFeignClient; +import com.elink.esua.epdc.modules.feign.UserInfoFeignClient; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDateTime; +import java.util.*; + +/** + * 活动信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Service +public class ActInfoServiceImpl extends BaseServiceImpl implements ActInfoService { + + @Autowired + private ActBannerService actBannerService; + @Autowired + private JobFeignClient jobFeignClient; + @Autowired + private ActUserRelationDao actUserRelationDao; + @Autowired + private ActUserClockLogDao actUserClockLogDao; + @Autowired + private UserInfoFeignClient userInfoFeignClient; + @Autowired + private NewsTask newsTask; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActInfoDTO.class); + } + + @Override + public PageData getActInfoPageFromPC(Map params) { + IPage page = getPage(params); + List list = baseDao.getActInfoPageFromPC(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActInfoDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ActInfoDTO get(String id) { + ActInfoEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActInfoDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result save(ActInfoDTO dto) { + ActInfoEntity entity = ConvertUtils.sourceToTarget(dto, ActInfoEntity.class); + if (insert(entity)) { + if (NumConstant.ONE_STR.equals(dto.getIsBanner())) { + // 保存到banner + this.saveActInfoToBanner(entity.getId(), dto); + } + // 创建定时任务(活动开始后将未审核的报名人员自动置为审核通过或不通过) + return this.saveActToScheduleJob(entity.getId(), dto.getActStartTime()); + } + + return new Result().error(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActInfoDTO dto) { + ActInfoEntity entity = ConvertUtils.sourceToTarget(dto, ActInfoEntity.class); + updateById(entity); + } + + /** + * 活动列表-移动app端用 + * + * @Params: [formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: lipengfei + * @Date: 2019/10/19 16:47 + */ + @Override + public Result> signupListItemsByApp(ActInfoAppFormDTO formDto) { + int pageIndex = (formDto.getPageIndex() - NumConstant.ONE) * formDto.getPageSize(); + formDto.setPageIndex(pageIndex); + List data = baseDao.signupListItemsByApp(formDto); + return new Result>().ok(data); + } + + /** + * 活动列表-移动app端用 + * + * @Params: [formDto] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: lipengfei + * @Date: 2019/10/19 16:47 + */ + @Override + public Result> listItemsByApp(ActInfoAppFormDTO formDto) { + int pageIndex = (formDto.getPageIndex() - NumConstant.ONE) * formDto.getPageSize(); + formDto.setPageIndex(pageIndex); + List data = baseDao.listItemsByApp(formDto); + return new Result>().ok(data); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result cancel(ActInfoFormDTO dto) { + ActInfoEntity entity = baseDao.selectById(dto.getId()); + if (ActStateConstant.ACT_INFO_STATUS_UNDERCARRIAGE.equals(entity.getActStatus())) { + return new Result().error("活动已取消"); + } else if (new Date().compareTo(entity.getActStartTime()) > 0) { + return new Result().error("已过活动开始时间不可取消"); + } + ActInfoEntity updateEntity = new ActInfoEntity(); + updateEntity.setId(dto.getId()); + updateEntity.setTitle(entity.getTitle()); + updateEntity.setCancelReason(dto.getCancelReason()); + updateEntity.setActStatus(ActStateConstant.ACT_INFO_STATUS_UNDERCARRIAGE); + updateById(updateEntity); + + // 下架banner + actBannerService.takeOffBannerByActId(dto.getId()); + // 通知用户 + this.sendUserCancelActNotice(updateEntity); + return new Result(); + } + + /** + * @param actInfoEntity + * @return void + * @Author yinzuomei + * @Description 取消活动时通知所有已经报名的 用户 + * @Date 2020/2/7 20:43 + **/ + private void sendUserCancelActNotice(ActInfoEntity actInfoEntity) { + List userList = actUserRelationDao.selectAllSignUpUsers(actInfoEntity.getId()); + if (null == userList || userList.size() == 0) { + return; + } + List epdcInformationFormDTOList = new ArrayList<>(); + for (ActUserRelationDTO user : userList) { + EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO(); + informationFormDTO.setTitle(HeartNoticeConstant.NOTICE_CANCEL_ACT); + informationFormDTO.setUserId(user.getUserId()); + informationFormDTO.setType(HeartNoticeConstant.NOTICE_TYPE_INTERACTIVE_NOTICE); + informationFormDTO.setBusinessType(HeartNoticeConstant.NOTICE__BUSINESS_TYPE_ACT_CANCEL); + informationFormDTO.setBusinessId(actInfoEntity.getId()); + informationFormDTO.setContent(actInfoEntity.getCancelReason()); + informationFormDTO.setRelBusinessContent(actInfoEntity.getTitle()); + epdcInformationFormDTOList.add(informationFormDTO); + } + newsTask.insertBatchUserInformation(epdcInformationFormDTOList); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public void addClockNum(String actId) { + baseDao.addClockNum(actId); + } + + @Override + public void minusSignUpNum(String actId) { + baseDao.minusSignUpNum(actId); + } + + @Override + public Result getDetailByApp(ActInfoAppFormDTO formDto) { + formDto.setTimestamp(DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN)); + ActInfoDetailAppResultDTO resultDTO = baseDao.getDetailByApp(formDto); + return new Result().ok(resultDTO); + } + + /** + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description + * @Date 2020/2/5 14:42 + **/ + @Override + public Result queryActInfoDetail(ActInfoAppFormDTO formDto) { + ActInfoDetailResultDTO detailResultDTO = baseDao.selectActInfoDetailResultDTO(formDto.getId()); + // 获取用户报名状态 + String currentUserStatus = getCurrentUserStatus(formDto.getId(), formDto.getUserId()); + + detailResultDTO.setCurrentUserStatus(currentUserStatus); + Result userVolunteerFlagResult = userInfoFeignClient.queryUserVolunteerFlag(formDto.getUserId()); + detailResultDTO.setUserVolunteerFlag(userVolunteerFlagResult.getData()); + ActInfoDetailAppResultDTO resultDTO = ConvertUtils.sourceToTarget(detailResultDTO, ActInfoDetailAppResultDTO.class); + //获取活动详情 活动信息表 浏览数+1 banner表 浏览数+1 + this.addActBrowseNumber(resultDTO.getId()); + return new Result().ok(resultDTO); + } + + + /** + * @param actId 活动id + * @param userId 用户id + * @return java.lang.String + * @Author yinzuomei + * @Description 返回当前活动下,用户状态:(0-我要报名,1-取消报名,2-已报满,3-未开始,4-我要打卡,5-更新打卡,6-已结束,7-已取消) + * @Date 2020/2/5 21:54 + **/ + private String getCurrentUserStatus(String actId, String userId) { + ActInfoEntity actInfoEntity = baseDao.selectById(actId); + + // 活动已取消 + if (ActStateConstant.ACT_INFO_STATUS_UNDERCARRIAGE.equals(actInfoEntity.getActStatus())) { + return ActUserStatusConstant.CANCELED; + } + + Date currentTime = new Date(); + // 活动已经结束:当前时间已经过了活动结束时间并且也已经过了打卡截止时间 + if (currentTime.after(actInfoEntity.getActEndTime()) && currentTime.after(actInfoEntity.getSigninEndTime())) { + return ActUserStatusConstant.FINISHED; + } + + // 查询用户活动关系 + QueryWrapper actUserRelationWrapper = new QueryWrapper<>(); + actUserRelationWrapper.eq("ACT_ID", actId) + .eq("USER_ID", userId) + .orderByDesc("CREATED_TIME").last("limit 1"); + ActUserRelationEntity actUserRelationEntity = actUserRelationDao.selectOne(actUserRelationWrapper); + if (null == actUserRelationEntity) { + return getCurrentUserStatusNotSignUp(actInfoEntity, currentTime); + } else { + return getCurrentUserStatusHasSignUp(actInfoEntity, actUserRelationEntity, currentTime); + } + } + + /** + * 用户是否有活动打卡记录 + * + * @param actUserRelationId 用户活动关系id + * @return boolean + * @author work@yujt.net.cn + * @date 2020/4/8 17:31 + */ + private boolean isClocked(String actUserRelationId) { + QueryWrapper actUserClockLogWrapper = new QueryWrapper<>(); + actUserClockLogWrapper.eq("ACT_USER_ID", actUserRelationId); + Integer count = actUserClockLogDao.selectCount(actUserClockLogWrapper); + return count > NumConstant.ZERO; + } + + /** + * 用户已报名活动时,判断用户活动状态 + * + * @param actInfoEntity 当前活动 + * @param actUserRelationEntity 用户活动关系 + * @param currentTime 当前时间 + * @return java.lang.String + * @author work@yujt.net.cn + * @date 2020/4/8 17:11 + */ + private String getCurrentUserStatusHasSignUp(ActInfoEntity actInfoEntity, ActUserRelationEntity actUserRelationEntity, Date currentTime) { + + String actUserStatus = actUserRelationEntity.getStatus(); + + // 已确认过积分,直接返回 + if (ActUserRelationStatusConstant.CONFIRM_ADD_POINTS.equals(actUserStatus) + || ActUserRelationStatusConstant.REFUSE_ADD_POINTS.equals(actUserStatus)) { + return ActUserStatusConstant.POINTS_CONFIRM; + } + + boolean isClocked = isClocked(actUserRelationEntity.getId()); + + if (currentTime.after(actInfoEntity.getActEndTime()) && currentTime.before(actInfoEntity.getSigninEndTime())) { + /*活动结束;打卡未截止*/ + // 审核通过且未打卡的显示 我要打卡 + if (ActUserRelationStatusConstant.APPROVED.equals(actUserStatus) && !isClocked) { + return ActUserStatusConstant.CLOCK; + } + // (已经打过卡的)显示更新打卡 + if (ActUserRelationStatusConstant.CLOCK.equals(actUserStatus) && isClocked) { + return ActUserStatusConstant.UPDATE_CLOCK; + } + // 未审核的、审核未通过、已经取消报名的)- 已结束 + if (ActUserRelationStatusConstant.SIGN_UP.equals(actUserStatus) + || ActUserRelationStatusConstant.NOT_APPROVED.equals(actUserStatus) + || ActUserRelationStatusConstant.CANCEL_SIGN_UP.equals(actUserStatus)) { + return ActUserStatusConstant.FINISHED; + } + } else if (currentTime.after(actInfoEntity.getSigninStartTime()) && currentTime.before(actInfoEntity.getSigninEndTime())) { + /* 活动打卡时间段内 */ + // 审核通过且未打卡的显示 我要打卡 + if (ActUserRelationStatusConstant.APPROVED.equals(actUserStatus) && !isClocked) { + return ActUserStatusConstant.CLOCK; + } + // (已经打过卡的)显示更新打卡 + if (ActUserRelationStatusConstant.CLOCK.equals(actUserStatus) && isClocked) { + return ActUserStatusConstant.UPDATE_CLOCK; + } + // 未审核的、审核未通过、已经取消报名的)- 进行中 + if (ActUserRelationStatusConstant.SIGN_UP.equals(actUserStatus) + || ActUserRelationStatusConstant.CANCEL_SIGN_UP.equals(actUserStatus) + || ActUserRelationStatusConstant.NOT_APPROVED.equals(actUserStatus)) { + return ActUserStatusConstant.ON_GOING; + } + } else if (currentTime.before(actInfoEntity.getSignupEndTime())) { + /*报名截至时间前 */ + //(未审核、审核通过的)底部显示按钮 取消报名 + if (ActUserRelationStatusConstant.SIGN_UP.equals(actUserStatus) || ActUserRelationStatusConstant.APPROVED.equals(actUserStatus)) { + return ActUserStatusConstant.CANCEL_SIGN_UP; + } + // (报名审核未通过或者已经取消报名的)可再次报名-我要报名 + if (ActUserRelationStatusConstant.NOT_APPROVED.equals(actUserStatus) || ActUserRelationStatusConstant.CANCEL_SIGN_UP.equals(actUserStatus)) { + return ActUserStatusConstant.SIGN_UP; + } + } else if (currentTime.after(actInfoEntity.getSignupEndTime()) && currentTime.before(actInfoEntity.getActStartTime())) { + /*报名截止但 活动未开始 */ + // 已经取消报名的-未开始 + if (ActUserRelationStatusConstant.CANCEL_SIGN_UP.equals(actUserStatus)) { + return ActUserStatusConstant.NOT_STARTED; + } + // 已报名审核不通过 -未开始 + if (ActUserRelationStatusConstant.NOT_APPROVED.equals(actUserStatus)) { + return ActUserStatusConstant.NOT_STARTED; + } + // 已报名且审核通过、未审核 -取消报名 + if (ActUserRelationStatusConstant.APPROVED.equals(actUserStatus) || ActUserRelationStatusConstant.SIGN_UP.equals(actUserStatus)) { + return ActUserStatusConstant.CANCEL_SIGN_UP; + } + } + return ActUserStatusConstant.FINISHED; + } + + /** + * 用户未报名活动时,判断用户活动状态 + * + * @param actInfoEntity 当前活动 + * @param currentTime 当前时间 + * @return java.lang.String + * @author work@yujt.net.cn + * @date 2020/4/8 16:55 + */ + private String getCurrentUserStatusNotSignUp(ActInfoEntity actInfoEntity, Date currentTime) { + if (currentTime.before(actInfoEntity.getSignupEndTime())) { + /*报名结束前*/ + if (NumConstant.ZERO == actInfoEntity.getActQuotaCategory() || actInfoEntity.getActQuota() > actInfoEntity.getSignupNum()) { + // 我要报名(不限名额或者未报满的) + return ActUserStatusConstant.SIGN_UP; + } else { + // 已报满(限制名额且已经报满的) + return ActUserStatusConstant.FULL_SIGN_UP; + } + } else if (currentTime.after(actInfoEntity.getSignupEndTime()) && currentTime.before(actInfoEntity.getActStartTime())) { + /*报名结束,活动未开始*/ + return ActUserStatusConstant.NOT_STARTED; + } else if (currentTime.after(actInfoEntity.getSigninStartTime()) && currentTime.before(actInfoEntity.getSigninEndTime())) { + // 活动打卡时间段内: 显示:进行中 + return ActUserStatusConstant.ON_GOING; + } else { + return ActUserStatusConstant.FINISHED; + } + } + + @Override + public Result getRejectDetailByApp(ActInfoAppFormDTO formDto) { + ActInfoDetailAppResultDTO resultDTO = baseDao.getRejectDetailByApp(formDto); + return new Result().ok(resultDTO); + } + + @Override + public Result getCancelDetailByApp(String id) { + ActInfoAppFormDTO formDto = new ActInfoAppFormDTO(); + formDto.setId(id); + ActInfoDetailAppResultDTO resultDTO = baseDao.getCancelDetailByApp(formDto); + return new Result().ok(resultDTO); + } + + /** + * @Description: 增加活动浏览数 + * @Param: [dto] + * @return: void + * @Author: zy + * @Date: 2020-02-06 + */ + private void addActBrowseNumber(String actId) { + //活动信息表 浏览数+1 + ActInfoEntity infoEntity = baseDao.selectById(actId); + infoEntity.setActBrowseNum(infoEntity.getActBrowseNum() + 1); + updateById(infoEntity); + //banner表 浏览数+1 + ActBannerDTO bannerDto = actBannerService.getBannerInfo(actId); + if (bannerDto != null) { + bannerDto.setBrowseNum(bannerDto.getBrowseNum() + 1); + ActBannerEntity bannerEntity = ConvertUtils.sourceToTarget(bannerDto, ActBannerEntity.class); + actBannerService.updateById(bannerEntity); + } + } + + /** + * 活动保存到banner + * + * @return void + * @params [entity] + * @author liuchuang + * @since 2020/2/6 20:44 + */ + private void saveActInfoToBanner(String actId, ActInfoDTO dto) { + // banner表处理:banner图限制最多10个,超出10个再发布就把最早顶下去 + actBannerService.takeOffOtherBanners(); + + ActBannerDTO bannerDto = new ActBannerDTO(); + bannerDto.setActId(actId); + bannerDto.setTitle(dto.getTitle()); + bannerDto.setBannerImg(dto.getBannerUrl()); + bannerDto.setBannerType(NumConstant.ONE_STR); + bannerDto.setBannerPosition(NumConstant.ONE_STR); + bannerDto.setUrl(""); + bannerDto.setStatus(dto.getIsBanner()); + bannerDto.setStatusTime(new Date()); + bannerDto.setDeptId(dto.getDeptId()); + ValidatorUtils.validateEntity(bannerDto, AddGroup.class, DefaultGroup.class); + actBannerService.save(bannerDto); + } + + /** + * 创建定时任务(活动开始后将未审核的报名人员自动置为审核通过或不通过) + * + * @return Result + * @params [actId, actStartTime] + * @author liuchuang + * @since 2020/2/6 21:10 + */ + private Result saveActToScheduleJob(String actId, Date actStartTime) { + + LocalDateTime jobTime = LocalDateUtils.dateToLocalDateTime(actStartTime); + + StringBuffer cronStr = new StringBuffer(StringUtils.EMPTY); + cronStr.append(jobTime.getSecond()).append(StringUtils.SPACE) + .append(jobTime.getMinute()).append(StringUtils.SPACE) + .append(jobTime.getHour()).append(StringUtils.SPACE) + .append(jobTime.getDayOfMonth()).append(StringUtils.SPACE) + .append(jobTime.getMonthValue()).append(StringUtils.SPACE) + .append(StrConstant.QUESTION_MARK).append(StringUtils.SPACE) + .append(jobTime.getYear()).append(StrConstant.HYPHEN).append(jobTime.getYear()); + + ScheduleJobDTO jobDTO = new ScheduleJobDTO(); + jobDTO.setBeanName(JobModuleConstant.TASK_NAME_AUDIT_ACT); + jobDTO.setParams(actId); + jobDTO.setStatus(NumConstant.ONE); + jobDTO.setCronExpression(cronStr.toString()); + return jobFeignClient.save(jobDTO); + } +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserClockLogServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserClockLogServiceImpl.java new file mode 100644 index 000000000..41bbe86ff --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserClockLogServiceImpl.java @@ -0,0 +1,348 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.activity.*; +import com.elink.esua.epdc.activity.form.ActPointCheckFormDTO; +import com.elink.esua.epdc.activity.result.ActUserClockLogResultDTO; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; +import com.elink.esua.epdc.commons.tools.enums.pointsenum.PointsBehaviorCodeEnum; +import com.elink.esua.epdc.commons.tools.enums.pointsenum.PointsOperationEnum; +import com.elink.esua.epdc.commons.tools.enums.pointsenum.PointsOperationModeEnum; +import com.elink.esua.epdc.commons.tools.enums.pointsenum.PointsRuleCodeEnum; +import com.elink.esua.epdc.commons.tools.exception.RenException; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.LocalDateUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.constant.ActStateConstant; +import com.elink.esua.epdc.constant.ActUserRelationStatusConstant; +import com.elink.esua.epdc.constant.HeartNoticeConstant; +import com.elink.esua.epdc.dto.UserDTO; +import com.elink.esua.epdc.dto.VolunteerInfoDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcUserPointsFormDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcVolunteerKindnessTimeFormDTO; +import com.elink.esua.epdc.dto.logs.PointsLogsDTO; +import com.elink.esua.epdc.modules.activity.dao.ActUserClockLogDao; +import com.elink.esua.epdc.modules.activity.entity.ActUserClockLogEntity; +import com.elink.esua.epdc.modules.activity.entity.ActUserPointsLogEntity; +import com.elink.esua.epdc.modules.activity.service.*; +import com.elink.esua.epdc.modules.async.NewsTask; +import com.elink.esua.epdc.modules.feign.PointsFeignClient; +import com.elink.esua.epdc.modules.feign.UserInfoFeignClient; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; + +/** + * 用户打卡日志表 用户打卡日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-17 + */ +@Service +public class ActUserClockLogServiceImpl extends BaseServiceImpl implements ActUserClockLogService { + + @Autowired + private ActUserRelationService actUserRelationService; + + @Autowired + private ActClockPicService actClockPicService; + + @Autowired + private ActUserLogService actUserLogService; + + @Autowired + private ActUserPointsLogService actUserPointsLogService; + + @Autowired + private ActInfoService actInfoService; + + @Autowired + private UserInfoFeignClient userInfoFeignClient; + + @Autowired + private PointsFeignClient pointsFeignClient; + + @Autowired + private NewsTask newsTask; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActUserClockLogDTO.class); + } + + @Override + public PageData getActUserClockLogFromPC(Map params) { + IPage page = getPage(params); + System.out.println(params); + List list = baseDao.getActUserClockLogFromPC(params); + //图片处理 + for (ActUserClockLogResultDTO dto : list) { + if (dto.getClockPics() != null) { + String[] strArr = dto.getClockPics().split(","); + dto.setClockPic(strArr); + } + } + return new PageData<>(list, page.getTotal()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActUserClockLogDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ActUserClockLogDTO get(String id) { + ActUserClockLogEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActUserClockLogDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActUserClockLogDTO dto) { + ActUserClockLogEntity entity = ConvertUtils.sourceToTarget(dto, ActUserClockLogEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result pointCheck(ActPointCheckFormDTO dto) { + ActUserRelationDTO actUserRelationDTO = actUserRelationService.get(dto.getId()); + ActInfoDTO actInfoDTO = actInfoService.get(dto.getActId()); + ActUserPointsLogDTO actUserPointsLogDTO = new ActUserPointsLogDTO(); + actUserPointsLogDTO.setActUserId(dto.getId()); + actUserPointsLogDTO.setOperationReason(dto.getFailureReason()); + //确认加积分 + if (ActStateConstant.ACT_USER_RELATION_STATUS_POINTPASS.equals(dto.getStatus())) { + //操作类型 0-系统确认积分,2-管理员确认积分,4-取消报名扣减积分,6-管理员扣减积分,8-拒绝积分 + actUserPointsLogDTO.setOperationType(NumConstant.TWO_STR); + actUserPointsLogDTO.setOperationPointsType(ActStateConstant.OPERATION_POINTS_TYPE_ADD);//0-减积分,1-加积分 + actUserPointsLogDTO.setPoints(actInfoDTO.getReward()); + // 志愿者增加爱心时长 + Result result = this.calculationKindnessTime(actInfoDTO, dto.getId()); + if (!result.success()) { + return result; + } + //增加用户活动积分记录 + ActUserPointsLogEntity actUserPointsLogEntity = actUserPointsLogService.insertActUserPointsLogDTO(actUserPointsLogDTO); + //更新用户积分余额、插入积分日志表 + Result updateUserPointsResult = this.updateUserPoints(dto, actInfoDTO, actUserRelationDTO, actUserPointsLogEntity); + if (!updateUserPointsResult.success()) { + return updateUserPointsResult; + } + //拒绝加积分 + } else if (ActStateConstant.ACT_USER_RELATION_STATUS_POINTREJECT.equals(dto.getStatus())) { + actUserPointsLogDTO.setOperationType(ActStateConstant.POINT_OPERATION_TYPE_ADMINREJECT); + actUserPointsLogDTO.setOperationPointsType(ActStateConstant.OPERATION_POINTS_TYPE_DEDUCT); + actUserPointsLogDTO.setPoints(actInfoDTO.getReward()); + //增加用户活动积分记录 + ActUserPointsLogEntity actUserPointsLogEntity = actUserPointsLogService.insertActUserPointsLogDTO(actUserPointsLogDTO); + } + //更新用户活动关系表状态 + this.updateActUserRelation(dto); + //插入用户活动关系日志表记录 + this.insertActUserLogDTO(dto); + //发送消息通知 + this.insertUserInformation(dto, actInfoDTO, actUserRelationDTO); + return new Result(); + } + + private void updateActUserRelation(ActPointCheckFormDTO dto) { + //用户关系表状态更新 + ActUserRelationDTO actUserRelationEntity = new ActUserRelationDTO(); + actUserRelationEntity.setId(dto.getId()); + actUserRelationEntity.setStatus(dto.getStatus()); + actUserRelationEntity.setFailureReason(dto.getFailureReason()); + actUserRelationService.update(actUserRelationEntity); + } + + private void insertActUserLogDTO(ActPointCheckFormDTO dto) { + //存储活动日志表 epdc_act_user_log + ActUserLogDTO actUserLogDTO = new ActUserLogDTO(); + actUserLogDTO.setActUserRelationId(dto.getId()); + actUserLogDTO.setOperationType(dto.getStatus()); + actUserLogDTO.setOperationTime(new Date()); + actUserLogDTO.setFailureReason(dto.getFailureReason()); + actUserLogService.save(actUserLogDTO); + } + + private Result updateUserPoints(ActPointCheckFormDTO actPointCheckFormDTO, ActInfoDTO actInfoDTO, ActUserRelationDTO actUserRelationDTO, ActUserPointsLogEntity actUserPointsLogEntity) { + PointsLogsDTO pointsLogsDTO = new PointsLogsDTO(); + //根据用户id查询志愿者信息 + Result volunteerInfoDTOResult = userInfoFeignClient.getVolunteerInfoDTOByUserId(actUserRelationDTO.getUserId()); + if (!volunteerInfoDTOResult.success() || null == volunteerInfoDTOResult.getData()) { + throw new RenException("查询志愿者信息异常"); + } + //直接调用fegin,返回剩余积分值 + EpdcUserPointsFormDTO userPointsFormDTO = new EpdcUserPointsFormDTO(); + userPointsFormDTO.setUserId(actUserRelationDTO.getUserId()); + userPointsFormDTO.setPoints(actInfoDTO.getReward()); + userPointsFormDTO.setOperationType(PointsOperationEnum.OPERATION_TYPE_ADD.getOperationType()); + Result result = userInfoFeignClient.handleUserPoints(userPointsFormDTO); + if (!result.success()) { + throw new RenException("更新用户积分异常"); + } + pointsLogsDTO.setVolunteerId(volunteerInfoDTOResult.getData().getId()); + pointsLogsDTO.setUserId(actUserRelationDTO.getUserId()); + pointsLogsDTO.setOperationType(PointsOperationEnum.OPERATION_TYPE_ADD.getOperationType());//(0-减积分,1-加积分) + pointsLogsDTO.setPoints(actInfoDTO.getReward()); + pointsLogsDTO.setOperationTime(new Date()); + pointsLogsDTO.setOperationMode(PointsOperationModeEnum.OPERATION_MODE_ADMIN.getOperationMode()); + pointsLogsDTO.setRuleCode(PointsRuleCodeEnum.CONFIRM_JOIN_ACT.getRuleCode()); + pointsLogsDTO.setLavePoints(result.getData().getPoints());//剩余积分值 + pointsLogsDTO.setBehaviorCode(PointsBehaviorCodeEnum.JOIN_ACT.getBehaviorCode()); + pointsLogsDTO.setStatus(YesOrNoEnum.YES.value()); + pointsLogsDTO.setReferenceId(actUserPointsLogEntity.getId()); + pointsLogsDTO.setOperationDesc(actPointCheckFormDTO.getFailureReason()); + return pointsFeignClient.addPointsLog(pointsLogsDTO); + } + + /** + * @param dto + * @param actInfoDTO + * @param actUserRelationDTO + * @return void + * @Author yinzuomei + * @Description 管理员确认积分、拒绝积分后给用户发送通知 + * @Date 2020/2/8 12:06 + **/ + private void insertUserInformation(ActPointCheckFormDTO dto, ActInfoDTO actInfoDTO, ActUserRelationDTO actUserRelationDTO) { + EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO(); + //确认积分或者拒绝积分 + if (ActStateConstant.ACT_USER_RELATION_STATUS_POINTPASS.equals(dto.getStatus())) { + informationFormDTO.setTitle(HeartNoticeConstant.NOTICE_CONFIRM_ADD_ACT_POINTS); + informationFormDTO.setBusinessType(HeartNoticeConstant.NOTICE__BUSINESS_TYPE_POINTS_PLUS); + } else if (ActStateConstant.ACT_USER_RELATION_STATUS_POINTREJECT.equals(dto.getStatus())) { + informationFormDTO.setTitle(HeartNoticeConstant.NOTICE_REFUSE_ADD_ACT_POINTS); + informationFormDTO.setBusinessType(HeartNoticeConstant.NOTICE__BUSINESS_TYPE_POINTS_REJECT); + } else { + return; + } + informationFormDTO.setUserId(actUserRelationDTO.getUserId()); + informationFormDTO.setType(HeartNoticeConstant.NOTICE_TYPE_INTERACTIVE_NOTICE); + + informationFormDTO.setBusinessId(actUserRelationDTO.getActId()); + informationFormDTO.setContent(dto.getFailureReason()); + informationFormDTO.setRelBusinessContent(actInfoDTO.getTitle()); + newsTask.insertUserInformation(informationFormDTO); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActUserClockLogDTO dto) { + ActUserClockLogEntity entity = ConvertUtils.sourceToTarget(dto, ActUserClockLogEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 活动打卡 + * + * @param appActUserClockLogDTO + * @return + */ + @Override + public Result activityClock(AppActUserClockLogDTO appActUserClockLogDTO) { + //查询人员活动关系Id(可打卡的) + List statusList = new ArrayList<>(); + statusList.add(ActUserRelationStatusConstant.APPROVED); + statusList.add(ActUserRelationStatusConstant.CLOCK); + ActUserRelationDTO actUserRelationDTO = actUserRelationService.getActUserRelationId(appActUserClockLogDTO.getUserId(), appActUserClockLogDTO.getActId(), statusList); + ActUserClockLogDTO actUserClockLogDTO = ConvertUtils.sourceToTarget(appActUserClockLogDTO, ActUserClockLogDTO.class); + if (actUserRelationDTO.getId() == null) { + return new Result().error("打卡失败"); + } + actUserClockLogDTO.setActUserId(actUserRelationDTO.getId()); + actUserClockLogDTO.setClockTime(new Date()); + //存储打卡日志 + ActUserClockLogEntity entity = ConvertUtils.sourceToTarget(actUserClockLogDTO, ActUserClockLogEntity.class); + insert(entity); + String clockId = entity.getId(); + //存储活动日志表 epdc_act_user_log + ActUserLogDTO actUserLogDTO = new ActUserLogDTO(); + actUserLogDTO.setActUserRelationId(actUserRelationDTO.getId()); + actUserLogDTO.setOperationType(ActUserRelationStatusConstant.CLOCK);//打卡 + actUserLogDTO.setOperationTime(new Date()); + actUserLogService.save(actUserLogDTO); + //更新人员活动关系表当前状态 + actUserRelationDTO.setStatus(ActUserRelationStatusConstant.CLOCK); + actUserRelationService.updateActivityStatus(actUserRelationDTO); + //存储打卡图片 + List imgList = appActUserClockLogDTO.getImages(); + for (int i = 0; i < imgList.size(); i++) { + String imgUrl = imgList.get(i); + ActClockPicDTO actClockPicDTO = new ActClockPicDTO(); + actClockPicDTO.setClockId(clockId); + actClockPicDTO.setClockPic(imgUrl); + actClockPicService.save(actClockPicDTO); + } + actInfoService.addClockNum(appActUserClockLogDTO.getActId()); + return new Result().ok("打卡成功"); + } + + /** + * 确认积分时志愿者增加爱心时长 + * + * @return Result + * @params [actInfoDTO, actUserId] + * @author liuchuang + * @since 2020/2/7 17:06 + */ + private Result calculationKindnessTime(ActInfoDTO actInfo, String actUserId) { + ActUserRelationDTO actUserRelationDto = actUserRelationService.get(actUserId); + if (null != actUserRelationDto) { + EpdcVolunteerKindnessTimeFormDTO formDto = new EpdcVolunteerKindnessTimeFormDTO(); + formDto.setKindnessTime(LocalDateUtils.durationHours(actInfo.getActStartTime(), actInfo.getActEndTime(), NumConstant.TWO)); + formDto.setUserId(actUserRelationDto.getUserId()); + return userInfoFeignClient.addKindnessTime(formDto); + } + return new Result(); + } + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserLogServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserLogServiceImpl.java new file mode 100644 index 000000000..e06e4f44d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserLogServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.modules.activity.dao.ActUserLogDao; +import com.elink.esua.epdc.activity.ActUserLogDTO; +import com.elink.esua.epdc.modules.activity.entity.ActUserLogEntity; +import com.elink.esua.epdc.modules.activity.redis.ActUserLogRedis; +import com.elink.esua.epdc.modules.activity.service.ActUserLogService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 用户活动日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Service +public class ActUserLogServiceImpl extends BaseServiceImpl implements ActUserLogService { + + @Autowired + private ActUserLogRedis actUserLogRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActUserLogDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActUserLogDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ActUserLogDTO get(String id) { + ActUserLogEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActUserLogDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActUserLogDTO dto) { + ActUserLogEntity entity = ConvertUtils.sourceToTarget(dto, ActUserLogEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActUserLogDTO dto) { + ActUserLogEntity entity = ConvertUtils.sourceToTarget(dto, ActUserLogEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserPointsLogServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserPointsLogServiceImpl.java new file mode 100644 index 000000000..4ef603086 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserPointsLogServiceImpl.java @@ -0,0 +1,118 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.activity.ActUserPointsLogDTO; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.modules.activity.dao.ActUserPointsLogDao; +import com.elink.esua.epdc.modules.activity.entity.ActUserPointsLogEntity; +import com.elink.esua.epdc.modules.activity.redis.ActUserPointsLogRedis; +import com.elink.esua.epdc.modules.activity.service.ActUserPointsLogService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-21 + */ +@Service +public class ActUserPointsLogServiceImpl extends BaseServiceImpl implements ActUserPointsLogService { + + @Autowired + private ActUserPointsLogRedis actUserPointsLogRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActUserPointsLogDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActUserPointsLogDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ActUserPointsLogDTO get(String id) { + ActUserPointsLogEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActUserPointsLogDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActUserPointsLogDTO dto) { + ActUserPointsLogEntity entity = ConvertUtils.sourceToTarget(dto, ActUserPointsLogEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActUserPointsLogDTO dto) { + ActUserPointsLogEntity entity = ConvertUtils.sourceToTarget(dto, ActUserPointsLogEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param actUserPointsLogDTO + * @return com.elink.esua.epdc.modules.activity.entity.ActUserPointsLogEntity + * @Author yinzuomei + * @Description 返回插入对象 + * @Date 2020/2/6 16:47 + **/ + @Override + public ActUserPointsLogEntity insertActUserPointsLogDTO(ActUserPointsLogDTO actUserPointsLogDTO) { + ActUserPointsLogEntity entity = ConvertUtils.sourceToTarget(actUserPointsLogDTO, ActUserPointsLogEntity.class); + insert(entity); + return entity; + } + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java new file mode 100644 index 000000000..24b24b0dc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java @@ -0,0 +1,482 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.activity.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.activity.*; +import com.elink.esua.epdc.activity.form.ActUserRelationAuditFormDTO; +import com.elink.esua.epdc.activity.result.ActInfoClockResultDTO; +import com.elink.esua.epdc.activity.result.ActUserClockResultDTO; +import com.elink.esua.epdc.activity.result.ActUserRelationResultDTO; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; +import com.elink.esua.epdc.commons.tools.enums.pointsenum.PointsBehaviorCodeEnum; +import com.elink.esua.epdc.commons.tools.enums.pointsenum.PointsOperationEnum; +import com.elink.esua.epdc.commons.tools.enums.pointsenum.PointsOperationModeEnum; +import com.elink.esua.epdc.commons.tools.enums.pointsenum.PointsRuleCodeEnum; +import com.elink.esua.epdc.commons.tools.exception.RenException; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.constant.ActStateConstant; +import com.elink.esua.epdc.constant.ActUserPointsOperationTypeConstant; +import com.elink.esua.epdc.constant.ActUserRelationStatusConstant; +import com.elink.esua.epdc.constant.HeartNoticeConstant; +import com.elink.esua.epdc.dto.UserDTO; +import com.elink.esua.epdc.dto.VolunteerInfoDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcUserPointsFormDTO; +import com.elink.esua.epdc.dto.logs.PointsLogsDTO; +import com.elink.esua.epdc.modules.activity.dao.ActInfoDao; +import com.elink.esua.epdc.modules.activity.dao.ActUserLogDao; +import com.elink.esua.epdc.modules.activity.dao.ActUserRelationDao; +import com.elink.esua.epdc.modules.activity.entity.ActUserLogEntity; +import com.elink.esua.epdc.modules.activity.entity.ActUserPointsLogEntity; +import com.elink.esua.epdc.modules.activity.entity.ActUserRelationEntity; +import com.elink.esua.epdc.modules.activity.service.ActInfoService; +import com.elink.esua.epdc.modules.activity.service.ActUserPointsLogService; +import com.elink.esua.epdc.modules.activity.service.ActUserRelationService; +import com.elink.esua.epdc.modules.async.NewsTask; +import com.elink.esua.epdc.modules.feign.PointsFeignClient; +import com.elink.esua.epdc.modules.feign.UserInfoFeignClient; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; + +/** + * 用户活动关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-16 + */ +@Service +public class ActUserRelationServiceImpl extends BaseServiceImpl implements ActUserRelationService { + + @Autowired + private ActUserLogDao actUserLogDao; + + @Autowired + private ActInfoService actInfoService; + + @Autowired + private ActInfoDao actInfoDao; + + @Autowired + private ActUserPointsLogService actUserPointsLogService; + @Autowired + private UserInfoFeignClient userInfoFeignClient; + + @Autowired + private PointsFeignClient pointsFeignClient; + + @Autowired + private NewsTask newsTask; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActUserRelationDTO.class); + } + + @Override + public PageData getActUserRelationPageFromPC(Map params) { + IPage page = getPage(params); + List list = baseDao.getActUserRelationPageFromPC(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public PageData getActUserClockPageFromPC(Map params) { + IPage page = getPage(params); + List list = baseDao.getActUserClockPageFromPC(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public ActInfoClockResultDTO getActDetail(String id) { + ActInfoClockResultDTO resultDTO = baseDao.getActDetail(id); + resultDTO.setOldStatus(resultDTO.getStatus()); + System.out.println(resultDTO); + return resultDTO; + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActUserRelationDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ActUserRelationDTO get(String id) { + ActUserRelationEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActUserRelationDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActUserRelationDTO dto) { + ActUserRelationEntity entity = ConvertUtils.sourceToTarget(dto, ActUserRelationEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActUserRelationDTO dto) { + ActUserRelationEntity entity = ConvertUtils.sourceToTarget(dto, ActUserRelationEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result audit(ActUserRelationAuditFormDTO dto) { + ActUserRelationEntity entity = baseDao.selectById(dto.getId()); + if (ActStateConstant.ACT_USER_RELATION_STATUS_APPLY.equals(entity.getStatus())) { + ActUserRelationEntity updateEntity = new ActUserRelationEntity(); + updateEntity.setId(dto.getId()); + updateEntity.setUserId(entity.getUserId()); + updateEntity.setActId(entity.getActId()); + updateEntity.setStatus(dto.getStatus()); + updateEntity.setFailureReason(dto.getFailureReason()); + updateEntity.setAuditTime(new Date()); + updateById(updateEntity); + // 未通过时 活动表报名数减一 + if (ActStateConstant.ACT_USER_RELATION_STATUS_AUDITREJECT.equals(dto.getStatus())) { + actInfoService.minusSignUpNum(entity.getActId()); + } + // + //存储活动日志表 epdc_act_user_log + ActUserLogEntity actUserLog = new ActUserLogEntity(); + actUserLog.setActUserRelationId(dto.getId()); + actUserLog.setOperationType(dto.getStatus()); + actUserLog.setFailureReason(dto.getFailureReason()); + actUserLog.setOperationTime(new Date()); + int insertCount = actUserLogDao.insert(actUserLog); + if (insertCount > NumConstant.ZERO) { + this.insertUserInformation(updateEntity, actUserLog.getId()); + } + return new Result(); + } + return new Result().error("不可操作"); + } + + /** + * 发送审核消息 + *

+ *

  • 活动报名审核通过:通知信息busines_id字段,填入活动的id
  • + *
  • 活动报名审核不通过:通知信息busines_id字段,填入活动用户日志的id
  • + *

    + * + * @param actUserRelationEntity 用户活动关系 + * @param actUserLogId 用户活动日志id + * @return void + * @author work@yujt.net.cn + * @date 2020/4/7 10:00 + */ + private void insertUserInformation(ActUserRelationEntity actUserRelationEntity, String actUserLogId) { + EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO(); + // 当前状态(0-报名,1-审核通过,2-打卡,3-取消报名,4-审核不通过) + if (ActUserRelationStatusConstant.APPROVED.equals(actUserRelationEntity.getStatus())) { + informationFormDTO.setTitle(HeartNoticeConstant.NOTICE_SIGN_UP_PASSED); + informationFormDTO.setBusinessType(HeartNoticeConstant.NOTICE__BUSINESS_TYPE_ACT_SUCCESS); + informationFormDTO.setBusinessId(actUserRelationEntity.getActId()); + } else if (ActUserRelationStatusConstant.NOT_APPROVED.equals(actUserRelationEntity.getStatus())) { + informationFormDTO.setTitle(HeartNoticeConstant.NOTICE_SIGN_UP_NOT_PASSED); + informationFormDTO.setBusinessType(HeartNoticeConstant.NOTICE__BUSINESS_TYPE_ACT_FAILURE); + informationFormDTO.setBusinessId(actUserLogId); + } else { + return; + } + informationFormDTO.setUserId(actUserRelationEntity.getUserId()); + informationFormDTO.setType(HeartNoticeConstant.NOTICE_TYPE_AUDIT_NOTICE); + + informationFormDTO.setContent(actUserRelationEntity.getFailureReason()); + ActInfoDTO actInfoDTO = actInfoService.get(actUserRelationEntity.getActId()); + if (null != actInfoDTO) { + informationFormDTO.setRelBusinessContent(actInfoDTO.getTitle()); + } + newsTask.insertUserInformation(informationFormDTO); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public Result activitySignUp(ActUserRelationDTO actUserRelationDTO) { + ActInfoDTO actInfoDTO = actInfoDao.queryActSignupNum(actUserRelationDTO.getActId()); + //判断报名是否已满 + if (actInfoDTO.getActQuotaCategory() != 0 && actInfoDTO.getActQuota().equals(actInfoDTO.getSignupNum())) { + return new Result().error("活动已报满"); + } + //查询是否已报名 + ActUserRelationEntity actUserRelationEntity = baseDao.selectOneByUserIdAndActId(actUserRelationDTO.getUserId(), actUserRelationDTO.getActId()); + if (null == actUserRelationEntity || (ActUserRelationStatusConstant.CANCEL_SIGN_UP.equals(actUserRelationEntity.getStatus()) + || ActUserRelationStatusConstant.NOT_APPROVED.equals(actUserRelationEntity.getStatus()))) { + //未报名该活动,进行报名 + //存储活动人员关系表 + ActUserRelationEntity entity = ConvertUtils.sourceToTarget(actUserRelationDTO, ActUserRelationEntity.class); + if (null != actUserRelationEntity) { + entity.setId(actUserRelationEntity.getId()); + baseDao.updateById(entity); + } else { + insert(entity); + } + //存储活动日志表 + ActUserLogEntity actUserLog = new ActUserLogEntity(); + actUserLog.setActUserRelationId(entity.getId()); + actUserLog.setOperationType(ActUserRelationStatusConstant.SIGN_UP); + actUserLog.setOperationTime(new Date()); + actUserLogDao.insert(actUserLog); + //更新epdc_act_info的已报名名额 + actInfoDTO.setSignupNum(actInfoDTO.getSignupNum() + 1); + actInfoService.update(actInfoDTO); + } else { + return new Result().error("您已报名"); + } + return new Result().ok("报名成功"); + } + + @Override + public Result activityCancelSignUp(AppActUserCancelsignupDTO appActUserCancelsignupDTO) { + //查询是否已报名 + List statusList = new ArrayList<>(); + statusList.add(ActUserRelationStatusConstant.SIGN_UP); + statusList.add(ActUserRelationStatusConstant.APPROVED); + List data = baseDao.selectOneActUserRelationInfo(appActUserCancelsignupDTO.getUserId(), appActUserCancelsignupDTO.getActId(), statusList); + if (data != null && data.size() > 0) { + ActUserRelationDTO actUserRelationDTO = data.get(0); + actUserRelationDTO.setStatus(ActUserRelationStatusConstant.CANCEL_SIGN_UP);//取消报名 + actUserRelationDTO.setFailureReason(appActUserCancelsignupDTO.getFailureReason());//取消报名原因 + //已报名该活动,进行取消报名 + //1、更新活动人员关系表 + ActUserRelationEntity entity = ConvertUtils.sourceToTarget(actUserRelationDTO, ActUserRelationEntity.class); + updateById(entity); + //2、存储活动日志表 + Date currentTime = new Date(); + ActUserLogEntity actUserLog = new ActUserLogEntity(); + actUserLog.setActUserRelationId(actUserRelationDTO.getId()); + actUserLog.setOperationType(ActUserRelationStatusConstant.CANCEL_SIGN_UP);//取消报名 + actUserLog.setOperationTime(currentTime); + actUserLog.setFailureReason(appActUserCancelsignupDTO.getFailureReason()); + actUserLogDao.insert(actUserLog); + //3、更新epdc_act_info的已报名名额 + //ActInfoDTO actInfoDTO = actInfoDao.queryActSignupNum(actUserRelationDTO.getActId()); + ActInfoDTO actInfoDTO = actInfoService.get(actUserRelationDTO.getActId()); + actInfoDTO.setSignupNum(actInfoDTO.getSignupNum() - 1); + actInfoService.update(actInfoDTO); + //4、判断是否扣除用户积分 + if (currentTime.after(actInfoDTO.getSignupEndTime()) && currentTime.before(actInfoDTO.getActStartTime())) { + this.cancelActSubtractPoint(actUserRelationDTO, actInfoDTO); + } + + } else { + return new Result().error("未报名"); + } + return new Result().ok("取消报名成功"); + } + + /** + * @param actUserRelationDTO + * @param actInfoDTO + * @return void + * @Author yinzuomei + * @Description 活动报名结束到活动开始时间段内取消报名要扣除用户积分,扣除积分值为当前活动的惩罚积分 + * @Date 2020/2/6 12:00 + **/ + private void cancelActSubtractPoint(ActUserRelationDTO actUserRelationDTO, ActInfoDTO actInfoDTO) { + if (null == actInfoDTO.getPunishmentPoints() || actInfoDTO.getPunishmentPoints() == 0) { + return; + } + Result volunteerInfoDTOResult = userInfoFeignClient.getVolunteerInfoDTOByUserId(actUserRelationDTO.getUserId()); + if (!volunteerInfoDTOResult.success()) { + throw new RenException("查询志愿者信息异常"); + } + //4、更新epdc_user表积分 + //直接调用fegin,返回剩余积分值 + EpdcUserPointsFormDTO userPointsFormDTO = new EpdcUserPointsFormDTO(); + userPointsFormDTO.setUserId(actUserRelationDTO.getUserId()); + userPointsFormDTO.setPoints(actInfoDTO.getPunishmentPoints()); + userPointsFormDTO.setOperationType(PointsOperationEnum.OPERATION_TYPE_SUBSTRACT.getOperationType()); + Result result = userInfoFeignClient.handleUserPoints(userPointsFormDTO); + if (!result.success()) { + throw new RenException("更新用户积分异常"); + } + //5、插入epdc_act_user_points_log记录 + ActUserPointsLogDTO actUserPointsLogDTO = new ActUserPointsLogDTO(); + actUserPointsLogDTO.setActUserId(actUserRelationDTO.getId()); + actUserPointsLogDTO.setOperationType(ActUserPointsOperationTypeConstant.CANCEL_ACT_SUBTRACT); + actUserPointsLogDTO.setOperationPointsType(PointsOperationEnum.OPERATION_TYPE_SUBSTRACT.getOperationType()); + actUserPointsLogDTO.setPoints(actInfoDTO.getPunishmentPoints()); + ActUserPointsLogEntity actUserPointsLog = actUserPointsLogService.insertActUserPointsLogDTO(actUserPointsLogDTO); + //6、插入points记录 + PointsLogsDTO pointsLogsDTO = new PointsLogsDTO(); + pointsLogsDTO.setVolunteerId(volunteerInfoDTOResult.getData().getId()); + pointsLogsDTO.setUserId(actUserRelationDTO.getUserId()); + pointsLogsDTO.setOperationType(PointsOperationEnum.OPERATION_TYPE_SUBSTRACT.getOperationType()); + pointsLogsDTO.setPoints(actInfoDTO.getPunishmentPoints()); + pointsLogsDTO.setOperationTime(new Date()); + pointsLogsDTO.setOperationMode(PointsOperationModeEnum.OPERATION_MODE_USER.getOperationMode()); + pointsLogsDTO.setRuleCode(PointsRuleCodeEnum.CANCEL_ACT.getRuleCode());//积分规则编码 + pointsLogsDTO.setLavePoints(result.getData().getPoints());//剩余积分值 + pointsLogsDTO.setBehaviorCode(PointsBehaviorCodeEnum.BREAK_PROMISE.getBehaviorCode());//积分行为编码 + pointsLogsDTO.setStatus(YesOrNoEnum.YES.value()); + pointsLogsDTO.setReferenceId(actUserPointsLog.getId()); + pointsFeignClient.addPointsLog(pointsLogsDTO); + //发送消息通知 + this.sendUserInformation(actUserRelationDTO, actInfoDTO, HeartNoticeConstant.NOTICE__BUSINESS_TYPE_POINTS_SIGN_OUT); + } + + /** + * @param actUserRelationDTO + * @param actInfoDTO + * @return void + * @Author yinzuomei + * @Description 取消活动扣减积分发送用户消息 + * @Date 2020/2/8 19:37 + **/ + private void sendUserInformation(ActUserRelationDTO actUserRelationDTO, ActInfoDTO actInfoDTO, String businessType) { + EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO(); + informationFormDTO.setTitle(HeartNoticeConstant.CANCEL_ACT_TITLE); + informationFormDTO.setUserId(actUserRelationDTO.getUserId()); + informationFormDTO.setType(HeartNoticeConstant.NOTICE_TYPE_INTERACTIVE_NOTICE); + informationFormDTO.setBusinessType(businessType); + informationFormDTO.setBusinessId(actUserRelationDTO.getActId()); +// 您未参加“活动名称”,根据规则未参加将扣除积分 + informationFormDTO.setContent("您未参加“" + actInfoDTO.getTitle() + "”,根据规则未参加将扣除积分" + actInfoDTO.getPunishmentPoints()); + informationFormDTO.setRelBusinessContent(actInfoDTO.getTitle()); + newsTask.insertUserInformation(informationFormDTO); + } + + @Override + + public ActUserRelationDTO getActUserRelationId(String userId, String actId, List statusList) { + List data = baseDao.selectOneActUserRelationInfo(userId, actId, statusList); + ActUserRelationDTO actUserRelationDTO = new ActUserRelationDTO(); + if (data != null && data.size() > 0) { + actUserRelationDTO = data.get(0); + + } + return actUserRelationDTO; + } + + @Override + public Result updateActivityStatus(ActUserRelationDTO actUserRelationDTO) { + //更新活动人员关系表当前状态为打卡 + ActUserRelationEntity entity = ConvertUtils.sourceToTarget(actUserRelationDTO, ActUserRelationEntity.class); + updateById(entity); + return new Result().ok("更新成功"); + } + + @Override + public Result selectListActUserRelation(String actId) { + List list = baseDao.selectListActUserRelation(actId); + if (null == list || list.size() == 0) { + return new Result(); + } + List resultList = new ArrayList(); + String[] idArr = new String[list.size()]; + for (int k = 0; k < list.size(); k++) { + Map map = new HashMap(); + map.put("nickname", list.get(k).getNickname()); + map.put("faceImg", list.get(k).getFaceImg()); + map.put("partyFlag", list.get(k).getPartyFlag()); + map.put("clockDesc", list.get(k).getClockDesc()); + map.put("createdTime", list.get(k).getClockTime()); + map.put("clockId", list.get(k).getId() == null ? "" : list.get(k).getId()); + //查询打卡对应图片 + idArr[k] = list.get(k).getId(); + resultList.add(map); + } + List listLogImg = baseDao.selectListClockImg(idArr); + for (Object objMap : resultList) { + Map mm = (Map) objMap; + List imgList = new ArrayList(); + for (int i = listLogImg.size() - 1; i >= 0; i--) { + if (mm.get("clockId").equals(listLogImg.get(i).getClockId())) { + imgList.add(listLogImg.get(i).getClockPic()); + listLogImg.remove(i); + } + } + mm.put("images", imgList); + mm.remove("clockId"); + } + AppClockListDTO appClockListDTO = new AppClockListDTO(); + appClockListDTO.setClockNum(resultList.size()); + appClockListDTO.setClocks(resultList); + return new Result().ok(appClockListDTO); + } + + /** + * 自动审核 + * + * @param actId + * @return + */ + @Override + public Result updateAuditDefaultStatus(String actId) { + // 根据actID查询活动开始未审核报名人默认状态 + ActInfoDTO actInfoDTO = actInfoService.get(actId); + String actUserDefaultState = actInfoDTO.getActUserDefaultState(); // 活动开始未审核报名人默认状态 + + // 查询已报名未审核的志愿者 + List data = baseDao.selectListActUserInfo(actId); + if (data != null && data.size() > 0) { + for (int i = 0; i < data.size(); i++) { + // 更新人员活动关系表 + ActUserRelationDTO actUserRelationDTO = data.get(i); + actUserRelationDTO.setStatus(actUserDefaultState);// 默认状态 + actUserRelationDTO.setAuditTime(new Date()); //自动审核时间 + ActUserRelationEntity entity = ConvertUtils.sourceToTarget(actUserRelationDTO, ActUserRelationEntity.class); + updateById(entity); + // 存储活动日志表 + ActUserLogEntity actUserLog = new ActUserLogEntity(); + actUserLog.setActUserRelationId(entity.getId()); + actUserLog.setOperationType(actUserDefaultState);// 默认状态 + actUserLog.setOperationTime(new Date()); + actUserLogDao.insert(actUserLog); + } + } else { + return new Result().ok("该活动暂时没有未审核的志愿者"); + } + + return new Result().ok("该活动对已报名的志愿者自动审核成功"); + } + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/async/NewsTask.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/async/NewsTask.java new file mode 100644 index 000000000..25afb8351 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/async/NewsTask.java @@ -0,0 +1,47 @@ +package com.elink.esua.epdc.modules.async; + +import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; +import com.elink.esua.epdc.modules.feign.NewsFeignClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 新闻通知消息模块 线程任务 + * + * @author yujintao + * @email yujintao@elink-cn.com + * @date 2019/9/10 10:02 + */ +@Component +public class NewsTask { + + @Autowired + private NewsFeignClient newsFeignClient; + + /** + * 给用户发送消息 + * + * @param informationDto + * @return void + * @author yujintao + * @date 2019/9/10 10:33 + */ + @Async + public void insertUserInformation(EpdcInformationFormDTO informationDto) { + newsFeignClient.saveInformation(informationDto); + } + + /** + * @param epdcInformationFormDTOList + * @return void + * @Author yinzuomei + * @Description 批量给用户发消息 + * @Date 2020/2/7 21:01 + **/ + public void insertBatchUserInformation(List epdcInformationFormDTOList) { + newsFeignClient.saveInformationList(epdcInformationFormDTOList); + } +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/JobFeignClient.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/JobFeignClient.java new file mode 100644 index 000000000..06a84d45c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/JobFeignClient.java @@ -0,0 +1,37 @@ +package com.elink.esua.epdc.modules.feign; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.ScheduleJobDTO; +import com.elink.esua.epdc.dto.UserDTO; +import com.elink.esua.epdc.modules.feign.fallback.JobFeignClientFallback; +import com.elink.esua.epdc.modules.feign.fallback.UserInfoFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; + +/** + * + * 调用用户模块 + * + * @Author:wanggongfeng + * @Date:2019/12/16 17:36 + */ +@FeignClient(name = ServiceConstant.EPDC_JOB_SERVER, fallback = JobFeignClientFallback.class) +public interface JobFeignClient { + + + + /** + * 定时任务 + * + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @params [userDTO] + * @author liuchuang + * @since 2019/10/25 17:07 + */ + @PostMapping("job/schedule") + Result save(ScheduleJobDTO dto); + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/NewsFeignClient.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/NewsFeignClient.java new file mode 100644 index 000000000..662dc2192 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/NewsFeignClient.java @@ -0,0 +1,43 @@ +package com.elink.esua.epdc.modules.feign; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; +import com.elink.esua.epdc.modules.feign.fallback.NewsFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; + +/** + * 消息模块 + * + * @author work@yujt.net.cn + * @date 2019/9/18 15:37 + */ +@FeignClient(name = ServiceConstant.EPDC_NEWS_SERVER, fallback = NewsFeignClientFallback.class) +public interface NewsFeignClient { + + /** + * 给用户发消息 + * + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2019/9/18 15:40 + */ + @PostMapping(value = "news/epdc-app/information/save", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result saveInformation(@RequestBody EpdcInformationFormDTO formDto); + + /** + * @param epdcInformationFormDTOList + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 批量给用户发消息 + * @Date 2020/2/7 21:00 + **/ + @PostMapping(value = "news/epdc-app/information/saveList", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result saveInformationList(List epdcInformationFormDTOList); +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/PointsFeignClient.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/PointsFeignClient.java new file mode 100644 index 000000000..077ec117c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/PointsFeignClient.java @@ -0,0 +1,25 @@ +package com.elink.esua.epdc.modules.feign; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.logs.PointsLogsDTO; +import com.elink.esua.epdc.modules.feign.fallback.PointsFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +/** + * + * 调用用户模块 + * + * @Author:wanggongfeng + * @Date:2019/12/16 17:36 + */ +@FeignClient(name = ServiceConstant.EPDC_POINTS_SERVER, fallback = PointsFeignClientFallback.class) +public interface PointsFeignClient { + + @PostMapping("/points/pointslogs/addPointsLog") + Result addPointsLog(@RequestBody PointsLogsDTO dto); + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/UserInfoFeignClient.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/UserInfoFeignClient.java new file mode 100644 index 000000000..d68636c33 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/UserInfoFeignClient.java @@ -0,0 +1,82 @@ +package com.elink.esua.epdc.modules.feign; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.UserDTO; +import com.elink.esua.epdc.dto.VolunteerInfoDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcUserPointsFormDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcVolunteerKindnessTimeFormDTO; +import com.elink.esua.epdc.modules.feign.fallback.UserInfoFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; + +/** + * + * 调用用户模块 + * + * @Author:wanggongfeng + * @Date:2019/12/16 17:36 + */ +@FeignClient(name = ServiceConstant.EPDC_USER_SERVER, fallback = UserInfoFeignClientFallback.class) +public interface UserInfoFeignClient { + + + @GetMapping("app-user/epdc-app/user/getById/{userId}") + Result getUserInfoById(@PathVariable("userId") String userId); + + /** + * 更新用户信息 + * + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @params [userDTO] + * @author liuchuang + * @since 2019/10/25 17:07 + */ + @PostMapping("app-user/epdc-app/user/updateUserInfo") + Result updateUserInfo(UserDTO userDTO); + + /** + * @param userId 用户主键 + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据用户主键获取用户志愿者标识(0-未认证1-已认证) + * @Date 2020/2/5 16:45 + **/ + @GetMapping("app-user/volunteerinfo/queryUserVolunteerFlag/{userId}") + Result queryUserVolunteerFlag(@PathVariable("userId") String userId); + + /** + * @param userId 用户id + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei 根据用户id查询志愿者信息 + * @Description 根据用户id + * @Date 2020/2/6 12:20 + **/ + @GetMapping("app-user/volunteerinfo/getVolunteerInfoDTOByUserId/{userId}") + Result getVolunteerInfoDTOByUserId(@PathVariable("userId") String userId); + + /** + * @param formDTO + * @return com.elink.esua.epdc.dto.UserDTO + * @Author yinzuomei + * @Description 根据操作类型更新用户积分 + * @Date 2019/12/13 15:12 + **/ + @PostMapping(value = "app-user/user/handleUserPoints", consumes = MediaType.APPLICATION_JSON_VALUE) + Result handleUserPoints(EpdcUserPointsFormDTO formDTO); + + /** + * + * 志愿者增加参与活动爱心时长 + * + * @params [formDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2020/2/7 18:16 + */ + @PostMapping(value = "app-user/volunteerinfo/addKindnessTime", consumes = MediaType.APPLICATION_JSON_VALUE) + Result addKindnessTime(EpdcVolunteerKindnessTimeFormDTO formDto); +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/JobFeignClientFallback.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/JobFeignClientFallback.java new file mode 100644 index 000000000..2f7bb69e3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/JobFeignClientFallback.java @@ -0,0 +1,22 @@ +package com.elink.esua.epdc.modules.feign.fallback; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.ScheduleJobDTO; +import com.elink.esua.epdc.dto.UserDTO; +import com.elink.esua.epdc.modules.feign.JobFeignClient; +import com.elink.esua.epdc.modules.feign.UserInfoFeignClient; +import org.springframework.stereotype.Component; + +/** + * @author 86185 + */ +@Component +public class JobFeignClientFallback implements JobFeignClient { + + @Override + public Result save(ScheduleJobDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_JOB_SERVER, "save", dto); + } +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/NewsFeignClientFallback.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/NewsFeignClientFallback.java new file mode 100644 index 000000000..9d91e8372 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/NewsFeignClientFallback.java @@ -0,0 +1,28 @@ +package com.elink.esua.epdc.modules.feign.fallback; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; +import com.elink.esua.epdc.modules.feign.NewsFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @author work@yujt.net.cn + * @date 2019/9/18 15:38 + */ +@Component +public class NewsFeignClientFallback implements NewsFeignClient { + + @Override + public Result saveInformation(EpdcInformationFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_NEWS_SERVER, "saveInformation", formDto); + } + + @Override + public Result saveInformationList(List epdcInformationFormDTOList) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_NEWS_SERVER, "saveInformationList", epdcInformationFormDTOList); + } +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/PointsFeignClientFallback.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/PointsFeignClientFallback.java new file mode 100644 index 000000000..01597dd98 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/PointsFeignClientFallback.java @@ -0,0 +1,23 @@ +package com.elink.esua.epdc.modules.feign.fallback; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.logs.PointsLogsDTO; +import com.elink.esua.epdc.modules.feign.PointsFeignClient; +import org.springframework.stereotype.Component; + + +/** + * @Author:wanggongfeng + * @Date:2019/12/16 15:11 + */ +@Component +public class PointsFeignClientFallback implements PointsFeignClient { + + + @Override + public Result addPointsLog(PointsLogsDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_POINTS_SERVER, "addPointsLog", dto); + } +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/UserInfoFeignClientFallback.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/UserInfoFeignClientFallback.java new file mode 100644 index 000000000..95f0d4b4b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/UserInfoFeignClientFallback.java @@ -0,0 +1,48 @@ +package com.elink.esua.epdc.modules.feign.fallback; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.UserDTO; +import com.elink.esua.epdc.dto.VolunteerInfoDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcUserPointsFormDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcVolunteerKindnessTimeFormDTO; +import com.elink.esua.epdc.modules.feign.UserInfoFeignClient; +import org.springframework.stereotype.Component; + +/** + * @author 86185 + */ +@Component +public class UserInfoFeignClientFallback implements UserInfoFeignClient { + @Override + public Result getUserInfoById(String userId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "getUserInfoById", userId); + } + + @Override + public Result updateUserInfo(UserDTO userDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "updateUserInfo", userDTO); + } + + @Override + public Result queryUserVolunteerFlag(String userId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "queryUserVolunteerFlag", userId); + } + + @Override + public Result getVolunteerInfoDTOByUserId(String userId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "getVolunteerInfoDTOByUserId", userId); + } + + @Override + public Result handleUserPoints(EpdcUserPointsFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "handleUserPoints", formDTO); + } + + @Override + public Result addKindnessTime(EpdcVolunteerKindnessTimeFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "addKindnessTime", formDto); + } + +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiManualScoreTempController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/controller/ActPhraseController.java similarity index 62% rename from esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiManualScoreTempController.java rename to esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/controller/ActPhraseController.java index 2686c98ac..a07ca3a68 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/controller/KpiManualScoreTempController.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/controller/ActPhraseController.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.elink.esua.epdc.controller; +package com.elink.esua.epdc.modules.phrases.controller; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; @@ -23,11 +23,11 @@ import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.commons.tools.validator.AssertUtils; import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; -import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; -import com.elink.esua.epdc.dto.KpiManualScoreTempDTO; -import com.elink.esua.epdc.excel.KpiManualScoreTempExcel; -import com.elink.esua.epdc.service.KpiManualScoreTempService; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.modules.phrases.excel.ActPhraseExcel; +import com.elink.esua.epdc.modules.phrases.service.ActPhraseService; +import com.elink.esua.epdc.phrases.ActPhraseDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -37,43 +37,44 @@ import java.util.Map; /** - * 绩效考核手动打分记录 + * 常用语表 * * @author qu qu@elink-cn.com - * @since v1.0.0 2019-12-06 + * @since v1.0.0 2019-12-11 */ @RestController -@RequestMapping("kpimanualscoretemp") -public class KpiManualScoreTempController { +@RequestMapping("actphrase") +public class ActPhraseController { @Autowired - private KpiManualScoreTempService kpiManualScoreTempService; + private ActPhraseService actPhraseService; @GetMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = kpiManualScoreTempService.page(params); - return new Result>().ok(page); + public Result> page(@RequestParam Map params){ + //PageData page = actPhraseService.page(params); + PageData page = actPhraseService.getPhrasePage(params); + return new Result>().ok(page); } @GetMapping("{id}") - public Result get(@PathVariable("id") String id){ - KpiManualScoreTempDTO data = kpiManualScoreTempService.get(id); - return new Result().ok(data); + public Result get(@PathVariable("id") String id){ + ActPhraseDTO data = actPhraseService.get(id); + return new Result().ok(data); } @PostMapping - public Result save(@RequestBody KpiManualScoreTempDTO dto){ + public Result save(@RequestBody ActPhraseDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - kpiManualScoreTempService.save(dto); + actPhraseService.save(dto); return new Result(); } @PutMapping - public Result update(@RequestBody KpiManualScoreTempDTO dto){ + public Result update(@RequestBody ActPhraseDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - kpiManualScoreTempService.update(dto); + actPhraseService.update(dto); return new Result(); } @@ -81,14 +82,14 @@ public class KpiManualScoreTempController { public Result delete(@RequestBody String[] ids){ //效验数据 AssertUtils.isArrayEmpty(ids, "id"); - kpiManualScoreTempService.delete(ids); + actPhraseService.delete(ids); return new Result(); } @GetMapping("export") public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { - List list = kpiManualScoreTempService.list(params); - ExcelUtils.exportExcelToTarget(response, null, list, KpiManualScoreTempExcel.class); + List list = actPhraseService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ActPhraseExcel.class); } } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/controller/AppActPhraseController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/controller/AppActPhraseController.java new file mode 100644 index 000000000..4e5630f8b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/controller/AppActPhraseController.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * 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. + *

    + * 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. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.phrases.controller; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.modules.phrases.entity.ActPhraseRedisEntity; +import com.elink.esua.epdc.modules.phrases.service.ActPhraseService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +/** + * 常用语表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11sagenumAddOneById + */ +@RestController +@RequestMapping("appactphrase") +public class AppActPhraseController { + + @Autowired + private ActPhraseService actPhraseService; + + /** + * 使用次数加一 + * @param id 常用语ID + * @return + */ + @GetMapping(value="sagenumAddOneById/{id}") + public Result sagenumAddOneById(@PathVariable("id")String id) { + actPhraseService.updateUsagenumAddOne(id); + return new Result().ok("使用次数加一成功"); + } + + /** + * redis获取常用语 + * @return + */ + @GetMapping(value="getPhraseList") + public Result getPhraseList() { + List object = actPhraseService.getPhraseList(); + return new Result().ok(object); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiManualScoreTempDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/dao/ActPhraseDao.java similarity index 56% rename from esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiManualScoreTempDao.java rename to esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/dao/ActPhraseDao.java index eeaca7ab1..3076a6c2d 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/esua/epdc/dao/KpiManualScoreTempDao.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/dao/ActPhraseDao.java @@ -15,30 +15,39 @@ * along with this program. If not, see . */ -package com.elink.esua.epdc.dao; +package com.elink.esua.epdc.modules.phrases.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; -import com.elink.esua.epdc.entity.KpiManualScoreTempEntity; -import com.elink.esua.epdc.excel.KpiManualScoreTemplateExcel; +import com.elink.esua.epdc.modules.phrases.entity.ActPhraseEntity; +import com.elink.esua.epdc.modules.phrases.entity.ActPhraseRedisEntity; +import com.elink.esua.epdc.phrases.ActPhraseDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; -import java.util.Date; import java.util.List; +import java.util.Map; /** - * 绩效考核手动打分记录 + * 常用语表 * * @author qu qu@elink-cn.com - * @since v1.0.0 2019-12-06 + * @since v1.0.0 2019-12-11 */ @Mapper -public interface KpiManualScoreTempDao extends BaseDao { +public interface ActPhraseDao extends BaseDao { - int deleteManualScoreTemp(@Param("userId") String toString, - @Param("ruleId")String id, - @Param("scoreStartTime")String scoreStartTime); + /** + * 按序号顺序查询常用语 + * @return + */ + List selectListPhraseInOrder(); - List selectListKpiManualScoreTemp(@Param("userId") String userId, - @Param("recordList")List recordList); -} + void updateUsagenumAddOne(@Param("id")String id); + + /** + * 条件查询 + * @param params + * @return + */ + List getPhrasePage(Map params); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/entity/ActPhraseEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/entity/ActPhraseEntity.java new file mode 100644 index 000000000..453fa00b7 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/entity/ActPhraseEntity.java @@ -0,0 +1,63 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * 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. + *

    + * 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. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.phrases.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 常用语表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_act_phrase") +public class ActPhraseEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 常用语 + */ + private String phrase; + + /** + * 显示顺序 + */ + private Integer sort; + + /** + * 是否显示(0-否,1-是) + */ + private String showFlag; + + /** + * 使用次数 0 + */ + private Integer usageNum; + + /** + * code + */ + private String code; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/entity/ActPhraseRedisEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/entity/ActPhraseRedisEntity.java new file mode 100644 index 000000000..883ed5b53 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/entity/ActPhraseRedisEntity.java @@ -0,0 +1,46 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * 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. + *

    + * 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. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.phrases.entity; + +import lombok.Data; + +/** + * 常用语表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class ActPhraseRedisEntity { + + /** + * ID + */ + private String id; + + /** + * 常用语 + */ + private String phrase; + + /** + * code + */ + private String code; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/excel/ActPhraseExcel.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/excel/ActPhraseExcel.java new file mode 100644 index 000000000..c6b06076d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/excel/ActPhraseExcel.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * 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. + *

    + * 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. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.phrases.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 常用语表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Data +public class ActPhraseExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "常用语") + private String phrase; + + @Excel(name = "显示顺序") + private Integer sort; + + @Excel(name = "是否显示(0-否,1-是)") + private String showFlag; + + @Excel(name = "使用次数 0") + private Integer usageNum; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/redis/ActPhraseRedis.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/redis/ActPhraseRedis.java new file mode 100644 index 000000000..da46cccab --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/redis/ActPhraseRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * 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. + *

    + * 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. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.phrases.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 常用语表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Component +public class ActPhraseRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/service/ActPhraseService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/service/ActPhraseService.java new file mode 100644 index 000000000..d2724726a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/service/ActPhraseService.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * 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. + *

    + * 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. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.phrases.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.modules.phrases.entity.ActPhraseEntity; +import com.elink.esua.epdc.modules.phrases.entity.ActPhraseRedisEntity; +import com.elink.esua.epdc.phrases.ActPhraseDTO; + +import java.util.List; +import java.util.Map; + +/** + * 常用语表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +public interface ActPhraseService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-11 + */ + PageData page(Map params); + + /** + * 分页条件查询 + * @param params + * @return + */ + PageData getPhrasePage(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-11 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActPhraseDTO + * @author generator + * @date 2019-12-11 + */ + ActPhraseDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-11 + */ + void save(ActPhraseDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-11 + */ + void update(ActPhraseDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-11 + */ + void delete(String[] ids); + + /** + * 查询常用语,更新Radis + */ + void insertPhraseListToRedis(); + + /** + * 更新使用次数(+1) + * + * @param id + * @return void + * @author wanggongfeng + * @date 2019-12-12 + */ + void updateUsagenumAddOne(String id); + + /** + * 从redis直接读取常用语 + * @author wanggongfeng + * @date 2019-12-12 + * @return 常用语列表 + */ + List getPhraseList(); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/service/impl/ActPhraseServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/service/impl/ActPhraseServiceImpl.java new file mode 100644 index 000000000..25628a3c3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/phrases/service/impl/ActPhraseServiceImpl.java @@ -0,0 +1,214 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * 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. + *

    + * 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. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.phrases.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.exception.RenException; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.redis.RedisKeys; +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.modules.phrases.dao.ActPhraseDao; +import com.elink.esua.epdc.modules.phrases.entity.ActPhraseEntity; +import com.elink.esua.epdc.modules.phrases.entity.ActPhraseRedisEntity; +import com.elink.esua.epdc.modules.phrases.redis.ActPhraseRedis; +import com.elink.esua.epdc.modules.phrases.service.ActPhraseService; +import com.elink.esua.epdc.phrases.ActPhraseDTO; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 常用语表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-11 + */ +@Service +public class ActPhraseServiceImpl extends BaseServiceImpl implements ActPhraseService { + + @Autowired + private ActPhraseRedis actPhraseRedis; + @Autowired + private RedisUtils redisUtils; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActPhraseDTO.class); + } + + /** + * 条件查询 + * + * @param params + * @return + */ + @Override + public PageData getPhrasePage(Map params) { + String phrase = ((String) params.get("phrase")).trim(); + String code = ((String) params.get("code")).trim(); + params.put("phrase", phrase); + params.put("code", code); + IPage page = getPage(params); + List list = baseDao.getPhrasePage(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActPhraseDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ActPhraseDTO get(String id) { + ActPhraseEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActPhraseDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActPhraseDTO dto) { + String categoryCode = dto.getCode(); + if (StringUtils.isNotBlank(categoryCode)) { + if (getCodeCount(dto) > 0) { + throw new RenException("您输入的编码已存在"); + } + } + ActPhraseEntity entity = ConvertUtils.sourceToTarget(dto, ActPhraseEntity.class); + entity.setUsageNum(0); + if (insert(entity)) { + //redis存储 + String key = RedisKeys.getPhraseListKey(); + List list = baseDao.selectListPhraseInOrder(); + if (null != list && list.size() > 0) { + redisUtils.set(key, list,RedisUtils.NOT_EXPIRE); + } + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActPhraseDTO dto) { + ActPhraseEntity entity = ConvertUtils.sourceToTarget(dto, ActPhraseEntity.class); + updateById(entity); + + //redis存储 + String key = RedisKeys.getPhraseListKey(); + redisUtils.delete(key); + List list = baseDao.selectListPhraseInOrder(); + redisUtils.set(key, list,RedisUtils.NOT_EXPIRE); + + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + + //redis存储 + String key = RedisKeys.getPhraseListKey(); + redisUtils.delete(key); + List list = baseDao.selectListPhraseInOrder(); + redisUtils.set(key, list,RedisUtils.NOT_EXPIRE); + } + + /** + * 统计编码数量 + * + * @param dto + * @return + */ + public Integer getCodeCount(ActPhraseDTO dto) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("code", dto.getCode()); + String id = dto.getId(); + wrapper.ne(id != null, "id", dto.getId()); + wrapper.eq("del_flag", "0"); + return baseDao.selectCount(wrapper); + } + + /** + * 查询启动时需存入radis内的常用语 + * + * @return + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void insertPhraseListToRedis() { + //redis存储 + String key = RedisKeys.getPhraseListKey(); + redisUtils.delete(key); + List list = baseDao.selectListPhraseInOrder(); + redisUtils.set(key, list,RedisUtils.NOT_EXPIRE); + } + + /** + * 使用次数加一 + * + * @param id + */ + @Override + public void updateUsagenumAddOne(String id) { + baseDao.updateUsagenumAddOne(id); + } + + /** + * 从redis直接读取常用语 + * + * @return + */ + @Override + public List getPhraseList() { + String key = RedisKeys.getPhraseListKey(); + Object object = redisUtils.get(key); + List list = new ArrayList(); + if (object != null) { + list = (List) object; + } else { + list = baseDao.selectListPhraseInOrder(); + redisUtils.set(key, list,RedisUtils.NOT_EXPIRE); + } + return list; + } + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/AppVolunteerRankController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/AppVolunteerRankController.java new file mode 100644 index 000000000..e7e699609 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/AppVolunteerRankController.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * 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. + *

    + * 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. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.controller; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; +import com.elink.esua.epdc.modules.volunteer.service.VolunteerRankService; +import com.elink.esua.epdc.volunteer.EpdcVolunteerRankDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + + +/** + * 志愿者排名接口 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@RestController +@RequestMapping("volunteer") +public class AppVolunteerRankController { + + @Autowired + private VolunteerRankService volunteerRankService; + + /** + * 获取排行榜 + * @return + */ + @GetMapping(value="leaderboard") + public Result> leaderboard() { + List list = volunteerRankService.leaderboard(); + return new Result().ok(list); + } + + /** + * 定时更新排行榜 + * @return + */ + @PostMapping(value="generateRankingList") + public Result generateRankingList(@RequestBody List list) { + return volunteerRankService.generateRankingList(list); + + } + + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/VolunteerRankController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/VolunteerRankController.java new file mode 100644 index 000000000..79398e8d2 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/VolunteerRankController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * 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. + *

    + * 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. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.volunteer.VolunteerRankDTO; +import com.elink.esua.epdc.modules.volunteer.excel.VolunteerRankExcel; +import com.elink.esua.epdc.modules.volunteer.service.VolunteerRankService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 志愿者排名 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@RestController +@RequestMapping("volunteerrank") +public class VolunteerRankController { + + @Autowired + private VolunteerRankService volunteerRankService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = volunteerRankService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + VolunteerRankDTO data = volunteerRankService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody VolunteerRankDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + volunteerRankService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody VolunteerRankDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + volunteerRankService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + volunteerRankService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = volunteerRankService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, VolunteerRankExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/VolunteerRankDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/VolunteerRankDao.java new file mode 100644 index 000000000..d56556bcf --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/VolunteerRankDao.java @@ -0,0 +1,41 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * 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. + *

    + * 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. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.volunteer.entity.VolunteerRankEntity; +import com.elink.esua.epdc.volunteer.EpdcVolunteerRankDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 志愿者排名 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Mapper +public interface VolunteerRankDao extends BaseDao { + /** + * 获取排行榜 + * @Author wanggongfeng + * @return + */ + List leaderboard(); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/entity/VolunteerRankEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/entity/VolunteerRankEntity.java new file mode 100644 index 000000000..26201329d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/entity/VolunteerRankEntity.java @@ -0,0 +1,92 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * 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. + *

    + * 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. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 志愿者排名 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_volunteer_rank") +public class VolunteerRankEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 排名 + */ + private Integer sort; + + /** + * 志愿者ID + */ + private String volunteerId; + + /** + * 用户ID + */ + private String userId; + + /** + * 头像 + */ + private String faceImg; + + /** + * 用户名 + */ + private String nickname; + + /** + * 是否党员(0-否,1-是) + */ + private String partyFlag; + + /** + * 爱心时长(单位:小时) + */ + private BigDecimal kindnessTime; + + /** + * 参加次数 + */ + private Integer participationNum; + + /** + * 排行生成日期 + */ + private Date generateDate; + + /** + * 是否显示(0-不显示,1-显示) + */ + private String showFlag; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/excel/VolunteerRankExcel.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/excel/VolunteerRankExcel.java new file mode 100644 index 000000000..c3e8854ce --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/excel/VolunteerRankExcel.java @@ -0,0 +1,87 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * 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. + *

    + * 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. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 志愿者排名 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Data +public class VolunteerRankExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "排名") + private Integer sort; + + @Excel(name = "志愿者ID") + private String volunteerId; + + @Excel(name = "用户ID") + private String userId; + + @Excel(name = "头像") + private String faceImg; + + @Excel(name = "用户名") + private String nickname; + + @Excel(name = "是否党员(0-否,1-是)") + private String partyFlag; + + @Excel(name = "爱心时长(单位:小时)") + private BigDecimal kindnessTime; + + @Excel(name = "参加次数") + private Integer participationNum; + + @Excel(name = "排行生成日期") + private Date generateDate; + + @Excel(name = "是否显示(0-不显示,1-显示)") + private String showFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + @Excel(name = "删除标志") + private String delFlag; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/redis/VolunteerRankRedis.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/redis/VolunteerRankRedis.java new file mode 100644 index 000000000..df6b5e58b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/redis/VolunteerRankRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * 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. + *

    + * 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. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 志愿者排名 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Component +public class VolunteerRankRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/VolunteerRankService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/VolunteerRankService.java new file mode 100644 index 000000000..757a41d68 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/VolunteerRankService.java @@ -0,0 +1,114 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * 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. + *

    + * 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. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; +import com.elink.esua.epdc.modules.volunteer.entity.VolunteerRankEntity; +import com.elink.esua.epdc.volunteer.EpdcVolunteerRankDTO; +import com.elink.esua.epdc.volunteer.VolunteerRankDTO; + +import java.util.List; +import java.util.Map; + +/** + * 志愿者排名 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +public interface VolunteerRankService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return VolunteerRankDTO + * @author generator + * @date 2019-12-19 + */ + VolunteerRankDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-19 + */ + void save(VolunteerRankDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-19 + */ + void update(VolunteerRankDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-19 + */ + void delete(String[] ids); + + /** + * 获取排行榜 + * @Author wanggongfeng + * @return + */ + List leaderboard(); + + /** + * 生成排行榜 + * @Author wanggongfeng + * @return + */ + Result generateRankingList(List list); + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VolunteerRankServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VolunteerRankServiceImpl.java new file mode 100644 index 000000000..5b8434bd8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VolunteerRankServiceImpl.java @@ -0,0 +1,136 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * 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. + *

    + * 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. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; +import com.elink.esua.epdc.modules.volunteer.dao.VolunteerRankDao; +import com.elink.esua.epdc.modules.volunteer.entity.VolunteerRankEntity; +import com.elink.esua.epdc.modules.volunteer.redis.VolunteerRankRedis; +import com.elink.esua.epdc.modules.volunteer.service.VolunteerRankService; +import com.elink.esua.epdc.volunteer.EpdcVolunteerRankDTO; +import com.elink.esua.epdc.volunteer.VolunteerRankDTO; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 志愿者排名 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Service +public class VolunteerRankServiceImpl extends BaseServiceImpl implements VolunteerRankService { + + @Autowired + private VolunteerRankRedis volunteerRankRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, VolunteerRankDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, VolunteerRankDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public VolunteerRankDTO get(String id) { + VolunteerRankEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, VolunteerRankDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(VolunteerRankDTO dto) { + VolunteerRankEntity entity = ConvertUtils.sourceToTarget(dto, VolunteerRankEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(VolunteerRankDTO dto) { + VolunteerRankEntity entity = ConvertUtils.sourceToTarget(dto, VolunteerRankEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 获取排行榜 + * @Author wanggongfeng + * @return + */ + @Override + public List leaderboard(){ + List list = baseDao.leaderboard(); + return list; + } + + /** + * 更新排行榜 + * @Author wanggongfeng + * @return + */ + @Override + public Result generateRankingList(List list){ + if(list != null && list.size() > 0){ + for(int i = 0 ; i < list.size(); i++ ){ + EpdcGetVolunteerRankDTO epdcGetVolunteerRankDTO = list.get(i); + VolunteerRankEntity entity = ConvertUtils.sourceToTarget(epdcGetVolunteerRankDTO, VolunteerRankEntity.class); + insert(entity); + } + return new Result().ok("排名更新成功"); + } + return new Result().error("更新排名失败"); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/support/initbean/InitRedisCache.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/support/initbean/InitRedisCache.java new file mode 100644 index 000000000..53f4593c6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/support/initbean/InitRedisCache.java @@ -0,0 +1,19 @@ +package com.elink.esua.epdc.support.initbean; + +import com.elink.esua.epdc.modules.phrases.service.ActPhraseService; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +public class InitRedisCache implements InitializingBean { + + @Autowired + private ActPhraseService actPhraseService; + + @Override + public void afterPropertiesSet() throws Exception{ + //redis存储常用语 + actPhraseService.insertPhraseListToRedis(); + } +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/application.yml index 4febac6f8..15f06a2c2 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/application.yml +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/application.yml @@ -1,9 +1,30 @@ +#server: +# port: @server.port@ +# servlet: +# context-path: /heart +# +#nacos: +# config: +# server-addr: @nacos.server-addr@ +# type: YAML +# namespace: @nacos.config.namespace@ +# group: @nacos.config.group@ +# dataId: epdc-heart-server +# bootstrap: +# enable: true +# log: +# enable: @nacos.config.bootstrap.log.enable@ +#spring: +# application: +# name: epdc-heart-server server: port: @server.port@ servlet: context-path: /heart spring: + main: + allow-bean-definition-overriding: true application: name: epdc-heart-server # 环境 dev|test|prod @@ -45,6 +66,23 @@ spring: # 将采样比例设置为 1.0,也就是全部都需要。默认是 0.1 probability: 1.0 +feign: + hystrix: + enabled: true + httpclient: + enabled: true + +hystrix: + command: + default: + execution: + isolation: + thread: + timeoutInMilliseconds: 60000 #缺省为1000 + +ribbon: + ReadTimeout: 300000 + ConnectTimeout: 300000 management: endpoints: diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActBannerDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActBannerDao.xml new file mode 100644 index 000000000..096b6f507 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActBannerDao.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + UPDATE epdc_act_banner + SET `STATUS` = '0' + WHERE + ID NOT IN ( + SELECT + t.ID + FROM + ( SELECT ID FROM epdc_act_banner WHERE `STATUS` = '1' AND DEL_FLAG = '0' ORDER BY CREATED_TIME DESC LIMIT 9 ) AS t + ) + + + + UPDATE epdc_act_banner SET `STATUS` = '0' WHERE ACT_ID = #{actId} + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActClockPicDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActClockPicDao.xml new file mode 100644 index 000000000..37dd9f15b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActClockPicDao.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActInfoDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActInfoDao.xml new file mode 100644 index 000000000..946d836eb --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActInfoDao.xml @@ -0,0 +1,513 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + update epdc_act_info eai + set eai.CLOCK_NUM=eai.CLOCK_NUM+1 + where eai.DEL_FLAG='0' + and eai.id=#{actId} + + + + + update epdc_act_info eai + set eai.SIGNUP_NUM=eai.SIGNUP_NUM-1 + where eai.DEL_FLAG='0' + and eai.id=#{actId} + + diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserClockLogDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserClockLogDao.xml new file mode 100644 index 000000000..b871e8823 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserClockLogDao.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserLogDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserLogDao.xml new file mode 100644 index 000000000..aaf472d71 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserLogDao.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserPointsLogDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserPointsLogDao.xml new file mode 100644 index 000000000..7410a2662 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserPointsLogDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml new file mode 100644 index 000000000..5ea3a7247 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml @@ -0,0 +1,270 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/phrases/ActPhraseDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/phrases/ActPhraseDao.xml new file mode 100644 index 000000000..084868edf --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/phrases/ActPhraseDao.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + update epdc_act_phrase set USAGE_NUM = USAGE_NUM + 1 where id = #{id} + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/volunteer/VolunteerRankDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/volunteer/VolunteerRankDao.xml new file mode 100644 index 000000000..ad0ac000e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/volunteer/VolunteerRankDao.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-client/src/main/java/com/elink/esua/epdc/constant/JobModuleConstant.java b/esua-epdc/epdc-module/epdc-job/epdc-job-client/src/main/java/com/elink/esua/epdc/constant/JobModuleConstant.java new file mode 100644 index 000000000..ebcb2bc87 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-client/src/main/java/com/elink/esua/epdc/constant/JobModuleConstant.java @@ -0,0 +1,15 @@ +package com.elink.esua.epdc.constant; + +/** + * 定时任务模块部分常量 + * + * @author work@yujt.net.cn + * @date 2020/4/10 16:49 + */ +public interface JobModuleConstant { + + /** + * 审核初心互助报名用户 + */ + String TASK_NAME_AUDIT_ACT = "autoAuditActUserTask"; +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/pom.xml b/esua-epdc/epdc-module/epdc-job/epdc-job-server/pom.xml index ea7698e56..9eb0e1954 100644 --- a/esua-epdc/epdc-module/epdc-job/epdc-job-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/pom.xml @@ -145,7 +145,7 @@ dev dev - 9061 + 10013 2 47.104.224.45 @@ -171,12 +171,12 @@ test test - 10008 + 10013 2 - 47.104.224.45 - 6379 - elink@888 + 114.215.125.123 + 9603 + epdc!redis@master1405 @@ -197,7 +197,7 @@ prod prod - 9061 + 10013 0 diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClint.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/AnalysisFeignClint.java similarity index 88% rename from esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClint.java rename to esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/AnalysisFeignClint.java index c0b7e2ec5..3907e37de 100644 --- a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClint.java +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/AnalysisFeignClint.java @@ -2,7 +2,7 @@ package com.elink.esua.epdc.feign; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.Result; -import com.elink.esua.epdc.feign.fallback.UserFeignClintFallback; +import com.elink.esua.epdc.feign.fallback.AnalysisFeignClintFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; @@ -11,8 +11,8 @@ import org.springframework.web.bind.annotation.GetMapping; * @Date: 2020/3/25 10:20 * @Description: 用户数据分析 */ -@FeignClient(name = ServiceConstant.EPDC_ANALYSIS_SERVER, fallback = UserFeignClintFallback.class) -public interface UserFeignClint { +@FeignClient(name = ServiceConstant.EPDC_ANALYSIS_SERVER, fallback = AnalysisFeignClintFallback.class) +public interface AnalysisFeignClint { /*** * 生成用户分析数据导入临时表 diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/HeartFeignClient.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/HeartFeignClient.java new file mode 100644 index 000000000..230d38575 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/HeartFeignClient.java @@ -0,0 +1,40 @@ +package com.elink.esua.epdc.feign; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; +import com.elink.esua.epdc.feign.fallback.HeartFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; + +import java.util.List; + +/** + * + * 调用用户模块 + * + * @Author:wanggongfeng + * @Date:2019/12/16 17:36 + */ +@FeignClient(name = ServiceConstant.EPDC_HEART_SERVER, fallback = HeartFeignClientFallback.class) +public interface HeartFeignClient { + + /** + * 更新当日排行榜 + * + * @return + */ + @PostMapping("heart/volunteer/generateRankingList") + Result generateRankingList(List list); + + /** + * 活动时间到自动审核通过未审核的报名人员 + * + * @return + */ + @GetMapping("heart/appactuserrelation/AutoAuditActUser/{actId}") + Result AutoAuditActUser(@PathVariable("actId") String actId); + +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java new file mode 100644 index 000000000..975afbe24 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java @@ -0,0 +1,48 @@ +package com.elink.esua.epdc.feign; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.UserDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; +import com.elink.esua.epdc.feign.fallback.UserFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; + +import java.util.List; + +/** + * + * 调用用户模块 + * + * @Author:wanggongfeng + * @Date:2019/12/16 17:36 + */ +@FeignClient(name = ServiceConstant.EPDC_USER_SERVER, fallback = UserFeignClientFallback.class) +public interface UserFeignClient { + + /** + * 获取当日排行榜 + * + * @return + */ + @GetMapping("app-user/epdc-app/volunteerinfo/getRankingList") + Result> getRankingList(); + + + @GetMapping("app-user/epdc-app/user/getById/{userId}") + Result getUserInfoById(@PathVariable("userId") String userId); + + /** + * 更新用户信息 + * + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @params [userDTO] + * @author liuchuang + * @since 2019/10/25 17:07 + */ + @PostMapping("app-user/epdc-app/user/updateUserInfo") + Result updateUserInfo(UserDTO userDTO); + +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClintFallback.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/AnalysisFeignClintFallback.java similarity index 87% rename from esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClintFallback.java rename to esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/AnalysisFeignClintFallback.java index 8a2a066dc..dc3783417 100644 --- a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClintFallback.java +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/AnalysisFeignClintFallback.java @@ -3,7 +3,7 @@ package com.elink.esua.epdc.feign.fallback; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; import com.elink.esua.epdc.commons.tools.utils.Result; -import com.elink.esua.epdc.feign.UserFeignClint; +import com.elink.esua.epdc.feign.AnalysisFeignClint; import org.springframework.stereotype.Component; /** @@ -12,7 +12,7 @@ import org.springframework.stereotype.Component; * @Description: 用户数据分析 */ @Component -public class UserFeignClintFallback implements UserFeignClint { +public class AnalysisFeignClintFallback implements AnalysisFeignClint { @Override public Result createUserAnalysisData() { diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/HeartFeignClientFallback.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/HeartFeignClientFallback.java new file mode 100644 index 000000000..0bcf90b3f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/HeartFeignClientFallback.java @@ -0,0 +1,39 @@ +package com.elink.esua.epdc.feign.fallback; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; +import com.elink.esua.epdc.feign.HeartFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @Author:wanggongfeng + * @Date:2019/12/16 15:11 + */ +@Component +public class HeartFeignClientFallback implements HeartFeignClient { + + /** + * 更新排行榜 + * + * @return + */ + @Override + public Result generateRankingList(List list) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "generateRankingList",list); + } + + /** + * 活动时间到自动审核通过未审核的报名人员 + * + * @return + */ + @Override + public Result AutoAuditActUser(String actId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "AutoAuditActUser",actId); + } + +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java new file mode 100644 index 000000000..d3ab4b71f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java @@ -0,0 +1,37 @@ +package com.elink.esua.epdc.feign.fallback; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.UserDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; +import com.elink.esua.epdc.feign.UserFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @Author:wanggongfeng + * @Date:2019/12/16 15:11 + */ +@Component +public class UserFeignClientFallback implements UserFeignClient { + + /** + * 获取排行榜 + * + * @return + */ + @Override + public Result> getRankingList() { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "getRankingList"); + } + @Override + public Result getUserInfoById(String userId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "getUserInfoById", userId); + } + @Override + public Result updateUserInfo(UserDTO userDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "updateUserInfo", userDTO); + } +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/ActivityService.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/ActivityService.java new file mode 100644 index 000000000..44fee92f4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/ActivityService.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.tools.utils.Result; + +/** + * 定时更新排行榜 + * + * @author Mark sunlightcs@gmail.com + */ +public interface ActivityService { + + /** + * 活动时间到自动审核通过未审核的报名人员 + * @Author wanggongfeng + * @return + */ + Result AutoAuditActUser(String actId); + +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/VolunteerService.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/VolunteerService.java new file mode 100644 index 000000000..ce6343dd5 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/VolunteerService.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.tools.utils.Result; + +/** + * 定时更新排行榜 + * + * @author Mark sunlightcs@gmail.com + */ +public interface VolunteerService { + + /** + * 生成排行榜 + * @Author wanggongfeng + * @return + */ + Result generateRankingList(); + +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/ActivityServiceImpl.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/ActivityServiceImpl.java new file mode 100644 index 000000000..ba4cc19b9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/ActivityServiceImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service.impl; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.feign.HeartFeignClient; +import com.elink.esua.epdc.feign.UserFeignClient; +import com.elink.esua.epdc.service.ActivityService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class ActivityServiceImpl implements ActivityService { + + @Autowired + private UserFeignClient userFeignClient; + + @Autowired + private HeartFeignClient heartFeignClient; + + /** + * 活动时间到自动审核通过未审核的报名人员 + * @Author wanggongfeng + * @return + */ + @Override + public Result AutoAuditActUser(String actId){ + return heartFeignClient.AutoAuditActUser(actId); + } + +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/ScheduleJobServiceImpl.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/ScheduleJobServiceImpl.java index 5e31f78e8..c1932e4db 100644 --- a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/ScheduleJobServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/ScheduleJobServiceImpl.java @@ -1,13 +1,14 @@ /** * Copyright (c) 2018 人人开源 All rights reserved. - * + *

    * https://www.renren.io - * + *

    * 版权所有,侵权必究! */ package com.elink.esua.epdc.service.impl; +import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.elink.esua.epdc.entity.ScheduleJobEntity; @@ -18,10 +19,8 @@ import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; import com.elink.esua.epdc.dao.ScheduleJobDao; import com.elink.esua.epdc.dto.ScheduleJobDTO; -import com.elink.esua.epdc.entity.ScheduleJobEntity; import com.elink.esua.epdc.enums.ScheduleStatusEnum; import com.elink.esua.epdc.service.ScheduleJobService; -import com.elink.esua.epdc.utils.ScheduleUtils; import org.apache.commons.lang3.StringUtils; import org.quartz.Scheduler; import org.springframework.beans.factory.annotation.Autowired; @@ -30,110 +29,123 @@ import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; import java.util.HashMap; +import java.util.List; import java.util.Map; @Service public class ScheduleJobServiceImpl extends BaseServiceImpl implements ScheduleJobService { - @Autowired - private Scheduler scheduler; - - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, Constant.CREATE_DATE, false), - getWrapper(params) - ); - return getPageData(page, ScheduleJobDTO.class); - } + @Autowired + private Scheduler scheduler; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, Constant.CREATE_DATE, false), + getWrapper(params) + ); + return getPageData(page, ScheduleJobDTO.class); + } - @Override - public ScheduleJobDTO get(Long id) { - ScheduleJobEntity entity = baseDao.selectById(id); + @Override + public ScheduleJobDTO get(Long id) { + ScheduleJobEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, ScheduleJobDTO.class); - } + return ConvertUtils.sourceToTarget(entity, ScheduleJobDTO.class); + } - private QueryWrapper getWrapper(Map params){ - String beanName = (String)params.get("beanName"); + private QueryWrapper getWrapper(Map params) { + String beanName = (String) params.get("beanName"); - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.like(StringUtils.isNotBlank(beanName), "bean_name", beanName); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StringUtils.isNotBlank(beanName), "bean_name", beanName); - return wrapper; - } + return wrapper; + } - @Override - @Transactional(rollbackFor = Exception.class) - public void save(ScheduleJobDTO dto) { - ScheduleJobEntity entity = ConvertUtils.sourceToTarget(dto, ScheduleJobEntity.class); + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScheduleJobDTO dto) { + ScheduleJobEntity entity = ConvertUtils.sourceToTarget(dto, ScheduleJobEntity.class); - entity.setStatus(ScheduleStatusEnum.NORMAL.value()); + entity.setStatus(ScheduleStatusEnum.NORMAL.value()); this.insert(entity); ScheduleUtils.createScheduleJob(scheduler, entity); } - @Override - @Transactional(rollbackFor = Exception.class) - public void update(ScheduleJobDTO dto) { - ScheduleJobEntity entity = ConvertUtils.sourceToTarget(dto, ScheduleJobEntity.class); + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScheduleJobDTO dto) { + ScheduleJobEntity entity = ConvertUtils.sourceToTarget(dto, ScheduleJobEntity.class); ScheduleUtils.updateScheduleJob(scheduler, entity); this.updateById(entity); } - @Override - @Transactional(rollbackFor = Exception.class) + @Override + @Transactional(rollbackFor = Exception.class) public void deleteBatch(Long[] ids) { - for(Long id : ids){ - ScheduleUtils.deleteScheduleJob(scheduler, id); - } - - //删除数据 - this.deleteBatchIds(Arrays.asList(ids)); - } - - @Override - public int updateBatch(Long[] ids, int status){ - Map map = new HashMap<>(2); - map.put("ids", ids); - map.put("status", status); - return baseDao.updateBatch(map); + for (Long id : ids) { + ScheduleUtils.deleteScheduleJob(scheduler, id); + } + + //删除数据 + this.deleteBatchIds(Arrays.asList(ids)); } - @Override - @Transactional(rollbackFor = Exception.class) + @Override + public int updateBatch(Long[] ids, int status) { + Map map = new HashMap<>(2); + map.put("ids", ids); + map.put("status", status); + return baseDao.updateBatch(map); + } + + @Override + @Transactional(rollbackFor = Exception.class) public void run(Long[] ids) { - for(Long id : ids){ - ScheduleUtils.run(scheduler, this.selectById(id)); - } + for (Long id : ids) { + ScheduleUtils.run(scheduler, this.selectById(id)); + } } - @Override - @Transactional(rollbackFor = Exception.class) + @Override + @Transactional(rollbackFor = Exception.class) public void pause(Long[] ids) { - for(Long id : ids){ - ScheduleUtils.pauseJob(scheduler, id); - } + for (Long id : ids) { + ScheduleUtils.pauseJob(scheduler, id); + } - updateBatch(ids, ScheduleStatusEnum.PAUSE.value()); + updateBatch(ids, ScheduleStatusEnum.PAUSE.value()); } - @Override - @Transactional(rollbackFor = Exception.class) + @Override + @Transactional(rollbackFor = Exception.class) public void resume(Long[] ids) { - for(Long id : ids){ - ScheduleUtils.resumeJob(scheduler, id); - } + for (Long id : ids) { + ScheduleUtils.resumeJob(scheduler, id); + } - updateBatch(ids, ScheduleStatusEnum.NORMAL.value()); + updateBatch(ids, ScheduleStatusEnum.NORMAL.value()); } - @Override - public void deleteJobByParams(String params) { - //删除数据 - baseDao.deleteJobByParams(params); - } + @Override + public void deleteJobByParams(String params) { + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("params", params); + List scheduleJobEntities = baseDao.selectList(wrapper); + + if (CollUtil.isNotEmpty(scheduleJobEntities)) { + Long[] jobIds = scheduleJobEntities.stream() + .map(ScheduleJobEntity::getId) + .distinct() + .toArray(Long[]::new); + + this.deleteBatch(jobIds); + } + + } } diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/ScheduleJobUserServiceImpl.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/ScheduleJobUserServiceImpl.java index 7a0726756..c25f91290 100644 --- a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/ScheduleJobUserServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/ScheduleJobUserServiceImpl.java @@ -1,10 +1,9 @@ package com.elink.esua.epdc.service.impl; -import com.elink.esua.epdc.feign.UserFeignClint; +import com.elink.esua.epdc.feign.AnalysisFeignClint; import com.elink.esua.epdc.service.ScheduleJobUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import org.springframework.stereotype.Service; /** * @author: qushutong @@ -14,7 +13,7 @@ import org.springframework.stereotype.Service; @Component public class ScheduleJobUserServiceImpl implements ScheduleJobUserService { @Autowired - private UserFeignClint userFeignClint; + private AnalysisFeignClint userFeignClint; @Override public void createUserAnalysisData() { diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerServiceImpl.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerServiceImpl.java new file mode 100644 index 000000000..dfb6eabfa --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerServiceImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service.impl; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; +import com.elink.esua.epdc.feign.HeartFeignClient; +import com.elink.esua.epdc.feign.UserFeignClient; +import com.elink.esua.epdc.service.VolunteerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class VolunteerServiceImpl implements VolunteerService { + + @Autowired + private UserFeignClient userFeignClient; + + @Autowired + private HeartFeignClient heartFeignClient; + + /** + * 更新排行榜 + * @Author wanggongfeng + * @return + */ + @Override + public Result generateRankingList(){ + Result> result = userFeignClient.getRankingList(); + List list = result.getData(); + return heartFeignClient.generateRankingList(list); + } + +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/activity/AutoAuditActUserTask.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/activity/AutoAuditActUserTask.java new file mode 100644 index 000000000..78cf190eb --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/activity/AutoAuditActUserTask.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * 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. + *

    + * 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. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.task.activity; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.constant.JobModuleConstant; +import com.elink.esua.epdc.service.ActivityService; +import com.elink.esua.epdc.service.ScheduleJobService; +import com.elink.esua.epdc.task.ITask; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 自动审核通过未审核的报名人员 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Component(JobModuleConstant.TASK_NAME_AUDIT_ACT) +public class AutoAuditActUserTask implements ITask { + + @Autowired + private ActivityService activityService; + + @Autowired + private ScheduleJobService scheduleJobService; + + @Override + public void run(String actId) { + // 活动时间到自动审核通过未审核的报名人员 + Result result = activityService.AutoAuditActUser(actId); + + // 删除对应job + if (result.success()) { + scheduleJobService.deleteJobByParams(actId); + } + + } + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/analysis/UserAnalysisTask.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/analysis/UserAnalysisTask.java index d02458b5d..40e9c69c5 100644 --- a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/analysis/UserAnalysisTask.java +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/analysis/UserAnalysisTask.java @@ -1,18 +1,23 @@ package com.elink.esua.epdc.task.analysis; +import com.elink.esua.epdc.service.ScheduleJobUserService; +import com.elink.esua.epdc.task.ITask; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + /** - * @author: qushutong - * @Date: 2020/3/25 10:04 - * @Description: 用户分析 + * @author: qushutong + * @Date: 2020/3/25 10:12 + * @Description: */ -public interface UserAnalysisTask { +@Component("userAnalysisTask") +public class UserAnalysisTask implements ITask { + + @Autowired + private ScheduleJobUserService scheduleJobUserService; - /*** - * 网格开通情况 - * @param - * @return void - * @author qushutong - * @date 2020/3/25 10:11 - */ - void run(String params); + @Override + public void run(String params) { + scheduleJobUserService.createUserAnalysisData(); + } } diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/analysis/UserAnalysisTaskImpl.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/analysis/UserAnalysisTaskImpl.java deleted file mode 100644 index 2430504cc..000000000 --- a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/analysis/UserAnalysisTaskImpl.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.elink.esua.epdc.task.analysis; - -import com.elink.esua.epdc.service.ScheduleJobUserService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -/** - * @author: qushutong - * @Date: 2020/3/25 10:12 - * @Description: - */ -@Component("UserAnalysisTask") -public class UserAnalysisTaskImpl implements UserAnalysisTask { - @Autowired - private ScheduleJobUserService scheduleJobUserService; - - @Override - public void run(String params) { - scheduleJobUserService.createUserAnalysisData(); - } -} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/KpiManualScoreTask.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/kpi/KpiManualScoreTask.java similarity index 90% rename from esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/KpiManualScoreTask.java rename to esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/kpi/KpiManualScoreTask.java index 613b2e967..b3be673c6 100644 --- a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/KpiManualScoreTask.java +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/kpi/KpiManualScoreTask.java @@ -1,6 +1,7 @@ -package com.elink.esua.epdc.task; +package com.elink.esua.epdc.task.kpi; import com.elink.esua.epdc.service.ScheduleJobKpiService; +import com.elink.esua.epdc.task.ITask; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/KpiMetaDataTask.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/kpi/KpiMetaDataTask.java similarity index 91% rename from esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/KpiMetaDataTask.java rename to esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/kpi/KpiMetaDataTask.java index 43fd263f7..ce333be77 100644 --- a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/KpiMetaDataTask.java +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/kpi/KpiMetaDataTask.java @@ -1,6 +1,7 @@ -package com.elink.esua.epdc.task; +package com.elink.esua.epdc.task.kpi; import com.elink.esua.epdc.service.ScheduleJobKpiService; +import com.elink.esua.epdc.task.ITask; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/KpiRuleTask.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/kpi/KpiRuleTask.java similarity index 91% rename from esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/KpiRuleTask.java rename to esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/kpi/KpiRuleTask.java index 6c5edf27a..e7b921342 100644 --- a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/KpiRuleTask.java +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/kpi/KpiRuleTask.java @@ -1,6 +1,7 @@ -package com.elink.esua.epdc.task; +package com.elink.esua.epdc.task.kpi; import com.elink.esua.epdc.service.ScheduleJobKpiService; +import com.elink.esua.epdc.task.ITask; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/volunteer/UpdateVolunteerRankTask.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/volunteer/UpdateVolunteerRankTask.java new file mode 100644 index 000000000..6a1c0c330 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/volunteer/UpdateVolunteerRankTask.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * 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. + *

    + * 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. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.task.volunteer; + +import com.elink.esua.epdc.service.VolunteerService; +import com.elink.esua.epdc.task.ITask; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 定时更新志愿者排名 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-19 + */ +@Component("updateVolunteerRankTask") +public class UpdateVolunteerRankTask implements ITask { + + @Autowired + private VolunteerService volunteerService; + + @Override + public void run(String param) { + //每日定时更新排行榜 + volunteerService.generateRankingList(); + } + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/ImportExcelErrorResultDTO.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/ImportExcelErrorResultDTO.java deleted file mode 100644 index d581645b6..000000000 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/src/main/java/com/elink/esua/epdc/dto/result/ImportExcelErrorResultDTO.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.elink.esua.epdc.dto.result; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import lombok.Data; - -import java.io.Serializable; - -/** - * @Description - * @Author yinzuomei - * @Date 2019/12/5 17:27 - */ -@Data -public class ImportExcelErrorResultDTO implements Serializable { - private static final long serialVersionUID = -6085396247858232510L; - - /** - * 错误数据行数 - */ - private String errorLine; - /** - * 错误数据信息 - */ - private String errorInfo; -} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/pom.xml b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/pom.xml index 004da4b62..763213561 100644 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/pom.xml @@ -159,9 +159,9 @@ 10009 2 - 47.104.224.45 - 6379 - elink@888 + 114.215.125.123 + 9603 + epdc!redis@master1405 diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiManualScoreTempDao.xml b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiManualScoreTempDao.xml deleted file mode 100644 index 1cd17d684..000000000 --- a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/mapper/KpiManualScoreTempDao.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DELETE - FROM - epdc_kpi_manual_score_temp - WHERE - RULE_ID =#{ruleId} - AND user_id = #{userId} - AND score_start_time =#{scoreStartTime} - - - - diff --git a/esua-epdc/epdc-module/epdc-message/epdc-message-server/pom.xml b/esua-epdc/epdc-module/epdc-message/epdc-message-server/pom.xml index 367eede94..ffe406860 100644 --- a/esua-epdc/epdc-module/epdc-message/epdc-message-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-message/epdc-message-server/pom.xml @@ -174,9 +174,9 @@ 10010 2 - 47.104.224.45 - 6379 - elink@888 + 114.215.125.123 + 9603 + epdc!redis@master1405 diff --git a/esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/resources/logback-spring.xml b/esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/resources/logback-spring.xml index 6afa5c97e..1d5077d24 100644 --- a/esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/resources/logback-spring.xml +++ b/esua-epdc/epdc-module/epdc-message/epdc-message-server/src/main/resources/logback-spring.xml @@ -144,10 +144,10 @@ - - - - + + + + diff --git a/esua-epdc/epdc-module/epdc-news/epdc-news-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcInformationFormDTO.java b/esua-epdc/epdc-module/epdc-news/epdc-news-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcInformationFormDTO.java index 17428cd70..6ad274a6a 100644 --- a/esua-epdc/epdc-module/epdc-news/epdc-news-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcInformationFormDTO.java +++ b/esua-epdc/epdc-module/epdc-news/epdc-news-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcInformationFormDTO.java @@ -62,9 +62,9 @@ public class EpdcInformationFormDTO implements Serializable { /** * AppInformationBusinessEnum * 消息所属业务类型:event事件审核;issueComment议题评论;issueReply议题评论回复;itemComment项目评论;itemReply项目评论回复; - * issueApprove支持议题;itemApprove支持项目;issueCommentApprove议题评论支持;issueCommentOppose议题评论反对; - * itemCommentApprove项目评论支持;itemCommentOppose项目评论反对;issue议题处理; - * item项目处理;groupInvited社群邀请等 + * issueApprove支持议题;itemApprove支持项目;issueCommentApprove议题评论支持;issueCommentOppose议题评论反对; + * itemCommentApprove项目评论支持;itemCommentOppose项目评论反对;issue议题处理; + * item项目处理;groupInvited社群邀请等; volunteer志愿者审核;activity爱心互助活动;points积分商城 */ @NotBlank(message = "消息所属业务类型不能为空") private String businessType; diff --git a/esua-epdc/epdc-module/epdc-news/epdc-news-server/pom.xml b/esua-epdc/epdc-module/epdc-news/epdc-news-server/pom.xml index 59b4c2105..71ae58d1b 100644 --- a/esua-epdc/epdc-module/epdc-news/epdc-news-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-news/epdc-news-server/pom.xml @@ -45,6 +45,10 @@ epdc-admin-client 1.0.0 + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + org.apache.rocketmq @@ -137,6 +141,13 @@ 47.104.85.99:9876;114.215.125.123:9876 organizationGroup + @@ -148,9 +159,9 @@ 10011 2 - 47.104.224.45 - 6379 - elink@888 + 114.215.125.123 + 9603 + epdc!redis@master1405 @@ -167,6 +178,13 @@ 47.104.85.99:9876;114.215.125.123:9876 organizationGroup + diff --git a/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppInformationController.java b/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppInformationController.java index ff65dd5cd..2e561ce91 100644 --- a/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppInformationController.java +++ b/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppInformationController.java @@ -59,6 +59,19 @@ public class EpdcAppInformationController { return this.informationService.saveInformation(formDto); } + /** + * @param epdcInformationFormDTOList + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 批量发送消息 + * @Date 2020/2/7 21:04 + **/ + @PostMapping("saveList") + public Result saveInformation(@RequestBody List epdcInformationFormDTOList) { + ValidatorUtils.validateEntity(epdcInformationFormDTOList); + return this.informationService.saveInformationList(epdcInformationFormDTOList); + } + /** * 消息已读 * @@ -99,4 +112,4 @@ public class EpdcAppInformationController { public Result selectOneFristByUserId(@PathVariable("userId") String userId) { return informationService.selectOneFristByUserId(userId); } -} \ No newline at end of file +} diff --git a/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/java/com/elink/esua/epdc/redis/NewsCategoryRedis.java b/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/java/com/elink/esua/epdc/redis/NewsCategoryRedis.java index c2d90ac5c..05bbd071c 100644 --- a/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/java/com/elink/esua/epdc/redis/NewsCategoryRedis.java +++ b/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/java/com/elink/esua/epdc/redis/NewsCategoryRedis.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.elink.esua.epdc.news.redis; +package com.elink.esua.epdc.redis; import com.elink.esua.epdc.commons.tools.redis.RedisUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -36,12 +36,12 @@ public class NewsCategoryRedis { } - public void set(){ + public void set() { } - public String get(String id){ + public String get(String id) { return null; } -} \ No newline at end of file +} diff --git a/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/java/com/elink/esua/epdc/service/InformationService.java b/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/java/com/elink/esua/epdc/service/InformationService.java index 889972dc5..76b296d18 100644 --- a/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/java/com/elink/esua/epdc/service/InformationService.java +++ b/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/java/com/elink/esua/epdc/service/InformationService.java @@ -137,4 +137,13 @@ public interface InformationService extends BaseService { * @date 2019/9/11 19:05 */ Result selectOneFristByUserId(String userId); -} \ No newline at end of file + + /** + * @param epdcInformationFormDTOList + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei 批量给用户发消息 + * @Description saveInformationList + * @Date 2020/2/7 21:04 + **/ + Result saveInformationList(List epdcInformationFormDTOList); +} diff --git a/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/java/com/elink/esua/epdc/service/impl/InformationServiceImpl.java b/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/java/com/elink/esua/epdc/service/impl/InformationServiceImpl.java index c9f7d5fe7..3f1d2309b 100644 --- a/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/java/com/elink/esua/epdc/service/impl/InformationServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/java/com/elink/esua/epdc/service/impl/InformationServiceImpl.java @@ -20,11 +20,11 @@ package com.elink.esua.epdc.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; import com.elink.esua.epdc.commons.tools.constant.NumConstant; import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; -import com.elink.esua.epdc.commons.tools.constant.FieldConstant; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dao.InformationDao; import com.elink.esua.epdc.dto.InformationDTO; @@ -132,4 +132,14 @@ public class InformationServiceImpl extends BaseServiceImpl selectOneFristByUserId(String userId) { return new Result().ok(baseDao.selectOneFristByUserId(userId)); } -} \ No newline at end of file + + @Override + public Result saveInformationList(List epdcInformationFormDTOList) { + List entityList = ConvertUtils.sourceToTarget(epdcInformationFormDTOList, InformationEntity.class); + for (InformationEntity entity : entityList) { + entity.setReadFlag(YesOrNoEnum.NO.value()); + } + this.insertBatch(entityList); + return new Result(); + } +} diff --git a/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/resources/application.yml index fbd61c184..9ab1ce832 100644 --- a/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/resources/application.yml +++ b/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/resources/application.yml @@ -1,3 +1,23 @@ +#server: +# port: @server.port@ +# servlet: +# context-path: /news +# +#nacos: +# config: +# server-addr: @nacos.server-addr@ +# type: YAML +# namespace: @nacos.config.namespace@ +# group: @nacos.config.group@ +# dataId: epdc-news-server +# bootstrap: +# enable: true +# log: +# enable: @nacos.config.bootstrap.log.enable@ +# +#spring: +# application: +# name: epdc-news-server server: port: @server.port@ servlet: diff --git a/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/resources/logback-spring.xml b/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/resources/logback-spring.xml index 999a92997..1d5cdf4ad 100644 --- a/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/resources/logback-spring.xml +++ b/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/resources/logback-spring.xml @@ -144,10 +144,10 @@ - - - - + + + + @@ -156,4 +156,4 @@ - \ No newline at end of file + diff --git a/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/resources/mapper/NoticeDao.xml b/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/resources/mapper/NoticeDao.xml index c87bd37fb..336771ed9 100644 --- a/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/resources/mapper/NoticeDao.xml +++ b/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/resources/mapper/NoticeDao.xml @@ -57,7 +57,7 @@ + + + + + + + + + + + + + + + + + + + + select * + from epdc_user_tag m + where m.DEL_FLAG='0' + and m.TAG_CODE=#{tagCode} + - \ No newline at end of file + + + diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserTagRelationDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserTagRelationDao.xml index e7c8bc663..15e11a50b 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserTagRelationDao.xml +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserTagRelationDao.xml @@ -15,5 +15,13 @@ - - \ No newline at end of file + + DELETE FROM + epdc_user_tag_relation + WHERE + USER_ID = #{userId} + AND TAG_ID IN ( + SELECT eut.id FROM epdc_user_tag eut WHERE eut.TAG_CODE = #{tagCode} + ) + + diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml new file mode 100644 index 000000000..cc604bf15 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml @@ -0,0 +1,207 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + UPDATE epdc_volunteer_info + SET + UPDATED_BY = #{updatedBy} + ,UPDATED_TIME = #{updatedTime} + ,AUDIT_STATUS = #{auditStatus} + ,FAILURE_REASON = #{failureReason} + ,AUDIT_TIME = #{auditTime} + ,AUDITOR = #{auditor} + WHERE ID = #{id} + + + + + + + + + + + + UPDATE epdc_volunteer_info + SET KINDNESS_TIME = ( KINDNESS_TIME + #{kindnessTime} ), + PARTICIPATION_NUM = ( PARTICIPATION_NUM + 1 ) + WHERE + USER_ID = #{userId} + AND DEL_FLAG = '0' + + diff --git a/esua-epdc/epdc-module/epdc-webservice/pom.xml b/esua-epdc/epdc-module/epdc-webservice/pom.xml index a3eb757a6..8c8098348 100644 --- a/esua-epdc/epdc-module/epdc-webservice/pom.xml +++ b/esua-epdc/epdc-module/epdc-webservice/pom.xml @@ -151,9 +151,9 @@ test 2 - 47.104.224.45 - 6379 - elink@888 + 114.215.125.123 + 9603 + epdc!redis@master1405 diff --git a/esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/config/WebServiceConfig.java b/esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/config/WebServiceConfig.java index c0cbba341..d032a46f5 100644 --- a/esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/config/WebServiceConfig.java +++ b/esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/config/WebServiceConfig.java @@ -10,23 +10,23 @@ import org.springframework.context.annotation.Configuration; import javax.xml.ws.Endpoint; /** - * @Description TODO + * @Description * @Author yinzuomei * @Date 2019/12/30 12:55 */ @Configuration public class WebServiceConfig { - @Autowired - private Bus bus; - @Autowired - private CityGridInterfaceServiceWebService cityGridInterfaceServiceWebService; + @Autowired + private Bus bus; + @Autowired + private CityGridInterfaceServiceWebService cityGridInterfaceServiceWebService; - @Bean - public Endpoint endpointUserService() { - EndpointImpl endpoint = new EndpointImpl(bus,cityGridInterfaceServiceWebService); - endpoint.publish("/CityGridInterfaceServiceWebService");//接口发布在 /CityGridInterfaceServiceWebService 目录下 - return endpoint; - } + @Bean + public Endpoint endpointUserService() { + EndpointImpl endpoint = new EndpointImpl(bus, cityGridInterfaceServiceWebService); + endpoint.publish("/CityGridInterfaceServiceWebService");//接口发布在 /CityGridInterfaceServiceWebService 目录下 + return endpoint; + } } diff --git a/esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/dto/form/TestDTO.java b/esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/dto/form/TestDTO.java index 6f9be79c7..e7419ce9f 100644 --- a/esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/dto/form/TestDTO.java +++ b/esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/dto/form/TestDTO.java @@ -6,20 +6,20 @@ import javax.xml.bind.annotation.*; import java.io.Serializable; /** - * @Description TODO + * @Description * @Author yinzuomei * @Date 2019/12/30 17:28 */ -@XmlRootElement(name="user") +@XmlRootElement(name = "user") @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "user",propOrder = {"userId","userName"}) +@XmlType(name = "user", propOrder = {"userId", "userName"}) @Data public class TestDTO implements Serializable { - private static final long serialVersionUID = 1677005211935252496L; - @XmlElement(name = "userId",required = true) - private String userId; - @XmlElement(name = "userName",required = true) - private String userName; + private static final long serialVersionUID = 1677005211935252496L; + @XmlElement(name = "userId", required = true) + private String userId; + @XmlElement(name = "userName", required = true) + private String userName; } diff --git a/esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/utils/JaxbUtil.java b/esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/utils/JaxbUtil.java index a834ed356..ab035fc97 100644 --- a/esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/utils/JaxbUtil.java +++ b/esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/utils/JaxbUtil.java @@ -1,7 +1,7 @@ package com.elink.esua.epdc.utils; /** - * @Description TODO + * @Description * @Author yinzuomei * @Date 2019/12/30 17:46 */ diff --git a/esua-epdc/epdc-module/epdc-websocket/epdc-websocket-server/pom.xml b/esua-epdc/epdc-module/epdc-websocket/epdc-websocket-server/pom.xml index 78ed92a3f..2fc5877bf 100644 --- a/esua-epdc/epdc-module/epdc-websocket/epdc-websocket-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-websocket/epdc-websocket-server/pom.xml @@ -177,9 +177,9 @@ 10016 2 - 47.104.224.45 - 6379 - elink@888 + 114.215.125.123 + 9603 + epdc!redis@master1405 diff --git a/esua-epdc/epdc-module/epdc-websocket/epdc-websocket-server/src/main/resources/logback-spring.xml b/esua-epdc/epdc-module/epdc-websocket/epdc-websocket-server/src/main/resources/logback-spring.xml index 5deef2105..255556f1e 100644 --- a/esua-epdc/epdc-module/epdc-websocket/epdc-websocket-server/src/main/resources/logback-spring.xml +++ b/esua-epdc/epdc-module/epdc-websocket/epdc-websocket-server/src/main/resources/logback-spring.xml @@ -1,21 +1,159 @@ - - - + + + + + + + + + + + + debug + + + ${CONSOLE_LOG_PATTERN} + + UTF-8 + + + + + + + + ${log.path}/debug.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/debug-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + debug + ACCEPT + DENY + + + + + + + ${log.path}/info.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/info-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + info + ACCEPT + DENY + + + + + + + ${log.path}/warn.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/warn-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + warn + ACCEPT + DENY + + + + + + + ${log.path}/error.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/error-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + ERROR + ACCEPT + DENY + + - - + + + + + + + + + - - - + + + + + + + + + + - \ No newline at end of file + diff --git a/esua-epdc/epdc-module/pom.xml b/esua-epdc/epdc-module/pom.xml index d3b43ea8a..a4518f1b9 100644 --- a/esua-epdc/epdc-module/pom.xml +++ b/esua-epdc/epdc-module/pom.xml @@ -26,6 +26,7 @@ epdc-group epdc-websocket epdc-kpi + epdc-points epdc-webservice epdc-custom epdc-analysis diff --git a/esua-epdc/k8s/kongcun/app-master/mysql/mysql-config.yml b/esua-epdc/k8s/kongcun/app-master/mysql/mysql-config.yml new file mode 100644 index 000000000..bec1eecf7 --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/mysql/mysql-config.yml @@ -0,0 +1,30 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: mysql-master-config + namespace: epdc-mysql + labels: + config: mysql-master-config +data: + mysqld.cnf: |- + [mysqld] + pid-file = /var/run/mysqld/mysqld.pid + socket = /var/run/mysqld/mysqld.sock + datadir = /var/lib/mysql + log-error = /var/log/mysql/error.log + # By default we only accept connections from localhost + # bind-address = 127.0.0.1 + # Disabling symbolic-links is recommended to prevent assorted security risks + symbolic-links=0 + sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' + # 允许最大连接数 + max_connections=200 + # 允许连接失败的次数。这是为了防止有人从该主机试图攻击数据库系统 + max_connect_errors=10 + # 创建新表时将使用的默认存储引擎 + default-storage-engine=INNODB + # 默认使用“mysql_native_password”插件认证 + default_authentication_plugin=mysql_native_password + server-id=164 + log-bin=master-bin + log-bin-index=master-bin.index diff --git a/esua-epdc/k8s/kongcun/app-master/mysql/mysql-deploy.yml b/esua-epdc/k8s/kongcun/app-master/mysql/mysql-deploy.yml new file mode 100644 index 000000000..fdabdc889 --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/mysql/mysql-deploy.yml @@ -0,0 +1,42 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mysql-master-deploy + namespace: epdc-mysql + labels: + deploy: mysql-master-deploy +spec: + replicas: 1 + selector: + matchLabels: + app: mysql-master-pod + template: + metadata: + labels: + app: mysql-master-pod + spec: + containers: + - name: mysql-master-container + image: mysql:8.0 + env: + - name: MYSQL_ROOT_PASSWORD #以下是设置MySQL数据库的密码 + valueFrom: + secretKeyRef: + name: mysql-master-secret + key: mysql-user-root-pwd + ports: + - containerPort: 3306 + protocol: TCP + name: mysql-master-tcp-3306 + volumeMounts: + - name: mysql-master-persistent-storage + mountPath: /var/lib/mysql #MySQL容器的数据都是存在这个目录的,要对这个目录做数据持久化 + - name: mysql-master-config-volume #表示一个挂载点的名称 + mountPath: /etc/mysql/mysql.conf.d/ #表示新挂载点的路径,这里就是mysql配置文件的路径 + volumes: + - name: mysql-master-persistent-storage + persistentVolumeClaim: + claimName: mysql-master-pvc #指定pvc的名称 + - name: mysql-master-config-volume #表示挂载点的名称 + configMap: #使用configmap + name: mysql-master-config diff --git a/esua-epdc/k8s/kongcun/app-master/mysql/mysql-pv.yml b/esua-epdc/k8s/kongcun/app-master/mysql/mysql-pv.yml new file mode 100644 index 000000000..18ff7b812 --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/mysql/mysql-pv.yml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: mysql-master-pv + namespace: epdc-mysql + labels: + pv: mysql-master-pv +spec: + accessModes: + - ReadWriteOnce #访问模式定义为只能以读写的方式挂载到单个节点 + capacity: + storage: 100Gi + persistentVolumeReclaimPolicy: Retain + storageClassName: nfs + nfs: + path: /mnt/nfsdata/mysql-master + server: 172.16.0.7 diff --git a/esua-epdc/k8s/kongcun/app-master/mysql/mysql-pvc.yml b/esua-epdc/k8s/kongcun/app-master/mysql/mysql-pvc.yml new file mode 100644 index 000000000..f3373ae78 --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/mysql/mysql-pvc.yml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: mysql-master-pvc + namespace: epdc-mysql + labels: + pvc: mysql-master-pvc +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Gi + storageClassName: managed-nfs-storage + selector: + matchLabels: + pv: mysql-master-pv diff --git a/esua-epdc/k8s/kongcun/app-master/mysql/mysql-secret.yml b/esua-epdc/k8s/kongcun/app-master/mysql/mysql-secret.yml new file mode 100644 index 000000000..404545628 --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/mysql/mysql-secret.yml @@ -0,0 +1,11 @@ +#键的值是经过base64编码的 +#在Linux里运行命令“echo -n dbuser | base64”获得“dbuser”的编码 +apiVersion: v1 +kind: Secret +metadata: + name: mysql-master-secret + namespace: epdc-mysql + labels: + secret: mysql-master-secret +data: + mysql-user-root-pwd: ZXBkY19rb25nY3VuQDE0MDU= diff --git a/esua-epdc/k8s/kongcun/app-master/mysql/mysql-svc.yml b/esua-epdc/k8s/kongcun/app-master/mysql/mysql-svc.yml new file mode 100644 index 000000000..70b104759 --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/mysql/mysql-svc.yml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: mysql-master-svc + namespace: epdc-mysql + labels: + svc: mysql-master-svc +spec: + type: NodePort + ports: + - port: 3306 + protocol: TCP + targetPort: 3306 + nodePort: 33306 + selector: + app: mysql-master-pod diff --git a/esua-epdc/k8s/kongcun/app-master/nacos/nacos-cm.yml b/esua-epdc/k8s/kongcun/app-master/nacos/nacos-cm.yml new file mode 100644 index 000000000..e36532865 --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/nacos/nacos-cm.yml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: nacos-cm + namespace: epdc-nacos +data: + mysql.master.db.name: "nacos_devtest" + mysql.master.port: "3306" + mysql.slave.port: "3306" + mysql.master.user: "nacos" + mysql.master.password: "nacos" diff --git a/esua-epdc/k8s/kongcun/app-master/nacos/nacos-pvc-nfs.yml b/esua-epdc/k8s/kongcun/app-master/nacos/nacos-pvc-nfs.yml new file mode 100644 index 000000000..ac857b09f --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/nacos/nacos-pvc-nfs.yml @@ -0,0 +1,132 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: nacos +spec: + serviceName: nacos-headless + replicas: 2 + template: + metadata: + labels: + app: nacos + annotations: + pod.alpha.kubernetes.io/initialized: "true" + spec: + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: "app" + operator: In + values: + - nacos + topologyKey: "kubernetes.io/hostname" + serviceAccountName: nfs-client-provisioner + initContainers: + - name: peer-finder-plugin-install + image: nacos/nacos-peer-finder-plugin:latest + imagePullPolicy: Always + volumeMounts: + - mountPath: "/home/nacos/plugins/peer-finder" + name: plugindir + containers: + - name: nacos + imagePullPolicy: Always + image: nacos/nacos-server:latest + resources: + requests: + memory: "2Gi" + cpu: "500m" + ports: + - containerPort: 8848 + name: client-port + env: + - name: NACOS_REPLICAS + value: "3" + - name: SERVICE_NAME + value: "nacos-headless" + - name: POD_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + - name: MYSQL_MASTER_SERVICE_DB_NAME + valueFrom: + configMapKeyRef: + name: nacos-cm + key: mysql.master.db.name + - name: MYSQL_MASTER_SERVICE_PORT + valueFrom: + configMapKeyRef: + name: nacos-cm + key: mysql.master.port + - name: MYSQL_SLAVE_SERVICE_PORT + valueFrom: + configMapKeyRef: + name: nacos-cm + key: mysql.slave.port + - name: MYSQL_MASTER_SERVICE_USER + valueFrom: + configMapKeyRef: + name: nacos-cm + key: mysql.master.user + - name: MYSQL_MASTER_SERVICE_PASSWORD + valueFrom: + configMapKeyRef: + name: nacos-cm + key: mysql.master.password + - name: NACOS_SERVER_PORT + value: "8848" + - name: PREFER_HOST_MODE + value: "hostname" + readinessProbe: + httpGet: + port: client-port + path: /nacos/v1/console/health/readiness + initialDelaySeconds: 60 + timeoutSeconds: 3 + livenessProbe: + httpGet: + port: client-port + path: /nacos/v1/console/health/liveness + initialDelaySeconds: 60 + timeoutSeconds: 3 + volumeMounts: + - name: plugindir + mountPath: /home/nacos/plugins/peer-finder + - name: datadir + mountPath: /home/nacos/data + - name: logdir + mountPath: /home/nacos/logs + volumeClaimTemplates: + - metadata: + name: plugindir + annotations: + volume.beta.kubernetes.io/storage-class: "managed-nfs-storage" + spec: + accessModes: [ "ReadWriteMany" ] + resources: + requests: + storage: 5Gi + - metadata: + name: datadir + annotations: + volume.beta.kubernetes.io/storage-class: "managed-nfs-storage" + spec: + accessModes: [ "ReadWriteMany" ] + resources: + requests: + storage: 5Gi + - metadata: + name: logdir + annotations: + volume.beta.kubernetes.io/storage-class: "managed-nfs-storage" + spec: + accessModes: [ "ReadWriteMany" ] + resources: + requests: + storage: 5Gi + selector: + matchLabels: + app: nacos diff --git a/esua-epdc/k8s/kongcun/app-master/nacos/nacos-svc.yml b/esua-epdc/k8s/kongcun/app-master/nacos/nacos-svc.yml new file mode 100644 index 000000000..ec1af420a --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/nacos/nacos-svc.yml @@ -0,0 +1,18 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: nacos-headless + namespace: epdc-nacos + labels: + app: nacos + annotations: + service.alpha.kubernetes.io/tolerate-unready-endpoints: "true" +spec: + ports: + - port: 8848 + name: server + targetPort: 8848 + clusterIP: None + selector: + app: nacos diff --git a/esua-epdc/k8s/kongcun/app-master/nfs/nfs-deployment.yml b/esua-epdc/k8s/kongcun/app-master/nfs/nfs-deployment.yml new file mode 100644 index 000000000..0b2efd137 --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/nfs/nfs-deployment.yml @@ -0,0 +1,35 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + name: nfs-client-provisioner +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app: nfs-client-provisioner + template: + metadata: + labels: + app: nfs-client-provisioner + spec: + serviceAccountName: nfs-client-provisioner + containers: + - name: nfs-client-provisioner + image: quay.io/external_storage/nfs-client-provisioner:latest + volumeMounts: + - name: nfs-client-root + mountPath: /persistentvolumes + env: + - name: PROVISIONER_NAME + value: fuseim.pri/ifs + - name: NFS_SERVER + value: 172.16.0.8 + - name: NFS_PATH + value: /mnt/nfs/data + volumes: + - name: nfs-client-root + nfs: + server: 172.16.0.8 + path: /mnt/nfs/data diff --git a/esua-epdc/k8s/kongcun/app-master/nfs/nfs-rbac.yml b/esua-epdc/k8s/kongcun/app-master/nfs/nfs-rbac.yml new file mode 100644 index 000000000..92c1e4718 --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/nfs/nfs-rbac.yml @@ -0,0 +1,42 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: nfs-client-provisioner + +--- + +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: nfs-client-provisioner-runner +rules: + - apiGroups: [""] + resources: ["persistentvolumes"] + verbs: ["get", "list", "watch", "create", "delete"] + - apiGroups: [""] + resources: ["persistentvolumeclaims"] + verbs: ["get", "list", "watch", "update"] + - apiGroups: ["storage.k8s.io"] + resources: ["storageclasses"] + verbs: ["get", "list", "watch"] + - apiGroups: [""] + resources: ["events"] + verbs: ["list", "watch", "create", "update", "patch"] + - apiGroups: [""] + resources: ["endpoints"] + verbs: ["create", "delete", "get", "list", "watch", "patch", "update"] + +--- + +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: run-nfs-client-provisioner +subjects: + - kind: ServiceAccount + name: nfs-client-provisioner + namespace: default +roleRef: + kind: ClusterRole + name: nfs-client-provisioner-runner + apiGroup: rbac.authorization.k8s.io diff --git a/esua-epdc/k8s/kongcun/app-master/nfs/storageclass-nfs.yml b/esua-epdc/k8s/kongcun/app-master/nfs/storageclass-nfs.yml new file mode 100644 index 000000000..d20235804 --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/nfs/storageclass-nfs.yml @@ -0,0 +1,5 @@ +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: course-nfs-storage +provisioner: fuseim.pri/ifs # or choose another name, must match deployment's env PROVISIONER_NAME' diff --git a/esua-epdc/k8s/kongcun/app-master/nginx/nginx-deploy.yml b/esua-epdc/k8s/kongcun/app-master/nginx/nginx-deploy.yml new file mode 100644 index 000000000..4d8ad1a38 --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/nginx/nginx-deploy.yml @@ -0,0 +1,41 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nginx-deploy + namespace: epdc-nginx + labels: + deploy: nginx-deploy +spec: + replicas: 1 + selector: + matchLabels: + app: nginx-pod + template: + metadata: + labels: + app: nginx-pod + spec: + containers: + - name: nginx-container + image: nginx + ports: + - containerPort: 443 + name: nginx-443 + volumeMounts: + - name: nginx-persistent-storage-01 + mountPath: /usr/share/nginx/html + - name: nginx-persistent-storage-02 + mountPath: /etc/nginx #MySQL容器的数据都是存在这个目录的,要对这个目录做数据持久化 + readOnly: true + - name: nginx-persistent-storage-03 #表示一个挂载点的名称 + mountPath: /var/log/nginx #表示新挂载点的路径,这里就是mysql配置文件的路径 + volumes: + - name: nginx-persistent-storage-01 + persistentVolumeClaim: + claimName: nginx-data-pvc #指定pvc的名称 + - name: nginx-persistent-storage-02 + persistentVolumeClaim: + claimName: nginx-etc-pvc + - name: nginx-persistent-storage-03 + persistentVolumeClaim: + claimName: nginx-log-pvc diff --git a/esua-epdc/k8s/kongcun/app-master/nginx/nginx-pv.yml b/esua-epdc/k8s/kongcun/app-master/nginx/nginx-pv.yml new file mode 100644 index 000000000..ed9c372ff --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/nginx/nginx-pv.yml @@ -0,0 +1,60 @@ +#nginx数据PV +apiVersion: v1 +kind: PersistentVolume +metadata: + name: nginx-data-pv + namespace: epdc-nginx + labels: + pv: nginx-data-pv +spec: + accessModes: + - ReadWriteOnce #访问模式定义为只能以读写的方式挂载到单个节点 + capacity: + storage: 2Gi + persistentVolumeReclaimPolicy: Retain + storageClassName: nfs + nfs: + path: /mnt/nfsdata/nginx/data + server: 172.16.0.7 + +--- + +#nginx配置PV +apiVersion: v1 +kind: PersistentVolume +metadata: + name: nginx-etc-pv + namespace: epdc-nginx + labels: + pv: nginx-etc-pv +spec: + accessModes: + - ReadWriteOnce #访问模式定义为只能以读写的方式挂载到单个节点 + capacity: + storage: 1Gi + persistentVolumeReclaimPolicy: Retain + storageClassName: nfs + nfs: + path: /mnt/nfsdata/nginx/etc + server: 172.16.0.7 + +--- + +#nginx日志PV +apiVersion: v1 +kind: PersistentVolume +metadata: + name: nginx-log-pv + namespace: epdc-nginx + labels: + pv: nginx-log-pv +spec: + accessModes: + - ReadWriteOnce #访问模式定义为只能以读写的方式挂载到单个节点 + capacity: + storage: 2Gi + persistentVolumeReclaimPolicy: Retain + storageClassName: nfs + nfs: + path: /mnt/nfsdata/nginx/log + server: 172.16.0.7 diff --git a/esua-epdc/k8s/kongcun/app-master/nginx/nginx-pvc.yml b/esua-epdc/k8s/kongcun/app-master/nginx/nginx-pvc.yml new file mode 100644 index 000000000..fa021eb1d --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/nginx/nginx-pvc.yml @@ -0,0 +1,61 @@ +#nginx数据PVC +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: nginx-data-pvc + namespace: epdc-nginx + labels: + pvc: nginx-data-pvc +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 2Gi + storageClassName: nfs + selector: + matchLabels: + pv: nginx-data-pv + +--- + +#nginx配置PVC +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: nginx-etc-pvc + namespace: epdc-nginx + labels: + pvc: nginx-etc-pvc +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + storageClassName: nfs + selector: + matchLabels: + pv: nginx-etc-pv + +--- + +#nginx日志PVC + +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: nginx-log-pvc + namespace: epdc-nginx + labels: + pvc: nginx-log-pvc +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 2Gi + storageClassName: nfs + selector: + matchLabels: + pv: nginx-log-pv diff --git a/esua-epdc/k8s/kongcun/app-master/nginx/nginx-svc.yml b/esua-epdc/k8s/kongcun/app-master/nginx/nginx-svc.yml new file mode 100644 index 000000000..af4cf986d --- /dev/null +++ b/esua-epdc/k8s/kongcun/app-master/nginx/nginx-svc.yml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: nginx-svc + namespace: epdc-nginx + labels: + svc: nginx-svc +spec: + type: NodePort + ports: + - port: 443 + protocol: TCP + targetPort: 443 + nodePort: 443 + selector: + app: mysql-master-pod diff --git a/esua-epdc/pom.xml b/esua-epdc/pom.xml index a1db4d450..aa4f0596b 100644 --- a/esua-epdc/pom.xml +++ b/esua-epdc/pom.xml @@ -17,27 +17,30 @@ epdc-commons - epdc-gateway + epdc-cloud-gateway-shibei epdc-auth epdc-admin epdc-module - UTF-8 - UTF-8 - 1.8 - Greenwich.RELEASE - 2.1.0.RELEASE - 2.7.0 1.1.1 - 2.0.3 - 0.8.0 47.104.85.99:9002 1.4.13 prod - registry-vpc.cn-qingdao.aliyuncs.com/esua-epdc-shibei/ + registry.cn-qingdao.aliyuncs.com/esua-epdc-shibei/ + 5.2.4 + 1.8 + UTF-8 + UTF-8 + 0.8.0 9508 + 2.0.3 + 2.1.1.RELEASE + + Greenwich.RELEASE + 2.1.0.RELEASE + 2.7.0 @@ -71,6 +74,18 @@ seata-all ${seata.version} + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + 2.1.1.RELEASE + + + + org.flywaydb + flyway-core + ${flyway-core.version} + @@ -99,6 +114,7 @@ ${docker.tag} + -Xmx256m -Xms256m -Xmn160m -Xss128k target/${project.build.finalName}.jar ${project.artifactId} ${server.port} @@ -110,22 +126,6 @@ - - - - - - - - - - - - - - - - elink-release aliyun nexus @@ -134,6 +134,14 @@ true + + centerl-release + centerl + https://repo1.maven.org/maven2/ + + true + + sonatype sonatype nexus diff --git a/renren-cloud-generator/src/main/resources/application.yml b/renren-cloud-generator/src/main/resources/application.yml index dc0f5909f..91fe3458c 100644 --- a/renren-cloud-generator/src/main/resources/application.yml +++ b/renren-cloud-generator/src/main/resources/application.yml @@ -9,7 +9,7 @@ spring: type: com.alibaba.druid.pool.DruidDataSource #MySQL配置 driverClassName: com.mysql.jdbc.Driver - url: jdbc:mysql://47.104.224.45:3308/esua_epdc_group?useUnicode=true&characterEncoding=UTF-8&useSSL=false + url: jdbc:mysql://47.104.224.45:3308/esua_epdc_kpi?useUnicode=true&characterEncoding=UTF-8&useSSL=false username: epdc password: elink833066 #oracle配置