From 8c2cc9a47f27e507c510ef9984c384cba4a0ff81 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 8 Jul 2020 12:31:49 +0800 Subject: [PATCH 01/98] =?UTF-8?q?=E6=96=B0=E5=A2=9Eepmet-heart=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/constant/ServiceConstant.java | 5 + epmet-gateway/pom.xml | 7 + .../src/main/resources/bootstrap.yml | 17 +- .../epmet-heart/epmet-heart-client/pom.xml | 35 ++++ .../src/main/java/com/epmet/dto/form/.gitkeep | 0 .../main/java/com/epmet/dto/result/.gitkeep | 0 .../feign/EpmetHeartOpenFeignClient.java | 15 ++ .../EpmetHeartOpenFeignClientFallback.java | 14 ++ .../epmet-heart/epmet-heart-server/Dockerfile | 11 + .../deploy/docker-compose-dev.yml | 17 ++ .../deploy/docker-compose-prod.yml | 17 ++ .../deploy/docker-compose-test.yml | 17 ++ .../epmet-heart/epmet-heart-server/pom.xml | 190 ++++++++++++++++++ .../java/com/epmet/EpmetHeartApplication.java | 31 +++ .../com/epmet/aspect/RequestLogAspect.java | 40 ++++ .../com/epmet/config/ModuleConfigImpl.java | 26 +++ .../java/com/epmet/config/SwaggerConfig.java | 68 +++++++ .../main/java/com/epmet/controller/.gitkeep | 0 .../com/epmet/controller/TestController.java | 37 ++++ .../src/main/java/com/epmet/dao/.gitkeep | 0 .../src/main/java/com/epmet/entity/.gitkeep | 0 .../src/main/java/com/epmet/excel/.gitkeep | 0 .../com/epmet/exception/ModuleErrorCode.java | 25 +++ .../src/main/java/com/epmet/redis/.gitkeep | 0 .../src/main/java/com/epmet/service/.gitkeep | 0 .../java/com/epmet/utils/ModuleConstant.java | 21 ++ .../src/main/resources/bootstrap.yml | 119 +++++++++++ .../resources/db/migration/V0.0.1__demo.sql | 1 + .../src/main/resources/logback-spring.xml | 164 +++++++++++++++ .../src/main/resources/mapper/.gitkeep | 0 epmet-module/epmet-heart/pom.xml | 21 ++ epmet-module/pom.xml | 1 + 32 files changed, 897 insertions(+), 2 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/pom.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/.gitkeep create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/.gitkeep create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/Dockerfile create mode 100644 epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-prod.yml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-test.yml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/pom.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/EpmetHeartApplication.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/aspect/RequestLogAspect.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/config/ModuleConfigImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/config/SwaggerConfig.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/.gitkeep create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/TestController.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/.gitkeep create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/.gitkeep create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/.gitkeep create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/exception/ModuleErrorCode.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/.gitkeep create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/.gitkeep create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ModuleConstant.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.1__demo.sql create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/logback-spring.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/.gitkeep create mode 100644 epmet-module/epmet-heart/pom.xml diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java index 0b1295ab88..db5c2bdd90 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java @@ -118,4 +118,9 @@ public interface ServiceConstant { * 数据统计 */ String DATA_STATISTICAL_SERVER = "data-statistical-server"; + + /** + * 爱心互助 + */ + String EPMET_HEART_SERVER="epmet-heart-server"; } diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index c7b9d62cb6..1f253efe21 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -185,6 +185,9 @@ lb://epmet-openapi-scan + + lb://epmet-heart-server + @@ -267,6 +270,8 @@ lb://data-statistical-server lb://epmet-openapi-scan + + lb://epmet-heart-server @@ -346,6 +351,8 @@ lb://data-statistical-server lb://epmet-openapi-scan + + lb://epmet-heart-server diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index 4d910e0f02..fd44dac5b1 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -280,12 +280,21 @@ spring: #内容审核服务 - id: epmet-openapi-scan uri: @gateway.routes.epmet-openapi-scan.uri@ - order: 29 + order: 30 predicates: - Path=${server.servlet.context-path}/epmetscan/** filters: - StripPrefix=1 - CpAuth=true + # 爱心互助 + - id: epmet-heart-server + uri: @gateway.routes.epmet-heart-server.url@ + order: 31 + predicates: + - Path=${server.servlet.context-path}/heart/** + filters: + - StripPrefix=1 + - CpAuth=true nacos: discovery: server-addr: @nacos.server-addr@ @@ -379,7 +388,7 @@ ribbon: ConnectTimeout: 300000 epmet: - # 党群e事通(不放行) + # 党群e事通(校验是否登录) urls: - /oper/customize/** - /oper/crm/** @@ -400,6 +409,10 @@ epmet: - /gov/issue/** - /gov/project/** - /resi/home/** + - /gov/voice/** + - /resi/voice/** + - /data/report/** + - /heart/** swaggerUrls: jwt: diff --git a/epmet-module/epmet-heart/epmet-heart-client/pom.xml b/epmet-module/epmet-heart/epmet-heart-client/pom.xml new file mode 100644 index 0000000000..8701e1a09d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/pom.xml @@ -0,0 +1,35 @@ + + + 4.0.0 + + + com.epmet + epmet-heart + 2.0.0 + + + epmet-heart-client + jar + + + + com.epmet + epmet-commons-tools + 2.0.0 + + + io.springfox + springfox-swagger2 + + + io.springfox + springfox-swagger-ui + + + + + ${project.artifactId} + + + diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/.gitkeep b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/.gitkeep b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java new file mode 100644 index 0000000000..a11aab31c2 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java @@ -0,0 +1,15 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:25 + */ +@FeignClient(name = ServiceConstant.EPMET_HEART_SERVER, fallback = EpmetHeartOpenFeignClientFallback.class) +public interface EpmetHeartOpenFeignClient { +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java new file mode 100644 index 0000000000..0dc4701b4b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java @@ -0,0 +1,14 @@ +package com.epmet.feign.fallback; + +import com.epmet.feign.EpmetHeartOpenFeignClient; +import org.springframework.stereotype.Component; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:26 + */ +@Component +public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignClient { +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/Dockerfile b/epmet-module/epmet-heart/epmet-heart-server/Dockerfile new file mode 100644 index 0000000000..696964e45a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/Dockerfile @@ -0,0 +1,11 @@ +FROM java:8 + +RUN export LANG="zh_CN.UTF-8" +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo 'Asia/Shanghai' > /etc/timezone + +COPY ./target/*.jar ./app.jar + +EXPOSE 8090 + +ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml new file mode 100644 index 0000000000..f26cbd716e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + oper-crm-server: + container_name: epmet-heart-server-dev + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-heart-server:0.0.1 + ports: + - "8111:8111" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/dev:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 250M \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-prod.yml new file mode 100644 index 0000000000..8a981b9839 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-prod.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + oper-crm-server: + container_name: epmet-heart-server-prod + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-heart-server:0.0.1 + ports: + - "8111:8111" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/prod:/logs" + environment: + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 600M \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-test.yml b/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-test.yml new file mode 100644 index 0000000000..7e11fabd04 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-test.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + oper-crm-server: + container_name: epmet-heart-server-test + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-heart-server:0.0.1 + ports: + - "8111:8111" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/test:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 250M \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/pom.xml b/epmet-module/epmet-heart/epmet-heart-server/pom.xml new file mode 100644 index 0000000000..3c200a6622 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/pom.xml @@ -0,0 +1,190 @@ + + + 4.0.0 + 0.0.1 + + com.epmet + epmet-heart + 2.0.0 + + epmet-heart-server + jar + + + + com.epmet + epmet-heart-client + 2.0.0 + + + com.epmet + epmet-commons-tools + 2.0.0 + + + com.epmet + epmet-commons-mybatis + 2.0.0 + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework + spring-context-support + + + org.springframework.boot + spring-boot-starter-actuator + + + de.codecentric + spring-boot-admin-starter-client + ${spring.boot.admin.version} + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + io.github.openfeign + feign-httpclient + 10.3.0 + + + com.epmet + epmet-common-clienttoken + 2.0.0 + compile + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + ${project.basedir}/src/main/java + + + true + ${basedir}/src/main/resources + + + + + + dev + + true + + + 8111 + dev + + + + + + epmet_heart_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 122.152.200.70:8848 + fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + + + false + + + false + + + + test + + + 8111 + test + + + + + + epmet + elink@833066 + + 0 + r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com + 6379 + EpmEtrEdIs!q@w + + true + 192.168.10.150:8848 + 67e3c350-533e-4d7c-9f8f-faf1b4aa82ae + + + false + + + true + + + + prod + + + 8111 + test + + + + + + epmet_heart_user + EpmEt-db-UsEr + + 0 + r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com + 6379 + EpmEtclOUdrEdIs!Q2w + + true + 192.168.11.180:8848 + bd205d23-e696-47be-b995-916313f86e99 + + + false + + + true + + + + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/EpmetHeartApplication.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/EpmetHeartApplication.java new file mode 100644 index 0000000000..39fd7584e1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/EpmetHeartApplication.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; + +/** + * 模块 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@SpringBootApplication +@EnableDiscoveryClient +@EnableFeignClients +public class EpmetHeartApplication { + + public static void main(String[] args) { + SpringApplication.run(EpmetHeartApplication.class, args); + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/aspect/RequestLogAspect.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/aspect/RequestLogAspect.java new file mode 100644 index 0000000000..49581cf63c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/aspect/RequestLogAspect.java @@ -0,0 +1,40 @@ +package com.epmet.aspect; + +import com.epmet.commons.tools.aspect.BaseRequestLogAspect; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; + +/** + * 日志/异常处理切面实现,调用父类方法完成日志记录和异常处理。 + */ +@Aspect +@Component +@Order(0) +public class RequestLogAspect extends BaseRequestLogAspect { + + @Override + @Around(value = "execution(* com.epmet.controller.*Controller*.*(..)) ") + public Object proceed(ProceedingJoinPoint point) throws Throwable { + return super.proceed(point, getRequest()); + } + + /** + * 获取Request对象 + * + * @return + */ + private HttpServletRequest getRequest() { + RequestAttributes ra = RequestContextHolder.getRequestAttributes(); + ServletRequestAttributes sra = (ServletRequestAttributes) ra; + return sra.getRequest(); + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/config/ModuleConfigImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/config/ModuleConfigImpl.java new file mode 100644 index 0000000000..1fcce2b65b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/config/ModuleConfigImpl.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.config; + +import com.epmet.commons.tools.config.ModuleConfig; +import org.springframework.stereotype.Service; + +/** + * 模块配置信息 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class ModuleConfigImpl implements ModuleConfig { + @Override + public String getName() { + return "heart"; + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/config/SwaggerConfig.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/config/SwaggerConfig.java new file mode 100644 index 0000000000..262f1bc07b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/config/SwaggerConfig.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.config; + +import com.epmet.commons.tools.constant.Constant; +import io.swagger.annotations.ApiOperation; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.ApiKey; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +import java.util.List; + +import static com.google.common.collect.Lists.newArrayList; + +/** + * Swagger配置 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Configuration +@EnableSwagger2 +public class SwaggerConfig implements WebMvcConfigurer { + + @Bean + public Docket createRestApi() { + return new Docket(DocumentationType.SWAGGER_2) + .apiInfo(apiInfo()) + .select() + //加了ApiOperation注解的类,才生成接口文档 + .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) + .paths(PathSelectors.any()) + .build() + .directModelSubstitute(java.util.Date.class, String.class) + .securitySchemes(security()); + + } + + private ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title("人人开源") + .description("模块接口文档") + .termsOfServiceUrl("https://www.renren.io") + .version("1.1.0") + .build(); + } + + private List security() { + return newArrayList( + new ApiKey(Constant.TOKEN_HEADER, Constant.TOKEN_HEADER, "header") + ); + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/.gitkeep b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/TestController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/TestController.java new file mode 100644 index 0000000000..773e645d2c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/TestController.java @@ -0,0 +1,37 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.Result; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +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.HashMap; +import java.util.Map; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/8 11:03 + */ +@RestController +@RequestMapping("demo") +public class TestController { + private Logger logger = LogManager.getLogger(TestController.class); + @Autowired + private LoginUserUtil loginUserUtil; + @GetMapping("test") + public Result test(@LoginUser TokenDto tokenDto){ + Map map=new HashMap<>(); + String userId=loginUserUtil.getLoginUserId(); + map.put("TokenDto", tokenDto); + map.put("userId",userId); + return new Result().ok(map); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/.gitkeep b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/.gitkeep b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/.gitkeep b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/exception/ModuleErrorCode.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/exception/ModuleErrorCode.java new file mode 100644 index 0000000000..1206c71b9a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/exception/ModuleErrorCode.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.exception; + + +import com.epmet.commons.tools.exception.ErrorCode; + +/** + * 模块错误编码,由9位数字组成,前6位为模块编码,后3位为业务编码 + *

+ * 如:100001001(100001代表模块,001代表业务代码) + *

+ * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface ModuleErrorCode extends ErrorCode { + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/.gitkeep b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/.gitkeep b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ModuleConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ModuleConstant.java new file mode 100644 index 0000000000..d9f96aa25d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ModuleConstant.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.utils; + +import com.epmet.commons.tools.constant.Constant; + +/** + * 模块常量 + * + * @author Mark sunlightcs@gmail.com + * @since 1.1.0 + */ +public interface ModuleConstant extends Constant { + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml new file mode 100644 index 0000000000..f1b4e09318 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml @@ -0,0 +1,119 @@ +server: + port: @server.port@ + servlet: + context-path: /heart + +spring: + main: + allow-bean-definition-overriding: true + application: + name: epmet-heart-server + #环境 dev|test|prod + profiles: + active: dev + jackson: + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + redis: + database: @spring.redis.index@ + host: @spring.redis.host@ + port: @spring.redis.port@ + password: @spring.redis.password@ + timeout: 30s + datasource: + druid: + #MySQL + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.url@ + username: @datasource.druid.username@ + password: @datasource.druid.password@ + cloud: + nacos: + discovery: + server-addr: @nacos.server-addr@ + #nacos的命名空间ID,默认是public + namespace: @nacos.discovery.namespace@ + #不把自己注册到注册中心的地址 + register-enabled: @nacos.register-enabled@ + ip: @nacos.ip@ + config: + enabled: @nacos.config-enabled@ + server-addr: @nacos.server-addr@ + namespace: @nacos.config.namespace@ + group: @nacos.config.group@ + file-extension: yaml + #指定共享配置,且支持动态刷新 + # ext-config: + # - data-id: datasource.yaml + # group: ${spring.cloud.nacos.config.group} + # refresh: true + # - data-id: common.yaml + # group: ${spring.cloud.nacos.config.group} + # refresh: true + + # 数据迁移工具flyway + flyway: + enabled: false + locations: classpath:db/migration + url: @datasource.druid.url@ + user: @datasource.druid.username@ + password: @datasource.druid.password@ + baseline-on-migrate: true + baseline-version: 0 + +management: + endpoints: + web: + exposure: + include: "*" + endpoint: + health: + show-details: ALWAYS + +mybatis-plus: + mapper-locations: classpath:/mapper/**/*.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: com.epmet.entity + global-config: + #数据库相关配置 + db-config: + #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; + id-type: INPUT + #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" + field-strategy: NOT_NULL + #驼峰下划线转换 + column-underline: true + banner: false + #原生配置 + configuration: + map-underscore-to-camel-case: true + cache-enabled: false + call-setters-on-nulls: true + jdbc-type-for-null: 'null' + +feign: + hystrix: + enabled: true + client: + config: + default: + loggerLevel: BASIC + httpclient: + enabled: true + +hystrix: + command: + default: + execution: + isolation: + thread: + timeoutInMilliseconds: 60000 #缺省为1000 + +ribbon: + ReadTimeout: 300000 + ConnectTimeout: 300000 + +#pageHelper分页插件 +pagehelper: + helper-dialect: mysql + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.1__demo.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.1__demo.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.1__demo.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..512e302761 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/logback-spring.xml @@ -0,0 +1,164 @@ + + + + + + + + + + ${appname} + + + + + + + + + debug + + + ${CONSOLE_LOG_PATTERN} + + UTF-8 + + + + + + + + ${log.path}/debug.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%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} [%contextName] [%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} [%contextName] [%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} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/error-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + ERROR + ACCEPT + DENY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/.gitkeep b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-heart/pom.xml b/epmet-module/epmet-heart/pom.xml new file mode 100644 index 0000000000..34f68f6e5b --- /dev/null +++ b/epmet-module/epmet-heart/pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + + + com.epmet + epmet-module + 2.0.0 + + + com.epmet + epmet-heart + pom + + + epmet-heart-client + epmet-heart-server + + + diff --git a/epmet-module/pom.xml b/epmet-module/pom.xml index aa37ab3129..beb48a2e31 100644 --- a/epmet-module/pom.xml +++ b/epmet-module/pom.xml @@ -39,6 +39,7 @@ resi-voice data-statistical data-report + epmet-heart From 8d59d07d3c432dd36fe1649e9d25fbde407d6703 Mon Sep 17 00:00:00 2001 From: wangchao Date: Fri, 10 Jul 2020 09:57:39 +0800 Subject: [PATCH 02/98] =?UTF-8?q?=E7=A7=AF=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/constant/ServiceConstant.java | 5 + epmet-gateway/pom.xml | 7 + .../src/main/resources/bootstrap.yml | 10 + .../feign/EpmetHeartOpenFeignClient.java | 2 +- .../epmet-point/epmet-point-client/pom.xml | 37 ++++ .../src/main/java/dto/form/.gitkeep | 0 .../src/main/java/dto/result/.gitkeep | 0 .../java/feign/EpmetPointOpenFeignClient.java | 15 ++ .../EpmetPointOpenFeignClientFallback.java | 14 ++ .../epmet-point/epmet-point-server/Dockerfile | 11 + .../deploy/docker-compose-dev.yml | 17 ++ .../deploy/docker-compose-prod.yml | 17 ++ .../deploy/docker-compose-test.yml | 17 ++ .../epmet-point/epmet-point-server/pom.xml | 190 ++++++++++++++++++ .../java/com/epmet/EpmetPointApplication.java | 22 ++ .../com/epmet/aspect/RequestLogAspect.java | 40 ++++ .../com/epmet/config/ModuleConfigImpl.java | 25 +++ .../com/epmet/controller/TestController.java | 46 +++++ .../src/main/java/com/epmet/dao/.gitkeep | 0 .../src/main/java/com/epmet/entity/.gitkeep | 0 .../src/main/java/com/epmet/excel/.gitkeep | 0 .../com/epmet/exception/ModuleErrorCode.java | 25 +++ .../src/main/java/com/epmet/redis/.gitkeep | 0 .../src/main/java/com/epmet/service/.gitkeep | 0 .../java/com/epmet/utils/ModuleConstant.java | 21 ++ .../src/main/resources/.gitkeep | 0 .../src/main/resources/bootstrap.yml | 119 +++++++++++ .../resources/db/migration/V0.0.1__demo.sql | 1 + .../src/main/resources/logback-spring.xml | 164 +++++++++++++++ .../src/main/resources/mapper/.gitkeep | 0 epmet-module/epmet-point/pom.xml | 22 ++ epmet-module/pom.xml | 3 +- 32 files changed, 828 insertions(+), 2 deletions(-) create mode 100644 epmet-module/epmet-point/epmet-point-client/pom.xml create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/dto/form/.gitkeep create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/dto/result/.gitkeep create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/feign/EpmetPointOpenFeignClient.java create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/feign/fallback/EpmetPointOpenFeignClientFallback.java create mode 100644 epmet-module/epmet-point/epmet-point-server/Dockerfile create mode 100644 epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml create mode 100644 epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-prod.yml create mode 100644 epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-test.yml create mode 100644 epmet-module/epmet-point/epmet-point-server/pom.xml create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/EpmetPointApplication.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/aspect/RequestLogAspect.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/ModuleConfigImpl.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/TestController.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/.gitkeep create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/.gitkeep create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/.gitkeep create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/exception/ModuleErrorCode.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/redis/.gitkeep create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/.gitkeep create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/utils/ModuleConstant.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/resources/.gitkeep create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/V0.0.1__demo.sql create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/resources/logback-spring.xml create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/.gitkeep create mode 100644 epmet-module/epmet-point/pom.xml diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java index db5c2bdd90..9e73b1a49f 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java @@ -123,4 +123,9 @@ public interface ServiceConstant { * 爱心互助 */ String EPMET_HEART_SERVER="epmet-heart-server"; + + /** + * 积分银行 + * */ + String EPMET_POINT_SERVER = "epmet-point-server"; } diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index 1f253efe21..edb6deb03d 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -188,6 +188,9 @@ lb://epmet-heart-server + + lb://epmet-point-server + @@ -272,6 +275,8 @@ lb://epmet-openapi-scan lb://epmet-heart-server + + http://127.0.0.1:8112 @@ -353,6 +358,8 @@ lb://epmet-openapi-scan lb://epmet-heart-server + + http://127.0.0.1:8112 diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index fd44dac5b1..17a6252b9f 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -295,6 +295,15 @@ spring: filters: - StripPrefix=1 - CpAuth=true + # 积分银行 + - id: epmet-point-server + uri: @gateway.routes.epmet-point-server.url@ + order: 32 + predicates: + - Path=${server.servlet.context-path}/point/** + filters: + - StripPrefix=1 + - CpAuth=true nacos: discovery: server-addr: @nacos.server-addr@ @@ -413,6 +422,7 @@ epmet: - /resi/voice/** - /data/report/** - /heart/** + - /point/** swaggerUrls: jwt: diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java index a11aab31c2..85a0f088e0 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java @@ -10,6 +10,6 @@ import org.springframework.cloud.openfeign.FeignClient; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:25 */ -@FeignClient(name = ServiceConstant.EPMET_HEART_SERVER, fallback = EpmetHeartOpenFeignClientFallback.class) +@FeignClient(name = ServiceConstant.EPMET_POINT_SERVER, fallback = EpmetHeartOpenFeignClientFallback.class) public interface EpmetHeartOpenFeignClient { } diff --git a/epmet-module/epmet-point/epmet-point-client/pom.xml b/epmet-module/epmet-point/epmet-point-client/pom.xml new file mode 100644 index 0000000000..c43496fa40 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/pom.xml @@ -0,0 +1,37 @@ + + + 4.0.0 + + + epmet-point + com.epmet + 2.0.0 + + + epmet-point-client + jar + + + + com.epmet + epmet-commons-tools + 2.0.0 + + + io.springfox + springfox-swagger2 + + + io.springfox + springfox-swagger-ui + + + + + ${project.artifactId} + + + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/dto/form/.gitkeep b/epmet-module/epmet-point/epmet-point-client/src/main/java/dto/form/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/dto/result/.gitkeep b/epmet-module/epmet-point/epmet-point-client/src/main/java/dto/result/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/feign/EpmetPointOpenFeignClient.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/feign/EpmetPointOpenFeignClient.java new file mode 100644 index 0000000000..34d20263a2 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/feign/EpmetPointOpenFeignClient.java @@ -0,0 +1,15 @@ +package feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import feign.fallback.EpmetPointOpenFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author wangc + * @date 2020/7/9 13:25 + */ +@FeignClient(name = ServiceConstant.EPMET_HEART_SERVER, fallback = EpmetPointOpenFeignClientFallback.class) +public interface EpmetPointOpenFeignClient { +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/feign/fallback/EpmetPointOpenFeignClientFallback.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/feign/fallback/EpmetPointOpenFeignClientFallback.java new file mode 100644 index 0000000000..164d7256d1 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/feign/fallback/EpmetPointOpenFeignClientFallback.java @@ -0,0 +1,14 @@ +package feign.fallback; + +import feign.EpmetPointOpenFeignClient; +import org.springframework.stereotype.Component; + +/** + * @Description + * @ClassName EpmetPointOpenFeignClient + * @Auth wangc + * @Date 2020-07-10 09:14 + */ +@Component +public class EpmetPointOpenFeignClientFallback implements EpmetPointOpenFeignClient { +} diff --git a/epmet-module/epmet-point/epmet-point-server/Dockerfile b/epmet-module/epmet-point/epmet-point-server/Dockerfile new file mode 100644 index 0000000000..696964e45a --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/Dockerfile @@ -0,0 +1,11 @@ +FROM java:8 + +RUN export LANG="zh_CN.UTF-8" +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo 'Asia/Shanghai' > /etc/timezone + +COPY ./target/*.jar ./app.jar + +EXPOSE 8090 + +ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml new file mode 100644 index 0000000000..60480da477 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + oper-crm-server: + container_name: epmet-point-server-dev + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-point-server:0.0.1 + ports: + - "8112:8112" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/dev:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 250M \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-prod.yml new file mode 100644 index 0000000000..a53ebe7fe4 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-prod.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + oper-crm-server: + container_name: epmet-point-server-prod + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-point-server:0.0.1 + ports: + - "8112:8112" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/prod:/logs" + environment: + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 600M \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-test.yml b/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-test.yml new file mode 100644 index 0000000000..42c92bd168 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-test.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + oper-crm-server: + container_name: epmet-point-server-test + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-point-server:0.0.1 + ports: + - "8112:8112" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/test:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 250M \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/pom.xml b/epmet-module/epmet-point/epmet-point-server/pom.xml new file mode 100644 index 0000000000..780c5f7382 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/pom.xml @@ -0,0 +1,190 @@ + + + 4.0.0 + 0.0.1 + + epmet-point + com.epmet + 2.0.0 + + + + epmet-point-server + jar + + + + + com.epmet + epmet-commons-tools + 2.0.0 + + + com.epmet + epmet-commons-mybatis + 2.0.0 + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework + spring-context-support + + + org.springframework.boot + spring-boot-starter-actuator + + + de.codecentric + spring-boot-admin-starter-client + ${spring.boot.admin.version} + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + io.github.openfeign + feign-httpclient + 10.3.0 + + + com.epmet + epmet-common-clienttoken + 2.0.0 + compile + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + ${project.basedir}/src/main/java + + + true + ${basedir}/src/main/resources + + + + + + dev + + true + + + 8112 + dev + + + + + + epmet_point_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 122.152.200.70:8848 + fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + + + false + + + false + + + + test + + + 8112 + test + + + + + + epmet + elink@833066 + + 0 + r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com + 6379 + EpmEtrEdIs!q@w + + true + 192.168.10.150:8848 + 67e3c350-533e-4d7c-9f8f-faf1b4aa82ae + + + false + + + true + + + + prod + + + 8112 + test + + + + + + epmet_point_user + EpmEt-db-UsEr + + 0 + r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com + 6379 + EpmEtclOUdrEdIs!Q2w + + true + 192.168.11.180:8848 + bd205d23-e696-47be-b995-916313f86e99 + + + false + + + true + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/EpmetPointApplication.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/EpmetPointApplication.java new file mode 100644 index 0000000000..4b8eeb035d --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/EpmetPointApplication.java @@ -0,0 +1,22 @@ +package com.epmet; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; + +/** + * 模块 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@SpringBootApplication +@EnableDiscoveryClient +@EnableFeignClients +public class EpmetPointApplication { + public static void main(String[] args) { + SpringApplication.run(EpmetPointApplication.class, args); + } + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/aspect/RequestLogAspect.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/aspect/RequestLogAspect.java new file mode 100644 index 0000000000..49581cf63c --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/aspect/RequestLogAspect.java @@ -0,0 +1,40 @@ +package com.epmet.aspect; + +import com.epmet.commons.tools.aspect.BaseRequestLogAspect; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; + +/** + * 日志/异常处理切面实现,调用父类方法完成日志记录和异常处理。 + */ +@Aspect +@Component +@Order(0) +public class RequestLogAspect extends BaseRequestLogAspect { + + @Override + @Around(value = "execution(* com.epmet.controller.*Controller*.*(..)) ") + public Object proceed(ProceedingJoinPoint point) throws Throwable { + return super.proceed(point, getRequest()); + } + + /** + * 获取Request对象 + * + * @return + */ + private HttpServletRequest getRequest() { + RequestAttributes ra = RequestContextHolder.getRequestAttributes(); + ServletRequestAttributes sra = (ServletRequestAttributes) ra; + return sra.getRequest(); + } + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/ModuleConfigImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/ModuleConfigImpl.java new file mode 100644 index 0000000000..0b59fee9ab --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/ModuleConfigImpl.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ +package com.epmet.config; + +import com.epmet.commons.tools.config.ModuleConfig; +import org.springframework.stereotype.Service; + +/** + * 模块配置信息 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class ModuleConfigImpl implements ModuleConfig { + @Override + public String getName() { + return "point"; + } +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/TestController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/TestController.java new file mode 100644 index 0000000000..e35f3820d4 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/TestController.java @@ -0,0 +1,46 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.Result; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; + +import java.util.HashMap; +import java.util.Map; + +/** + * @Description + * @ClassName TestController + * @Auth wangc + * @Date 2020-07-10 09:27 + */ + +@Controller +@RequestMapping("demo") +public class TestController { + private Logger logger = LogManager.getLogger(TestController.class); + @Autowired + private LoginUserUtil loginUserUtil; + @GetMapping("test") + public Result test(@LoginUser TokenDto tokenDto){ + Map map=new HashMap<>(); + String userId=loginUserUtil.getLoginUserId(); + map.put("TokenDto", tokenDto); + map.put("userId",userId); + return new Result().ok(map); + } + @GetMapping("testlocalhost") + public Result testLocalhost(){ + logger.info("========================================="); + Result result = new Result(); + result.setData("success"); + return result; + } +} + diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/.gitkeep b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/.gitkeep b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/.gitkeep b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/exception/ModuleErrorCode.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/exception/ModuleErrorCode.java new file mode 100644 index 0000000000..1206c71b9a --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/exception/ModuleErrorCode.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.exception; + + +import com.epmet.commons.tools.exception.ErrorCode; + +/** + * 模块错误编码,由9位数字组成,前6位为模块编码,后3位为业务编码 + *

+ * 如:100001001(100001代表模块,001代表业务代码) + *

+ * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface ModuleErrorCode extends ErrorCode { + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/redis/.gitkeep b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/redis/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/.gitkeep b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/utils/ModuleConstant.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/utils/ModuleConstant.java new file mode 100644 index 0000000000..d9f96aa25d --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/utils/ModuleConstant.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.utils; + +import com.epmet.commons.tools.constant.Constant; + +/** + * 模块常量 + * + * @author Mark sunlightcs@gmail.com + * @since 1.1.0 + */ +public interface ModuleConstant extends Constant { + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/.gitkeep b/epmet-module/epmet-point/epmet-point-server/src/main/resources/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml new file mode 100644 index 0000000000..06e24d34cc --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml @@ -0,0 +1,119 @@ +server: + port: @server.port@ + servlet: + context-path: /point + +spring: + main: + allow-bean-definition-overriding: true + application: + name: epmet-point-server + #环境 dev|test|prod + profiles: + active: dev + jackson: + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + redis: + database: @spring.redis.index@ + host: @spring.redis.host@ + port: @spring.redis.port@ + password: @spring.redis.password@ + timeout: 30s + datasource: + druid: + #MySQL + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.url@ + username: @datasource.druid.username@ + password: @datasource.druid.password@ + cloud: + nacos: + discovery: + server-addr: @nacos.server-addr@ + #nacos的命名空间ID,默认是public + namespace: @nacos.discovery.namespace@ + #不把自己注册到注册中心的地址 + register-enabled: @nacos.register-enabled@ + ip: @nacos.ip@ + config: + enabled: @nacos.config-enabled@ + server-addr: @nacos.server-addr@ + namespace: @nacos.config.namespace@ + group: @nacos.config.group@ + file-extension: yaml + #指定共享配置,且支持动态刷新 + # ext-config: + # - data-id: datasource.yaml + # group: ${spring.cloud.nacos.config.group} + # refresh: true + # - data-id: common.yaml + # group: ${spring.cloud.nacos.config.group} + # refresh: true + + # 数据迁移工具flyway + flyway: + enabled: false + locations: classpath:db/migration + url: @datasource.druid.url@ + user: @datasource.druid.username@ + password: @datasource.druid.password@ + baseline-on-migrate: true + baseline-version: 0 + +management: + endpoints: + web: + exposure: + include: "*" + endpoint: + health: + show-details: ALWAYS + +mybatis-plus: + mapper-locations: classpath:/mapper/**/*.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: com.epmet.entity + global-config: + #数据库相关配置 + db-config: + #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; + id-type: INPUT + #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" + field-strategy: NOT_NULL + #驼峰下划线转换 + column-underline: true + banner: false + #原生配置 + configuration: + map-underscore-to-camel-case: true + cache-enabled: false + call-setters-on-nulls: true + jdbc-type-for-null: 'null' + +feign: + hystrix: + enabled: true + client: + config: + default: + loggerLevel: BASIC + httpclient: + enabled: true + +hystrix: + command: + default: + execution: + isolation: + thread: + timeoutInMilliseconds: 60000 #缺省为1000 + +ribbon: + ReadTimeout: 300000 + ConnectTimeout: 300000 + +#pageHelper分页插件 +pagehelper: + helper-dialect: mysql + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/V0.0.1__demo.sql b/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/V0.0.1__demo.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/V0.0.1__demo.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..e862b078ef --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/logback-spring.xml @@ -0,0 +1,164 @@ + + + + + + + + + + ${appname} + + + + + + + + + debug + + + ${CONSOLE_LOG_PATTERN} + + UTF-8 + + + + + + + + ${log.path}/debug.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%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} [%contextName] [%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} [%contextName] [%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} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/error-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + ERROR + ACCEPT + DENY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/.gitkeep b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-point/pom.xml b/epmet-module/epmet-point/pom.xml new file mode 100644 index 0000000000..460ce0de13 --- /dev/null +++ b/epmet-module/epmet-point/pom.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + + + epmet-module + com.epmet + 2.0.0 + + + com.epmet + epmet-point + pom + + + epmet-point-server + epmet-point-client + + + \ No newline at end of file diff --git a/epmet-module/pom.xml b/epmet-module/pom.xml index beb48a2e31..28533ed679 100644 --- a/epmet-module/pom.xml +++ b/epmet-module/pom.xml @@ -40,6 +40,7 @@ data-statistical data-report epmet-heart - + epmet-point + From 45e3be3dd50ad81340dd643566e7002dadfef209 Mon Sep 17 00:00:00 2001 From: wangchao Date: Fri, 10 Jul 2020 10:08:06 +0800 Subject: [PATCH 03/98] =?UTF-8?q?=E7=A7=AF=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/TestController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/TestController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/TestController.java index e35f3820d4..3418b3a5f3 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/TestController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/TestController.java @@ -7,9 +7,9 @@ import com.epmet.commons.tools.utils.Result; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; import java.util.HashMap; import java.util.Map; @@ -21,7 +21,7 @@ import java.util.Map; * @Date 2020-07-10 09:27 */ -@Controller +@RestController @RequestMapping("demo") public class TestController { private Logger logger = LogManager.getLogger(TestController.class); From 6b919f334b37ecb3cb6240733876cbb621e070e9 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 16 Jul 2020 15:06:15 +0800 Subject: [PATCH 04/98] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E8=A1=A8=E5=8F=8A=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/form/EventFormDTO.java | 119 ++++++++++++++++++ .../com/epmet/constant/ProjectConstant.java | 11 ++ .../com/epmet/controller/EventController.java | 79 ++++++++++++ .../src/main/java/com/epmet/dao/EventDao.java | 35 ++++++ .../java/com/epmet/entity/EventEntity.java | 81 ++++++++++++ .../java/com/epmet/enu/SysResponseEnum.java | 41 ++++++ .../java/com/epmet/service/EventService.java | 35 ++++++ .../epmet/service/impl/EventServiceImpl.java | 60 +++++++++ .../db/migration/epmet_common_service.sql | 20 +++ .../src/main/resources/mapper/EventDao.xml | 28 +++++ .../resources/db/migration/epmet_point.sql | 39 ++++++ 11 files changed, 548 insertions(+) create mode 100644 epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/EventFormDTO.java create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/constant/ProjectConstant.java create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/EventController.java create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/EventDao.java create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/EventEntity.java create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/enu/SysResponseEnum.java create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/EventService.java create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/EventServiceImpl.java create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/EventDao.xml create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/epmet_point.sql diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/EventFormDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/EventFormDTO.java new file mode 100644 index 0000000000..2c72dd5e4b --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/EventFormDTO.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.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + + +/** + * 事件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-16 + */ +@Data +public class EventFormDTO implements Serializable { + + + private static final long serialVersionUID = -5890535035537229696L; + /** + * 主键 + */ + private String id; + + /** + * 消息网关事件类别ID 从消息网关获取事件类型Id + */ + private String classId; + + /** + * 消息网关APP_ID + */ + private String appId; + + /** + * 消息网关APP_NAME + */ + private String appName; + + /** + * 事件标识 与消息网关事件tag一致 + */ + @NotBlank(message = "事件标识不能为空",groups = {AddGroup.class, UpdateGroup.class}) + private String eventCode; + + /** + * 事件名称 + */ + @NotBlank(message = "事件名称不能为空",groups = {AddGroup.class}) + private String eventName; + + /** + * 事件说明 + */ + private String eventDesc; + + /** + * 事件功能分组ID 来自oper_customize.customer_function表 + */ + @NotBlank(message = "事件功能分组ID不能为空",groups = {AddGroup.class}) + private String eventGroupId; + + /** + * 是否是通用事件 0-否,1-是;消息体内需要体现该字段,通用则说明由业务系统自己计算分值 + */ + @NotBlank(message = "是否是通用事件不能为空",groups = {AddGroup.class}) + private String isCommon; + + /** + * 删除标识 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/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/constant/ProjectConstant.java new file mode 100644 index 0000000000..8aa3dc2fc1 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -0,0 +1,11 @@ +package com.epmet.constant; + +/** + * desc:项目常量 + */ +public interface ProjectConstant { + /** + * 时间已存在 + */ + +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/EventController.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/EventController.java new file mode 100644 index 0000000000..f07730295b --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/EventController.java @@ -0,0 +1,79 @@ +/** + * 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.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.form.EventFormDTO; +import com.epmet.service.EventService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + + +/** + * 事件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-16 + */ +@RestController +@RequestMapping("event") +public class EventController { + + @Autowired + private EventService eventService; + + /** + * desc:添加事件,如果已存在则不作任何改动,直接返回成功 + * + * @param formDTO + * @return + * json:{ + * "classId":"epmet_heart", + * "appId":"202007161443499985fa2d397436d10356542134c8f008c48", + * "appName":"党群e事通开发测试", + * "eventCode":"epmet_heart_active_send_point", + * "eventName":"活动发放积分", + * "eventDesc":"给参加活动的人发放积分", + * "eventGroupId":"1234", + * "isCommon":"1" + * } + */ + @PostMapping("addEvent") + public Result addEvent(@RequestBody EventFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AddGroup.class); + eventService.addEvent(formDTO); + return new Result().ok(true); + } + + /** + * desc:修改事件,如果已存在则不作任何改动,直接返回成功 + * + * @param formDTO + * @return + */ + @GetMapping("updateEvent") + public Result updateEvent(@RequestBody EventFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, UpdateGroup.class); + eventService.updateEvent(formDTO); + return new Result().ok(true); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/EventDao.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/EventDao.java new file mode 100644 index 0000000000..4db69553ec --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/EventDao.java @@ -0,0 +1,35 @@ +/** + * 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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.EventEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 事件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-16 + */ +@Mapper +public interface EventDao extends BaseDao { + + int getCountByEventCode(@Param("eventCode") String eventCode); +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/EventEntity.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/EventEntity.java new file mode 100644 index 0000000000..391b11ad40 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/EventEntity.java @@ -0,0 +1,81 @@ +/** + * 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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 事件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("event") +public class EventEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 消息网关事件类别ID 从消息网关获取事件类型Id + */ + private String classId; + + /** + * 消息网关APP_ID + */ + private String appId; + + /** + * 消息网关APP_NAME + */ + private String appName; + + /** + * 事件标识 与消息网关事件tag一致 + */ + private String eventCode; + + /** + * 事件名称 + */ + private String eventName; + + /** + * 事件说明 + */ + private String eventDesc; + + /** + * 事件功能分组ID 来自oper_customize.customer_function表 + */ + private String eventGroupId; + + /** + * 是否是通用事件 0-否,1-是;消息体内需要体现该字段,通用则说明由业务系统自己计算分值 + */ + private String isCommon; + +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/enu/SysResponseEnum.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/enu/SysResponseEnum.java new file mode 100644 index 0000000000..a34883da65 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/enu/SysResponseEnum.java @@ -0,0 +1,41 @@ +package com.epmet.enu; + +/** + * @author jianjun liu + * @date 2020-06-04 21:39 + **/ +public enum SysResponseEnum { + /** + * + * 业务代码枚举类 + * + * 编码样式:【CCCBBOOXX】 + * 编码示例说明: + * CCC 中心编码&业务系统 (120-内容扫描服务中心服务) + * BB 业务类型(00-默认 ) + * OO 操作类型(00-默认) + * + */ + /*通用枚举 */ + EXCEPTION(12001,"系统异常"), + + + /*事件 业务 01*/ + EVENT_HAS_ALREADY_EXIST(120010001,"事件已存在无需重复添加"), + ; + + private Integer code; + private String msg; + SysResponseEnum(Integer code, String msg){ + this.code = code; + this.msg = msg; + } + + public Integer getCode() { + return code; + } + + public String getMsg() { + return msg; + } +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/EventService.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/EventService.java new file mode 100644 index 0000000000..fc60058fc2 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/EventService.java @@ -0,0 +1,35 @@ +/** + * 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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.form.EventFormDTO; +import com.epmet.entity.EventEntity; + +/** + * 事件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-16 + */ +public interface EventService extends BaseService { + + void addEvent(EventFormDTO formDTO); + + void updateEvent(EventFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/EventServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/EventServiceImpl.java new file mode 100644 index 0000000000..fed5a58ed3 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/EventServiceImpl.java @@ -0,0 +1,60 @@ +/** + * 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.epmet.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.EventDao; +import com.epmet.dto.form.EventFormDTO; +import com.epmet.entity.EventEntity; +import com.epmet.enu.SysResponseEnum; +import com.epmet.service.EventService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * 事件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-16 + */ +@Slf4j +@Service +public class EventServiceImpl extends BaseServiceImpl implements EventService { + + @Override + public void addEvent(EventFormDTO formDTO) { + if (baseDao.getCountByEventCode(formDTO.getEventCode()) > 0) { + log.warn("addEvent fail,msg:{}", SysResponseEnum.EVENT_HAS_ALREADY_EXIST.getMsg()); + return; + } + + EventEntity eventEntity = ConvertUtils.sourceToTarget(formDTO, EventEntity.class); + if (eventEntity == null) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.insert(eventEntity); + } + + @Override + public void updateEvent(EventFormDTO formDTO) { + //baseDao.update(eventEntity); + } +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/epmet_common_service.sql b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/epmet_common_service.sql index 1e2005a491..bcf0b493c7 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/epmet_common_service.sql +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/epmet_common_service.sql @@ -416,3 +416,23 @@ INSERT INTO `calender` VALUES ('ff7e08ece3008eeb1661a2b1d8b4e20e', 0, '20200711' INSERT INTO `calender` VALUES ('ffe45e7059c67874f88498cfcfd19b4c', 0, '20200424', '2020-04-24', 5, '', '', '', '1', '工作日', '无', 'Friday', '周五', 0, 0, 'APP_USER', '2020-05-12 01:32:25', 'APP_USER', '2020-05-12 10:05:11'); SET FOREIGN_KEY_CHECKS = 1; + +#add by liujianjun 2020-07-16 +CREATE TABLE event( + ID VARCHAR(64) NOT NULL COMMENT '主键' , + CLASS_ID VARCHAR(32) COMMENT '消息网关事件类别ID 从消息网关获取事件类型Id' , + APP_ID VARCHAR(128) COMMENT '消息网关APP_ID' , + APP_NAME VARCHAR(32) COMMENT '消息网关APP_NAME' , + EVENT_CODE VARCHAR(32) COMMENT '事件标识 与消息网关事件tag一致' , + EVENT_NAME VARCHAR(32) COMMENT '事件名称' , + EVENT_DESC VARCHAR(64) COMMENT '事件说明' , + EVENT_GROUP_ID VARCHAR(512) COMMENT '事件功能分组ID 来自oper_customize.customer_function表' , + IS_COMMON VARCHAR(1) COMMENT '是否是通用事件 0-否,1-是;消息体内需要体现该字段,通用则说明由业务系统自己计算分值' , + DEL_FLAG VARCHAR(1) COMMENT '删除标识 0-否,1-是' , + 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 = '事件表'; diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/EventDao.xml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/EventDao.xml new file mode 100644 index 0000000000..9865ab0efa --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/EventDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/epmet_point.sql b/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/epmet_point.sql new file mode 100644 index 0000000000..af08a35db6 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/epmet_point.sql @@ -0,0 +1,39 @@ +CREATE TABLE point_rule( + ID VARCHAR(64) NOT NULL COMMENT '主键' , + CUSTOMER_ID VARCHAR(64) COMMENT '客户ID' , + EVENT_CODE VARCHAR(32) COMMENT '事件CODE 来自事件表' , + EVENT_NAME VARCHAR(32) COMMENT '事件名称 来自事件表' , + RULE_DESC VARCHAR(32) COMMENT '积分说明 事件说明' , + OPERATE_TYPE VARCHAR(32) COMMENT '操作类型 加积分:add;减积分:subtract' , + UP_LIMIT INT COMMENT '积分上限' , + untitled VARCHAR(32) COMMENT '积分上限描述' , + POINT_NUM INT DEFAULT 0 COMMENT '获得积分值' , + POINT_UNIT VARCHAR(32) COMMENT '获得积分单位 次:time;分钟:minute;小时:hour' , + REMARK VARCHAR(128) COMMENT '备注 备注说明' , + ENABLED_FLAG VARCHAR(1) COMMENT '是否启用 0-否,1-是' , + DEL_FLAG VARCHAR(1) COMMENT '删除标识 0-否,1-是' , + 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 = '积分规则表';; + +CREATE TABLE sys_operate_log( + ID VARCHAR(64) NOT NULL COMMENT '主键' , + CUSTOMER_ID VARCHAR(64) COMMENT '客户ID' , + OBJECT_ID VARCHAR(64) COMMENT '操作对象ID' , + OBJECT_TYPE VARCHAR(64) COMMENT '对象类型 规则:rule' , + OP_TYPE VARCHAR(32) COMMENT '操作类型 新建:add,编辑:edit,删除:del;' , + OP_USER VARCHAR(64) COMMENT '操作用户 操作人' , + BEFORD_DATA VARCHAR(1024) COMMENT '变更前数据 JSON串' , + AFTER_DATA VARCHAR(1024) COMMENT '变更后数据 JSON串' , + DEL_FLAG VARCHAR(1) COMMENT '删除标识 0-否,1-是' , + 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 = '积分系统操作记录表'; From a9b32ed7fc830d1491b33cf6503ebc0b92deb4e9 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 16 Jul 2020 17:37:30 +0800 Subject: [PATCH 05/98] =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=85=B7=E4=BD=93?= =?UTF-8?q?=E9=94=99=E8=AF=AFcode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/commons/tools/utils/HttpClientManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java index 261153eea7..2b48025317 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java @@ -29,7 +29,6 @@ import org.springframework.util.CollectionUtils; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; import java.io.ByteArrayOutputStream; -import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URLEncoder; @@ -190,7 +189,8 @@ public class HttpClientManager { String result = EntityUtils.toString(response.getEntity()); return new Result().ok(result); } else { - log.warn("execute http method fail,httpStatus:{0}", response.getStatusLine().getStatusCode()); + log.warn("execute http method fail,httpStatus:{}", response.getStatusLine().getStatusCode()); + return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(),"请求失败httpStatus:"+response.getStatusLine().getStatusCode()); } } } catch (Exception e) { From ceeaebefaaf0af88a4a945e166b87af57684c248 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 19 Jul 2020 23:48:53 +0800 Subject: [PATCH 06/98] =?UTF-8?q?=E7=88=B1=E5=BF=83=E4=BA=92=E5=8A=A9?= =?UTF-8?q?=E7=9B=B8=E5=85=B3DB=EF=BC=8C=E4=BB=A3=E7=A0=81=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/ActContentDTO.java | 91 +++++++ .../java/com/epmet/dto/ActCustomizedDTO.java | 106 ++++++++ .../main/java/com/epmet/dto/ActInfoDTO.java | 250 ++++++++++++++++++ .../java/com/epmet/dto/ActLivePicDTO.java | 86 ++++++ .../java/com/epmet/dto/ActLiveRecDTO.java | 102 +++++++ .../com/epmet/dto/ActOperationRecDTO.java | 89 +++++++ .../java/com/epmet/dto/ActPointLogDTO.java | 102 +++++++ .../java/com/epmet/dto/ActSignInPicDTO.java | 86 ++++++ .../java/com/epmet/dto/ActSignInRecDTO.java | 112 ++++++++ .../java/com/epmet/dto/ActStatisticalDTO.java | 126 +++++++++ .../java/com/epmet/dto/ActSummaryDTO.java | 91 +++++++ .../java/com/epmet/dto/ActUserLogDTO.java | 101 +++++++ .../com/epmet/dto/ActUserRelationDTO.java | 135 ++++++++++ .../java/com/epmet/dto/HeartUserInfoDTO.java | 102 +++++++ .../com/epmet/dto/LatestActContentDTO.java | 91 +++++++ .../java/com/epmet/dto/LatestActInfoDTO.java | 212 +++++++++++++++ .../java/com/epmet/dto/VolunteerInfoDTO.java | 91 +++++++ .../controller/ActCustomizedController.java | 41 +++ .../controller/GrantPointsController.java | 15 ++ .../epmet/controller/WorkActController.java | 15 ++ .../controller/WorkActDraftController.java | 15 ++ .../controller/WorkActUserController.java | 15 ++ .../java/com/epmet/dao/ActContentDao.java | 33 +++ .../java/com/epmet/dao/ActCustomizedDao.java | 33 +++ .../main/java/com/epmet/dao/ActInfoDao.java | 33 +++ .../java/com/epmet/dao/ActLivePicDao.java | 33 +++ .../java/com/epmet/dao/ActLiveRecDao.java | 33 +++ .../com/epmet/dao/ActOperationRecDao.java | 33 +++ .../java/com/epmet/dao/ActPointLogDao.java | 33 +++ .../java/com/epmet/dao/ActSignInPicDao.java | 33 +++ .../java/com/epmet/dao/ActSignInRecDao.java | 33 +++ .../java/com/epmet/dao/ActStatisticalDao.java | 33 +++ .../java/com/epmet/dao/ActSummaryDao.java | 33 +++ .../java/com/epmet/dao/ActUserLogDao.java | 33 +++ .../com/epmet/dao/ActUserRelationDao.java | 33 +++ .../java/com/epmet/dao/HeartUserInfoDao.java | 33 +++ .../com/epmet/dao/LatestActContentDao.java | 33 +++ .../java/com/epmet/dao/LatestActInfoDao.java | 33 +++ .../java/com/epmet/dao/VolunteerInfoDao.java | 33 +++ .../com/epmet/entity/ActContentEntity.java | 61 +++++ .../com/epmet/entity/ActCustomizedEntity.java | 76 ++++++ .../java/com/epmet/entity/ActInfoEntity.java | 220 +++++++++++++++ .../com/epmet/entity/ActLivePicEntity.java | 56 ++++ .../com/epmet/entity/ActLiveRecEntity.java | 72 +++++ .../epmet/entity/ActOperationRecEntity.java | 59 +++++ .../com/epmet/entity/ActPointLogEntity.java | 72 +++++ .../com/epmet/entity/ActSignInPicEntity.java | 56 ++++ .../com/epmet/entity/ActSignInRecEntity.java | 82 ++++++ .../epmet/entity/ActStatisticalEntity.java | 96 +++++++ .../com/epmet/entity/ActSummaryEntity.java | 61 +++++ .../com/epmet/entity/ActUserLogEntity.java | 71 +++++ .../epmet/entity/ActUserRelationEntity.java | 105 ++++++++ .../com/epmet/entity/HeartUserInfoEntity.java | 72 +++++ .../epmet/entity/LatestActContentEntity.java | 61 +++++ .../com/epmet/entity/LatestActInfoEntity.java | 182 +++++++++++++ .../com/epmet/entity/VolunteerInfoEntity.java | 61 +++++ .../java/com/epmet/excel/ActContentExcel.java | 68 +++++ .../com/epmet/excel/ActCustomizedExcel.java | 77 ++++++ .../java/com/epmet/excel/ActInfoExcel.java | 162 ++++++++++++ .../java/com/epmet/excel/ActLivePicExcel.java | 65 +++++ .../java/com/epmet/excel/ActLiveRecExcel.java | 75 ++++++ .../com/epmet/excel/ActOperationRecExcel.java | 65 +++++ .../com/epmet/excel/ActPointLogExcel.java | 74 ++++++ .../com/epmet/excel/ActSignInPicExcel.java | 65 +++++ .../com/epmet/excel/ActSignInRecExcel.java | 81 ++++++ .../com/epmet/excel/ActStatisticalExcel.java | 89 +++++++ .../java/com/epmet/excel/ActSummaryExcel.java | 68 +++++ .../java/com/epmet/excel/ActUserLogExcel.java | 68 +++++ .../com/epmet/excel/ActUserRelationExcel.java | 92 +++++++ .../com/epmet/excel/HeartUserInfoExcel.java | 74 ++++++ .../epmet/excel/LatestActContentExcel.java | 68 +++++ .../com/epmet/excel/LatestActInfoExcel.java | 141 ++++++++++ .../com/epmet/excel/VolunteerInfoExcel.java | 68 +++++ .../java/com/epmet/redis/ActContentRedis.java | 47 ++++ .../com/epmet/redis/ActCustomizedRedis.java | 47 ++++ .../java/com/epmet/redis/ActInfoRedis.java | 47 ++++ .../java/com/epmet/redis/ActLivePicRedis.java | 47 ++++ .../java/com/epmet/redis/ActLiveRecRedis.java | 47 ++++ .../com/epmet/redis/ActOperationRecRedis.java | 47 ++++ .../com/epmet/redis/ActPointLogRedis.java | 47 ++++ .../com/epmet/redis/ActSignInPicRedis.java | 47 ++++ .../com/epmet/redis/ActSignInRecRedis.java | 47 ++++ .../com/epmet/redis/ActStatisticalRedis.java | 47 ++++ .../java/com/epmet/redis/ActSummaryRedis.java | 47 ++++ .../java/com/epmet/redis/ActUserLogRedis.java | 47 ++++ .../com/epmet/redis/ActUserRelationRedis.java | 47 ++++ .../com/epmet/redis/HeartUserInfoRedis.java | 47 ++++ .../epmet/redis/LatestActContentRedis.java | 47 ++++ .../com/epmet/redis/LatestActInfoRedis.java | 47 ++++ .../com/epmet/redis/VolunteerInfoRedis.java | 47 ++++ .../com/epmet/service/ActContentService.java | 95 +++++++ .../epmet/service/ActCustomizedService.java | 95 +++++++ .../com/epmet/service/ActInfoService.java | 95 +++++++ .../com/epmet/service/ActLivePicService.java | 95 +++++++ .../com/epmet/service/ActLiveRecService.java | 95 +++++++ .../epmet/service/ActOperationRecService.java | 95 +++++++ .../com/epmet/service/ActPointLogService.java | 95 +++++++ .../epmet/service/ActSignInPicService.java | 95 +++++++ .../epmet/service/ActSignInRecService.java | 95 +++++++ .../epmet/service/ActStatisticalService.java | 95 +++++++ .../com/epmet/service/ActSummaryService.java | 95 +++++++ .../com/epmet/service/ActUserLogService.java | 95 +++++++ .../epmet/service/ActUserRelationService.java | 95 +++++++ .../epmet/service/HeartUserInfoService.java | 95 +++++++ .../service/LatestActContentService.java | 95 +++++++ .../epmet/service/LatestActInfoService.java | 95 +++++++ .../epmet/service/VolunteerInfoService.java | 95 +++++++ .../service/impl/ActContentServiceImpl.java | 104 ++++++++ .../impl/ActCustomizedServiceImpl.java | 104 ++++++++ .../service/impl/ActInfoServiceImpl.java | 104 ++++++++ .../service/impl/ActLivePicServiceImpl.java | 104 ++++++++ .../service/impl/ActLiveRecServiceImpl.java | 104 ++++++++ .../impl/ActOperationRecServiceImpl.java | 104 ++++++++ .../service/impl/ActPointLogServiceImpl.java | 104 ++++++++ .../service/impl/ActSignInPicServiceImpl.java | 104 ++++++++ .../service/impl/ActSignInRecServiceImpl.java | 104 ++++++++ .../impl/ActStatisticalServiceImpl.java | 104 ++++++++ .../service/impl/ActSummaryServiceImpl.java | 104 ++++++++ .../service/impl/ActUserLogServiceImpl.java | 104 ++++++++ .../impl/ActUserRelationServiceImpl.java | 104 ++++++++ .../impl/HeartUserInfoServiceImpl.java | 104 ++++++++ .../impl/LatestActContentServiceImpl.java | 104 ++++++++ .../impl/LatestActInfoServiceImpl.java | 104 ++++++++ .../impl/VolunteerInfoServiceImpl.java | 104 ++++++++ .../main/resources/mapper/ActContentDao.xml | 21 ++ .../resources/mapper/ActCustomizedDao.xml | 24 ++ .../src/main/resources/mapper/ActInfoDao.xml | 52 ++++ .../main/resources/mapper/ActLivePicDao.xml | 20 ++ .../main/resources/mapper/ActLiveRecDao.xml | 23 ++ .../resources/mapper/ActOperationRecDao.xml | 20 ++ .../main/resources/mapper/ActPointLogDao.xml | 23 ++ .../main/resources/mapper/ActSignInPicDao.xml | 20 ++ .../main/resources/mapper/ActSignInRecDao.xml | 25 ++ .../resources/mapper/ActStatisticalDao.xml | 28 ++ .../main/resources/mapper/ActSummaryDao.xml | 21 ++ .../main/resources/mapper/ActUserLogDao.xml | 21 ++ .../resources/mapper/ActUserRelationDao.xml | 29 ++ .../resources/mapper/HeartUserInfoDao.xml | 23 ++ .../resources/mapper/LatestActContentDao.xml | 21 ++ .../resources/mapper/LatestActInfoDao.xml | 45 ++++ .../resources/mapper/VolunteerInfoDao.xml | 21 ++ .../java/com/epmet/dto/UserBaseInfoDTO.java | 126 +++++++++ .../controller/UserBaseInfoController.java | 94 +++++++ .../java/com/epmet/dao/UserBaseInfoDao.java | 33 +++ .../com/epmet/entity/UserBaseInfoEntity.java | 101 +++++++ .../com/epmet/excel/UserBaseInfoExcel.java | 89 +++++++ .../com/epmet/redis/UserBaseInfoRedis.java | 47 ++++ .../epmet/service/UserBaseInfoService.java | 95 +++++++ .../service/impl/UserBaseInfoServiceImpl.java | 104 ++++++++ .../main/resources/mapper/UserBaseInfoDao.xml | 28 ++ 150 files changed, 10834 insertions(+) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActContentDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActCustomizedDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActLivePicDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActLiveRecDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActOperationRecDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActPointLogDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActSignInPicDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActSignInRecDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActStatisticalDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActSummaryDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserLogDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserRelationDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/HeartUserInfoDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActContentDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/VolunteerInfoDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ActCustomizedController.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/GrantPointsController.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActContentDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActCustomizedDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActLivePicDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActLiveRecDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActOperationRecDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActPointLogDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSignInPicDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSignInRecDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActStatisticalDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSummaryDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserLogDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActContentDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActInfoDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActContentEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActCustomizedEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActLivePicEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActLiveRecEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActOperationRecEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActPointLogEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActSignInPicEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActSignInRecEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActStatisticalEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActSummaryEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserLogEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserRelationEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/HeartUserInfoEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActContentEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/VolunteerInfoEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActContentExcel.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActCustomizedExcel.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActInfoExcel.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActLivePicExcel.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActLiveRecExcel.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActOperationRecExcel.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActPointLogExcel.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActSignInPicExcel.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActSignInRecExcel.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActStatisticalExcel.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActSummaryExcel.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActUserLogExcel.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActUserRelationExcel.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/HeartUserInfoExcel.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/LatestActContentExcel.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/LatestActInfoExcel.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/VolunteerInfoExcel.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActContentRedis.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActCustomizedRedis.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActInfoRedis.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActLivePicRedis.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActLiveRecRedis.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActOperationRecRedis.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActPointLogRedis.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActSignInPicRedis.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActSignInRecRedis.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActStatisticalRedis.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActSummaryRedis.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActUserLogRedis.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActUserRelationRedis.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/HeartUserInfoRedis.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/LatestActContentRedis.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/LatestActInfoRedis.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/VolunteerInfoRedis.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActContentService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActCustomizedService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLivePicService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActOperationRecService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActPointLogService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSignInPicService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSignInRecService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActStatisticalService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSummaryService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserLogService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/HeartUserInfoService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActContentService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActInfoService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActContentServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActCustomizedServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLivePicServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActOperationRecServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActPointLogServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInPicServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInRecServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActStatisticalServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSummaryServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserLogServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartUserInfoServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActInfoServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActContentDao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActCustomizedDao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLivePicDao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLiveRecDao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActOperationRecDao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActPointLogDao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSignInPicDao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSignInRecDao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActStatisticalDao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSummaryDao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserLogDao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActContentDao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBaseInfoDTO.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBaseInfoDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserBaseInfoEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserBaseInfoExcel.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActContentDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActContentDTO.java new file mode 100644 index 0000000000..92f086a8bd --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActContentDTO.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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 活动内容 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActContentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 活动id:act_info.id + */ + private String actId; + + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; + + /** + * 内容顺序 从1开始 + */ + private Integer orderNum; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer 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/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActCustomizedDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActCustomizedDTO.java new file mode 100644 index 0000000000..ece26c588e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActCustomizedDTO.java @@ -0,0 +1,106 @@ +/** + * 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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 爱心互助首页自定义配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActCustomizedDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键(客户如果没配置,默认的值写在代码里) + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 标题:eg: 志愿者去哪儿 + */ + private String titleName; + + /** + * 咨询热线 + */ + private String hotline; + + /** + * 活动列表 + */ + private String actListName; + + /** + * 爱心榜 + */ + private String heartRankName; + + /** + * 活动回顾 + */ + private String actReviewName; + + /** + * 我的活动 + */ + private String myActName; + + /** + * 乐观锁 + */ + 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/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java new file mode 100644 index 0000000000..b7a63122b9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java @@ -0,0 +1,250 @@ +/** + * 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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 活动信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 活动标题 + */ + private String title; + + /** + * 活动封面 + */ + private String coverPic; + + /** + * 报名开始时间 + */ + private Date signupStartTime; + + /** + * 报名截止时间 + */ + private Date signupEndTime; + + /** + * 招募要求 + */ + private String requirement; + + /** + * 活动开始时间 + */ + private Date actStartTime; + + /** + * 活动结束时间 + */ + private Date actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动位置经度 + */ + private BigDecimal actLongitude; + + /** + * 活动位置纬度 + */ + private BigDecimal actLatitude; + + /** + * 打卡开始时间 + */ + private Date signinStartTime; + + /** + * 打卡截止时间 + */ + private Date signinEndTime; + + /** + * 活动签到打卡地点 + */ + private String signinAddress; + + /** + * 活动签到打卡位置经度 + */ + private BigDecimal signinLongitude; + + /** + * 活动签到打卡位置纬度 + */ + private BigDecimal signinLatitude; + + /** + * 活动签到打卡半径(单位:米) + */ + private Integer signinRadius; + + /** + * 活动名额类型(0-不限名额,1-固定名额) + */ + private Integer actQuotaCategory; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 活动状态( +已发布/报名中:published; +已取消:canceled; +已结束:finished) + */ + private String actStatus; + + /** + * 活动取消的原因 + */ + private String cancelReason; + + /** + * 取消活动的时间 + */ + private Date cancelTime; + + /** + * 联系人 + */ + private String sponsorContacts; + + /** + * 联系电话 + */ + private String sponsorTel; + + /** + * 发布名义:网格主办:grid;组织主办:agency + */ + private String sponsorType; + + /** + * 主办方id(机关或网格的id) + */ + private String sponsorId; + + /** + * 活动主办方名称(机关或网格的名称) + */ + private String sponsorName; + + /** + * 发布单位的上一级组织id,如果是以网格发布,此列存储的是网格所属机关的上一级机关 + */ + private String pid; + + /** + * 活动奖励积分 + */ + private Integer reward; + + /** + * 身份限制:1只有志愿者才可以参加活动0不限制志愿者身份 + */ + private Integer volunteerLimit; + + /** + * 审核开关:1报名人员需要人工审核0不需要 + */ + private Integer auditSwitch; + + /** + * 活动实际开始时间 + */ + private Date actualStartTime; + + /** + * 活动实际结束时间 + */ + private Date actualEndTime; + + /** + * 活动共计时长(服务时间)单位:分钟 + */ + private Integer serviceMin; + + /** + * 1已经总结0未总结 + */ + private Integer summaryFlag; + + /** + * 乐观锁 + */ + 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/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActLivePicDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActLivePicDTO.java new file mode 100644 index 0000000000..3ce290e641 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActLivePicDTO.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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 活动实况图片表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActLivePicDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 实况ID:act_live.id + */ + private String liveId; + + /** + * 图片地址 + */ + private String picUrl; + + /** + * 排序从1开始 + */ + private Integer sort; + + /** + * 乐观锁 + */ + 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/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActLiveRecDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActLiveRecDTO.java new file mode 100644 index 0000000000..46a30b97d6 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActLiveRecDTO.java @@ -0,0 +1,102 @@ +/** + * 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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 活动实况记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActLiveRecDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 活动id: act_info.id + */ + private String actId; + + /** + * 用户id + */ + private String userId; + + /** + * 实况打卡位置经度 + */ + private BigDecimal longitude; + + /** + * 实况打卡位置纬度 + */ + private BigDecimal latitude; + + /** + * 实况打卡地址 + */ + private String address; + + /** + * 实况打卡描述 + */ + private String desc; + + /** + * 删除标记 + */ + 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/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActOperationRecDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActOperationRecDTO.java new file mode 100644 index 0000000000..1faff0fdd7 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActOperationRecDTO.java @@ -0,0 +1,89 @@ +/** + * 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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 活动操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActOperationRecDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 活动id + */ + private String actId; + + /** + * 发布:publish; +取消活动:cancel; +结束活动:finish +重新编辑:update + */ + private String type; + + /** + * 1通知用户0不通知 + */ + private Integer noticeUser; + + /** + * 删除标记 + */ + 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/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActPointLogDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActPointLogDTO.java new file mode 100644 index 0000000000..2d878f2615 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActPointLogDTO.java @@ -0,0 +1,102 @@ +/** + * 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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 活动发放积分日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActPointLogDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键(给分或者不给分,以及重新处理插入本表) + */ + private String id; + + /** + * 活动id + */ + private String actId; + + /** + * 用户id + */ + private String userId; + + /** + * 加积分:add ; 减积分:subtract + */ + private String pointType; + + /** + * 积分值 + */ + private Integer points; + + /** + * 操作类型: +同意给分agree; 不给分:deny;重新处理: reset + */ + private String operateType; + + /** + * 备注:拒绝给分和重新处理时录入的理由 + */ + private String remark; + + /** + * 删除标识 0-否,1-是 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人(工作人员id) + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActSignInPicDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActSignInPicDTO.java new file mode 100644 index 0000000000..632b3f09ec --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActSignInPicDTO.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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 活动签到图片表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActSignInPicDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 签到记录ID:act_sign_in_record.id + */ + private String signInId; + + /** + * 图片地址 + */ + private String picUrl; + + /** + * 排序从1开始 + */ + private Integer sort; + + /** + * 乐观锁 + */ + 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/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActSignInRecDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActSignInRecDTO.java new file mode 100644 index 0000000000..e8cb87fa83 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActSignInRecDTO.java @@ -0,0 +1,112 @@ +/** + * 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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 活动签到记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActSignInRecDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 活动id:act_info.id + */ + private String actId; + + /** + * 用户id + */ + private String userId; + + /** + * 签到位置经度 + */ + private BigDecimal longitude; + + /** + * 签到位置纬度 + */ + private BigDecimal latitude; + + /** + * 签到地址 + */ + private String address; + + /** + * 签到描述 + */ + private String desc; + + /** + * 0不同步实况1同步到实况记录 + */ + private Integer syncLive; + + /** + * 实况id,党sync_live=1时此列有值 + */ + private String liveId; + + /** + * 删除标记 + */ + 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/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActStatisticalDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActStatisticalDTO.java new file mode 100644 index 0000000000..233b5c2188 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActStatisticalDTO.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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 活动统计信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActStatisticalDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键(活动结束后插入本表) + */ + private String id; + + /** + * 活动id + */ + private String actId; + + /** + * 已报名总人数(已报名/待审核auditing,审核通过passed,审核不通过refused取消报名canceld总人数) + */ + private Integer signupNum; + + /** + * 待审核 + */ + private Integer auditingNum; + + /** + * 审核通过 + */ + private Integer passedNum; + + /** + * 审核不通过总人数 + */ + private Integer refusedNum; + + /** + * 取消报名的人数 + */ + private Integer canceldNum; + + /** + * 活动已签到人数 + */ + private Integer signedInUserNum; + + /** + * 添加实况总人数 + */ + private Integer liveUserNum; + + /** + * 实况总记录数 + */ + private Integer liveCount; + + /** + * 发放积分总人数 + */ + private Integer rewardUserNum; + + /** + * 拒绝发放积分总人数 + */ + private Integer denyRewardUserNum; + + /** + * 删除标识 + */ + 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/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActSummaryDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActSummaryDTO.java new file mode 100644 index 0000000000..2de3fd0ce7 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActSummaryDTO.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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 活动回顾表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActSummaryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 活动ID:act_info.id + */ + private String actId; + + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; + + /** + * 内容顺序 从1开始 + */ + private Integer orderNum; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer 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/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserLogDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserLogDTO.java new file mode 100644 index 0000000000..a6f783b20f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserLogDTO.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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户活动关系日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActUserLogDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 活动ID + */ + private String actId; + + /** + * 用户ID + */ + private String userId; + + /** + * 操作类型(已报名/待审核auditing, +审核通过passed, +审核不通过refused +取消报名canceld, +发放积分rewarded +拒绝发放积分refuse_reward +重新处理processing +) + */ + private String operationType; + + /** + * 操作备注:(1)审核不通过的原因 +(2)取消报名的原因| +(3)拒绝发放积分的理由 +(4)重新处理的理由 + */ + private String reason; + + /** + * 删除标识 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/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserRelationDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserRelationDTO.java new file mode 100644 index 0000000000..57952477e7 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserRelationDTO.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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户活动关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActUserRelationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键(用户-活动一对一,报名取消再报名也只有一条记录) + */ + private String id; + + /** + * 活动ID + */ + private String actId; + + /** + * 用户ID + */ + private String userId; + + /** + * 当前状态(已报名/待审核auditing, +审核通过passed, +审核不通过refused +取消报名canceld, +) + */ + private String status; + + /** + * 审核通过类型:auto, manual + */ + private String passedType; + + /** + * 审核时间(同意、拒绝的时间) + */ + private Date auditTime; + + /** + * 未通过原因 + */ + private String failureReason; + + /** + * 取消报名的时间 + */ + private Date cancelTime; + + /** + * 用户取消报名的原因 + */ + private String cancelReason; + + /** + * 已处理: handled; 默认"",重新处理时reward_flag置为空字符串 + */ + private String processFlag; + + /** + * 已签到:signed_in; 默认"" + */ + private String signInFlag; + + /** + * 已给分:agree, 不给分:deny 默认"" + */ + private String rewardFlag; + + /** + * 拒绝发放积分备注 + */ + private String denyRewardReason; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 删除标记 + */ + private String delFlag; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间(报名时间) + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/HeartUserInfoDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/HeartUserInfoDTO.java new file mode 100644 index 0000000000..3995852d76 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/HeartUserInfoDTO.java @@ -0,0 +1,102 @@ +/** + * 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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class HeartUserInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键(用户提交报名成功后,插入本表) + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 用户id + */ + private String userId; + + /** + * 1是志愿者,0不是志愿者(志愿者注册成功后需要来更新值) + */ + private Integer volunteerFlag; + + /** + * 爱心时长(单位:分钟)(参与并签到了的活动,实际结束-实际开始)签到的。未签到但是有积分的 + + */ + private Integer kindnessTime; + + /** + * 实际参与活动个数(签到+1) + */ + private Integer participationNum; + + /** + * 参与活动并获得积分的次数(发放积分+1,重新处理如果原来是发放积分需要-1) + */ + private Integer obtainPointNum; + + /** + * 删除标记 + */ + 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/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActContentDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActContentDTO.java new file mode 100644 index 0000000000..79d7f858d1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActContentDTO.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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 最近一次编辑的活动内容 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class LatestActContentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 活动id:latest_act_info.id + */ + private String actId; + + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; + + /** + * 内容顺序 从1开始 + */ + private Integer orderNum; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer 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/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java new file mode 100644 index 0000000000..56fd782ed6 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java @@ -0,0 +1,212 @@ +/** + * 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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 最近一次编辑的活动信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class LatestActInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 活动标题 + */ + private String title; + + /** + * 活动封面 + */ + private String coverPic; + + /** + * 报名开始时间 + */ + private Date signupStartTime; + + /** + * 报名截止时间 + */ + private Date signupEndTime; + + /** + * 招募要求 + */ + private String requirement; + + /** + * 活动开始时间 + */ + private Date actStartTime; + + /** + * 活动结束时间 + */ + private Date actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动位置经度 + */ + private BigDecimal actLongitude; + + /** + * 活动位置纬度 + */ + private BigDecimal actLatitude; + + /** + * 打卡开始时间 + */ + private Date signinStartTime; + + /** + * 打卡截止时间 + */ + private Date signinEndTime; + + /** + * 活动签到打卡地点 + */ + private String signinAddress; + + /** + * 活动签到打卡位置经度 + */ + private BigDecimal signinLongitude; + + /** + * 活动签到打卡位置纬度 + */ + private BigDecimal signinLatitude; + + /** + * 活动签到打卡半径(单位:米) + */ + private Integer signinRadius; + + /** + * 活动名额类型(0-不限名额,1-固定名额) + */ + private Integer actQuotaCategory; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 联系人 + */ + private String sponsorContacts; + + /** + * 联系电话 + */ + private String sponsorTel; + + /** + * 主办方类型:网格主办:grid;组织主办:agency + */ + private String sponsorType; + + /** + * 主办方id(机关或网格的id) + */ + private String sponsorId; + + /** + * 活动主办方名称(机关或网格的名称) + */ + private String sponsorName; + + /** + * 如果以网格名义发布,存储空字符串"" + */ + private String pid; + + /** + * 活动奖励积分 + */ + private Integer reward; + + /** + * 身份限制:1只有志愿者才可以参加活动0不限制志愿者身份 + */ + private Integer volunteerLimit; + + /** + * 审核开关:1报名人员需要人工审核0不需要 + */ + private Integer auditSwitch; + + /** + * 乐观锁 + */ + 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/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/VolunteerInfoDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/VolunteerInfoDTO.java new file mode 100644 index 0000000000..e0f352bc70 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/VolunteerInfoDTO.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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 志愿者信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class VolunteerInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键(志愿者注册后插入本表) + */ + private String id; + + /** + * 用户id + */ + private String userId; + + /** + * 客户id + */ + private String customerId; + + /** + * 志愿者自我介绍 + */ + private String volunteerIntroduce; + + /** + * 志愿者签名 + */ + private String volunteerSignature; + + /** + * 删除标记 + */ + 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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ActCustomizedController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ActCustomizedController.java new file mode 100644 index 0000000000..cbc7bf3083 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ActCustomizedController.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.epmet.controller; + +import com.epmet.service.ActCustomizedService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 爱心互助首页自定义配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@RestController +@RequestMapping("actcustomized") +public class ActCustomizedController { + + @Autowired + private ActCustomizedService actCustomizedService; + + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/GrantPointsController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/GrantPointsController.java new file mode 100644 index 0000000000..f28d58a269 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/GrantPointsController.java @@ -0,0 +1,15 @@ +package com.epmet.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 工作端-积分发放api + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/19 23:21 + */ +@RestController +@RequestMapping("grantpoints") +public class GrantPointsController { +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java new file mode 100644 index 0000000000..4bc41c41d3 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java @@ -0,0 +1,15 @@ +package com.epmet.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 工作端-发布活动相关api + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/19 23:17 + */ +@RestController +@RequestMapping("/work/act") +public class WorkActController { +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java new file mode 100644 index 0000000000..2da3a0d56a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java @@ -0,0 +1,15 @@ +package com.epmet.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 工作端活动草稿 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/19 23:18 + */ +@RestController +@RequestMapping("/work/actdraft") +public class WorkActDraftController { +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java new file mode 100644 index 0000000000..165c110b9d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java @@ -0,0 +1,15 @@ +package com.epmet.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 工作端:活动人员相关api + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/19 23:16 + */ +@RestController +@RequestMapping("/work/actuser") +public class WorkActUserController { +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActContentDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActContentDao.java new file mode 100644 index 0000000000..2d7ef0de25 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActContentDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ActContentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 活动内容 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface ActContentDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActCustomizedDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActCustomizedDao.java new file mode 100644 index 0000000000..ecb50483a9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActCustomizedDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ActCustomizedEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 爱心互助首页自定义配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface ActCustomizedDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java new file mode 100644 index 0000000000..a5cdb23ff9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ActInfoEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 活动信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface ActInfoDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActLivePicDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActLivePicDao.java new file mode 100644 index 0000000000..1976a5320d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActLivePicDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ActLivePicEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 活动实况图片表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface ActLivePicDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActLiveRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActLiveRecDao.java new file mode 100644 index 0000000000..dec7d0055b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActLiveRecDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ActLiveRecEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 活动实况记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface ActLiveRecDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActOperationRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActOperationRecDao.java new file mode 100644 index 0000000000..6a6c4357af --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActOperationRecDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ActOperationRecEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 活动操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface ActOperationRecDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActPointLogDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActPointLogDao.java new file mode 100644 index 0000000000..9d6298581c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActPointLogDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ActPointLogEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 活动发放积分日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface ActPointLogDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSignInPicDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSignInPicDao.java new file mode 100644 index 0000000000..ddf3ca56ec --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSignInPicDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ActSignInPicEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 活动签到图片表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface ActSignInPicDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSignInRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSignInRecDao.java new file mode 100644 index 0000000000..04c13f13cd --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSignInRecDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ActSignInRecEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 活动签到记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface ActSignInRecDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActStatisticalDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActStatisticalDao.java new file mode 100644 index 0000000000..ac052c4eae --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActStatisticalDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ActStatisticalEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 活动统计信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface ActStatisticalDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSummaryDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSummaryDao.java new file mode 100644 index 0000000000..9ebc0e3fed --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSummaryDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ActSummaryEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 活动回顾表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface ActSummaryDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserLogDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserLogDao.java new file mode 100644 index 0000000000..52b3034e75 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ActUserLogEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户活动关系日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface ActUserLogDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java new file mode 100644 index 0000000000..83aeabfc61 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ActUserRelationEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户活动关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface ActUserRelationDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java new file mode 100644 index 0000000000..595e9178c0 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.HeartUserInfoEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface HeartUserInfoDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActContentDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActContentDao.java new file mode 100644 index 0000000000..5f1c108a52 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActContentDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LatestActContentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 最近一次编辑的活动内容 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface LatestActContentDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActInfoDao.java new file mode 100644 index 0000000000..c6d68bbac5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActInfoDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LatestActInfoEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 最近一次编辑的活动信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface LatestActInfoDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java new file mode 100644 index 0000000000..2d23a8d37c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.VolunteerInfoEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 志愿者信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface VolunteerInfoDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActContentEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActContentEntity.java new file mode 100644 index 0000000000..a39d4a48c5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActContentEntity.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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 活动内容 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_content") +public class ActContentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 活动id:act_info.id + */ + private String actId; + + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; + + /** + * 内容顺序 从1开始 + */ + private Integer orderNum; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActCustomizedEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActCustomizedEntity.java new file mode 100644 index 0000000000..df76098d87 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActCustomizedEntity.java @@ -0,0 +1,76 @@ +/** + * 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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 爱心互助首页自定义配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_customized") +public class ActCustomizedEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 标题:eg: 志愿者去哪儿 + */ + private String titleName; + + /** + * 咨询热线 + */ + private String hotline; + + /** + * 活动列表 + */ + private String actListName; + + /** + * 爱心榜 + */ + private String heartRankName; + + /** + * 活动回顾 + */ + private String actReviewName; + + /** + * 我的活动 + */ + private String myActName; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java new file mode 100644 index 0000000000..36bda96989 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java @@ -0,0 +1,220 @@ +/** + * 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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_info") +public class ActInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 活动标题 + */ + private String title; + + /** + * 活动封面 + */ + private String coverPic; + + /** + * 报名开始时间 + */ + private Date signupStartTime; + + /** + * 报名截止时间 + */ + private Date signupEndTime; + + /** + * 招募要求 + */ + private String requirement; + + /** + * 活动开始时间 + */ + private Date actStartTime; + + /** + * 活动结束时间 + */ + private Date actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动位置经度 + */ + private BigDecimal actLongitude; + + /** + * 活动位置纬度 + */ + private BigDecimal actLatitude; + + /** + * 打卡开始时间 + */ + private Date signinStartTime; + + /** + * 打卡截止时间 + */ + private Date signinEndTime; + + /** + * 活动签到打卡地点 + */ + private String signinAddress; + + /** + * 活动签到打卡位置经度 + */ + private BigDecimal signinLongitude; + + /** + * 活动签到打卡位置纬度 + */ + private BigDecimal signinLatitude; + + /** + * 活动签到打卡半径(单位:米) + */ + private Integer signinRadius; + + /** + * 活动名额类型(0-不限名额,1-固定名额) + */ + private Integer actQuotaCategory; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 活动状态( +已发布/报名中:published; +已取消:canceled; +已结束:finished) + */ + private String actStatus; + + /** + * 活动取消的原因 + */ + private String cancelReason; + + /** + * 取消活动的时间 + */ + private Date cancelTime; + + /** + * 联系人 + */ + private String sponsorContacts; + + /** + * 联系电话 + */ + private String sponsorTel; + + /** + * 发布名义:网格主办:grid;组织主办:agency + */ + private String sponsorType; + + /** + * 主办方id(机关或网格的id) + */ + private String sponsorId; + + /** + * 活动主办方名称(机关或网格的名称) + */ + private String sponsorName; + + /** + * 发布单位的上一级组织id,如果是以网格发布,此列存储的是网格所属机关的上一级机关 + */ + private String pid; + + /** + * 活动奖励积分 + */ + private Integer reward; + + /** + * 身份限制:1只有志愿者才可以参加活动0不限制志愿者身份 + */ + private Integer volunteerLimit; + + /** + * 审核开关:1报名人员需要人工审核0不需要 + */ + private Integer auditSwitch; + + /** + * 活动实际开始时间 + */ + private Date actualStartTime; + + /** + * 活动实际结束时间 + */ + private Date actualEndTime; + + /** + * 活动共计时长(服务时间)单位:分钟 + */ + private Integer serviceMin; + + /** + * 1已经总结0未总结 + */ + private Integer summaryFlag; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActLivePicEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActLivePicEntity.java new file mode 100644 index 0000000000..07c47eff6f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActLivePicEntity.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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 活动实况图片表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_live_pic") +public class ActLivePicEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 实况ID:act_live.id + */ + private String liveId; + + /** + * 图片地址 + */ + private String picUrl; + + /** + * 排序从1开始 + */ + private Integer sort; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActLiveRecEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActLiveRecEntity.java new file mode 100644 index 0000000000..8d3373cd76 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActLiveRecEntity.java @@ -0,0 +1,72 @@ +/** + * 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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动实况记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_live_rec") +public class ActLiveRecEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 活动id: act_info.id + */ + private String actId; + + /** + * 用户id + */ + private String userId; + + /** + * 实况打卡位置经度 + */ + private BigDecimal longitude; + + /** + * 实况打卡位置纬度 + */ + private BigDecimal latitude; + + /** + * 实况打卡地址 + */ + private String address; + + /** + * 实况打卡描述 + */ + private String desc; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActOperationRecEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActOperationRecEntity.java new file mode 100644 index 0000000000..fe794c6422 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActOperationRecEntity.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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 活动操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_operation_rec") +public class ActOperationRecEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 活动id + */ + private String actId; + + /** + * 发布:publish; +取消活动:cancel; +结束活动:finish +重新编辑:update + */ + private String type; + + /** + * 1通知用户0不通知 + */ + private Integer noticeUser; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActPointLogEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActPointLogEntity.java new file mode 100644 index 0000000000..1a437316e1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActPointLogEntity.java @@ -0,0 +1,72 @@ +/** + * 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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 活动发放积分日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_point_log") +public class ActPointLogEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 活动id + */ + private String actId; + + /** + * 用户id + */ + private String userId; + + /** + * 加积分:add ; 减积分:subtract + */ + private String pointType; + + /** + * 积分值 + */ + private Integer points; + + /** + * 操作类型: +同意给分agree; 不给分:deny;重新处理: reset + */ + private String operateType; + + /** + * 备注:拒绝给分和重新处理时录入的理由 + */ + private String remark; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActSignInPicEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActSignInPicEntity.java new file mode 100644 index 0000000000..fd95c558cc --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActSignInPicEntity.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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 活动签到图片表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_sign_in_pic") +public class ActSignInPicEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 签到记录ID:act_sign_in_record.id + */ + private String signInId; + + /** + * 图片地址 + */ + private String picUrl; + + /** + * 排序从1开始 + */ + private Integer sort; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActSignInRecEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActSignInRecEntity.java new file mode 100644 index 0000000000..9ceb0bb53a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActSignInRecEntity.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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动签到记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_sign_in_rec") +public class ActSignInRecEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 活动id:act_info.id + */ + private String actId; + + /** + * 用户id + */ + private String userId; + + /** + * 签到位置经度 + */ + private BigDecimal longitude; + + /** + * 签到位置纬度 + */ + private BigDecimal latitude; + + /** + * 签到地址 + */ + private String address; + + /** + * 签到描述 + */ + private String desc; + + /** + * 0不同步实况1同步到实况记录 + */ + private Integer syncLive; + + /** + * 实况id,党sync_live=1时此列有值 + */ + private String liveId; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActStatisticalEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActStatisticalEntity.java new file mode 100644 index 0000000000..61de147e46 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActStatisticalEntity.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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 活动统计信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_statistical") +public class ActStatisticalEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 活动id + */ + private String actId; + + /** + * 已报名总人数(已报名/待审核auditing,审核通过passed,审核不通过refused取消报名canceld总人数) + */ + private Integer signupNum; + + /** + * 待审核 + */ + private Integer auditingNum; + + /** + * 审核通过 + */ + private Integer passedNum; + + /** + * 审核不通过总人数 + */ + private Integer refusedNum; + + /** + * 取消报名的人数 + */ + private Integer canceldNum; + + /** + * 活动已签到人数 + */ + private Integer signedInUserNum; + + /** + * 添加实况总人数 + */ + private Integer liveUserNum; + + /** + * 实况总记录数 + */ + private Integer liveCount; + + /** + * 发放积分总人数 + */ + private Integer rewardUserNum; + + /** + * 拒绝发放积分总人数 + */ + private Integer denyRewardUserNum; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActSummaryEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActSummaryEntity.java new file mode 100644 index 0000000000..6a50b01aae --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActSummaryEntity.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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 活动回顾表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_summary") +public class ActSummaryEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 活动ID:act_info.id + */ + private String actId; + + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; + + /** + * 内容顺序 从1开始 + */ + private Integer orderNum; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserLogEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserLogEntity.java new file mode 100644 index 0000000000..101f3c9556 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserLogEntity.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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户活动关系日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_user_log") +public class ActUserLogEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 活动ID + */ + private String actId; + + /** + * 用户ID + */ + private String userId; + + /** + * 操作类型(已报名/待审核auditing, +审核通过passed, +审核不通过refused +取消报名canceld, +发放积分rewarded +拒绝发放积分refuse_reward +重新处理processing +) + */ + private String operationType; + + /** + * 操作备注:(1)审核不通过的原因 +(2)取消报名的原因| +(3)拒绝发放积分的理由 +(4)重新处理的理由 + */ + private String reason; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserRelationEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserRelationEntity.java new file mode 100644 index 0000000000..4eb9a68cdd --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserRelationEntity.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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户活动关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_user_relation") +public class ActUserRelationEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 活动ID + */ + private String actId; + + /** + * 用户ID + */ + private String userId; + + /** + * 当前状态(已报名/待审核auditing, +审核通过passed, +审核不通过refused +取消报名canceld, +) + */ + private String status; + + /** + * 审核通过类型:auto, manual + */ + private String passedType; + + /** + * 审核时间(同意、拒绝的时间) + */ + private Date auditTime; + + /** + * 未通过原因 + */ + private String failureReason; + + /** + * 取消报名的时间 + */ + private Date cancelTime; + + /** + * 用户取消报名的原因 + */ + private String cancelReason; + + /** + * 已处理: handled; 默认"",重新处理时reward_flag置为空字符串 + */ + private String processFlag; + + /** + * 已签到:signed_in; 默认"" + */ + private String signInFlag; + + /** + * 已给分:agree, 不给分:deny 默认"" + */ + private String rewardFlag; + + /** + * 拒绝发放积分备注 + */ + private String denyRewardReason; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/HeartUserInfoEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/HeartUserInfoEntity.java new file mode 100644 index 0000000000..97c1e1da4d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/HeartUserInfoEntity.java @@ -0,0 +1,72 @@ +/** + * 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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("heart_user_info") +public class HeartUserInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 用户id + */ + private String userId; + + /** + * 1是志愿者,0不是志愿者(志愿者注册成功后需要来更新值) + */ + private Integer volunteerFlag; + + /** + * 爱心时长(单位:分钟)(参与并签到了的活动,实际结束-实际开始)签到的。未签到但是有积分的 + + */ + private Integer kindnessTime; + + /** + * 实际参与活动个数(签到+1) + */ + private Integer participationNum; + + /** + * 参与活动并获得积分的次数(发放积分+1,重新处理如果原来是发放积分需要-1) + */ + private Integer obtainPointNum; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActContentEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActContentEntity.java new file mode 100644 index 0000000000..0ccb343b75 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActContentEntity.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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 最近一次编辑的活动内容 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("latest_act_content") +public class LatestActContentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 活动id:latest_act_info.id + */ + private String actId; + + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; + + /** + * 内容顺序 从1开始 + */ + private Integer orderNum; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java new file mode 100644 index 0000000000..24716be77c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java @@ -0,0 +1,182 @@ +/** + * 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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 最近一次编辑的活动信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("latest_act_info") +public class LatestActInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 活动标题 + */ + private String title; + + /** + * 活动封面 + */ + private String coverPic; + + /** + * 报名开始时间 + */ + private Date signupStartTime; + + /** + * 报名截止时间 + */ + private Date signupEndTime; + + /** + * 招募要求 + */ + private String requirement; + + /** + * 活动开始时间 + */ + private Date actStartTime; + + /** + * 活动结束时间 + */ + private Date actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动位置经度 + */ + private BigDecimal actLongitude; + + /** + * 活动位置纬度 + */ + private BigDecimal actLatitude; + + /** + * 打卡开始时间 + */ + private Date signinStartTime; + + /** + * 打卡截止时间 + */ + private Date signinEndTime; + + /** + * 活动签到打卡地点 + */ + private String signinAddress; + + /** + * 活动签到打卡位置经度 + */ + private BigDecimal signinLongitude; + + /** + * 活动签到打卡位置纬度 + */ + private BigDecimal signinLatitude; + + /** + * 活动签到打卡半径(单位:米) + */ + private Integer signinRadius; + + /** + * 活动名额类型(0-不限名额,1-固定名额) + */ + private Integer actQuotaCategory; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 联系人 + */ + private String sponsorContacts; + + /** + * 联系电话 + */ + private String sponsorTel; + + /** + * 主办方类型:网格主办:grid;组织主办:agency + */ + private String sponsorType; + + /** + * 主办方id(机关或网格的id) + */ + private String sponsorId; + + /** + * 活动主办方名称(机关或网格的名称) + */ + private String sponsorName; + + /** + * 如果以网格名义发布,存储空字符串"" + */ + private String pid; + + /** + * 活动奖励积分 + */ + private Integer reward; + + /** + * 身份限制:1只有志愿者才可以参加活动0不限制志愿者身份 + */ + private Integer volunteerLimit; + + /** + * 审核开关:1报名人员需要人工审核0不需要 + */ + private Integer auditSwitch; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/VolunteerInfoEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/VolunteerInfoEntity.java new file mode 100644 index 0000000000..6d1a11c42b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/VolunteerInfoEntity.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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 志愿者信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("volunteer_info") +public class VolunteerInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户id + */ + private String userId; + + /** + * 客户id + */ + private String customerId; + + /** + * 志愿者自我介绍 + */ + private String volunteerIntroduce; + + /** + * 志愿者签名 + */ + private String volunteerSignature; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActContentExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActContentExcel.java new file mode 100644 index 0000000000..c94706353e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActContentExcel.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.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 活动内容 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActContentExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "活动id:act_info.id") + private String actId; + + @Excel(name = "内容") + private String content; + + @Excel(name = "内容类型 图片:img;文字:text") + private String contentType; + + @Excel(name = "内容顺序 从1开始") + private Integer orderNum; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer 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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActCustomizedExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActCustomizedExcel.java new file mode 100644 index 0000000000..00b2a6d366 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActCustomizedExcel.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.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 爱心互助首页自定义配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActCustomizedExcel { + + @Excel(name = "主键(客户如果没配置,默认的值写在代码里)") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "标题:eg: 志愿者去哪儿") + private String titleName; + + @Excel(name = "咨询热线") + private String hotline; + + @Excel(name = "活动列表") + private String actListName; + + @Excel(name = "爱心榜") + private String heartRankName; + + @Excel(name = "活动回顾") + private String actReviewName; + + @Excel(name = "我的活动") + private String myActName; + + @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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActInfoExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActInfoExcel.java new file mode 100644 index 0000000000..9b8a737572 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActInfoExcel.java @@ -0,0 +1,162 @@ +/** + * 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.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActInfoExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "活动标题") + private String title; + + @Excel(name = "活动封面") + private String coverPic; + + @Excel(name = "报名开始时间") + private Date signupStartTime; + + @Excel(name = "报名截止时间") + private Date signupEndTime; + + @Excel(name = "招募要求") + private String requirement; + + @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 Date signinStartTime; + + @Excel(name = "打卡截止时间") + private Date signinEndTime; + + @Excel(name = "活动签到打卡地点") + private String signinAddress; + + @Excel(name = "活动签到打卡位置经度") + private BigDecimal signinLongitude; + + @Excel(name = "活动签到打卡位置纬度") + private BigDecimal signinLatitude; + + @Excel(name = "活动签到打卡半径(单位:米)") + private Integer signinRadius; + + @Excel(name = "活动名额类型(0-不限名额,1-固定名额)") + private Integer actQuotaCategory; + + @Excel(name = "活动名额") + private Integer actQuota; + + @Excel(name = "活动状态( 已发布/报名中:published; 已取消:canceled; 已结束:finished)") + private String actStatus; + + @Excel(name = "活动取消的原因") + private String cancelReason; + + @Excel(name = "取消活动的时间") + private Date cancelTime; + + @Excel(name = "联系人") + private String sponsorContacts; + + @Excel(name = "联系电话") + private String sponsorTel; + + @Excel(name = "发布名义:网格主办:grid;组织主办:agency") + private String sponsorType; + + @Excel(name = "主办方id(机关或网格的id)") + private String sponsorId; + + @Excel(name = "活动主办方名称(机关或网格的名称)") + private String sponsorName; + + @Excel(name = "发布单位的上一级组织id,如果是以网格发布,此列存储的是网格所属机关的上一级机关") + private String pid; + + @Excel(name = "活动奖励积分") + private Integer reward; + + @Excel(name = "身份限制:1只有志愿者才可以参加活动0不限制志愿者身份") + private Integer volunteerLimit; + + @Excel(name = "审核开关:1报名人员需要人工审核0不需要") + private Integer auditSwitch; + + @Excel(name = "活动实际开始时间") + private Date actualStartTime; + + @Excel(name = "活动实际结束时间") + private Date actualEndTime; + + @Excel(name = "活动共计时长(服务时间)单位:分钟") + private Integer serviceMin; + + @Excel(name = "1已经总结0未总结") + private Integer summaryFlag; + + @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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActLivePicExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActLivePicExcel.java new file mode 100644 index 0000000000..8fb21190df --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActLivePicExcel.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.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 活动实况图片表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActLivePicExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "实况ID:act_live.id") + private String liveId; + + @Excel(name = "图片地址") + private String picUrl; + + @Excel(name = "排序从1开始") + private Integer sort; + + @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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActLiveRecExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActLiveRecExcel.java new file mode 100644 index 0000000000..f85f566f67 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActLiveRecExcel.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.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动实况记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActLiveRecExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "活动id: act_info.id") + private String actId; + + @Excel(name = "用户id") + private String userId; + + @Excel(name = "实况打卡位置经度") + private BigDecimal longitude; + + @Excel(name = "实况打卡位置纬度") + private BigDecimal latitude; + + @Excel(name = "实况打卡地址") + private String address; + + @Excel(name = "实况打卡描述") + private String desc; + + @Excel(name = "删除标记") + 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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActOperationRecExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActOperationRecExcel.java new file mode 100644 index 0000000000..b9d7974822 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActOperationRecExcel.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.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 活动操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActOperationRecExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "活动id") + private String actId; + + @Excel(name = "发布:publish; 取消活动:cancel; 结束活动:finish 重新编辑:update") + private String type; + + @Excel(name = "1通知用户0不通知") + private Integer noticeUser; + + @Excel(name = "删除标记") + 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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActPointLogExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActPointLogExcel.java new file mode 100644 index 0000000000..9017737a09 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActPointLogExcel.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.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 活动发放积分日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActPointLogExcel { + + @Excel(name = "主键(给分或者不给分,以及重新处理插入本表)") + private String id; + + @Excel(name = "活动id") + private String actId; + + @Excel(name = "用户id") + private String userId; + + @Excel(name = "加积分:add ; 减积分:subtract") + private String pointType; + + @Excel(name = "积分值") + private Integer points; + + @Excel(name = "操作类型: 同意给分agree; 不给分:deny;重新处理: reset") + private String operateType; + + @Excel(name = "备注:拒绝给分和重新处理时录入的理由") + private String remark; + + @Excel(name = "删除标识 0-否,1-是") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人(工作人员id)") + 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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActSignInPicExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActSignInPicExcel.java new file mode 100644 index 0000000000..6e3e6168f1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActSignInPicExcel.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.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 活动签到图片表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActSignInPicExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "签到记录ID:act_sign_in_record.id") + private String signInId; + + @Excel(name = "图片地址") + private String picUrl; + + @Excel(name = "排序从1开始") + private Integer sort; + + @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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActSignInRecExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActSignInRecExcel.java new file mode 100644 index 0000000000..8862beb067 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActSignInRecExcel.java @@ -0,0 +1,81 @@ +/** + * 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.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动签到记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActSignInRecExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "活动id:act_info.id") + private String actId; + + @Excel(name = "用户id") + private String userId; + + @Excel(name = "签到位置经度") + private BigDecimal longitude; + + @Excel(name = "签到位置纬度") + private BigDecimal latitude; + + @Excel(name = "签到地址") + private String address; + + @Excel(name = "签到描述") + private String desc; + + @Excel(name = "0不同步实况1同步到实况记录") + private Integer syncLive; + + @Excel(name = "实况id,党sync_live=1时此列有值") + private String liveId; + + @Excel(name = "删除标记") + 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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActStatisticalExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActStatisticalExcel.java new file mode 100644 index 0000000000..8de1f083d9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActStatisticalExcel.java @@ -0,0 +1,89 @@ +/** + * 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.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 活动统计信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActStatisticalExcel { + + @Excel(name = "主键(活动结束后插入本表)") + private String id; + + @Excel(name = "活动id") + private String actId; + + @Excel(name = "已报名总人数(已报名/待审核auditing,审核通过passed,审核不通过refused取消报名canceld总人数)") + private Integer signupNum; + + @Excel(name = "待审核") + private Integer auditingNum; + + @Excel(name = "审核通过") + private Integer passedNum; + + @Excel(name = "审核不通过总人数") + private Integer refusedNum; + + @Excel(name = "取消报名的人数") + private Integer canceldNum; + + @Excel(name = "活动已签到人数") + private Integer signedInUserNum; + + @Excel(name = "添加实况总人数") + private Integer liveUserNum; + + @Excel(name = "实况总记录数") + private Integer liveCount; + + @Excel(name = "发放积分总人数") + private Integer rewardUserNum; + + @Excel(name = "拒绝发放积分总人数") + private Integer denyRewardUserNum; + + @Excel(name = "删除标识") + 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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActSummaryExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActSummaryExcel.java new file mode 100644 index 0000000000..6767630412 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActSummaryExcel.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.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 活动回顾表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActSummaryExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "活动ID:act_info.id") + private String actId; + + @Excel(name = "内容") + private String content; + + @Excel(name = "内容类型 图片:img;文字:text") + private String contentType; + + @Excel(name = "内容顺序 从1开始") + private Integer orderNum; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer 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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActUserLogExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActUserLogExcel.java new file mode 100644 index 0000000000..5db57daab1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActUserLogExcel.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.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 用户活动关系日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActUserLogExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "活动ID") + private String actId; + + @Excel(name = "用户ID") + private String userId; + + @Excel(name = "操作类型(已报名/待审核auditing, 审核通过passed, 审核不通过refused 取消报名canceld, 发放积分rewarded 拒绝发放积分refuse_reward 重新处理processing)") + private String operationType; + + @Excel(name = "操作备注:(1)审核不通过的原因(2)取消报名的原因|(3)拒绝发放积分的理由 (4)重新处理的理由") + private String reason; + + @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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActUserRelationExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActUserRelationExcel.java new file mode 100644 index 0000000000..f61580acdd --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActUserRelationExcel.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.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 用户活动关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActUserRelationExcel { + + @Excel(name = "主键(用户-活动一对一,报名取消再报名也只有一条记录)") + private String id; + + @Excel(name = "活动ID") + private String actId; + + @Excel(name = "用户ID") + private String userId; + + @Excel(name = "当前状态(已报名/待审核auditing, 审核通过passed, 审核不通过refused 取消报名canceld,)") + private String status; + + @Excel(name = "审核通过类型:auto, manual") + private String passedType; + + @Excel(name = "审核时间(同意、拒绝的时间)") + private Date auditTime; + + @Excel(name = "未通过原因") + private String failureReason; + + @Excel(name = "取消报名的时间") + private Date cancelTime; + + @Excel(name = "用户取消报名的原因") + private String cancelReason; + + @Excel(name = "已处理: handled; 默认空字符串,重新处理时reward_flag置为空字符串") + private String processFlag; + + @Excel(name = "已签到:signed_in; 默认空字符串") + private String signInFlag; + + @Excel(name = "已给分:agree, 不给分:deny 默认空字符串") + private String rewardFlag; + + @Excel(name = "拒绝发放积分备注") + private String denyRewardReason; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "删除标记") + 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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/HeartUserInfoExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/HeartUserInfoExcel.java new file mode 100644 index 0000000000..30f2f5c4a6 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/HeartUserInfoExcel.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.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 用户信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class HeartUserInfoExcel { + + @Excel(name = "主键(用户提交报名成功后,插入本表)") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "用户id") + private String userId; + + @Excel(name = "1是志愿者,0不是志愿者(志愿者注册成功后需要来更新值)") + private Integer volunteerFlag; + + @Excel(name = "爱心时长(单位:分钟)(参与并签到了的活动,实际结束-实际开始)签到的。未签到但是有积分的 ") + private Integer kindnessTime; + + @Excel(name = "实际参与活动个数(签到+1)") + private Integer participationNum; + + @Excel(name = "参与活动并获得积分的次数(发放积分+1,重新处理如果原来是发放积分需要-1)") + private Integer obtainPointNum; + + @Excel(name = "删除标记") + 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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/LatestActContentExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/LatestActContentExcel.java new file mode 100644 index 0000000000..9439c24ba0 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/LatestActContentExcel.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.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 最近一次编辑的活动内容 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class LatestActContentExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "活动id:latest_act_info.id") + private String actId; + + @Excel(name = "内容") + private String content; + + @Excel(name = "内容类型 图片:img;文字:text") + private String contentType; + + @Excel(name = "内容顺序 从1开始") + private Integer orderNum; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer 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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/LatestActInfoExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/LatestActInfoExcel.java new file mode 100644 index 0000000000..4ad7c2ab80 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/LatestActInfoExcel.java @@ -0,0 +1,141 @@ +/** + * 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.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 最近一次编辑的活动信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class LatestActInfoExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "活动标题") + private String title; + + @Excel(name = "活动封面") + private String coverPic; + + @Excel(name = "报名开始时间") + private Date signupStartTime; + + @Excel(name = "报名截止时间") + private Date signupEndTime; + + @Excel(name = "招募要求") + private String requirement; + + @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 Date signinStartTime; + + @Excel(name = "打卡截止时间") + private Date signinEndTime; + + @Excel(name = "活动签到打卡地点") + private String signinAddress; + + @Excel(name = "活动签到打卡位置经度") + private BigDecimal signinLongitude; + + @Excel(name = "活动签到打卡位置纬度") + private BigDecimal signinLatitude; + + @Excel(name = "活动签到打卡半径(单位:米)") + private Integer signinRadius; + + @Excel(name = "活动名额类型(0-不限名额,1-固定名额)") + private Integer actQuotaCategory; + + @Excel(name = "活动名额") + private Integer actQuota; + + @Excel(name = "联系人") + private String sponsorContacts; + + @Excel(name = "联系电话") + private String sponsorTel; + + @Excel(name = "主办方类型:网格主办:grid;组织主办:agency") + private String sponsorType; + + @Excel(name = "主办方id(机关或网格的id)") + private String sponsorId; + + @Excel(name = "活动主办方名称(机关或网格的名称)") + private String sponsorName; + + @Excel(name = "如果以网格名义发布,存储空字符串") + private String pid; + + @Excel(name = "活动奖励积分") + private Integer reward; + + @Excel(name = "身份限制:1只有志愿者才可以参加活动0不限制志愿者身份") + private Integer volunteerLimit; + + @Excel(name = "审核开关:1报名人员需要人工审核0不需要") + private Integer auditSwitch; + + @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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/VolunteerInfoExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/VolunteerInfoExcel.java new file mode 100644 index 0000000000..d10316d6c8 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/VolunteerInfoExcel.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.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 志愿者信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class VolunteerInfoExcel { + + @Excel(name = "主键(志愿者注册后插入本表)") + private String id; + + @Excel(name = "用户id") + private String userId; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "志愿者自我介绍") + private String volunteerIntroduce; + + @Excel(name = "志愿者签名") + private String volunteerSignature; + + @Excel(name = "删除标记") + 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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActContentRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActContentRedis.java new file mode 100644 index 0000000000..4570a2701e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActContentRedis.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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 活动内容 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class ActContentRedis { + @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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActCustomizedRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActCustomizedRedis.java new file mode 100644 index 0000000000..a5a070843f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActCustomizedRedis.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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 爱心互助首页自定义配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class ActCustomizedRedis { + @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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActInfoRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActInfoRedis.java new file mode 100644 index 0000000000..22c59f9e70 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 活动信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActLivePicRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActLivePicRedis.java new file mode 100644 index 0000000000..2f8a75528b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActLivePicRedis.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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 活动实况图片表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class ActLivePicRedis { + @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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActLiveRecRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActLiveRecRedis.java new file mode 100644 index 0000000000..2f24bab04e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActLiveRecRedis.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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 活动实况记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class ActLiveRecRedis { + @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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActOperationRecRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActOperationRecRedis.java new file mode 100644 index 0000000000..ba55729812 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActOperationRecRedis.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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 活动操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class ActOperationRecRedis { + @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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActPointLogRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActPointLogRedis.java new file mode 100644 index 0000000000..eaa25a47b7 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActPointLogRedis.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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 活动发放积分日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class ActPointLogRedis { + @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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActSignInPicRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActSignInPicRedis.java new file mode 100644 index 0000000000..1dd1c83295 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActSignInPicRedis.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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 活动签到图片表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class ActSignInPicRedis { + @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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActSignInRecRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActSignInRecRedis.java new file mode 100644 index 0000000000..a284611f48 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActSignInRecRedis.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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 活动签到记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class ActSignInRecRedis { + @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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActStatisticalRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActStatisticalRedis.java new file mode 100644 index 0000000000..373cd14a37 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActStatisticalRedis.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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 活动统计信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class ActStatisticalRedis { + @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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActSummaryRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActSummaryRedis.java new file mode 100644 index 0000000000..847f27756b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActSummaryRedis.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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 活动回顾表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class ActSummaryRedis { + @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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActUserLogRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActUserLogRedis.java new file mode 100644 index 0000000000..631d2d4808 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 用户活动关系日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActUserRelationRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActUserRelationRedis.java new file mode 100644 index 0000000000..1bd4bab980 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 用户活动关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/HeartUserInfoRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/HeartUserInfoRedis.java new file mode 100644 index 0000000000..4f749e8d28 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/HeartUserInfoRedis.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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 用户信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class HeartUserInfoRedis { + @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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/LatestActContentRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/LatestActContentRedis.java new file mode 100644 index 0000000000..2413bfc9ee --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/LatestActContentRedis.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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 最近一次编辑的活动内容 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class LatestActContentRedis { + @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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/LatestActInfoRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/LatestActInfoRedis.java new file mode 100644 index 0000000000..83864f7283 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/LatestActInfoRedis.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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 最近一次编辑的活动信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class LatestActInfoRedis { + @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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/VolunteerInfoRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/VolunteerInfoRedis.java new file mode 100644 index 0000000000..03a2ee9ce0 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/VolunteerInfoRedis.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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 志愿者信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class VolunteerInfoRedis { + @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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActContentService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActContentService.java new file mode 100644 index 0000000000..fde8428f41 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActContentService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ActContentDTO; +import com.epmet.entity.ActContentEntity; + +import java.util.List; +import java.util.Map; + +/** + * 活动内容 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface ActContentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActContentDTO + * @author generator + * @date 2020-07-19 + */ + ActContentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(ActContentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(ActContentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActCustomizedService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActCustomizedService.java new file mode 100644 index 0000000000..d53305c49f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActCustomizedService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ActCustomizedDTO; +import com.epmet.entity.ActCustomizedEntity; + +import java.util.List; +import java.util.Map; + +/** + * 爱心互助首页自定义配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface ActCustomizedService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActCustomizedDTO + * @author generator + * @date 2020-07-19 + */ + ActCustomizedDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(ActCustomizedDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(ActCustomizedDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java new file mode 100644 index 0000000000..3f948abe52 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ActInfoDTO; +import com.epmet.entity.ActInfoEntity; + +import java.util.List; +import java.util.Map; + +/** + * 活动信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface ActInfoService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActInfoDTO + * @author generator + * @date 2020-07-19 + */ + ActInfoDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(ActInfoDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(ActInfoDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLivePicService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLivePicService.java new file mode 100644 index 0000000000..9e082cf4f4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLivePicService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ActLivePicDTO; +import com.epmet.entity.ActLivePicEntity; + +import java.util.List; +import java.util.Map; + +/** + * 活动实况图片表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface ActLivePicService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActLivePicDTO + * @author generator + * @date 2020-07-19 + */ + ActLivePicDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(ActLivePicDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(ActLivePicDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java new file mode 100644 index 0000000000..aa89cb830a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ActLiveRecDTO; +import com.epmet.entity.ActLiveRecEntity; + +import java.util.List; +import java.util.Map; + +/** + * 活动实况记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface ActLiveRecService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActLiveRecDTO + * @author generator + * @date 2020-07-19 + */ + ActLiveRecDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(ActLiveRecDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(ActLiveRecDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActOperationRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActOperationRecService.java new file mode 100644 index 0000000000..301a02b7f3 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActOperationRecService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ActOperationRecDTO; +import com.epmet.entity.ActOperationRecEntity; + +import java.util.List; +import java.util.Map; + +/** + * 活动操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface ActOperationRecService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActOperationRecDTO + * @author generator + * @date 2020-07-19 + */ + ActOperationRecDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(ActOperationRecDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(ActOperationRecDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActPointLogService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActPointLogService.java new file mode 100644 index 0000000000..93840c7129 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActPointLogService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ActPointLogDTO; +import com.epmet.entity.ActPointLogEntity; + +import java.util.List; +import java.util.Map; + +/** + * 活动发放积分日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface ActPointLogService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActPointLogDTO + * @author generator + * @date 2020-07-19 + */ + ActPointLogDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(ActPointLogDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(ActPointLogDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSignInPicService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSignInPicService.java new file mode 100644 index 0000000000..68d8960299 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSignInPicService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ActSignInPicDTO; +import com.epmet.entity.ActSignInPicEntity; + +import java.util.List; +import java.util.Map; + +/** + * 活动签到图片表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface ActSignInPicService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActSignInPicDTO + * @author generator + * @date 2020-07-19 + */ + ActSignInPicDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(ActSignInPicDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(ActSignInPicDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSignInRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSignInRecService.java new file mode 100644 index 0000000000..c8119da389 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSignInRecService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ActSignInRecDTO; +import com.epmet.entity.ActSignInRecEntity; + +import java.util.List; +import java.util.Map; + +/** + * 活动签到记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface ActSignInRecService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActSignInRecDTO + * @author generator + * @date 2020-07-19 + */ + ActSignInRecDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(ActSignInRecDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(ActSignInRecDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActStatisticalService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActStatisticalService.java new file mode 100644 index 0000000000..1d4a93eb48 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActStatisticalService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ActStatisticalDTO; +import com.epmet.entity.ActStatisticalEntity; + +import java.util.List; +import java.util.Map; + +/** + * 活动统计信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface ActStatisticalService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActStatisticalDTO + * @author generator + * @date 2020-07-19 + */ + ActStatisticalDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(ActStatisticalDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(ActStatisticalDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSummaryService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSummaryService.java new file mode 100644 index 0000000000..6cc0b1e450 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSummaryService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ActSummaryDTO; +import com.epmet.entity.ActSummaryEntity; + +import java.util.List; +import java.util.Map; + +/** + * 活动回顾表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface ActSummaryService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActSummaryDTO + * @author generator + * @date 2020-07-19 + */ + ActSummaryDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(ActSummaryDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(ActSummaryDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserLogService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserLogService.java new file mode 100644 index 0000000000..8edb4ef9c5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ActUserLogDTO; +import com.epmet.entity.ActUserLogEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户活动关系日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface ActUserLogService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActUserLogDTO + * @author generator + * @date 2020-07-19 + */ + ActUserLogDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(ActUserLogDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(ActUserLogDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java new file mode 100644 index 0000000000..1def3fd939 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ActUserRelationDTO; +import com.epmet.entity.ActUserRelationEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户活动关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface ActUserRelationService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActUserRelationDTO + * @author generator + * @date 2020-07-19 + */ + ActUserRelationDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(ActUserRelationDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(ActUserRelationDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/HeartUserInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/HeartUserInfoService.java new file mode 100644 index 0000000000..59427d9848 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/HeartUserInfoService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.HeartUserInfoDTO; +import com.epmet.entity.HeartUserInfoEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface HeartUserInfoService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return HeartUserInfoDTO + * @author generator + * @date 2020-07-19 + */ + HeartUserInfoDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(HeartUserInfoDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(HeartUserInfoDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActContentService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActContentService.java new file mode 100644 index 0000000000..430e70d859 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActContentService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.LatestActContentDTO; +import com.epmet.entity.LatestActContentEntity; + +import java.util.List; +import java.util.Map; + +/** + * 最近一次编辑的活动内容 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface LatestActContentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return LatestActContentDTO + * @author generator + * @date 2020-07-19 + */ + LatestActContentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(LatestActContentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(LatestActContentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActInfoService.java new file mode 100644 index 0000000000..03ad6a938a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActInfoService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.LatestActInfoDTO; +import com.epmet.entity.LatestActInfoEntity; + +import java.util.List; +import java.util.Map; + +/** + * 最近一次编辑的活动信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface LatestActInfoService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return LatestActInfoDTO + * @author generator + * @date 2020-07-19 + */ + LatestActInfoDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(LatestActInfoDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(LatestActInfoDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java new file mode 100644 index 0000000000..e7874814d2 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.VolunteerInfoDTO; +import com.epmet.entity.VolunteerInfoEntity; + +import java.util.List; +import java.util.Map; + +/** + * 志愿者信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface VolunteerInfoService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return VolunteerInfoDTO + * @author generator + * @date 2020-07-19 + */ + VolunteerInfoDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(VolunteerInfoDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(VolunteerInfoDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActContentServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActContentServiceImpl.java new file mode 100644 index 0000000000..88e241dda9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActContentServiceImpl.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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ActContentDao; +import com.epmet.dto.ActContentDTO; +import com.epmet.entity.ActContentEntity; +import com.epmet.redis.ActContentRedis; +import com.epmet.service.ActContentService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class ActContentServiceImpl extends BaseServiceImpl implements ActContentService { + + @Autowired + private ActContentRedis actContentRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActContentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActContentDTO.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 ActContentDTO get(String id) { + ActContentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActContentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActContentDTO dto) { + ActContentEntity entity = ConvertUtils.sourceToTarget(dto, ActContentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActContentDTO dto) { + ActContentEntity entity = ConvertUtils.sourceToTarget(dto, ActContentEntity.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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActCustomizedServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActCustomizedServiceImpl.java new file mode 100644 index 0000000000..f81e5f9672 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActCustomizedServiceImpl.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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ActCustomizedDao; +import com.epmet.dto.ActCustomizedDTO; +import com.epmet.entity.ActCustomizedEntity; +import com.epmet.redis.ActCustomizedRedis; +import com.epmet.service.ActCustomizedService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class ActCustomizedServiceImpl extends BaseServiceImpl implements ActCustomizedService { + + @Autowired + private ActCustomizedRedis actCustomizedRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActCustomizedDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActCustomizedDTO.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 ActCustomizedDTO get(String id) { + ActCustomizedEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActCustomizedDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActCustomizedDTO dto) { + ActCustomizedEntity entity = ConvertUtils.sourceToTarget(dto, ActCustomizedEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActCustomizedDTO dto) { + ActCustomizedEntity entity = ConvertUtils.sourceToTarget(dto, ActCustomizedEntity.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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java new file mode 100644 index 0000000000..c5edbe2337 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ActInfoDao; +import com.epmet.dto.ActInfoDTO; +import com.epmet.entity.ActInfoEntity; +import com.epmet.redis.ActInfoRedis; +import com.epmet.service.ActInfoService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class ActInfoServiceImpl extends BaseServiceImpl implements ActInfoService { + + @Autowired + private ActInfoRedis actInfoRedis; + + @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 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 void save(ActInfoDTO dto) { + ActInfoEntity entity = ConvertUtils.sourceToTarget(dto, ActInfoEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActInfoDTO dto) { + ActInfoEntity entity = ConvertUtils.sourceToTarget(dto, ActInfoEntity.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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLivePicServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLivePicServiceImpl.java new file mode 100644 index 0000000000..5f2bf70f66 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLivePicServiceImpl.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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ActLivePicDao; +import com.epmet.dto.ActLivePicDTO; +import com.epmet.entity.ActLivePicEntity; +import com.epmet.redis.ActLivePicRedis; +import com.epmet.service.ActLivePicService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class ActLivePicServiceImpl extends BaseServiceImpl implements ActLivePicService { + + @Autowired + private ActLivePicRedis actLivePicRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActLivePicDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActLivePicDTO.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 ActLivePicDTO get(String id) { + ActLivePicEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActLivePicDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActLivePicDTO dto) { + ActLivePicEntity entity = ConvertUtils.sourceToTarget(dto, ActLivePicEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActLivePicDTO dto) { + ActLivePicEntity entity = ConvertUtils.sourceToTarget(dto, ActLivePicEntity.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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java new file mode 100644 index 0000000000..9f9792f8a9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ActLiveRecDao; +import com.epmet.dto.ActLiveRecDTO; +import com.epmet.entity.ActLiveRecEntity; +import com.epmet.redis.ActLiveRecRedis; +import com.epmet.service.ActLiveRecService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class ActLiveRecServiceImpl extends BaseServiceImpl implements ActLiveRecService { + + @Autowired + private ActLiveRecRedis actLiveRecRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActLiveRecDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActLiveRecDTO.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 ActLiveRecDTO get(String id) { + ActLiveRecEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActLiveRecDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActLiveRecDTO dto) { + ActLiveRecEntity entity = ConvertUtils.sourceToTarget(dto, ActLiveRecEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActLiveRecDTO dto) { + ActLiveRecEntity entity = ConvertUtils.sourceToTarget(dto, ActLiveRecEntity.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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActOperationRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActOperationRecServiceImpl.java new file mode 100644 index 0000000000..aa83d22102 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActOperationRecServiceImpl.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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ActOperationRecDao; +import com.epmet.dto.ActOperationRecDTO; +import com.epmet.entity.ActOperationRecEntity; +import com.epmet.redis.ActOperationRecRedis; +import com.epmet.service.ActOperationRecService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class ActOperationRecServiceImpl extends BaseServiceImpl implements ActOperationRecService { + + @Autowired + private ActOperationRecRedis actOperationRecRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActOperationRecDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActOperationRecDTO.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 ActOperationRecDTO get(String id) { + ActOperationRecEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActOperationRecDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActOperationRecDTO dto) { + ActOperationRecEntity entity = ConvertUtils.sourceToTarget(dto, ActOperationRecEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActOperationRecDTO dto) { + ActOperationRecEntity entity = ConvertUtils.sourceToTarget(dto, ActOperationRecEntity.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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActPointLogServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActPointLogServiceImpl.java new file mode 100644 index 0000000000..0f09783403 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActPointLogServiceImpl.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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ActPointLogDao; +import com.epmet.dto.ActPointLogDTO; +import com.epmet.entity.ActPointLogEntity; +import com.epmet.redis.ActPointLogRedis; +import com.epmet.service.ActPointLogService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class ActPointLogServiceImpl extends BaseServiceImpl implements ActPointLogService { + + @Autowired + private ActPointLogRedis actPointLogRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActPointLogDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActPointLogDTO.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 ActPointLogDTO get(String id) { + ActPointLogEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActPointLogDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActPointLogDTO dto) { + ActPointLogEntity entity = ConvertUtils.sourceToTarget(dto, ActPointLogEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActPointLogDTO dto) { + ActPointLogEntity entity = ConvertUtils.sourceToTarget(dto, ActPointLogEntity.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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInPicServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInPicServiceImpl.java new file mode 100644 index 0000000000..b9c54782e3 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInPicServiceImpl.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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ActSignInPicDao; +import com.epmet.dto.ActSignInPicDTO; +import com.epmet.entity.ActSignInPicEntity; +import com.epmet.redis.ActSignInPicRedis; +import com.epmet.service.ActSignInPicService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class ActSignInPicServiceImpl extends BaseServiceImpl implements ActSignInPicService { + + @Autowired + private ActSignInPicRedis actSignInPicRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActSignInPicDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActSignInPicDTO.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 ActSignInPicDTO get(String id) { + ActSignInPicEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActSignInPicDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActSignInPicDTO dto) { + ActSignInPicEntity entity = ConvertUtils.sourceToTarget(dto, ActSignInPicEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActSignInPicDTO dto) { + ActSignInPicEntity entity = ConvertUtils.sourceToTarget(dto, ActSignInPicEntity.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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInRecServiceImpl.java new file mode 100644 index 0000000000..ac608c807a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInRecServiceImpl.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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ActSignInRecDao; +import com.epmet.dto.ActSignInRecDTO; +import com.epmet.entity.ActSignInRecEntity; +import com.epmet.redis.ActSignInRecRedis; +import com.epmet.service.ActSignInRecService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class ActSignInRecServiceImpl extends BaseServiceImpl implements ActSignInRecService { + + @Autowired + private ActSignInRecRedis actSignInRecRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActSignInRecDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActSignInRecDTO.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 ActSignInRecDTO get(String id) { + ActSignInRecEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActSignInRecDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActSignInRecDTO dto) { + ActSignInRecEntity entity = ConvertUtils.sourceToTarget(dto, ActSignInRecEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActSignInRecDTO dto) { + ActSignInRecEntity entity = ConvertUtils.sourceToTarget(dto, ActSignInRecEntity.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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActStatisticalServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActStatisticalServiceImpl.java new file mode 100644 index 0000000000..9dc1d82ede --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActStatisticalServiceImpl.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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ActStatisticalDao; +import com.epmet.dto.ActStatisticalDTO; +import com.epmet.entity.ActStatisticalEntity; +import com.epmet.redis.ActStatisticalRedis; +import com.epmet.service.ActStatisticalService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class ActStatisticalServiceImpl extends BaseServiceImpl implements ActStatisticalService { + + @Autowired + private ActStatisticalRedis actStatisticalRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActStatisticalDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActStatisticalDTO.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 ActStatisticalDTO get(String id) { + ActStatisticalEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActStatisticalDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActStatisticalDTO dto) { + ActStatisticalEntity entity = ConvertUtils.sourceToTarget(dto, ActStatisticalEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActStatisticalDTO dto) { + ActStatisticalEntity entity = ConvertUtils.sourceToTarget(dto, ActStatisticalEntity.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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSummaryServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSummaryServiceImpl.java new file mode 100644 index 0000000000..4bb9ad328f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSummaryServiceImpl.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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ActSummaryDao; +import com.epmet.dto.ActSummaryDTO; +import com.epmet.entity.ActSummaryEntity; +import com.epmet.redis.ActSummaryRedis; +import com.epmet.service.ActSummaryService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class ActSummaryServiceImpl extends BaseServiceImpl implements ActSummaryService { + + @Autowired + private ActSummaryRedis actSummaryRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActSummaryDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActSummaryDTO.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 ActSummaryDTO get(String id) { + ActSummaryEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActSummaryDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActSummaryDTO dto) { + ActSummaryEntity entity = ConvertUtils.sourceToTarget(dto, ActSummaryEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActSummaryDTO dto) { + ActSummaryEntity entity = ConvertUtils.sourceToTarget(dto, ActSummaryEntity.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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserLogServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserLogServiceImpl.java new file mode 100644 index 0000000000..71311479b3 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ActUserLogDao; +import com.epmet.dto.ActUserLogDTO; +import com.epmet.entity.ActUserLogEntity; +import com.epmet.redis.ActUserLogRedis; +import com.epmet.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 generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java new file mode 100644 index 0000000000..214fd7b76c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ActUserRelationDao; +import com.epmet.dto.ActUserRelationDTO; +import com.epmet.entity.ActUserRelationEntity; +import com.epmet.redis.ActUserRelationRedis; +import com.epmet.service.ActUserRelationService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class ActUserRelationServiceImpl extends BaseServiceImpl implements ActUserRelationService { + + @Autowired + private ActUserRelationRedis actUserRelationRedis; + + @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 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 void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartUserInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartUserInfoServiceImpl.java new file mode 100644 index 0000000000..61506b7e6f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartUserInfoServiceImpl.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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.HeartUserInfoDao; +import com.epmet.dto.HeartUserInfoDTO; +import com.epmet.entity.HeartUserInfoEntity; +import com.epmet.redis.HeartUserInfoRedis; +import com.epmet.service.HeartUserInfoService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class HeartUserInfoServiceImpl extends BaseServiceImpl implements HeartUserInfoService { + + @Autowired + private HeartUserInfoRedis heartUserInfoRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, HeartUserInfoDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, HeartUserInfoDTO.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 HeartUserInfoDTO get(String id) { + HeartUserInfoEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, HeartUserInfoDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(HeartUserInfoDTO dto) { + HeartUserInfoEntity entity = ConvertUtils.sourceToTarget(dto, HeartUserInfoEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(HeartUserInfoDTO dto) { + HeartUserInfoEntity entity = ConvertUtils.sourceToTarget(dto, HeartUserInfoEntity.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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java new file mode 100644 index 0000000000..c08afd3689 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.LatestActContentDao; +import com.epmet.dto.LatestActContentDTO; +import com.epmet.entity.LatestActContentEntity; +import com.epmet.redis.LatestActContentRedis; +import com.epmet.service.LatestActContentService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class LatestActContentServiceImpl extends BaseServiceImpl implements LatestActContentService { + + @Autowired + private LatestActContentRedis latestActContentRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, LatestActContentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, LatestActContentDTO.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 LatestActContentDTO get(String id) { + LatestActContentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, LatestActContentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(LatestActContentDTO dto) { + LatestActContentEntity entity = ConvertUtils.sourceToTarget(dto, LatestActContentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(LatestActContentDTO dto) { + LatestActContentEntity entity = ConvertUtils.sourceToTarget(dto, LatestActContentEntity.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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActInfoServiceImpl.java new file mode 100644 index 0000000000..16cc23d0d4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActInfoServiceImpl.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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.LatestActInfoDao; +import com.epmet.dto.LatestActInfoDTO; +import com.epmet.entity.LatestActInfoEntity; +import com.epmet.redis.LatestActInfoRedis; +import com.epmet.service.LatestActInfoService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class LatestActInfoServiceImpl extends BaseServiceImpl implements LatestActInfoService { + + @Autowired + private LatestActInfoRedis latestActInfoRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, LatestActInfoDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, LatestActInfoDTO.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 LatestActInfoDTO get(String id) { + LatestActInfoEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, LatestActInfoDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(LatestActInfoDTO dto) { + LatestActInfoEntity entity = ConvertUtils.sourceToTarget(dto, LatestActInfoEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(LatestActInfoDTO dto) { + LatestActInfoEntity entity = ConvertUtils.sourceToTarget(dto, LatestActInfoEntity.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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java new file mode 100644 index 0000000000..c5e11e7f2c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.VolunteerInfoDao; +import com.epmet.dto.VolunteerInfoDTO; +import com.epmet.entity.VolunteerInfoEntity; +import com.epmet.redis.VolunteerInfoRedis; +import com.epmet.service.VolunteerInfoService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class VolunteerInfoServiceImpl extends BaseServiceImpl implements VolunteerInfoService { + + @Autowired + private VolunteerInfoRedis volunteerInfoRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, VolunteerInfoDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, VolunteerInfoDTO.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 VolunteerInfoDTO get(String id) { + VolunteerInfoEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, VolunteerInfoDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(VolunteerInfoDTO dto) { + VolunteerInfoEntity entity = ConvertUtils.sourceToTarget(dto, VolunteerInfoEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(VolunteerInfoDTO dto) { + VolunteerInfoEntity entity = ConvertUtils.sourceToTarget(dto, VolunteerInfoEntity.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/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActContentDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActContentDao.xml new file mode 100644 index 0000000000..4f6c46667e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActContentDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActCustomizedDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActCustomizedDao.xml new file mode 100644 index 0000000000..32b58dedf2 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActCustomizedDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml new file mode 100644 index 0000000000..c6f4d40c0b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLivePicDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLivePicDao.xml new file mode 100644 index 0000000000..0df8cdc28c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLivePicDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLiveRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLiveRecDao.xml new file mode 100644 index 0000000000..6ebfea5ed7 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLiveRecDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActOperationRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActOperationRecDao.xml new file mode 100644 index 0000000000..555b3b18e5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActOperationRecDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActPointLogDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActPointLogDao.xml new file mode 100644 index 0000000000..9da8bf431c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActPointLogDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSignInPicDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSignInPicDao.xml new file mode 100644 index 0000000000..af761e3fe4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSignInPicDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSignInRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSignInRecDao.xml new file mode 100644 index 0000000000..6ac88d72a1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSignInRecDao.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActStatisticalDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActStatisticalDao.xml new file mode 100644 index 0000000000..7fd6faa626 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActStatisticalDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSummaryDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSummaryDao.xml new file mode 100644 index 0000000000..f71666b3c1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSummaryDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserLogDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserLogDao.xml new file mode 100644 index 0000000000..67716c10d3 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserLogDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml new file mode 100644 index 0000000000..9c4689d6e2 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml new file mode 100644 index 0000000000..5da94b031e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActContentDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActContentDao.xml new file mode 100644 index 0000000000..99c6f3e2c1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActContentDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml new file mode 100644 index 0000000000..087273256d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml new file mode 100644 index 0000000000..48854253bb --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBaseInfoDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBaseInfoDTO.java new file mode 100644 index 0000000000..1ac6a85c85 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBaseInfoDTO.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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class UserBaseInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 用户id + */ + private String userId; + + /** + * 手机号(注册手机号) + */ + private String mobile; + + /** + * 姓氏 + */ + private String surname; + + /** + * 名称 + */ + private String name; + + /** + * 身份证号 + */ + private String idNum; + + /** + * 性别(1男2女0未知) + */ + private String gender; + + /** + * 街道 + */ + private String street; + + /** + * 小区名称 + */ + private String district; + + /** + * 楼栋单元 + */ + private String buildingAddress; + + /** + * 昵称(目前来源于微信昵称,后续系统可支持用户有昵称) + */ + private String nickname; + + /** + * 头像(目前来源于微信,后续系统顾客支持上传头像) + */ + private String headImgUrl; + + /** + * 删除标识 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/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java new file mode 100644 index 0000000000..44204aa99a --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.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.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.UserBaseInfoDTO; +import com.epmet.excel.UserBaseInfoExcel; +import com.epmet.service.UserBaseInfoService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@RestController +@RequestMapping("userbaseinfo") +public class UserBaseInfoController { + + @Autowired + private UserBaseInfoService userBaseInfoService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = userBaseInfoService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + UserBaseInfoDTO data = userBaseInfoService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody UserBaseInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + userBaseInfoService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody UserBaseInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + userBaseInfoService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + userBaseInfoService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = userBaseInfoService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, UserBaseInfoExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBaseInfoDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBaseInfoDao.java new file mode 100644 index 0000000000..02397056e8 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBaseInfoDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.UserBaseInfoEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface UserBaseInfoDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserBaseInfoEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserBaseInfoEntity.java new file mode 100644 index 0000000000..e6e5d1dcae --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserBaseInfoEntity.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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user_base_info") +public class UserBaseInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 用户id + */ + private String userId; + + /** + * 手机号(注册手机号) + */ + private String mobile; + + /** + * 姓氏 + */ + private String surname; + + /** + * 名称 + */ + private String name; + + /** + * 身份证号 + */ + private String idNum; + + /** + * 性别(1男2女0未知) + */ + private String gender; + + /** + * 街道 + */ + private String street; + + /** + * 小区名称 + */ + private String district; + + /** + * 楼栋单元 + */ + private String buildingAddress; + + /** + * 昵称(目前来源于微信昵称,后续系统可支持用户有昵称) + */ + private String nickname; + + /** + * 头像(目前来源于微信,后续系统顾客支持上传头像) + */ + private String headImgUrl; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserBaseInfoExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserBaseInfoExcel.java new file mode 100644 index 0000000000..895c241afd --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserBaseInfoExcel.java @@ -0,0 +1,89 @@ +/** + * 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.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class UserBaseInfoExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "用户id") + private String userId; + + @Excel(name = "手机号(注册手机号)") + private String mobile; + + @Excel(name = "姓氏") + private String surname; + + @Excel(name = "名称") + private String name; + + @Excel(name = "身份证号") + private String idNum; + + @Excel(name = "性别(1男2女0未知)") + private String gender; + + @Excel(name = "街道") + private String street; + + @Excel(name = "小区名称") + private String district; + + @Excel(name = "楼栋单元") + private String buildingAddress; + + @Excel(name = "昵称(目前来源于微信昵称,后续系统可支持用户有昵称)") + private String nickname; + + @Excel(name = "头像(目前来源于微信,后续系统顾客支持上传头像)") + private String headImgUrl; + + @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/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java new file mode 100644 index 0000000000..1e34bba718 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.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.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class UserBaseInfoRedis { + @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/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java new file mode 100644 index 0000000000..ab1ca9d0e8 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.UserBaseInfoDTO; +import com.epmet.entity.UserBaseInfoEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface UserBaseInfoService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return UserBaseInfoDTO + * @author generator + * @date 2020-07-19 + */ + UserBaseInfoDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(UserBaseInfoDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(UserBaseInfoDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java new file mode 100644 index 0000000000..17756b8c46 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.UserBaseInfoDao; +import com.epmet.dto.UserBaseInfoDTO; +import com.epmet.entity.UserBaseInfoEntity; +import com.epmet.redis.UserBaseInfoRedis; +import com.epmet.service.UserBaseInfoService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class UserBaseInfoServiceImpl extends BaseServiceImpl implements UserBaseInfoService { + + @Autowired + private UserBaseInfoRedis userBaseInfoRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, UserBaseInfoDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, UserBaseInfoDTO.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 UserBaseInfoDTO get(String id) { + UserBaseInfoEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, UserBaseInfoDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(UserBaseInfoDTO dto) { + UserBaseInfoEntity entity = ConvertUtils.sourceToTarget(dto, UserBaseInfoEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(UserBaseInfoDTO dto) { + UserBaseInfoEntity entity = ConvertUtils.sourceToTarget(dto, UserBaseInfoEntity.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/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml new file mode 100644 index 0000000000..87f3520461 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From ed69942ca9123c2d592854fae7df9a5ae0e33798 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 19 Jul 2020 23:49:39 +0800 Subject: [PATCH 07/98] =?UTF-8?q?=E7=88=B1=E5=BF=83=E4=BA=92=E5=8A=A9?= =?UTF-8?q?=E7=9B=B8=E5=85=B3DB=EF=BC=8C=E4=BB=A3=E7=A0=81=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=8F=90=E4=BA=A4v1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/ActContentDTO.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActContentDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActContentDTO.java index 92f086a8bd..4ca6b53a0d 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActContentDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActContentDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** From 15a15c885501f812586764228d27bfd2b33c6836 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 20 Jul 2020 17:43:58 +0800 Subject: [PATCH 08/98] =?UTF-8?q?heart=E5=B7=A5=E4=BD=9C=E7=AB=AF-?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=87=AA=E5=AE=9A=E4=B9=89=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E3=80=81=E4=BF=9D=E5=AD=98=E4=BF=AE=E6=94=B9=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/work/ActCustomizedFormDTO.java | 23 +++++++ .../form/work/SaveActCustomizedFormDTO.java | 62 +++++++++++++++++++ .../result/work/ActCustomizedResultDTO.java | 51 +++++++++++++++ .../epmet/constant/ActCustomizedConstant.java | 40 ++++++++++++ .../controller/ActCustomizedController.java | 34 +++++++++- .../java/com/epmet/dao/ActCustomizedDao.java | 11 +++- .../epmet/service/ActCustomizedService.java | 21 +++++++ .../impl/ActCustomizedServiceImpl.java | 61 +++++++++++++++++- .../resources/mapper/ActCustomizedDao.xml | 17 ++++- 9 files changed, 315 insertions(+), 5 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActCustomizedFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActCustomizedFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActCustomizedResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActCustomizedConstant.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActCustomizedFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActCustomizedFormDTO.java new file mode 100644 index 0000000000..5a4cfe3d5c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActCustomizedFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form.work; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 获取自定义配置项-入参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/20 15:17 + */ +@Data +public class ActCustomizedFormDTO implements Serializable { + private static final long serialVersionUID = 7089647420851532829L; + public interface AddUserInternalGroup {} + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空", groups = { AddUserInternalGroup.class }) + private String customerId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActCustomizedFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActCustomizedFormDTO.java new file mode 100644 index 0000000000..e6af4266e4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActCustomizedFormDTO.java @@ -0,0 +1,62 @@ +package com.epmet.dto.form.work; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 保存自定义配置-入参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/20 17:22 + */ +@Data +public class SaveActCustomizedFormDTO implements Serializable { + + private static final long serialVersionUID = 5571356065160809543L; + public interface AddUserInternalGroup {} + public interface AddUserShowGroup extends CustomerClientShowGroup {} + /** + * act_customized主键 + */ + @NotBlank(message = "主键不能为空", groups = { AddUserInternalGroup.class }) + private String actCustomizedId; + + /** + * 标题:志愿者去哪儿 + */ + @NotBlank(message = "标题不能为空", groups = { AddUserShowGroup.class }) + private String titleName; + + /** + * 咨询热线 + */ + @NotBlank(message = "咨询热线不能为空", groups = { AddUserShowGroup.class }) + private String hotLine; + + /** + * 活动列表 + */ + @NotBlank(message = "活动列表名称不能为空", groups = { AddUserShowGroup.class }) + private String actListName; + + /** + * 爱心榜 + */ + @NotBlank(message = "爱心榜列表名称不能为空", groups = { AddUserShowGroup.class }) + private String heartRankName; + + /** + * 活动回顾 + */ + @NotBlank(message = "活动回顾列表名称不能为空", groups = { AddUserShowGroup.class }) + private String actReviewName; + + /** + * 我的活动 + */ + @NotBlank(message = "我的回顾列表名称不能为空", groups = { AddUserShowGroup.class }) + private String myActName; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActCustomizedResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActCustomizedResultDTO.java new file mode 100644 index 0000000000..f06d4eaa89 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActCustomizedResultDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 获取自定义配置项-返参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/20 15:03 + */ +@Data +public class ActCustomizedResultDTO implements Serializable { + private static final long serialVersionUID = 5784819474548493258L; + + /** + * act_customized主键 + */ + private String actCustomizedId; + + /** + * 标题:志愿者去哪儿 + */ + private String titleName; + + /** + * 咨询热线 + */ + private String hotLine; + + /** + * 活动列表 + */ + private String actListName; + + /** + * 爱心榜 + */ + private String heartRankName; + + /** + * 活动回顾 + */ + private String actReviewName; + + /** + * 我的活动 + */ + private String myActName; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActCustomizedConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActCustomizedConstant.java new file mode 100644 index 0000000000..e097fcd814 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActCustomizedConstant.java @@ -0,0 +1,40 @@ +package com.epmet.constant; + +/** + * 爱心互助自定义配置项 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/20 16:54 + */ +public interface ActCustomizedConstant { + + /** + * 标题:志愿者去哪儿 + */ + String TITLE_NAME = "志愿者去哪儿"; + + /** + * 咨询热线 + */ + String HOT_LINE = ""; + + /** + * 活动列表 + */ + String ACT_LIST_NAME = "活动列表"; + + /** + * 爱心榜 + */ + String HEART_RANK_NAME = "爱心榜"; + + /** + * 活动回顾 + */ + String ACT_REVIEW_NAME = "活动回顾"; + + /** + * 我的活动 + */ + String MY_ACT_NAME = "我的活动"; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ActCustomizedController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ActCustomizedController.java index cbc7bf3083..c65621aae9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ActCustomizedController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ActCustomizedController.java @@ -17,8 +17,15 @@ package com.epmet.controller; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.work.ActCustomizedFormDTO; +import com.epmet.dto.form.work.SaveActCustomizedFormDTO; +import com.epmet.dto.result.work.ActCustomizedResultDTO; import com.epmet.service.ActCustomizedService; 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; @@ -36,6 +43,31 @@ public class ActCustomizedController { @Autowired private ActCustomizedService actCustomizedService; + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 获取当前客户下,爱心互助模块自定义配置项,如果没有配置,返回系统默认 + * @Date 2020/7/20 15:42 + **/ + @PostMapping("getconfigs") + public Result getConfigs(@RequestBody ActCustomizedFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ActCustomizedFormDTO.AddUserInternalGroup.class); + ActCustomizedResultDTO resultDTO=actCustomizedService.getConfigs(formDTO); + return new Result().ok(resultDTO); + } - + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 保存自定义配置 + * @Date 2020/7/20 17:25 + **/ + @PostMapping("save") + public Result saveConfigs(@RequestBody SaveActCustomizedFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, SaveActCustomizedFormDTO.AddUserShowGroup.class,SaveActCustomizedFormDTO.AddUserInternalGroup.class); + actCustomizedService.saveConfigs(formDTO); + return new Result(); + } } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActCustomizedDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActCustomizedDao.java index ecb50483a9..80a94700f9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActCustomizedDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActCustomizedDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.work.ActCustomizedResultDTO; import com.epmet.entity.ActCustomizedEntity; import org.apache.ibatis.annotations.Mapper; @@ -29,5 +30,13 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ActCustomizedDao extends BaseDao { - + + /** + * @param customerId + * @return com.epmet.dto.result.work.ActCustomizedResultDTO + * @author yinzuomei + * @description 获取当前客户下,爱心互助模块自定义配置项,如果没有配置,返回系统默认 + * @Date 2020/7/20 17:04 + **/ + ActCustomizedResultDTO selectConfigsByCustomerId(String customerId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActCustomizedService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActCustomizedService.java index d53305c49f..3d539c4076 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActCustomizedService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActCustomizedService.java @@ -20,6 +20,9 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.ActCustomizedDTO; +import com.epmet.dto.form.work.ActCustomizedFormDTO; +import com.epmet.dto.form.work.SaveActCustomizedFormDTO; +import com.epmet.dto.result.work.ActCustomizedResultDTO; import com.epmet.entity.ActCustomizedEntity; import java.util.List; @@ -92,4 +95,22 @@ public interface ActCustomizedService extends BaseService { * @date 2020-07-19 */ void delete(String[] ids); + + /** + * @return com.epmet.dto.result.work.ActCustomizedResultDTO + * @param formDTO + * @author yinzuomei + * @description 获取当前客户下,爱心互助模块自定义配置项,如果没有配置,返回系统默认 + * @Date 2020/7/20 15:42 + **/ + ActCustomizedResultDTO getConfigs(ActCustomizedFormDTO formDTO); + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 保存自定义配置 + * @Date 2020/7/20 17:26 + **/ + void saveConfigs(SaveActCustomizedFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActCustomizedServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActCustomizedServiceImpl.java index f81e5f9672..d3f5539d70 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActCustomizedServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActCustomizedServiceImpl.java @@ -20,15 +20,21 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.constant.ActCustomizedConstant; import com.epmet.dao.ActCustomizedDao; import com.epmet.dto.ActCustomizedDTO; +import com.epmet.dto.form.work.ActCustomizedFormDTO; +import com.epmet.dto.form.work.SaveActCustomizedFormDTO; +import com.epmet.dto.result.work.ActCustomizedResultDTO; import com.epmet.entity.ActCustomizedEntity; import com.epmet.redis.ActCustomizedRedis; import com.epmet.service.ActCustomizedService; import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -45,7 +51,7 @@ import java.util.Map; */ @Service public class ActCustomizedServiceImpl extends BaseServiceImpl implements ActCustomizedService { - + private Logger logger = LogManager.getLogger(ActCustomizedServiceImpl.class); @Autowired private ActCustomizedRedis actCustomizedRedis; @@ -101,4 +107,55 @@ public class ActCustomizedServiceImpl extends BaseServiceImpl - + + \ No newline at end of file From 3ff987764b022a66eb3c6a764a7b32ea25206a51 Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 20 Jul 2020 18:08:46 +0800 Subject: [PATCH 09/98] =?UTF-8?q?=E7=A7=AF=E5=88=86=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/PointRuleDTO.java | 126 +++++++++++++++++ .../epmet/dto/PointVerificationLogDTO.java | 131 ++++++++++++++++++ .../PointVerificationStatisticalDailyDTO.java | 121 ++++++++++++++++ .../java/com/epmet/dto/SysOperateLogDTO.java | 106 ++++++++++++++ .../com/epmet/dto/UserPointActionLogDTO.java | 112 +++++++++++++++ .../dto/UserPointStatisticalDailyDTO.java | 111 +++++++++++++++ .../java/com/epmet/dto/UserPointTotalDTO.java | 96 +++++++++++++ .../java/{ => com/epmet}/dto/form/.gitkeep | 0 .../java/{ => com/epmet}/dto/result/.gitkeep | 0 .../feign/EpmetPointOpenFeignClient.java | 4 +- .../EpmetPointOpenFeignClientFallback.java | 4 +- .../epmet-point/epmet-point-server/pom.xml | 6 + .../controller/AdjustmentController.java | 14 ++ .../epmet/controller/ExchangeController.java | 14 ++ .../epmet/controller/ResiPointController.java | 14 ++ .../main/java/com/epmet/dao/PointRuleDao.java | 33 +++++ .../epmet/dao/PointVerificationLogDao.java | 33 +++++ .../PointVerificationStatisticalDailyDao.java | 33 +++++ .../java/com/epmet/dao/SysOperateLogDao.java | 33 +++++ .../com/epmet/dao/UserPointActionLogDao.java | 33 +++++ .../dao/UserPointStatisticalDailyDao.java | 33 +++++ .../java/com/epmet/dao/UserPointTotalDao.java | 33 +++++ .../com/epmet/entity/PointRuleEntity.java | 96 +++++++++++++ .../entity/PointVerificationLogEntity.java | 101 ++++++++++++++ ...intVerificationStatisticalDailyEntity.java | 91 ++++++++++++ .../com/epmet/entity/SysOperateLogEntity.java | 76 ++++++++++ .../entity/UserPointActionLogEntity.java | 82 +++++++++++ .../UserPointStatisticalDailyEntity.java | 81 +++++++++++ .../epmet/entity/UserPointTotalEntity.java | 66 +++++++++ .../java/com/epmet/excel/PointRuleExcel.java | 89 ++++++++++++ .../excel/PointVerificationLogExcel.java | 92 ++++++++++++ ...ointVerificationStatisticalDailyExcel.java | 86 ++++++++++++ .../com/epmet/excel/SysOperateLogExcel.java | 77 ++++++++++ .../epmet/excel/UserPointActionLogExcel.java | 80 +++++++++++ .../excel/UserPointStatisticalDailyExcel.java | 80 +++++++++++ .../com/epmet/excel/UserPointTotalExcel.java | 71 ++++++++++ .../com/epmet/service/PointRuleService.java | 95 +++++++++++++ .../service/PointVerificationLogService.java | 95 +++++++++++++ ...ntVerificationStatisticalDailyService.java | 95 +++++++++++++ .../epmet/service/SysOperateLogService.java | 95 +++++++++++++ .../service/UserPointActionLogService.java | 95 +++++++++++++ .../UserPointStatisticalDailyService.java | 95 +++++++++++++ .../epmet/service/UserPointTotalService.java | 95 +++++++++++++ .../service/impl/PointRuleServiceImpl.java | 100 +++++++++++++ .../impl/PointVerificationLogServiceImpl.java | 99 +++++++++++++ ...rificationStatisticalDailyServiceImpl.java | 100 +++++++++++++ .../impl/SysOperateLogServiceImpl.java | 99 +++++++++++++ .../impl/UserPointActionLogServiceImpl.java | 100 +++++++++++++ .../UserPointStatisticalDailyServiceImpl.java | 100 +++++++++++++ .../impl/UserPointTotalServiceImpl.java | 100 +++++++++++++ .../main/resources/mapper/PointRuleDao.xml | 28 ++++ .../mapper/PointVerificationLogDao.xml | 29 ++++ .../PointVerificationStatisticalDailyDao.xml | 27 ++++ .../resources/mapper/SysOperateLogDao.xml | 24 ++++ .../mapper/UserPointActionLogDao.xml | 25 ++++ .../mapper/UserPointStatisticalDailyDao.xml | 25 ++++ .../resources/mapper/UserPointTotalDao.xml | 22 +++ 57 files changed, 3797 insertions(+), 4 deletions(-) create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointRuleDTO.java create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointVerificationLogDTO.java create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointVerificationStatisticalDailyDTO.java create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/SysOperateLogDTO.java create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/UserPointActionLogDTO.java create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/UserPointStatisticalDailyDTO.java create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/UserPointTotalDTO.java rename epmet-module/epmet-point/epmet-point-client/src/main/java/{ => com/epmet}/dto/form/.gitkeep (100%) rename epmet-module/epmet-point/epmet-point-client/src/main/java/{ => com/epmet}/dto/result/.gitkeep (100%) rename epmet-module/epmet-point/epmet-point-client/src/main/java/{ => com/epmet}/feign/EpmetPointOpenFeignClient.java (81%) rename epmet-module/epmet-point/epmet-point-client/src/main/java/{ => com/epmet}/feign/fallback/EpmetPointOpenFeignClientFallback.java (75%) create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDao.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationStatisticalDailyDao.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/SysOperateLogDao.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointTotalDao.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleEntity.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointVerificationLogEntity.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointVerificationStatisticalDailyEntity.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/SysOperateLogEntity.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/UserPointActionLogEntity.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/UserPointStatisticalDailyEntity.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/UserPointTotalEntity.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointRuleExcel.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointVerificationLogExcel.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointVerificationStatisticalDailyExcel.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/SysOperateLogExcel.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/UserPointActionLogExcel.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/UserPointStatisticalDailyExcel.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/UserPointTotalExcel.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRuleService.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationLogService.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationStatisticalDailyService.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/SysOperateLogService.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointTotalService.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationStatisticalDailyServiceImpl.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/SysOperateLogServiceImpl.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRuleDao.xml create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointVerificationLogDao.xml create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointVerificationStatisticalDailyDao.xml create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/SysOperateLogDao.xml create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointRuleDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointRuleDTO.java new file mode 100644 index 0000000000..25251dd36a --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointRuleDTO.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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 积分规则表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +public class PointRuleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 规则名称 与事件名称保持一致即可 + */ + private String ruleName; + + /** + * 规则说明 事件说明 + */ + private String ruleDesc; + + /** + * 事件CODE 来自事件表 + */ + private String eventCode; + + /** + * 事件名称 来自事件表 + */ + private String eventName; + + /** + * 操作类型 加积分:add;减积分:subtract + */ + private String operateType; + + /** + * 积分上限 + */ + private Integer upLimit; + + /** + * 积分上限描述 + */ + private String upLimitDesc; + + /** + * 获得积分值 + */ + private Integer pointNum; + + /** + * 获得积分单位 次:time;分钟:minute;小时:hour + */ + private String pointUnit; + + /** + * 是否启用 0-否,1-是 + */ + private String enabledFlag; + + /** + * 删除标识 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/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointVerificationLogDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointVerificationLogDTO.java new file mode 100644 index 0000000000..8c8c1a6db1 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointVerificationLogDTO.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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 核销记录/确认表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +public class PointVerificationLogDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 积分行为记录表ID 关联用户积分行为记录表 + */ + private String actionId; + + /** + * 核销对象 + */ + private String userId; + + /** + * 核销对象首次注册网格 + */ + private String userRegistedGridId; + + /** + * 核销对象首次注册网格所在机关 + */ + private String userRegistedAgnecyId; + + /** + * 核销人员ID + */ + private String operatorId; + + /** + * 核销人员名称 工作人员的昵称,在和核销记录里显示,兑换人、核销人都要显示,核销人昵称格式【xx机关-xxx】(ORG必须是机关级别?),若工作人员日后修改昵称,此项不变 + */ + private String operatorName; + + /** + * 核销人员所属机关ID + */ + private String operatorAgencyId; + + /** + * 核销物品 目前没有做商城,所以商品的信息统一记录并展示核销人员手动输入的信息,必填项,为商品描述,以后如果开发商城体系,此项关联商品的ID + */ + private String exchangedItem; + + /** + * 使用积分 需要多少积分 + */ + private Integer point; + + /** + * 核销人所在位置经度 + */ + private String longitude; + + /** + * 核销人所在位置维度 + */ + private String dimension; + + /** + * 核销人所在位置详细地址 + */ + private String address; + + /** + * 删除标识 + */ + 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/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointVerificationStatisticalDailyDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointVerificationStatisticalDailyDTO.java new file mode 100644 index 0000000000..94ccf1963a --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointVerificationStatisticalDailyDTO.java @@ -0,0 +1,121 @@ +/** + * 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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 工作人员核销数据统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +public class PointVerificationStatisticalDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 日 + */ + private String dateId; + + /** + * 周 + */ + private String weekId; + + /** + * 月 + */ + private String monthId; + + /** + * 季 + */ + private String quarterId; + + /** + * 年 + */ + private String yearId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 核销分数 这一天内核销了多少积分,一次insert,多次update + */ + private Integer verificatedPoint; + + /** + * 工作人员机关ID + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 父级机关ID集合 + */ + private String pids; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 核销工作人员ID + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/SysOperateLogDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/SysOperateLogDTO.java new file mode 100644 index 0000000000..9d0344e07d --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/SysOperateLogDTO.java @@ -0,0 +1,106 @@ +/** + * 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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 积分系统操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +public class SysOperateLogDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 操作对象ID + */ + private String objectId; + + /** + * 对象类型 规则:rule + */ + private String objectType; + + /** + * 操作类型 新建:add,编辑:edit,删除:del; + */ + private String opType; + + /** + * 操作用户 操作人 + */ + private String opUser; + + /** + * 变更前数据 JSON串 + */ + private String befordData; + + /** + * 变更后数据 JSON串 + */ + private String afterData; + + /** + * 删除标识 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/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/UserPointActionLogDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/UserPointActionLogDTO.java new file mode 100644 index 0000000000..254e53bbd6 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/UserPointActionLogDTO.java @@ -0,0 +1,112 @@ +/** + * 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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户积分行为记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +public class UserPointActionLogDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 用户ID + */ + private String userId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 加减分标识 plus/minus + */ + private String actionFlag; + + /** + * 来源ID 当来源为积分调整时 通过事件Id查找规则ID计算出分数 通过EVENT_ID能查出RUIE_ID + */ + private String eventId; + + /** + * 活动描述 获取积分的原因,相关内容,用来拼接【用户参加了xxx活动获取?积分】的文案,取活动的名称;【积分调整文案】;其他…… +如果是管理员手动调整扣减积分,ACTION_FLAG为"minus",但是不会生成核销记录,核销记录只保存用户使用积分兑换商品的核销详情 + */ + private String eventStatement; + + /** + * 事件名称 在积分记录里,对应的每一个明细都有一个标题和备注,该项为【标题】 value:活动、阅读文章、首次注册、评论、积分调整(手动)…… + */ + private String eventName; + + /** + * 分值 获取/核销的积分分值 + */ + private Integer point; + + /** + * 操作人所属机关ID 用户获取/核销积分的途径,1.工作人员手动审核积分发放、2.系统事件自动响应,所以CREATED_BY会可能是SYSTEM和工作人员的ID,当CREATED_BY是工作人员ID时,AGENCY_ID为这个工作人员所属的机关ID + */ + private String operatorAgencyId; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 SYSTEM或工作人员ID + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/UserPointStatisticalDailyDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/UserPointStatisticalDailyDTO.java new file mode 100644 index 0000000000..51291b89ef --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/UserPointStatisticalDailyDTO.java @@ -0,0 +1,111 @@ +/** + * 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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户积分统计情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +public class UserPointStatisticalDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 日 yyyy-MM-dd + */ + private String dateId; + + /** + * 周 yyyyWcc + */ + private String weekId; + + /** + * 月 yyyy-MM + */ + private String monthId; + + /** + * 季 yyyyQc + */ + private String quarterId; + + /** + * 年 yyyy + */ + private String yearId; + + /** + * 加减积分 plus/minus + */ + private String actionFlag; + + /** + * 客户ID + */ + private String customerId; + + /** + * 积分变动 当获取/核销标识为【plus】时,为这一日的积分增量,为 【miuns】时,为这一日的总的兑换积分数 + */ + private Integer pointChange; + + /** + * 删除标识 + */ + 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/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/UserPointTotalDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/UserPointTotalDTO.java new file mode 100644 index 0000000000..bb92d7f476 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/UserPointTotalDTO.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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户积分总计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +public class UserPointTotalDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 用户ID + */ + private String userId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 已兑积分 + */ + private Integer usedPoint; + + /** + * 可用积分 + */ + private Integer usablePoint; + + /** + * 总积分 总积分=已兑积分+剩余积分 + */ + private Integer totalPoint; + + /** + * 删除标识 + */ + 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/epmet-module/epmet-point/epmet-point-client/src/main/java/dto/form/.gitkeep b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/.gitkeep similarity index 100% rename from epmet-module/epmet-point/epmet-point-client/src/main/java/dto/form/.gitkeep rename to epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/.gitkeep diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/dto/result/.gitkeep b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/.gitkeep similarity index 100% rename from epmet-module/epmet-point/epmet-point-client/src/main/java/dto/result/.gitkeep rename to epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/.gitkeep diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/feign/EpmetPointOpenFeignClient.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java similarity index 81% rename from epmet-module/epmet-point/epmet-point-client/src/main/java/feign/EpmetPointOpenFeignClient.java rename to epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java index 34d20263a2..643542bddc 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/feign/EpmetPointOpenFeignClient.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java @@ -1,7 +1,7 @@ -package feign; +package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; -import feign.fallback.EpmetPointOpenFeignClientFallback; +import com.epmet.feign.fallback.EpmetPointOpenFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; /** diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/feign/fallback/EpmetPointOpenFeignClientFallback.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java similarity index 75% rename from epmet-module/epmet-point/epmet-point-client/src/main/java/feign/fallback/EpmetPointOpenFeignClientFallback.java rename to epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java index 164d7256d1..7dfd5ee983 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/feign/fallback/EpmetPointOpenFeignClientFallback.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java @@ -1,6 +1,6 @@ -package feign.fallback; +package com.epmet.feign.fallback; -import feign.EpmetPointOpenFeignClient; +import com.epmet.feign.EpmetPointOpenFeignClient; import org.springframework.stereotype.Component; /** diff --git a/epmet-module/epmet-point/epmet-point-server/pom.xml b/epmet-module/epmet-point/epmet-point-server/pom.xml index 780c5f7382..962ba4984e 100644 --- a/epmet-module/epmet-point/epmet-point-server/pom.xml +++ b/epmet-module/epmet-point/epmet-point-server/pom.xml @@ -63,6 +63,12 @@ 2.0.0 compile + + com.epmet + epmet-point-client + 2.0.0 + compile + diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java new file mode 100644 index 0000000000..04d9f2c4b4 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java @@ -0,0 +1,14 @@ +package com.epmet.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @description: 工作人员积分调整Controller + * @date: Created in 2020-07-20 16:38 + * @author: wangc + */ +@RestController +@RequestMapping("work/adjustment") +public class AdjustmentController { +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java new file mode 100644 index 0000000000..c3bf13d4ba --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java @@ -0,0 +1,14 @@ +package com.epmet.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @description: 工作人员积分核销Controller + * @date: Created in 2020-07-20 16:37 + * @author: wangc + */ +@RestController +@RequestMapping("work/exchange") +public class ExchangeController { +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java new file mode 100644 index 0000000000..9a935771cb --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java @@ -0,0 +1,14 @@ +package com.epmet.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @description: 居民端积分信息controller + * @date: Created in 2020-07-20 16:39 + * @author: wangc + */ +@RestController +@RequestMapping("resi/point") +public class ResiPointController { +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDao.java new file mode 100644 index 0000000000..3ab8e48b42 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.PointRuleEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 积分规则表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Mapper +public interface PointRuleDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java new file mode 100644 index 0000000000..de8e7a2aab --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.PointVerificationLogEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 核销记录/确认表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Mapper +public interface PointVerificationLogDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationStatisticalDailyDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationStatisticalDailyDao.java new file mode 100644 index 0000000000..d123b66210 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationStatisticalDailyDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.PointVerificationStatisticalDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 工作人员核销数据统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Mapper +public interface PointVerificationStatisticalDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/SysOperateLogDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/SysOperateLogDao.java new file mode 100644 index 0000000000..2721c88716 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/SysOperateLogDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.SysOperateLogEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 积分系统操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Mapper +public interface SysOperateLogDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java new file mode 100644 index 0000000000..a611054609 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.UserPointActionLogEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户积分行为记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Mapper +public interface UserPointActionLogDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java new file mode 100644 index 0000000000..9600a5ed9c --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.UserPointStatisticalDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户积分统计情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Mapper +public interface UserPointStatisticalDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointTotalDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointTotalDao.java new file mode 100644 index 0000000000..082dfb12e6 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointTotalDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.UserPointTotalEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户积分总计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Mapper +public interface UserPointTotalDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleEntity.java new file mode 100644 index 0000000000..affd55595e --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleEntity.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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 积分规则表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("point_rule") +public class PointRuleEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 规则名称 与事件名称保持一致即可 + */ + private String ruleName; + + /** + * 规则说明 事件说明 + */ + private String ruleDesc; + + /** + * 事件CODE 来自事件表 + */ + private String eventCode; + + /** + * 事件名称 来自事件表 + */ + private String eventName; + + /** + * 操作类型 加积分:add;减积分:subtract + */ + private String operateType; + + /** + * 积分上限 + */ + private Integer upLimit; + + /** + * 积分上限描述 + */ + private String upLimitDesc; + + /** + * 获得积分值 + */ + private Integer pointNum; + + /** + * 获得积分单位 次:time;分钟:minute;小时:hour + */ + private String pointUnit; + + /** + * 是否启用 0-否,1-是 + */ + private String enabledFlag; + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointVerificationLogEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointVerificationLogEntity.java new file mode 100644 index 0000000000..5e9de373e1 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointVerificationLogEntity.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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 核销记录/确认表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("point_verification_log") +public class PointVerificationLogEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 积分行为记录表ID 关联用户积分行为记录表 + */ + private String actionId; + + /** + * 核销对象 + */ + private String userId; + + /** + * 核销对象首次注册网格 + */ + private String userRegistedGridId; + + /** + * 核销对象首次注册网格所在机关 + */ + private String userRegistedAgnecyId; + + /** + * 核销人员ID + */ + private String operatorId; + + /** + * 核销人员名称 工作人员的昵称,在和核销记录里显示,兑换人、核销人都要显示,核销人昵称格式【xx机关-xxx】(ORG必须是机关级别?),若工作人员日后修改昵称,此项不变 + */ + private String operatorName; + + /** + * 核销人员所属机关ID + */ + private String operatorAgencyId; + + /** + * 核销物品 目前没有做商城,所以商品的信息统一记录并展示核销人员手动输入的信息,必填项,为商品描述,以后如果开发商城体系,此项关联商品的ID + */ + private String exchangedItem; + + /** + * 使用积分 需要多少积分 + */ + private Integer point; + + /** + * 核销人所在位置经度 + */ + private String longitude; + + /** + * 核销人所在位置维度 + */ + private String dimension; + + /** + * 核销人所在位置详细地址 + */ + private String address; + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointVerificationStatisticalDailyEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointVerificationStatisticalDailyEntity.java new file mode 100644 index 0000000000..b2b752d052 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointVerificationStatisticalDailyEntity.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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 工作人员核销数据统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("point_verification_statistical_daily") +public class PointVerificationStatisticalDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 日 + */ + private String dateId; + + /** + * 周 + */ + private String weekId; + + /** + * 月 + */ + private String monthId; + + /** + * 季 + */ + private String quarterId; + + /** + * 年 + */ + private String yearId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 核销分数 这一天内核销了多少积分,一次insert,多次update + */ + private Integer verificatedPoint; + + /** + * 工作人员机关ID + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 父级机关ID集合 + */ + private String pids; + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/SysOperateLogEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/SysOperateLogEntity.java new file mode 100644 index 0000000000..4068bba53b --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/SysOperateLogEntity.java @@ -0,0 +1,76 @@ +/** + * 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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 积分系统操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_operate_log") +public class SysOperateLogEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 操作对象ID + */ + private String objectId; + + /** + * 对象类型 规则:rule + */ + private String objectType; + + /** + * 操作类型 新建:add,编辑:edit,删除:del; + */ + private String opType; + + /** + * 操作用户 操作人 + */ + private String opUser; + + /** + * 变更前数据 JSON串 + */ + private String befordData; + + /** + * 变更后数据 JSON串 + */ + private String afterData; + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/UserPointActionLogEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/UserPointActionLogEntity.java new file mode 100644 index 0000000000..4c72c5659a --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/UserPointActionLogEntity.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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户积分行为记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user_point_action_log") +public class UserPointActionLogEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private String userId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 加减分标识 plus/minus + */ + private String actionFlag; + + /** + * 来源ID 当来源为积分调整时 通过事件Id查找规则ID计算出分数 通过EVENT_ID能查出RUIE_ID + */ + private String eventId; + + /** + * 活动描述 获取积分的原因,相关内容,用来拼接【用户参加了xxx活动获取?积分】的文案,取活动的名称;【积分调整文案】;其他…… +如果是管理员手动调整扣减积分,ACTION_FLAG为"minus",但是不会生成核销记录,核销记录只保存用户使用积分兑换商品的核销详情 + */ + private String eventStatement; + + /** + * 事件名称 在积分记录里,对应的每一个明细都有一个标题和备注,该项为【标题】 value:活动、阅读文章、首次注册、评论、积分调整(手动)…… + */ + private String eventName; + + /** + * 分值 获取/核销的积分分值 + */ + private Integer point; + + /** + * 操作人所属机关ID 用户获取/核销积分的途径,1.工作人员手动审核积分发放、2.系统事件自动响应,所以CREATED_BY会可能是SYSTEM和工作人员的ID,当CREATED_BY是工作人员ID时,AGENCY_ID为这个工作人员所属的机关ID + */ + private String operatorAgencyId; + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/UserPointStatisticalDailyEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/UserPointStatisticalDailyEntity.java new file mode 100644 index 0000000000..f83dec624b --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/UserPointStatisticalDailyEntity.java @@ -0,0 +1,81 @@ +/** + * 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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户积分统计情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user_point_statistical_daily") +public class UserPointStatisticalDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 日 yyyy-MM-dd + */ + private String dateId; + + /** + * 周 yyyyWcc + */ + private String weekId; + + /** + * 月 yyyy-MM + */ + private String monthId; + + /** + * 季 yyyyQc + */ + private String quarterId; + + /** + * 年 yyyy + */ + private String yearId; + + /** + * 加减积分 plus/minus + */ + private String actionFlag; + + /** + * 客户ID + */ + private String customerId; + + /** + * 积分变动 当获取/核销标识为【plus】时,为这一日的积分增量,为 【miuns】时,为这一日的总的兑换积分数 + */ + private Integer pointChange; + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/UserPointTotalEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/UserPointTotalEntity.java new file mode 100644 index 0000000000..6d8a3c6174 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/UserPointTotalEntity.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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户积分总计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user_point_total") +public class UserPointTotalEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private String userId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 已兑积分 + */ + private Integer usedPoint; + + /** + * 可用积分 + */ + private Integer usablePoint; + + /** + * 总积分 总积分=已兑积分+剩余积分 + */ + private Integer totalPoint; + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointRuleExcel.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointRuleExcel.java new file mode 100644 index 0000000000..c5c26801e5 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointRuleExcel.java @@ -0,0 +1,89 @@ +/** + * 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.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 积分规则表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +public class PointRuleExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "规则名称 与事件名称保持一致即可") + private String ruleName; + + @Excel(name = "规则说明 事件说明") + private String ruleDesc; + + @Excel(name = "事件CODE 来自事件表") + private String eventCode; + + @Excel(name = "事件名称 来自事件表") + private String eventName; + + @Excel(name = "操作类型 加积分:add;减积分:subtract") + private String operateType; + + @Excel(name = "积分上限") + private Integer upLimit; + + @Excel(name = "积分上限描述") + private String upLimitDesc; + + @Excel(name = "获得积分值") + private Integer pointNum; + + @Excel(name = "获得积分单位 次:time;分钟:minute;小时:hour") + private String pointUnit; + + @Excel(name = "是否启用 0-否,1-是") + private String enabledFlag; + + @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/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointVerificationLogExcel.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointVerificationLogExcel.java new file mode 100644 index 0000000000..f5cf3f8f79 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointVerificationLogExcel.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.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 核销记录/确认表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +public class PointVerificationLogExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "积分行为记录表ID 关联用户积分行为记录表") + private String actionId; + + @Excel(name = "核销对象") + private String userId; + + @Excel(name = "核销对象首次注册网格") + private String userRegistedGridId; + + @Excel(name = "核销对象首次注册网格所在机关") + private String userRegistedAgnecyId; + + @Excel(name = "核销人员ID") + private String operatorId; + + @Excel(name = "核销人员名称 工作人员的昵称,在和核销记录里显示,兑换人、核销人都要显示,核销人昵称格式【xx机关-xxx】(ORG必须是机关级别?),若工作人员日后修改昵称,此项不变") + private String operatorName; + + @Excel(name = "核销人员所属机关ID") + private String operatorAgencyId; + + @Excel(name = "核销物品 目前没有做商城,所以商品的信息统一记录并展示核销人员手动输入的信息,必填项,为商品描述,以后如果开发商城体系,此项关联商品的ID") + private String exchangedItem; + + @Excel(name = "使用积分 需要多少积分") + private Integer point; + + @Excel(name = "核销人所在位置经度") + private String longitude; + + @Excel(name = "核销人所在位置维度") + private String dimension; + + @Excel(name = "核销人所在位置详细地址") + private String address; + + @Excel(name = "删除标识") + 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/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointVerificationStatisticalDailyExcel.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointVerificationStatisticalDailyExcel.java new file mode 100644 index 0000000000..10a719da98 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointVerificationStatisticalDailyExcel.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.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 工作人员核销数据统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +public class PointVerificationStatisticalDailyExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "日") + private String dateId; + + @Excel(name = "周") + private String weekId; + + @Excel(name = "月") + private String monthId; + + @Excel(name = "季") + private String quarterId; + + @Excel(name = "年") + private String yearId; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "核销分数 这一天内核销了多少积分,一次insert,多次update") + private Integer verificatedPoint; + + @Excel(name = "工作人员机关ID") + private String agencyId; + + @Excel(name = "父级机关ID") + private String pid; + + @Excel(name = "父级机关ID集合") + private String pids; + + @Excel(name = "删除标识") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人 核销工作人员ID") + 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/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/SysOperateLogExcel.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/SysOperateLogExcel.java new file mode 100644 index 0000000000..a61756012f --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/SysOperateLogExcel.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.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 积分系统操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +public class SysOperateLogExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "操作对象ID") + private String objectId; + + @Excel(name = "对象类型 规则:rule") + private String objectType; + + @Excel(name = "操作类型 新建:add,编辑:edit,删除:del;") + private String opType; + + @Excel(name = "操作用户 操作人") + private String opUser; + + @Excel(name = "变更前数据 JSON串") + private String befordData; + + @Excel(name = "变更后数据 JSON串") + private String afterData; + + @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/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/UserPointActionLogExcel.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/UserPointActionLogExcel.java new file mode 100644 index 0000000000..6baf9de332 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/UserPointActionLogExcel.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.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 用户积分行为记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +public class UserPointActionLogExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "用户ID") + private String userId; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "加减分标识 plus/minus") + private String actionFlag; + + @Excel(name = "来源ID 当来源为积分调整时 通过事件Id查找规则ID计算出分数 通过EVENT_ID能查出RUIE_ID") + private String eventId; + + @Excel(name = "活动描述 获取积分的原因,相关内容,用来拼接【用户参加了xxx活动获取?积分】的文案,取活动的名称;【积分调整文案】;其他…… 如果是管理员手动调整扣减积分,ACTION_FLAG为\"minus\",但是不会生成核销记录,核销记录只保存用户使用积分兑换商品的核销详情") + private String eventStatement; + + @Excel(name = "事件名称 在积分记录里,对应的每一个明细都有一个标题和备注,该项为【标题】 value:活动、阅读文章、首次注册、评论、积分调整(手动)……") + private String eventName; + + @Excel(name = "分值 获取/核销的积分分值") + private Integer point; + + @Excel(name = "操作人所属机关ID 用户获取/核销积分的途径,1.工作人员手动审核积分发放、2.系统事件自动响应,所以CREATED_BY会可能是SYSTEM和工作人员的ID,当CREATED_BY是工作人员ID时,AGENCY_ID为这个工作人员所属的机关ID") + private String operatorAgencyId; + + @Excel(name = "删除标识") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人 SYSTEM或工作人员ID") + 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/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/UserPointStatisticalDailyExcel.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/UserPointStatisticalDailyExcel.java new file mode 100644 index 0000000000..372a990500 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/UserPointStatisticalDailyExcel.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.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 用户积分统计情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +public class UserPointStatisticalDailyExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "日 yyyy-MM-dd") + private String dateId; + + @Excel(name = "周 yyyyWcc") + private String weekId; + + @Excel(name = "月 yyyy-MM") + private String monthId; + + @Excel(name = "季 yyyyQc") + private String quarterId; + + @Excel(name = "年 yyyy") + private String yearId; + + @Excel(name = "加减积分 plus/minus") + private String actionFlag; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "积分变动 当获取/核销标识为【plus】时,为这一日的积分增量,为 【miuns】时,为这一日的总的兑换积分数") + private Integer pointChange; + + @Excel(name = "删除标识") + 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/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/UserPointTotalExcel.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/UserPointTotalExcel.java new file mode 100644 index 0000000000..2266e332b1 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/UserPointTotalExcel.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.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 用户积分总计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +public class UserPointTotalExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "用户ID") + private String userId; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "已兑积分") + private Integer usedPoint; + + @Excel(name = "可用积分") + private Integer usablePoint; + + @Excel(name = "总积分 总积分=已兑积分+剩余积分") + private Integer totalPoint; + + @Excel(name = "删除标识") + 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/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRuleService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRuleService.java new file mode 100644 index 0000000000..3c84c43cad --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRuleService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.PointRuleDTO; +import com.epmet.entity.PointRuleEntity; + +import java.util.List; +import java.util.Map; + +/** + * 积分规则表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +public interface PointRuleService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PointRuleDTO + * @author generator + * @date 2020-07-20 + */ + PointRuleDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-20 + */ + void save(PointRuleDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-20 + */ + void update(PointRuleDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-20 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationLogService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationLogService.java new file mode 100644 index 0000000000..55cd81a0d4 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationLogService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.PointVerificationLogDTO; +import com.epmet.entity.PointVerificationLogEntity; + +import java.util.List; +import java.util.Map; + +/** + * 核销记录/确认表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +public interface PointVerificationLogService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PointVerificationLogDTO + * @author generator + * @date 2020-07-20 + */ + PointVerificationLogDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-20 + */ + void save(PointVerificationLogDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-20 + */ + void update(PointVerificationLogDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-20 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationStatisticalDailyService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationStatisticalDailyService.java new file mode 100644 index 0000000000..5c7b8903b3 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationStatisticalDailyService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.PointVerificationStatisticalDailyDTO; +import com.epmet.entity.PointVerificationStatisticalDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 工作人员核销数据统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +public interface PointVerificationStatisticalDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PointVerificationStatisticalDailyDTO + * @author generator + * @date 2020-07-20 + */ + PointVerificationStatisticalDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-20 + */ + void save(PointVerificationStatisticalDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-20 + */ + void update(PointVerificationStatisticalDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-20 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/SysOperateLogService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/SysOperateLogService.java new file mode 100644 index 0000000000..962df38027 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/SysOperateLogService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.SysOperateLogDTO; +import com.epmet.entity.SysOperateLogEntity; + +import java.util.List; +import java.util.Map; + +/** + * 积分系统操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +public interface SysOperateLogService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return SysOperateLogDTO + * @author generator + * @date 2020-07-20 + */ + SysOperateLogDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-20 + */ + void save(SysOperateLogDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-20 + */ + void update(SysOperateLogDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-20 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java new file mode 100644 index 0000000000..895442c190 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.UserPointActionLogDTO; +import com.epmet.entity.UserPointActionLogEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户积分行为记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +public interface UserPointActionLogService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return UserPointActionLogDTO + * @author generator + * @date 2020-07-20 + */ + UserPointActionLogDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-20 + */ + void save(UserPointActionLogDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-20 + */ + void update(UserPointActionLogDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-20 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java new file mode 100644 index 0000000000..cd9d329154 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.UserPointStatisticalDailyDTO; +import com.epmet.entity.UserPointStatisticalDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户积分统计情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +public interface UserPointStatisticalDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return UserPointStatisticalDailyDTO + * @author generator + * @date 2020-07-20 + */ + UserPointStatisticalDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-20 + */ + void save(UserPointStatisticalDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-20 + */ + void update(UserPointStatisticalDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-20 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointTotalService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointTotalService.java new file mode 100644 index 0000000000..04a49fbf11 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointTotalService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.UserPointTotalDTO; +import com.epmet.entity.UserPointTotalEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户积分总计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +public interface UserPointTotalService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return UserPointTotalDTO + * @author generator + * @date 2020-07-20 + */ + UserPointTotalDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-20 + */ + void save(UserPointTotalDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-20 + */ + void update(UserPointTotalDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-20 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java new file mode 100644 index 0000000000..c64ccfdc35 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java @@ -0,0 +1,100 @@ +/** + * 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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.PointRuleDao; +import com.epmet.dto.PointRuleDTO; +import com.epmet.entity.PointRuleEntity; +import com.epmet.service.PointRuleService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 积分规则表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Service +public class PointRuleServiceImpl extends BaseServiceImpl implements PointRuleService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PointRuleDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PointRuleDTO.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 PointRuleDTO get(String id) { + PointRuleEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PointRuleDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PointRuleDTO dto) { + PointRuleEntity entity = ConvertUtils.sourceToTarget(dto, PointRuleEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PointRuleDTO dto) { + PointRuleEntity entity = ConvertUtils.sourceToTarget(dto, PointRuleEntity.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/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java new file mode 100644 index 0000000000..82f9fb9d52 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java @@ -0,0 +1,99 @@ +/** + * 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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.PointVerificationLogDao; +import com.epmet.dto.PointVerificationLogDTO; +import com.epmet.entity.PointVerificationLogEntity; +import com.epmet.service.PointVerificationLogService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 核销记录/确认表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Service +public class PointVerificationLogServiceImpl extends BaseServiceImpl implements PointVerificationLogService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PointVerificationLogDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PointVerificationLogDTO.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 PointVerificationLogDTO get(String id) { + PointVerificationLogEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PointVerificationLogDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PointVerificationLogDTO dto) { + PointVerificationLogEntity entity = ConvertUtils.sourceToTarget(dto, PointVerificationLogEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PointVerificationLogDTO dto) { + PointVerificationLogEntity entity = ConvertUtils.sourceToTarget(dto, PointVerificationLogEntity.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/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationStatisticalDailyServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationStatisticalDailyServiceImpl.java new file mode 100644 index 0000000000..b1802b95cd --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationStatisticalDailyServiceImpl.java @@ -0,0 +1,100 @@ +/** + * 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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.PointVerificationStatisticalDailyDao; +import com.epmet.dto.PointVerificationStatisticalDailyDTO; +import com.epmet.entity.PointVerificationStatisticalDailyEntity; +import com.epmet.service.PointVerificationStatisticalDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 工作人员核销数据统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Service +public class PointVerificationStatisticalDailyServiceImpl extends BaseServiceImpl implements PointVerificationStatisticalDailyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PointVerificationStatisticalDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PointVerificationStatisticalDailyDTO.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 PointVerificationStatisticalDailyDTO get(String id) { + PointVerificationStatisticalDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PointVerificationStatisticalDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PointVerificationStatisticalDailyDTO dto) { + PointVerificationStatisticalDailyEntity entity = ConvertUtils.sourceToTarget(dto, PointVerificationStatisticalDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PointVerificationStatisticalDailyDTO dto) { + PointVerificationStatisticalDailyEntity entity = ConvertUtils.sourceToTarget(dto, PointVerificationStatisticalDailyEntity.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/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/SysOperateLogServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/SysOperateLogServiceImpl.java new file mode 100644 index 0000000000..59604433bf --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/SysOperateLogServiceImpl.java @@ -0,0 +1,99 @@ +/** + * 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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.SysOperateLogDao; +import com.epmet.dto.SysOperateLogDTO; +import com.epmet.entity.SysOperateLogEntity; +import com.epmet.service.SysOperateLogService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 积分系统操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Service +public class SysOperateLogServiceImpl extends BaseServiceImpl implements SysOperateLogService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, SysOperateLogDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, SysOperateLogDTO.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 SysOperateLogDTO get(String id) { + SysOperateLogEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, SysOperateLogDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysOperateLogDTO dto) { + SysOperateLogEntity entity = ConvertUtils.sourceToTarget(dto, SysOperateLogEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysOperateLogDTO dto) { + SysOperateLogEntity entity = ConvertUtils.sourceToTarget(dto, SysOperateLogEntity.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/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java new file mode 100644 index 0000000000..1fc485a017 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java @@ -0,0 +1,100 @@ +/** + * 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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.UserPointActionLogDao; +import com.epmet.dto.UserPointActionLogDTO; +import com.epmet.entity.UserPointActionLogEntity; +import com.epmet.service.UserPointActionLogService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 用户积分行为记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Service +public class UserPointActionLogServiceImpl extends BaseServiceImpl implements UserPointActionLogService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, UserPointActionLogDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, UserPointActionLogDTO.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 UserPointActionLogDTO get(String id) { + UserPointActionLogEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, UserPointActionLogDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(UserPointActionLogDTO dto) { + UserPointActionLogEntity entity = ConvertUtils.sourceToTarget(dto, UserPointActionLogEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(UserPointActionLogDTO dto) { + UserPointActionLogEntity entity = ConvertUtils.sourceToTarget(dto, UserPointActionLogEntity.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/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java new file mode 100644 index 0000000000..9715199436 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java @@ -0,0 +1,100 @@ +/** + * 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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.UserPointStatisticalDailyDao; +import com.epmet.dto.UserPointStatisticalDailyDTO; +import com.epmet.entity.UserPointStatisticalDailyEntity; +import com.epmet.service.UserPointStatisticalDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 用户积分统计情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Service +public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl implements UserPointStatisticalDailyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, UserPointStatisticalDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, UserPointStatisticalDailyDTO.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 UserPointStatisticalDailyDTO get(String id) { + UserPointStatisticalDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, UserPointStatisticalDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(UserPointStatisticalDailyDTO dto) { + UserPointStatisticalDailyEntity entity = ConvertUtils.sourceToTarget(dto, UserPointStatisticalDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(UserPointStatisticalDailyDTO dto) { + UserPointStatisticalDailyEntity entity = ConvertUtils.sourceToTarget(dto, UserPointStatisticalDailyEntity.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/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java new file mode 100644 index 0000000000..22f3cf2e94 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java @@ -0,0 +1,100 @@ +/** + * 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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.UserPointTotalDao; +import com.epmet.dto.UserPointTotalDTO; +import com.epmet.entity.UserPointTotalEntity; +import com.epmet.service.UserPointTotalService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 用户积分总计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Service +public class UserPointTotalServiceImpl extends BaseServiceImpl implements UserPointTotalService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, UserPointTotalDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, UserPointTotalDTO.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 UserPointTotalDTO get(String id) { + UserPointTotalEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, UserPointTotalDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(UserPointTotalDTO dto) { + UserPointTotalEntity entity = ConvertUtils.sourceToTarget(dto, UserPointTotalEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(UserPointTotalDTO dto) { + UserPointTotalEntity entity = ConvertUtils.sourceToTarget(dto, UserPointTotalEntity.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/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRuleDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRuleDao.xml new file mode 100644 index 0000000000..539d926b29 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRuleDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointVerificationLogDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointVerificationLogDao.xml new file mode 100644 index 0000000000..38bd0e6e7f --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointVerificationLogDao.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointVerificationStatisticalDailyDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointVerificationStatisticalDailyDao.xml new file mode 100644 index 0000000000..1a69fb4c49 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointVerificationStatisticalDailyDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/SysOperateLogDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/SysOperateLogDao.xml new file mode 100644 index 0000000000..0fe2621044 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/SysOperateLogDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml new file mode 100644 index 0000000000..e3c1dcc2bc --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml new file mode 100644 index 0000000000..5af194c539 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml new file mode 100644 index 0000000000..3866cce55e --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 8d76f18e54efb5ed2088021477e936f27c8dbe00 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 20 Jul 2020 18:19:24 +0800 Subject: [PATCH 10/98] =?UTF-8?q?=E5=85=9A=E5=BB=BA=E5=A3=B0=E9=9F=B3=20?= =?UTF-8?q?=E4=BA=BA=E5=B7=A5=E5=8F=91=E5=B8=83=E5=8A=9F=E8=83=BD=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/form/DraftDetailFormDTO.java | 5 + .../dto/result/DraftDetailResultDTO.java | 5 + .../epmet/dto/result/DraftListResultDTO.java | 5 + .../epmet/dto/result/GovDraftContentDTO.java | 5 + .../com/epmet/constant/ArticleConstant.java | 10 + .../epmet/controller/ArticleController.java | 628 +++++++++--------- .../com/epmet/controller/DraftController.java | 16 + .../java/com/epmet/entity/ArticleEntity.java | 5 + .../com/epmet/service/ArticleService.java | 8 + .../service/impl/ArticleServiceImpl.java | 54 +- .../epmet/service/impl/DraftServiceImpl.java | 14 + .../db/migration/V0.0.2__addAutoPublish.sql | 2 + .../src/main/resources/mapper/DraftDao.xml | 8 +- 13 files changed, 448 insertions(+), 317 deletions(-) create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.2__addAutoPublish.sql diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftDetailFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftDetailFormDTO.java index 2fed15dcf8..f2672f2b30 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftDetailFormDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftDetailFormDTO.java @@ -22,4 +22,9 @@ public class DraftDetailFormDTO implements Serializable { */ @NotBlank(message = "草稿id不能为空", groups = {DraftDetailFormDTO.AddUserInternalGroup.class}) private String draftId; + + /** + * 是否展示封面 + */ + private boolean showCover; } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftDetailResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftDetailResultDTO.java index ccd0e9918e..6298a5cfca 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftDetailResultDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftDetailResultDTO.java @@ -59,4 +59,9 @@ public class DraftDetailResultDTO implements Serializable { * 标签名称数组 */ private String[] tagNameList; + + /** + * 封面信息 + */ + private CoverImgDTO coverInfo; } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftListResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftListResultDTO.java index 4f41ee517c..e3f62d12d5 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftListResultDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftListResultDTO.java @@ -31,4 +31,9 @@ public class DraftListResultDTO implements Serializable { * 创建时间 */ private Long createdTime; + + /** + * 审核状态 + */ + private String auditStatus; } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovDraftContentDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovDraftContentDTO.java index 1b0530e3e4..4b4ae98c07 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovDraftContentDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovDraftContentDTO.java @@ -24,4 +24,9 @@ public class GovDraftContentDTO implements Serializable { */ private String content; + /** + * 审核状态 + */ + private String auditStatus; + } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java index f90304f477..65a7f54855 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java @@ -56,4 +56,14 @@ public interface ArticleConstant { * 操作权限异常-自己发表的文章只有自己才能下线 */ String SHIRO_EXCEPTION = "当前人员不是文章发布者,不能下线文章"; + + /** + * 发布方式 人工强制发布 不审核 + */ + String PUBLISH_WAY_MANUAL = "manualNoAudit"; + + /** + * 发布方式 api审核后自动发布 + */ + String PUBLISH_WAY_AUTO_AUDIT = "autoAudit"; } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index b22716bc16..bf3de1429d 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -52,308 +52,330 @@ import java.util.List; @RestController @RequestMapping("article") public class ArticleController { - - @Autowired - private ArticleService articleService; - @Autowired - private ArticleOperateRecordService articleOperateRecordService; - @Autowired - private DraftService draftService; - - /** - * @param tokenDTO - * @return - * @Author sun - * @Description 党建声音-政府端-可选发布范围 - **/ - @PostMapping("agencygridlist") - public Result agencyGridList(@LoginUser TokenDto tokenDTO) { - ArticleAgencyGridListResultDTO agencyGridList = new ArticleAgencyGridListResultDTO(); - agencyGridList.setAgencyGridList(articleService.agencyGridList(tokenDTO)); - return new Result().ok(agencyGridList); - } - - /** - * desc:政府端-点击返回按钮时,点击保存草稿 无需校验参数 - * @param fromDTO - * @throws Exception - */ - @PostMapping("savedraft") - @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) - public Result savedraft(@LoginUser TokenDto tokenDto,@RequestBody DraftContentFromDTO fromDTO) throws Exception { - DraftContentSaveResultDTO draftDTO = articleService.saveDraft(tokenDto, fromDTO); - return new Result().ok(draftDTO); - } - - /** - * desc:保存或修改草稿内容 - * @param fromDTO - * @throws Exception - */ - @PostMapping("savecontent") - @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) - public Result saveOrUpdateContent(@LoginUser TokenDto tokenDto,@RequestBody DraftContentFromDTO fromDTO) throws Exception { - DraftContentSaveResultDTO resultDTO = articleService.saveOrUpdateContent(tokenDto, fromDTO, true); - return new Result().ok(resultDTO); - } - - /** - * @param formDTO - * @return com.epmet.commons.tools.utils.Result> - * @author yinzuomei@elink-cn.com - * @description 政府端:查询文章操作记录 - * @date 2020/6/2 16:50 - **/ - @PostMapping("oprationlist") - public Result> operationList(@RequestBody ArticleOperationFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO, ArticleOperationFormDTO.AddUserInternalGroup.class); - List list = - articleOperateRecordService.listOfArticleOperation(formDTO.getArticleId()); - return new Result>().ok(list); - } - - /** - * @param formDTO - * @return com.epmet.commons.tools.utils.Result - * @author yinzuomei@elink-cn.com - * @description 政府端:(已发布、已下线)文章详情 - * @date 2020/6/3 9:44 - **/ - @PostMapping("articledetail") - public Result articleDetail(@RequestBody GovArticleDetailFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); - GovArticleDetailResultDTO articleDetail = articleService.queryGovArticleDetail(formDTO.getArticleId()); - return new Result().ok(articleDetail); - } - - /** - * @param formDTO 草稿id - * @return com.epmet.commons.tools.utils.Result - * @author yinzuomei@elink-cn.com - * @description 政府端:选中草稿编辑,获取草稿内容 - * @date 2020/6/3 13:18 - **/ - @PostMapping("getcontent") - @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DRAFT_EDIT) - public Result getContent(@RequestBody DraftDetailFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); - DraftContentResultDTO draftContent=draftService.queryDraftContent(formDTO); - return new Result().ok(draftContent); - } - - /** - * @param formDTO - * @return com.epmet.commons.tools.utils.Result - * @author yinzuomei@elink-cn.com - * @description 政府端:选中草稿编辑,获取草稿属性 - * @date 2020/6/3 13:51 - **/ - @PostMapping("getattr") - @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DRAFT_EDIT) - public Result getAttr(@RequestBody DraftDetailFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); - DraftAttrResultDTO draftAttrResultDTO=draftService.getDraftAttr(formDTO); - return new Result().ok(draftAttrResultDTO); - } - /** - * @param tokenDTO - * @return - * @Author sun - * @Description 党建声音-政府端-可选发布单位 - **/ - @PostMapping("publishagencylist") - public Result publishAgencyList(@LoginUser TokenDto tokenDTO) { - return new Result().ok(articleService.publishAgencyList(tokenDTO)); - } - - /** - * @param tokenDTO formDTO - * @return - * @Author sun - * @Description 党建声音-政府端-下线文章 - **/ - @PostMapping("offlinearticle") - @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_OFFLINE) - public Result offLineArticle(@LoginUser TokenDto tokenDTO, @RequestBody OffLineArticleFormDTO formDTO) { - formDTO.setStaffId(tokenDTO.getUserId()); - ValidatorUtils.validateEntity(formDTO, OffLineArticleFormDTO.AddUserInternalGroup.class); - articleService.offLineArticle(formDTO); - return new Result(); - } - - /** - * desc:保存草稿属性 - * @param fromDTO - * @throws Exception - */ - @PostMapping("saveattr") - @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) - public Result saveDraftAttr(@LoginUser TokenDto tokenDto,@RequestBody DraftAttrFromDTO fromDTO) throws Exception { - ValidatorUtils.validateEntity(fromDTO, DefaultGroup.class); - Boolean isSuccess = articleService.saveDraftAttr(tokenDto, fromDTO); - return new Result().ok(isSuccess); - } - - /** - * desc:预览保存草稿属性 - * @param fromDTO - * @throws Exception - */ - @PostMapping("previewsaveattr") - @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) - public Result previewSaveDraftAttr(@LoginUser TokenDto tokenDto,@RequestBody DraftAttrFromDTO fromDTO) throws Exception { - ValidatorUtils.validateEntity(fromDTO, DefaultGroup.class); - Boolean isSuccess = articleService.previewSaveDraftAttr(tokenDto, fromDTO); - return new Result().ok(isSuccess); - } - - /** - * desc:发布文章 - * @param formDTO - * @throws Exception - */ - @PostMapping("publish") - @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) - public Result publishArticle(@LoginUser TokenDto tokenDto, @RequestBody PublishArticleFormDTO formDTO) throws Exception { - Boolean isSuccess = articleService.publish(tokenDto, formDTO.getDraftId()); - if (isSuccess) { - scanContent(tokenDto, formDTO.getDraftId()); - } - return new Result().ok(isSuccess); - } - - @Async - public void scanContent(TokenDto tokenDto,String draftId){ - try { - SyncScanResult syncScanResult = articleService.scanContent(tokenDto, draftId); - if (syncScanResult == null) { - log.error("scanContent draftId:{} return result null", draftId); - } - - if (syncScanResult.isAllPass()) { - articleService.scanAllPassPublishArticle(tokenDto, draftId, syncScanResult); - } else { - articleService.updateAuditStatusFailById(draftId, syncScanResult); - } - } catch (Exception e) { - articleService.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL); - log.error("scanContent exception draftId:{} return result null", e); - } - } - - - /** - * 已发布文章列表 - * @author zhaoqifeng - * @date 2020/6/3 16:19 - * @param tokenDto - * @param formDTO - * @return com.epmet.commons.tools.utils.Result - */ - @PostMapping("publishedarticlelist") - @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISHED_LIST) - public Result> publishedArticleList(@LoginUser TokenDto tokenDto, @RequestBody PublishedListFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO); - List list = articleService.publishedArticleList(tokenDto, formDTO).getList(); - return new Result>().ok(list); - } - - - /** - * 已下线文章列表 - * @author zhaoqifeng - * @date 2020/6/3 16:19 - * @param tokenDto - * @param formDTO - * @return com.epmet.commons.tools.utils.Result - */ - @PostMapping("offlinearticlelist") - @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_OFFLINE_LIST) - public Result > offLineList(@LoginUser TokenDto tokenDto, @RequestBody OfflineListFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO); - List list = articleService.offlineList(tokenDto, formDTO).getList(); - return new Result >().ok(list); - } - /** - * @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播 - * @param commonArticleListFormDTO :: getGridId :: getNum - * @return List - * @author wangc - * @date 2020.06.02 16:13 - **/ - @PostMapping("resitoparticlelist") - public Result> resiTopArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO){ - ValidatorUtils.validateEntity(commonArticleListFormDTO, CommonArticleListFormDTO.ArticleBannerInternalGroup.class); - return new Result>().ok(articleService.getTopArticleList(commonArticleListFormDTO)); - } - - /** - * @Description 根据网格Id查找最新文章的相关信息列表 用处:居民端首页最新文章列表 - * @param commonArticleListFormDTO :: getGridId :: getNum - * @return List - * @author wangc - * @date 2020.06.03 09:53 - **/ - @PostMapping("resilatestarticlelist") - public Result> resiLatestArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO){ - ValidatorUtils.validateEntity(commonArticleListFormDTO, CommonArticleListFormDTO.ArticleBannerInternalGroup.class); - return new Result>().ok(articleService.getLatestArticleList(commonArticleListFormDTO)); - } - - /** - * @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表 - * @param articlePageFormDTO - * @return List - * @author wangc - * @date 2020.06.03 14:19 - **/ - @PostMapping("resiarticlelist") - public Result> resiArticleList(@RequestBody ArticlePageFormDTO articlePageFormDTO){ - ValidatorUtils.validateEntity(articlePageFormDTO,ArticlePageFormDTO.ArticlePageInternalGroup.class); - return new Result>().ok(articleService.getArticleList(articlePageFormDTO)); - } - - /** - * @param tokenDTO formDTO - * @return - * @Author sun - * @Description 党建声音-政府端-可下线网格列表 - **/ - @PostMapping("publishgridlist") - public Result publishGridList(@LoginUser TokenDto tokenDTO, @RequestBody PublishGridListFormDTO formDTO) { - formDTO.setStaffId(tokenDTO.getUserId()); - ValidatorUtils.validateEntity(formDTO, PublishGridListFormDTO.AddUserInternalGroup.class); - ArticleAgencyGridListResultDTO agencyGridList = new ArticleAgencyGridListResultDTO(); - agencyGridList.setAgencyGridList(articleService.publishGridList(formDTO)); - return new Result().ok(agencyGridList); - } - - - /** - * @Description 根绝文章Id查询出文章的内容、封面等相关信息,如果居民端传入的网格Id不在该文章的发布范围内,则返回NULL - * @param articleDetailFormDTO - * @return ArticleDetailResultDTO - * @author wangc - * @date 2020.06.03 18:28 - **/ - @PostMapping("resiarticledetail") - public Result resiArticleDetail(@RequestBody ResiArticleDetailFormDTO articleDetailFormDTO){ - ValidatorUtils.validateEntity(articleDetailFormDTO,ResiArticleDetailFormDTO.ResiArticleDetailInternalGroup.class); - return new Result().ok(articleService.getArticleDetail(articleDetailFormDTO)); - } - - /** - * @param formDTO - * @return com.epmet.commons.tools.utils.Result - * @author yinzuomei@elink-cn.com - * @description 政府端:文章预览 - * @date 2020/6/5 10:56 - **/ - @PostMapping("draftdetail") - public Result queryDraftDetail(@RequestBody DraftDetailFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); - DraftDetailResultDTO draftDetailResultDTO = draftService.queryDraftDetail(formDTO); - return new Result().ok(draftDetailResultDTO); - } + + @Autowired + private ArticleService articleService; + @Autowired + private ArticleOperateRecordService articleOperateRecordService; + @Autowired + private DraftService draftService; + + /** + * @param tokenDTO + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布范围 + **/ + @PostMapping("agencygridlist") + public Result agencyGridList(@LoginUser TokenDto tokenDTO) { + ArticleAgencyGridListResultDTO agencyGridList = new ArticleAgencyGridListResultDTO(); + agencyGridList.setAgencyGridList(articleService.agencyGridList(tokenDTO)); + return new Result().ok(agencyGridList); + } + + /** + * desc:政府端-点击返回按钮时,点击保存草稿 无需校验参数 + * + * @param fromDTO + * @throws Exception + */ + @PostMapping("savedraft") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) + public Result savedraft(@LoginUser TokenDto tokenDto, @RequestBody DraftContentFromDTO fromDTO) throws Exception { + DraftContentSaveResultDTO draftDTO = articleService.saveDraft(tokenDto, fromDTO); + return new Result().ok(draftDTO); + } + + /** + * desc:保存或修改草稿内容 + * + * @param fromDTO + * @throws Exception + */ + @PostMapping("savecontent") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) + public Result saveOrUpdateContent(@LoginUser TokenDto tokenDto, @RequestBody DraftContentFromDTO fromDTO) throws Exception { + DraftContentSaveResultDTO resultDTO = articleService.saveOrUpdateContent(tokenDto, fromDTO, true); + return new Result().ok(resultDTO); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei@elink-cn.com + * @description 政府端:查询文章操作记录 + * @date 2020/6/2 16:50 + **/ + @PostMapping("oprationlist") + public Result> operationList(@RequestBody ArticleOperationFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ArticleOperationFormDTO.AddUserInternalGroup.class); + List list = + articleOperateRecordService.listOfArticleOperation(formDTO.getArticleId()); + return new Result>().ok(list); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei@elink-cn.com + * @description 政府端:(已发布、已下线)文章详情 + * @date 2020/6/3 9:44 + **/ + @PostMapping("articledetail") + public Result articleDetail(@RequestBody GovArticleDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); + GovArticleDetailResultDTO articleDetail = articleService.queryGovArticleDetail(formDTO.getArticleId()); + return new Result().ok(articleDetail); + } + + /** + * @param formDTO 草稿id + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei@elink-cn.com + * @description 政府端:选中草稿编辑,获取草稿内容 + * @date 2020/6/3 13:18 + **/ + @PostMapping("getcontent") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DRAFT_EDIT) + public Result getContent(@RequestBody DraftDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); + DraftContentResultDTO draftContent = draftService.queryDraftContent(formDTO); + return new Result().ok(draftContent); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei@elink-cn.com + * @description 政府端:选中草稿编辑,获取草稿属性 + * @date 2020/6/3 13:51 + **/ + @PostMapping("getattr") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DRAFT_EDIT) + public Result getAttr(@RequestBody DraftDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); + DraftAttrResultDTO draftAttrResultDTO = draftService.getDraftAttr(formDTO); + return new Result().ok(draftAttrResultDTO); + } + + /** + * @param tokenDTO + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布单位 + **/ + @PostMapping("publishagencylist") + public Result publishAgencyList(@LoginUser TokenDto tokenDTO) { + return new Result().ok(articleService.publishAgencyList(tokenDTO)); + } + + /** + * @param tokenDTO formDTO + * @return + * @Author sun + * @Description 党建声音-政府端-下线文章 + **/ + @PostMapping("offlinearticle") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_OFFLINE) + public Result offLineArticle(@LoginUser TokenDto tokenDTO, @RequestBody OffLineArticleFormDTO formDTO) { + formDTO.setStaffId(tokenDTO.getUserId()); + ValidatorUtils.validateEntity(formDTO, OffLineArticleFormDTO.AddUserInternalGroup.class); + articleService.offLineArticle(formDTO); + return new Result(); + } + + /** + * desc:保存草稿属性 + * + * @param fromDTO + * @throws Exception + */ + @PostMapping("saveattr") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) + public Result saveDraftAttr(@LoginUser TokenDto tokenDto, @RequestBody DraftAttrFromDTO fromDTO) throws Exception { + ValidatorUtils.validateEntity(fromDTO, DefaultGroup.class); + Boolean isSuccess = articleService.saveDraftAttr(tokenDto, fromDTO); + return new Result().ok(isSuccess); + } + + /** + * desc:预览保存草稿属性 + * + * @param fromDTO + * @throws Exception + */ + @PostMapping("previewsaveattr") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) + public Result previewSaveDraftAttr(@LoginUser TokenDto tokenDto, @RequestBody DraftAttrFromDTO fromDTO) throws Exception { + ValidatorUtils.validateEntity(fromDTO, DefaultGroup.class); + Boolean isSuccess = articleService.previewSaveDraftAttr(tokenDto, fromDTO); + return new Result().ok(isSuccess); + } + + /** + * desc:发布文章 + * + * @param formDTO + * @throws Exception + */ + @PostMapping("publish") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) + public Result publishArticle(@LoginUser TokenDto tokenDto, @RequestBody PublishArticleFormDTO formDTO) throws Exception { + Boolean isSuccess = articleService.publish(tokenDto, formDTO.getDraftId()); + if (isSuccess) { + scanContent(tokenDto, formDTO.getDraftId()); + } + return new Result().ok(isSuccess); + } + + /** + * desc:人工确认无误后发布文章,不走审核接口 + * + * @param formDTO + * @throws Exception + */ + @PostMapping("manualpublish") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) + public Result manualPublish(@LoginUser TokenDto tokenDto, @RequestBody PublishArticleFormDTO formDTO) throws Exception { + articleService.manualPublish(tokenDto, formDTO.getDraftId()); + return new Result().ok(true); + } + + @Async + public void scanContent(TokenDto tokenDto, String draftId) { + try { + SyncScanResult syncScanResult = articleService.scanContent(tokenDto, draftId); + if (syncScanResult == null) { + log.error("scanContent draftId:{} return result null", draftId); + } + + if (syncScanResult.isAllPass()) { + articleService.scanAllPassPublishArticle(tokenDto, draftId, syncScanResult); + } else { + articleService.updateAuditStatusFailById(draftId, syncScanResult); + } + } catch (Exception e) { + articleService.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL); + log.error("scanContent exception draftId:{} return result null", e); + } + } + + + /** + * 已发布文章列表 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2020/6/3 16:19 + */ + @PostMapping("publishedarticlelist") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISHED_LIST) + public Result> publishedArticleList(@LoginUser TokenDto tokenDto, @RequestBody PublishedListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + List list = articleService.publishedArticleList(tokenDto, formDTO).getList(); + return new Result>().ok(list); + } + + + /** + * 已下线文章列表 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2020/6/3 16:19 + */ + @PostMapping("offlinearticlelist") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_OFFLINE_LIST) + public Result> offLineList(@LoginUser TokenDto tokenDto, @RequestBody OfflineListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + List list = articleService.offlineList(tokenDto, formDTO).getList(); + return new Result>().ok(list); + } + + /** + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播 + * @author wangc + * @date 2020.06.02 16:13 + **/ + @PostMapping("resitoparticlelist") + public Result> resiTopArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO) { + ValidatorUtils.validateEntity(commonArticleListFormDTO, CommonArticleListFormDTO.ArticleBannerInternalGroup.class); + return new Result>().ok(articleService.getTopArticleList(commonArticleListFormDTO)); + } + + /** + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @Description 根据网格Id查找最新文章的相关信息列表 用处:居民端首页最新文章列表 + * @author wangc + * @date 2020.06.03 09:53 + **/ + @PostMapping("resilatestarticlelist") + public Result> resiLatestArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO) { + ValidatorUtils.validateEntity(commonArticleListFormDTO, CommonArticleListFormDTO.ArticleBannerInternalGroup.class); + return new Result>().ok(articleService.getLatestArticleList(commonArticleListFormDTO)); + } + + /** + * @param articlePageFormDTO + * @return List + * @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表 + * @author wangc + * @date 2020.06.03 14:19 + **/ + @PostMapping("resiarticlelist") + public Result> resiArticleList(@RequestBody ArticlePageFormDTO articlePageFormDTO) { + ValidatorUtils.validateEntity(articlePageFormDTO, ArticlePageFormDTO.ArticlePageInternalGroup.class); + return new Result>().ok(articleService.getArticleList(articlePageFormDTO)); + } + + /** + * @param tokenDTO formDTO + * @return + * @Author sun + * @Description 党建声音-政府端-可下线网格列表 + **/ + @PostMapping("publishgridlist") + public Result publishGridList(@LoginUser TokenDto tokenDTO, @RequestBody PublishGridListFormDTO formDTO) { + formDTO.setStaffId(tokenDTO.getUserId()); + ValidatorUtils.validateEntity(formDTO, PublishGridListFormDTO.AddUserInternalGroup.class); + ArticleAgencyGridListResultDTO agencyGridList = new ArticleAgencyGridListResultDTO(); + agencyGridList.setAgencyGridList(articleService.publishGridList(formDTO)); + return new Result().ok(agencyGridList); + } + + + /** + * @param articleDetailFormDTO + * @return ArticleDetailResultDTO + * @Description 根绝文章Id查询出文章的内容、封面等相关信息,如果居民端传入的网格Id不在该文章的发布范围内,则返回NULL + * @author wangc + * @date 2020.06.03 18:28 + **/ + @PostMapping("resiarticledetail") + public Result resiArticleDetail(@RequestBody ResiArticleDetailFormDTO articleDetailFormDTO) { + ValidatorUtils.validateEntity(articleDetailFormDTO, ResiArticleDetailFormDTO.ResiArticleDetailInternalGroup.class); + return new Result().ok(articleService.getArticleDetail(articleDetailFormDTO)); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei@elink-cn.com + * @description 政府端:文章预览 + * @date 2020/6/5 10:56 + **/ + @PostMapping("draftdetail") + public Result queryDraftDetail(@RequestBody DraftDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); + DraftDetailResultDTO draftDetailResultDTO = draftService.queryDraftDetail(formDTO); + return new Result().ok(draftDetailResultDTO); + } } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java index 2a9837723f..b7ffc4a382 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java @@ -24,7 +24,10 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.DeleteDraftFormDTO; +import com.epmet.dto.form.DraftDetailFormDTO; import com.epmet.dto.form.DraftListFormDTO; +import com.epmet.dto.form.GovArticleDetailFormDTO; +import com.epmet.dto.result.DraftDetailResultDTO; import com.epmet.dto.result.DraftListResultDTO; import com.epmet.service.DraftService; import org.springframework.beans.factory.annotation.Autowired; @@ -70,4 +73,17 @@ public class DraftController { ValidatorUtils.validateEntity(formDTO); return new Result>().ok(draftService.draftList(tokenDto, formDTO).getList()); } + + /** + * desc:政府端:带封面的预览 + * @param formDTO + * @return + */ + @PostMapping("detailwithcover") + public Result detailWithCover(@RequestBody DraftDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); + formDTO.setShowCover(true); + DraftDetailResultDTO draftDetailResultDTO = draftService.queryDraftDetail(formDTO); + return new Result().ok(draftDetailResultDTO); + } } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java index eb2b026fb7..3b1021a004 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java @@ -103,6 +103,11 @@ public class ArticleEntity extends BaseEpmetEntity { */ private String tags; + /** + * 发布方式 自动审核后发布:autoAudit;人工确认无误发布(不审核):manualNoAudit + */ + private String publishWay; + /** * 组织ID */ diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java index 4a5424c8af..6b69368795 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -206,4 +206,12 @@ public interface ArticleService extends BaseService { * @return */ void updateDraftPublishStatus(String draftId,String statusFlag); + + /** + * desc:人工发布文章 不走审核接口 + * @param tokenDto + * @param draftId + * @return + */ + void manualPublish(TokenDto tokenDto, String draftId); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java index 2e3d296122..c5c4b74f0f 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -63,7 +63,6 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; @@ -322,7 +321,7 @@ public class ArticleServiceImpl extends BaseServiceImpl { offLineGridId.append(StrConstant.COLON).append(off.getGridId()); }); - recordEntity.setGridIds(offLineGridId.toString().replaceFirst(StrConstant.COLON,"")); + recordEntity.setGridIds(offLineGridId.toString().replaceFirst(StrConstant.COLON, "")); recordEntity.setContent(content); recordEntity.setOpType(ArticleConstant.OFFLINE); recordEntity.setOpTime(date); @@ -641,7 +640,7 @@ public class ArticleServiceImpl extends BaseServiceImpl NumConstant.ZERO) { draftContents.forEach(content -> { @@ -1006,16 +1008,16 @@ public class ArticleServiceImpl extends BaseServiceImpl updateGridTagCacheDTOS = this.updateGridTag(tokenDto, draftId, updateCustomerTagCacheDTO); + this.addArticleTags(updateCustomerTagCacheDTO, draftId, tokenDto, articleEntity.getCreatedTime()); + + //更新redis + try { + this.updateCacheCustomerTag(updateCustomerTagCacheDTO); + this.updateCacheGridTag(updateGridTagCacheDTOS); + } catch (Exception e) { + log.error("manualPublish update redis exception", e); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + } catch (RenException e) { + log.error("manualPublish exception", e); + } + } + /** * @param draftId diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java index 59e311c943..ceb961ac38 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java @@ -26,12 +26,14 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.DraftConstant; +import com.epmet.dao.DraftCoverDao; import com.epmet.dao.DraftDao; import com.epmet.dto.DraftDTO; import com.epmet.dto.form.DeleteDraftFormDTO; import com.epmet.dto.form.DraftDetailFormDTO; import com.epmet.dto.form.DraftListFormDTO; import com.epmet.dto.result.*; +import com.epmet.entity.DraftCoverEntity; import com.epmet.entity.DraftEntity; import com.epmet.service.DraftService; import com.github.pagehelper.PageHelper; @@ -39,6 +41,7 @@ import com.github.pagehelper.PageInfo; 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; import org.springframework.transaction.annotation.Transactional; @@ -57,6 +60,8 @@ import java.util.Map; public class DraftServiceImpl extends BaseServiceImpl implements DraftService { private Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired + private DraftCoverDao draftCoverDao; @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -179,6 +184,15 @@ public class DraftServiceImpl extends BaseServiceImpl imp }else{ draftDetailResultDTO.setTagNameList(new String[0]); } + if (formDTO.isShowCover()){ + DraftCoverEntity coverEntity = draftCoverDao.selectByDraftId(formDTO.getDraftId(), null); + if (coverEntity != null){ + CoverImgDTO coverImgDTO = ConvertUtils.sourceToTarget(coverEntity, CoverImgDTO.class); + draftDetailResultDTO.setCoverInfo(coverImgDTO); + }else{ + draftDetailResultDTO.setCoverInfo(new CoverImgDTO()); + } + } } return draftDetailResultDTO; } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.2__addAutoPublish.sql b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.2__addAutoPublish.sql new file mode 100644 index 0000000000..50dc5ea180 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.2__addAutoPublish.sql @@ -0,0 +1,2 @@ +ALTER TABLE `epmet_gov_voice`.`article` +ADD COLUMN `PUBLISH_WAY` varchar(16) NOT NULL DEFAULT 'autoAudit' COMMENT '发布方式 自动审核后发布:autoAudit;人工确认无误发布(不审核):manualNoAudit' AFTER `TAGS`; \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml index e97eb759b1..71330a10b8 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml @@ -142,7 +142,9 @@ ID AS "draftId", TITLE AS "title", IFNULL(PREVIEW_CONTENT, "") AS "content", - UNIX_TIMESTAMP(CREATED_TIME) AS "createdTime" + UNIX_TIMESTAMP(CREATED_TIME) AS "createdTime", + AUDIT_STATUS, + AUDIT_REASON FROM draft WHERE DEL_FLAG = '0' AND (STATUS_FLAG = 'unpublish' OR STATUS_FLAG = 'auditfail') @@ -169,7 +171,9 @@ + SELECT + count( 1 ) as totalNum + FROM + latest_act_info lai + WHERE + lai.DEL_FLAG = '0' + AND lai.CREATED_BY = #{userId} + \ No newline at end of file From 80eaa25d703e90f90598bbfb4774392990995086 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 20 Jul 2020 23:21:09 +0800 Subject: [PATCH 12/98] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=9C=80=E8=BF=91?= =?UTF-8?q?=E4=B8=80=E6=AC=A1=E7=BC=96=E8=BE=91=E7=9A=84=E6=B4=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/ActInfoDTO.java | 24 +-- .../java/com/epmet/dto/LatestActInfoDTO.java | 26 +-- .../work/ActDraftContentDTOResultDTO.java | 25 +++ .../work/LatestDraftActInfoResultDTO.java | 166 ++++++++++++++++++ .../controller/WorkActDraftController.java | 13 ++ .../com/epmet/dao/LatestActContentDao.java | 12 ++ .../java/com/epmet/dao/LatestActInfoDao.java | 11 +- .../java/com/epmet/entity/ActInfoEntity.java | 22 +-- .../com/epmet/entity/LatestActInfoEntity.java | 22 +-- .../service/LatestActContentService.java | 10 ++ .../epmet/service/LatestActInfoService.java | 10 ++ .../epmet/service/WorkActDraftService.java | 10 ++ .../impl/LatestActContentServiceImpl.java | 13 ++ .../impl/LatestActInfoServiceImpl.java | 13 ++ .../service/impl/WorkActDraftServiceImpl.java | 28 +++ .../src/main/resources/mapper/ActInfoDao.xml | 16 +- .../resources/mapper/LatestActContentDao.xml | 13 ++ .../resources/mapper/LatestActInfoDao.xml | 59 ++++++- 18 files changed, 429 insertions(+), 64 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActDraftContentDTOResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java index b7a63122b9..0a30122f04 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java @@ -17,11 +17,11 @@ package com.epmet.dto; -import java.io.Serializable; -import java.util.Date; import lombok.Data; +import java.io.Serializable; import java.math.BigDecimal; +import java.util.Date; /** * 活动信息 @@ -57,12 +57,12 @@ public class ActInfoDTO implements Serializable { /** * 报名开始时间 */ - private Date signupStartTime; + private Date signUpStartTime; /** * 报名截止时间 */ - private Date signupEndTime; + private Date signUpEndTime; /** * 招募要求 @@ -97,17 +97,17 @@ public class ActInfoDTO implements Serializable { /** * 打卡开始时间 */ - private Date signinStartTime; + private Date signInStartTime; /** * 打卡截止时间 */ - private Date signinEndTime; + private Date signInEndTime; /** * 活动签到打卡地点 */ - private String signinAddress; + private String signInAddress; /** * 活动签到打卡位置经度 @@ -117,17 +117,17 @@ public class ActInfoDTO implements Serializable { /** * 活动签到打卡位置纬度 */ - private BigDecimal signinLatitude; + private BigDecimal signInLatitude; /** * 活动签到打卡半径(单位:米) */ - private Integer signinRadius; + private Integer signInRadius; /** * 活动名额类型(0-不限名额,1-固定名额) */ - private Integer actQuotaCategory; + private Boolean actQuotaCategory; /** * 活动名额 @@ -190,12 +190,12 @@ public class ActInfoDTO implements Serializable { /** * 身份限制:1只有志愿者才可以参加活动0不限制志愿者身份 */ - private Integer volunteerLimit; + private Boolean volunteerLimit; /** * 审核开关:1报名人员需要人工审核0不需要 */ - private Integer auditSwitch; + private Boolean auditSwitch; /** * 活动实际开始时间 diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java index 56fd782ed6..68c34830cf 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java @@ -17,11 +17,11 @@ package com.epmet.dto; -import java.io.Serializable; -import java.util.Date; import lombok.Data; +import java.io.Serializable; import java.math.BigDecimal; +import java.util.Date; /** * 最近一次编辑的活动信息 @@ -57,12 +57,12 @@ public class LatestActInfoDTO implements Serializable { /** * 报名开始时间 */ - private Date signupStartTime; + private Date signUpStartTime; /** * 报名截止时间 */ - private Date signupEndTime; + private Date signUpEndTime; /** * 招募要求 @@ -97,37 +97,37 @@ public class LatestActInfoDTO implements Serializable { /** * 打卡开始时间 */ - private Date signinStartTime; + private Date signInStartTime; /** * 打卡截止时间 */ - private Date signinEndTime; + private Date signInEndTime; /** * 活动签到打卡地点 */ - private String signinAddress; + private String signInAddress; /** * 活动签到打卡位置经度 */ - private BigDecimal signinLongitude; + private BigDecimal signInLongitude; /** * 活动签到打卡位置纬度 */ - private BigDecimal signinLatitude; + private BigDecimal signInLatitude; /** * 活动签到打卡半径(单位:米) */ - private Integer signinRadius; + private Integer signInRadius; /** * 活动名额类型(0-不限名额,1-固定名额) */ - private Integer actQuotaCategory; + private Boolean actQuotaCategory; /** * 活动名额 @@ -172,12 +172,12 @@ public class LatestActInfoDTO implements Serializable { /** * 身份限制:1只有志愿者才可以参加活动0不限制志愿者身份 */ - private Integer volunteerLimit; + private Boolean volunteerLimit; /** * 审核开关:1报名人员需要人工审核0不需要 */ - private Integer auditSwitch; + private Boolean auditSwitch; /** * 乐观锁 diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActDraftContentDTOResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActDraftContentDTOResultDTO.java new file mode 100644 index 0000000000..845efcb65c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActDraftContentDTOResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 获取最近一次编辑的活动内容-返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/20 21:58 + */ +@Data +public class ActDraftContentDTOResultDTO implements Serializable { + private static final long serialVersionUID = 7937967625440168599L; + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java new file mode 100644 index 0000000000..3f5a6dacaa --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java @@ -0,0 +1,166 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * 获取最近一次编辑的活动-返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/20 21:54 + */ +@Data +public class LatestDraftActInfoResultDTO implements Serializable { + private static final long serialVersionUID = 4104775168048712734L; + private String actDraftId; + /** + * 客户id + */ + private String customerId; + + /** + * 活动标题 + */ + private String title; + + /** + * 活动封面 + */ + private String coverPic; + + /** + * 报名开始时间 + */ + @JsonFormat(pattern="yyyy-MM-dd HH:mm") + private Date signUpStartTime; + + /** + * 报名截止时间 + */ + @JsonFormat(pattern="yyyy-MM-dd HH:mm") + private Date signUpEndTime; + + /** + * 招募要求 + */ + private String requirement; + + /** + * 活动预计开始时间 + */ + @JsonFormat(pattern="yyyy-MM-dd HH:mm") + private Date actStartTime; + + /** + * 活动预计结束时间 + */ + @JsonFormat(pattern="yyyy-MM-dd HH:mm") + private Date actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动位置经度 + */ + private BigDecimal actLongitude; + + /** + * 活动位置纬度 + */ + private BigDecimal actLatitude; + + /** + * 签到开始时间 + */ + @JsonFormat(pattern="yyyy-MM-dd HH:mm") + private Date signInStartTime; + + /** + * 签到截止时间 + */ + @JsonFormat(pattern="yyyy-MM-dd HH:mm") + private Date signInEndTime; + + /** + * 活动签到打卡地点 + */ + private String signInAddress; + + /** + * 活动签到打卡位置经度 + */ + private BigDecimal signInLongitude; + + /** + * 活动签到打卡位置纬度 + */ + private BigDecimal signInLatitude; + + /** + * 活动签到打卡半径(单位:米) + */ + private Integer signInRadius; + + /** + * 活动名额类型(0-不限名额,1-固定名额) + */ + private Boolean actQuotaCategory; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 联系人 + */ + private String sponsorContacts; + + /** + * 联系电话 + */ + private String sponsorTel; + + /** + * 主办方类型:网格主办:grid;组织主办:agency + */ + private String sponsorType; + + /** + * 主办方id(机关或网格的id) + */ + private String sponsorId; + + /** + * 活动主办方名称(机关或网格的名称) + */ + private String sponsorName; + + /** + * 活动奖励积分 + */ + private Integer reward; + + /** + * 身份限制:1只有志愿者才可以参加活动0不限制志愿者身份 + */ + private Boolean volunteerLimit; + + /** + * 审核开关:1报名人员需要人工审核0不需要 + */ + private Boolean auditSwitch; + + /** + * 活动内容- + */ + private List actContentList; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java index 9d7b410a47..c224a270a9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java @@ -2,6 +2,7 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.work.PublishActInitResultDTO; +import com.epmet.dto.result.work.LatestDraftActInfoResultDTO; import com.epmet.service.WorkActDraftService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -47,4 +48,16 @@ public class WorkActDraftController { return new Result(); } + /** + * @return com.epmet.commons.tools.utils.Result + * @param + * @author yinzuomei + * @description 获取最近一次编辑的活动,用户选择继续编辑上次的活动 + * @Date 2020/7/20 21:56 + **/ + @PostMapping("latestdraft") + public Result getLatestDraft(){ + LatestDraftActInfoResultDTO resultDTO=workActDraftService.getLatestDraft(); + return new Result().ok(resultDTO); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActContentDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActContentDao.java index fdfc4da871..12568cd4e6 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActContentDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActContentDao.java @@ -18,9 +18,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.work.ActDraftContentDTOResultDTO; import com.epmet.entity.LatestActContentEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 最近一次编辑的活动内容 * @@ -38,4 +41,13 @@ public interface LatestActContentDao extends BaseDao { * @Date 2020/7/20 18:35 **/ int updateToDelByActId(String actId); + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 根据latest_act_info.id查询活动内容,已排序 + * @Date 2020/7/20 23:01 + **/ + List selectActContentList(String actId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActInfoDao.java index 65cd470efd..0cd96b4a67 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActInfoDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActInfoDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.work.LatestDraftActInfoResultDTO; import com.epmet.entity.LatestActInfoEntity; import org.apache.ibatis.annotations.Mapper; @@ -31,12 +32,20 @@ import org.apache.ibatis.annotations.Mapper; public interface LatestActInfoDao extends BaseDao { /** - * @return java.lang.Integer * @param userId + * @return java.lang.Integer * @author yinzuomei * @description 查询当前用户保留的活动记录 * @Date 2020/7/20 18:06 **/ Integer countByUserId(String userId); + /** + * @param userId + * @return com.epmet.dto.result.work.LatestDraftActInfoResultDTO + * @author yinzuomei + * @description 获取用户最近一次编辑的活动信息 + * @Date 2020/7/20 23:05 + **/ + LatestDraftActInfoResultDTO selectLatestActDraft(String userId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java index 36bda96989..c92f1733b2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java @@ -57,12 +57,12 @@ public class ActInfoEntity extends BaseEpmetEntity { /** * 报名开始时间 */ - private Date signupStartTime; + private Date signUpStartTime; /** * 报名截止时间 */ - private Date signupEndTime; + private Date signUpEndTime; /** * 招募要求 @@ -97,32 +97,32 @@ public class ActInfoEntity extends BaseEpmetEntity { /** * 打卡开始时间 */ - private Date signinStartTime; + private Date signInStartTime; /** * 打卡截止时间 */ - private Date signinEndTime; + private Date signInEndTime; /** * 活动签到打卡地点 */ - private String signinAddress; + private String signInAddress; /** * 活动签到打卡位置经度 */ - private BigDecimal signinLongitude; + private BigDecimal signInLongitude; /** * 活动签到打卡位置纬度 */ - private BigDecimal signinLatitude; + private BigDecimal signInLatitude; /** * 活动签到打卡半径(单位:米) */ - private Integer signinRadius; + private Integer signInRadius; /** * 活动名额类型(0-不限名额,1-固定名额) @@ -190,12 +190,12 @@ public class ActInfoEntity extends BaseEpmetEntity { /** * 身份限制:1只有志愿者才可以参加活动0不限制志愿者身份 */ - private Integer volunteerLimit; + private Boolean volunteerLimit; /** * 审核开关:1报名人员需要人工审核0不需要 */ - private Integer auditSwitch; + private Boolean auditSwitch; /** * 活动实际开始时间 @@ -215,6 +215,6 @@ public class ActInfoEntity extends BaseEpmetEntity { /** * 1已经总结0未总结 */ - private Integer summaryFlag; + private Boolean summaryFlag; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java index 24716be77c..df12c12dc0 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java @@ -57,12 +57,12 @@ public class LatestActInfoEntity extends BaseEpmetEntity { /** * 报名开始时间 */ - private Date signupStartTime; + private Date signUpStartTime; /** * 报名截止时间 */ - private Date signupEndTime; + private Date signUpEndTime; /** * 招募要求 @@ -97,37 +97,37 @@ public class LatestActInfoEntity extends BaseEpmetEntity { /** * 打卡开始时间 */ - private Date signinStartTime; + private Date signInStartTime; /** * 打卡截止时间 */ - private Date signinEndTime; + private Date signInEndTime; /** * 活动签到打卡地点 */ - private String signinAddress; + private String signInAddress; /** * 活动签到打卡位置经度 */ - private BigDecimal signinLongitude; + private BigDecimal signInLongitude; /** * 活动签到打卡位置纬度 */ - private BigDecimal signinLatitude; + private BigDecimal signInLatitude; /** * 活动签到打卡半径(单位:米) */ - private Integer signinRadius; + private Integer signInRadius; /** * 活动名额类型(0-不限名额,1-固定名额) */ - private Integer actQuotaCategory; + private Boolean actQuotaCategory; /** * 活动名额 @@ -172,11 +172,11 @@ public class LatestActInfoEntity extends BaseEpmetEntity { /** * 身份限制:1只有志愿者才可以参加活动0不限制志愿者身份 */ - private Integer volunteerLimit; + private Boolean volunteerLimit; /** * 审核开关:1报名人员需要人工审核0不需要 */ - private Integer auditSwitch; + private Boolean auditSwitch; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActContentService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActContentService.java index bf6dbde152..cc56738beb 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActContentService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActContentService.java @@ -20,6 +20,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.LatestActContentDTO; +import com.epmet.dto.result.work.ActDraftContentDTOResultDTO; import com.epmet.entity.LatestActContentEntity; import java.util.List; @@ -101,4 +102,13 @@ public interface LatestActContentService extends BaseService + * @param actId + * @author yinzuomei + * @description 根据latest_act_info.id查询活动内容,已排序 + * @Date 2020/7/20 22:59 + **/ + List selectActContentList(String actId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActInfoService.java index 5a17ae2c45..347fe62c5b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActInfoService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActInfoService.java @@ -20,6 +20,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.LatestActInfoDTO; +import com.epmet.dto.result.work.LatestDraftActInfoResultDTO; import com.epmet.entity.LatestActInfoEntity; import java.util.List; @@ -110,4 +111,13 @@ public interface LatestActInfoService extends BaseService { * @Date 2020/7/20 18:17 **/ void deleteAllDraft(String userId); + + /** + * @return com.epmet.dto.result.work.LatestDraftActInfoResultDTO + * @param userId + * @author yinzuomei + * @description 获取用户最近一次编辑的活动信息 + * @Date 2020/7/20 22:59 + **/ + LatestDraftActInfoResultDTO getLatestActDraft(String userId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java index 5c8e317e88..016a8e9564 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java @@ -1,6 +1,7 @@ package com.epmet.service; import com.epmet.dto.form.work.PublishActInitResultDTO; +import com.epmet.dto.result.work.LatestDraftActInfoResultDTO; /** * 工作端活动草稿 @@ -27,4 +28,13 @@ public interface WorkActDraftService { * @Date 2020/7/20 18:15 **/ void deleteDraft(); + + /** + * @return com.epmet.dto.result.work.LatestDraftActInfoResultDTO + * @param + * @author yinzuomei + * @description 获取最近一次编辑的活动 + * @Date 2020/7/20 22:29 + **/ + LatestDraftActInfoResultDTO getLatestDraft(); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java index fca1156449..3c513d983e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java @@ -25,6 +25,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.LatestActContentDao; import com.epmet.dto.LatestActContentDTO; +import com.epmet.dto.result.work.ActDraftContentDTOResultDTO; import com.epmet.entity.LatestActContentEntity; import com.epmet.redis.LatestActContentRedis; import com.epmet.service.LatestActContentService; @@ -114,4 +115,16 @@ public class LatestActContentServiceImpl extends BaseServiceImpl + * @author yinzuomei + * @description 根据latest_act_info.id查询活动内容,已排序 + * @Date 2020/7/20 22:59 + **/ + @Override + public List selectActContentList(String actId) { + return baseDao.selectActContentList(actId); + } + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActInfoServiceImpl.java index 2ba5a45d53..ee6022f70b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActInfoServiceImpl.java @@ -26,6 +26,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.LatestActInfoDao; import com.epmet.dto.LatestActInfoDTO; +import com.epmet.dto.result.work.LatestDraftActInfoResultDTO; import com.epmet.entity.LatestActInfoEntity; import com.epmet.redis.LatestActInfoRedis; import com.epmet.service.LatestActContentService; @@ -138,5 +139,17 @@ public class LatestActInfoServiceImpl extends BaseServiceImpl actContentList=latestActContentService.selectActContentList(latestAct.getActDraftId()); + latestAct.setActContentList(actContentList); + } + }else{ + logger.warn("loginUserUtil.getLoginUserId()获取当前用户id为空"); + } + return null; + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml index c6f4d40c0b..5f95eb5ee2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml @@ -8,20 +8,20 @@ - - + + - - - - - - + + + + + + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActContentDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActContentDao.xml index d6f4181e6f..61e18e4f89 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActContentDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActContentDao.xml @@ -24,4 +24,17 @@ WHERE ACT_ID = #{actId} + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml index cad09d0638..9c860a03b2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml @@ -8,20 +8,20 @@ - - + + - - - - - - + + + + + + @@ -52,4 +52,47 @@ AND lai.CREATED_BY = #{userId} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 944b734933c23c6cdb71f4bb56700e05b646a1d4 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 21 Jul 2020 12:50:16 +0800 Subject: [PATCH 13/98] =?UTF-8?q?heart-=E5=B1=85=E6=B0=91=E7=AB=AF?= =?UTF-8?q?=EF=BC=9A/resi/getconfigs=E6=8E=A5=E5=8F=A3=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../work/CustomerHeartConfigsResultDTO.java | 51 +++++++++++++++++++ .../controller/ActCustomizedController.java | 15 ++++++ .../java/com/epmet/dao/ActCustomizedDao.java | 10 ++++ .../epmet/service/ActCustomizedService.java | 10 ++++ .../impl/ActCustomizedServiceImpl.java | 14 +++++ .../resources/mapper/ActCustomizedDao.xml | 18 +++++++ 6 files changed, 118 insertions(+) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CustomerHeartConfigsResultDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CustomerHeartConfigsResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CustomerHeartConfigsResultDTO.java new file mode 100644 index 0000000000..d1a5c05b6c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CustomerHeartConfigsResultDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 12:45 + */ +@Data +public class CustomerHeartConfigsResultDTO implements Serializable { + /** + * act_customized主键 + */ + @JsonIgnore + private String actCustomizedId; + + /** + * 标题:志愿者去哪儿 + */ + private String titleName; + + /** + * 咨询热线 + */ + private String hotLine; + + /** + * 活动列表 + */ + private String actListName; + + /** + * 爱心榜 + */ + private String heartRankName; + + /** + * 活动回顾 + */ + private String actReviewName; + + /** + * 我的活动 + */ + private String myActName; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ActCustomizedController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ActCustomizedController.java index c65621aae9..a2ce0f1972 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ActCustomizedController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ActCustomizedController.java @@ -22,6 +22,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.work.ActCustomizedFormDTO; import com.epmet.dto.form.work.SaveActCustomizedFormDTO; import com.epmet.dto.result.work.ActCustomizedResultDTO; +import com.epmet.dto.result.work.CustomerHeartConfigsResultDTO; import com.epmet.service.ActCustomizedService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -70,4 +71,18 @@ public class ActCustomizedController { actCustomizedService.saveConfigs(formDTO); return new Result(); } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 居民端根据客户id获取爱心互助自定义配置 + * @Date 2020/7/21 12:47 + **/ + @PostMapping("/resi/getconfigs") + public Result getCustomerHeartConfigs(@RequestBody ActCustomizedFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ActCustomizedFormDTO.AddUserInternalGroup.class); + CustomerHeartConfigsResultDTO resultDTO = actCustomizedService.getCustomerHeartConfigs(formDTO); + return new Result().ok(resultDTO); + } } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActCustomizedDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActCustomizedDao.java index 80a94700f9..440c2cb81f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActCustomizedDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActCustomizedDao.java @@ -19,6 +19,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.result.work.ActCustomizedResultDTO; +import com.epmet.dto.result.work.CustomerHeartConfigsResultDTO; import com.epmet.entity.ActCustomizedEntity; import org.apache.ibatis.annotations.Mapper; @@ -39,4 +40,13 @@ public interface ActCustomizedDao extends BaseDao { * @Date 2020/7/20 17:04 **/ ActCustomizedResultDTO selectConfigsByCustomerId(String customerId); + + /** + * @return com.epmet.dto.result.work.CustomerHeartConfigsResultDTO + * @param customerId + * @author yinzuomei + * @description 居民端根据客户id获取爱心互助自定义配置 + * @Date 2020/7/21 12:48 + **/ + CustomerHeartConfigsResultDTO selectCustomerHeartConfigs(String customerId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActCustomizedService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActCustomizedService.java index 3d539c4076..7c56084f81 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActCustomizedService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActCustomizedService.java @@ -23,6 +23,7 @@ import com.epmet.dto.ActCustomizedDTO; import com.epmet.dto.form.work.ActCustomizedFormDTO; import com.epmet.dto.form.work.SaveActCustomizedFormDTO; import com.epmet.dto.result.work.ActCustomizedResultDTO; +import com.epmet.dto.result.work.CustomerHeartConfigsResultDTO; import com.epmet.entity.ActCustomizedEntity; import java.util.List; @@ -113,4 +114,13 @@ public interface ActCustomizedService extends BaseService { * @Date 2020/7/20 17:26 **/ void saveConfigs(SaveActCustomizedFormDTO formDTO); + + /** + * @return com.epmet.dto.result.work.CustomerHeartConfigsResultDTO + * @param formDTO + * @author yinzuomei + * @description 居民端根据客户id获取爱心互助自定义配置 + * @Date 2020/7/21 12:47 + **/ + CustomerHeartConfigsResultDTO getCustomerHeartConfigs(ActCustomizedFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActCustomizedServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActCustomizedServiceImpl.java index d3f5539d70..1cd0baa3df 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActCustomizedServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActCustomizedServiceImpl.java @@ -29,6 +29,7 @@ import com.epmet.dto.ActCustomizedDTO; import com.epmet.dto.form.work.ActCustomizedFormDTO; import com.epmet.dto.form.work.SaveActCustomizedFormDTO; import com.epmet.dto.result.work.ActCustomizedResultDTO; +import com.epmet.dto.result.work.CustomerHeartConfigsResultDTO; import com.epmet.entity.ActCustomizedEntity; import com.epmet.redis.ActCustomizedRedis; import com.epmet.service.ActCustomizedService; @@ -158,4 +159,17 @@ public class ActCustomizedServiceImpl extends BaseServiceImpl + + + + \ No newline at end of file From 2b11e715c2c3fd10dc602ee74cad8455845c51d2 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 21 Jul 2020 12:50:45 +0800 Subject: [PATCH 14/98] =?UTF-8?q?heart-=E5=B1=85=E6=B0=91=E7=AB=AF?= =?UTF-8?q?=EF=BC=9A/resi/getconfigs=E6=8E=A5=E5=8F=A3=E6=8F=90=E4=BA=A4,?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/result/work/CustomerHeartConfigsResultDTO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CustomerHeartConfigsResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CustomerHeartConfigsResultDTO.java index d1a5c05b6c..135a9d539e 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CustomerHeartConfigsResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CustomerHeartConfigsResultDTO.java @@ -6,7 +6,7 @@ import lombok.Data; import java.io.Serializable; /** - * 描述一下 + * 居民端根据客户id获取爱心互助自定义配置-返参DTO * * @author yinzuomei@elink-cn.com * @date 2020/7/21 12:45 From 1c83d3a22c5676c684f3d9d33964458d059c2cef Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 21 Jul 2020 14:02:42 +0800 Subject: [PATCH 15/98] =?UTF-8?q?heart-work=EF=BC=9Asaveact=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/work/SaveActContentFormDTO.java | 31 +++ .../dto/form/work/SaveActInfoFormDTO.java | 182 ++++++++++++++++++ .../work/LatestDraftActInfoResultDTO.java | 3 + .../work/PublishActInitResultDTO.java | 2 +- .../result/work/SaveActDraftResultDTO.java | 21 ++ .../controller/WorkActDraftController.java | 20 +- .../epmet/service/WorkActDraftService.java | 13 +- .../service/impl/WorkActDraftServiceImpl.java | 16 +- 8 files changed, 284 insertions(+), 4 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActContentFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActInfoFormDTO.java rename epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/{form => result}/work/PublishActInitResultDTO.java (91%) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/SaveActDraftResultDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActContentFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActContentFormDTO.java new file mode 100644 index 0000000000..3117a66132 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActContentFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form.work; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 活动内容 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 13:18 + */ +@Data +public class SaveActContentFormDTO implements Serializable { + private static final long serialVersionUID = 5236509944250440348L; + public interface UserInternalGroup {} + public interface UserShowGroup extends CustomerClientShowGroup {} + /** + * 内容 + */ + @NotBlank(message = "内容不能为空", groups = {UserShowGroup.class }) + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + @NotBlank(message = "内容类型不能为空,图片:img;文字:text", groups = {UserInternalGroup.class }) + private String contentType; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActInfoFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActInfoFormDTO.java new file mode 100644 index 0000000000..39df684d03 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActInfoFormDTO.java @@ -0,0 +1,182 @@ +package com.epmet.dto.form.work; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.Valid; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * 预览-保存活动草稿入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 13:17 + */ +@Data +public class SaveActInfoFormDTO implements Serializable { + private static final long serialVersionUID = -4967079570884814526L; + public interface AddUserInternalGroup {} + public interface AddUserShowGroup extends CustomerClientShowGroup {} + @Valid + private List actContent; + + /** + * 活动草稿id,如果是编辑之前的活动草稿,此列是有值的 + */ + private String actDraftId; + + + /** + * 如果是重新发布活动,此列是有值的 + */ + private String actId; + + /** + * 活动标题 + */ + @NotBlank(message = "活动标题不能为空", groups = {AddUserShowGroup.class }) + private String title; + + /** + * 封面图 + */ + @NotBlank(message = "封面图不能为空", groups = {AddUserShowGroup.class }) + private String coverPic; + + /** + * 活动地点 + */ + @NotBlank(message = "活动地点不能为空", groups = {AddUserShowGroup.class }) + private String actAddress; + + /** + * 活动地点-经度 + */ + @NotBlank(message = "活动地点经度不能为空", groups = {AddUserInternalGroup.class }) + private String actLongitude; + + /** + * 活动地点-纬度 + */ + @NotBlank(message = "活动地点经度不能为空", groups = {AddUserInternalGroup.class }) + private String actLatitude; + + /** + * 活动预计开始时间yyyy-MM-dd HH:mm + */ + @NotBlank(message = "活动预计开始时间不能为空", groups = {AddUserShowGroup.class }) + private String actStartTime; + + /** + * 活动预计结束时间yyyy-MM-dd HH:mm + */ + @NotBlank(message = "活动预计结束时间不能为空", groups = {AddUserShowGroup.class }) + private String actEndTime; + + /** + * 活动人数 + */ + @Min(0) + private Integer actQuota; + + /** + * 活动积分 + */ + @Min(0) + private Integer reward; + + /** + * 报名审核:true:只有志愿者才可以参加活动,false: 只要是居民就可以参加活动 + */ + @NotNull(message = "报名身份不能为空",groups = {AddUserInternalGroup.class}) + private Boolean volunteerLimit; + + /** + * 报名审核: true: 需人工审核 false: 无需审核 + */ + @NotNull(message = "报名审核方式不能为空",groups = {AddUserInternalGroup.class}) + private Boolean auditSwitch; + + /** + * 报名截止时间:yyyy-MM-dd HH:mm + */ + @NotBlank(message = "报名截止时间不能为空", groups = {AddUserShowGroup.class }) + private String signUpEndTime; + + /** + * 报名条件 + */ + @NotBlank(message = "报名条件不能为空", groups = {AddUserShowGroup.class }) + private String requirement; + + /** + * 签到开始时间:yyyy-MM-dd HH:mm + */ + @NotBlank(message = "签到开始时间不能为空", groups = {AddUserShowGroup.class }) + private String signInStartTime; + + /** + * 签到结束时间: yyyy-MM-dd HH:mm + */ + @NotBlank(message = "签到结束时间不能为空", groups = {AddUserShowGroup.class }) + private String signInEndTime; + + /** + * 签到地址 + */ + @NotBlank(message = "签到地址不能为空", groups = {AddUserShowGroup.class }) + private String signInAddress; + + /** + * 签到地址-纬度 + */ + @NotBlank(message = "签到地址-纬度不能为空", groups = {AddUserInternalGroup.class }) + private String signInLatitude; + + /** + * 签到地址-经度 + */ + @NotBlank(message = "签到地址-经度不能为空", groups = {AddUserInternalGroup.class }) + private String signInLongitude; + + /** + * 签到有效范围(米) + */ + @Min(0) + private Integer signInRadius; + + /** + * 主办方id + */ + @NotBlank(message = "主办方id不能为空", groups = {AddUserInternalGroup.class }) + private String sponsorId; + + /** + * 主办方类型:以网格名义:grid , 以机关名义: agency + */ + @NotBlank(message = "主办方类型不能为空", groups = {AddUserInternalGroup.class }) + private String sponsorType; + + /** + * 主办方名称 + */ + @NotBlank(message = "主办方名称不能为空", groups = {AddUserShowGroup.class }) + private String sponsorName; + + /** + * 联系人 + */ + @NotBlank(message = "联系人不能为空", groups = {AddUserShowGroup.class }) + private String sponsorContacts; + + /** + * 联系电话 + */ + @NotBlank(message = "联系电话不能为空", groups = {AddUserShowGroup.class }) + private String sponsorTel; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java index 3f5a6dacaa..4e3e933be4 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java @@ -17,6 +17,9 @@ import java.util.List; @Data public class LatestDraftActInfoResultDTO implements Serializable { private static final long serialVersionUID = 4104775168048712734L; + /** + * 活动草稿id + */ private String actDraftId; /** * 客户id diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInitResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PublishActInitResultDTO.java similarity index 91% rename from epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInitResultDTO.java rename to epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PublishActInitResultDTO.java index 94b9e8b7af..08c3ff1d97 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInitResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PublishActInitResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.dto.form.work; +package com.epmet.dto.result.work; import lombok.Data; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/SaveActDraftResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/SaveActDraftResultDTO.java new file mode 100644 index 0000000000..248519fc28 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/SaveActDraftResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 预览-保存活动草稿返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 12:53 + */ +@Data +public class SaveActDraftResultDTO implements Serializable { + private static final long serialVersionUID = -111427814347693729L; + + /** + * 活动草稿id + */ + private String actDraftId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java index c224a270a9..69645c02a5 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java @@ -1,11 +1,15 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.work.PublishActInitResultDTO; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.work.SaveActInfoFormDTO; import com.epmet.dto.result.work.LatestDraftActInfoResultDTO; +import com.epmet.dto.result.work.PublishActInitResultDTO; +import com.epmet.dto.result.work.SaveActDraftResultDTO; import com.epmet.service.WorkActDraftService; 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; @@ -60,4 +64,18 @@ public class WorkActDraftController { LatestDraftActInfoResultDTO resultDTO=workActDraftService.getLatestDraft(); return new Result().ok(resultDTO); } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 预览按下-调用此接口保存活动信息、活动内容 + * @Date 2020/7/21 14:00 + **/ + @PostMapping("saveact") + public Result saveAct(@RequestBody SaveActInfoFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + SaveActDraftResultDTO resultDTO=workActDraftService.saveAct(formDTO); + return new Result().ok(resultDTO); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java index 016a8e9564..6e56268955 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java @@ -1,7 +1,9 @@ package com.epmet.service; -import com.epmet.dto.form.work.PublishActInitResultDTO; +import com.epmet.dto.form.work.SaveActInfoFormDTO; import com.epmet.dto.result.work.LatestDraftActInfoResultDTO; +import com.epmet.dto.result.work.PublishActInitResultDTO; +import com.epmet.dto.result.work.SaveActDraftResultDTO; /** * 工作端活动草稿 @@ -37,4 +39,13 @@ public interface WorkActDraftService { * @Date 2020/7/20 22:29 **/ LatestDraftActInfoResultDTO getLatestDraft(); + + /** + * @return com.epmet.dto.result.work.SaveActDraftResultDTO + * @param formDTO + * @author yinzuomei + * @description 预览按下-调用此接口保存活动信息、活动内容 + * @Date 2020/7/21 14:00 + **/ + SaveActDraftResultDTO saveAct(SaveActInfoFormDTO formDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java index 4fbe13acf7..c2ea713fc7 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java @@ -1,9 +1,11 @@ package com.epmet.service.impl; import com.epmet.commons.tools.security.user.LoginUserUtil; -import com.epmet.dto.form.work.PublishActInitResultDTO; +import com.epmet.dto.form.work.SaveActInfoFormDTO; import com.epmet.dto.result.work.ActDraftContentDTOResultDTO; import com.epmet.dto.result.work.LatestDraftActInfoResultDTO; +import com.epmet.dto.result.work.PublishActInitResultDTO; +import com.epmet.dto.result.work.SaveActDraftResultDTO; import com.epmet.service.LatestActContentService; import com.epmet.service.LatestActInfoService; import com.epmet.service.WorkActDraftService; @@ -89,4 +91,16 @@ public class WorkActDraftServiceImpl implements WorkActDraftService { } return null; } + + /** + * @param formDTO + * @return com.epmet.dto.result.work.SaveActDraftResultDTO + * @author yinzuomei + * @description 预览按下-调用此接口保存活动信息、活动内容 + * @Date 2020/7/21 14:00 + **/ + @Override + public SaveActDraftResultDTO saveAct(SaveActInfoFormDTO formDTO) { + return null; + } } From 78fc66c85952e2d4ac85ffc5801174b1eed9fa5f Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 21 Jul 2020 14:20:54 +0800 Subject: [PATCH 16/98] =?UTF-8?q?=E6=8B=89=E5=8E=BBdev=E5=88=B0heart,=20?= =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/commons/tools/utils/HttpClientManager.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java index 3dee996aae..6312fa2df0 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java @@ -32,6 +32,7 @@ import org.springframework.util.CollectionUtils; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; import java.io.ByteArrayOutputStream; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URLEncoder; From 88711d3b6cf164a755abb63115f43a2469fa440e Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Tue, 21 Jul 2020 16:40:41 +0800 Subject: [PATCH 17/98] =?UTF-8?q?=E7=88=B1=E5=BF=83=E4=BA=92=E5=8A=A9-?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/resi/ResiActBaseFormDTO.java | 68 ++++ .../dto/form/resi/ResiLatestActFormDTO.java | 57 ++++ .../epmet/dto/form/resi/ResiMyActFormDTO.java | 62 ++++ .../dto/result/resi/ResiActInfoResultDTO.java | 90 +++++ .../resi/ResiInProgressActResultDTO.java | 44 +++ .../result/resi/ResiLatestActResultDTO.java | 85 +++++ .../result/resi/ResiLookBackActResultDTO.java | 69 ++++ .../dto/result/resi/ResiMyActResultDTO.java | 85 +++++ .../controller/ResiActListController.java | 168 ++++++++++ .../main/java/com/epmet/dao/ActInfoDao.java | 148 +++++++- .../com/epmet/service/ActInfoService.java | 111 +++++- .../service/impl/ActInfoServiceImpl.java | 115 ++++++- .../src/main/resources/mapper/ActInfoDao.xml | 315 +++++++++++++++++- 13 files changed, 1412 insertions(+), 5 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActBaseFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiLatestActFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiMyActFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActInfoResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiInProgressActResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLatestActResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLookBackActResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiMyActResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActBaseFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActBaseFormDTO.java new file mode 100644 index 0000000000..04a0b710aa --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActBaseFormDTO.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.epmet.dto.form.resi; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 活动列表(标准) 入参 + * + * @author zhangyong + * @since v1.0.0 2020-07-20 + */ +@Data +public class ResiActBaseFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + //>>>>>>>>>>>>>>>>>校验分组开始>>>>>>>>>>>>>>>>>>>>> + /** + * 添加用户操作的内部异常分组 + * 出现错误会提示给前端7000错误码,返回信息为:服务器开小差... + */ + public interface AddUserInternalGroup {} + + // <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<< + + /** + * 客户Id + */ + @NotBlank(message = "客户Id不能为空", groups = { AddUserInternalGroup.class }) + private String customerId; + + /** + * 页码,从1开始 + */ + @Min(value = 1, message = "页码必须大于0", groups = { AddUserInternalGroup.class }) + private Integer pageNo; + + /** + * 页容量,默认20页 + */ + @Min(value = 1, message = "每页条数必须大于必须大于0", groups = { AddUserInternalGroup.class }) + private Integer pageSize; + + /** + * 用户id + */ + private String userId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiLatestActFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiLatestActFormDTO.java new file mode 100644 index 0000000000..0f9af626e5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiLatestActFormDTO.java @@ -0,0 +1,57 @@ +/** + * 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.epmet.dto.form.resi; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 最新活动列表 入参 + * + * @author zhangyong + * @since v1.0.0 2020-07-21 + */ +@Data +public class ResiLatestActFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + //>>>>>>>>>>>>>>>>>校验分组开始>>>>>>>>>>>>>>>>>>>>> + /** + * 添加用户操作的内部异常分组 + * 出现错误会提示给前端7000错误码,返回信息为:服务器开小差... + */ + public interface AddUserInternalGroup {} + + // <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<< + + /** + * 客户Id + */ + @NotBlank(message = "客户Id不能为空", groups = { AddUserInternalGroup.class }) + private String customerId; + + /** + * 页容量,默认20页 + */ + @Min(value = 1, message = "每页条数必须大于必须大于0", groups = { AddUserInternalGroup.class }) + private Integer num; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiMyActFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiMyActFormDTO.java new file mode 100644 index 0000000000..1cad8308bc --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiMyActFormDTO.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.epmet.dto.form.resi; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 我的活动列表 入参 + * + * @author zhangyong + * @since v1.0.0 2020-07-20 + */ +@Data +public class ResiMyActFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + //>>>>>>>>>>>>>>>>>校验分组开始>>>>>>>>>>>>>>>>>>>>> + /** + * 添加用户操作的内部异常分组 + * 出现错误会提示给前端7000错误码,返回信息为:服务器开小差... + */ + public interface AddUserInternalGroup {} + + // <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<< + + /** + * 页码,从1开始 + */ + @Min(value = 1, message = "页码必须大于0", groups = { AddUserInternalGroup.class }) + private Integer pageNo; + + /** + * 页容量,默认20页 + */ + @Min(value = 1, message = "每页条数必须大于必须大于0", groups = { AddUserInternalGroup.class }) + private Integer pageSize; + + /** + * 用户id + */ + private String userId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActInfoResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActInfoResultDTO.java new file mode 100644 index 0000000000..c842cef5e4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActInfoResultDTO.java @@ -0,0 +1,90 @@ +/** + * 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.epmet.dto.result.resi; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 活动列表(标准) 返回值 + * + * @author zhangyong + * @since v1.0.0 2020-07-20 + */ +@Data +public class ResiActInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 活动ID + */ + private String actId; + + /** + * 标题 + */ + private String title; + + + /** + * 活动封面 + */ + private String coverPic; + + /** + * 活动开始时间 + */ + private String actStartTime; + + /** + * 活动结束时间 + */ + private String actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动名额类型(true:固定名额(1) false: 不限制名额(0)) + */ + private Boolean actQuotaCategory; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 已报名人数 + */ + private Integer signupNum; + + /** + * 活动状态:(报名中:signing_up;已报满:enough;截止报名: end_sign_up; 已开始: in_progress; 已结束:finished;取消报名canceld;) + */ + private String actCurrentState; + + /** + *用户报名状态(no_signed_up: 未报名,signed_up: 已报名) + */ + private String signupFlag; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiInProgressActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiInProgressActResultDTO.java new file mode 100644 index 0000000000..b6905711fe --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiInProgressActResultDTO.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.epmet.dto.result.resi; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 即将进行/正在进行中的活动 返回值 + * + * @author zhangyong + * @since v1.0.0 2020-07-21 + */ +@Data +public class ResiInProgressActResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String actId; + + /** + * 标题 + */ + private String title; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLatestActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLatestActResultDTO.java new file mode 100644 index 0000000000..1bf6b8124e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLatestActResultDTO.java @@ -0,0 +1,85 @@ +/** + * 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.epmet.dto.result.resi; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 最新活动列表 返回值 + * + * @author zhangyong + * @since v1.0.0 2020-07-20 + */ +@Data +public class ResiLatestActResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String actId; + + /** + * 标题 + */ + private String title; + + + /** + * 活动封面 + */ + private String coverPic; + + /** + * 活动开始时间 + */ + private String actStartTime; + + /** + * 活动结束时间 + */ + private String actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动名额类型(true:固定名额(1) false: 不限制名额(0)) + */ + private Boolean actQuotaCategory; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 已报名人数 + */ + private Integer signupNum; + + /** + * 活动状态:(报名中:signing_up;已报满:enough;截止报名: end_sign_up; 已开始: in_progress;) + */ + private String actCurrentState; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLookBackActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLookBackActResultDTO.java new file mode 100644 index 0000000000..fc7d7d39e7 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLookBackActResultDTO.java @@ -0,0 +1,69 @@ +/** + * 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.epmet.dto.result.resi; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 活动回顾列表 返回值 + * + * @author zhangyong + * @since v1.0.0 2020-07-20 + */ +@Data +public class ResiLookBackActResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String actId; + + /** + * 标题 + */ + private String title; + + /** + * 活动封面 + */ + private String coverPic; + + /** + * 活动开始时间 + */ + private String actStartTime; + + /** + * 活动结束时间 + */ + private String actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动状态:(已结束:finished;) + */ + private String actCurrentState; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiMyActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiMyActResultDTO.java new file mode 100644 index 0000000000..b477f6d513 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiMyActResultDTO.java @@ -0,0 +1,85 @@ +/** + * 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.epmet.dto.result.resi; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 我的活动列表 返回值 + * + * @author zhangyong + * @since v1.0.0 2020-07-20 + */ +@Data +public class ResiMyActResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String actId; + + /** + * 标题 + */ + private String title; + + + /** + * 活动封面 + */ + private String coverPic; + + /** + * 活动开始时间 + */ + private String actStartTime; + + /** + * 活动结束时间 + */ + private String actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动名额类型(true:固定名额(1) false: 不限制名额(0)) + */ + private Boolean actQuotaCategory; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 已报名人数 + */ + private Integer signupNum; + + /** + * 活动当前状态(审核中auditing,审核通过passed,审核不通过refused,已结束canceld) + */ + private String actCurrentState; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java new file mode 100644 index 0000000000..235dbca23b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java @@ -0,0 +1,168 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.resi.*; +import com.epmet.dto.result.resi.*; +import com.epmet.service.ActInfoService; +import com.epmet.commons.tools.utils.Result; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 居民端-活动列表相关api + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/19 23:17 + */ +@RestController +@RequestMapping("/resi/act") +public class ResiActListController { + + @Autowired + private ActInfoService actInfoService; + + /** + * 活动列表(包含状态:报名中:signing_up;已报满:enough;截止报名: end_sign_up; 已开始: in_progress; 已结束:finished;) + * + * @param tokenDto + * @param formDto + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 13:39 2020-07-21 + **/ + @PostMapping("list") + public Result> listAct(@LoginUser TokenDto tokenDto, @RequestBody ResiActBaseFormDTO formDto) { + return actInfoService.listAct(tokenDto, formDto); + } + + + /** + * 我的活动-审核中 + * + * @param tokenDto + * @param formDto + * @return java.util.List + * @Author zhangyong + * @Date 13:53 2020-07-21 + **/ + @PostMapping("list/auditing") + public Result> listAuditing(@LoginUser TokenDto tokenDto, @RequestBody ResiMyActFormDTO formDto) { + return actInfoService.myActListAuditing(tokenDto, formDto); + } + + /** + * 我的活动-未通过 + * + * @param tokenDto + * @param formDto + * @return java.util.List + * @Author zhangyong + * @Date 13:53 2020-07-21 + **/ + @PostMapping("list/refused") + public Result> listRefused(@LoginUser TokenDto tokenDto, @RequestBody ResiMyActFormDTO formDto) { + return actInfoService.myActListRefused(tokenDto, formDto); + } + + /** + * 我的活动-已通过 + * + * @param tokenDto + * @param formDto + * @return java.util.List + * @Author zhangyong + * @Date 13:53 2020-07-21 + **/ + @PostMapping("list/passed") + public Result> listPassed(@LoginUser TokenDto tokenDto, @RequestBody ResiMyActFormDTO formDto) { + return actInfoService.myActListPassed(tokenDto, formDto); + } + + /** + * 我的活动-已结束 + * + * @param tokenDto + * @param formDto + * @return java.util.List + * @Author zhangyong + * @Date 13:53 2020-07-21 + **/ + @PostMapping("list/canceld") + public Result> listcanceld(@LoginUser TokenDto tokenDto, @RequestBody ResiMyActFormDTO formDto) { + return actInfoService.myActListCanceld(tokenDto, formDto); + } + + /** + * 最新活动列表 + * + * @param formDto + * @return java.util.List + * @Author zhangyong + * @Date 13:53 2020-07-21 + **/ + @PostMapping("list/latestact") + public Result> latestAct(@RequestBody ResiLatestActFormDTO formDto) { + return actInfoService.latestAct(formDto); + } + + /* + * 正在进行中的活动 + * 进入活动的快捷入口, 前端只取第一条 + * + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 14:56 2020-07-21 + **/ + @PostMapping("inprogress") + public Result> inProgressAct(@LoginUser TokenDto tokenDto) { + return actInfoService.inProgressAct(tokenDto); + } + + /** + * 活动回顾列表(包含状态:已结束:finished;) + * @param formDto + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 13:39 2020-07-21 + **/ + @PostMapping("actlookback") + public Result> actLookBack(@RequestBody ResiActBaseFormDTO formDto) { + return actInfoService.actLookBack(formDto); + } + + /** + * 取消活动报名 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 09:29 2020-07-20 + **/ + @PostMapping("cancelsignup") + public Result cancelSignUp(@LoginUser TokenDto tokenDto, @RequestBody ResiActUserCancelSignUpFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return actInfoService.cancelSignUp(tokenDto, formDTO); + } + + /** + * 重新定位 + * 根据活动id、前端传的实时经纬度,与活动设置的经纬度相比较,判断用户是否已到达打卡地点 + * + * @param formDTO + * @return javax.xml.transform.Result + * @Author zhangyong + * @Date 16:48 2020-07-20 + **/ + @PostMapping("checksigninaddress") + public Result cancelSignUp(@RequestBody ResiActCaculateDistanceFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return actInfoService.checkSignInAddress(formDTO); + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java index a5cdb23ff9..ddd1dc1088 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java @@ -18,8 +18,16 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.ActInfoDTO; +import com.epmet.dto.form.resi.ResiActBaseFormDTO; +import com.epmet.dto.form.resi.ResiLatestActFormDTO; +import com.epmet.dto.form.resi.ResiMyActFormDTO; +import com.epmet.dto.result.resi.*; import com.epmet.entity.ActInfoEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 活动信息 @@ -29,5 +37,141 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ActInfoDao extends BaseDao { - -} \ No newline at end of file + + /** + * 活动列表 - 报名中(未报满) - signing_up + * 列表排序第一组 无分页 + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 11:00 2020-07-20 + **/ + List selectListActSigningUp(ResiActBaseFormDTO formDTO); + + /** + * 活动列表 - (报名中),已报满 - enough + * 列表排序第二组 无分页 + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 11:00 2020-07-20 + **/ + List selectListActQuotaIsEnough(ResiActBaseFormDTO formDTO); + + /** + * 活动列表 - 截止报名 - end_sign_up + * 列表排序第三组 无分页 + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 11:00 2020-07-20 + **/ + List selectListActEndSignUp(ResiActBaseFormDTO formDTO); + + /** + * 活动列表 - 已开始 - in_progress + * 列表排序第四组 无分页 + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 11:00 2020-07-20 + **/ + List selectListActInProgress(ResiActBaseFormDTO formDTO); + + /** + * 活动列表 - 已结束 - finished + * 列表排序第四无组 分页 + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 11:00 2020-07-20 + **/ + List selectListActFinished(ResiActBaseFormDTO formDTO); + // 活动列表End + + /** + * 我的活动-审核中 + * + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 13:53 2020-07-20 + **/ + List selectListMyActAuditing(ResiMyActFormDTO formDTO); + + /** + * 我的活动-审核不通过 + * + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 13:53 2020-07-20 + **/ + List selectListActRefused(ResiMyActFormDTO formDTO); + + /** + * 我的活动-已通过 + * + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 13:53 2020-07-20 + **/ + List selectListActMyHavePassed(ResiMyActFormDTO formDTO); + + /** + * 我的活动-已结束 + * + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 13:53 2020-07-20 + **/ + List selectListMyActCanceld(ResiMyActFormDTO formDTO); + // 我的活动End + + /** + * 最新活动列表(未结束的、未取消的活动) + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 11:00 2020-07-20 + **/ + List selectListLatestAct(ResiLatestActFormDTO formDTO); + + /** + * 即将进行/正在进行中的活动 + * 进入活动的快捷入口,滚动显示 当前用户正在(或将要)进行的一条活动 + * 活动开始前1小时,此处展示:您报名的“情暖夕阳,爱在锦水”的活动还有xx分钟开始。 + * 活动开始后显示:正在进行中的活动:“情暖夕阳。。。 + * + * @param userId + * @return java.util.List + * @Author zhangyong + * @Date 11:00 2020-07-20 + **/ + List selectListInProgress(@Param("userId") String userId); + + /** + * 活动回顾列表 + * 已结束的活动,并且有实况或有回顾 + * 按照时间顺序排序 + * + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 11:00 2020-07-20 + **/ + List selectListLookBackAct(ResiActBaseFormDTO formDTO); + + /** + * 根据活动id、用户id 查询用户报名的活动信息 + * + * @param actId + * @param userId + * @return com.epmet.dto.ActInfoDTO + * @Author zhangyong + * @Date 17:39 2020-07-20 + **/ + ActInfoDTO queryActAccordingToActIdAndUserId(@Param("actId") String actId, @Param("userId") String userId); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java index 3f948abe52..32c0978916 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java @@ -19,9 +19,13 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.ActInfoDTO; +import com.epmet.dto.form.resi.*; +import com.epmet.dto.result.resi.*; import com.epmet.entity.ActInfoEntity; +import com.epmet.commons.tools.utils.Result; import java.util.List; import java.util.Map; @@ -92,4 +96,109 @@ public interface ActInfoService extends BaseService { * @date 2020-07-19 */ void delete(String[] ids); -} \ No newline at end of file + + /** + * 根据活动id、前端传的实时经纬度,与活动设置的经纬度相比较,判断用户是否已到达打卡地点 + * @param fromDTO + * @return javax.xml.transform.Result + * @Author zhangyong + * @Date 16:48 2020-07-20 + **/ + Result checkSignInAddress(ResiActCaculateDistanceFormDTO fromDTO); + + /** + * 活动列表(包含状态:报名中:signing_up;已报满:enough;截止报名: end_sign_up; 已开始: in_progress; 已结束:finished;) + * + * @param tokenDto + * @param formDto + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 13:39 2020-07-21 + **/ + Result> listAct(TokenDto tokenDto, ResiActBaseFormDTO formDto); + + /* + * 我的活动-审核中 + * + * @param tokenDto + * @param formDto + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 14:15 2020-07-21 + **/ + Result> myActListAuditing(TokenDto tokenDto, ResiMyActFormDTO formDto); + + /* + * 我的活动-未通过 + * + * @param tokenDto + * @param formDto + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 14:15 2020-07-21 + **/ + Result> myActListRefused(TokenDto tokenDto, ResiMyActFormDTO formDto); + + /* + * 我的活动-已通过 + * + * @param tokenDto + * @param formDto + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 14:15 2020-07-21 + **/ + Result> myActListPassed(TokenDto tokenDto, ResiMyActFormDTO formDto); + + /* + * 我的活动-已结束 + * + * @param tokenDto + * @param formDto + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 14:15 2020-07-21 + **/ + Result> myActListCanceld(TokenDto tokenDto, ResiMyActFormDTO formDto); + + /** + * 最新活动列表 + * + * @param formDto + * @return java.util.List + * @Author zhangyong + * @Date 13:53 2020-07-21 + **/ + Result> latestAct(ResiLatestActFormDTO formDto); + + /** + * 正在进行中的活动 + * 进入活动的快捷入口, 前端只取第一条 + * + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 15:00 2020-07-21 + **/ + Result> inProgressAct(TokenDto tokenDto); + + /** + * 活动回顾列表(包含状态:已结束:finished;) + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 13:39 2020-07-21 + **/ + Result> actLookBack(ResiActBaseFormDTO formDTO); + + /** + * 取消活动报名 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 09:29 2020-07-20 + **/ + Result cancelSignUp(TokenDto tokenDto, ResiActUserCancelSignUpFormDTO formDTO); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java index c5edbe2337..548c11c454 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java @@ -20,19 +20,29 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.Result; import com.epmet.dao.ActInfoDao; import com.epmet.dto.ActInfoDTO; +import com.epmet.dto.form.resi.*; +import com.epmet.dto.result.resi.*; import com.epmet.entity.ActInfoEntity; import com.epmet.redis.ActInfoRedis; import com.epmet.service.ActInfoService; +import com.epmet.service.ActUserRelationService; +import com.epmet.utils.CaculateDistance; 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; @@ -49,6 +59,9 @@ public class ActInfoServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -101,4 +114,104 @@ public class ActInfoServiceImpl extends BaseServiceImpl> listAct(TokenDto tokenDto, ResiActBaseFormDTO formDto) { + List list = new ArrayList<>(); + formDto.setUserId(tokenDto.getUserId()); + // 查询活动状态是:报名中 signing_up + List signingUp = baseDao.selectListActSigningUp(formDto); + list.addAll(signingUp); + + // 查询活动状态是:已报满 enough + List enough = baseDao.selectListActQuotaIsEnough(formDto); + list.addAll(enough); + + // 查询活动状态是:截止报名 end_sign_up + List endSignUp = baseDao.selectListActEndSignUp(formDto); + list.addAll(endSignUp); + + // 查询活动状态是:已开始 in_progress + List inProgress = baseDao.selectListActInProgress(formDto); + list.addAll(inProgress); + + // 查询活动状态是:已结束 finished + int pageIndex = (formDto.getPageNo() - NumConstant.ONE) * formDto.getPageSize(); + formDto.setPageNo(pageIndex); + List finished = baseDao.selectListActFinished(formDto); + list.addAll(finished); + return new Result>().ok(list); + } + + @Override + public Result> myActListAuditing(TokenDto tokenDto, ResiMyActFormDTO formDto) { + formDto.setUserId(tokenDto.getUserId()); + List myAct = baseDao.selectListMyActAuditing(formDto); + return new Result>().ok(myAct); + } + + @Override + public Result> myActListRefused(TokenDto tokenDto, ResiMyActFormDTO formDto) { + formDto.setUserId(tokenDto.getUserId()); + List myAct = baseDao.selectListActRefused(formDto); + return new Result>().ok(myAct); + } + + @Override + public Result> myActListPassed(TokenDto tokenDto, ResiMyActFormDTO formDto) { + formDto.setUserId(tokenDto.getUserId()); + List myAct = baseDao.selectListActMyHavePassed(formDto); + return new Result>().ok(myAct); + } + + @Override + public Result> myActListCanceld(TokenDto tokenDto, ResiMyActFormDTO formDto) { + formDto.setUserId(tokenDto.getUserId()); + List myAct = baseDao.selectListMyActCanceld(formDto); + return new Result>().ok(myAct); + } + + @Override + public Result> latestAct(ResiLatestActFormDTO formDto) { + List latest = baseDao.selectListLatestAct(formDto); + return new Result>().ok(latest); + } + + @Override + public Result> inProgressAct(TokenDto tokenDto) { + List inProgress = baseDao.selectListInProgress(tokenDto.getUserId()); + return new Result>().ok(inProgress); + } + + @Override + public Result> actLookBack(ResiActBaseFormDTO formDTO) { + List lookBackAct = baseDao.selectListLookBackAct(formDTO); + return new Result>().ok(lookBackAct); + } + + @Override + public Result cancelSignUp(TokenDto tokenDto, ResiActUserCancelSignUpFormDTO formDTO) { + // 判断用户是否已报名该活动 + ActInfoDTO actInfoDTO = baseDao.queryActAccordingToActIdAndUserId(formDTO.getActId(),formDTO.getUserId()); + if (null == actInfoDTO){ + throw new RenException(EpmetErrorCode.NO_ACT_TO_CANCEL_SIGN_UP_WERE_FOUND.getCode()); + } + //1、更新用户活动关系表 +// relationService.update(); + //2、插入用户活动关系日志表 + //3、更新act_info的已报名名额 + return null; + } + + @Override + public Result checkSignInAddress(ResiActCaculateDistanceFormDTO formDTO) { + // 根据活动id,查询活动基本信息 + ActInfoEntity entity = baseDao.selectById(formDTO.getActId()); + Double distance = CaculateDistance.getDistance(formDTO.getLongitude(),formDTO.getLatitude(),entity.getActLongitude().doubleValue(),entity.getActLatitude().doubleValue()); +// if (distance <= entity.getSigninRadius()){ +// return new Result(); +// } else { +// throw new RenException(EpmetErrorCode.NOT_IN_THE_SIGN_IN_RANGE.getCode()); +// } + return new Result(); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml index 5f95eb5ee2..06a22f4c84 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml @@ -49,4 +49,317 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 1cff30b8df84f6f11c4af00ac34ccda23a5b1148 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 21 Jul 2020 17:32:54 +0800 Subject: [PATCH 18/98] =?UTF-8?q?heart-work:=E4=BF=9D=E5=AD=98=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8=E8=8D=89=E7=A8=BFapi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/utils/DateUtils.java | 14 ++ .../dto/form/work/ActPreviewFormDTO.java | 26 +++ ...rmDTO.java => DraftActContentFormDTO.java} | 15 +- .../form/work/PublishActContentFormDTO.java | 36 +++++ .../dto/result/work/ActPreviewResultDTO.java | 16 ++ .../controller/WorkActDraftController.java | 35 +++- .../service/LatestActContentService.java | 10 ++ .../epmet/service/LatestActInfoService.java | 10 ++ .../epmet/service/WorkActDraftService.java | 15 +- .../impl/ActCustomizedServiceImpl.java | 1 + .../impl/LatestActContentServiceImpl.java | 13 ++ .../impl/LatestActInfoServiceImpl.java | 13 ++ .../service/impl/WorkActDraftServiceImpl.java | 151 +++++++++++++++++- .../resources/mapper/LatestActContentDao.xml | 4 +- .../resources/mapper/LatestActInfoDao.xml | 32 ++-- 15 files changed, 357 insertions(+), 34 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActPreviewFormDTO.java rename epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/{SaveActContentFormDTO.java => DraftActContentFormDTO.java} (79%) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActContentFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index f79b22ccb5..e76c5a4c33 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -488,4 +488,18 @@ public class DateUtils { return format.format(timestamp); } + public static Date minStrToSecondDate(String minStr){ + if(StringUtils.isNotBlank(minStr)&&minStr.length()==16){ + String date=minStr.concat(":00"); + System.out.println(date); + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + try { + return format.parse(date); + } catch (ParseException e) { + e.printStackTrace(); + } + } + return null; + } + } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActPreviewFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActPreviewFormDTO.java new file mode 100644 index 0000000000..57166c22f1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActPreviewFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form.work; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 活动预览-查看活动详情 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 17:19 + */ +@Data +public class ActPreviewFormDTO implements Serializable { + private static final long serialVersionUID = -1603801389350245626L; + + public interface UserInternalGroup { + } + + /** + * 活动草稿id + */ + @NotBlank(message = "活动草稿id不能为空", groups = {UserInternalGroup.class}) + private String actDraftId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActContentFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActContentFormDTO.java similarity index 79% rename from epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActContentFormDTO.java rename to epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActContentFormDTO.java index 3117a66132..91bbae914b 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActContentFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActContentFormDTO.java @@ -13,19 +13,24 @@ import java.io.Serializable; * @date 2020/7/21 13:18 */ @Data -public class SaveActContentFormDTO implements Serializable { +public class DraftActContentFormDTO implements Serializable { private static final long serialVersionUID = 5236509944250440348L; - public interface UserInternalGroup {} - public interface UserShowGroup extends CustomerClientShowGroup {} + + public interface UserInternalGroup { + } + + public interface UserShowGroup extends CustomerClientShowGroup { + } + /** * 内容 */ - @NotBlank(message = "内容不能为空", groups = {UserShowGroup.class }) + @NotBlank(message = "内容不能为空", groups = {UserShowGroup.class}) private String content; /** * 内容类型 图片:img;文字:text */ - @NotBlank(message = "内容类型不能为空,图片:img;文字:text", groups = {UserInternalGroup.class }) + @NotBlank(message = "内容类型不能为空,图片:img;文字:text", groups = {UserInternalGroup.class}) private String contentType; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActContentFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActContentFormDTO.java new file mode 100644 index 0000000000..efe2592e7a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActContentFormDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.form.work; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 发布活动入参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 16:21 + */ +@Data +public class PublishActContentFormDTO implements Serializable { + private static final long serialVersionUID = 7541780156596764819L; + + public interface UserInternalGroup { + } + + public interface UserShowGroup extends CustomerClientShowGroup { + } + + /** + * 内容 + */ + @NotBlank(message = "内容不能为空", groups = {UserShowGroup.class}) + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + @NotBlank(message = "内容类型不能为空,图片:img;文字:text", groups = {UserInternalGroup.class}) + private String contentType; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java new file mode 100644 index 0000000000..5b0aedee40 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 活动预览-查看活动详情返参修改 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 17:23 + */ +@Data +public class ActPreviewResultDTO implements Serializable { + private static final long serialVersionUID = 8655407962470027973L; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java index 69645c02a5..73974c194d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java @@ -2,7 +2,10 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.dto.form.work.SaveActInfoFormDTO; +import com.epmet.dto.form.work.ActPreviewFormDTO; +import com.epmet.dto.form.work.DraftActContentFormDTO; +import com.epmet.dto.form.work.DraftActInfoFormDTO; +import com.epmet.dto.result.work.ActPreviewResultDTO; import com.epmet.dto.result.work.LatestDraftActInfoResultDTO; import com.epmet.dto.result.work.PublishActInitResultDTO; import com.epmet.dto.result.work.SaveActDraftResultDTO; @@ -73,9 +76,35 @@ public class WorkActDraftController { * @Date 2020/7/21 14:00 **/ @PostMapping("saveact") - public Result saveAct(@RequestBody SaveActInfoFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO); + public Result saveAct(@RequestBody DraftActInfoFormDTO formDTO){ + //起码活动标题不能为空 + ValidatorUtils.validateEntity(formDTO, DraftActInfoFormDTO.AddDraftUserShowGroup.class, + DraftActInfoFormDTO.AddUserInternalGroup.class); + //如果录入了活动内容,需要校验 content、contentType + if (null != formDTO.getActContent() && formDTO.getActContent().size() > 0) { + for(DraftActContentFormDTO actContentFormDTO:formDTO.getActContent()){ + ValidatorUtils.validateEntity(actContentFormDTO, + DraftActContentFormDTO.UserShowGroup.class, + DraftActContentFormDTO.UserInternalGroup.class + ); + } + } SaveActDraftResultDTO resultDTO=workActDraftService.saveAct(formDTO); return new Result().ok(resultDTO); } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 预览-查看活动详情 + * @Date 2020/7/21 17:24 + **/ + @PostMapping("preview") + public Result previewActDetail(@RequestBody ActPreviewFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,ActPreviewFormDTO.UserInternalGroup.class); + ActPreviewResultDTO resultDTO=workActDraftService.previewActDetail(formDTO); + return new Result().ok(resultDTO); + } + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActContentService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActContentService.java index cc56738beb..c33aea0235 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActContentService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActContentService.java @@ -74,6 +74,16 @@ public interface LatestActContentService extends BaseService dtoList); + /** * 默认更新 * diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActInfoService.java index 347fe62c5b..2de8222a44 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActInfoService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActInfoService.java @@ -74,6 +74,16 @@ public interface LatestActInfoService extends BaseService { */ void save(LatestActInfoDTO dto); + /** + * 默认保存,返回主键 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + String saveOrUpdateLatestActInfoDTO(LatestActInfoDTO dto); + /** * 默认更新 * diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java index 6e56268955..816305db8c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java @@ -1,6 +1,8 @@ package com.epmet.service; -import com.epmet.dto.form.work.SaveActInfoFormDTO; +import com.epmet.dto.form.work.ActPreviewFormDTO; +import com.epmet.dto.form.work.DraftActInfoFormDTO; +import com.epmet.dto.result.work.ActPreviewResultDTO; import com.epmet.dto.result.work.LatestDraftActInfoResultDTO; import com.epmet.dto.result.work.PublishActInitResultDTO; import com.epmet.dto.result.work.SaveActDraftResultDTO; @@ -47,5 +49,14 @@ public interface WorkActDraftService { * @description 预览按下-调用此接口保存活动信息、活动内容 * @Date 2020/7/21 14:00 **/ - SaveActDraftResultDTO saveAct(SaveActInfoFormDTO formDTO); + SaveActDraftResultDTO saveAct(DraftActInfoFormDTO formDTO); + + /** + * @return com.epmet.dto.result.work.ActPreviewResultDTO + * @param formDTO + * @author yinzuomei + * @description 预览-查看活动详情 + * @Date 2020/7/21 17:24 + **/ + ActPreviewResultDTO previewActDetail(ActPreviewFormDTO formDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActCustomizedServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActCustomizedServiceImpl.java index 1cd0baa3df..1ecc24fc9b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActCustomizedServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActCustomizedServiceImpl.java @@ -131,6 +131,7 @@ public class ActCustomizedServiceImpl extends BaseServiceImpl dtoList) { + //先删除之前的 + this.deleteByActId(dtoList.get(0).getActId()); + //再插入新的 + for(LatestActContentDTO dto:dtoList){ + LatestActContentEntity entity = ConvertUtils.sourceToTarget(dto, LatestActContentEntity.class); + insert(entity); + } + } + @Override @Transactional(rollbackFor = Exception.class) public void update(LatestActContentDTO dto) { @@ -112,6 +124,7 @@ public class LatestActContentServiceImpl extends BaseServiceImpl actContentList=latestActContentService.selectActContentList(latestAct.getActDraftId()); latestAct.setActContentList(actContentList); } + return latestAct; }else{ logger.warn("loginUserUtil.getLoginUserId()获取当前用户id为空"); } @@ -100,7 +106,140 @@ public class WorkActDraftServiceImpl implements WorkActDraftService { * @Date 2020/7/21 14:00 **/ @Override - public SaveActDraftResultDTO saveAct(SaveActInfoFormDTO formDTO) { + public SaveActDraftResultDTO saveAct(DraftActInfoFormDTO formDTO) { + //保存活动属性 + LatestActInfoDTO latestActInfoDTO=this.constructLatestActInfoDTO(formDTO); + //如果存在草稿id,则更新 + String actDraftId=latestActInfoService.saveOrUpdateLatestActInfoDTO(latestActInfoDTO); + if(null!=formDTO.getActContent()&&formDTO.getActContent().size()>0){ + //保存活动内容 + List actContentList=this.constructLatestActContent(formDTO.getActContent(),actDraftId); + //删除之前的内容 + latestActContentService.saveLatestActContentDTOList(actContentList); + } + SaveActDraftResultDTO resultDTO=new SaveActDraftResultDTO(); + resultDTO.setActDraftId(actDraftId); + return resultDTO; + } + + /** + * @param formDTO + * @return com.epmet.dto.result.work.ActPreviewResultDTO + * @author yinzuomei + * @description 预览-查看活动详情 + * @Date 2020/7/21 17:24 + **/ + @Override + public ActPreviewResultDTO previewActDetail(ActPreviewFormDTO formDTO) { return null; } + + private List constructLatestActContent(List actContent,String actDraftId) { + List list=new ArrayList<>(); + int orderNum=1; + for(DraftActContentFormDTO actContentFormDTO:actContent){ + LatestActContentDTO latestAct=new LatestActContentDTO(); + latestAct.setActId(actDraftId); + latestAct.setContent(actContentFormDTO.getContent()); + latestAct.setContentType(actContentFormDTO.getContentType()); + latestAct.setOrderNum(orderNum); + list.add(latestAct); + orderNum++; + } + return list; + } + + private LatestActInfoDTO constructLatestActInfoDTO(DraftActInfoFormDTO formDTO) { + LatestActInfoDTO latestActInfoDTO=new LatestActInfoDTO(); + if(StringUtils.isNotBlank(formDTO.getActDraftId())){ + logger.info("修改活动草稿actDraftId",formDTO.getActDraftId()); + latestActInfoDTO.setId(formDTO.getActDraftId()); + } + latestActInfoDTO.setCustomerId(formDTO.getCustomerId()); + //活动标题 + latestActInfoDTO.setTitle(formDTO.getTitle()); + //活动封面 + latestActInfoDTO.setCoverPic(formDTO.getCoverPic()); + //报名开始时间latestActInfoDTO.setSignUpStartTime(new Date()); + //报名截止时间 + if(StringUtils.isNotBlank(formDTO.getSignUpEndTime())){ + Date signUpEndTime= DateUtils.minStrToSecondDate(formDTO.getSignUpEndTime()); + latestActInfoDTO.setSignUpEndTime(signUpEndTime); + } + //招募要求 + latestActInfoDTO.setRequirement(formDTO.getRequirement()); + //活动预计开始时间 + if(StringUtils.isNotBlank(formDTO.getActStartTime())){ + Date actStartTime= DateUtils.minStrToSecondDate(formDTO.getActStartTime()); + latestActInfoDTO.setActStartTime(actStartTime); + } + //活动预计结束时间 + if(StringUtils.isNotBlank(formDTO.getActEndTime())){ + Date actEndTime=DateUtils.minStrToSecondDate(formDTO.getActEndTime()); + latestActInfoDTO.setActEndTime(actEndTime); + } + //活动地点 + latestActInfoDTO.setActAddress(formDTO.getActAddress()); + //活动地点-经度 + if(StringUtils.isNotBlank(formDTO.getActLongitude())){ + latestActInfoDTO.setActLongitude(new BigDecimal(formDTO.getActLongitude())); + } + //活动地点-纬度 + if(StringUtils.isNotBlank(formDTO.getActLatitude())){ + latestActInfoDTO.setActLatitude(new BigDecimal(formDTO.getActLatitude())); + } + //打开开始时间 + if(StringUtils.isNotBlank(formDTO.getSignInStartTime())){ + Date signInStartTime=DateUtils.minStrToSecondDate(formDTO.getSignInStartTime()); + latestActInfoDTO.setSignInStartTime(signInStartTime); + } + //打开截止时间 + if(StringUtils.isNotBlank(formDTO.getSignInEndTime())){ + Date signInEndTime=DateUtils.minStrToSecondDate(formDTO.getSignInEndTime()); + latestActInfoDTO.setSignInEndTime(signInEndTime); + } + //活动签到打卡地点 + latestActInfoDTO.setSignInAddress(formDTO.getSignInAddress()); + //活动签到打卡位置经度 + if(StringUtils.isNotBlank(formDTO.getSignInLongitude())){ + latestActInfoDTO.setSignInLongitude(new BigDecimal(formDTO.getSignInLongitude())); + } + //活动签到打卡位置纬度 + if(StringUtils.isNotBlank(formDTO.getSignInLatitude())){ + latestActInfoDTO.setSignInLatitude(new BigDecimal(formDTO.getSignInLatitude())); + } + //活动签到打卡半径(单位:米) + if(null!=formDTO.getSignInRadius()){ + latestActInfoDTO.setSignInRadius(formDTO.getSignInRadius()); + } + //活动名额类型(0-不限名额,1-固定名额) + if(null!=formDTO.getActQuota()&&formDTO.getActQuota()==0){ + latestActInfoDTO.setActQuotaCategory(false); + }else{ + latestActInfoDTO.setActQuotaCategory(true); + } + //活动名额 + latestActInfoDTO.setActQuota(formDTO.getActQuota()); + //联系人 + latestActInfoDTO.setSponsorContacts(formDTO.getSponsorContacts()); + //联系电话 + latestActInfoDTO.setSponsorTel(formDTO.getSponsorTel()); + //主办方类型:网格主办:grid;组织主办:agency + latestActInfoDTO.setSponsorType(formDTO.getSponsorType()); + //主办方id(机关或网格的id) + latestActInfoDTO.setSponsorId(formDTO.getSponsorId()); + //活动主办方名称(机关或网格的名称) + latestActInfoDTO.setSponsorName(formDTO.getSponsorName()); + //如果以网格名义发布,存储空字符串"" + latestActInfoDTO.setSponsorType(formDTO.getSponsorType()); + //活动奖励积分 + latestActInfoDTO.setReward(formDTO.getReward()); + //身份限制:1只有志愿者才可以参加活动0不限制志愿者身份 + latestActInfoDTO.setVolunteerLimit(formDTO.getVolunteerLimit()); + //审核开关:1报名人员需要人工审核0不需要 + latestActInfoDTO.setAuditSwitch(formDTO.getAuditSwitch()); + return latestActInfoDTO; + } + + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActContentDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActContentDao.xml index 61e18e4f89..44733dcca7 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActContentDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActContentDao.xml @@ -21,8 +21,8 @@ UPDATE latest_act_content SET DEL_FLAG = '1' - WHERE - ACT_ID = #{actId} + WHERE DEL_FLAG = '0' + AND ACT_ID = #{actId} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml index 9c860a03b2..e8d11c7b25 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml @@ -8,20 +8,20 @@ - - + + - - - - - - + + + + + + @@ -57,20 +57,20 @@ - - + + - - - - - - + + + + + + From b278dabcfc80c474f510e721f4811f852a4378bc Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 21 Jul 2020 17:48:35 +0800 Subject: [PATCH 19/98] =?UTF-8?q?heart-work:=E4=BF=9D=E5=AD=98=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8=E8=8D=89=E7=A8=BFapi=20=E8=A1=A5=E5=85=85=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/work/DraftActInfoFormDTO.java | 172 ++++++++++++++++++ ...ormDTO.java => PublishActInfoFormDTO.java} | 70 ++++--- .../work/ActPreviewContentResultDTO.java | 25 +++ .../dto/result/work/ActPreviewResultDTO.java | 76 ++++++++ .../work/LatestDraftActInfoResultDTO.java | 12 +- .../service/LatestActContentService.java | 10 + .../epmet/service/LatestActInfoService.java | 10 + .../impl/LatestActContentServiceImpl.java | 13 ++ .../impl/LatestActInfoServiceImpl.java | 13 ++ .../service/impl/WorkActDraftServiceImpl.java | 9 +- 10 files changed, 373 insertions(+), 37 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java rename epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/{SaveActInfoFormDTO.java => PublishActInfoFormDTO.java} (76%) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewContentResultDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java new file mode 100644 index 0000000000..90255794a9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java @@ -0,0 +1,172 @@ +package com.epmet.dto.form.work; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.Valid; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * 预览-保存活动草稿入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 13:17 + */ +@Data +public class DraftActInfoFormDTO implements Serializable { + private static final long serialVersionUID = -4967079570884814526L; + + public interface AddUserInternalGroup { + } + + public interface AddDraftUserShowGroup extends CustomerClientShowGroup { + } + + @Valid + private List actContent; + + /** + * 活动草稿id,如果是编辑之前的活动草稿,此列是有值的 + */ + private String actDraftId; + + + /** + * 如果是重新发布活动,此列是有值的 + */ + private String actId; + + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空", groups = {AddUserInternalGroup.class}) + private String customerId; + + /** + * 活动标题 + */ + @NotBlank(message = "活动标题不能为空", groups = {AddDraftUserShowGroup.class}) + private String title; + + /** + * 封面图 + */ + private String coverPic; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动地点-经度 + */ + private String actLongitude; + + /** + * 活动地点-纬度 + */ + private String actLatitude; + + /** + * 活动预计开始时间yyyy-MM-dd HH:mm + */ + private String actStartTime; + + /** + * 活动预计结束时间yyyy-MM-dd HH:mm + */ + private String actEndTime; + + /** + * 活动人数 + */ + @Min(0) + private Integer actQuota; + + /** + * 活动积分 + */ + @Min(0) + private Integer reward; + + /** + * 报名审核:true:只有志愿者才可以参加活动,false: 只要是居民就可以参加活动 + */ + private Boolean volunteerLimit; + + /** + * 报名审核: true: 需人工审核 false: 无需审核 + */ + private Boolean auditSwitch; + + /** + * 报名截止时间:yyyy-MM-dd HH:mm + */ + private String signUpEndTime; + + /** + * 报名条件 + */ + private String requirement; + + /** + * 签到开始时间:yyyy-MM-dd HH:mm + */ + private String signInStartTime; + + /** + * 签到结束时间: yyyy-MM-dd HH:mm + */ + private String signInEndTime; + + /** + * 签到地址 + */ + private String signInAddress; + + /** + * 签到地址-纬度 + */ + private String signInLatitude; + + /** + * 签到地址-经度 + */ + private String signInLongitude; + + /** + * 签到有效范围(米) + */ + @Min(0) + private Integer signInRadius; + + /** + * 主办方id + */ + private String sponsorId; + + /** + * 主办方类型:以网格名义:grid , 以机关名义: agency + */ + private String sponsorType; + + /** + * 主办方名称 + */ + private String sponsorName; + + /** + * 联系人 + */ + private String sponsorContacts; + + /** + * 联系电话 + */ + private String sponsorTel; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActInfoFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java similarity index 76% rename from epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActInfoFormDTO.java rename to epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java index 39df684d03..bafb5f2a0f 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActInfoFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java @@ -11,18 +11,23 @@ import java.io.Serializable; import java.util.List; /** - * 预览-保存活动草稿入参DTO + * 发布活动-入参 * * @author yinzuomei@elink-cn.com - * @date 2020/7/21 13:17 + * @date 2020/7/21 16:15 */ @Data -public class SaveActInfoFormDTO implements Serializable { - private static final long serialVersionUID = -4967079570884814526L; - public interface AddUserInternalGroup {} - public interface AddUserShowGroup extends CustomerClientShowGroup {} +public class PublishActInfoFormDTO implements Serializable { + private static final long serialVersionUID = -2066903357493362692L; + + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + @Valid - private List actContent; + private List actContent; /** * 活动草稿id,如果是编辑之前的活动草稿,此列是有值的 @@ -35,46 +40,52 @@ public class SaveActInfoFormDTO implements Serializable { */ private String actId; + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空", groups = {AddUserInternalGroup.class}) + private String customerId; + /** * 活动标题 */ - @NotBlank(message = "活动标题不能为空", groups = {AddUserShowGroup.class }) + @NotBlank(message = "活动标题不能为空", groups = {AddUserShowGroup.class}) private String title; /** * 封面图 */ - @NotBlank(message = "封面图不能为空", groups = {AddUserShowGroup.class }) + @NotBlank(message = "封面图不能为空", groups = {AddUserShowGroup.class}) private String coverPic; /** * 活动地点 */ - @NotBlank(message = "活动地点不能为空", groups = {AddUserShowGroup.class }) + @NotBlank(message = "活动地点不能为空", groups = {AddUserShowGroup.class}) private String actAddress; /** * 活动地点-经度 */ - @NotBlank(message = "活动地点经度不能为空", groups = {AddUserInternalGroup.class }) + @NotBlank(message = "活动地点经度不能为空", groups = {AddUserInternalGroup.class}) private String actLongitude; /** * 活动地点-纬度 */ - @NotBlank(message = "活动地点经度不能为空", groups = {AddUserInternalGroup.class }) + @NotBlank(message = "活动地点经度不能为空", groups = {AddUserInternalGroup.class}) private String actLatitude; /** * 活动预计开始时间yyyy-MM-dd HH:mm */ - @NotBlank(message = "活动预计开始时间不能为空", groups = {AddUserShowGroup.class }) + @NotBlank(message = "活动预计开始时间不能为空", groups = {AddUserShowGroup.class}) private String actStartTime; /** * 活动预计结束时间yyyy-MM-dd HH:mm */ - @NotBlank(message = "活动预计结束时间不能为空", groups = {AddUserShowGroup.class }) + @NotBlank(message = "活动预计结束时间不能为空", groups = {AddUserShowGroup.class}) private String actEndTime; /** @@ -92,55 +103,55 @@ public class SaveActInfoFormDTO implements Serializable { /** * 报名审核:true:只有志愿者才可以参加活动,false: 只要是居民就可以参加活动 */ - @NotNull(message = "报名身份不能为空",groups = {AddUserInternalGroup.class}) + @NotNull(message = "报名身份不能为空", groups = {AddUserInternalGroup.class}) private Boolean volunteerLimit; /** * 报名审核: true: 需人工审核 false: 无需审核 */ - @NotNull(message = "报名审核方式不能为空",groups = {AddUserInternalGroup.class}) + @NotNull(message = "报名审核方式不能为空", groups = {AddUserInternalGroup.class}) private Boolean auditSwitch; /** * 报名截止时间:yyyy-MM-dd HH:mm */ - @NotBlank(message = "报名截止时间不能为空", groups = {AddUserShowGroup.class }) + @NotBlank(message = "报名截止时间不能为空", groups = {AddUserShowGroup.class}) private String signUpEndTime; /** * 报名条件 */ - @NotBlank(message = "报名条件不能为空", groups = {AddUserShowGroup.class }) + @NotBlank(message = "报名条件不能为空", groups = {AddUserShowGroup.class}) private String requirement; /** * 签到开始时间:yyyy-MM-dd HH:mm */ - @NotBlank(message = "签到开始时间不能为空", groups = {AddUserShowGroup.class }) + @NotBlank(message = "签到开始时间不能为空", groups = {AddUserShowGroup.class}) private String signInStartTime; /** * 签到结束时间: yyyy-MM-dd HH:mm */ - @NotBlank(message = "签到结束时间不能为空", groups = {AddUserShowGroup.class }) + @NotBlank(message = "签到结束时间不能为空", groups = {AddUserShowGroup.class}) private String signInEndTime; /** * 签到地址 */ - @NotBlank(message = "签到地址不能为空", groups = {AddUserShowGroup.class }) + @NotBlank(message = "签到地址不能为空", groups = {AddUserShowGroup.class}) private String signInAddress; /** * 签到地址-纬度 */ - @NotBlank(message = "签到地址-纬度不能为空", groups = {AddUserInternalGroup.class }) + @NotBlank(message = "签到地址-纬度不能为空", groups = {AddUserInternalGroup.class}) private String signInLatitude; /** * 签到地址-经度 */ - @NotBlank(message = "签到地址-经度不能为空", groups = {AddUserInternalGroup.class }) + @NotBlank(message = "签到地址-经度不能为空", groups = {AddUserInternalGroup.class}) private String signInLongitude; /** @@ -152,31 +163,30 @@ public class SaveActInfoFormDTO implements Serializable { /** * 主办方id */ - @NotBlank(message = "主办方id不能为空", groups = {AddUserInternalGroup.class }) + @NotBlank(message = "主办方id不能为空", groups = {AddUserInternalGroup.class}) private String sponsorId; /** * 主办方类型:以网格名义:grid , 以机关名义: agency */ - @NotBlank(message = "主办方类型不能为空", groups = {AddUserInternalGroup.class }) + @NotBlank(message = "主办方类型不能为空", groups = {AddUserInternalGroup.class}) private String sponsorType; /** * 主办方名称 */ - @NotBlank(message = "主办方名称不能为空", groups = {AddUserShowGroup.class }) + @NotBlank(message = "主办方名称不能为空", groups = {AddUserShowGroup.class}) private String sponsorName; /** - * 联系人 + * 联系人 */ - @NotBlank(message = "联系人不能为空", groups = {AddUserShowGroup.class }) + @NotBlank(message = "联系人不能为空", groups = {AddUserShowGroup.class}) private String sponsorContacts; /** * 联系电话 */ - @NotBlank(message = "联系电话不能为空", groups = {AddUserShowGroup.class }) + @NotBlank(message = "联系电话不能为空", groups = {AddUserShowGroup.class}) private String sponsorTel; - } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewContentResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewContentResultDTO.java new file mode 100644 index 0000000000..73609e486f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewContentResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 活动预览详情页-活动内容详情 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 17:39 + */ +@Data +public class ActPreviewContentResultDTO implements Serializable { + private static final long serialVersionUID = -3351984717336783565L; + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java index 5b0aedee40..f5869bdb87 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java @@ -1,8 +1,11 @@ package com.epmet.dto.result.work; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; +import java.util.Date; +import java.util.List; /** * 活动预览-查看活动详情返参修改 @@ -13,4 +16,77 @@ import java.io.Serializable; @Data public class ActPreviewResultDTO implements Serializable { private static final long serialVersionUID = 8655407962470027973L; + + /** + * 活动草稿id + */ + private String actDraftId; + + /** + * 活动标题 + */ + private String title; + + /** + * 活动人数 + */ + private Integer actQuota; + + /** + * true:固定名额 false: 不限制名额 + */ + private Boolean actQuotaCategory; + + /** + * 活动积分 + */ + private Integer reward; + + /** + * 活动开始时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actStartTime; + + /** + * 活动结束时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 报名截止时间:yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date signUpEndTime; + + /** + * 报名条件 + */ + private String requirement; + + /** + * 主办方名称 + */ + private String sponsorName; + + /** + * 联系人 + */ + private String sponsorContacts; + + /** + * 联系电话 + */ + private String sponsorTel; + + /** + * 活动详情 + */ + private List actContent; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java index 4e3e933be4..89d5c1e4ec 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java @@ -39,13 +39,13 @@ public class LatestDraftActInfoResultDTO implements Serializable { /** * 报名开始时间 */ - @JsonFormat(pattern="yyyy-MM-dd HH:mm") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date signUpStartTime; /** * 报名截止时间 */ - @JsonFormat(pattern="yyyy-MM-dd HH:mm") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date signUpEndTime; /** @@ -56,13 +56,13 @@ public class LatestDraftActInfoResultDTO implements Serializable { /** * 活动预计开始时间 */ - @JsonFormat(pattern="yyyy-MM-dd HH:mm") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date actStartTime; /** * 活动预计结束时间 */ - @JsonFormat(pattern="yyyy-MM-dd HH:mm") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date actEndTime; /** @@ -83,13 +83,13 @@ public class LatestDraftActInfoResultDTO implements Serializable { /** * 签到开始时间 */ - @JsonFormat(pattern="yyyy-MM-dd HH:mm") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date signInStartTime; /** * 签到截止时间 */ - @JsonFormat(pattern="yyyy-MM-dd HH:mm") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date signInEndTime; /** diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActContentService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActContentService.java index c33aea0235..39a067055f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActContentService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActContentService.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.LatestActContentDTO; import com.epmet.dto.result.work.ActDraftContentDTOResultDTO; +import com.epmet.dto.result.work.ActPreviewContentResultDTO; import com.epmet.entity.LatestActContentEntity; import java.util.List; @@ -121,4 +122,13 @@ public interface LatestActContentService extends BaseService selectActContentList(String actId); + + /** + * @return java.util.List + * @param actDraftId latest_act_info主键 + * @author yinzuomei + * @description 预览-查看活动详情 + * @Date 2020/7/21 17:47 + **/ + List previewActContent(String actDraftId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActInfoService.java index 2de8222a44..0102ea76ee 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActInfoService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActInfoService.java @@ -20,6 +20,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.LatestActInfoDTO; +import com.epmet.dto.result.work.ActPreviewResultDTO; import com.epmet.dto.result.work.LatestDraftActInfoResultDTO; import com.epmet.entity.LatestActInfoEntity; @@ -130,4 +131,13 @@ public interface LatestActInfoService extends BaseService { * @Date 2020/7/20 22:59 **/ LatestDraftActInfoResultDTO getLatestActDraft(String userId); + + /** + * @return com.epmet.dto.result.work.ActPreviewResultDTO + * @param actDraftId latest_act_info主键 + * @author yinzuomei + * @description 预览-查看活动详情 + * @Date 2020/7/21 17:45 + **/ + ActPreviewResultDTO previewActInfo(String actDraftId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java index 5b5ba78400..03c0e5621d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java @@ -26,6 +26,7 @@ import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.LatestActContentDao; import com.epmet.dto.LatestActContentDTO; import com.epmet.dto.result.work.ActDraftContentDTOResultDTO; +import com.epmet.dto.result.work.ActPreviewContentResultDTO; import com.epmet.entity.LatestActContentEntity; import com.epmet.redis.LatestActContentRedis; import com.epmet.service.LatestActContentService; @@ -140,4 +141,16 @@ public class LatestActContentServiceImpl extends BaseServiceImpl + * @author yinzuomei + * @description 预览-查看活动详情 + * @Date 2020/7/21 17:47 + **/ + @Override + public List previewActContent(String actDraftId) { + return null; + } + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActInfoServiceImpl.java index c467ffa148..dba3dc1f94 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActInfoServiceImpl.java @@ -26,6 +26,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.LatestActInfoDao; import com.epmet.dto.LatestActInfoDTO; +import com.epmet.dto.result.work.ActPreviewResultDTO; import com.epmet.dto.result.work.LatestDraftActInfoResultDTO; import com.epmet.entity.LatestActInfoEntity; import com.epmet.redis.LatestActInfoRedis; @@ -164,5 +165,17 @@ public class LatestActInfoServiceImpl extends BaseServiceImpl actContent = latestActContentService.previewActContent(formDTO.getActDraftId()); + if (null != actContent && actContent.size() > 0) { + actPreviewResultDTO.setActContent(actContent); + } + } + return actPreviewResultDTO; } private List constructLatestActContent(List actContent,String actDraftId) { From 0ac55a3f0670cfbbc66492e7766b7313c6431479 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Tue, 21 Jul 2020 17:57:56 +0800 Subject: [PATCH 20/98] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resi/ResiActUserCancelSignUpFormDTO.java | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActUserCancelSignUpFormDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActUserCancelSignUpFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActUserCancelSignUpFormDTO.java new file mode 100644 index 0000000000..cbe419a7b3 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActUserCancelSignUpFormDTO.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.epmet.dto.form.resi; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 取消报名参数 + * + * @author zhangyong + * @since v1.0.0 2020-07-20 + */ +@Data +public class ResiActUserCancelSignUpFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + //>>>>>>>>>>>>>>>>>校验分组开始>>>>>>>>>>>>>>>>>>>>> + /** + * 添加用户操作的内部异常分组 + * 出现错误会提示给前端7000错误码,返回信息为:服务器开小差... + */ + public interface AddUserInternalGroup {} + + /** + * 添加用户操作的用户可见异常分组 + * 该分组用于校验需要返回给前端错误信息提示的列,需要继承CustomerClientShowGroup + * 返回错误码为8999,提示信息为DTO中具体的列的校验注解message的内容 + */ + public interface AddUserShowGroup extends CustomerClientShowGroup {} + + // <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<< + + /** + * 用户Id + */ + private String userId; + + /** + * 活动ID + */ + @NotBlank(message = "活动ID不能为空", groups = { AddUserInternalGroup.class }) + private String actId; + + /** + * 取消报名原因 + */ + @NotBlank(message = "请输入取消报名原因", groups = { AddUserInternalGroup.class, AddUserShowGroup.class }) + @Length(max = 150, message = "取消报名原因不能超过150字", groups = { AddUserInternalGroup.class, AddUserShowGroup.class }) + private String failureReason; +} From 7a7278c7a76009215512c3cbf464861ff7d422b6 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Tue, 21 Jul 2020 17:59:19 +0800 Subject: [PATCH 21/98] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/resi/ActUserClockLogFormDTO.java | 81 +++++++++++++++++++ .../resi/ResiActCaculateDistanceFormDTO.java | 45 +++++++++++ .../result/resi/ActClockListResultDTO.java | 48 +++++++++++ .../com/epmet/utils/CaculateDistance.java | 40 +++++++++ 4 files changed, 214 insertions(+) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ActUserClockLogFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActCaculateDistanceFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ActClockListResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/CaculateDistance.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ActUserClockLogFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ActUserClockLogFormDTO.java new file mode 100644 index 0000000000..fa7e943ebf --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ActUserClockLogFormDTO.java @@ -0,0 +1,81 @@ +/** + * 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.epmet.dto.form.resi; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; + +/** + * 用户活动打卡参数 + * + * @author zhangyong + * @since v1.0.0 2020-07-14 + */ +@Data +public class ActUserClockLogFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private String userId; + /** + * 活动ID + */ + @NotBlank(message = "活动ID不能为空") + private String actId; + /** + * 打卡类型(0-打卡,1-更新打卡) + */ + @NotBlank(message = "打卡类型不能为空") + private String clockType; + /** + * 打卡位置经度 + */ + @NotBlank(message = "打卡位置经度不能为空") + private BigDecimal clockLongitude; + /** + * 打卡位置纬度 + */ + @NotBlank(message = "打卡位置纬度不能为空") + private BigDecimal clockLatitude; + /** + * 打卡地址 + */ + @NotBlank(message = "打卡地址不能为空") + private String clockAddress; + /** + * 打卡描述 + */ + @NotBlank(message = "打卡描述不能为空") + private String clockDesc; + /** + * 打卡是否有效(0-否,1-是) + */ + @NotBlank(message = "打卡是否有效不能为空") + private String effectiveFlag; + /** + * 打卡图片 + */ + private ArrayList images; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActCaculateDistanceFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActCaculateDistanceFormDTO.java new file mode 100644 index 0000000000..b48ff6bb08 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActCaculateDistanceFormDTO.java @@ -0,0 +1,45 @@ +package com.epmet.dto.form.resi; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 重新定位 入参 + * + * @author zhangyong + * @since v1.0.0 2020-07-20 + */ +@Data +public class ResiActCaculateDistanceFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + //>>>>>>>>>>>>>>>>>校验分组开始>>>>>>>>>>>>>>>>>>>>> + /** + * 添加用户操作的内部异常分组 + * 出现错误会提示给前端7000错误码,返回信息为:服务器开小差... + */ + public interface AddUserInternalGroup {} + + // <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<< + + /** + * 经度 + */ + @NotBlank(message = "经度不能为空", groups = { ResiActBaseFormDTO.AddUserInternalGroup.class }) + private Double longitude; + + /** + * 纬度 + */ + @NotBlank(message = "纬度不能为空", groups = { ResiActBaseFormDTO.AddUserInternalGroup.class }) + private Double latitude; + + /** + * 用户id + */ + @NotBlank(message = "活动ID不能为空", groups = { ResiActBaseFormDTO.AddUserInternalGroup.class }) + private String actId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ActClockListResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ActClockListResultDTO.java new file mode 100644 index 0000000000..cb3cc26361 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ActClockListResultDTO.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.epmet.dto.result.resi; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 打卡列表 + * + * @author zhangyong + * @since v1.0.0 2020-07-14 + */ +@Data +public class ActClockListResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 活动打卡人次 + */ + private Integer clockNum; + + /** + * 打卡列表 + */ + private List clocks; + + + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/CaculateDistance.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/CaculateDistance.java new file mode 100644 index 0000000000..5a772706da --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/CaculateDistance.java @@ -0,0 +1,40 @@ +package com.epmet.utils; + + +/** + * 计算两个经纬度之间相差的距离(米) + * + * @Auther: zhangyong + * @Date: 2020-07-17 14:54 + */ +public class CaculateDistance { + + private static final double EARTH_RADIUS = 6378137; + private static double rad(double d) { + return d * Math.PI / 180.0; + } + + /** + * 根据两点间经纬度坐标(double值),计算两点间距离,单位为米 + * + * @param lng1 经度1 + * @param lat1 纬度1 + * @param lng2 经度2 + * @param lat2 纬度2 + * @return double + * @Author zhangyong + * @Date 14:56 2020-07-17 + **/ + public static double getDistance(double lng1, double lat1, double lng2, double lat2) { + double radLat1 = rad(lat1); + double radLat2 = rad(lat2); + double a = radLat1 - radLat2; + double b = rad(lng1) - rad(lng2); + double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a/2),2) + + Math.cos(radLat1)*Math.cos(radLat2)*Math.pow(Math.sin(b/2),2))); + s = s * EARTH_RADIUS; + s = Math.round(s * 10000) / 10000; + return s; + } + +} From 52b06d99af15b05a97e09a96334dc178dc3e6193 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Tue, 21 Jul 2020 18:03:34 +0800 Subject: [PATCH 22/98] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/ActInfoServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java index 548c11c454..a1b23bed6b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java @@ -192,9 +192,9 @@ public class ActInfoServiceImpl extends BaseServiceImpl Date: Tue, 21 Jul 2020 18:09:16 +0800 Subject: [PATCH 23/98] =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/ActInfoDao.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml index 06a22f4c84..bf0d043bf6 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml @@ -120,7 +120,7 @@ LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID WHERE i.DEL_FLAG = '0' -- 活动开始时间 > 当前时间 并且 报名截止时间 < 当前时间 报名已结束,活动未开始 未开始 - AND ( ]]> NOW() AND NOW() ) + AND ( ]]> NOW() AND NOW() ) AND i.ACT_STATUS != 'canceled' AND i.CUSTOMER_ID = #{customerId} ORDER BY i.CREATED_TIME DESC @@ -146,7 +146,7 @@ LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID WHERE i.DEL_FLAG = '0' -- 活动开始时间 <= 当前时间 并且活动结束时间 >= 当前时间 进行中 - AND ( NOW() AND = ]]> NOW() ) + AND ( NOW() AND = ]]> NOW() ) AND i.ACT_STATUS != 'canceled' AND i.CUSTOMER_ID = #{customerId} ORDER BY i.CREATED_TIME DESC @@ -290,7 +290,7 @@ then 'enough' else 'signing_up' end when ]]> NOW() - and NOW() + and NOW() then 'end_sign_up' when NOW() and = ]]> NOW() From a2086c03cc8c64baf8f31520cc715741b8151231 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 21 Jul 2020 18:19:28 +0800 Subject: [PATCH 24/98] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E7=BD=91=E5=85=B3=20=E5=8F=91=E9=80=81=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=8E=A5=E6=94=B6=E6=B6=88=E6=81=AF=EF=BC=88=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=9C=AA=E5=A4=84=E7=90=86=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-commons/epmet-commons-tools/pom.xml | 4 - .../epmet/commons/tools/config/MqConfig.java | 33 +++++ .../tools/dto/form/mq/MqBaseMsgDTO.java | 30 +++++ .../tools/dto/form/mq/MqConfigDTO.java | 18 +++ .../tools/dto/form/mq/MqReturnBaseResult.java | 19 +++ .../tools/dto/form/mq/MqSubscribeFormDTO.java | 36 ++++++ .../tools/dto/form/mq/ReceiveMqMsg.java | 21 +++ .../commons/tools/enums/MqMethodPathEnum.java | 42 ++++++ .../tools/utils/HttpClientManager.java | 121 ++++++++++++++---- .../commons/tools/utils/ScanContentUtils.java | 1 - .../commons/tools/utils/SendMqMsgUtils.java | 69 ++++++++++ .../epmet-heart/epmet-heart-server/pom.xml | 15 +++ .../com/epmet/controller/TestController.java | 53 ++++++-- .../src/main/resources/bootstrap.yml | 10 +- .../main/java/dto/form/SendPointFormDTO.java | 18 +++ .../com/epmet/config/MqSubcribeConfig.java | 45 +++++++ .../controller/MqPointCallbackController.java | 45 +++++++ .../resources/db/migration/epmet_point.sql | 8 +- 18 files changed, 539 insertions(+), 49 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/MqConfig.java create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqBaseMsgDTO.java create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqConfigDTO.java create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqReturnBaseResult.java create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqSubscribeFormDTO.java create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/ReceiveMqMsg.java create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/MqMethodPathEnum.java create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/SendMqMsgUtils.java create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/dto/form/SendPointFormDTO.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/MqSubcribeConfig.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/MqPointCallbackController.java diff --git a/epmet-commons/epmet-commons-tools/pom.xml b/epmet-commons/epmet-commons-tools/pom.xml index 4cf33e4c25..01d92799d7 100644 --- a/epmet-commons/epmet-commons-tools/pom.xml +++ b/epmet-commons/epmet-commons-tools/pom.xml @@ -133,10 +133,6 @@ org.apache.httpcomponents httpmime - - org.apache.httpcomponents - httpmime - diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/MqConfig.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/MqConfig.java new file mode 100644 index 0000000000..297c305a39 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/MqConfig.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

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

+ * 版权所有,侵权必究! + */ + +package com.epmet.commons.tools.config; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Configuration; + +/** + * 消息网关配置信息 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@Configuration +public class MqConfig { + @Value("${elink.mq.appId}") + private String appId; + @Value("${elink.mq.token}") + private String token; + @JsonIgnore + @Value("${elink.mq.host}") + private String host; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqBaseMsgDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqBaseMsgDTO.java new file mode 100644 index 0000000000..812d2e5baa --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqBaseMsgDTO.java @@ -0,0 +1,30 @@ +package com.epmet.commons.tools.dto.form.mq; + +import lombok.Data; +import org.springframework.stereotype.Component; + +/** + * 消息网关基础信息 + * + * @author jianjun liu + * @date 2020-07-21 14:33 + **/ +@Data +@Component +public class MqBaseMsgDTO extends MqConfigDTO { + private static final long serialVersionUID = 8176470786428432009L; + + /** + * mq的事件类型 + */ + private String eventClass; + /** + * 事件code + */ + private String eventTag; + /** + * 消息体 + */ + private String msg; + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqConfigDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqConfigDTO.java new file mode 100644 index 0000000000..24a388f8ae --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqConfigDTO.java @@ -0,0 +1,18 @@ +package com.epmet.commons.tools.dto.form.mq; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 消息网关基础信息 + * + * @author jianjun liu + * @date 2020-07-21 14:33 + **/ +@Data +public class MqConfigDTO implements Serializable { + private String appId; + private String token; + private String requestUrl; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqReturnBaseResult.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqReturnBaseResult.java new file mode 100644 index 0000000000..f25e66bcfd --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqReturnBaseResult.java @@ -0,0 +1,19 @@ +package com.epmet.commons.tools.dto.form.mq; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:消息网关返回结果 + * + * @author lyn + * @date 2020/7/21 13:38 + */ +@Data +public class MqReturnBaseResult implements Serializable { + private static final long serialVersionUID = -7763308686382363929L; + Integer errCode; + String errMsg; + String data; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqSubscribeFormDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqSubscribeFormDTO.java new file mode 100644 index 0000000000..4eb3a21bc7 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqSubscribeFormDTO.java @@ -0,0 +1,36 @@ +package com.epmet.commons.tools.dto.form.mq; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc: 订阅服务参数 实体类 + * + * @date: 2020/6/29 9:06 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ +@Data +public class MqSubscribeFormDTO implements Serializable { + + /** + * 消息接收者 + */ + private String belongAppId; + + /** + * 密钥 + */ + private String eventClass; + /** + * 发送内容 + */ + private String eventTag; + + /** + * 是否at所有人 + */ + private String callbackUrl; + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/ReceiveMqMsg.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/ReceiveMqMsg.java new file mode 100644 index 0000000000..b78d568924 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/ReceiveMqMsg.java @@ -0,0 +1,21 @@ +package com.epmet.commons.tools.dto.form.mq; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 亿联云消息网关消息回调外层DTO + * + * @author jianjun liu + * @date 2020-07-20 8:58 + **/ +@Data +public class ReceiveMqMsg implements Serializable { + + private static final long serialVersionUID = -2776439983884650701L; + /** + * 消息体 json串 + */ + private String msg; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/MqMethodPathEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/MqMethodPathEnum.java new file mode 100644 index 0000000000..014722de84 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/MqMethodPathEnum.java @@ -0,0 +1,42 @@ +package com.epmet.commons.tools.enums; + +/** + * 消息网关方法枚举类 + * dev|test|prod + * + * @author jianjun liu + * @date 2020-07-03 11:14 + **/ +public enum MqMethodPathEnum { + SEND_MSG("producerService/producer/sendMsg", "发送消息"), + + ; + + private String code; + private String name; + + + + MqMethodPathEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public static MqMethodPathEnum getEnum(String code) { + MqMethodPathEnum[] values = MqMethodPathEnum.values(); + for (MqMethodPathEnum value : values) { + if (code != null && value.getCode().equals(code)) { + return value; + } + } + return null; + } + + public String getCode() { + return code; + } + + public String getName() { + return name; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java index 6312fa2df0..5061222074 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java @@ -4,8 +4,6 @@ import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.dto.form.DingTalkTextMsg; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; -import com.epmet.commons.tools.scan.param.TextScanParamDTO; -import com.epmet.commons.tools.scan.param.TextTaskDTO; import lombok.extern.slf4j.Slf4j; import org.apache.commons.codec.binary.Base64; import org.apache.commons.lang3.ArrayUtils; @@ -20,22 +18,34 @@ import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpRequestBase; import org.apache.http.client.utils.URIBuilder; +import org.apache.http.config.Registry; +import org.apache.http.config.RegistryBuilder; +import org.apache.http.conn.socket.ConnectionSocketFactory; +import org.apache.http.conn.socket.PlainConnectionSocketFactory; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.entity.StringEntity; import org.apache.http.entity.mime.MultipartEntityBuilder; import org.apache.http.entity.mime.content.FileBody; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; import org.apache.http.message.BasicNameValuePair; import org.apache.http.util.EntityUtils; import org.springframework.util.CollectionUtils; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URLEncoder; +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; +import java.security.cert.CertificateException; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -55,6 +65,28 @@ public class HttpClientManager { * HttpClient对象 */ private static CloseableHttpClient httpclient = HttpClients.custom().disableAutomaticRetries().build(); + private static CloseableHttpClient httpsClient; + + static { + try { + // 采用绕过验证的方式处理https请求 + SSLContext sslcontext = createIgnoreVerifySSL(); + // 设置协议http和https对应的处理socket链接工厂的对象 + Registry socketFactoryRegistry = RegistryBuilder.create() + .register("http", PlainConnectionSocketFactory.INSTANCE) + .register("https", new SSLConnectionSocketFactory(sslcontext, + SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER)) + .build(); + PoolingHttpClientConnectionManager connManager = new PoolingHttpClientConnectionManager( + socketFactoryRegistry); + HttpClients.custom().setConnectionManager(connManager); + + // 创建自定义的httpclient对象 + httpsClient = HttpClients.custom().setConnectionManager(connManager).build(); + } catch (Exception e) { + e.printStackTrace(); + } + } /*** 超时设置 ****/ private static RequestConfig requestConfig = RequestConfig.custom() @@ -78,7 +110,7 @@ public class HttpClientManager { * * @author: jianjun liu */ - public Result sendPost(String url, Map paramsMap) { + public Result sendPost(String url, Map paramsMap) { try { HttpPost httppost = new HttpPost(url); @@ -92,9 +124,8 @@ public class HttpClientManager { UrlEncodedFormEntity urlEncodedFormEntity = new UrlEncodedFormEntity(list, "utf-8"); httppost.setEntity(urlEncodedFormEntity); - return execute(httppost); + return execute(httppost, false); } catch (Exception e) { - e.printStackTrace(); log.error("send exception", e); return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); } @@ -119,7 +150,7 @@ public class HttpClientManager { StringEntity se = new StringEntity(jsonStrParam, "utf-8"); httppost.setEntity(se); } - return execute(httppost); + return execute(httppost, false); } catch (Exception e) { log.error("send exception", e); throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); @@ -144,13 +175,38 @@ public class HttpClientManager { HttpEntity reqEntity = MultipartEntityBuilder.create() .addPart("media", fileBody).build(); httppost.setEntity(reqEntity); - return execute(httppost); + return execute(httppost,false); } catch (Exception e) { log.error("send exception", e); throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); } } + /** + * desc: https发送json post 请求 + * param: url,jsonStrParam + * return: Result + * date: 2019/2/21 9:12 + * + * @author: jianjun liu + */ + public Result sendPostByHttps(String url, String jsonStrParam) { + try { + HttpPost httppost = new HttpPost(url); + httppost.setConfig(requestConfig); + httppost.addHeader("Content-Type", "application/json"); + if (StringUtils.isNotEmpty(jsonStrParam)) { + StringEntity se = new StringEntity(jsonStrParam, "utf-8"); + httppost.setEntity(se); + } + return execute(httppost, true); + } catch (Exception e) { + log.error("sendPostByHttps exception", e); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + + } + /** * desc: 发送钉钉群消息 简版 * param: url,jsonStrParam @@ -168,10 +224,10 @@ public class HttpClientManager { Mac mac = Mac.getInstance("HmacSHA256"); mac.init(new SecretKeySpec(secret.getBytes("UTF-8"), "HmacSHA256")); byte[] signData = mac.doFinal(stringToSign.getBytes("UTF-8")); - String sign = URLEncoder.encode(new String(Base64.encodeBase64(signData)),"UTF-8"); + String sign = URLEncoder.encode(new String(Base64.encodeBase64(signData)), "UTF-8"); DingTalkTextMsg msg = new DingTalkTextMsg(); msg.setContent(content); - url = url.concat("×tamp="+timestamp+"&sign="+sign); + url = url.concat("×tamp=" + timestamp + "&sign=" + sign); String jsonStrParam = msg.getMsgContent(); return sendPostByJSON(url, jsonStrParam); } catch (Exception e) { @@ -200,25 +256,28 @@ public class HttpClientManager { } HttpGet httpGet = new HttpGet(builder.build()); httpGet.setConfig(requestConfig); - return execute(httpGet); + return execute(httpGet, false); } catch (Exception e) { log.error("sendGet exception", e); return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); } } - private Result execute(HttpRequestBase httpMethod) { + private Result execute(HttpRequestBase httpMethod, boolean isHttps) { CloseableHttpResponse response = null; try { - response = httpclient.execute(httpMethod); - log.debug("http send response:{}", JSON.toJSONString(response)); + if (isHttps) { + response = httpsClient.execute(httpMethod); + } else { + response = httpclient.execute(httpMethod); + } if (response != null && response.getStatusLine() != null) { if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { String result = EntityUtils.toString(response.getEntity()); return new Result().ok(result); } else { log.warn("execute http method fail,httpStatus:{}", response.getStatusLine().getStatusCode()); - return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(),"请求失败httpStatus:"+response.getStatusLine().getStatusCode()); + return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), "请求失败httpStatus:" + response.getStatusLine().getStatusCode()); } } } catch (Exception e) { @@ -297,17 +356,29 @@ public class HttpClientManager { return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); } - public static void main(String[] args) { - String url = "http://localhost:8107/epmetscan/api/textSyncScan"; - TextTaskDTO p = new TextTaskDTO(); - p.setDataId("1"); - p.setContent("neirong1"); - List list = new ArrayList<>(); - list.add(p); - TextScanParamDTO param = new TextScanParamDTO(); - param.setTasks(list); - Result result = HttpClientManager.getInstance().sendPostByJSON(url, JSON.toJSONString(param)); - System.out.println(JSON.toJSONString(result)); + private static SSLContext createIgnoreVerifySSL() throws NoSuchAlgorithmException, KeyManagementException { + SSLContext sc = SSLContext.getInstance("SSLv3"); + + // 实现一个X509TrustManager接口,用于绕过验证,不用修改里面的方法 + X509TrustManager trustManager = new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] paramArrayOfX509Certificate, + String paramString) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] paramArrayOfX509Certificate, + String paramString) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return null; + } + }; + + sc.init(null, new TrustManager[]{trustManager}, null); + return sc; } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java index a39a45309e..ef7a3257a6 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java @@ -18,7 +18,6 @@ import java.util.List; * 扫描内容工具类 * * @author jianjun liu - * @email liujianjun@yunzongnet.com * @date 2020-06-08 8:28 **/ @Slf4j diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/SendMqMsgUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/SendMqMsgUtils.java new file mode 100644 index 0000000000..65fb179ca3 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/SendMqMsgUtils.java @@ -0,0 +1,69 @@ +package com.epmet.commons.tools.utils; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.epmet.commons.tools.config.MqConfig; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; +import com.epmet.commons.tools.dto.form.mq.MqReturnBaseResult; +import com.epmet.commons.tools.enums.MqMethodPathEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.ValidateException; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +/** + * 发送亿联云消息工具类 + * + * @author jianjun liu + * @date 2020-06-08 8:28 + **/ +@Slf4j +@Component +public class SendMqMsgUtils { + private static MqConfig mqStaticConfig; + + /** + * desc:发送mq消息 + * + * @return + */ + public static Result sendMsg(MqBaseMsgDTO msg) { + if (mqStaticConfig == null) { + mqStaticConfig = SpringContextUtils.getBean(MqConfig.class); + } + log.debug("sendMsg param:{}", JSON.toJSONString(msg)); + try { + // TODO + //ValidatorUtils.validateEntity(msg, null); + } catch (ValidateException e) { + return new Result().error(e.getMsg()); + } + msg.setAppId(mqStaticConfig.getAppId()); + msg.setRequestUrl(mqStaticConfig.getHost().concat(MqMethodPathEnum.SEND_MSG.getCode())); + msg.setToken(mqStaticConfig.getToken()); + try { + Result result = HttpClientManager.getInstance().sendPostByHttps(msg.getRequestUrl(), JSON.toJSONString(msg)); + log.debug("sendMsg result:{}", JSON.toJSONString(result)); + if (result.success()) { + MqReturnBaseResult resultResult = JSON.parseObject(result.getData(), MqReturnBaseResult.class); + if (resultResult.getErrCode().equals(NumConstant.ZERO)) { + JSONObject jsonObject = JSON.parseObject(resultResult.getData()); + return new Result().ok(jsonObject.getString("msgId")); + } else { + log.error("sendMsg fail,resultData:{}", JSON.toJSONString(resultResult)); + return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), resultResult.getErrMsg()); + } + } + Result resultResult = new Result<>(); + resultResult.error(result.getCode(), result.getMsg()); + resultResult.setInternalMsg(result.getInternalMsg()); + return resultResult; + } catch (Exception e) { + log.debug("sendMsg exception", e); + return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + } + + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/pom.xml b/epmet-module/epmet-heart/epmet-heart-server/pom.xml index 3c200a6622..2646e872e2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/pom.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/pom.xml @@ -120,6 +120,11 @@ false + + https://epmet-dev.elinkservice.cn/estos/ + producerService/producer/sendMsg + 202007161443499985fa2d397436d10356542134c8f008c48 + 52d9d9b0e7d0eb5b8b81c205b579e07c @@ -152,6 +157,11 @@ true + + https://epmet-dev.elinkservice.cn/estos/ + producerService/producer/sendMsg + 202007161443499985fa2d397436d10356542134c8f008c48 + 52d9d9b0e7d0eb5b8b81c205b579e07c @@ -184,6 +194,11 @@ true + + https://epmet-dev.elinkservice.cn/estos/ + producerService/producer/sendMsg + 202007161443499985fa2d397436d10356542134c8f008c48 + 52d9d9b0e7d0eb5b8b81c205b579e07c diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/TestController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/TestController.java index 773e645d2c..a7ddd79e3b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/TestController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/TestController.java @@ -1,15 +1,17 @@ package com.epmet.controller; +import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.SendMqMsgUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; 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 org.springframework.web.bind.annotation.*; import java.util.HashMap; import java.util.Map; @@ -23,15 +25,38 @@ import java.util.Map; @RestController @RequestMapping("demo") public class TestController { - private Logger logger = LogManager.getLogger(TestController.class); - @Autowired - private LoginUserUtil loginUserUtil; - @GetMapping("test") - public Result test(@LoginUser TokenDto tokenDto){ - Map map=new HashMap<>(); - String userId=loginUserUtil.getLoginUserId(); - map.put("TokenDto", tokenDto); - map.put("userId",userId); - return new Result().ok(map); - } + private Logger logger = LogManager.getLogger(TestController.class); + @Autowired + private LoginUserUtil loginUserUtil; + + @GetMapping("test") + public Result test(@LoginUser TokenDto tokenDto) { + Map map = new HashMap<>(); + String userId = loginUserUtil.getLoginUserId(); + map.put("TokenDto", tokenDto); + map.put("userId", userId); + return new Result().ok(map); + } + + @PostMapping("sendPointMsg") + public Result sendPointEvent(@RequestBody MqBaseMsgDTO mqBaseMsgDTO) { + Result result = SendMqMsgUtils.sendMsg(mqBaseMsgDTO); + logger.info("param:{},reult:{}", mqBaseMsgDTO, result); + return result; + } + + public static void main(String[] args) { + String url = "https://epmet-dev.elinkservice.cn/estos/producerService/producer/sendMsg"; + Map msgInfo = new HashMap(6); + msgInfo.put("appId", "202007161443499985fa2d397436d10356542134c8f008c48"); + //msgInfo.put("appName", "党群e事通开发测试"); + msgInfo.put("eventClass", "epmet_heart"); + msgInfo.put("eventTag", "active_send_point"); + msgInfo.put("msg", "我是消息体"); + //msgInfo.put("msgId", "123456"); + msgInfo.put("token", "52d9d9b0e7d0eb5b8b81c205b579e07c"); + String jsonStrParam = JSON.toJSONString(msgInfo); + Result result = HttpClientManager.getInstance().sendPostByHttps(url, jsonStrParam); + System.out.println("result:" + result + "param:" + jsonStrParam); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml index f1b4e09318..e9eeec50c4 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml @@ -116,4 +116,12 @@ ribbon: #pageHelper分页插件 pagehelper: helper-dialect: mysql - reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + +#亿联云消息网关 +elink: + mq: + appId: @elink.mq.appId@ #项目接入亿联云的应用Id + token: @elink.mq.token@ #项目接入亿联云的应用token 相当于secret + host: @elink.mq.host@ #亿联云消息网关服务地址 + sendMsgPath: @elink.mq.sendMsgPath@ #发送消息路径 \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/dto/form/SendPointFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/dto/form/SendPointFormDTO.java new file mode 100644 index 0000000000..ae4c7aeeba --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/dto/form/SendPointFormDTO.java @@ -0,0 +1,18 @@ +package dto.form;/** + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-07-17 17:16 + **/ + +import lombok.Data; + +/** + * desc:发送积分dto + * @author lyn + * @date 2020/7/17 17:16 + */ +@Data +public class SendPointFormDTO { + private String pointDesc; + private Integer point; +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/MqSubcribeConfig.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/MqSubcribeConfig.java new file mode 100644 index 0000000000..e7e1a33c7f --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/MqSubcribeConfig.java @@ -0,0 +1,45 @@ +package com.epmet.config; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.dto.form.mq.MqSubscribeFormDTO; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * desc:订阅积分事件 + */ +@Component +public class MqSubcribeConfig { + private Logger logger = LogManager.getLogger(MqSubcribeConfig.class); + + private String mqServer = "https://epmet-dev.elinkservice.cn/estos/mq-subscriber/subscribe"; + private String token = "1cfcbb5ade1e3202855ee5819983d773"; + + @PostConstruct + private void subscribe() { + MqSubscribeFormDTO event = new MqSubscribeFormDTO(); + event.setBelongAppId("202007161443499985fa2d397436d10356542134c8f008c48"); + event.setEventClass("epmet_heart"); + event.setEventTag("active_send_point"); + String callbackUrl = "http://192.168.51.49/point/callback/sendPoint"; + callbackUrl = ""; + event.setCallbackUrl(callbackUrl); + List subscribeFormDTOList = new ArrayList<>(); + subscribeFormDTOList.add(event); + Map param = new HashMap<>(); + param.put("token", token); + param.put("mqSubscribeList", subscribeFormDTOList); + String jsonStrParam = JSON.toJSONString(param); + Result result = HttpClientManager.getInstance().sendPostByHttps(mqServer, JSON.toJSONString(param)); + logger.error("subscriber==jsonStrParam:{}=====result:{}" ,jsonStrParam, JSON.toJSONString(result)); + } +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/MqPointCallbackController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/MqPointCallbackController.java new file mode 100644 index 0000000000..aeaca6e25d --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/MqPointCallbackController.java @@ -0,0 +1,45 @@ +package com.epmet.controller; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.dto.form.mq.ReceiveMqMsg; +import com.epmet.commons.tools.utils.ConvertUtils; +import dto.form.SendPointFormDTO; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * desc: 积分相关消息回调controller + * + * @date: 2020/7/21 9:04 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ +@Slf4j +@RestController +@RequestMapping("mqCallback") +public class MqPointCallbackController { + private Logger logger = LogManager.getLogger(MqPointCallbackController.class); + + /** + * desc:爱心活动积分发放 + * + * @param mqMsg + * @return + */ + @RequestMapping("activeSendPoint") + public String activeSendPoint(ReceiveMqMsg mqMsg) { + log.debug("activeSendPoint receive mqMsg:{}", JSON.toJSONString(mqMsg)); + if (mqMsg == null || StringUtils.isBlank(mqMsg.getMsg())) { + log.warn("activeSendPoint mqMsg is empty"); + return "success"; + } + SendPointFormDTO formDTO = ConvertUtils.sourceToTarget(mqMsg.getMsg(), SendPointFormDTO.class); + log.info("activeSendPoint consumer success,formDTO:{}", JSON.toJSONString(formDTO)); + return "success"; + } +} + diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/epmet_point.sql b/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/epmet_point.sql index af08a35db6..91e47c87ad 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/epmet_point.sql +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/epmet_point.sql @@ -1,15 +1,15 @@ CREATE TABLE point_rule( ID VARCHAR(64) NOT NULL COMMENT '主键' , CUSTOMER_ID VARCHAR(64) COMMENT '客户ID' , + RULE_NAME VARCHAR(32) COMMENT '规则名称 与事件名称保持一致即可' , + RULE_DESC VARCHAR(32) COMMENT '规则说明 事件说明' , EVENT_CODE VARCHAR(32) COMMENT '事件CODE 来自事件表' , EVENT_NAME VARCHAR(32) COMMENT '事件名称 来自事件表' , - RULE_DESC VARCHAR(32) COMMENT '积分说明 事件说明' , OPERATE_TYPE VARCHAR(32) COMMENT '操作类型 加积分:add;减积分:subtract' , UP_LIMIT INT COMMENT '积分上限' , - untitled VARCHAR(32) COMMENT '积分上限描述' , + UP_LIMIT_DESC VARCHAR(64) COMMENT '积分上限描述' , POINT_NUM INT DEFAULT 0 COMMENT '获得积分值' , POINT_UNIT VARCHAR(32) COMMENT '获得积分单位 次:time;分钟:minute;小时:hour' , - REMARK VARCHAR(128) COMMENT '备注 备注说明' , ENABLED_FLAG VARCHAR(1) COMMENT '是否启用 0-否,1-是' , DEL_FLAG VARCHAR(1) COMMENT '删除标识 0-否,1-是' , REVISION INT COMMENT '乐观锁' , @@ -18,7 +18,7 @@ CREATE TABLE point_rule( UPDATED_BY VARCHAR(32) COMMENT '更新人' , UPDATED_TIME DATETIME COMMENT '更新时间' , PRIMARY KEY (ID) -) COMMENT = '积分规则表';; +) COMMENT = '积分规则表'; CREATE TABLE sys_operate_log( ID VARCHAR(64) NOT NULL COMMENT '主键' , From 64f902d5be49b539ea9ace72454c22539daad3ea Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 21 Jul 2020 18:20:51 +0800 Subject: [PATCH 25/98] =?UTF-8?q?heart-work:preview=20=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E8=AF=A6=E6=83=85api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dao/LatestActContentDao.java | 10 ++++++++ .../java/com/epmet/dao/LatestActInfoDao.java | 10 ++++++++ .../impl/LatestActContentServiceImpl.java | 6 ++--- .../impl/LatestActInfoServiceImpl.java | 2 +- .../resources/mapper/LatestActContentDao.xml | 13 +++++++++++ .../resources/mapper/LatestActInfoDao.xml | 23 +++++++++++++++++++ 6 files changed, 60 insertions(+), 4 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActContentDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActContentDao.java index 12568cd4e6..a0cbb2b6e5 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActContentDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActContentDao.java @@ -19,6 +19,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.result.work.ActDraftContentDTOResultDTO; +import com.epmet.dto.result.work.ActPreviewContentResultDTO; import com.epmet.entity.LatestActContentEntity; import org.apache.ibatis.annotations.Mapper; @@ -50,4 +51,13 @@ public interface LatestActContentDao extends BaseDao { * @Date 2020/7/20 23:01 **/ List selectActContentList(String actId); + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 预览-查看活动详情 + * @Date 2020/7/21 18:07 + **/ + List previewActContent(String actId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActInfoDao.java index 0cd96b4a67..d1a00cb15d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActInfoDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActInfoDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.work.ActPreviewResultDTO; import com.epmet.dto.result.work.LatestDraftActInfoResultDTO; import com.epmet.entity.LatestActInfoEntity; import org.apache.ibatis.annotations.Mapper; @@ -48,4 +49,13 @@ public interface LatestActInfoDao extends BaseDao { * @Date 2020/7/20 23:05 **/ LatestDraftActInfoResultDTO selectLatestActDraft(String userId); + + /** + * @return com.epmet.dto.result.work.ActPreviewResultDTO + * @param actDraftId + * @author yinzuomei + * @description 预览-查看活动详情 + * @Date 2020/7/21 17:56 + **/ + ActPreviewResultDTO previewActInfo(String actDraftId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java index 03c0e5621d..e60c7d539e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java @@ -142,15 +142,15 @@ public class LatestActContentServiceImpl extends BaseServiceImpl * @author yinzuomei * @description 预览-查看活动详情 * @Date 2020/7/21 17:47 **/ @Override - public List previewActContent(String actDraftId) { - return null; + public List previewActContent(String actId) { + return baseDao.previewActContent(actId); } } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActInfoServiceImpl.java index dba3dc1f94..fb1a572fde 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActInfoServiceImpl.java @@ -174,7 +174,7 @@ public class LatestActInfoServiceImpl extends BaseServiceImpl + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml index e8d11c7b25..28b43cd8cf 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml @@ -95,4 +95,27 @@ lai.CREATED_TIME DESC LIMIT 1 + + + \ No newline at end of file From 9e0fbb994e40aab2b5ee4d95fa14c7dedf7df0e2 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 21 Jul 2020 20:45:56 +0800 Subject: [PATCH 26/98] =?UTF-8?q?heart-work:=E5=8F=91=E5=B8=83=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8=E3=80=81=E4=BF=9D=E5=AD=98=E6=B4=BB=E5=8A=A8=E8=8D=89?= =?UTF-8?q?=E7=A8=BF=E6=8E=A5=E5=8F=A3=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/exception/EpmetErrorCode.java | 6 + .../main/java/com/epmet/dto/ActInfoDTO.java | 2 +- .../com/epmet/dto/ActOperationRecDTO.java | 5 +- .../dto/form/work/DraftActInfoFormDTO.java | 13 +- .../dto/form/work/PublishActInfoFormDTO.java | 29 +- .../dto/result/work/PublishActResultDTO.java | 17 + .../epmet-heart/epmet-heart-server/pom.xml | 9 + .../java/com/epmet/constant/ActConstant.java | 70 ++++ .../controller/WorkActDraftController.java | 30 +- .../java/com/epmet/entity/ActInfoEntity.java | 2 +- .../epmet/entity/ActOperationRecEntity.java | 5 +- .../epmet/service/WorkActDraftService.java | 15 +- .../service/impl/WorkActDraftServiceImpl.java | 333 +++++++++++++++++- .../src/main/resources/bootstrap.yml | 9 +- 14 files changed, 495 insertions(+), 50 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PublishActResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 22eb8f38ac..63cab186d4 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -49,6 +49,12 @@ public enum EpmetErrorCode { CANNOT_DELETE_PARTY_MEMBER(8111,"该用户已注册党员,不允许删除"), GROUP_LEADER_CAN_EDIT_GROUP_INFO(8112,"只有组长才可以修改小组信息"), INVITE_NEW_MEMBER(8113,"只有讨论中的小组才可以邀请新成员"), + ACT_TITLE_SCAN_FAILED(8114,"活动标题审核失败,请重新编辑"), + ACT_REQ_SCAN_FAILED(8115,"活动报名条件审核失败,请重新编辑"), + ACT_CONTENT_TEXT_SCAN_FAILED(8116,"活动详情内容审核失败,请重新编辑"), + ACT_CONTENT_IMG_SCAN_FAILED(8117,"活动详情图片失败,请重新编辑"), + ACT_COVER_PIC_SCAN_FAILED(8118,"活动封面图片审核失败,请重新编辑"), + CANNOT_AUDIT_WARM(8201, "请完善居民信息"), NOT_DEL_AGENCY(8202, "该机关存在下级机关,不允许删除"), NOT_DEL_AGENCY_PER(8205, "该机关存在工作人员,不允许删除"), diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java index 0a30122f04..ad18a98c8b 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java @@ -215,7 +215,7 @@ public class ActInfoDTO implements Serializable { /** * 1已经总结0未总结 */ - private Integer summaryFlag; + private Boolean summaryFlag; /** * 乐观锁 diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActOperationRecDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActOperationRecDTO.java index 1faff0fdd7..00b8294271 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActOperationRecDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActOperationRecDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -54,7 +55,7 @@ public class ActOperationRecDTO implements Serializable { /** * 1通知用户0不通知 */ - private Integer noticeUser; + private Boolean noticeUser; /** * 删除标记 diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java index 90255794a9..6ec78b75a0 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java @@ -2,11 +2,13 @@ package com.epmet.dto.form.work; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import org.hibernate.validator.constraints.Length; import javax.validation.Valid; import javax.validation.constraints.Min; import javax.validation.constraints.NotBlank; import java.io.Serializable; +import java.math.BigDecimal; import java.util.List; /** @@ -49,6 +51,7 @@ public class DraftActInfoFormDTO implements Serializable { * 活动标题 */ @NotBlank(message = "活动标题不能为空", groups = {AddDraftUserShowGroup.class}) + @Length(min=1, max=50,message = "活动标题限50字以内", groups = {AddDraftUserShowGroup.class}) private String title; /** @@ -64,12 +67,12 @@ public class DraftActInfoFormDTO implements Serializable { /** * 活动地点-经度 */ - private String actLongitude; + private BigDecimal actLongitude; /** * 活动地点-纬度 */ - private String actLatitude; + private BigDecimal actLatitude; /** * 活动预计开始时间yyyy-MM-dd HH:mm @@ -111,6 +114,8 @@ public class DraftActInfoFormDTO implements Serializable { /** * 报名条件 */ + @NotBlank(message = "报名条件不能为空", groups = {AddDraftUserShowGroup.class}) + @Length(min=1, max=50,message = "报名条件限200字以内", groups = {AddDraftUserShowGroup.class}) private String requirement; /** @@ -131,12 +136,12 @@ public class DraftActInfoFormDTO implements Serializable { /** * 签到地址-纬度 */ - private String signInLatitude; + private BigDecimal signInLatitude; /** * 签到地址-经度 */ - private String signInLongitude; + private BigDecimal signInLongitude; /** * 签到有效范围(米) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java index bafb5f2a0f..e1005aa31a 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java @@ -2,12 +2,15 @@ package com.epmet.dto.form.work; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import org.hibernate.validator.constraints.Length; import javax.validation.Valid; import javax.validation.constraints.Min; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; import java.io.Serializable; +import java.math.BigDecimal; import java.util.List; /** @@ -27,6 +30,7 @@ public class PublishActInfoFormDTO implements Serializable { } @Valid + @Size(min=1,message = "活动详情不能为空",groups = {AddUserShowGroup.class}) private List actContent; /** @@ -34,12 +38,6 @@ public class PublishActInfoFormDTO implements Serializable { */ private String actDraftId; - - /** - * 如果是重新发布活动,此列是有值的 - */ - private String actId; - /** * 客户id */ @@ -50,6 +48,7 @@ public class PublishActInfoFormDTO implements Serializable { * 活动标题 */ @NotBlank(message = "活动标题不能为空", groups = {AddUserShowGroup.class}) + @Length(min=1, max=50,message = "活动标题限50字以内", groups = {AddUserShowGroup.class}) private String title; /** @@ -67,14 +66,14 @@ public class PublishActInfoFormDTO implements Serializable { /** * 活动地点-经度 */ - @NotBlank(message = "活动地点经度不能为空", groups = {AddUserInternalGroup.class}) - private String actLongitude; + @NotNull(message = "活动地点经度不能为空", groups = {AddUserInternalGroup.class}) + private BigDecimal actLongitude; /** * 活动地点-纬度 */ - @NotBlank(message = "活动地点经度不能为空", groups = {AddUserInternalGroup.class}) - private String actLatitude; + @NotNull(message = "活动地点经度不能为空", groups = {AddUserInternalGroup.class}) + private BigDecimal actLatitude; /** * 活动预计开始时间yyyy-MM-dd HH:mm @@ -122,6 +121,7 @@ public class PublishActInfoFormDTO implements Serializable { * 报名条件 */ @NotBlank(message = "报名条件不能为空", groups = {AddUserShowGroup.class}) + @Length(min=1, max=50,message = "报名条件限200字以内", groups = {AddUserShowGroup.class}) private String requirement; /** @@ -145,19 +145,20 @@ public class PublishActInfoFormDTO implements Serializable { /** * 签到地址-纬度 */ - @NotBlank(message = "签到地址-纬度不能为空", groups = {AddUserInternalGroup.class}) - private String signInLatitude; + @NotNull(message = "签到地址-纬度不能为空", groups = {AddUserInternalGroup.class}) + private BigDecimal signInLatitude; /** * 签到地址-经度 */ - @NotBlank(message = "签到地址-经度不能为空", groups = {AddUserInternalGroup.class}) - private String signInLongitude; + @NotNull(message = "签到地址-经度不能为空", groups = {AddUserInternalGroup.class}) + private BigDecimal signInLongitude; /** * 签到有效范围(米) */ @Min(0) + @NotNull(message = "签到有效范围不能为空", groups = {AddUserShowGroup.class}) private Integer signInRadius; /** diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PublishActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PublishActResultDTO.java new file mode 100644 index 0000000000..5fdc6a5c06 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PublishActResultDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 发布活动-返参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 18:29 + */ +@Data +public class PublishActResultDTO implements Serializable { + private static final long serialVersionUID = 4699176252192192495L; + private String actId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/pom.xml b/epmet-module/epmet-heart/epmet-heart-server/pom.xml index 2646e872e2..c708875ec3 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/pom.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/pom.xml @@ -64,6 +64,12 @@ 2.0.0 compile + + com.epmet + gov-org-client + 2.0.0 + compile + @@ -120,6 +126,7 @@ false + https://epmet-dev.elinkservice.cn/api/epmetscan/api https://epmet-dev.elinkservice.cn/estos/ producerService/producer/sendMsg @@ -157,6 +164,7 @@ true + https://epmet-dev.elinkservice.cn/api/epmetscan/api https://epmet-dev.elinkservice.cn/estos/ producerService/producer/sendMsg @@ -194,6 +202,7 @@ true + https://epmet-open.elinkservice.cn/api/epmetscan/api https://epmet-dev.elinkservice.cn/estos/ producerService/producer/sendMsg diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java new file mode 100644 index 0000000000..0ee7df0ae7 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java @@ -0,0 +1,70 @@ +package com.epmet.constant; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 20:21 + */ +public interface ActConstant { + /** + * 文本 + */ + String ACT_CONTENT_TYPE_TEXT = "text"; + + /** + * 图片 + */ + String ACT_CONTENT_TYPE_IMG="img"; + + /** + * (1)活动状态 + * act_info表中的status,已发布/报名中, + * 发布成功后自动赋值 + */ + String ACT_STATUS_PUBLISHED="published"; + + /** + * (2)活动状态 + * 活动已取消, + * 成功取消活动后,写入act_info表中的status, + */ + String ACT_STATUS_CANCELED="canceled"; + + /** + * (3)活动状态 + * 活动已结束 + * 活动后,写入act_info表中的status, + */ + String ACT_STATUS_FINISHED="finished"; + + /** + * 发布活动时,选择的主办方名义,已组织名义发布 + */ + String SPONSOR_AGENCY="agency"; + + /** + * 发布活动时,选择的主办方名义,已网格名义发布 + */ + String SPONSOR_GRID="grid"; + + /** + * 活动操作日志:取消活动 + */ + String ACT_OPER_TYPE_CANCEL="cancel"; + + /** + * 活动操作日志:发布活动 + */ + String ACT_OPER_TYPE_PUBLISH="publish"; + + /** + * 活动操作日志:结束活动 + */ + String ACT_OPER_TYPE_FINISH="finish"; + + /** + * 活动操作日志:重新发布活动 + */ + String ACT_OPER_TYPE_UPDATE="update"; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java index 73974c194d..f69b65b065 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java @@ -2,13 +2,8 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.dto.form.work.ActPreviewFormDTO; -import com.epmet.dto.form.work.DraftActContentFormDTO; -import com.epmet.dto.form.work.DraftActInfoFormDTO; -import com.epmet.dto.result.work.ActPreviewResultDTO; -import com.epmet.dto.result.work.LatestDraftActInfoResultDTO; -import com.epmet.dto.result.work.PublishActInitResultDTO; -import com.epmet.dto.result.work.SaveActDraftResultDTO; +import com.epmet.dto.form.work.*; +import com.epmet.dto.result.work.*; import com.epmet.service.WorkActDraftService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -107,4 +102,25 @@ public class WorkActDraftController { return new Result().ok(resultDTO); } + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 发布活动 + * @Date 2020/7/21 18:32 + **/ + @PostMapping("publish") + public Result publishAct(@RequestBody PublishActInfoFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, PublishActInfoFormDTO.AddUserShowGroup.class, PublishActInfoFormDTO.AddUserInternalGroup.class); + for (PublishActContentFormDTO actContentFormDTO : formDTO.getActContent()) { + ValidatorUtils.validateEntity(actContentFormDTO, + PublishActContentFormDTO.UserShowGroup.class, + PublishActContentFormDTO.UserInternalGroup.class + ); + } + PublishActResultDTO resultDTO = workActDraftService.publishAct(formDTO); + return new Result().ok(resultDTO); + } + + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java index c92f1733b2..7681415b68 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java @@ -127,7 +127,7 @@ public class ActInfoEntity extends BaseEpmetEntity { /** * 活动名额类型(0-不限名额,1-固定名额) */ - private Integer actQuotaCategory; + private Boolean actQuotaCategory; /** * 活动名额 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActOperationRecEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActOperationRecEntity.java index fe794c6422..aef5e68fe0 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActOperationRecEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActOperationRecEntity.java @@ -18,13 +18,10 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; - /** * 活动操作日志表 * @@ -54,6 +51,6 @@ public class ActOperationRecEntity extends BaseEpmetEntity { /** * 1通知用户0不通知 */ - private Integer noticeUser; + private Boolean noticeUser; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java index 816305db8c..e08b1671e4 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java @@ -2,10 +2,8 @@ package com.epmet.service; import com.epmet.dto.form.work.ActPreviewFormDTO; import com.epmet.dto.form.work.DraftActInfoFormDTO; -import com.epmet.dto.result.work.ActPreviewResultDTO; -import com.epmet.dto.result.work.LatestDraftActInfoResultDTO; -import com.epmet.dto.result.work.PublishActInitResultDTO; -import com.epmet.dto.result.work.SaveActDraftResultDTO; +import com.epmet.dto.form.work.PublishActInfoFormDTO; +import com.epmet.dto.result.work.*; /** * 工作端活动草稿 @@ -59,4 +57,13 @@ public interface WorkActDraftService { * @Date 2020/7/21 17:24 **/ ActPreviewResultDTO previewActDetail(ActPreviewFormDTO formDTO); + + /** + * @return com.epmet.dto.result.work.PublishActResultDTO + * @param formDTO + * @author yinzuomei + * @description 发布活动 + * @Date 2020/7/21 18:33 + **/ + PublishActResultDTO publishAct(PublishActInfoFormDTO formDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java index a1f6797309..1c75dfdb57 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java @@ -1,13 +1,31 @@ package com.epmet.service.impl; +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.scan.param.ImgScanParamDTO; +import com.epmet.commons.tools.scan.param.ImgTaskDTO; +import com.epmet.commons.tools.scan.param.TextScanParamDTO; +import com.epmet.commons.tools.scan.param.TextTaskDTO; +import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.ScanContentUtils; +import com.epmet.constant.ActConstant; +import com.epmet.dao.ActContentDao; +import com.epmet.dao.ActInfoDao; +import com.epmet.dao.ActOperationRecDao; +import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.LatestActContentDTO; import com.epmet.dto.LatestActInfoDTO; -import com.epmet.dto.form.work.ActPreviewFormDTO; -import com.epmet.dto.form.work.DraftActContentFormDTO; -import com.epmet.dto.form.work.DraftActInfoFormDTO; +import com.epmet.dto.form.work.*; import com.epmet.dto.result.work.*; +import com.epmet.entity.ActContentEntity; +import com.epmet.entity.ActInfoEntity; +import com.epmet.entity.ActOperationRecEntity; +import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.LatestActContentService; import com.epmet.service.LatestActInfoService; import com.epmet.service.WorkActDraftService; @@ -15,12 +33,14 @@ import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; -import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.UUID; /** * 工作端活动草稿 @@ -37,6 +57,20 @@ public class WorkActDraftServiceImpl implements WorkActDraftService { private LatestActInfoService latestActInfoService; @Autowired private LatestActContentService latestActContentService; + @Value("${openapi.scan.server.url}") + private String scanApiUrl; + @Value("${openapi.scan.method.textSyncScan}") + private String textSyncScanMethod; + @Value("${openapi.scan.method.imgSyncScan}") + private String imgSyncScanMethod; + @Autowired + private ActInfoDao actInfoDao; + @Autowired + private ActContentDao actContentDao; + @Autowired + private ActOperationRecDao actOperationRecDao; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; /** * @return com.epmet.dto.form.work.PublishActInitResultDTO @@ -141,6 +175,274 @@ public class WorkActDraftServiceImpl implements WorkActDraftService { return actPreviewResultDTO; } + /** + * @param formDTO + * @return com.epmet.dto.result.work.PublishActResultDTO + * @author yinzuomei + * @description 发布活动 + * @Date 2020/7/21 18:33 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public PublishActResultDTO publishAct(PublishActInfoFormDTO formDTO) { + PublishActResultDTO publishActResultDTO=new PublishActResultDTO(); + //内容审核(活动标题、招募要求、活动内容图文) + this.auditAct(formDTO); + logger.info("发布活动,审核成功"); + + //构造属性保存活动属性,活动内容 + ActInfoEntity actInfoEntity=this.constructActInfo(formDTO); + actInfoDao.insert(actInfoEntity); + + List actContentEntityList=this.constructActContent(formDTO.getActContent(),actInfoEntity.getId()); + for(ActContentEntity actContentEntity:actContentEntityList){ + actContentDao.insert(actContentEntity); + } + //插入一条操作日志 + ActOperationRecEntity actOperationRecEntity=new ActOperationRecEntity(); + actOperationRecEntity.setActId(actInfoEntity.getId()); + actOperationRecEntity.setType(ActConstant.ACT_OPER_TYPE_PUBLISH); + actOperationRecEntity.setNoticeUser(false); + actOperationRecDao.insert(actOperationRecEntity); + + //删除所有的草稿 + this.deleteDraft(); + publishActResultDTO.setActId(actInfoEntity.getId()); + + return publishActResultDTO; + } + + /** + * @return com.epmet.entity.ActInfoEntity + * @param formDTO + * @author yinzuomei + * @description 发布活动-构造act_info + * @Date 2020/7/21 20:00 + **/ + private ActInfoEntity constructActInfo(PublishActInfoFormDTO formDTO) { + ActInfoEntity actInfoEntity = ConvertUtils.sourceToTarget(formDTO, ActInfoEntity.class); + //活动名额类型(0-不限名额,1-固定名额) + if(actInfoEntity.getActQuota()==0){ + actInfoEntity.setActQuotaCategory(false); + }else{ + actInfoEntity.setActQuotaCategory(true); + } + actInfoEntity.setSignUpStartTime(new Date()); + actInfoEntity.setActStatus(ActConstant.ACT_STATUS_PUBLISHED); + + //1已经总结0未总结 + actInfoEntity.setSummaryFlag(false); + if(ActConstant.SPONSOR_AGENCY.equals(actInfoEntity.getSponsorType())){ + //调用gov_org服务获取当前组织的上一级机关id TODO + Result result=govOrgOpenFeignClient.getAgencyById(formDTO.getSponsorId()); + if(result.success()&&null!=result.getData()){ + actInfoEntity.setPid(result.getData().getPid()); + }else{ + logger.warn("根据agencyId查询组织信息失败,agencyId=",formDTO.getSponsorId()); + } + }else{ + actInfoEntity.setPid(""); + } + return actInfoEntity; + } + + /** + * @return java.util.List + * @param actContent + * @param actId + * @author yinzuomei + * @description 发布活动-构造活动详情act_content + * @Date 2020/7/21 19:59 + **/ + private List constructActContent(List actContent, String actId) { + List list=new ArrayList<>(); + int orderNum=1; + for(PublishActContentFormDTO actContentFormDTO:actContent){ + ActContentEntity actContentEntity=new ActContentEntity(); + actContentEntity.setActId(actId); + actContentEntity.setContent(actContentFormDTO.getContent()); + actContentEntity.setContentType(actContentFormDTO.getContentType()); + actContentEntity.setOrderNum(orderNum); + list.add(actContentEntity); + orderNum++; + } + return list; + } + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 活动相关内容审核(活动标题、招募要求、活动内容图文) + * @Date 2020/7/21 19:20 + **/ + private void auditAct(PublishActInfoFormDTO formDTO) { + //1、活动标题 + if (StringUtils.isNotBlank(formDTO.getTitle())) { + this.auditActTitle(formDTO.getTitle()); + } + //2、活动封面 + if(StringUtils.isNotBlank(formDTO.getCoverPic())){ + this.auditActCoverPic(formDTO.getCoverPic()); + } + + //3、招募要求 + if (StringUtils.isNotBlank(formDTO.getRequirement())) { + this.auditActRequirement(formDTO.getRequirement()); + } + //4、活动内容 + if(null==formDTO.getActContent()||formDTO.getActContent().size()<1){ + return; + } + List textList=new ArrayList<>(); + List imgList=new ArrayList<>(); + for(PublishActContentFormDTO actContent:formDTO.getActContent()){ + if(ActConstant.ACT_CONTENT_TYPE_TEXT.equals(actContent.getContentType())){ + textList.add(actContent.getContent()); + }else if(ActConstant.ACT_CONTENT_TYPE_IMG.equals(actContent.getContentType())){ + imgList.add(actContent.getContent()); + } + } + this.auditActContent(textList,imgList); + } + + /** + * @return void + * @param textList + * @param imgList + * @author yinzuomei + * @description 活动详情审核 + * @Date 2020/7/21 19:21 + **/ + private void auditActContent(List textList, List imgList) { + //审核活动详情中的内容 + if(null!=textList&&textList.size()>0){ + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + textList.forEach(content -> { + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setContent(content); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScanParamDTO.getTasks().add(taskDTO); + }); + Result contentSyncScanRes = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!contentSyncScanRes.success()) { + logger.error("活动详情内容审核接口失败,返参:", JSON.toJSONString(contentSyncScanRes)); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!contentSyncScanRes.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.ACT_REQ_SCAN_FAILED.getCode()); + } + } + logger.info("活动详情内容审核成功"); + } + if(null!=imgList&&imgList.size()>0){ + //审核活动详情中的图片 + ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO(); + imgList.forEach(url -> { + ImgTaskDTO task = new ImgTaskDTO(); + task.setDataId(UUID.randomUUID().toString().replace("-", "")); + task.setUrl(url); + imgScanParamDTO.getTasks().add(task); + }); + Result imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO); + if (!imgScanResult.success()){ + logger.error("活动详情图片审核接口失败,返参:", JSON.toJSONString(imgScanResult)); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!imgScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.ACT_CONTENT_IMG_SCAN_FAILED.getCode()); + } + } + logger.info("活动详情图片审核成功"); + } + } + + /** + * @return void + * @param requirement + * @author yinzuomei + * @description 活动招募条件审核 + * @Date 2020/7/21 19:21 + **/ + private void auditActRequirement(String requirement) { + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setContent(requirement); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + logger.error("活动报名条件审核接口返回失败,返参:", JSON.toJSONString(textSyncScanResult)); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + logger.error("活动报名条件审核失败,报名条件:",requirement); + throw new RenException(EpmetErrorCode.ACT_REQ_SCAN_FAILED.getCode()); + } + } + logger.info("活动报名条件审核成功"); + } + + /** + * @return void + * @param coverPic + * @author yinzuomei + * @description 活动封面图片审核 + * @Date 2020/7/21 19:21 + **/ + private void auditActCoverPic(String coverPic) { + ImgScanParamDTO coverPicScanParamDTO = new ImgScanParamDTO(); + ImgTaskDTO coverImgtask = new ImgTaskDTO(); + coverImgtask.setDataId(UUID.randomUUID().toString().replace("-", "")); + coverImgtask.setUrl(coverPic); + coverPicScanParamDTO.getTasks().add(coverImgtask); + Result coverPicScanRes = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), coverPicScanParamDTO); + if (!coverPicScanRes.success()){ + logger.error("活动封面审核失败接口返回失败,返参:",JSON.toJSONString(coverPicScanRes)); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!coverPicScanRes.getData().isAllPass()) { + logger.error("活动封面审核失败,封面图片地址:",coverPic); + throw new RenException(EpmetErrorCode.ACT_COVER_PIC_SCAN_FAILED.getCode()); + } + } + logger.info("活动封面审核成功"); + } + + /** + * @return void + * @param title + * @author yinzuomei + * @description 活动标题审核 + * @Date 2020/7/21 19:21 + **/ + private void auditActTitle(String title) { + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setContent(title); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + logger.error("活动标题审核接口返回失败,返参:", JSON.toJSONString(textSyncScanResult)); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + logger.error("活动标题审核失败,标题内容:",title); + throw new RenException(EpmetErrorCode.ACT_TITLE_SCAN_FAILED.getCode()); + } + } + logger.info("活动标题审核通过"); + } + + /** + * @return java.util.List + * @param actContent + * @param actDraftId + * @author yinzuomei + * @description 保存草稿- 构造latest_act_content + * @Date 2020/7/21 19:22 + **/ private List constructLatestActContent(List actContent,String actDraftId) { List list=new ArrayList<>(); int orderNum=1; @@ -156,6 +458,13 @@ public class WorkActDraftServiceImpl implements WorkActDraftService { return list; } + /** + * @return com.epmet.dto.LatestActInfoDTO + * @param formDTO + * @author yinzuomei + * @description 保存草稿- 构造latest_act_info + * @Date 2020/7/21 19:22 + **/ private LatestActInfoDTO constructLatestActInfoDTO(DraftActInfoFormDTO formDTO) { LatestActInfoDTO latestActInfoDTO=new LatestActInfoDTO(); if(StringUtils.isNotBlank(formDTO.getActDraftId())){ @@ -188,12 +497,12 @@ public class WorkActDraftServiceImpl implements WorkActDraftService { //活动地点 latestActInfoDTO.setActAddress(formDTO.getActAddress()); //活动地点-经度 - if(StringUtils.isNotBlank(formDTO.getActLongitude())){ - latestActInfoDTO.setActLongitude(new BigDecimal(formDTO.getActLongitude())); + if(null!=formDTO.getActLongitude()){ + latestActInfoDTO.setActLongitude(formDTO.getActLongitude()); } //活动地点-纬度 - if(StringUtils.isNotBlank(formDTO.getActLatitude())){ - latestActInfoDTO.setActLatitude(new BigDecimal(formDTO.getActLatitude())); + if(null!=formDTO.getActLatitude()){ + latestActInfoDTO.setActLatitude(formDTO.getActLatitude()); } //打开开始时间 if(StringUtils.isNotBlank(formDTO.getSignInStartTime())){ @@ -208,12 +517,12 @@ public class WorkActDraftServiceImpl implements WorkActDraftService { //活动签到打卡地点 latestActInfoDTO.setSignInAddress(formDTO.getSignInAddress()); //活动签到打卡位置经度 - if(StringUtils.isNotBlank(formDTO.getSignInLongitude())){ - latestActInfoDTO.setSignInLongitude(new BigDecimal(formDTO.getSignInLongitude())); + if(null!=formDTO.getSignInLongitude()){ + latestActInfoDTO.setSignInLongitude(formDTO.getSignInLongitude()); } //活动签到打卡位置纬度 - if(StringUtils.isNotBlank(formDTO.getSignInLatitude())){ - latestActInfoDTO.setSignInLatitude(new BigDecimal(formDTO.getSignInLatitude())); + if(null!=formDTO.getSignInLatitude()){ + latestActInfoDTO.setSignInLatitude(formDTO.getSignInLatitude()); } //活动签到打卡半径(单位:米) if(null!=formDTO.getSignInRadius()){ diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml index e9eeec50c4..8571a47da1 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml @@ -124,4 +124,11 @@ elink: appId: @elink.mq.appId@ #项目接入亿联云的应用Id token: @elink.mq.token@ #项目接入亿联云的应用token 相当于secret host: @elink.mq.host@ #亿联云消息网关服务地址 - sendMsgPath: @elink.mq.sendMsgPath@ #发送消息路径 \ No newline at end of file + sendMsgPath: @elink.mq.sendMsgPath@ #发送消息路径 +openapi: + scan: + server: + url: @openapi.scan.server.url@ + method: + imgSyncScan: /imgSyncScan + textSyncScan: /textSyncScan \ No newline at end of file From 13924c1217b72c64615f66a240c3e7d8556776c0 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 22 Jul 2020 11:10:17 +0800 Subject: [PATCH 27/98] =?UTF-8?q?heart-work:=E5=BE=85=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/constant/NumConstant.java | 2 +- .../java/com/epmet/dto/HeartUserInfoDTO.java | 5 +- .../dto/form/work/AuditingActUserFormDTO.java | 23 ++++ .../dto/form/work/DraftActInfoFormDTO.java | 9 -- .../result/work/AuditingActUserResultDTO.java | 55 +++++++++ .../epmet-heart/epmet-heart-server/pom.xml | 6 + .../controller/WorkActUserController.java | 27 +++++ .../com/epmet/dao/ActUserRelationDao.java | 22 +++- .../java/com/epmet/dao/HeartUserInfoDao.java | 11 +- .../com/epmet/entity/HeartUserInfoEntity.java | 5 +- .../epmet/service/ActUserRelationService.java | 18 +++ .../epmet/service/HeartUserInfoService.java | 9 ++ .../com/epmet/service/WorkActUserService.java | 23 ++++ .../impl/ActUserRelationServiceImpl.java | 24 ++++ .../impl/HeartUserInfoServiceImpl.java | 12 ++ .../service/impl/WorkActUserServiceImpl.java | 110 ++++++++++++++++++ .../resources/mapper/ActUserRelationDao.xml | 24 ++++ .../resources/mapper/HeartUserInfoDao.xml | 11 +- .../java/com/epmet/dto/UserBaseInfoDTO.java | 10 +- .../dto/result/UserBaseInfoResultDTO.java | 80 +++++++++++++ .../epmet/dto/result/UserWechatResultDTO.java | 71 +++++++++++ .../epmet/feign/EpmetUserOpenFeignClient.java | 9 ++ .../EpmetUserOpenFeignClientFallback.java | 12 ++ .../controller/UserBaseInfoController.java | 28 ++++- .../java/com/epmet/dao/UserBaseInfoDao.java | 21 +++- .../java/com/epmet/dao/UserResiInfoDao.java | 9 ++ .../java/com/epmet/dao/UserWechatDao.java | 9 ++ .../com/epmet/entity/UserBaseInfoEntity.java | 8 +- .../epmet/service/UserBaseInfoService.java | 19 +++ .../service/impl/UserBaseInfoServiceImpl.java | 69 ++++++++++- .../main/resources/mapper/UserBaseInfoDao.xml | 41 +++++++ .../main/resources/mapper/UserResiInfoDao.xml | 11 ++ .../main/resources/mapper/UserWechatDao.xml | 10 ++ 33 files changed, 776 insertions(+), 27 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AuditingActUserFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingActUserResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBaseInfoResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserWechatResultDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java index c6d5234ddd..1c0247c8b1 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java @@ -50,5 +50,5 @@ public interface NumConstant { String FOUR_STR = "4"; String FIVE_STR = "5"; String POSITIVE_EIGHT_STR = "+8"; - + String EMPTY_STR = ""; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/HeartUserInfoDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/HeartUserInfoDTO.java index 3995852d76..8ea2b28322 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/HeartUserInfoDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/HeartUserInfoDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -51,7 +52,7 @@ public class HeartUserInfoDTO implements Serializable { /** * 1是志愿者,0不是志愿者(志愿者注册成功后需要来更新值) */ - private Integer volunteerFlag; + private Boolean volunteerFlag; /** * 爱心时长(单位:分钟)(参与并签到了的活动,实际结束-实际开始)签到的。未签到但是有积分的 diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AuditingActUserFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AuditingActUserFormDTO.java new file mode 100644 index 0000000000..9fb58c8179 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AuditingActUserFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form.work; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 报名审核-待审核列表入参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 22:12 + */ +@Data +public class AuditingActUserFormDTO implements Serializable { + private static final long serialVersionUID = 3811387419859675753L; + public interface AddUserInternalGroup {} + /** + * 活动id + */ + @NotBlank(message = "活动id不能为空", groups = { AddUserInternalGroup.class }) + private String actId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java index 6ec78b75a0..55cd75a090 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java @@ -2,10 +2,8 @@ package com.epmet.dto.form.work; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; -import org.hibernate.validator.constraints.Length; import javax.validation.Valid; -import javax.validation.constraints.Min; import javax.validation.constraints.NotBlank; import java.io.Serializable; import java.math.BigDecimal; @@ -50,8 +48,6 @@ public class DraftActInfoFormDTO implements Serializable { /** * 活动标题 */ - @NotBlank(message = "活动标题不能为空", groups = {AddDraftUserShowGroup.class}) - @Length(min=1, max=50,message = "活动标题限50字以内", groups = {AddDraftUserShowGroup.class}) private String title; /** @@ -87,13 +83,11 @@ public class DraftActInfoFormDTO implements Serializable { /** * 活动人数 */ - @Min(0) private Integer actQuota; /** * 活动积分 */ - @Min(0) private Integer reward; /** @@ -114,8 +108,6 @@ public class DraftActInfoFormDTO implements Serializable { /** * 报名条件 */ - @NotBlank(message = "报名条件不能为空", groups = {AddDraftUserShowGroup.class}) - @Length(min=1, max=50,message = "报名条件限200字以内", groups = {AddDraftUserShowGroup.class}) private String requirement; /** @@ -146,7 +138,6 @@ public class DraftActInfoFormDTO implements Serializable { /** * 签到有效范围(米) */ - @Min(0) private Integer signInRadius; /** diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingActUserResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingActUserResultDTO.java new file mode 100644 index 0000000000..c40e1310b2 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingActUserResultDTO.java @@ -0,0 +1,55 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 报名审核-待审核列表返参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 22:14 + */ +@Data +public class AuditingActUserResultDTO implements Serializable { + private static final long serialVersionUID = 5567556309702585031L; + + /** + * 活动id + */ + private String actId; + + /** + * 用户id + */ + private String userId; + + /** + * 姓名 + */ + private String realName; + + /** + * 微信昵称 + */ + private String nickName; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * 报名时间yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date signUpTime; + + /** + * true: 是志愿者 false : 不是志愿者 + */ + private Boolean volunteerFlag; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/pom.xml b/epmet-module/epmet-heart/epmet-heart-server/pom.xml index c708875ec3..e245a2cdc9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/pom.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/pom.xml @@ -70,6 +70,12 @@ 2.0.0 compile + + com.epmet + epmet-user-client + 2.0.0 + compile + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java index 165c110b9d..514a73f1e4 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java @@ -1,8 +1,18 @@ package com.epmet.controller; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.work.AuditingActUserFormDTO; +import com.epmet.dto.result.work.AuditingActUserResultDTO; +import com.epmet.service.WorkActUserService; +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.List; + /** * 工作端:活动人员相关api * @@ -12,4 +22,21 @@ import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/work/actuser") public class WorkActUserController { + + @Autowired + private WorkActUserService workActUserService; + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @author yinzuomei + * @description 报名审核-待审核列表 + * @Date 2020/7/21 22:24 + **/ + @PostMapping("auditinglist") + public Result> getAuditingList(@RequestBody AuditingActUserFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, AuditingActUserFormDTO.AddUserInternalGroup.class); + List list=workActUserService.getAuditingList(formDTO); + return new Result>().ok(list); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java index 83aeabfc61..4054f2dda7 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java @@ -18,9 +18,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.ActUserRelationDTO; import com.epmet.entity.ActUserRelationEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 用户活动关系表 * @@ -29,5 +32,22 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ActUserRelationDao extends BaseDao { - + + /** + * @return java.util.List + * @param actId 活动id + * @author yinzuomei + * @description 根据活动id,查询待审核人员关系记录 + * @Date 2020/7/21 22:41 + **/ + List selectAuditingUserList(String actId); + + /** + * @return java.util.List + * @param actId 活动id + * @author yinzuomei + * @description 根据活动id,查询待审核人员,返回用户id集合 + * @Date 2020/7/21 22:45 + **/ + List selectAuditingUserIds(String actId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java index 595e9178c0..8ec5974ac9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.HeartUserInfoDTO; import com.epmet.entity.HeartUserInfoEntity; import org.apache.ibatis.annotations.Mapper; @@ -29,5 +30,13 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface HeartUserInfoDao extends BaseDao { - + + /** + * @return com.epmet.dto.HeartUserInfoDTO + * @param userId + * @author yinzuomei + * @description 根据用户id查询爱心用户记录 + * @Date 2020/7/21 22:48 + **/ + HeartUserInfoDTO selectByUserId(String userId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/HeartUserInfoEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/HeartUserInfoEntity.java index 97c1e1da4d..c7b90074b1 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/HeartUserInfoEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/HeartUserInfoEntity.java @@ -18,13 +18,10 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; - /** * 用户信息 * @@ -51,7 +48,7 @@ public class HeartUserInfoEntity extends BaseEpmetEntity { /** * 1是志愿者,0不是志愿者(志愿者注册成功后需要来更新值) */ - private Integer volunteerFlag; + private Boolean volunteerFlag; /** * 爱心时长(单位:分钟)(参与并签到了的活动,实际结束-实际开始)签到的。未签到但是有积分的 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java index 1def3fd939..f0d0fe7d5b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java @@ -92,4 +92,22 @@ public interface ActUserRelationService extends BaseService + * @param actId + * @author yinzuomei + * @description 根据活动id,查询待审核人员关系记录 + * @Date 2020/7/21 22:40 + **/ + List getAuditingUserList(String actId); + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 根据活动id,查询待审核人员,返回用户id集合 + * @Date 2020/7/21 22:44 + **/ + List getAuditingUserIds(String actId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/HeartUserInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/HeartUserInfoService.java index 59427d9848..ba77b11ed9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/HeartUserInfoService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/HeartUserInfoService.java @@ -92,4 +92,13 @@ public interface HeartUserInfoService extends BaseService { * @date 2020-07-19 */ void delete(String[] ids); + + /** + * @return com.epmet.dto.HeartUserInfoDTO + * @param userId + * @author yinzuomei + * @description 根据用户id查询爱心用户记录 + * @Date 2020/7/21 22:48 + **/ + HeartUserInfoDTO getByUserId(String userId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java new file mode 100644 index 0000000000..a11d56794d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java @@ -0,0 +1,23 @@ +package com.epmet.service; + +import com.epmet.dto.form.work.AuditingActUserFormDTO; +import com.epmet.dto.result.work.AuditingActUserResultDTO; + +import java.util.List; + +/** + * 工作端:活动人员相关api + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 22:23 + */ +public interface WorkActUserService { + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 报名审核-待审核列表 + * @Date 2020/7/21 22:25 + **/ + List getAuditingList(AuditingActUserFormDTO formDTO); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java index 214fd7b76c..0979dc568d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java @@ -101,4 +101,28 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl + * @author yinzuomei + * @description 根据活动id,查询待审核人员关系记录 + * @Date 2020/7/21 22:40 + **/ + @Override + public List getAuditingUserList(String actId) { + return baseDao.selectAuditingUserList(actId); + } + + /** + * @param actId + * @return java.util.List + * @author yinzuomei + * @description 根据活动id,查询待审核人员,返回用户id集合 + * @Date 2020/7/21 22:44 + **/ + @Override + public List getAuditingUserIds(String actId) { + return baseDao.selectAuditingUserIds(actId); + } + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartUserInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartUserInfoServiceImpl.java index 61506b7e6f..3b7aa9f2c9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartUserInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartUserInfoServiceImpl.java @@ -101,4 +101,16 @@ public class HeartUserInfoServiceImpl extends BaseServiceImpl + * @author yinzuomei + * @description 报名审核-待审核列表 + * @Date 2020/7/21 22:25 + **/ + @Override + public List getAuditingList(AuditingActUserFormDTO formDTO) { + List list=new ArrayList<>(); + //查询出待审核的人员列表 + List actUserRelationDTOList=actUserRelationService.getAuditingUserList(formDTO.getActId()); + if(null==actUserRelationDTOList||actUserRelationDTOList.size()==0){ + logger.info(String.format("当前活动%s没有待审核的报名人员",formDTO.getActId())); + return list; + } + //查询出待审核的人员id集合 + List userIdList=actUserRelationService.getAuditingUserIds(formDTO.getActId()); + //根据待审核的人员结合,查询出用户基本信息 + List userInfoList=this.queryUserBaseInfo(userIdList); + //调用epemet_user服务获取用户的基本信息 + for(ActUserRelationDTO actUserRelationDTO:actUserRelationDTOList){ + AuditingActUserResultDTO resultDTO=new AuditingActUserResultDTO(); + resultDTO.setActId(formDTO.getActId()); + resultDTO.setUserId(actUserRelationDTO.getUserId()); + resultDTO.setSignUpTime(actUserRelationDTO.getCreatedTime()); + //微信基本信息先默认为空字符串 + resultDTO.setRealName(NumConstant.EMPTY_STR); + resultDTO.setNickName(NumConstant.EMPTY_STR); + resultDTO.setHeadImgUrl(NumConstant.EMPTY_STR); + + HeartUserInfoDTO heartUserInfoDTO=heartUserInfoService.getByUserId(actUserRelationDTO.getUserId()); + //true: 是志愿者 false : 不是志愿者 + if(null!=heartUserInfoDTO){ + resultDTO.setVolunteerFlag(heartUserInfoDTO.getVolunteerFlag()); + }else{ + resultDTO.setVolunteerFlag(false); + } + //赋值基本信息 + for(UserBaseInfoResultDTO userBaseInfoResultDTO:userInfoList){ + if(actUserRelationDTO.getUserId().equals(userBaseInfoResultDTO.getUserId())){ + resultDTO.setRealName(userBaseInfoResultDTO.getRealName()); + resultDTO.setNickName(userBaseInfoResultDTO.getNickname()); + resultDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); + break; + } + } + list.add(resultDTO); + } + return list; + } + + /** + * @return java.util.List + * @param userIdList + * @author yinzuomei + * @description 传入用户id集合,返回用户的基本信息(包含微信基本信息) + * @Date 2020/7/22 10:38 + **/ + private List queryUserBaseInfo(List userIdList) { + List userInfoList=new ArrayList<>(); + if(null==userIdList||userIdList.size()==0){ + return userInfoList; + } + Result> resultUserList =epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); + if(resultUserList.success()&&resultUserList.getData().size()>0){ + return resultUserList.getData(); + }else{ + logger.warn("查询用户基本信息接口返回失败"); + } + return userInfoList; + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml index 9c4689d6e2..7dcd874931 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml @@ -25,5 +25,29 @@ + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml index 5da94b031e..341370c3f7 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml @@ -19,5 +19,14 @@ - + + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBaseInfoDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBaseInfoDTO.java index 1ac6a85c85..1530f1f3c9 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBaseInfoDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBaseInfoDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -54,10 +55,15 @@ public class UserBaseInfoDTO implements Serializable { private String surname; /** - * 名称 + * 名 */ private String name; + /** + * 姓名 + */ + private String realName; + /** * 身份证号 */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBaseInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBaseInfoResultDTO.java new file mode 100644 index 0000000000..19ece1b40f --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBaseInfoResultDTO.java @@ -0,0 +1,80 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 用户基本信息-居民录入的基本信息 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/22 9:26 + */ +@Data +public class UserBaseInfoResultDTO implements Serializable { + private static final long serialVersionUID = 3124057264557384333L; + /** + * 用户id + */ + private String userId; + + /** + * 手机号(注册手机号) + */ + private String mobile; + + /** + * 姓氏 + */ + private String surname; + + /** + * 名 + */ + private String name; + + /** + * 姓名 + */ + private String realName; + + /** + * 身份证号 + */ + private String idNum; + + /** + * 性别(1男2女0未知) + */ + private String gender; + + /** + * 街道 + */ + private String street; + + /** + * 小区名称 + */ + private String district; + + /** + * 楼栋单元 + */ + private String buildingAddress; + + /** + * 昵称(目前来源于微信昵称,后续系统可支持用户有昵称) + */ + private String nickname; + + /** + * 头像(目前来源于微信,后续系统顾客支持上传头像) + */ + private String headImgUrl; + + /** + * 微信基本信息 + */ + private UserWechatResultDTO userWechatResultDTO; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserWechatResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserWechatResultDTO.java new file mode 100644 index 0000000000..e7a9886d41 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserWechatResultDTO.java @@ -0,0 +1,71 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 用户基本信息-微信信息 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/22 9:27 + */ +@Data +public class UserWechatResultDTO implements Serializable { + private static final long serialVersionUID = 5770079291635923923L; + + /** + * 用户ID + * */ + private String userId; + + /** + * 微信openId + */ + private String wxOpenId; + + /** + * 微信unionId + */ + private String unionId; + + /** + * 手机号 + */ + private String mobile; + + /** + * 昵称 + */ + private String nickname; + + /** + * 性别:0.未知 1.男性2女性 + */ + private Integer sex; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * 国家 + */ + private String country; + + /** + * 省份 + */ + private String province; + + /** + * 城市 + */ + private String city; + + /** + * 语言 + */ + private String language; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index c02d4ba8a1..8a4de9898e 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -139,4 +139,13 @@ public interface EpmetUserOpenFeignClient { @PostMapping("/epmetuser/staffrole/staffroles") Result> getRolesOfStaff(StaffRoleFormDTO staffRoleFormDTO); + /** + * @param userIdList + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @description 传入用户id集合,返回用户的基本信息(包含微信基本信息) + * @Date 2020/7/22 9:30 + **/ + @PostMapping("/epmetuser/userbaseinfo/queryuserbaseinfo") + Result> queryUserBaseInfo(@RequestBody List userIdList); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 8f3ef4c809..bb2cbe9d77 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -86,4 +86,16 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result> getRolesOfStaff(StaffRoleFormDTO staffRoleFormDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getRolesOfStaff", staffRoleFormDTO); } + + /** + * @param userIdList + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @description 传入用户id集合,返回用户的基本信息(包含微信基本信息) + * @Date 2020/7/22 9:30 + **/ + @Override + public Result> queryUserBaseInfo(List userIdList) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "queryUserBaseInfo", userIdList); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java index 44204aa99a..046bc0f071 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java @@ -23,9 +23,10 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.UserBaseInfoDTO; +import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.excel.UserBaseInfoExcel; import com.epmet.service.UserBaseInfoService; import org.springframework.beans.factory.annotation.Autowired; @@ -91,4 +92,29 @@ public class UserBaseInfoController { ExcelUtils.exportExcelToTarget(response, null, list, UserBaseInfoExcel.class); } + /** + * @param userIdList + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @description 传入用户id集合,返回用户的基本信息(包含微信基本信息) + * @Date 2020/7/22 9:34 + **/ + @PostMapping("queryuserbaseinfo") + public Result> queryUserBaseInfo(@RequestBody List userIdList) { + List list = userBaseInfoService.queryUserBaseInfo(userIdList); + return new Result>().ok(list); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param + * @author yinzuomei + * @description 初始化历史用户信息到user_base_info数据 + * @Date 2020/7/22 10:42 + **/ + @PostMapping("initbaseinfo") + public Result initBaseInfo(){ + userBaseInfoService.initBaseInfo(); + return new Result(); + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBaseInfoDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBaseInfoDao.java index 02397056e8..f5ca5fc3aa 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBaseInfoDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBaseInfoDao.java @@ -18,6 +18,8 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.dto.result.UserWechatResultDTO; import com.epmet.entity.UserBaseInfoEntity; import org.apache.ibatis.annotations.Mapper; @@ -29,5 +31,22 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface UserBaseInfoDao extends BaseDao { - + + /** + * @return com.epmet.dto.result.UserBaseInfoResultDTO + * @param userId + * @author yinzuomei + * @description 根据用户id查询user_base_info基本信息 + * @Date 2020/7/22 9:46 + **/ + UserBaseInfoResultDTO selectListByUserIdList(String userId); + + /** + * @return com.epmet.dto.result.UserWechatResultDTO + * @param userId + * @author yinzuomei + * @description 根据用户id获取user_wechat表微信用户基本信息 + * @Date 2020/7/22 9:46 + **/ + UserWechatResultDTO selectUserWechatByUserId(String userId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java index a47f215bdc..acb1ce5ab2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java @@ -78,4 +78,13 @@ public interface UserResiInfoDao extends BaseDao { * @date 2020/5/11 11:18 */ IssueInitiatorResultDTO selectIssueInitiator(IssueInitiatorFormDTO formDTO); + + /** + * @return com.epmet.dto.UserResiInfoDTO + * @param userId + * @author yinzuomei + * @description 根据要用户id,查询用户注册的信息 + * @Date 2020/7/22 10:58 + **/ + UserResiInfoDTO selectByUserId(String userId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java index 6d03a46a9c..fc00b799bf 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java @@ -55,4 +55,13 @@ public interface UserWechatDao extends BaseDao{ * @CreatedTime 2020/4/26 18:53 */ List selectUserHeadPhotoByUserId(List certifiedResultDTOS); + + /** + * @return com.epmet.entity.UserWechatEntity + * @param + * @author yinzuomei + * @description 查询已经授权的微信用户信息 + * @Date 2020/7/22 10:46 + **/ + List selectAll(); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserBaseInfoEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserBaseInfoEntity.java index e6e5d1dcae..882aaeb243 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserBaseInfoEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserBaseInfoEntity.java @@ -18,13 +18,10 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; - /** * 用户基础信息 * @@ -63,6 +60,11 @@ public class UserBaseInfoEntity extends BaseEpmetEntity { */ private String name; + /** + * 姓名 + */ + private String realName; + /** * 身份证号 */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java index ab1ca9d0e8..d4c13a7c1c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java @@ -20,6 +20,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.UserBaseInfoDTO; +import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.entity.UserBaseInfoEntity; import java.util.List; @@ -92,4 +93,22 @@ public interface UserBaseInfoService extends BaseService { * @date 2020-07-19 */ void delete(String[] ids); + + /** + * @return java.util.List + * @param userIdList + * @author yinzuomei + * @description 传入用户id集合,返回用户的基本信息(包含微信基本信息) + * @Date 2020/7/22 9:35 + **/ + List queryUserBaseInfo(List userIdList); + + /** + * @return void + * @param + * @author yinzuomei + * @description 初始化历史用户信息到user_base_info数据 + * @Date 2020/7/22 10:42 + **/ + void initBaseInfo(); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java index 17756b8c46..8ba70f14f3 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java @@ -20,11 +20,17 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.UserBaseInfoDao; +import com.epmet.dao.UserResiInfoDao; +import com.epmet.dao.UserWechatDao; import com.epmet.dto.UserBaseInfoDTO; +import com.epmet.dto.UserResiInfoDTO; +import com.epmet.dto.UserWechatDTO; +import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.dto.result.UserWechatResultDTO; import com.epmet.entity.UserBaseInfoEntity; import com.epmet.redis.UserBaseInfoRedis; import com.epmet.service.UserBaseInfoService; @@ -33,6 +39,7 @@ 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; @@ -48,6 +55,10 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl page(Map params) { @@ -101,4 +112,60 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl + * @author yinzuomei + * @description 传入用户id集合,返回用户的基本信息(包含微信基本信息) + * @Date 2020/7/22 9:35 + **/ + @Override + public List queryUserBaseInfo(List userIdList) { + if(null==userIdList||userIdList.size()<1){ + return new ArrayList<>(); + } + List userBaseInfoList=new ArrayList<>(); + for(String userId:userIdList){ + UserBaseInfoResultDTO userBaseInfoResultDTO=baseDao.selectListByUserIdList(userId); + if(null!=userBaseInfoResultDTO){ + UserWechatResultDTO userWechatResultDTO=baseDao.selectUserWechatByUserId(userId); + userBaseInfoResultDTO.setUserWechatResultDTO(userWechatResultDTO); + userBaseInfoList.add(userBaseInfoResultDTO); + } + } + return userBaseInfoList; + } + + /** + * @return void + * @author yinzuomei + * @description 初始化历史用户信息到user_base_info数据 + * @Date 2020/7/22 10:42 + **/ + @Override + public void initBaseInfo() { + List userWechatDTOList=userWechatDao.selectAll(); + for(UserWechatDTO userWechatDTO:userWechatDTOList){ + UserResiInfoDTO userResiInfoDTO=userResiInfoDao.selectByUserId(userWechatDTO.getUserId()); + UserBaseInfoEntity userBaseInfoEntity=new UserBaseInfoEntity(); + + userBaseInfoEntity.setUserId(userResiInfoDTO.getUserId()); + userBaseInfoEntity.setMobile(userResiInfoDTO.getRegMobile()); + userBaseInfoEntity.setSurname(userResiInfoDTO.getSurname()); + userBaseInfoEntity.setName(userResiInfoDTO.getName()); + userBaseInfoEntity.setRealName(userResiInfoDTO.getSurname()+userResiInfoDTO.getName()); + //查询党员信息 +// userBaseInfoEntity.setIdNum(); + userBaseInfoEntity.setGender(userWechatDTO.getSex().toString()); + userBaseInfoEntity.setStreet(userResiInfoDTO.getStreet()); + userBaseInfoEntity.setDistrict(userResiInfoDTO.getDistrict()); + userBaseInfoEntity.setBuildingAddress(userResiInfoDTO.getBuildingAddress()); + userBaseInfoEntity.setNickname(userWechatDTO.getNickname()); + userBaseInfoEntity.setHeadImgUrl(userWechatDTO.getHeadImgUrl()); + baseDao.insert(userBaseInfoEntity); + } + return; + } + + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml index 87f3520461..3733452b77 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml @@ -24,5 +24,46 @@ + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml index a95fc89291..724d49a68b 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml @@ -153,4 +153,15 @@ AND uri.del_flag = 0 AND uw.del_flag = 0 + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml index 48786dc58a..6ed041a555 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml @@ -79,4 +79,14 @@ AND del_flag = 0 + + From bb39494f93608314c3a91c577eb39f5eb71eaf05 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 22 Jul 2020 12:07:38 +0800 Subject: [PATCH 28/98] =?UTF-8?q?resi-mine=E6=B7=BB=E5=8A=A0=E8=8E=B7?= =?UTF-8?q?=E5=8F=9612=E4=BD=8D=E7=94=A8=E6=88=B7=E6=A0=87=E8=AF=86?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/redis/RedisKeys.java | 9 ++ .../epmet/commons/tools/redis/RedisUtils.java | 11 +- .../epmet/commons/tools/utils/Md5Util.java | 149 ++++++++++++++++++ .../OperCustomizeOpenFeignClientFallback.java | 7 + .../CustomerFunctionController.java | 11 ++ .../service/CustomerFunctionService.java | 8 + .../impl/CustomerFunctionServiceImpl.java | 7 + .../dto/from/GenerateShortUserIdFormDTO.java | 25 +++ .../dto/result/ShortUserIdInfoResultDTO.java | 27 ++++ .../eums/GenerateShortUserIdBizTypeEnum.java | 41 +++++ .../mine/controller/MineController.java | 78 +++++++-- 11 files changed, 356 insertions(+), 17 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Md5Util.java create mode 100644 epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/GenerateShortUserIdFormDTO.java create mode 100644 epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/ShortUserIdInfoResultDTO.java create mode 100644 epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/eums/GenerateShortUserIdBizTypeEnum.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index dcf93d3a24..0dadd18200 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -254,4 +254,13 @@ public class RedisKeys { return rootPrefix.concat("tags:grid:relationTag:").concat(gridId).concat(StrConstant.COLON).concat(tagId); } + /** + * 获取生成的用户标识 缓存Key + * @param shortUserId + * @return + */ + public static String getShortUserIdKey(String shortUserId) { + return rootPrefix.concat("oper:user:shorId:").concat(shortUserId); + } + } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java index f7f985ed63..2f08f03683 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java @@ -10,8 +10,6 @@ package com.epmet.commons.tools.redis; import com.epmet.commons.tools.constant.NumConstant; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.dao.DataAccessException; -import org.springframework.data.redis.connection.RedisConnection; import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; import org.springframework.data.redis.core.*; import org.springframework.data.redis.support.atomic.RedisAtomicLong; @@ -316,4 +314,13 @@ public class RedisUtils { return redisTemplate.opsForZSet().incrementScore(key, value, delta); } + /** + * @Description 判断key是否存在 + * @param key + * @return + */ + public Boolean hasKey(String key) { + return redisTemplate.hasKey(key); + } + } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Md5Util.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Md5Util.java new file mode 100644 index 0000000000..1da80ff672 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Md5Util.java @@ -0,0 +1,149 @@ +package com.epmet.commons.tools.utils; + +import lombok.extern.slf4j.Slf4j; + +import java.io.UnsupportedEncodingException; +import java.security.MessageDigest; + +@Slf4j +public class Md5Util { + /** + * 加密盐 值 + */ + public static final String SALT = "EPMET_UMD_SALT"; + + public static String md5(String string) { + if (string == null || string.trim().length() == 0) { + return null; + } + try { + return getMD5(string.getBytes("GBK")); + } catch (UnsupportedEncodingException e) { + log.error( "md5 is error,msg={0}", e); + return null; + } + } + + private static final char hexDigits[] = { // 用来将字节转换成 16 进制表示的字符 + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; + + private static String getMD5(byte[] source) { + String s = null; + try { + MessageDigest md = MessageDigest.getInstance("MD5"); + md.update(source); + byte tmp[] = md.digest(); // MD5 的计算结果是一个 128 位的长整数, + // 用字节表示就是 16 个字节 + char str[] = new char[16 * 2]; // 每个字节用 16 进制表示的话,使用两个字符, + // 所以表示成 16 进制需要 32 个字符 + int k = 0; // 表示转换结果中对应的字符位置 + for (int i = 0; i < 16; i++) { // 从第一个字节开始,对 MD5 的每一个字节 + // 转换成 16 进制字符的转换 + byte byte0 = tmp[i]; // 取第 i 个字节 + str[k++] = hexDigits[byte0 >>> 4 & 0xf]; // 取字节中高 4 位的数字转换, + // >>> 为逻辑右移,将符号位一起右移 + str[k++] = hexDigits[byte0 & 0xf]; // 取字节中低 4 位的数字转换 + } + s = new String(str); // 换后的结果转换为字符串 + + } catch (Exception e) { + log.error("getMD5 is error,msg={0}", e); + } + return s; + } + + private static String byteArrayToHexString(byte b[]) { + StringBuffer resultSb = new StringBuffer(); + for (int i = 0; i < b.length; i++) + resultSb.append(byteToHexString(b[i])); + + return resultSb.toString(); + } + + private static String byteToHexString(byte b) { + int n = b; + if (n < 0) + n += 256; + int d1 = n / 16; + int d2 = n % 16; + return hexDigits[d1] + "" + hexDigits[d2]; + } + + public static String MD5Encode(String origin, String charsetname) { + String resultString = null; + try { + resultString = new String(origin); + MessageDigest md = MessageDigest.getInstance("MD5"); + if (charsetname == null || "".equals(charsetname)) + resultString = byteArrayToHexString(md.digest(resultString + .getBytes())); + else + resultString = byteArrayToHexString(md.digest(resultString + .getBytes(charsetname))); + } catch (Exception e) { + log.error("MD5Encode is error,msg={0}", e); + } + return resultString; + } + + + public static void main(String[] args) { + for (int i = 0; i < 5; i++) { + String uuid = "03a1dcd8cb1811eabac1c03fd56f7847"; + System.out.println(get12Char(uuid)); + } + } + + /** + * 获取短字符 + * + * @param str + * @return 大写 + */ + public static String get12Char(String str) { + String arr[] = ShortText(str); + String rst = (arr[0] + arr[1]).toUpperCase(); + return rst.substring(0, 4) + rst.substring(4, 8) + rst.substring(8, 12); + } + + private static String[] ShortText(String string) { + String[] chars = new String[]{ // 要使用生成URL的字符 + "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", + "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", + "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", + "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", + "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}; + + String hex = ""; + + MessageDigest md = null; + try { + md = MessageDigest.getInstance("MD5"); + hex = byteArrayToHexString(md.digest(SALT.concat(string) + .getBytes("utf-8"))); + } catch (Exception e) { + e.printStackTrace(); + } + + int hexLen = hex.length(); + int subHexLen = hexLen / 8; + String[] ShortStr = new String[4]; + + for (int i = 0; i < subHexLen; i++) { + String outChars = ""; + int j = i + 1; + String subHex = hex.substring(i * 8, j * 8); + long idx = Long.valueOf("3FFFFFFF", 16) & Long.valueOf(subHex, 16); + + for (int k = 0; k < 6; k++) { + int index = (int) (Long.valueOf("0000003D", 16) & idx); + outChars += chars[index]; + idx = idx >> 5; + } + ShortStr[i] = outChars; + } + + return ShortStr; + } + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java index 7b912afc73..5c2271f1b3 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java @@ -11,4 +11,11 @@ import org.springframework.stereotype.Component; */ @Component public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFeignClient { + /** + * 从缓存中查询已登录用户的基本信息以及角色等相关信息 + * + * @return + */ + //@PostMapping(value = "/epmetuser/user/loginuserdetails", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + //Result getLoginUserDetails(@RequestBody LoginUserDetailsFormDTO dto); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionController.java index 5af31e8e0b..7c2bbda050 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionController.java @@ -34,6 +34,7 @@ import com.epmet.dto.CustomerFunctionDTO; import com.epmet.dto.form.CustomerFunctionListFormDTO; import com.epmet.dto.form.SaveCustomerFunctionFormDTO; import com.epmet.dto.result.CustomerFunctionListResultDTO; +import com.epmet.dto.result.DefaultFunctionListResultDTO; import com.epmet.excel.CustomerFunctionExcel; import com.epmet.service.CustomerFunctionService; import org.springframework.beans.factory.annotation.Autowired; @@ -126,4 +127,14 @@ public class CustomerFunctionController { customerFunctionService.saveCustomerFunction(formDTO); return new Result(); } + + /** + * desc:获取客户已开通功能列表 + * @param formDTO + * @return + */ + @PostMapping("customeropenedfunction") + public Result> customerOpenedFunction(@RequestBody CustomerFunctionListFormDTO formDTO) { + return new Result>().ok(customerFunctionService.customerOpenedFunction(formDTO)); + } } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionService.java index 91c1e3eb1b..17fcb2be66 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionService.java @@ -23,6 +23,7 @@ import com.epmet.dto.CustomerFunctionDTO; import com.epmet.dto.form.CustomerFunctionListFormDTO; import com.epmet.dto.form.SaveCustomerFunctionFormDTO; import com.epmet.dto.result.CustomerFunctionListResultDTO; +import com.epmet.dto.result.DefaultFunctionListResultDTO; import com.epmet.entity.CustomerFunctionEntity; import java.util.List; @@ -111,4 +112,11 @@ public interface CustomerFunctionService extends BaseService customerOpenedFunction(CustomerFunctionListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionServiceImpl.java index deae7d7406..d4f949ef52 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionServiceImpl.java @@ -24,6 +24,7 @@ import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerFunctionConstant; @@ -207,7 +208,13 @@ public class CustomerFunctionServiceImpl extends BaseServiceImpl customerOpenedFunction(CustomerFunctionListFormDTO formDTO) { + return null; + } + } \ No newline at end of file diff --git a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/GenerateShortUserIdFormDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/GenerateShortUserIdFormDTO.java new file mode 100644 index 0000000000..64fce64ec1 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/GenerateShortUserIdFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.resi.mine.dto.from; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName MyResiUserInfoFormDTO + * @Auth wangc + * @Date 2020-05-22 17:27 + */ +@Data +public class GenerateShortUserIdFormDTO implements Serializable { + + /** + * 过期时间 单位秒 + */ + private Integer expires; + + /** + * 场景类型 + */ + private String bizType; +} diff --git a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/ShortUserIdInfoResultDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/ShortUserIdInfoResultDTO.java new file mode 100644 index 0000000000..19f2a9235e --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/ShortUserIdInfoResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.resi.mine.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * desc: 生成用户短用户标识 result + * + * @date: 2020/7/22 10:50 + * @author: jianjun liu + */ +@Data +public class ShortUserIdInfoResultDTO implements Serializable { + + /** + * 12位用户标识 + */ + private String shortUserId; + /** + * 过期时间 + */ + private Date expiresTime; + + +} diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/eums/GenerateShortUserIdBizTypeEnum.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/eums/GenerateShortUserIdBizTypeEnum.java new file mode 100644 index 0000000000..170a11230c --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/eums/GenerateShortUserIdBizTypeEnum.java @@ -0,0 +1,41 @@ +package com.epmet.eums; + +/** + * 生成用户唯一标识 枚举类 + * dev|test|prod + * + * @author jianjun liu + * @date 2020-07-03 11:14 + **/ +public enum GenerateShortUserIdBizTypeEnum { + POINT_EXCHANGE("pointExchange", "积分兑换") + ; + + private String code; + private String desc; + + + + GenerateShortUserIdBizTypeEnum(String code, String name) { + this.code = code; + this.desc = name; + } + + public static GenerateShortUserIdBizTypeEnum getEnum(String code) { + GenerateShortUserIdBizTypeEnum[] values = GenerateShortUserIdBizTypeEnum.values(); + for (GenerateShortUserIdBizTypeEnum value : values) { + if (code != null && value.getCode().equals(code)) { + return value; + } + } + return null; + } + + public String getCode() { + return code; + } + + public String getDesc() { + return desc; + } +} diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/controller/MineController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/controller/MineController.java index 174126f074..dccec06857 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/controller/MineController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/controller/MineController.java @@ -1,43 +1,91 @@ package com.epmet.modules.mine.controller; +import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Md5Util; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.eums.GenerateShortUserIdBizTypeEnum; import com.epmet.modules.feign.EpmetUserFeignClient; +import com.epmet.resi.mine.dto.from.GenerateShortUserIdFormDTO; import com.epmet.resi.mine.dto.from.MyResiUserInfoFormDTO; import com.epmet.resi.mine.dto.result.MyResiUserInfoResultDTO; +import com.epmet.resi.mine.dto.result.ShortUserIdInfoResultDTO; +import lombok.extern.slf4j.Slf4j; 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.Date; + /** * @Description * @ClassName MineController * @Auth wangc * @Date 2020-05-22 18:33 */ +@Slf4j @RestController @RequestMapping("mine") public class MineController { - @Autowired - EpmetUserFeignClient epmetUserFeignClient; + @Autowired + private EpmetUserFeignClient epmetUserFeignClient; + @Autowired + private RedisUtils redisUtils; + + /** + * @param myResiUserInfoFormDTO + * @return MyResiUserInfoResultDTO + * @Description 居民端获取我的信息 + * @author wangc + * @date 2020.05.22 18:37 + **/ + @PostMapping("profile") + Result getMyResiInfo(@LoginUser TokenDto tokenDto, @RequestBody MyResiUserInfoFormDTO myResiUserInfoFormDTO) { + myResiUserInfoFormDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(myResiUserInfoFormDTO); + return epmetUserFeignClient.resiMyselfMsg(myResiUserInfoFormDTO); + } - /** - * @Description 居民端获取我的信息 - * @param myResiUserInfoFormDTO - * @return MyResiUserInfoResultDTO - * @author wangc - * @date 2020.05.22 18:37 - **/ - @PostMapping("profile") - Result getMyResiInfo(@LoginUser TokenDto tokenDto, @RequestBody MyResiUserInfoFormDTO myResiUserInfoFormDTO){ - myResiUserInfoFormDTO.setUserId(tokenDto.getUserId()); - ValidatorUtils.validateEntity(myResiUserInfoFormDTO); - return epmetUserFeignClient.resiMyselfMsg(myResiUserInfoFormDTO); - } + /** + * desc:生成用户12位唯一标识 默认10分钟过期 + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("generateshortuserid") + Result generateShortUserId(TokenDto tokenDto, @RequestBody GenerateShortUserIdFormDTO formDTO) { + String userId = tokenDto.getUserId(); + GenerateShortUserIdBizTypeEnum bizTypeEnum = GenerateShortUserIdBizTypeEnum.getEnum(formDTO.getBizType()); + if (bizTypeEnum == null) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + String shortUserId = Md5Util.get12Char(bizTypeEnum.getCode().concat(userId)); + String redisKey = RedisKeys.getShortUserIdKey(shortUserId); + //过期时间 单位:秒 + int expires = formDTO.getExpires() == null ? NumConstant.TEN * NumConstant.SIXTY : formDTO.getExpires(); + if (redisUtils.hasKey(shortUserId)) { + redisUtils.expire(redisKey, expires); + } else { + redisUtils.setString(redisKey, userId, expires); + } + Date expiresDate = DateUtils.addDateSeconds(new Date(), expires); + ShortUserIdInfoResultDTO result = new ShortUserIdInfoResultDTO(); + result.setShortUserId(shortUserId); + result.setExpiresTime(expiresDate); + log.info("generateShortUserId success,result:{}", JSON.toJSONString(result)); + return new Result().ok(result); + } } From 93ed34996635abe946f04dcc1c67ea77b7bd17bd Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 22 Jul 2020 12:43:21 +0800 Subject: [PATCH 29/98] =?UTF-8?q?heart-work:=E5=8F=91=E5=B8=83=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8=E3=80=81=E4=BF=9D=E5=AD=98=E6=B4=BB=E5=8A=A8=E8=8D=89?= =?UTF-8?q?=E7=A8=BF=E6=8E=A5=E5=8F=A3=E6=9A=82=E5=AD=981?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feign/ResiPartyMemberOpenFeignClient.java | 11 +++++++++ ...esiPartyMemberOpenFeignClientFallback.java | 15 ++++++++++++ .../controller/PartymemberInfoController.java | 12 ++++++++++ .../partymember/dao/PartymemberInfoDao.java | 8 +++++++ .../service/PartymemberInfoService.java | 11 +++++++-- .../impl/PartymemberInfoServiceImpl.java | 22 ++++++++++++++++++ .../mapper/partymember/PartymemberInfoDao.xml | 13 +++++++++++ .../service/impl/UserBaseInfoServiceImpl.java | 23 ++++++++++++++++++- 8 files changed, 112 insertions(+), 3 deletions(-) diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java index 5785bf4489..bd54ec1604 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java @@ -3,6 +3,7 @@ package com.epmet.resi.partymember.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO; +import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; import com.epmet.resi.partymember.dto.partymember.form.DelPartyMemberBaseInfoFormDTO; import com.epmet.resi.partymember.dto.partymember.form.PartyMemberBaseInfoAddFormDTO; import com.epmet.resi.partymember.dto.partymember.result.PartyMemberBaseInfoDetailResultDTO; @@ -73,4 +74,14 @@ public interface ResiPartyMemberOpenFeignClient { **/ @PostMapping(value = "/resi/partymember/partymemberbaseinfo/delete", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result deltePartyMemberBaseInfo(@RequestBody DelPartyMemberBaseInfoFormDTO formDTO); + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param userIdList + * @author yinzuomei + * @description 根据用户id查询认证通过的党员信息 + * @Date 2020/7/22 12:14 + **/ + @PostMapping(value = "/resi/partymember/partymemberinfo/queryPartymemberInfoByUserId", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result> queryPartymemberInfoByUserId(@RequestBody List userIdList); } diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java index 058af67dfa..df60a30abc 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java @@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO; +import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; import com.epmet.resi.partymember.dto.partymember.form.DelPartyMemberBaseInfoFormDTO; import com.epmet.resi.partymember.dto.partymember.form.PartyMemberBaseInfoAddFormDTO; import com.epmet.resi.partymember.dto.partymember.result.PartyMemberBaseInfoDetailResultDTO; @@ -46,4 +47,18 @@ public class ResiPartyMemberOpenFeignClientFallback implements ResiPartyMemberOp public Result deltePartyMemberBaseInfo(DelPartyMemberBaseInfoFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "deltePartyMemberBaseInfo", formDTO); } + + /** + * @param userIdList + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @description 根据用户id查询认证通过的党员信息 + * @Date 2020/7/22 12:14 + **/ + @Override + public Result> queryPartymemberInfoByUserId(List userIdList) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "queryPartymemberInfoByUserId", userIdList); + } + + } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java index ab98cf565a..89b9d7c135 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java @@ -132,4 +132,16 @@ public class PartymemberInfoController { return new Result>().ok(list); } + /** + * @return com.epmet.commons.tools.utils.Result + * @param userIdList + * @author yinzuomei + * @description 根据用户id查询认证通过的党员信息 + * @Date 2020/7/22 12:18 + **/ + @PostMapping(value = "queryPartymemberInfoByUserId") + Result> queryPartymemberInfoByUserId(@RequestBody List userIdList) { + List list = partymemberInfoService.queryPartymemberInfoByUserId(userIdList); + return new Result>().ok(list); + } } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberInfoDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberInfoDao.java index a66092f216..53854d8253 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberInfoDao.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberInfoDao.java @@ -67,4 +67,12 @@ public interface PartymemberInfoDao extends BaseDao { */ CertifiedDetailResultDTO certifiedDetail(CertifiedDetailFormDTO formDTO); + /** + * @return com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO + * @param userId + * @author yinzuomei + * @description 根据用户id查询认证通过的党员信息,此sql用来初始化user_base_info用 + * @Date 2020/7/22 12:19 + **/ + PartymemberInfoDTO queryPartymemberInfoByUserId(String userId); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java index 0fe2142c08..b8b0b39694 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java @@ -19,7 +19,6 @@ package com.epmet.modules.partymember.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.utils.Result; import com.epmet.dto.result.CertifiedResultDTO; import com.epmet.modules.partymember.entity.PartymemberInfoEntity; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; @@ -27,7 +26,6 @@ import com.epmet.resi.partymember.dto.partymember.form.CertifiedDetailFormDTO; import com.epmet.resi.partymember.dto.partymember.form.CertifiedFormDTO; import com.epmet.resi.partymember.dto.partymember.result.CertifiedDetailResultDTO; import com.epmet.resi.partymember.dto.partymember.result.PartyAuthProcessingCountResultDTO; -import org.springframework.web.bind.annotation.RequestBody; import java.util.List; import java.util.Map; @@ -146,4 +144,13 @@ public interface PartymemberInfoService extends BaseService queryPartyMemberProcessingCount(List gridIdList); + + /** + * @return com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO + * @param userIdList + * @author yinzuomei + * @description 根据用户id查询认证通过的党员信息 + * @Date 2020/7/22 12:18 + **/ + List queryPartymemberInfoByUserId(List userIdList); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java index 4803ebef14..0aea73c30b 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java @@ -219,5 +219,27 @@ public class PartymemberInfoServiceImpl extends BaseServiceImpl queryPartymemberInfoByUserId(List userIdList) { + if(null==userIdList||userIdList.size()<1){ + return new ArrayList<>(); + } + List list=new ArrayList<>(); + for(String userId:userIdList){ + PartymemberInfoDTO partymemberInfoDTO=baseDao.queryPartymemberInfoByUserId(userId); + if(null!=partymemberInfoDTO){ + list.add(partymemberInfoDTO); + } + } + return list; + } + } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml index 61b7a60c9e..35447099f8 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml @@ -103,4 +103,17 @@ AND pi.confirm_result IN ( 'auto_confirm_success', 'approved' ) + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java index 8ba70f14f3..ea1abcfa50 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java @@ -21,8 +21,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.dao.UserBaseInfoDao; import com.epmet.dao.UserResiInfoDao; import com.epmet.dao.UserWechatDao; @@ -33,6 +35,8 @@ import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.dto.result.UserWechatResultDTO; import com.epmet.entity.UserBaseInfoEntity; import com.epmet.redis.UserBaseInfoRedis; +import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; +import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient; import com.epmet.service.UserBaseInfoService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -59,6 +63,8 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl page(Map params) { @@ -145,6 +151,15 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl userWechatDTOList=userWechatDao.selectAll(); + List userIdList=new ArrayList<>(); + for(UserWechatDTO userWechatDTO:userWechatDTOList){ + userIdList.add(userWechatDTO.getUserId()); + } + Result> partymemberInfoDTOResult=resiPartyMemberOpenFeignClient.queryPartymemberInfoByUserId(userIdList); + List list=new ArrayList<>(); + if(partymemberInfoDTOResult.success()&&null!=partymemberInfoDTOResult.getData()&&partymemberInfoDTOResult.getData().size()>0){ + list=partymemberInfoDTOResult.getData(); + } for(UserWechatDTO userWechatDTO:userWechatDTOList){ UserResiInfoDTO userResiInfoDTO=userResiInfoDao.selectByUserId(userWechatDTO.getUserId()); UserBaseInfoEntity userBaseInfoEntity=new UserBaseInfoEntity(); @@ -154,8 +169,14 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl Date: Wed, 22 Jul 2020 12:56:43 +0800 Subject: [PATCH 30/98] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/CustomerFunctionServiceImpl.java | 1 - 1 file changed, 1 deletion(-) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionServiceImpl.java index d4f949ef52..f2b3256b9e 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionServiceImpl.java @@ -208,7 +208,6 @@ public class CustomerFunctionServiceImpl extends BaseServiceImpl Date: Wed, 22 Jul 2020 13:31:05 +0800 Subject: [PATCH 31/98] =?UTF-8?q?gateway=E6=8E=92=E9=99=A4mqConfig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-gateway/src/main/java/com/epmet/GatewayApplication.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-gateway/src/main/java/com/epmet/GatewayApplication.java b/epmet-gateway/src/main/java/com/epmet/GatewayApplication.java index 5c8d111813..45db4f1a24 100644 --- a/epmet-gateway/src/main/java/com/epmet/GatewayApplication.java +++ b/epmet-gateway/src/main/java/com/epmet/GatewayApplication.java @@ -9,6 +9,7 @@ package com.epmet; import com.epmet.commons.tools.aspect.ServletExceptionHandler; +import com.epmet.commons.tools.config.MqConfig; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; @@ -25,7 +26,7 @@ import org.springframework.context.annotation.FilterType; @SpringBootApplication() @EnableDiscoveryClient @EnableFeignClients -@ComponentScan(basePackages = {"com.epmet.*"}, excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {ServletExceptionHandler.class})) +@ComponentScan(basePackages = {"com.epmet.*"}, excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {ServletExceptionHandler.class, MqConfig.class})) public class GatewayApplication { public static void main(String[] args) { From d7422095428e72286ceee969ed94298f32e9888d Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 22 Jul 2020 14:12:57 +0800 Subject: [PATCH 32/98] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E9=85=8D=E7=BD=AE=E4=B8=8D=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E6=97=B6=E5=BF=BD=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/config/ApplicationConfig.java | 21 +++++++++++++++++++ .../epmet/commons/tools/config/MqConfig.java | 3 --- .../java/com/epmet/GatewayApplication.java | 3 +-- .../impl/CustomerFunctionServiceImpl.java | 1 - 4 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/ApplicationConfig.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/ApplicationConfig.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/ApplicationConfig.java new file mode 100644 index 0000000000..a16de46621 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/ApplicationConfig.java @@ -0,0 +1,21 @@ +package com.epmet.commons.tools.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; + +/** + * desc:应用配置 + * @author lyn + * @date 2020/7/22 14:08 + */ +@Configuration +public class ApplicationConfig { + // 设置@Value注解取值不到忽略(不报错) + @Bean + public static PropertySourcesPlaceholderConfigurer placeholderConfigurer() { + PropertySourcesPlaceholderConfigurer c = new PropertySourcesPlaceholderConfigurer(); + c.setIgnoreUnresolvablePlaceholders(true); + return c; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/MqConfig.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/MqConfig.java index 297c305a39..4d9acf91fa 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/MqConfig.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/MqConfig.java @@ -8,9 +8,7 @@ package com.epmet.commons.tools.config; -import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; @@ -27,7 +25,6 @@ public class MqConfig { private String appId; @Value("${elink.mq.token}") private String token; - @JsonIgnore @Value("${elink.mq.host}") private String host; } diff --git a/epmet-gateway/src/main/java/com/epmet/GatewayApplication.java b/epmet-gateway/src/main/java/com/epmet/GatewayApplication.java index 45db4f1a24..5c8d111813 100644 --- a/epmet-gateway/src/main/java/com/epmet/GatewayApplication.java +++ b/epmet-gateway/src/main/java/com/epmet/GatewayApplication.java @@ -9,7 +9,6 @@ package com.epmet; import com.epmet.commons.tools.aspect.ServletExceptionHandler; -import com.epmet.commons.tools.config.MqConfig; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; @@ -26,7 +25,7 @@ import org.springframework.context.annotation.FilterType; @SpringBootApplication() @EnableDiscoveryClient @EnableFeignClients -@ComponentScan(basePackages = {"com.epmet.*"}, excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {ServletExceptionHandler.class, MqConfig.class})) +@ComponentScan(basePackages = {"com.epmet.*"}, excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {ServletExceptionHandler.class})) public class GatewayApplication { public static void main(String[] args) { diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionServiceImpl.java index f2b3256b9e..7c68f32ec1 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionServiceImpl.java @@ -24,7 +24,6 @@ import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerFunctionConstant; From f0bb1e886f6653700b574a16b40e43fc2bb38239 Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 22 Jul 2020 15:49:08 +0800 Subject: [PATCH 33/98] =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=AB=AF=E7=A7=AF?= =?UTF-8?q?=E5=88=86=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/UserPointStatisticalDailyDTO.java | 5 +++ .../dto/form/ResiCommonUserIdFormDTO.java | 23 ++++++++++ .../epmet/dto/form/ResiPointRankFormDTO.java | 33 +++++++++++++++ .../dto/result/ResiPointDetailResultDTO.java | 27 ++++++++++++ .../dto/result/ResiPointLogListResultDTO.java | 26 ++++++++++++ .../result/ResiPointLogPeriodResultDTO.java | 42 +++++++++++++++++++ .../result/ResiPointRankListResultDTO.java | 37 ++++++++++++++++ .../dto/result/ResiPointRankResultDTO.java | 27 ++++++++++++ .../dto/result/ResiPointRankingResultDTO.java | 23 ++++++++++ .../epmet-point/epmet-point-server/pom.xml | 2 +- .../epmet/dao/PointVerificationLogDao.java | 15 ++++++- .../com/epmet/dao/UserPointActionLogDao.java | 15 ++++++- .../dao/UserPointStatisticalDailyDao.java | 17 +++++++- .../java/com/epmet/dao/UserPointTotalDao.java | 25 ++++++++++- .../UserPointStatisticalDailyEntity.java | 5 +++ .../service/PointVerificationLogService.java | 11 +++++ .../service/UserPointActionLogService.java | 12 ++++++ .../UserPointStatisticalDailyService.java | 11 +++++ .../impl/PointVerificationLogServiceImpl.java | 34 +++++++++++++++ .../impl/UserPointActionLogServiceImpl.java | 38 +++++++++++++++-- .../UserPointStatisticalDailyServiceImpl.java | 20 +++++++++ .../java/com/epmet/utils/ModuleConstant.java | 29 +++++++++++++ .../mapper/PointVerificationLogDao.xml | 18 +++++++- .../mapper/UserPointActionLogDao.xml | 17 ++++++++ .../mapper/UserPointStatisticalDailyDao.xml | 36 +++++++++++++++- .../resources/mapper/UserPointTotalDao.xml | 25 +++++++++++ 26 files changed, 563 insertions(+), 10 deletions(-) create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/ResiCommonUserIdFormDTO.java create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/ResiPointRankFormDTO.java create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointDetailResultDTO.java create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointLogListResultDTO.java create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointLogPeriodResultDTO.java create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankListResultDTO.java create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankResultDTO.java create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankingResultDTO.java diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/UserPointStatisticalDailyDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/UserPointStatisticalDailyDTO.java index 51291b89ef..3cc6a6008f 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/UserPointStatisticalDailyDTO.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/UserPointStatisticalDailyDTO.java @@ -38,6 +38,11 @@ public class UserPointStatisticalDailyDTO implements Serializable { */ private String id; + /** + * 用户Id + * */ + private String userId; + /** * 日 yyyy-MM-dd */ diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/ResiCommonUserIdFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/ResiCommonUserIdFormDTO.java new file mode 100644 index 0000000000..af247b84f0 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/ResiCommonUserIdFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description + * @ClassName ResiCommonUserIdFormDTO + * @Auth wangc + * @Date 2020-07-22 14:07 + */ +@Data +public class ResiCommonUserIdFormDTO implements Serializable { + private static final long serialVersionUID = -1961545266124776452L; + + public interface UserId extends CustomerClientShowGroup{} + + @NotBlank(message = "获取不到用户Id",groups = UserId.class) + private String userId; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/ResiPointRankFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/ResiPointRankFormDTO.java new file mode 100644 index 0000000000..e78baf6178 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/ResiPointRankFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + +/** + * @Description 查询用户积分总排行、周排行、月排行参数 + * @ClassName ResiPointRankParam + * @Auth wangc + * @Date 2020-07-21 16:22 + */ +@Data +public class ResiPointRankFormDTO implements Serializable { + private static final long serialVersionUID = 1534061512200591149L; + + /** + * 页码 + * */ + @Min(1) + private Integer pageNo; + + /** + * 每页数据条数 + * */ + private Integer pageSize; + + /** + * 时间维度 week month + * */ + private String timeDimension; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointDetailResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointDetailResultDTO.java new file mode 100644 index 0000000000..556b8471e1 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointDetailResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 居民端用户查询累计积分、可用积分 + * @ClassName ResiPointDetailResultDTO + * @Auth wangc + * @Date 2020-07-21 11:06 + */ +@Data +public class ResiPointDetailResultDTO implements Serializable { + private static final long serialVersionUID = -4909273528724428776L; + + /** + * 累计积分 + * */ + private Integer accumulatedPoint; + + /** + * 可用积分 + * */ + private Integer usablePoint; + +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointLogListResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointLogListResultDTO.java new file mode 100644 index 0000000000..46deb286e9 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointLogListResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 用户积分记录列表返参DTO + * @ClassName ResiPointLogListResultDTO + * @Auth wangc + * @Date 2020-07-22 14:03 + */ +@Data +public class ResiPointLogListResultDTO implements Serializable { + private static final long serialVersionUID = 5316430104874305245L; + /** + * 日期 yyyy-MM-dd 字符串 + * */ + private String date; + + /** + * 当日积分记录列表 + * */ + private List dailyList; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointLogPeriodResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointLogPeriodResultDTO.java new file mode 100644 index 0000000000..a701328659 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointLogPeriodResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 用户积分记录时段DTO + * @ClassName ResiPointLogPeriodResultDTO + * @Auth wangc + * @Date 2020-07-22 10:54 + */ +@Data +public class ResiPointLogPeriodResultDTO implements Serializable { + private static final long serialVersionUID = -7686828993714392843L; + + /** + * 日期 yyyy-MM-dd + * */ + private String date; + + /** + * 时段 HH:mm + * */ + private String time; + + /** + * +100 -25 + * */ + private String point; + + /** + * 标题 + * */ + private String title; + + /** + * 备注内容 + * */ + private String remark; + +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankListResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankListResultDTO.java new file mode 100644 index 0000000000..0bcf0a4758 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankListResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 居民端积分总排行、周排行、月排行接口返参DTO + * @ClassName ResiPointRankListResultDTO + * @Auth wangc + * @Date 2020-07-21 16:48 + */ +@Data +public class ResiPointRankListResultDTO implements Serializable { + private static final long serialVersionUID = 685408245193506541L; + + /** + * 当前用户昵称 + * */ + private String myNickname; + + /** + * 当前用户积分 + * */ + private Integer myPoint; + + /** + * 当前用户排名 + * */ + private Integer myRanking; + + /** + * 积分排名列表 + * */ + private List rankList; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankResultDTO.java new file mode 100644 index 0000000000..54f72cd275 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + + +/** + * @Description 用户积分排名DTO + * @ClassName ResiPointRankResultDTO + * @Auth wangc + * @Date 2020-07-21 14:52 + */ +@Data +public class ResiPointRankResultDTO implements Serializable { + private static final long serialVersionUID = 2095785598460202838L; + + private Integer rank; + + private String userId; + + private String customerId; + + private Integer totalPoint; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankingResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankingResultDTO.java new file mode 100644 index 0000000000..ee551db6e0 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankingResultDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName ResiPointRankingResultDTO + * @Auth wangc + * @Date 2020-07-21 16:38 + */ +@Data +public class ResiPointRankingResultDTO implements Serializable { + private static final long serialVersionUID = -5073341813089351068L; + + private String nickname; + + private Integer ranking; + + private Integer point; + +} diff --git a/epmet-module/epmet-point/epmet-point-server/pom.xml b/epmet-module/epmet-point/epmet-point-server/pom.xml index 962ba4984e..49ccab5b90 100644 --- a/epmet-module/epmet-point/epmet-point-server/pom.xml +++ b/epmet-module/epmet-point/epmet-point-server/pom.xml @@ -116,7 +116,7 @@ 6379 123456 - true + false 122.152.200.70:8848 fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java index de8e7a2aab..4791eb6c00 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java @@ -18,8 +18,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.ResiPointLogPeriodResultDTO; import com.epmet.entity.PointVerificationLogEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 核销记录/确认表 @@ -29,5 +33,14 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface PointVerificationLogDao extends BaseDao { - + + /** + * @Description 查询指定用户兑换记录 + * @param userId + * @return + * @author wangc + * @date 2020.07.22 15:38 + **/ + List selectVerificationLog(@Param("userId") String userId); + } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java index a611054609..6f9ac3fb4c 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java @@ -18,8 +18,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.ResiPointLogPeriodResultDTO; import com.epmet.entity.UserPointActionLogEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 用户积分行为记录 @@ -29,5 +33,14 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface UserPointActionLogDao extends BaseDao { - + + /** + * @Description 查询用户积分明细,按照时间倒叙 + * @param userId + * @return + * @author wangc + * @date 2020.07.22 13:56 + **/ + List selectPointActionLogList(@Param("userId") String userId); + } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java index 9600a5ed9c..142817ae9f 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java @@ -18,8 +18,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.ResiPointRankResultDTO; import com.epmet.entity.UserPointStatisticalDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 用户积分统计情况 @@ -29,5 +33,16 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface UserPointStatisticalDailyDao extends BaseDao { - + + /** + * @Description 查询客户下周/月度用户积分排行榜 + * @param customerId + * @param dimension + * @param dimensionId + * @return + * @author wangc + * @date 2020.07.22 10:47 + **/ + List selectPointRankWithinTimeZone(@Param("customerId") String customerId,@Param("dimension") String dimension,@Param("dimensionId") String dimensionId); + } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointTotalDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointTotalDao.java index 082dfb12e6..b50249c020 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointTotalDao.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointTotalDao.java @@ -18,8 +18,13 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.ResiPointDetailResultDTO; +import com.epmet.dto.result.ResiPointRankResultDTO; import com.epmet.entity.UserPointTotalEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 用户积分总计 @@ -29,5 +34,23 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface UserPointTotalDao extends BaseDao { - + + /** + * @Description 根据用户Id查询他的累计积分以及可用积分 + * @param userId + * @return + * @author wangc + * @date 2020.07.21 13:38 + **/ + ResiPointDetailResultDTO selectPointByUserId(@Param("userId")String userId); + + /** + * @Description 查询客户下的用户累计积分排名榜 + * @param customerId + * @return + * @author wangc + * @date 2020.07.21 15:16 + **/ + List selectUserPointRank(@Param("customerId") String customerId); + } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/UserPointStatisticalDailyEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/UserPointStatisticalDailyEntity.java index f83dec624b..907d284425 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/UserPointStatisticalDailyEntity.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/UserPointStatisticalDailyEntity.java @@ -38,6 +38,11 @@ public class UserPointStatisticalDailyEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; + /** + * 用户Id + * */ + private String userId; + /** * 日 yyyy-MM-dd */ diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationLogService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationLogService.java index 55cd81a0d4..54700cbf63 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationLogService.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationLogService.java @@ -20,6 +20,8 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.PointVerificationLogDTO; +import com.epmet.dto.form.ResiCommonUserIdFormDTO; +import com.epmet.dto.result.ResiPointLogListResultDTO; import com.epmet.entity.PointVerificationLogEntity; import java.util.List; @@ -92,4 +94,13 @@ public interface PointVerificationLogService extends BaseService getMyExchangeRecord(ResiCommonUserIdFormDTO userId); } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java index 895442c190..e385a923c1 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java @@ -20,6 +20,8 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.UserPointActionLogDTO; +import com.epmet.dto.form.ResiCommonUserIdFormDTO; +import com.epmet.dto.result.ResiPointLogListResultDTO; import com.epmet.entity.UserPointActionLogEntity; import java.util.List; @@ -92,4 +94,14 @@ public interface UserPointActionLogService extends BaseService getMyPointRecord(ResiCommonUserIdFormDTO userId); + } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java index cd9d329154..b3cdc6443f 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java @@ -20,6 +20,8 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.UserPointStatisticalDailyDTO; +import com.epmet.dto.form.ResiPointRankFormDTO; +import com.epmet.dto.result.ResiPointRankListResultDTO; import com.epmet.entity.UserPointStatisticalDailyEntity; import java.util.List; @@ -92,4 +94,13 @@ public interface UserPointStatisticalDailyService extends BaseService getMyExchangeRecord(ResiCommonUserIdFormDTO userId) { + List logList = baseDao.selectVerificationLog(userId.getUserId()); + List result = new LinkedList<>(); + if(null != logList && !logList.isEmpty()){ + Map> map = + logList.stream().collect(Collectors.groupingBy(ResiPointLogPeriodResultDTO::getDate)); + + Map> sortedMap = Maps.newLinkedHashMap(); + map.entrySet().stream().sorted(Map.Entry.>comparingByKey().reversed()) + .forEachOrdered(e -> sortedMap.put(e.getKey(), e.getValue())); + map.entrySet().forEach(e -> { + ResiPointLogListResultDTO o = new ResiPointLogListResultDTO(); + o.setDate(e.getKey()); + o.setDailyList(e.getValue()); + result.add(o); + }); + } + return result; + } + } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java index 1fc485a017..bb57179d6c 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java @@ -25,15 +25,18 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.UserPointActionLogDao; import com.epmet.dto.UserPointActionLogDTO; +import com.epmet.dto.form.ResiCommonUserIdFormDTO; +import com.epmet.dto.result.ResiPointLogListResultDTO; +import com.epmet.dto.result.ResiPointLogPeriodResultDTO; import com.epmet.entity.UserPointActionLogEntity; import com.epmet.service.UserPointActionLogService; +import com.google.common.collect.Maps; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.stream.Collectors; /** * 用户积分行为记录 @@ -97,4 +100,33 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl getMyPointRecord(ResiCommonUserIdFormDTO userId) { + List logList = baseDao.selectPointActionLogList(userId.getUserId()); + List result = new LinkedList<>(); + if(null != logList && !logList.isEmpty()){ + Map> map = + logList.stream().collect(Collectors.groupingBy(ResiPointLogPeriodResultDTO::getDate)); + + Map> sortedMap = Maps.newLinkedHashMap(); + map.entrySet().stream().sorted(Map.Entry.>comparingByKey().reversed()) + .forEachOrdered(e -> sortedMap.put(e.getKey(), e.getValue())); + map.entrySet().forEach(e -> { + ResiPointLogListResultDTO o = new ResiPointLogListResultDTO(); + o.setDate(e.getKey()); + o.setDailyList(e.getValue()); + result.add(o); + }); + + } + return result; + } + } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java index 9715199436..6f68297877 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java @@ -25,8 +25,11 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.UserPointStatisticalDailyDao; import com.epmet.dto.UserPointStatisticalDailyDTO; +import com.epmet.dto.form.ResiPointRankFormDTO; +import com.epmet.dto.result.ResiPointRankListResultDTO; import com.epmet.entity.UserPointStatisticalDailyEntity; import com.epmet.service.UserPointStatisticalDailyService; +import com.epmet.utils.ModuleConstant; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -97,4 +100,21 @@ public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl - + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml index e3c1dcc2bc..57c6c0b81f 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml @@ -21,5 +21,22 @@ + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml index 5af194c539..e37642cd78 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml @@ -5,7 +5,8 @@ - + + @@ -21,5 +22,38 @@ + + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml index 3866cce55e..9c372dc78b 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml @@ -18,5 +18,30 @@ + + + + + \ No newline at end of file From 04b7b4d714a63e267cb112c7e8cafb0952ce185d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 22 Jul 2020 16:40:37 +0800 Subject: [PATCH 34/98] =?UTF-8?q?heart-work:=E6=8A=A5=E5=90=8D=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8tab=E5=88=97=E8=A1=A8=E5=88=9D=E5=A7=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/work/AuditingActUserResultDTO.java | 11 ++ .../result/work/CanceledActUserResultDTO.java | 78 ++++++++ .../result/work/PassedActUserResultDTO.java | 72 +++++++ .../result/work/RejectedActUserResultDTO.java | 77 ++++++++ .../controller/WorkActUserController.java | 46 +++++ .../com/epmet/dao/ActUserRelationDao.java | 36 ++++ .../epmet/service/ActUserRelationService.java | 36 ++++ .../com/epmet/service/WorkActUserService.java | 30 +++ .../impl/ActUserRelationServiceImpl.java | 48 +++++ .../service/impl/WorkActUserServiceImpl.java | 177 +++++++++++++++--- .../resources/mapper/ActUserRelationDao.xml | 50 +++++ .../dto/result/UserBaseInfoResultDTO.java | 3 + .../com/epmet/entity/UserBaseInfoEntity.java | 71 ++++--- .../service/impl/UserBaseInfoServiceImpl.java | 37 ++-- .../main/resources/mapper/UserBaseInfoDao.xml | 4 +- 15 files changed, 702 insertions(+), 74 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActUserResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PassedActUserResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/RejectedActUserResultDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingActUserResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingActUserResultDTO.java index c40e1310b2..1993b73dfa 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingActUserResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingActUserResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.result.work; +import com.epmet.commons.tools.constant.NumConstant; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; @@ -15,6 +16,10 @@ import java.util.Date; @Data public class AuditingActUserResultDTO implements Serializable { private static final long serialVersionUID = 5567556309702585031L; + /** + * act_user_relation主键 + */ + private String actUserRelationId; /** * 活动id @@ -52,4 +57,10 @@ public class AuditingActUserResultDTO implements Serializable { */ private Boolean volunteerFlag; + public AuditingActUserResultDTO(){ + //微信基本信息先默认为空字符串 + this.setRealName(NumConstant.EMPTY_STR); + this.setNickName(NumConstant.EMPTY_STR); + this.setHeadImgUrl(NumConstant.EMPTY_STR); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActUserResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActUserResultDTO.java new file mode 100644 index 0000000000..c35ec60a4c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActUserResultDTO.java @@ -0,0 +1,78 @@ +package com.epmet.dto.result.work; + +import com.epmet.commons.tools.constant.NumConstant; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 报名审核-已取消报名列表 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/22 16:24 + */ +@Data +public class CanceledActUserResultDTO implements Serializable { + private static final long serialVersionUID = 2860252989602238156L; + + /** + * act_user_relation主键 + */ + private String actUserRelationId; + + /** + * 活动id + */ + private String actId; + + /** + * 用户id + */ + private String userId; + + /** + * 姓名 + */ + private String realName; + + /** + * 微信昵称 + */ + private String nickName; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * 报名时间yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date signUpTime; + + /** + * true: 是志愿者 false : 不是志愿者 + */ + private Boolean volunteerFlag; + + /** + * 取消报名的时间yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date cancelTime; + + /** + * 用户取消报名的原因 + */ + private String cancelReason; + + public CanceledActUserResultDTO(){ + //微信基本信息先默认为空字符串 + this.setRealName(NumConstant.EMPTY_STR); + this.setNickName(NumConstant.EMPTY_STR); + this.setHeadImgUrl(NumConstant.EMPTY_STR); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PassedActUserResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PassedActUserResultDTO.java new file mode 100644 index 0000000000..52f8d2469b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PassedActUserResultDTO.java @@ -0,0 +1,72 @@ +package com.epmet.dto.result.work; + +import com.epmet.commons.tools.constant.NumConstant; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 报名审核-已通过列表返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/22 15:12 + */ +@Data +public class PassedActUserResultDTO implements Serializable { + private static final long serialVersionUID = -3805973537303081543L; + /** + * act_user_relation主键 + */ + private String actUserRelationId; + + /** + * 活动id + */ + private String actId; + + /** + * 用户id + */ + private String userId; + + /** + * 姓名 + */ + private String realName; + + /** + * 微信昵称 + */ + private String nickName; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * 报名时间yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date signUpTime; + + /** + * true: 是志愿者 false : 不是志愿者 + */ + private Boolean volunteerFlag; + + /** + * 审核通过的时间yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date auditTime; + + public PassedActUserResultDTO(){ + //微信基本信息先默认为空字符串 + this.setRealName(NumConstant.EMPTY_STR); + this.setNickName(NumConstant.EMPTY_STR); + this.setHeadImgUrl(NumConstant.EMPTY_STR); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/RejectedActUserResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/RejectedActUserResultDTO.java new file mode 100644 index 0000000000..58d5f5c1cb --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/RejectedActUserResultDTO.java @@ -0,0 +1,77 @@ +package com.epmet.dto.result.work; + +import com.epmet.commons.tools.constant.NumConstant; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 报名审核-已拒绝列表 返参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/22 15:41 + */ +@Data +public class RejectedActUserResultDTO implements Serializable { + private static final long serialVersionUID = 2569855003833546409L; + /** + * act_user_relation主键 + */ + private String actUserRelationId; + + /** + * 活动id + */ + private String actId; + + /** + * 用户id + */ + private String userId; + + /** + * 姓名 + */ + private String realName; + + /** + * 微信昵称 + */ + private String nickName; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * 报名时间yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date signUpTime; + + /** + * true: 是志愿者 false : 不是志愿者 + */ + private Boolean volunteerFlag; + + /** + * 审核不通过的时间yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date auditTime; + + /** + * 未通过原因 + */ + private String failureReason; + + public RejectedActUserResultDTO(){ + //微信基本信息先默认为空字符串 + this.setRealName(NumConstant.EMPTY_STR); + this.setNickName(NumConstant.EMPTY_STR); + this.setHeadImgUrl(NumConstant.EMPTY_STR); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java index 514a73f1e4..f770e5da75 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java @@ -4,6 +4,9 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.work.AuditingActUserFormDTO; import com.epmet.dto.result.work.AuditingActUserResultDTO; +import com.epmet.dto.result.work.CanceledActUserResultDTO; +import com.epmet.dto.result.work.PassedActUserResultDTO; +import com.epmet.dto.result.work.RejectedActUserResultDTO; import com.epmet.service.WorkActUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -39,4 +42,47 @@ public class WorkActUserController { List list=workActUserService.getAuditingList(formDTO); return new Result>().ok(list); } + + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @author yinzuomei + * @description 报名审核-已通过列表 + * @Date 2020/7/22 15:16 + **/ + @PostMapping("passedlist") + public Result> getPassedList(@RequestBody AuditingActUserFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, AuditingActUserFormDTO.AddUserInternalGroup.class); + List list=workActUserService.getPassedList(formDTO); + return new Result>().ok(list); + } + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @author yinzuomei + * @description 报名审核-已拒绝列表 + * @Date 2020/7/22 15:49 + **/ + @PostMapping("rejectedlist") + public Result> getRejectedlist(@RequestBody AuditingActUserFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, AuditingActUserFormDTO.AddUserInternalGroup.class); + List list=workActUserService.getRejectedlist(formDTO); + return new Result>().ok(list); + } + + /** + * @return + * @param formDTO + * @author yinzuomei + * @description 报名审核-已取消报名列表 + * @Date 2020/7/22 16:23 + **/ + @PostMapping("/heart/work/actuser/canceledlist") + public Result getCanceledList(@RequestBody AuditingActUserFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, AuditingActUserFormDTO.AddUserInternalGroup.class); + List list=workActUserService.getCanceledList(formDTO); + return new Result>().ok(list); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java index 4054f2dda7..1aa248d4d3 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java @@ -50,4 +50,40 @@ public interface ActUserRelationDao extends BaseDao { * @Date 2020/7/21 22:45 **/ List selectAuditingUserIds(String actId); + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 根据活动id,查询已通过人员关系记录 + * @Date 2020/7/22 15:33 + **/ + List selectPassedList(String actId); + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 根据活动id,查询已通过人员,返回用户id集合 + * @Date 2020/7/22 15:38 + **/ + List selectPassedListUserIds(String actId); + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 根据活动id,查询已拒绝人员关系记录 + * @Date 2020/7/22 16:20 + **/ + List selectRejectedList(String actId); + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 根据活动id,查询已拒绝人员,返回用户id集合 + * @Date 2020/7/22 16:20 + **/ + List selectRejectedListUserIds(String actId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java index f0d0fe7d5b..c96dcb9d94 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java @@ -110,4 +110,40 @@ public interface ActUserRelationService extends BaseService getAuditingUserIds(String actId); + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 查询已通过的人员列表 + * @Date 2020/7/22 15:31 + **/ + List getPassedList(String actId); + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 查询已通过的人员列表 userId集合 + * @Date 2020/7/22 15:37 + **/ + List getPassedListUserIds(String actId); + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 查询已拒绝过的人员列表 + * @Date 2020/7/22 16:19 + **/ + List getRejectedList(String actId); + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 查询已拒绝的人员列表 userId集合 + * @Date 2020/7/22 16:19 + **/ + List getRejectedListUserIds(String actId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java index a11d56794d..c319566125 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java @@ -2,6 +2,9 @@ package com.epmet.service; import com.epmet.dto.form.work.AuditingActUserFormDTO; import com.epmet.dto.result.work.AuditingActUserResultDTO; +import com.epmet.dto.result.work.CanceledActUserResultDTO; +import com.epmet.dto.result.work.PassedActUserResultDTO; +import com.epmet.dto.result.work.RejectedActUserResultDTO; import java.util.List; @@ -20,4 +23,31 @@ public interface WorkActUserService { * @Date 2020/7/21 22:25 **/ List getAuditingList(AuditingActUserFormDTO formDTO); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 报名审核-已通过列表 + * @Date 2020/7/22 15:16 + **/ + List getPassedList(AuditingActUserFormDTO formDTO); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 报名审核-已拒绝列表 + * @Date 2020/7/22 15:50 + **/ + List getRejectedlist(AuditingActUserFormDTO formDTO); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 报名审核-已取消报名列表 + * @Date 2020/7/22 16:35 + **/ + List getCanceledList(AuditingActUserFormDTO formDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java index 0979dc568d..516b0fa31d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java @@ -125,4 +125,52 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl + * @author yinzuomei + * @description 查询已通过的人员列表 + * @Date 2020/7/22 15:31 + **/ + @Override + public List getPassedList(String actId) { + return baseDao.selectPassedList(actId); + } + + /** + * @param actId + * @return java.util.List + * @author yinzuomei + * @description 查询已通过的人员列表 userId集合 + * @Date 2020/7/22 15:37 + **/ + @Override + public List getPassedListUserIds(String actId) { + return baseDao.selectPassedListUserIds(actId); + } + + /** + * @param actId + * @return java.util.List + * @author yinzuomei + * @description 查询已拒绝过的人员列表 + * @Date 2020/7/22 16:19 + **/ + @Override + public List getRejectedList(String actId) { + return baseDao.selectRejectedList(actId); + } + + /** + * @param actId + * @return java.util.List + * @author yinzuomei + * @description 查询已拒绝的人员列表 userId集合 + * @Date 2020/7/22 16:19 + **/ + @Override + public List getRejectedListUserIds(String actId) { + return baseDao.selectRejectedListUserIds(actId); + } + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java index 9e7cac148d..bb4d0c546e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java @@ -1,12 +1,14 @@ package com.epmet.service.impl; -import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.ActUserRelationDTO; import com.epmet.dto.HeartUserInfoDTO; import com.epmet.dto.form.work.AuditingActUserFormDTO; import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.dto.result.work.AuditingActUserResultDTO; +import com.epmet.dto.result.work.CanceledActUserResultDTO; +import com.epmet.dto.result.work.PassedActUserResultDTO; +import com.epmet.dto.result.work.RejectedActUserResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.service.ActUserRelationService; import com.epmet.service.HeartUserInfoService; @@ -48,43 +50,173 @@ public class WorkActUserServiceImpl implements WorkActUserService { //查询出待审核的人员列表 List actUserRelationDTOList=actUserRelationService.getAuditingUserList(formDTO.getActId()); if(null==actUserRelationDTOList||actUserRelationDTOList.size()==0){ - logger.info(String.format("当前活动%s没有待审核的报名人员",formDTO.getActId())); + logger.info(String.format("当前活动,actId=%s待审核列表为空",formDTO.getActId())); return list; } //查询出待审核的人员id集合 List userIdList=actUserRelationService.getAuditingUserIds(formDTO.getActId()); - //根据待审核的人员结合,查询出用户基本信息 + //根据待审核的人员集合,查询出用户基本信息 List userInfoList=this.queryUserBaseInfo(userIdList); - //调用epemet_user服务获取用户的基本信息 for(ActUserRelationDTO actUserRelationDTO:actUserRelationDTOList){ - AuditingActUserResultDTO resultDTO=new AuditingActUserResultDTO(); - resultDTO.setActId(formDTO.getActId()); - resultDTO.setUserId(actUserRelationDTO.getUserId()); - resultDTO.setSignUpTime(actUserRelationDTO.getCreatedTime()); - //微信基本信息先默认为空字符串 - resultDTO.setRealName(NumConstant.EMPTY_STR); - resultDTO.setNickName(NumConstant.EMPTY_STR); - resultDTO.setHeadImgUrl(NumConstant.EMPTY_STR); + AuditingActUserResultDTO auditingDTO=new AuditingActUserResultDTO(); + auditingDTO.setActUserRelationId(actUserRelationDTO.getId()); + auditingDTO.setActId(formDTO.getActId()); + auditingDTO.setUserId(actUserRelationDTO.getUserId()); + auditingDTO.setSignUpTime(actUserRelationDTO.getCreatedTime()); + //true: 是志愿者 false : 不是志愿者 + auditingDTO.setVolunteerFlag(getVolunteerFlag(actUserRelationDTO.getUserId())); + //赋值基本信息 + for(UserBaseInfoResultDTO userBaseInfoResultDTO:userInfoList){ + if(actUserRelationDTO.getUserId().equals(userBaseInfoResultDTO.getUserId())){ + auditingDTO.setRealName(userBaseInfoResultDTO.getRealName()); + auditingDTO.setNickName(userBaseInfoResultDTO.getNickname()); + auditingDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); + break; + } + } + list.add(auditingDTO); + } + return list; + } - HeartUserInfoDTO heartUserInfoDTO=heartUserInfoService.getByUserId(actUserRelationDTO.getUserId()); + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 报名审核-已通过列表 + * @Date 2020/7/22 15:16 + **/ + @Override + public List getPassedList(AuditingActUserFormDTO formDTO) { + List resultList=new ArrayList<>(); + //查询已通过的人员列表 + List actUserRelationDTOList=actUserRelationService.getPassedList(formDTO.getActId()); + if(null==actUserRelationDTOList||actUserRelationDTOList.size()==0){ + logger.info(String.format("当前活动,actId=%s已通过列表为空",formDTO.getActId())); + return resultList; + } + //查询已通过审核的人员id集合 + List userIdList=actUserRelationService.getPassedListUserIds(formDTO.getActId()); + //根据已通过的人员集合,查询出用户基本信息 + List userInfoList=this.queryUserBaseInfo(userIdList); + for(ActUserRelationDTO actUserRelationDTO:actUserRelationDTOList){ + PassedActUserResultDTO passedDTO=new PassedActUserResultDTO(); + passedDTO.setActUserRelationId(actUserRelationDTO.getId()); + passedDTO.setActId(formDTO.getActId()); + passedDTO.setUserId(actUserRelationDTO.getUserId()); + passedDTO.setSignUpTime(actUserRelationDTO.getCreatedTime()); + passedDTO.setAuditTime(actUserRelationDTO.getAuditTime()); + //true: 是志愿者 false : 不是志愿者 + passedDTO.setVolunteerFlag(getVolunteerFlag(actUserRelationDTO.getUserId())); + //赋值基本信息 + for(UserBaseInfoResultDTO userBaseInfoResultDTO:userInfoList){ + if(actUserRelationDTO.getUserId().equals(userBaseInfoResultDTO.getUserId())){ + passedDTO.setRealName(userBaseInfoResultDTO.getRealName()); + passedDTO.setNickName(userBaseInfoResultDTO.getNickname()); + passedDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); + break; + } + } + resultList.add(passedDTO); + } + return resultList; + } + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 报名审核-已拒绝列表 + * @Date 2020/7/22 15:50 + **/ + @Override + public List getRejectedlist(AuditingActUserFormDTO formDTO) { + List resultList=new ArrayList<>(); + //查询已拒绝的人员列表 + List actUserRelationDTOList=actUserRelationService.getRejectedList(formDTO.getActId()); + if(null==actUserRelationDTOList||actUserRelationDTOList.size()==0){ + logger.info(String.format("当前活动,actId=%s已拒绝列表为空",formDTO.getActId())); + return resultList; + } + //查询已拒绝审核的人员id集合 + List userIdList=actUserRelationService.getRejectedListUserIds(formDTO.getActId()); + //根据已拒绝的人员集合,查询出用户基本信息 + List userInfoList=this.queryUserBaseInfo(userIdList); + for(ActUserRelationDTO actUserRelationDTO:actUserRelationDTOList){ + RejectedActUserResultDTO rejectedDTO=new RejectedActUserResultDTO(); + rejectedDTO.setActUserRelationId(actUserRelationDTO.getId()); + rejectedDTO.setActId(formDTO.getActId()); + rejectedDTO.setUserId(actUserRelationDTO.getUserId()); + rejectedDTO.setSignUpTime(actUserRelationDTO.getCreatedTime()); + rejectedDTO.setAuditTime(actUserRelationDTO.getAuditTime()); + rejectedDTO.setFailureReason(actUserRelationDTO.getFailureReason()); //true: 是志愿者 false : 不是志愿者 - if(null!=heartUserInfoDTO){ - resultDTO.setVolunteerFlag(heartUserInfoDTO.getVolunteerFlag()); - }else{ - resultDTO.setVolunteerFlag(false); + rejectedDTO.setVolunteerFlag(getVolunteerFlag(actUserRelationDTO.getUserId())); + //赋值基本信息 + for(UserBaseInfoResultDTO userBaseInfoResultDTO:userInfoList){ + if(actUserRelationDTO.getUserId().equals(userBaseInfoResultDTO.getUserId())){ + rejectedDTO.setRealName(userBaseInfoResultDTO.getRealName()); + rejectedDTO.setNickName(userBaseInfoResultDTO.getNickname()); + rejectedDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); + break; + } } + resultList.add(rejectedDTO); + } + return resultList; + } + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 报名审核-已取消报名列表 + * @Date 2020/7/22 16:35 + **/ + @Override + public List getCanceledList(AuditingActUserFormDTO formDTO) { + List resultList=new ArrayList<>(); + //查询已取消的人员列表 + List actUserRelationDTOList=actUserRelationService.getRejectedList(formDTO.getActId()); + if(null==actUserRelationDTOList||actUserRelationDTOList.size()==0){ + logger.info(String.format("当前活动,actId=%s已取消报名列表为空",formDTO.getActId())); + return resultList; + } + //查询已取消审核的人员id集合 + List userIdList=actUserRelationService.getRejectedListUserIds(formDTO.getActId()); + //根据已取消的人员集合,查询出用户基本信息 + List userInfoList=this.queryUserBaseInfo(userIdList); + for(ActUserRelationDTO actUserRelationDTO:actUserRelationDTOList){ + CanceledActUserResultDTO cancelDTO=new CanceledActUserResultDTO(); + cancelDTO.setActUserRelationId(actUserRelationDTO.getId()); + cancelDTO.setActId(formDTO.getActId()); + cancelDTO.setUserId(actUserRelationDTO.getUserId()); + cancelDTO.setSignUpTime(actUserRelationDTO.getCreatedTime()); + cancelDTO.setCancelReason(actUserRelationDTO.getCancelReason()); + cancelDTO.setCancelTime(actUserRelationDTO.getCancelTime()); + //true: 是志愿者 false : 不是志愿者 + cancelDTO.setVolunteerFlag(getVolunteerFlag(actUserRelationDTO.getUserId())); //赋值基本信息 for(UserBaseInfoResultDTO userBaseInfoResultDTO:userInfoList){ if(actUserRelationDTO.getUserId().equals(userBaseInfoResultDTO.getUserId())){ - resultDTO.setRealName(userBaseInfoResultDTO.getRealName()); - resultDTO.setNickName(userBaseInfoResultDTO.getNickname()); - resultDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); + cancelDTO.setRealName(userBaseInfoResultDTO.getRealName()); + cancelDTO.setNickName(userBaseInfoResultDTO.getNickname()); + cancelDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); break; } } - list.add(resultDTO); + resultList.add(cancelDTO); } - return list; + return resultList; + } + + private Boolean getVolunteerFlag(String userId) { + HeartUserInfoDTO heartUserInfoDTO=heartUserInfoService.getByUserId(userId); + //true: 是志愿者 false : 不是志愿者 + if(null!=heartUserInfoDTO){ + return heartUserInfoDTO.getVolunteerFlag(); + } + return false; } /** @@ -99,6 +231,7 @@ public class WorkActUserServiceImpl implements WorkActUserService { if(null==userIdList||userIdList.size()==0){ return userInfoList; } + //调用epemet_user服务获取用户的基本信息 Result> resultUserList =epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); if(resultUserList.success()&&resultUserList.getData().size()>0){ return resultUserList.getData(); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml index 7dcd874931..17beff7a83 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml @@ -50,4 +50,54 @@ AND aur.ACT_ID = #{actId} order by aur.CREATED_TIME desc + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBaseInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBaseInfoResultDTO.java index 19ece1b40f..983bffec24 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBaseInfoResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBaseInfoResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -13,6 +14,8 @@ import java.io.Serializable; @Data public class UserBaseInfoResultDTO implements Serializable { private static final long serialVersionUID = 3124057264557384333L; + @JsonIgnore + private String id; /** * 用户id */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserBaseInfoEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserBaseInfoEntity.java index 882aaeb243..9a20ef3395 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserBaseInfoEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserBaseInfoEntity.java @@ -22,6 +22,7 @@ import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; + /** * 用户基础信息 * @@ -35,29 +36,25 @@ public class UserBaseInfoEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; - /** - * 主键 - */ - private String id; - /** - * 用户id - */ + /** + * 用户id + */ private String userId; - /** - * 手机号(注册手机号) - */ + /** + * 手机号(注册手机号) + */ private String mobile; - /** - * 姓氏 - */ + /** + * 姓氏 + */ private String surname; - /** - * 名称 - */ + /** + * 名称 + */ private String name; /** @@ -65,39 +62,39 @@ public class UserBaseInfoEntity extends BaseEpmetEntity { */ private String realName; - /** - * 身份证号 - */ + /** + * 身份证号 + */ private String idNum; - /** - * 性别(1男2女0未知) - */ + /** + * 性别(1男2女0未知) + */ private String gender; - /** - * 街道 - */ + /** + * 街道 + */ private String street; - /** - * 小区名称 - */ + /** + * 小区名称 + */ private String district; - /** - * 楼栋单元 - */ + /** + * 楼栋单元 + */ private String buildingAddress; - /** - * 昵称(目前来源于微信昵称,后续系统可支持用户有昵称) - */ + /** + * 昵称(目前来源于微信昵称,后续系统可支持用户有昵称) + */ private String nickname; - /** - * 头像(目前来源于微信,后续系统顾客支持上传头像) - */ + /** + * 头像(目前来源于微信,后续系统顾客支持上传头像) + */ private String headImgUrl; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java index ea1abcfa50..f097d83000 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java @@ -161,15 +161,24 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl - + @@ -22,11 +22,13 @@ + + + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml index 17beff7a83..f7531ff65a 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml @@ -25,79 +25,40 @@ - - SELECT aur.* FROM act_user_relation aur WHERE aur.DEL_FLAG = '0' - AND aur.`STATUS` = 'auditing' + AND aur.`STATUS` = #{status} AND aur.ACT_ID = #{actId} order by aur.CREATED_TIME desc - - SELECT distinct aur.USER_ID as userIds FROM act_user_relation aur WHERE aur.DEL_FLAG = '0' - AND aur.`STATUS` = 'auditing' + AND aur.`STATUS` =#{status} AND aur.ACT_ID = #{actId} order by aur.CREATED_TIME desc - - - - - - - - - SELECT - distinct aur.USER_ID as userIds + COUNT(1) AS TOTAL FROM act_user_relation aur WHERE aur.DEL_FLAG = '0' - AND aur.`STATUS` = 'refused' + AND aur.`STATUS` =#{status} AND aur.ACT_ID = #{actId} - order by aur.AUDIT_TIME desc \ No newline at end of file diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index 2c3f938f56..3d8b415889 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -137,7 +137,7 @@ 6379 123456 - true + false 122.152.200.70:8848 fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b From 27ae4b0a85363966116fd403735f200e7045b8ca Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 22 Jul 2020 18:36:04 +0800 Subject: [PATCH 37/98] =?UTF-8?q?user=E8=AF=AF=E6=8F=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-user/epmet-user-server/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index 3d8b415889..2c3f938f56 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -137,7 +137,7 @@ 6379 123456 - false + true 122.152.200.70:8848 fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b From f66bbc51a0c768de13bd7e0ade2778ab27fa2a31 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Thu, 23 Jul 2020 09:54:39 +0800 Subject: [PATCH 38/98] =?UTF-8?q?=E7=88=B1=E5=BF=83=E4=BA=92=E5=8A=A9-?= =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/exception/EpmetErrorCode.java | 3 + .../epmet-heart/epmet-heart-client/pom.xml | 6 + .../dto/form/resi/ResiActContentFormDTO.java | 46 ++++ .../dto/form/resi/ResiActDetailFormDTO.java | 38 ++++ .../result/resi/ResiActContentResultDTO.java | 56 +++++ .../result/resi/ResiActDetailResultDTO.java | 140 +++++++++++++ ...tDTO.java => ResiActLiveRecResultDTO.java} | 18 +- .../resi/ResiActRefusedDetailResultDTO.java | 99 +++++++++ .../result/resi/ResiActSummaryResultDTO.java | 55 +++++ .../result/resi/ResiLeaderboardResultDTO.java | 60 ++++++ .../com/epmet/feign/EpmetUserFeignClient.java | 32 +++ .../EpmetUserFeignClientFallBack.java | 25 +++ .../controller/ResiActListController.java | 92 +++++++- .../controller/ResiVolunteerController.java | 40 ++++ .../main/java/com/epmet/dao/ActInfoDao.java | 31 +++ .../java/com/epmet/dao/ActLiveRecDao.java | 29 ++- .../java/com/epmet/dao/ActSummaryDao.java | 15 +- .../com/epmet/dao/ActUserRelationDao.java | 22 +- .../java/com/epmet/dao/HeartUserInfoDao.java | 29 ++- .../com/epmet/service/ActInfoService.java | 21 +- .../com/epmet/service/ActLiveRecService.java | 15 +- .../com/epmet/service/ActSummaryService.java | 15 +- .../epmet/service/ActUserRelationService.java | 17 +- .../epmet/service/HeartUserInfoService.java | 18 +- .../service/impl/ActInfoServiceImpl.java | 198 ++++++++++++++++-- .../service/impl/ActLiveRecServiceImpl.java | 51 ++++- .../service/impl/ActSummaryServiceImpl.java | 13 +- .../impl/ActUserRelationServiceImpl.java | 31 ++- .../impl/HeartUserInfoServiceImpl.java | 39 +++- .../utils/ActUserRelationStatusConstant.java | 38 ++++ .../epmet/utils/ActUserStatusConstant.java | 49 +++++ .../com/epmet/utils/ValidityVerification.java | 90 ++++++++ .../src/main/resources/mapper/ActInfoDao.xml | 69 ++++++ .../main/resources/mapper/ActLiveRecDao.xml | 30 ++- .../main/resources/mapper/ActSummaryDao.xml | 17 +- .../resources/mapper/ActUserRelationDao.xml | 24 ++- .../resources/mapper/HeartUserInfoDao.xml | 28 ++- 37 files changed, 1537 insertions(+), 62 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActContentFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActDetailFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActContentResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java rename epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/{ActClockListResultDTO.java => ResiActLiveRecResultDTO.java} (78%) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActRefusedDetailResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActSummaryResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLeaderboardResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ActUserRelationStatusConstant.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ActUserStatusConstant.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ValidityVerification.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 63cab186d4..59a602b124 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -74,6 +74,9 @@ public enum EpmetErrorCode { IMG_SCAN_FAILED(8504,"图片审核失败,请重新上传"), PROJECT_IS_CLOSED(8601,"项目已结案"), + // 爱心互助 居民端 + NOT_IN_THE_SIGN_IN_RANGE(8510, "您还未进入指定的签到范围~"), + // 该错误不会提示给前端,只是后端传输错误信息用。 ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"), OPER_ADD_CUSTOMER_ROOT_AGENCY_ERROR(8702, "添加客户根级组织失败"), diff --git a/epmet-module/epmet-heart/epmet-heart-client/pom.xml b/epmet-module/epmet-heart/epmet-heart-client/pom.xml index 8701e1a09d..454488ddc2 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/pom.xml +++ b/epmet-module/epmet-heart/epmet-heart-client/pom.xml @@ -26,6 +26,12 @@ io.springfox springfox-swagger-ui + + com.epmet + epmet-user-client + 2.0.0 + compile + diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActContentFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActContentFormDTO.java new file mode 100644 index 0000000000..e1bd5fc097 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActContentFormDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.form.resi; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 活动内容(活动详情-已结束-回顾稿) 入参 + * + * @Auther: zhangyong + * @Date: 2020-07-21 18:12 + */ +@Data +public class ResiActContentFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + //>>>>>>>>>>>>>>>>>校验分组开始>>>>>>>>>>>>>>>>>>>>> + /** + * 添加用户操作的内部异常分组 + * 出现错误会提示给前端7000错误码,返回信息为:服务器开小差... + */ + public interface AddUserInternalGroup {} + + // <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<< + + /** + * 活动Id + */ + @NotBlank(message = "活动Id不能为空", groups = { ResiActBaseFormDTO.AddUserInternalGroup.class }) + private String actId; + + /** + * 页码,从1开始 + */ + @Min(value = 1, message = "页码必须大于0", groups = { ResiActBaseFormDTO.AddUserInternalGroup.class }) + private Integer pageNo; + + /** + * 页容量,默认20页 + */ + @Min(value = 1, message = "每页条数必须大于必须大于0", groups = { ResiActBaseFormDTO.AddUserInternalGroup.class }) + private Integer pageSize; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActDetailFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActDetailFormDTO.java new file mode 100644 index 0000000000..10a03cfd90 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActDetailFormDTO.java @@ -0,0 +1,38 @@ +package com.epmet.dto.form.resi; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 活动详情 入参 + * + * @Auther: zhangyong + * @Date: 2020-07-21 18:12 + */ +@Data +public class ResiActDetailFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + //>>>>>>>>>>>>>>>>>校验分组开始>>>>>>>>>>>>>>>>>>>>> + /** + * 添加用户操作的内部异常分组 + * 出现错误会提示给前端7000错误码,返回信息为:服务器开小差... + */ + public interface AddUserInternalGroup {} + + // <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<< + + /** + * 活动Id + */ + @NotBlank(message = "活动Id不能为空", groups = { ResiActBaseFormDTO.AddUserInternalGroup.class }) + private String actId; + + /** + * 用户id + */ + private String userId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActContentResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActContentResultDTO.java new file mode 100644 index 0000000000..4d6e9bbf3f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActContentResultDTO.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.epmet.dto.result.resi; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 活动内容 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ResiActContentResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String actContentId; + + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; + + /** + * 内容顺序 从1开始 + */ + private Integer orderNum; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java new file mode 100644 index 0000000000..18dba0c301 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java @@ -0,0 +1,140 @@ +/** + * 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.epmet.dto.result.resi; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 活动详情 + * + * @author zhangyong + * @since v1.0.0 2020-07-20 + */ +@Data +public class ResiActDetailResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String actId; + + /** + * 标题 + */ + private String title; + + /** + * 联系人 + */ + private String contacts; + + /** + * 联系电话 + */ + private String tel; + + /** + * 报名截止时间(yyyy-MM-dd HH:mm) + */ + private String signUpEndTime; + + /** + * 活动开始时间(yyyy-MM-dd HH:mm) + */ + private String actStartTime; + + /** + * 活动结束时间(yyyy-MM-dd HH:mm) + */ + private String actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动名额类型(true:固定名额 false: 不限制名额) + */ + private Boolean actQuotaCategory; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 已报名人数 + */ + private Integer signupNum; + + /** + * 积分奖励 + */ + private Integer reward; + + /** + * 招募要求 + */ + private String requirement; + + /** + * 活动详情 + */ + private List actContent; + + /** + * 用户当前状态(sign_up-我要报名,canceld-取消报名,enough-已报满,end_sign_up-截止报名,in_progress-已开始; finished-已结束,canceled-已取消) + */ + private String currentUserStatus; + + /** + * 用户是否是志愿者身份 (true:是,false 不是) + */ + private Boolean userVolunteerFlag; + + /** + * 是否需要是志愿者(true:只有志愿者才可以参加活动,false: 只要是居民就可以参加活动) + */ + private Boolean volunteerLimit; + + /** + * 活动实际开始时间(yyyy-MM-dd HH:mm) + */ + private String actualStartTime; + + /** + * 活动实际结束时间(yyyy-MM-dd HH:mm) + */ + private String actualEndTime; + + /** + * 主办方 + */ + private String sponsor; + + /** + * 是否已签到(true已签到,false未签到) + */ + private Boolean isSignUp; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ActClockListResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActLiveRecResultDTO.java similarity index 78% rename from epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ActClockListResultDTO.java rename to epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActLiveRecResultDTO.java index cb3cc26361..8798dfb0ef 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ActClockListResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActLiveRecResultDTO.java @@ -22,27 +22,25 @@ import lombok.Data; import java.io.Serializable; import java.util.List; + /** - * 打卡列表 + * 活动详情-已结束-现场实况列表 * - * @author zhangyong - * @since v1.0.0 2020-07-14 + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 */ @Data -public class ActClockListResultDTO implements Serializable { +public class ResiActLiveRecResultDTO implements Serializable { private static final long serialVersionUID = 1L; /** - * 活动打卡人次 + * 现场实况次数 */ - private Integer clockNum; + private Integer actLiveNum; /** * 打卡列表 */ - private List clocks; - - - + private List actLives; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActRefusedDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActRefusedDetailResultDTO.java new file mode 100644 index 0000000000..34d18ae9d2 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActRefusedDetailResultDTO.java @@ -0,0 +1,99 @@ +/** + * 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.epmet.dto.result.resi; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 活动详情-未通过 + * + * @author zhangyong + * @since v1.0.0 2020-07-20 + */ +@Data +public class ResiActRefusedDetailResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String actId; + + /** + * 标题 + */ + private String title; + + /** + * 报名截止时间(yyyy-MM-dd HH:mm) + */ + private String signUpEndTime; + + /** + * 活动开始时间(yyyy-MM-dd HH:mm) + */ + private String actStartTime; + + /** + * 活动结束时间(yyyy-MM-dd HH:mm) + */ + private String actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动名额类型(true:固定名额 false: 不限制名额) + */ + private Boolean actQuotaCategory; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 联系人 + */ + private String contacts; + + /** + * 联系电话 + */ + private String tel; + + /** + * 积分奖励 + */ + private Integer reward; + + /** + * 主办方 + */ + private String sponsor; + + /** + * 未通过原因 + */ + private String failureReason; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActSummaryResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActSummaryResultDTO.java new file mode 100644 index 0000000000..f52006de80 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActSummaryResultDTO.java @@ -0,0 +1,55 @@ +/** + * 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.epmet.dto.result.resi; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 活动回顾列表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ResiActSummaryResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String summaryId; + + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; + + /** + * 内容顺序 从1开始 + */ + private Integer orderNum; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLeaderboardResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLeaderboardResultDTO.java new file mode 100644 index 0000000000..d3d50da078 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLeaderboardResultDTO.java @@ -0,0 +1,60 @@ +/** + * 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.epmet.dto.result.resi; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 爱心榜 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ResiLeaderboardResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 微信昵称 + */ + private String nickname; + + /** + * 微信头像 + */ + private String headImg; + + /** + * 是否是志愿者(true:是志愿者,false: 不是志愿者) + */ + private Boolean volunteerFlag; + + /** + * 爱心时长(单位:小时) + */ + private Integer kindnessTime; + + /** + * 参加次数 + */ + private Integer participationNum; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java new file mode 100644 index 0000000000..96663f3503 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -0,0 +1,32 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.feign.fallback.EpmetUserFeignClientFallBack; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; + + +/** + * 用户模块 + * + * @author zhangyong + * @date 2020/7/22 14:51 + */ +@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallBack.class) +public interface EpmetUserFeignClient { + + /** + * @param userIds + * @return com.epmet.commons.tools.utils.Result> + * @author zhangyong + * @description 传入用户id集合,返回用户的基本信息(包含微信基本信息) + * @Date 2020/7/22 9:30 + **/ + @PostMapping("epmetuser/userbaseinfo/queryuserbaseinfo") + Result> heartQueryUserBaseInfo(@RequestBody List userIds); +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java new file mode 100644 index 0000000000..656c446b05 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java @@ -0,0 +1,25 @@ +package com.epmet.feign.fallback; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.UserWechatDTO; +import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.feign.EpmetUserFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + + +/** + * @author zhangyong + * @date 2020/7/22 14:51 + */ +@Component +public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { + + @Override + public Result> heartQueryUserBaseInfo(List userIds) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "heartQueryUserBaseInfo", userIds); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java index 235dbca23b..478bcfaa58 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java @@ -5,7 +5,7 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.resi.*; import com.epmet.dto.result.resi.*; -import com.epmet.service.ActInfoService; +import com.epmet.service.*; import com.epmet.commons.tools.utils.Result; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.*; import java.util.List; /** - * 居民端-活动列表相关api + * 居民端-活动相关api * * @author yinzuomei@elink-cn.com * @date 2020/7/19 23:17 @@ -25,6 +25,18 @@ public class ResiActListController { @Autowired private ActInfoService actInfoService; + @Autowired + private ActUserRelationService actUserRelationService; + + @Autowired + private ActSummaryService actSummaryService; + + @Autowired + private ActLiveRecService actLiveRecService; + + @Autowired + private HeartUserInfoService heartUserInfoService; + /** * 活动列表(包含状态:报名中:signing_up;已报满:enough;截止报名: end_sign_up; 已开始: in_progress; 已结束:finished;) * @@ -135,6 +147,64 @@ public class ResiActListController { return actInfoService.actLookBack(formDto); } + // + + /** + * 活动详情 + * + * @param tokenDto + * @param formDto + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 13:39 2020-07-21 + **/ + @PostMapping("detail") + public Result detail(@LoginUser TokenDto tokenDto, @RequestBody ResiActDetailFormDTO formDto) { + return actInfoService.actDetail(tokenDto, formDto); + } + + /** + * 活动详情-未通过 + * + * @param tokenDto + * @param formDto + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 13:39 2020-07-21 + **/ + @PostMapping("rejectdetail") + public Result rejectDetail(@LoginUser TokenDto tokenDto, @RequestBody ResiActDetailFormDTO formDto) { + return actInfoService.rejectDetail(tokenDto, formDto); + } + + /** + * 活动详情-已结束-回顾稿 + * + * @param formDto + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 13:39 2020-07-21 + **/ + @PostMapping("summary/list") + public Result summaryList(@RequestBody ResiActContentFormDTO formDto) { + return actSummaryService.summaryList(formDto); + } + + /** + * 活动详情-已结束-现场实况列表 + * + * @param actId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 13:39 2020-07-21 + **/ + @PostMapping("livereclist") + public Result liveRecList(@RequestBody String actId) { + return actLiveRecService.liveRecList(actId); + } + + // + /** * 取消活动报名 * @@ -147,7 +217,7 @@ public class ResiActListController { @PostMapping("cancelsignup") public Result cancelSignUp(@LoginUser TokenDto tokenDto, @RequestBody ResiActUserCancelSignUpFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); - return actInfoService.cancelSignUp(tokenDto, formDTO); + return actUserRelationService.cancelSignUp(tokenDto, formDTO); } /** @@ -165,4 +235,20 @@ public class ResiActListController { return actInfoService.checkSignInAddress(formDTO); } + /** + * 爱心榜 + * 显示报名参加过活动的用户/志愿者 + * 排序规则:按照爱心时长一致,按照参加次数排序 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 17:42 2020-07-22 + **/ + @PostMapping("leaderboard") + public Result> leaderboard(@RequestBody ResiActBaseFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return heartUserInfoService.leaderboard(formDTO); + } + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java new file mode 100644 index 0000000000..8d3508fce6 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java @@ -0,0 +1,40 @@ +/** + * 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.epmet.controller; + +import com.epmet.dao.VolunteerInfoDao; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 居民端-志愿者相关api + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@RestController +@RequestMapping("/resi/volunteer") +public class ResiVolunteerController { + + @Autowired + private VolunteerInfoDao volunteerInfoDao; + + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java index dfe34da353..1d4cf03f8b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java @@ -20,6 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.ActInfoDTO; import com.epmet.dto.form.resi.ResiActBaseFormDTO; +import com.epmet.dto.form.resi.ResiActDetailFormDTO; import com.epmet.dto.form.resi.ResiLatestActFormDTO; import com.epmet.dto.form.resi.ResiMyActFormDTO; import com.epmet.dto.result.resi.*; @@ -184,4 +185,34 @@ public interface ActInfoDao extends BaseDao { * @Date 2020/7/22 17:08 **/ ActSignUpStatResultDTO getActSignUpStat(String actId); + + /** + * 活动详情 + * + * @param formDto + * @return com.epmet.dto.result.resi.ResiActDetailResultDTO + * @Author zhangyong + * @Date 09:20 2020-07-22 + **/ + ResiActDetailResultDTO selectActInfoDetail(ResiActDetailFormDTO formDto); + + /** + * 活动详情-未通过 + * + * @param formDto + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 13:39 2020-07-21 + **/ + ResiActRefusedDetailResultDTO selectActRejectDetail(ResiActDetailFormDTO formDto); + + /** + * 从活动内容表,查询活动内容 + * + * @param actId + * @return java.util.List + * @Author zhangyong + * @Date 09:56 2020-07-22 + **/ + List selectListActContent(@Param("actId") String actId); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActLiveRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActLiveRecDao.java index dec7d0055b..61d04aa888 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActLiveRecDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActLiveRecDao.java @@ -18,8 +18,14 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.ActLivePicDTO; +import com.epmet.dto.ActLiveRecDTO; +import com.epmet.dto.form.resi.ResiActContentFormDTO; import com.epmet.entity.ActLiveRecEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 活动实况记录 @@ -29,5 +35,24 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ActLiveRecDao extends BaseDao { - -} \ No newline at end of file + + /** + * 根据活动id,查询活动下的所有活动实况 + * + * @param actId + * @return java.util.List + * @Author zhangyong + * @Date 16:27 2020-07-22 + **/ + List selectListActLives(@Param("actId") String actId); + + /** + * 根据实况id,查询每条实况对应的多张图片 + * + * @param liveIds + * @return java.util.List + * @Author zhangyong + * @Date 17:04 2020-07-22 + **/ + List selectListActLiveImg(@Param("liveId") List liveIds); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSummaryDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSummaryDao.java index 9ebc0e3fed..cb4993d0b0 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSummaryDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSummaryDao.java @@ -18,6 +18,8 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.resi.ResiActContentFormDTO; +import com.epmet.dto.result.resi.ResiActSummaryResultDTO; import com.epmet.entity.ActSummaryEntity; import org.apache.ibatis.annotations.Mapper; @@ -29,5 +31,14 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ActSummaryDao extends BaseDao { - -} \ No newline at end of file + + /** + * 活动详情-已结束-回顾稿 + * + * @param formDto + * @return com.epmet.dto.result.resi.ResiActSummaryResultDTO + * @Author zhangyong + * @Date 15:11 2020-07-22 + **/ + ResiActSummaryResultDTO selectListSummary(ResiActContentFormDTO formDto); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java index facb735601..ccc5981b5a 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java @@ -61,4 +61,24 @@ public interface ActUserRelationDao extends BaseDao { * @Date 2020/7/22 18:20 **/ Integer selectCountUser(@Param("actId") String actId, @Param("status")String status); -} \ No newline at end of file + + /** + * 根据活动id,查询活动已报名的人数 + * + * @param actId + * @return Integer + * @Author zhangyong + * @Date 10:51 2020-07-22 + **/ + Integer selectActSignupNum(@Param("actId") String actId); + + /** + * 将用户与活动的状态修改为 已取消 + * + * @param userRelationDTO + * @return void + * @Author zhangyong + * @Date 14:39 2020-07-22 + **/ + void updateUserStatusToCanceld(ActUserRelationDTO userRelationDTO); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java index 8ec5974ac9..4a22ba2ce6 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java @@ -19,8 +19,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.HeartUserInfoDTO; +import com.epmet.dto.form.resi.ResiActBaseFormDTO; import com.epmet.entity.HeartUserInfoEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 用户信息 @@ -39,4 +43,27 @@ public interface HeartUserInfoDao extends BaseDao { * @Date 2020/7/21 22:48 **/ HeartUserInfoDTO selectByUserId(String userId); -} \ No newline at end of file + + + /** + * 查询用户是否是志愿者:1是志愿者,0不是志愿者 + * + * @param userId + * @return java.lang.Integer + * @Author zhangyong + * @Date 13:53 2020-07-22 + **/ + Integer selectUserVolunteerFlag(@Param("userId") String userId); + + /** + * 爱心榜 + * 显示报名参加过活动的用户/志愿者 + * 排序规则:按照爱心时长一致,按照参加次数排序 + * + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 18:06 2020-07-22 + **/ + List selectListLeaderboard(ResiActBaseFormDTO formDTO); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java index 32c0978916..ec70e7e44b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java @@ -192,13 +192,24 @@ public interface ActInfoService extends BaseService { Result> actLookBack(ResiActBaseFormDTO formDTO); /** - * 取消活动报名 + * 活动详情 * * @param tokenDto - * @param formDTO - * @return com.epmet.commons.tools.utils.Result + * @param formDto + * @return com.epmet.commons.tools.utils.Result * @Author zhangyong - * @Date 09:29 2020-07-20 + * @Date 13:39 2020-07-21 + **/ + Result actDetail(TokenDto tokenDto, ResiActDetailFormDTO formDto); + + /** + * 活动详情-未通过 + * + * @param tokenDto + * @param formDto + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 13:39 2020-07-21 **/ - Result cancelSignUp(TokenDto tokenDto, ResiActUserCancelSignUpFormDTO formDTO); + Result rejectDetail(TokenDto tokenDto, ResiActDetailFormDTO formDto); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java index aa89cb830a..a0b32263c4 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java @@ -19,7 +19,10 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; import com.epmet.dto.ActLiveRecDTO; +import com.epmet.dto.form.resi.ResiActContentFormDTO; +import com.epmet.dto.result.resi.ResiActLiveRecResultDTO; import com.epmet.entity.ActLiveRecEntity; import java.util.List; @@ -92,4 +95,14 @@ public interface ActLiveRecService extends BaseService { * @date 2020-07-19 */ void delete(String[] ids); -} \ No newline at end of file + + /** + * 活动详情-已结束-现场实况列表 + * + * @param actId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 13:39 2020-07-21 + **/ + Result liveRecList(String actId); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSummaryService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSummaryService.java index 6cc0b1e450..863626d44f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSummaryService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSummaryService.java @@ -19,7 +19,10 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; import com.epmet.dto.ActSummaryDTO; +import com.epmet.dto.form.resi.ResiActContentFormDTO; +import com.epmet.dto.result.resi.ResiActSummaryResultDTO; import com.epmet.entity.ActSummaryEntity; import java.util.List; @@ -92,4 +95,14 @@ public interface ActSummaryService extends BaseService { * @date 2020-07-19 */ void delete(String[] ids); -} \ No newline at end of file + + /** + * 活动详情-已结束-回顾稿 + * + * @param formDto + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 13:39 2020-07-21 + **/ + Result summaryList(ResiActContentFormDTO formDto); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java index a93a4936cd..17d7d0c93b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java @@ -19,7 +19,10 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; import com.epmet.dto.ActUserRelationDTO; +import com.epmet.dto.form.resi.ResiActUserCancelSignUpFormDTO; import com.epmet.entity.ActUserRelationEntity; import org.apache.ibatis.annotations.Param; @@ -123,4 +126,16 @@ public interface ActUserRelationService extends BaseService { * @Date 2020/7/21 22:48 **/ HeartUserInfoDTO getByUserId(String userId); -} \ No newline at end of file + + + /** + * 爱心榜 + * 显示报名参加过活动的用户/志愿者 + * 排序规则:按照爱心时长一致,按照参加次数排序 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 17:42 2020-07-22 + **/ + Result> leaderboard(ResiActBaseFormDTO formDTO); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java index a1b23bed6b..550e13d878 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java @@ -29,23 +29,26 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.ActInfoDao; +import com.epmet.dao.ActUserRelationDao; +import com.epmet.dao.HeartUserInfoDao; +import com.epmet.dao.VolunteerInfoDao; import com.epmet.dto.ActInfoDTO; import com.epmet.dto.form.resi.*; import com.epmet.dto.result.resi.*; import com.epmet.entity.ActInfoEntity; +import com.epmet.entity.ActUserRelationEntity; import com.epmet.redis.ActInfoRedis; import com.epmet.service.ActInfoService; import com.epmet.service.ActUserRelationService; +import com.epmet.utils.ActUserRelationStatusConstant; +import com.epmet.utils.ActUserStatusConstant; import com.epmet.utils.CaculateDistance; 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; +import java.util.*; /** * 活动信息 @@ -62,6 +65,12 @@ public class ActInfoServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -189,17 +198,165 @@ public class ActInfoServiceImpl extends BaseServiceImpl actDetail(TokenDto tokenDto, ResiActDetailFormDTO formDto) { + formDto.setUserId(tokenDto.getUserId()); + // 从活动表查询活动信息 + ResiActDetailResultDTO detailResultDTO = baseDao.selectActInfoDetail(formDto); + // 获取活动内容 + detailResultDTO.setActContent(baseDao.selectListActContent(formDto.getActId())); + // 查询用户是否是志愿者 + Integer volunteerFlag = heartUserInfoDao.selectUserVolunteerFlag(formDto.getUserId()); + detailResultDTO.setUserVolunteerFlag(volunteerFlag == 1); + + // 获取用户报名状态 + String currentUserStatus = getCurrentUserStatus(formDto.getActId(), formDto.getUserId()); + detailResultDTO.setCurrentUserStatus(currentUserStatus); + return new Result().ok(detailResultDTO); + } + + /** + * 返回当前活动下,用户状态: + * (sign_up-我要报名,canceld-取消报名,enough-已报满,end_sign_up-截止报名,in_progress-已开始; finished-已结束,canceled-已取消) + * + * @param actId 活动id + * @param userId 用户id + * @return java.lang.String + * @Author zhangyong + * @Date 2020/7/22 10:54 + **/ + private String getCurrentUserStatus(String actId, String userId) { + Date currentTime = new Date(); + ActInfoEntity actInfoEntity =baseDao.selectById(actId); + // 活动已取消 + if (ActUserStatusConstant.CANCELED.equals(actInfoEntity.getActStatus())) { + return ActUserStatusConstant.CANCELED; + } + // 活动已经结束 + if (ActUserStatusConstant.FINISHED.equals(actInfoEntity.getActStatus())) { + 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); + // 查询活动已报名的人数 + Integer signUpNum = actUserRelationDao.selectActSignupNum(actId); + + if (null == actUserRelationEntity) { + return getCurrentUserStatusNotSignUp(actInfoEntity, signUpNum, currentTime); + } else { + return getCurrentUserStatusHasSignUp(actInfoEntity, actUserRelationEntity, signUpNum, currentTime); + } + } + + /** + * 用户未报名活动时,判断用户活动状态 + * + * @param actInfoEntity 当前活动 + * @param signUpNum 活动报名人数 + * @param currentTime 当前时间 + * @return java.lang.String + * @author zhangyong + * @date 2020/7/22 10:54 + */ + private String getCurrentUserStatusNotSignUp(ActInfoEntity actInfoEntity, Integer signUpNum, Date currentTime) { + if (currentTime.before(actInfoEntity.getSignUpEndTime())) { + /*报名结束前*/ + if (Boolean.FALSE.equals(actInfoEntity.getActQuotaCategory()) || actInfoEntity.getActQuota() > signUpNum) { + // 我要报名(不限名额或者未报满的) + return ActUserStatusConstant.SIGN_UP; + } else { + // 已报满(限制名额且已经报满的) + return ActUserStatusConstant.ENOUGH; + } + } else if (currentTime.after(actInfoEntity.getSignUpEndTime()) && currentTime.before(actInfoEntity.getActStartTime())) { + /*报名结束,活动未开始:显示:截止报名*/ + return ActUserStatusConstant.END_SIGN_UP; + } else if (currentTime.after(actInfoEntity.getSignInStartTime()) && currentTime.before(actInfoEntity.getSignInEndTime())) { + // 活动打卡时间段内: 显示:已开始 + return ActUserStatusConstant.IN_PROGRESS; + } else { + return ActUserStatusConstant.FINISHED; + } + } + + /** + * 用户已报名活动时,判断用户活动状态 + * + * @param actInfoEntity 当前活动 + * @param actUserRelationEntity 用户活动关系 + * @param signUpNum 活动报名人数 + * @param currentTime 当前时间 + * @return java.lang.String + * @author zhangyong + * @date 2020/7/22 17:11 + */ + private String getCurrentUserStatusHasSignUp(ActInfoEntity actInfoEntity, ActUserRelationEntity actUserRelationEntity, Integer signUpNum, Date currentTime) { + String actUserStatus = actUserRelationEntity.getStatus(); + + // 已确认过积分,直接返回 + if (ActUserRelationStatusConstant.AGREE.equals(actUserRelationEntity.getRewardFlag()) + || ActUserRelationStatusConstant.DENY.equals(actUserRelationEntity.getRewardFlag())) { + return ActUserStatusConstant.POINTS_CONFIRM; + } + + if (currentTime.after(actInfoEntity.getActEndTime()) && currentTime.before(actInfoEntity.getSignInEndTime())) { + /*活动结束;打卡未截止*/ + // (未审核的、审核未通过、取消报名的)- 已结束 + if (ActUserRelationStatusConstant.AUDITING.equals(actUserStatus) + || ActUserRelationStatusConstant.REFUSED.equals(actUserStatus) + || ActUserRelationStatusConstant.CANCELD.equals(actUserStatus)) { + return ActUserStatusConstant.FINISHED; + } + } else if (currentTime.after(actInfoEntity.getSignInStartTime()) && currentTime.before(actInfoEntity.getSignInEndTime())) { + /* 活动打卡时间段内 */ + + // (未审核的、审核未通过、取消报名的)- 已开始 + if (ActUserRelationStatusConstant.AUDITING.equals(actUserStatus) + || ActUserRelationStatusConstant.REFUSED.equals(actUserStatus) + || ActUserRelationStatusConstant.CANCELD.equals(actUserStatus)) { + return ActUserStatusConstant.IN_PROGRESS; + } + } else if (currentTime.before(actInfoEntity.getSignUpEndTime())) { + /* 报名截至时间前 */ + //(未审核、审核通过的)底部显示按钮 取消报名 + if (ActUserRelationStatusConstant.AUDITING.equals(actUserStatus) || ActUserRelationStatusConstant.PASSED.equals(actUserStatus)) { + return ActUserStatusConstant.CANCELD; + } + // 活动限制名额,且报名人数已满 已报满 + if (Boolean.FALSE.equals(actInfoEntity.getActQuotaCategory()) && signUpNum >= actInfoEntity.getActQuota()) { + return ActUserStatusConstant.ENOUGH; + } + // (报名审核未通过或者已经取消报名的)可再次报名-我要报名 + if (ActUserRelationStatusConstant.REFUSED.equals(actUserStatus) || ActUserRelationStatusConstant.CANCELD.equals(actUserStatus)) { + return ActUserStatusConstant.SIGN_UP; + } + } else if (currentTime.after(actInfoEntity.getSignUpEndTime()) && currentTime.before(actInfoEntity.getActStartTime())) { + /* 报名截止但 活动未开始 */ + // 已经取消报名的-报名截止 + if (ActUserRelationStatusConstant.CANCELD.equals(actUserStatus)) { + return ActUserStatusConstant.END_SIGN_UP; + } + // 已报名审核不通过 -报名截止 + if (ActUserRelationStatusConstant.REFUSED.equals(actUserStatus)) { + return ActUserStatusConstant.END_SIGN_UP; + } + // 已报名且审核通过、未审核 -取消报名 + if (ActUserRelationStatusConstant.PASSED.equals(actUserStatus) || ActUserRelationStatusConstant.AUDITING.equals(actUserStatus)) { + return ActUserStatusConstant.CANCELD; + } + } + return ActUserStatusConstant.FINISHED; + } + + @Override + public Result rejectDetail(TokenDto tokenDto, ResiActDetailFormDTO formDto) { + formDto.setUserId(tokenDto.getUserId()); + ResiActRefusedDetailResultDTO detail = baseDao.selectActRejectDetail(formDto); + return new Result().ok(detail); } @Override @@ -207,11 +364,10 @@ public class ActInfoServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -101,4 +108,40 @@ public class ActLiveRecServiceImpl extends BaseServiceImpl liveRecList(String actId) { + // 查询实况记录 + List actLives = baseDao.selectListActLives(actId); + List userIds = new ArrayList<>(); + List liveIds = new ArrayList<>(); + for (ActLiveRecDTO actLive : actLives){ + userIds.add(actLive.getUserId()); + liveIds.add(actLive.getId()); + } + // 查询用户微信基础信息 + Result> userWxInfos = epmetUserFeignClient.heartQueryUserBaseInfo(userIds); + // 根据活动实况id,查询对应实况的图片集合 + List actLiveImg = baseDao.selectListActLiveImg(liveIds); + // 数据汇总 + ResiActLiveRecResultDTO resultDto = new ResiActLiveRecResultDTO(); + List dataContainer = new ArrayList<>(); + for (int k = 0; k < actLives.size(); k++) { + Map map = new HashMap<>(); + map.put("nickname", userWxInfos.getData().get(k).getNickname()); + map.put("headImg", userWxInfos.getData().get(k).getHeadImgUrl()); + map.put("desc", actLives.get(k).getDesc()); + map.put("createdTime", actLives.get(k).getCreatedTime()); + // 查询打卡对应图片 + List imgUrlList = new ArrayList<>(); + for (ActLivePicDTO urlDto : actLiveImg) { + if (actLives.get(k).getId().equals(urlDto.getLiveId())) { + imgUrlList.add(urlDto.getPicUrl()); + } + } + map.put("images", imgUrlList); + dataContainer.add(map); + } + return new Result().ok(resultDto); + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSummaryServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSummaryServiceImpl.java index 4bb9ad328f..d3f9087afc 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSummaryServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSummaryServiceImpl.java @@ -20,11 +20,15 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.Result; import com.epmet.dao.ActSummaryDao; import com.epmet.dto.ActSummaryDTO; +import com.epmet.dto.form.resi.ResiActContentFormDTO; +import com.epmet.dto.result.resi.ResiActSummaryResultDTO; import com.epmet.entity.ActSummaryEntity; import com.epmet.redis.ActSummaryRedis; import com.epmet.service.ActSummaryService; @@ -101,4 +105,11 @@ public class ActSummaryServiceImpl extends BaseServiceImpl summaryList(ResiActContentFormDTO formDto) { + int pageIndex = (formDto.getPageNo() - NumConstant.ONE) * formDto.getPageSize(); + formDto.setPageNo(pageIndex); + return new Result().ok(baseDao.selectListSummary(formDto)); + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java index 06cb2f96ed..cfea34e14e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java @@ -21,13 +21,19 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.Result; import com.epmet.dao.ActUserRelationDao; +import com.epmet.dto.ActUserLogDTO; import com.epmet.dto.ActUserRelationDTO; +import com.epmet.dto.form.resi.ResiActUserCancelSignUpFormDTO; import com.epmet.entity.ActUserRelationEntity; import com.epmet.redis.ActUserRelationRedis; +import com.epmet.service.ActUserLogService; import com.epmet.service.ActUserRelationService; +import com.epmet.utils.ActUserRelationStatusConstant; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -48,6 +54,8 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl page(Map params) { @@ -140,5 +148,24 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl page(Map params) { @@ -113,4 +122,32 @@ public class HeartUserInfoServiceImpl extends BaseServiceImpl> leaderboard(ResiActBaseFormDTO formDTO) { + // 获取排好序的 排行榜 + List leaderboardList = baseDao.selectListLeaderboard(formDTO); + // 根据用户ID获取微信昵称、头像 + List userIds = new ArrayList<>(); + for (HeartUserInfoDTO list : leaderboardList){ + userIds.add(list.getUserId()); + } + // 查询用户微信基础信息 + Result> userWxInfos = epmetUserFeignClient.heartQueryUserBaseInfo(userIds); + + List resultDTOS = new ArrayList<>(); + for (HeartUserInfoDTO list : leaderboardList){ + ResiLeaderboardResultDTO dto = new ResiLeaderboardResultDTO(); + dto.setKindnessTime(list.getKindnessTime()); + dto.setVolunteerFlag(list.getVolunteerFlag()); + dto.setParticipationNum(list.getParticipationNum()); + List wxInfo = userWxInfos.getData(); + for (UserBaseInfoResultDTO wx : wxInfo){ + if (list.getUserId().equals(wx.getUserId())){ + dto.setHeadImg(wx.getHeadImgUrl()); + dto.setNickname(wx.getNickname()); + } + } + } + return new Result>().ok(resultDTOS); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ActUserRelationStatusConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ActUserRelationStatusConstant.java new file mode 100644 index 0000000000..dcde4657a7 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ActUserRelationStatusConstant.java @@ -0,0 +1,38 @@ +package com.epmet.utils; + +/** + * @Description 用户活动关系表当前状态 + * @Auther: zhangyong + * @Date: 2020-07-21 17:36 + */ +public interface ActUserRelationStatusConstant { + /** + * 已报名/待审核 + */ + String AUDITING="auditing"; + + /** + * 审核通过 + */ + String PASSED="passed"; + + /** + * 审核不通过 + */ + String REFUSED = "refused"; + + /** + * 取消报名 + */ + String CANCELD = "canceld"; + + /** + * 给积分 + */ + String AGREE = "agree"; + + /** + * 不给积分 + */ + String DENY = "deny"; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ActUserStatusConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ActUserStatusConstant.java new file mode 100644 index 0000000000..7d2334a9b0 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ActUserStatusConstant.java @@ -0,0 +1,49 @@ +package com.epmet.utils; + +/** + * 用户当前状态(sign_up-我要报名,canceld-取消报名,enough-已报满,end_sign_up-截止报名,in_progress-已开始; finished-已结束,canceled-已取消,points_confirm-已确认积分) + * @Auther: zhangyong + * @Date: 2020-07-21 17:36 + */ +public interface ActUserStatusConstant { + + /** + * 我要报名 + */ + String SIGN_UP = "sign_up"; + + /** + * 取消报名 + */ + String CANCELD = "canceld"; + + /** + * 已报满 + */ + String ENOUGH = "enough"; + + /** + * 截止报名 + */ + String END_SIGN_UP = "end_sign_up"; + + /** + * 已开始 + */ + String IN_PROGRESS = "in_progress"; + + /** + * 已结束 + */ + String FINISHED = "finished"; + + /** + * 已取消 + */ + String CANCELED = "canceled"; + + /** + * 已确认积分 + */ + String POINTS_CONFIRM = "points_confirm"; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ValidityVerification.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ValidityVerification.java new file mode 100644 index 0000000000..2b56bdc176 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ValidityVerification.java @@ -0,0 +1,90 @@ +package com.epmet.utils; + +import com.alibaba.nacos.client.utils.StringUtils; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.scan.param.ImgScanParamDTO; +import com.epmet.commons.tools.scan.param.ImgTaskDTO; +import com.epmet.commons.tools.scan.param.TextScanParamDTO; +import com.epmet.commons.tools.scan.param.TextTaskDTO; +import com.epmet.commons.tools.scan.result.SyncScanResult; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.ScanContentUtils; +import org.springframework.beans.factory.annotation.Value; +import lombok.extern.slf4j.Slf4j; + +import java.util.List; +import java.util.UUID; + +/** + * 文字、图片合法性校验 + * + * @author zhangyong + * @date 2020-07-15 14:26 + */ +@Slf4j +public class ValidityVerification { + + @Value("${openapi.scan.server.url}") + private String scanApiUrl; + @Value("${openapi.scan.method.textSyncScan}") + private String textSyncScanMethod; + @Value("${openapi.scan.method.imgSyncScan}") + private String imgSyncScanMethod; + + /** + * 文本校验 + * @param context 被校验的文本,,不能超过10000 + * @param businessEnum 业务枚举,定义校验失败后,输出的日志信息 + * @return void + * @auther zhangyong + * @Date 14:42 2020-07-15 + **/ + public void textScanVerification(String context, String businessEnum){ + if (StringUtils.isNotBlank(context)) { + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setContent(context); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + // 业务枚举:例如:评论话题失败,评论内容为:%s" + log.error(String.format(businessEnum, context)); + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } + } + } + + /** + * 图片列表校验 + * @param imgList 被校验的图片列表 + * @return void + * @auther zhangyong + * @Date 14:42 2020-07-15 + **/ + public void imgScanVerification(List imgList){ + if (NumConstant.ZERO != imgList.size()){ + ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO(); + imgList.forEach(url -> { + ImgTaskDTO task = new ImgTaskDTO(); + task.setDataId(UUID.randomUUID().toString().replace("-", "")); + task.setUrl(url); + imgScanParamDTO.getTasks().add(task); + }); + Result imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO); + if (!imgScanResult.success()){ + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!imgScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.IMG_SCAN_FAILED.getCode()); + } + } + } + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml index 3f9eb4a072..4b50ae3bd4 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml @@ -375,4 +375,73 @@ ai.DEL_FLAG = '0' AND ai.id =#{actId} + + + + + + + + + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLiveRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLiveRecDao.xml index 6ebfea5ed7..6e0281baf5 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLiveRecDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLiveRecDao.xml @@ -19,5 +19,33 @@ + + - \ No newline at end of file + + + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSummaryDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSummaryDao.xml index f71666b3c1..6ff1b956d0 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSummaryDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSummaryDao.xml @@ -17,5 +17,18 @@ - - \ No newline at end of file + + + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml index f7531ff65a..0cd324f25c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml @@ -61,4 +61,26 @@ AND aur.`STATUS` =#{status} AND aur.ACT_ID = #{actId} - \ No newline at end of file + + + + + + UPDATE act_user_relation + SET + STATUS = #{status}, + CANCEL_TIME = NOW(), + CANCEL_REASON = #{cancelReason} + WHERE + DEL_FLAG = '0' + AND ACT_ID = #{actId} + AND USER_ID = #{userId} + + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml index 341370c3f7..1c4fdba03f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml @@ -29,4 +29,30 @@ hui.DEL_FLAG = '0' AND hui.USER_ID =#{userId} - \ No newline at end of file + + + + + + + From 05cac1ea4f065bd4f6121c74877cd2a2edbe1f8b Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 23 Jul 2020 09:58:26 +0800 Subject: [PATCH 39/98] =?UTF-8?q?=E7=A7=AF=E5=88=86=E8=A7=84=E5=88=99?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/constant/StrConstant.java | 5 + .../tools/enums/CommonOperateTypeEnum.java | 42 ++++ .../main/java/com/epmet/dto/PointRuleDTO.java | 126 ----------- .../epmet/dto/form/PointDetailFormDTO.java | 21 ++ .../com/epmet/dto/form/PointRuleFormDTO.java | 71 +++++++ .../epmet/dto/form/PointRuleListFormDTO.java | 23 ++ .../dto/result/CustomerFunctionResultDTO.java | 18 ++ .../dto/result/PointDetailResultDTO.java | 24 +++ .../epmet/dto/result/PointRuleResultDTO.java | 23 ++ .../epmet-point/epmet-point-server/pom.xml | 12 ++ .../com/epmet/common/enu/PointUnitEnum.java | 42 ++++ .../com/epmet/common/enu/SysResponseEnum.java | 43 ++++ .../epmet/controller/BackDoorController.java | 40 ++++ .../epmet/controller/PointRuleController.java | 100 +++++++++ .../main/java/com/epmet/dao/PointRuleDao.java | 23 +- ...rateLogDao.java => RuleOperateLogDao.java} | 4 +- .../com/epmet/entity/PointRuleEntity.java | 32 ++- ...gEntity.java => RuleOperateLogEntity.java} | 14 +- .../com/epmet/service/PointRuleService.java | 76 ++----- .../epmet/service/SysOperateLogService.java | 4 +- .../service/impl/PointRuleServiceImpl.java | 199 ++++++++++++------ .../impl/SysOperateLogServiceImpl.java | 22 +- .../resources/db/migration/epmet_point.sql | 52 ++--- .../main/resources/mapper/PointRuleDao.xml | 19 +- ...perateLogDao.xml => RuleOperateLogDao.xml} | 4 +- .../feign/OperCustomizeOpenFeignClient.java | 10 +- .../OperCustomizeOpenFeignClientFallback.java | 18 +- .../CustomerFunctionController.java | 6 +- .../service/CustomerFunctionService.java | 2 +- .../impl/CustomerFunctionServiceImpl.java | 41 +++- 30 files changed, 788 insertions(+), 328 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CommonOperateTypeEnum.java delete mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointRuleDTO.java create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointDetailFormDTO.java create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointRuleFormDTO.java create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointRuleListFormDTO.java create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/CustomerFunctionResultDTO.java create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointDetailResultDTO.java create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointRuleResultDTO.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/PointUnitEnum.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/SysResponseEnum.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/BackDoorController.java create mode 100644 epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointRuleController.java rename epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/{SysOperateLogDao.java => RuleOperateLogDao.java} (88%) rename epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/{SysOperateLogEntity.java => RuleOperateLogEntity.java} (88%) rename epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/{SysOperateLogDao.xml => RuleOperateLogDao.xml} (87%) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java index b4a81ce53a..a7ae559a01 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java @@ -48,4 +48,9 @@ public interface StrConstant { * 中文顿号 */ String COMMA_ZH = "、"; + + /** + * 反斜杠 + */ + String SEPARATOR = "/"; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CommonOperateTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CommonOperateTypeEnum.java new file mode 100644 index 0000000000..1dc0b571c5 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CommonOperateTypeEnum.java @@ -0,0 +1,42 @@ +package com.epmet.commons.tools.enums; + +/** + * 通用操作类型 枚举类 + * dev|test|prod + * + * @author jianjun liu + * @date 2020-07-03 11:14 + **/ +public enum CommonOperateTypeEnum { + ADD("add", "添加"), + EDIT("edit", "编辑"), + DEL("del", "删除"), + ; + + private String code; + private String desc; + + + CommonOperateTypeEnum(String code, String name) { + this.code = code; + this.desc = name; + } + + public static CommonOperateTypeEnum getEnum(String code) { + CommonOperateTypeEnum[] values = CommonOperateTypeEnum.values(); + for (CommonOperateTypeEnum value : values) { + if (code != null && value.getCode().equals(code)) { + return value; + } + } + return null; + } + + public String getCode() { + return code; + } + + public String getDesc() { + return desc; + } +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointRuleDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointRuleDTO.java deleted file mode 100644 index 25251dd36a..0000000000 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointRuleDTO.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * 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.epmet.dto; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - - -/** - * 积分规则表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-07-20 - */ -@Data -public class PointRuleDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 主键 - */ - private String id; - - /** - * 客户ID - */ - private String customerId; - - /** - * 规则名称 与事件名称保持一致即可 - */ - private String ruleName; - - /** - * 规则说明 事件说明 - */ - private String ruleDesc; - - /** - * 事件CODE 来自事件表 - */ - private String eventCode; - - /** - * 事件名称 来自事件表 - */ - private String eventName; - - /** - * 操作类型 加积分:add;减积分:subtract - */ - private String operateType; - - /** - * 积分上限 - */ - private Integer upLimit; - - /** - * 积分上限描述 - */ - private String upLimitDesc; - - /** - * 获得积分值 - */ - private Integer pointNum; - - /** - * 获得积分单位 次:time;分钟:minute;小时:hour - */ - private String pointUnit; - - /** - * 是否启用 0-否,1-是 - */ - private String enabledFlag; - - /** - * 删除标识 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/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointDetailFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointDetailFormDTO.java new file mode 100644 index 0000000000..d8a7fee9cb --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointDetailFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** +* desc:积分规则Id详情获取 规则列表 + * @author jianjun liu + * @date 2020-07-22 15:28 + **/ +@Data +public class PointDetailFormDTO implements Serializable { + private static final long serialVersionUID = 7587939716742608164L; + /** + * 积分规则Id + */ + @NotBlank(message = "积分规则Id不能为空") + private String ruleId; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointRuleFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointRuleFormDTO.java new file mode 100644 index 0000000000..fca065c9d6 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointRuleFormDTO.java @@ -0,0 +1,71 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * desc:积分规则保存/修改 规则列表 + * + * @author jianjun liu + * @date 2020-07-22 15:28 + **/ +@Data +public class PointRuleFormDTO implements Serializable { + private static final long serialVersionUID = -3228252683629912008L; + /** + * 积分规则Id + */ + @NotBlank(message = "积分规则Id不能为空", groups = UpdateGroup.class) + private String ruleId; + /** + * 积分 + */ + @NotBlank(message = "积分不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private String point; + + /** + * 是否开启 + */ + @NotBlank(message = "是否开启不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private String enabledFlag; + /** + * 上限开启 + */ + @NotBlank(message = "积分上限不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private String upLimit; + + /** + * 积分规则Id + */ + @NotBlank(message = "客户Id不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private String customerId; + + //=======系统添加时的属性====== + /** + * 规则说明 事件说明 + */ + @NotBlank(message = "规则描述不能为空", groups = AddGroup.class) + private String ruleDesc; + + /** + * 事件CODE 来自事件表 + */ + @NotBlank(message = "事件code不能为空", groups = AddGroup.class) + private String eventCode; + + /** + * 操作类型 加积分:add;减积分:subtract + */ + @NotBlank(message = "操作类型不能为空", groups = AddGroup.class) + private String operateType; + /** + * 获得积分单位 次:time;分钟:minute;小时:hour + */ + @NotBlank(message = "积分单位不能为空", groups = AddGroup.class) + private String pointUnit; + +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointRuleListFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointRuleListFormDTO.java new file mode 100644 index 0000000000..93566a19b3 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointRuleListFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** +* desc:根据功能Id获取 规则列表 + * @author jianjun liu + * @date 2020-07-22 15:28 + **/ +@Data +public class PointRuleListFormDTO implements Serializable { + private static final long serialVersionUID = -1918653281170340608L; + /** + * 功能Id + */ + @NotBlank(message = "功能Id不能为空") + private String functionId; + @NotBlank(message = "客户Id不能为空") + private String customerId; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/CustomerFunctionResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/CustomerFunctionResultDTO.java new file mode 100644 index 0000000000..817b94d7c1 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/CustomerFunctionResultDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:积分规则-获取客户功能列表 result + * @author jianjun liu + * @date 2020-07-22 14:43 + **/ +@Data +public class CustomerFunctionResultDTO implements Serializable { + private static final long serialVersionUID = -3761765064811136295L; + + private String functionId; + private String functionName; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointDetailResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointDetailResultDTO.java new file mode 100644 index 0000000000..8ed856dc91 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointDetailResultDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:积分规则-详情 result + * @author jianjun liu + * @date 2020-07-22 14:43 + **/ +@Data +public class PointDetailResultDTO implements Serializable { + + private static final long serialVersionUID = 2426172750860788081L; + private String ruleId; + private String ruleName; + private String ruleDesc; + private Integer point; + private String pointUnit; + private String upLimit; + private String enabledFlag; + private String upLimitDesc; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointRuleResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointRuleResultDTO.java new file mode 100644 index 0000000000..bf8e546806 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointRuleResultDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:积分规则-列表 result + * @author jianjun liu + * @date 2020-07-22 14:43 + **/ +@Data +public class PointRuleResultDTO implements Serializable { + + private static final long serialVersionUID = -2327977101138032573L; + private String ruleId; + private String ruleName; + private String ruleDesc; + /** + * 拼接好的 积分值/单位 + */ + private String pointValue; +} diff --git a/epmet-module/epmet-point/epmet-point-server/pom.xml b/epmet-module/epmet-point/epmet-point-server/pom.xml index 49ccab5b90..a6eef46a98 100644 --- a/epmet-module/epmet-point/epmet-point-server/pom.xml +++ b/epmet-module/epmet-point/epmet-point-server/pom.xml @@ -69,6 +69,18 @@ 2.0.0 compile + + com.epmet + oper-customize-client + 2.0.0 + compile + + + com.epmet + epmet-user-client + 2.0.0 + compile + diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/PointUnitEnum.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/PointUnitEnum.java new file mode 100644 index 0000000000..ab1d97453c --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/PointUnitEnum.java @@ -0,0 +1,42 @@ +package com.epmet.common.enu; + +/** + * 系积分系统-积分单位枚举类 + * dev|test|prod + * + * @author jianjun liu + * @date 2020-07-03 11:14 + **/ +public enum PointUnitEnum { + TIME("time", "次"), + MINUTE("minute", "分种"), + HOUR("hour", "小时"), + ; + + private String code; + private String name; + + + PointUnitEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public static PointUnitEnum getEnum(String code) { + PointUnitEnum[] values = PointUnitEnum.values(); + for (PointUnitEnum value : values) { + if (code != null && value.getCode().equals(code)) { + return value; + } + } + return null; + } + + public String getCode() { + return code; + } + + public String getName() { + return name; + } +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/SysResponseEnum.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/SysResponseEnum.java new file mode 100644 index 0000000000..e7ff400906 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/SysResponseEnum.java @@ -0,0 +1,43 @@ +package com.epmet.common.enu; + +/** + * @author jianjun liu + * @date 2020-06-04 21:39 + **/ +public enum SysResponseEnum { + /** + * + * 业务代码枚举类 + * + * 编码样式:【CCCBBOOXX】 + * 编码示例说明: + * CCC 中心编码&业务系统 (112(与端口号一致)-积分系统服务) + * BB 业务类型(00-默认 ) + * OO 操作类型(00-默认) + * XX 具体编码(00-成功,01-失败,02-参数错误,10-异常 99-系统错误) + * + */ + /*通用枚举 */ + EXCEPTION(10001,"系统异常"), + + + /*积分规则 业务 01*/ + THIRD_SERVICE_ERROR(112010001,"调用第三方接口异常"), + POINT_RULE_IS_NOT_EXIST(112010002,"积分规则不存在"), + ; + + private Integer code; + private String msg; + SysResponseEnum(Integer code, String msg){ + this.code = code; + this.msg = msg; + } + + public Integer getCode() { + return code; + } + + public String getMsg() { + return msg; + } +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/BackDoorController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/BackDoorController.java new file mode 100644 index 0000000000..9d2b01d291 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/BackDoorController.java @@ -0,0 +1,40 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.dto.form.PointRuleFormDTO; +import com.epmet.service.PointRuleService; +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; + +/** + * @author jianjun liu + * @date 2020-06-04 20:39 + **/ +@RestController +@RequestMapping("opback") +public class BackDoorController { + @Autowired + private PointRuleService pointRuleService; + + /** + * desc:添加规则 + * + * @param formDTO + * @return + */ + @PostMapping(value = "sysadd") + public Result add(@RequestBody PointRuleFormDTO formDTO) { + TokenDto tokenDTO = new TokenDto(); + tokenDTO.setUserId("default"); + formDTO.setCustomerId(tokenDTO.getCustomerId()); + ValidatorUtils.validateEntity(formDTO, AddGroup.class); + pointRuleService.add(tokenDTO, formDTO); + return new Result().ok(true); + } +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointRuleController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointRuleController.java new file mode 100644 index 0000000000..a0c7f479dd --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointRuleController.java @@ -0,0 +1,100 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.form.PointDetailFormDTO; +import com.epmet.dto.form.PointRuleFormDTO; +import com.epmet.dto.form.PointRuleListFormDTO; +import com.epmet.dto.result.CustomerFunctionResultDTO; +import com.epmet.dto.result.PointDetailResultDTO; +import com.epmet.dto.result.PointRuleResultDTO; +import com.epmet.service.PointRuleService; +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.List; + +/** + * 积分规则controller + * + * @author jianjun liu + * @date 2020-07-22 14:39 + **/ +@RestController +@RequestMapping("rule") +public class PointRuleController { + @Autowired + private PointRuleService pointRuleService; + + /** + * desc:积分规则-获取客户有积分规则的功能列表 + * + * @param tokenDTO + * @return + */ + @PostMapping(value = "functionlist") + public Result> getFunctionList(@LoginUser TokenDto tokenDTO) { + return new Result>().ok(pointRuleService.getFunctionList(tokenDTO.getCustomerId())); + } + + /** + * desc:根据功能id获取积分规则 + * + * @param tokenDTO + * @param formDTO + * @return + */ + @PostMapping(value = "list") + public Result> list(@LoginUser TokenDto tokenDTO, @RequestBody PointRuleListFormDTO formDTO) { + formDTO.setCustomerId(tokenDTO.getCustomerId()); + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(pointRuleService.list(formDTO)); + } + + /** + * desc:根据规则id获取积分规则 + * + * @param formDTO + * @return + */ + @PostMapping(value = "detail") + public Result detail(@RequestBody PointDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(pointRuleService.detail(formDTO)); + } + + /** + * desc:根据功能id获取积分规则 + * + * @param formDTO + * @return + */ + @PostMapping(value = "update") + public Result update(@LoginUser TokenDto tokenDTO, @RequestBody PointRuleFormDTO formDTO) { + formDTO.setCustomerId(tokenDTO.getCustomerId()); + ValidatorUtils.validateEntity(formDTO, UpdateGroup.class); + pointRuleService.update(tokenDTO,formDTO); + return new Result().ok(true); + } + + /** + * desc:添加规则 + * + * @param formDTO + * @return + */ + @PostMapping(value = "add") + public Result add(@LoginUser TokenDto tokenDTO, @RequestBody PointRuleFormDTO formDTO) { + formDTO.setCustomerId(tokenDTO.getCustomerId()); + ValidatorUtils.validateEntity(formDTO, AddGroup.class); + pointRuleService.add(tokenDTO,formDTO); + return new Result().ok(true); + } +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDao.java index 3ab8e48b42..2c8f5a214a 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDao.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDao.java @@ -18,8 +18,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.PointRuleListFormDTO; import com.epmet.entity.PointRuleEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 积分规则表 @@ -29,5 +33,22 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface PointRuleDao extends BaseDao { - + + /** + * desc:获取该客户下有规则的功能Id + * + * @param customerId + * @return + */ + List selectFunctionIds(@Param("customerId") String customerId); + + /** + * desc:获取该客户下有规则的功能Id + * + * @param formDTO + * @return + */ + List selectListByFunctionId(PointRuleListFormDTO formDTO); + + int updateByCustomerId(PointRuleEntity entity); } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/SysOperateLogDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/RuleOperateLogDao.java similarity index 88% rename from epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/SysOperateLogDao.java rename to epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/RuleOperateLogDao.java index 2721c88716..a959af0219 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/SysOperateLogDao.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/RuleOperateLogDao.java @@ -18,7 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.SysOperateLogEntity; +import com.epmet.entity.RuleOperateLogEntity; import org.apache.ibatis.annotations.Mapper; /** @@ -28,6 +28,6 @@ import org.apache.ibatis.annotations.Mapper; * @since v1.0.0 2020-07-20 */ @Mapper -public interface SysOperateLogDao extends BaseDao { +public interface RuleOperateLogDao extends BaseDao { } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleEntity.java index affd55595e..c2132a4292 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleEntity.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleEntity.java @@ -18,12 +18,11 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; +import java.util.Objects; /** * 积分规则表 @@ -58,11 +57,6 @@ public class PointRuleEntity extends BaseEpmetEntity { */ private String eventCode; - /** - * 事件名称 来自事件表 - */ - private String eventName; - /** * 操作类型 加积分:add;减积分:subtract */ @@ -81,7 +75,7 @@ public class PointRuleEntity extends BaseEpmetEntity { /** * 获得积分值 */ - private Integer pointNum; + private Integer point; /** * 获得积分单位 次:time;分钟:minute;小时:hour @@ -93,4 +87,26 @@ public class PointRuleEntity extends BaseEpmetEntity { */ private String enabledFlag; + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + if (!super.equals(o)) return false; + PointRuleEntity entity = (PointRuleEntity) o; + return customerId.equals(entity.customerId) && + ruleName.equals(entity.ruleName) && + ruleDesc.equals(entity.ruleDesc) && + eventCode.equals(entity.eventCode) && + operateType.equals(entity.operateType) && + upLimit.equals(entity.upLimit) && + upLimitDesc.equals(entity.upLimitDesc) && + point.equals(entity.point) && + pointUnit.equals(entity.pointUnit) && + enabledFlag.equals(entity.enabledFlag); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), customerId, ruleName, ruleDesc, eventCode, operateType, upLimit, upLimitDesc, point, pointUnit, enabledFlag); + } } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/SysOperateLogEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/RuleOperateLogEntity.java similarity index 88% rename from epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/SysOperateLogEntity.java rename to epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/RuleOperateLogEntity.java index 4068bba53b..573a9f52da 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/SysOperateLogEntity.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/RuleOperateLogEntity.java @@ -18,13 +18,10 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; - /** * 积分系统操作记录表 * @@ -34,7 +31,7 @@ import java.util.Date; @Data @EqualsAndHashCode(callSuper=false) @TableName("sys_operate_log") -public class SysOperateLogEntity extends BaseEpmetEntity { +public class RuleOperateLogEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; @@ -44,14 +41,9 @@ public class SysOperateLogEntity extends BaseEpmetEntity { private String customerId; /** - * 操作对象ID - */ - private String objectId; - - /** - * 对象类型 规则:rule + * 规则ID */ - private String objectType; + private String ruleId; /** * 操作类型 新建:add,编辑:edit,删除:del; diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRuleService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRuleService.java index 3c84c43cad..fa53b5be05 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRuleService.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRuleService.java @@ -18,12 +18,16 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.commons.tools.page.PageData; -import com.epmet.dto.PointRuleDTO; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.PointDetailFormDTO; +import com.epmet.dto.form.PointRuleFormDTO; +import com.epmet.dto.form.PointRuleListFormDTO; +import com.epmet.dto.result.CustomerFunctionResultDTO; +import com.epmet.dto.result.PointDetailResultDTO; +import com.epmet.dto.result.PointRuleResultDTO; import com.epmet.entity.PointRuleEntity; import java.util.List; -import java.util.Map; /** * 积分规则表 @@ -34,62 +38,22 @@ import java.util.Map; public interface PointRuleService extends BaseService { /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2020-07-20 + * desc:根据用户id获取积分规则-功能列表 + * @param customerId + * @return */ - PageData page(Map params); + List getFunctionList(String customerId); - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2020-07-20 - */ - List list(Map params); + /** + * desc:根据客户Id 及功能Id获取规则列表 + * @param formDTO + * @return + */ + List list(PointRuleListFormDTO formDTO); - /** - * 单条查询 - * - * @param id - * @return PointRuleDTO - * @author generator - * @date 2020-07-20 - */ - PointRuleDTO get(String id); + PointDetailResultDTO detail(PointDetailFormDTO formDTO); - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2020-07-20 - */ - void save(PointRuleDTO dto); + void update(TokenDto tokenDTO, PointRuleFormDTO formDTO); - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2020-07-20 - */ - void update(PointRuleDTO dto); - - /** - * 批量删除 - * - * @param ids - * @return void - * @author generator - * @date 2020-07-20 - */ - void delete(String[] ids); + void add(TokenDto tokenDTO, PointRuleFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/SysOperateLogService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/SysOperateLogService.java index 962df38027..46e78037ec 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/SysOperateLogService.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/SysOperateLogService.java @@ -20,7 +20,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.SysOperateLogDTO; -import com.epmet.entity.SysOperateLogEntity; +import com.epmet.entity.RuleOperateLogEntity; import java.util.List; import java.util.Map; @@ -31,7 +31,7 @@ import java.util.Map; * @author generator generator@elink-cn.com * @since v1.0.0 2020-07-20 */ -public interface SysOperateLogService extends BaseService { +public interface SysOperateLogService extends BaseService { /** * 默认分页 diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java index c64ccfdc35..8e40169645 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java @@ -17,23 +17,40 @@ package com.epmet.service.impl; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; +import com.alibaba.fastjson.JSON; +import com.epmet.common.enu.PointUnitEnum; +import com.epmet.common.enu.SysResponseEnum; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.enums.CommonOperateTypeEnum; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.Result; import com.epmet.dao.PointRuleDao; -import com.epmet.dto.PointRuleDTO; +import com.epmet.dao.RuleOperateLogDao; +import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.form.CustomerFunctionListFormDTO; +import com.epmet.dto.form.PointDetailFormDTO; +import com.epmet.dto.form.PointRuleFormDTO; +import com.epmet.dto.form.PointRuleListFormDTO; +import com.epmet.dto.result.CustomerFunctionResultDTO; +import com.epmet.dto.result.DefaultFunctionListResultDTO; +import com.epmet.dto.result.PointDetailResultDTO; +import com.epmet.dto.result.PointRuleResultDTO; import com.epmet.entity.PointRuleEntity; +import com.epmet.entity.RuleOperateLogEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.service.PointRuleService; -import org.apache.commons.lang3.StringUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; -import java.util.Arrays; +import java.util.ArrayList; import java.util.List; -import java.util.Map; +import java.util.stream.Collectors; /** * 积分规则表 @@ -41,60 +58,116 @@ import java.util.Map; * @author generator generator@elink-cn.com * @since v1.0.0 2020-07-20 */ +@Slf4j @Service public class PointRuleServiceImpl extends BaseServiceImpl implements PointRuleService { - - - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, PointRuleDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, PointRuleDTO.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 PointRuleDTO get(String id) { - PointRuleEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, PointRuleDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(PointRuleDTO dto) { - PointRuleEntity entity = ConvertUtils.sourceToTarget(dto, PointRuleEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(PointRuleDTO dto) { - PointRuleEntity entity = ConvertUtils.sourceToTarget(dto, PointRuleEntity.class); - updateById(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); - } - + @Autowired + private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Autowired + private RuleOperateLogDao ruleOperateLogDao; + + @Override + public List getFunctionList(String customerId) { + List result = new ArrayList<>(); + CustomerFunctionListFormDTO formDTO = new CustomerFunctionListFormDTO(); + formDTO.setCustomerId(customerId); + Result> openedFunctionResult = operCustomizeOpenFeignClient.getOpenedFunctionList(formDTO); + if (!openedFunctionResult.success()) { + log.warn("getFunctionList getOpenedFunctionList fail,result:{}", JSON.toJSONString(openedFunctionResult)); + throw new RenException(SysResponseEnum.THIRD_SERVICE_ERROR.getCode(), SysResponseEnum.THIRD_SERVICE_ERROR.getMsg()); + } + List resultData = openedFunctionResult.getData(); + if (CollectionUtils.isEmpty(resultData)) { + log.warn("getFunctionList customerId:{} have opened any function", customerId); + return result; + } + List functionIds = baseDao.selectFunctionIds(customerId); + if (CollectionUtils.isEmpty(functionIds)) { + log.warn("getFunctionList customerId:{} have any pointRules", customerId); + return result; + } + return resultData.stream().filter(function -> functionIds.contains(function.getFunctionId())) + .map(fun -> ConvertUtils.sourceToTarget(fun, CustomerFunctionResultDTO.class)) + .collect(Collectors.toList()); + } + + @Override + public List list(PointRuleListFormDTO formDTO) { + List result = new ArrayList<>(); + List list = baseDao.selectListByFunctionId(formDTO); + if (CollectionUtils.isEmpty(list)) { + log.warn("list functionId:{} return empty", formDTO.getFunctionId()); + return result; + } + result = list.stream().map(pointRuleEntity -> { + PointRuleResultDTO resultDTO = new PointRuleResultDTO(); + resultDTO.setRuleId(pointRuleEntity.getId()); + resultDTO.setRuleName(pointRuleEntity.getRuleName()); + resultDTO.setRuleDesc(pointRuleEntity.getRuleDesc()); + PointUnitEnum pointUnitEnum = PointUnitEnum.getEnum(pointRuleEntity.getPointUnit()); + if (pointRuleEntity == null || pointRuleEntity.getPoint() == null) { + log.error("list ruleId:{} have not pointUnit or pointNum,pointRule:{}", JSON.toJSONString(pointRuleEntity)); + return null; + } + resultDTO.setPointValue(pointRuleEntity.getPoint().toString().concat(StrConstant.SEPARATOR).concat(pointUnitEnum.getCode())); + return resultDTO; + }).filter(fun -> fun != null).collect(Collectors.toList()); + return result; + } + + @Override + public PointDetailResultDTO detail(PointDetailFormDTO formDTO) { + PointRuleEntity pointRuleEntity = baseDao.selectById(formDTO.getRuleId()); + if (pointRuleEntity == null) { + throw new RenException(SysResponseEnum.POINT_RULE_IS_NOT_EXIST.getCode(), SysResponseEnum.POINT_RULE_IS_NOT_EXIST.getMsg()); + } + return ConvertUtils.sourceToTarget(pointRuleEntity, PointDetailResultDTO.class); + } + + @Override + public void update(TokenDto tokenDTO, PointRuleFormDTO formDTO) { + PointRuleEntity entityDB = baseDao.selectById(formDTO.getRuleId()); + //数据库不存在或者客户Id不相等 则抛出异常 + if (entityDB == null || !entityDB.getCustomerId().equals(formDTO.getCustomerId())) { + throw new RenException(SysResponseEnum.POINT_RULE_IS_NOT_EXIST.getCode(), SysResponseEnum.POINT_RULE_IS_NOT_EXIST.getMsg()); + } + PointRuleEntity entityNew = ConvertUtils.sourceToTarget(formDTO, PointRuleEntity.class); + if (entityDB.equals(entityNew)) { + log.warn("update ignore tow entity is same"); + return; + } + insertOperateRecord(tokenDTO, formDTO, entityDB, CommonOperateTypeEnum.EDIT.getCode()); + baseDao.updateByCustomerId(entityNew); + } + + @Override + public void add(TokenDto tokenDTO, PointRuleFormDTO formDTO) { + PointRuleEntity entity = ConvertUtils.sourceToTarget(formDTO, PointRuleEntity.class); + if (tokenDTO == null){ + insertOperateRecord(tokenDTO, formDTO, null, CommonOperateTypeEnum.ADD.getCode()); + } + baseDao.insert(entity); + } + + private void insertOperateRecord(TokenDto tokenDTO, PointRuleFormDTO formDTO, PointRuleEntity entityDB, String opType) { + CustomerStaffDTO userInfo = getCustomerStaff(tokenDTO.getUserId()); + RuleOperateLogEntity record = new RuleOperateLogEntity(); + record.setCustomerId(formDTO.getCustomerId()); + record.setRuleId(entityDB.getId()); + record.setOpType(opType); + record.setOpUser(userInfo.getRealName()); + record.setBefordData(JSON.toJSONString(entityDB)); + record.setAfterData(JSON.toJSONString(formDTO)); + ruleOperateLogDao.insert(record); + } + + private CustomerStaffDTO getCustomerStaff(String userId) { + Result resultStaff = epmetUserOpenFeignClient.getCustomerStaff(userId); + if (!resultStaff.success() || null == resultStaff.getData()) { + throw new RenException(SysResponseEnum.THIRD_SERVICE_ERROR.getMsg()); + } + return resultStaff.getData(); + } } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/SysOperateLogServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/SysOperateLogServiceImpl.java index 59604433bf..b309d3f7a0 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/SysOperateLogServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/SysOperateLogServiceImpl.java @@ -20,12 +20,12 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.dao.SysOperateLogDao; +import com.epmet.dao.RuleOperateLogDao; import com.epmet.dto.SysOperateLogDTO; -import com.epmet.entity.SysOperateLogEntity; +import com.epmet.entity.RuleOperateLogEntity; import com.epmet.service.SysOperateLogService; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; @@ -42,11 +42,11 @@ import java.util.Map; * @since v1.0.0 2020-07-20 */ @Service -public class SysOperateLogServiceImpl extends BaseServiceImpl implements SysOperateLogService { +public class SysOperateLogServiceImpl extends BaseServiceImpl implements SysOperateLogService { @Override public PageData page(Map params) { - IPage page = baseDao.selectPage( + IPage page = baseDao.selectPage( getPage(params, FieldConstant.CREATED_TIME, false), getWrapper(params) ); @@ -55,15 +55,15 @@ public class SysOperateLogServiceImpl extends BaseServiceImpl list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); + List entityList = baseDao.selectList(getWrapper(params)); return ConvertUtils.sourceToTarget(entityList, SysOperateLogDTO.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; @@ -71,21 +71,21 @@ public class SysOperateLogServiceImpl extends BaseServiceImpl - - + @@ -23,6 +22,18 @@ - - + + + + UPDATE point_rule + SET + POINT = #{point,jdbcType=INTEGER}, + ENABLED_FLAG = #{enabledFlag,jdbcType=VARCHAR}, + UP_LIMIT = #{upLimit,jdbcType=INTEGER} + WHERE id = #{id,jdbcType=VARCHAR} and CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/SysOperateLogDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/RuleOperateLogDao.xml similarity index 87% rename from epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/SysOperateLogDao.xml rename to epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/RuleOperateLogDao.xml index 0fe2621044..e20a977e8f 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/SysOperateLogDao.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/RuleOperateLogDao.xml @@ -1,9 +1,9 @@ - + - + diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java index 9e81857ef7..8707b1cf55 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java @@ -1,9 +1,13 @@ package com.epmet.feign; -import org.springframework.cloud.openfeign.FeignClient; - import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.CustomerFunctionListFormDTO; +import com.epmet.dto.result.DefaultFunctionListResultDTO; import com.epmet.feign.fallback.OperCustomizeOpenFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; + +import java.util.List; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -13,5 +17,5 @@ import com.epmet.feign.fallback.OperCustomizeOpenFeignClientFallback; */ @FeignClient(name = ServiceConstant.OPER_CUSTOMIZE_SERVER, fallback = OperCustomizeOpenFeignClientFallback.class) public interface OperCustomizeOpenFeignClient { - + Result> getOpenedFunctionList(CustomerFunctionListFormDTO formDTO); } diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java index 5c2271f1b3..d8e2fa7249 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java @@ -1,7 +1,16 @@ package com.epmet.feign.fallback; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.CustomerFunctionListFormDTO; +import com.epmet.dto.result.DefaultFunctionListResultDTO; import com.epmet.feign.OperCustomizeOpenFeignClient; +import org.springframework.http.MediaType; import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.PostMapping; + +import java.util.List; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -12,10 +21,13 @@ import org.springframework.stereotype.Component; @Component public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFeignClient { /** - * 从缓存中查询已登录用户的基本信息以及角色等相关信息 + * 获取客户已开通的功能列表 * * @return */ - //@PostMapping(value = "/epmetuser/user/loginuserdetails", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) - //Result getLoginUserDetails(@RequestBody LoginUserDetailsFormDTO dto); + @Override + @PostMapping(value = "/oper/customize/customerfunction/getOpenedFunctionList", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + public Result> getOpenedFunctionList(CustomerFunctionListFormDTO formDTO){ + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getOpenedFunctionList", formDTO); + } } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionController.java index 7c2bbda050..71e165696b 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionController.java @@ -133,8 +133,8 @@ public class CustomerFunctionController { * @param formDTO * @return */ - @PostMapping("customeropenedfunction") - public Result> customerOpenedFunction(@RequestBody CustomerFunctionListFormDTO formDTO) { - return new Result>().ok(customerFunctionService.customerOpenedFunction(formDTO)); + @PostMapping("openedfunctionlist") + public Result> getOpenedFunctionList(@RequestBody CustomerFunctionListFormDTO formDTO) { + return new Result>().ok(customerFunctionService.getOpenedFunctionList(formDTO)); } } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionService.java index 17fcb2be66..70b5c55404 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionService.java @@ -118,5 +118,5 @@ public interface CustomerFunctionService extends BaseService customerOpenedFunction(CustomerFunctionListFormDTO formDTO); + List getOpenedFunctionList(CustomerFunctionListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionServiceImpl.java index 7c68f32ec1..dadf4257ea 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionServiceImpl.java @@ -17,11 +17,13 @@ package com.epmet.service.impl; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; @@ -41,15 +43,15 @@ import com.epmet.entity.CustomerFunctionEntity; import com.epmet.feign.OperCrmFeignClient; import com.epmet.redis.CustomerFunctionRedis; import com.epmet.service.CustomerFunctionService; +import lombok.extern.slf4j.Slf4j; 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 org.springframework.util.CollectionUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.stream.Collectors; /** * 客户功能权限表 @@ -57,6 +59,7 @@ import java.util.Map; * @author generator generator@elink-cn.com * @since v1.0.0 2020-03-10 */ +@Slf4j @Service public class CustomerFunctionServiceImpl extends BaseServiceImpl implements CustomerFunctionService { @@ -211,8 +214,34 @@ public class CustomerFunctionServiceImpl extends BaseServiceImpl customerOpenedFunction(CustomerFunctionListFormDTO formDTO) { - return null; + public List getOpenedFunctionList(CustomerFunctionListFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getCustomerId())){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + List result = new ArrayList<>(); + //查询所有已上架功能列表(默认、定制功能) + List funList = functionDao.selectFunctionList(); + if(CollectionUtils.isEmpty(funList)){ + return result; + } + //查询当前客户已拥有的功能 + List openedList = baseDao.selectCustomerFunctionList(formDTO.getCustomerId()); + if(CollectionUtils.isEmpty(openedList)){ + log.warn("getOpenedFunctionList customerId:{} have any function",formDTO.getCustomerId()); + return result; + } + Set openedFunIdSet = openedList.stream().map(CustomerFunctionDTO::getFunctionId).collect(Collectors.toSet()); + for (FunctionDTO function : funList) { + if (openedFunIdSet.contains(function.getId())) { + DefaultFunctionListResultDTO resultDTO = ConvertUtils.sourceToTarget(function, DefaultFunctionListResultDTO.class); + if (resultDTO == null) { + log.error("getOpenedFunctionList convert return null,function:{}", JSON.toJSONString(function)); + continue; + } + result.add(resultDTO); + } + } + return result; } } \ No newline at end of file From fb203f736cb253ffb6cc868602e36d2681532ac9 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Thu, 23 Jul 2020 13:51:26 +0800 Subject: [PATCH 40/98] =?UTF-8?q?=E7=88=B1=E5=BF=83=E4=BA=92=E5=8A=A9-?= =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=AB=AF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/resi/ResiActInsertLiveFormDTO.java | 93 +++++++++++++ .../dto/form/resi/ResiActSignInFormDTO.java | 100 ++++++++++++++ .../ResiVolunteerAuthenticateFormDTO.java | 106 +++++++++++++++ .../controller/ResiActListController.java | 31 +++++ .../controller/ResiVolunteerController.java | 18 ++- .../com/epmet/dao/ActUserRelationDao.java | 4 +- .../com/epmet/service/ActLiveRecService.java | 75 +++-------- .../epmet/service/ActSignInRecService.java | 71 ++-------- .../epmet/service/VolunteerInfoService.java | 71 ++-------- .../service/impl/ActLiveRecServiceImpl.java | 93 +++++-------- .../service/impl/ActSignInRecServiceImpl.java | 124 ++++++++++-------- .../impl/ActUserRelationServiceImpl.java | 4 +- .../impl/VolunteerInfoServiceImpl.java | 66 +++------- .../utils/ActUserRelationStatusConstant.java | 5 + .../resources/mapper/ActUserRelationDao.xml | 19 ++- 15 files changed, 530 insertions(+), 350 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActInsertLiveFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActSignInFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiVolunteerAuthenticateFormDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActInsertLiveFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActInsertLiveFormDTO.java new file mode 100644 index 0000000000..d84b3b4698 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActInsertLiveFormDTO.java @@ -0,0 +1,93 @@ +/** + * 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.epmet.dto.form.resi; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 活动-添加实况 入参 + * + * @author zhangyong + * @since v1.0.0 2020-07-23 + */ +@Data +public class ResiActInsertLiveFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + //>>>>>>>>>>>>>>>>>校验分组开始>>>>>>>>>>>>>>>>>>>>> + /** + * 添加用户操作的内部异常分组 + * 出现错误会提示给前端7000错误码,返回信息为:服务器开小差... + */ + public interface AddUserInternalGroup {} + + /** + * 添加用户操作的用户可见异常分组 + * 该分组用于校验需要返回给前端错误信息提示的列,需要继承CustomerClientShowGroup + * 返回错误码为8999,提示信息为DTO中具体的列的校验注解message的内容 + */ + public interface AddUserShowGroup extends CustomerClientShowGroup {} + + // <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<< + + /** + * 活动ID + */ + @NotBlank(message = "活动ID不能为空", groups = { AddUserInternalGroup.class }) + private String actId; + + /** + * 活动签到描述 + */ + private String desc; + + /** + * 活动签到位置经度 + */ + @NotBlank(message = "活动签到位置经度不能为空", groups = { AddUserInternalGroup.class }) + private BigDecimal longitude; + + /** + * 活动签到位置纬度 + */ + @NotBlank(message = "活动签到位置纬度不能为空", groups = { AddUserInternalGroup.class }) + private BigDecimal latitude; + + /** + * 活动签到地址 + */ + @NotBlank(message = "活动签到地址不能为空", groups = { AddUserInternalGroup.class, AddUserShowGroup.class}) + private String address; + + /** + * 图片 + */ + private List images; + + /** + * 用户id + */ + private String userId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActSignInFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActSignInFormDTO.java new file mode 100644 index 0000000000..a587969ca2 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActSignInFormDTO.java @@ -0,0 +1,100 @@ +/** + * 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.epmet.dto.form.resi; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.awt.*; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 活动签到 入参 + * + * @author zhangyong + * @since v1.0.0 2020-07-23 + */ +@Data +public class ResiActSignInFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + //>>>>>>>>>>>>>>>>>校验分组开始>>>>>>>>>>>>>>>>>>>>> + /** + * 添加用户操作的内部异常分组 + * 出现错误会提示给前端7000错误码,返回信息为:服务器开小差... + */ + public interface AddUserInternalGroup {} + + /** + * 添加用户操作的用户可见异常分组 + * 该分组用于校验需要返回给前端错误信息提示的列,需要继承CustomerClientShowGroup + * 返回错误码为8999,提示信息为DTO中具体的列的校验注解message的内容 + */ + public interface AddUserShowGroup extends CustomerClientShowGroup {} + + // <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<< + + /** + * 活动ID + */ + @NotBlank(message = "活动ID不能为空", groups = { AddUserInternalGroup.class }) + private String actId; + + /** + * 活动签到描述 + */ + private String desc; + + /** + * 活动签到位置经度 + */ + @NotBlank(message = "活动签到位置经度不能为空", groups = { AddUserInternalGroup.class }) + private BigDecimal longitude; + + /** + * 活动签到位置纬度 + */ + @NotBlank(message = "活动签到位置纬度不能为空", groups = { AddUserInternalGroup.class }) + private BigDecimal latitude; + + /** + * 活动签到地址 + */ + @NotBlank(message = "活动签到地址不能为空", groups = { AddUserInternalGroup.class, AddUserShowGroup.class}) + private String address; + + /** + * 图片 + */ + private List images; + + /** + * 0不同步实况1同步到实况记录 + */ + @NotBlank(message = "是否同步到实况记录不能为空", groups = { AddUserInternalGroup.class, AddUserShowGroup.class}) + private Integer syncLive; + + /** + * 用户id + */ + private String userId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiVolunteerAuthenticateFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiVolunteerAuthenticateFormDTO.java new file mode 100644 index 0000000000..26b8591599 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiVolunteerAuthenticateFormDTO.java @@ -0,0 +1,106 @@ +package com.epmet.dto.form.resi; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 志愿者认证 入参 + * + * @Auther: zhangyong + * @Date: 2020-07-23 09:57 + */ + +@Data +public class ResiVolunteerAuthenticateFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + //>>>>>>>>>>>>>>>>>校验分组开始>>>>>>>>>>>>>>>>>>>>> + /** + * 添加用户操作的内部异常分组 + * 出现错误会提示给前端7000错误码,返回信息为:服务器开小差... + */ + public interface AddUserInternalGroup {} + + /** + * 添加用户操作的用户可见异常分组 + * 该分组用于校验需要返回给前端错误信息提示的列,需要继承CustomerClientShowGroup + * 返回错误码为8999,提示信息为DTO中具体的列的校验注解message的内容 + */ + public interface AddUserShowGroup extends CustomerClientShowGroup {} + + // <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<< + + /** + * 姓 + */ + @NotBlank(message = "姓不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) + private String surname; + + /** + * 名 + */ + @NotBlank(message = "名不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) + private String name; + + /** + * 性别(1男2女0未知) + */ + @NotBlank(message = "性别不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) + private String gender; + + /** + * 手机号 + */ + @NotBlank(message = "手机号不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) + private String mobile; + + /** + * 身份证号码 + */ + @NotBlank(message = "身份证号码不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) + private String idNum; + + /** + * 街道 + */ + @NotBlank(message = "街道不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) + private String street; + + /** + * 小区名 + */ + @NotBlank(message = "小区名不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) + private String district; + + /** + * 楼栋单元 + */ + @NotBlank(message = "楼栋单元不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) + private String buildingAddress; + + /** + * 志愿者自我介绍 + */ + private String volunteerIntroduce; + + /** + * 昵称 + */ + @NotBlank(message = "昵称不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) + private String nickname; + + /** + * 头像 + */ + @NotBlank(message = "头像不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) + private String headImgUrl; + + /** + * 志愿者签名 + */ + private String volunteerSignature; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java index 478bcfaa58..7231d7132a 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java @@ -37,6 +37,9 @@ public class ResiActListController { @Autowired private HeartUserInfoService heartUserInfoService; + @Autowired + private ActSignInRecService actSignInRecService; + /** * 活动列表(包含状态:报名中:signing_up;已报满:enough;截止报名: end_sign_up; 已开始: in_progress; 已结束:finished;) * @@ -251,4 +254,32 @@ public class ResiActListController { return heartUserInfoService.leaderboard(formDTO); } + /** + * 活动-添加实况 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:29 2020-07-23 + **/ + @PostMapping("insertlive") + public Result inSertlive(@LoginUser TokenDto tokenDto, @RequestBody ResiActInsertLiveFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return actLiveRecService.inSertlive(tokenDto, formDTO); + } + + /** + * 活动-签到 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:29 2020-07-23 + **/ + @PostMapping("signin") + public Result actSignIn(@LoginUser TokenDto tokenDto, @RequestBody ResiActSignInFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return actSignInRecService.actSignIn(tokenDto, formDTO); + } + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java index 8d3508fce6..f93e0da287 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java @@ -17,8 +17,16 @@ package com.epmet.controller; -import com.epmet.dao.VolunteerInfoDao; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.resi.ResiActUserCancelSignUpFormDTO; +import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; +import com.epmet.service.VolunteerInfoService; 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; @@ -34,7 +42,11 @@ import org.springframework.web.bind.annotation.RestController; public class ResiVolunteerController { @Autowired - private VolunteerInfoDao volunteerInfoDao; - + private VolunteerInfoService volunteerInfoService; + @PostMapping("authenticate") + public Result authenticate(@LoginUser TokenDto tokenDto, @RequestBody ResiVolunteerAuthenticateFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return volunteerInfoService.authenticate(tokenDto, formDTO); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java index ccc5981b5a..1f21cd951a 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java @@ -73,12 +73,12 @@ public interface ActUserRelationDao extends BaseDao { Integer selectActSignupNum(@Param("actId") String actId); /** - * 将用户与活动的状态修改为 已取消 + * 根据用户id和活动id,修改 用户活动关系表 * * @param userRelationDTO * @return void * @Author zhangyong * @Date 14:39 2020-07-22 **/ - void updateUserStatusToCanceld(ActUserRelationDTO userRelationDTO); + void updateUserRelationByActIdAndUserId(ActUserRelationDTO userRelationDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java index a0b32263c4..4185eedf75 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java @@ -19,9 +19,12 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.ActLiveRecDTO; import com.epmet.dto.form.resi.ResiActContentFormDTO; +import com.epmet.dto.form.resi.ResiActInsertLiveFormDTO; +import com.epmet.dto.form.resi.ResiActSignInFormDTO; import com.epmet.dto.result.resi.ResiActLiveRecResultDTO; import com.epmet.entity.ActLiveRecEntity; @@ -36,66 +39,6 @@ import java.util.Map; */ public interface ActLiveRecService extends BaseService { - /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2020-07-19 - */ - PageData page(Map params); - - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2020-07-19 - */ - List list(Map params); - - /** - * 单条查询 - * - * @param id - * @return ActLiveRecDTO - * @author generator - * @date 2020-07-19 - */ - ActLiveRecDTO get(String id); - - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2020-07-19 - */ - void save(ActLiveRecDTO dto); - - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2020-07-19 - */ - void update(ActLiveRecDTO dto); - - /** - * 批量删除 - * - * @param ids - * @return void - * @author generator - * @date 2020-07-19 - */ - void delete(String[] ids); - /** * 活动详情-已结束-现场实况列表 * @@ -105,4 +48,16 @@ public interface ActLiveRecService extends BaseService { * @Date 13:39 2020-07-21 **/ Result liveRecList(String actId); + + /** + * 活动-添加实况 + * 返回实况id,主要是因为,当签到并转发实况时,表中需要存储【实况ID】 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 13:40 2020-07-23 + **/ + Result inSertlive(TokenDto tokenDto, ResiActInsertLiveFormDTO formDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSignInRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSignInRecService.java index c8119da389..84aec10141 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSignInRecService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSignInRecService.java @@ -19,7 +19,10 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; import com.epmet.dto.ActSignInRecDTO; +import com.epmet.dto.form.resi.ResiActSignInFormDTO; import com.epmet.entity.ActSignInRecEntity; import java.util.List; @@ -32,64 +35,14 @@ import java.util.Map; * @since v1.0.0 2020-07-19 */ public interface ActSignInRecService extends BaseService { - - /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2020-07-19 - */ - PageData page(Map params); - - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2020-07-19 - */ - List list(Map params); - - /** - * 单条查询 - * - * @param id - * @return ActSignInRecDTO - * @author generator - * @date 2020-07-19 - */ - ActSignInRecDTO get(String id); - - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2020-07-19 - */ - void save(ActSignInRecDTO dto); - - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2020-07-19 - */ - void update(ActSignInRecDTO dto); - /** - * 批量删除 + * 活动-签到 * - * @param ids - * @return void - * @author generator - * @date 2020-07-19 - */ - void delete(String[] ids); -} \ No newline at end of file + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:29 2020-07-23 + **/ + Result actSignIn(TokenDto tokenDto, ResiActSignInFormDTO formDTO); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java index e7874814d2..6938871d5b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java @@ -19,7 +19,10 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; import com.epmet.dto.VolunteerInfoDTO; +import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; import com.epmet.entity.VolunteerInfoEntity; import java.util.List; @@ -34,62 +37,14 @@ import java.util.Map; public interface VolunteerInfoService extends BaseService { /** - * 默认分页 + * 志愿者认证 * - * @param params - * @return PageData - * @author generator - * @date 2020-07-19 - */ - PageData page(Map params); - - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2020-07-19 - */ - List list(Map params); - - /** - * 单条查询 - * - * @param id - * @return VolunteerInfoDTO - * @author generator - * @date 2020-07-19 - */ - VolunteerInfoDTO get(String id); - - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2020-07-19 - */ - void save(VolunteerInfoDTO dto); - - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2020-07-19 - */ - void update(VolunteerInfoDTO dto); - - /** - * 批量删除 - * - * @param ids - * @return void - * @author generator - * @date 2020-07-19 - */ - void delete(String[] ids); -} \ No newline at end of file + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:09 2020-07-23 + **/ + Result authenticate(TokenDto tokenDto, ResiVolunteerAuthenticateFormDTO formDTO); + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java index 967bdf16e2..b5038ce2ab 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java @@ -17,24 +17,24 @@ package com.epmet.service.impl; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.ActLivePicDao; import com.epmet.dao.ActLiveRecDao; +import com.epmet.dao.ActUserLogDao; +import com.epmet.dao.ActUserRelationDao; import com.epmet.dto.ActLivePicDTO; import com.epmet.dto.ActLiveRecDTO; -import com.epmet.dto.UserWechatDTO; +import com.epmet.dto.form.resi.ResiActInsertLiveFormDTO; import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.dto.result.resi.ResiActLiveRecResultDTO; +import com.epmet.entity.ActLivePicEntity; import com.epmet.entity.ActLiveRecEntity; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.redis.ActLiveRecRedis; import com.epmet.service.ActLiveRecService; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -56,57 +56,8 @@ public class ActLiveRecServiceImpl extends BaseServiceImpl page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, ActLiveRecDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, ActLiveRecDTO.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 ActLiveRecDTO get(String id) { - ActLiveRecEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, ActLiveRecDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(ActLiveRecDTO dto) { - ActLiveRecEntity entity = ConvertUtils.sourceToTarget(dto, ActLiveRecEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(ActLiveRecDTO dto) { - ActLiveRecEntity entity = ConvertUtils.sourceToTarget(dto, ActLiveRecEntity.class); - updateById(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); - } + @Autowired + private ActLivePicDao actLivePicDao; @Override public Result liveRecList(String actId) { @@ -144,4 +95,30 @@ public class ActLiveRecServiceImpl extends BaseServiceImpl().ok(resultDto); } + @Override + @Transactional(rollbackFor = Exception.class) + public Result inSertlive(TokenDto tokenDto, ResiActInsertLiveFormDTO formDTO) { + formDTO.setUserId(tokenDto.getUserId()); + // 存储活动实况记录表 + ActLiveRecEntity actLiveRecEntity = new ActLiveRecEntity(); + actLiveRecEntity.setActId(formDTO.getActId()); + actLiveRecEntity.setUserId(formDTO.getUserId()); + actLiveRecEntity.setLongitude(formDTO.getLongitude()); + actLiveRecEntity.setLatitude(formDTO.getLatitude()); + actLiveRecEntity.setAddress(formDTO.getAddress()); + actLiveRecEntity.setDesc(formDTO.getDesc()); + baseDao.insert(actLiveRecEntity); + + //存储活动实况图片 + List imgList = formDTO.getImages(); + for (int i = 0; i < imgList.size(); i++) { + String imgUrl = imgList.get(i); + ActLivePicEntity actLivePicEntity = new ActLivePicEntity(); + actLivePicEntity.setLiveId(actLiveRecEntity.getId()); + actLivePicEntity.setPicUrl(imgUrl); + actLivePicEntity.setSort(i + NumConstant.ONE); + actLivePicDao.insert(actLivePicEntity); + } + return new Result().ok(actLiveRecEntity.getId()); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInRecServiceImpl.java index ac608c807a..88719c0b99 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInRecServiceImpl.java @@ -17,25 +17,30 @@ package com.epmet.service.impl; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.ActSignInPicDao; import com.epmet.dao.ActSignInRecDao; -import com.epmet.dto.ActSignInRecDTO; +import com.epmet.dao.ActUserLogDao; +import com.epmet.dao.ActUserRelationDao; +import com.epmet.dto.ActUserRelationDTO; +import com.epmet.dto.form.resi.ResiActInsertLiveFormDTO; +import com.epmet.dto.form.resi.ResiActSignInFormDTO; +import com.epmet.entity.ActSignInPicEntity; import com.epmet.entity.ActSignInRecEntity; +import com.epmet.entity.ActUserLogEntity; import com.epmet.redis.ActSignInRecRedis; +import com.epmet.service.ActLiveRecService; import com.epmet.service.ActSignInRecService; -import org.apache.commons.lang3.StringUtils; +import com.epmet.utils.ActUserRelationStatusConstant; 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; /** * 活动签到记录 @@ -49,56 +54,67 @@ public class ActSignInRecServiceImpl extends BaseServiceImpl page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, ActSignInRecDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, ActSignInRecDTO.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; - } + @Autowired + private ActUserRelationDao actUserRelationDao; - @Override - public ActSignInRecDTO get(String id) { - ActSignInRecEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, ActSignInRecDTO.class); - } + @Autowired + private ActUserLogDao actUserLogDao; - @Override - @Transactional(rollbackFor = Exception.class) - public void save(ActSignInRecDTO dto) { - ActSignInRecEntity entity = ConvertUtils.sourceToTarget(dto, ActSignInRecEntity.class); - insert(entity); - } + @Autowired + private ActSignInPicDao actSignInPicDao; - @Override - @Transactional(rollbackFor = Exception.class) - public void update(ActSignInRecDTO dto) { - ActSignInRecEntity entity = ConvertUtils.sourceToTarget(dto, ActSignInRecEntity.class); - updateById(entity); - } + @Autowired + private ActLiveRecService actLiveRecService; @Override @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); + public Result actSignIn(TokenDto tokenDto, ResiActSignInFormDTO formDTO) { + formDTO.setUserId(tokenDto.getUserId()); + // 更新用户活动关系表 SIGN_IN_FLAG字段更新为已签到 + ActUserRelationDTO actUserRelationDTO = new ActUserRelationDTO(); + actUserRelationDTO.setActId(formDTO.getActId()); + actUserRelationDTO.setUserId(formDTO.getUserId()); + actUserRelationDTO.setSignInFlag(ActUserRelationStatusConstant.SIGNED_IN); + actUserRelationDao.updateUserRelationByActIdAndUserId(actUserRelationDTO); + + // 存储用户活动关系日志表 + ActUserLogEntity actUserLogEntity = new ActUserLogEntity(); + actUserLogEntity.setActId(formDTO.getActId()); + actUserLogEntity.setUserId(formDTO.getUserId()); + actUserLogEntity.setOperationType(ActUserRelationStatusConstant.SIGNED_IN); + actUserLogDao.insert(actUserLogEntity); + + //" 实况id,当sync_live=1时此列有值" + String liveId = ""; + if (formDTO.getSyncLive() == 1){ + // 签到内容同步到实况 + ResiActInsertLiveFormDTO liveFormDTO = ConvertUtils.sourceToTarget(formDTO, ResiActInsertLiveFormDTO.class); + Result inSertlive = actLiveRecService.inSertlive(tokenDto, liveFormDTO); + liveId = inSertlive.getData(); + } + + // 存储活动签到记录表 + ActSignInRecEntity actSignInRecEntity = new ActSignInRecEntity(); + actSignInRecEntity.setActId(formDTO.getActId()); + actSignInRecEntity.setUserId(formDTO.getUserId()); + actSignInRecEntity.setLongitude(formDTO.getLongitude()); + actSignInRecEntity.setLatitude(formDTO.getLatitude()); + actSignInRecEntity.setAddress(formDTO.getAddress()); + actSignInRecEntity.setDesc(formDTO.getDesc()); + actSignInRecEntity.setSyncLive(formDTO.getSyncLive()); + actSignInRecEntity.setLiveId(liveId); + baseDao.insert(actSignInRecEntity); + + //存储活动签到图片 + List imgList = formDTO.getImages(); + for (int i = 0; i < imgList.size(); i++) { + String imgUrl = imgList.get(i); + ActSignInPicEntity actLivePicEntity = new ActSignInPicEntity(); + actLivePicEntity.setSignInId(actSignInRecEntity.getId()); + actLivePicEntity.setPicUrl(imgUrl); + actLivePicEntity.setSort(i + NumConstant.ONE); + actSignInPicDao.insert(actLivePicEntity); + } + return new Result(); } - -} \ No newline at end of file +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java index cfea34e14e..5169f119df 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java @@ -153,11 +153,11 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, VolunteerInfoDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, VolunteerInfoDTO.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 VolunteerInfoDTO get(String id) { - VolunteerInfoEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, VolunteerInfoDTO.class); + public Result authenticate(TokenDto tokenDto, ResiVolunteerAuthenticateFormDTO formDTO) { + // 检查是否是志愿者 + // 是志愿者 + // 更新志愿者信息表 + // 更新用户基础信息表 + // 更新用户微信表 + + // 不是志愿者 + // 插入志愿者信息表 + // 更新用户基础信息表 + // 更新用户微信表 + return null; } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(VolunteerInfoDTO dto) { - VolunteerInfoEntity entity = ConvertUtils.sourceToTarget(dto, VolunteerInfoEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(VolunteerInfoDTO dto) { - VolunteerInfoEntity entity = ConvertUtils.sourceToTarget(dto, VolunteerInfoEntity.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/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ActUserRelationStatusConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ActUserRelationStatusConstant.java index dcde4657a7..1ecbcecca1 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ActUserRelationStatusConstant.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ActUserRelationStatusConstant.java @@ -35,4 +35,9 @@ public interface ActUserRelationStatusConstant { * 不给积分 */ String DENY = "deny"; + + /** + * 已签到 + */ + String SIGNED_IN = "signed_in"; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml index 0cd324f25c..d5300a49da 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml @@ -72,12 +72,23 @@ GROUP BY re.ACT_ID - + UPDATE act_user_relation SET - STATUS = #{status}, - CANCEL_TIME = NOW(), - CANCEL_REASON = #{cancelReason} + + STATUS = #{status}, + + + CANCEL_TIME = NOW(), + CANCEL_REASON = #{cancelReason}, + + + SIGN_IN_FLAG = #{signInFlag}, + + + UPDATED_BY = #{userId}, + + UPDATED_TIME = NOW() WHERE DEL_FLAG = '0' AND ACT_ID = #{actId} From 1862b53271f95d5ee150f7379e3f8d5ff5490b30 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Thu, 23 Jul 2020 14:29:20 +0800 Subject: [PATCH 41/98] =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=EF=BC=9A=E6=A0=B9=E6=8D=AE=E7=94=A8=E6=88=B7ID=EF=BC=8C?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=94=A8=E6=88=B7=E6=89=80=E5=B1=9E=E8=A7=92?= =?UTF-8?q?=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/feign/EpmetUserFeignClient.java | 14 ++++++++++++++ .../EpmetUserFeignClientFallBack.java | 6 ++++++ .../epmet/controller/UserRoleController.java | 14 +++++++++++++- .../main/java/com/epmet/dao/UserRoleDao.java | 15 +++++++++++++-- .../com/epmet/service/UserRoleService.java | 11 ++++++++++- .../service/impl/UserRoleServiceImpl.java | 7 ++++++- .../src/main/resources/mapper/UserRoleDao.xml | 19 ++++++++++++++++++- 7 files changed, 80 insertions(+), 6 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index 96663f3503..f98f1bc474 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -3,8 +3,11 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.dto.result.UserRoleResultDTO; import com.epmet.feign.fallback.EpmetUserFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -29,4 +32,15 @@ public interface EpmetUserFeignClient { **/ @PostMapping("epmetuser/userbaseinfo/queryuserbaseinfo") Result> heartQueryUserBaseInfo(@RequestBody List userIds); + + /** + * 根据用户ID,查询用户所属角色: 多种身份 + * + * @param userId + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 14:13 2020-07-23 + **/ + @PostMapping(value = "epmetuser/userrole/getuserroleinfobyuserid/{userId}", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> getUserRoleInfoByUserId(@PathVariable("userId") String userId); } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java index 656c446b05..71447cb0a6 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.UserWechatDTO; import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.dto.result.UserRoleResultDTO; import com.epmet.feign.EpmetUserFeignClient; import org.springframework.stereotype.Component; @@ -22,4 +23,9 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { public Result> heartQueryUserBaseInfo(List userIds) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "heartQueryUserBaseInfo", userIds); } + + @Override + public Result> getUserRoleInfoByUserId(String userId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getUserRoleInfoByUserId", userId); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserRoleController.java index f442da6e7f..f73fc1b52f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserRoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserRoleController.java @@ -120,4 +120,16 @@ public class UserRoleController { } -} \ No newline at end of file + /** + * 根据用户ID,查询用户所属角色: 多种身份 + * + * @param userId + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 14:24 2020-07-23 + **/ + @PostMapping("getuserroleinfobyuserid/{userId}") + public Result> getUserRoleInfoByUserId(@PathVariable String userId) { + return userRoleService.getUserRoleInfoByUserId(userId); + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserRoleDao.java index 989c20b2f1..58b864bce3 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserRoleDao.java @@ -18,16 +18,18 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.commons.tools.utils.Result; import com.epmet.dto.UserRoleDTO; import com.epmet.dto.form.UserRoleFormDTO; import com.epmet.dto.result.UserRoleResultDTO; import com.epmet.entity.UserRoleEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; /** - * 用户角色关系表 + * 用户角色关系表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-03-30 @@ -52,4 +54,13 @@ public interface UserRoleDao extends BaseDao { **/ List getUserRoleList(UserRoleFormDTO userRoleFormDTO); -} \ No newline at end of file + /** + * 根据用户ID,查询用户所属角色: 多种身份 + * + * @param userId + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 14:24 2020-07-23 + **/ + Result> getUserRoleInfoByUserId(@Param("userId") String userId); +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserRoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserRoleService.java index a22191edb0..c431331236 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserRoleService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserRoleService.java @@ -113,4 +113,13 @@ public interface UserRoleService extends BaseService { */ Result saveUserRole(UserRoleDTO userRoleDTO); -} \ No newline at end of file + /** + * 根据用户ID,查询用户所属角色: 多种身份 + * + * @param userId + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 14:24 2020-07-23 + **/ + Result> getUserRoleInfoByUserId(String userId); +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserRoleServiceImpl.java index 3650de51fc..4c0eafdad9 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserRoleServiceImpl.java @@ -132,4 +132,9 @@ public class UserRoleServiceImpl extends BaseServiceImpl> getUserRoleInfoByUserId(String userId) { + return baseDao.getUserRoleInfoByUserId(userId); + } + +} diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserRoleDao.xml index af3e8cbfbb..803fa40621 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserRoleDao.xml @@ -71,4 +71,21 @@ - \ No newline at end of file + + From f05c44dd1fe39ccd31762b5059664adbb7a67f90 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 23 Jul 2020 16:08:29 +0800 Subject: [PATCH 42/98] =?UTF-8?q?heart-work:=E6=8A=A5=E5=90=8D=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8-=E8=AF=A6=E6=83=85api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/ActUserLogDTO.java | 18 +-- .../dto/form/work/AactUserDetailFormDTO.java | 27 ++++ .../epmet/dto/result/work/AuditResult.java | 26 ++++ .../work/AuditingUserDetailResultDTO.java | 103 +++++++++++++++ .../epmet/dto/result/work/CancelResult.java | 29 +++++ .../dto/result/work/HistoricalActInfo.java | 34 +++++ .../result/work/HistoricalAuditResult.java | 30 +++++ .../controller/WorkActUserController.java | 30 +++-- .../java/com/epmet/dao/ActUserLogDao.java | 23 +++- .../com/epmet/dao/ActUserRelationDao.java | 27 ++++ .../com/epmet/entity/ActUserLogEntity.java | 18 ++- .../com/epmet/service/WorkActUserService.java | 10 ++ .../service/impl/WorkActUserServiceImpl.java | 120 +++++++++++++++++- .../main/resources/mapper/ActUserLogDao.xml | 28 +++- .../resources/mapper/ActUserRelationDao.xml | 35 +++++ 15 files changed, 521 insertions(+), 37 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AactUserDetailFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditResult.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingUserDetailResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CancelResult.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/HistoricalActInfo.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/HistoricalAuditResult.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserLogDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserLogDTO.java index a6f783b20f..aecb1b1750 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserLogDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserLogDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -50,13 +51,14 @@ public class ActUserLogDTO implements Serializable { /** * 操作类型(已报名/待审核auditing, -审核通过passed, -审核不通过refused -取消报名canceld, -发放积分rewarded -拒绝发放积分refuse_reward -重新处理processing -) + * 审核通过passed, + * 审核不通过refused + * 取消报名canceld, + * 已签到signedin + * 发放积分rewarded + * 拒绝发放积分refuse_reward + * 重新处理processing + * ) */ private String operationType; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AactUserDetailFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AactUserDetailFormDTO.java new file mode 100644 index 0000000000..3e653e76c1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AactUserDetailFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form.work; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 报名审核-人员详情-入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/22 22:22 + */ +@Data +public class AactUserDetailFormDTO implements Serializable { + private static final long serialVersionUID = 5791290477143999176L; + + public interface AddUserInternalGroup { + } + + /** + * 列表页返回的主键 + */ + @NotBlank(message = "主键不能为空", groups = {AddUserInternalGroup.class}) + private String actUserRelationId; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditResult.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditResult.java new file mode 100644 index 0000000000..480cc75f71 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditResult.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 审核结果(已通过/已拒绝) + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 14:01 + */ +@Data +public class AuditResult implements Serializable { + private static final long serialVersionUID = -656845099071435835L; + /** + * 审核通过/拒绝的时间yyyy-MM-dd HH:mm:ss + */ + private Date auditTime; + + /** + * 拒绝原因,status=passed时返回空字符串 + */ + private String refusedReason; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingUserDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingUserDetailResultDTO.java new file mode 100644 index 0000000000..b04972b890 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingUserDetailResultDTO.java @@ -0,0 +1,103 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 报名审核-待审核人员详情-返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/22 22:24 + */ +@Data +public class AuditingUserDetailResultDTO implements Serializable { + private static final long serialVersionUID = 6259802533450991971L; + /** + * 活动id + */ + private String actId; + /** + * 用户id + */ + private String userId; + + /** + * 姓名 + */ + private String realName; + + /** + * 性别1男2女0未知 + */ + private String gender; + + /** + * true: 是志愿者 false : 不是志愿者 + */ + private Boolean volunteerFlag; + + /** + * 联系方式 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idNum; + + /** + * 居住地址 + */ + private String address; + + /** + * 待审核auditing, 审核通过passed, 审核不通过refused 取消报名canceld, + */ + private String status; + + /** + * 报名时间yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date signUpTime; + + /** + * 返回文本:已拒绝5次 + */ + private String refusedCountDesc; + + /** + * 最近一次拒绝原因 + */ + private String latestRefusedReason; + + /** + * 最近一次拒绝的时间yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date latestAuditTime; + + /** + * 历史活动情况 + */ + private HistoricalActInfo historicalActInfo; + + + /** + * 取消信息(已取消界面 用) + */ + private CancelResult cancelResult; + /** + * 审核结果(已通过/已拒绝) + */ + private AuditResult auditResult; + + /** + * 审核历史(待审核界面需要显示) + */ + private HistoricalAuditResult historicalAuditResult; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CancelResult.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CancelResult.java new file mode 100644 index 0000000000..bf128fc0b1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CancelResult.java @@ -0,0 +1,29 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 取消信息(已取消界面 用) + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 13:53 + */ +@Data +public class CancelResult implements Serializable { + private static final long serialVersionUID = -4638522326622908384L; + + /** + * 取消的原因:当status=canceld,才有值 + */ + private String cancelReason; + + /** + * 取消的时间yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date cancelTime; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/HistoricalActInfo.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/HistoricalActInfo.java new file mode 100644 index 0000000000..6054511006 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/HistoricalActInfo.java @@ -0,0 +1,34 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 用户历史活动情况 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 12:39 + */ +@Data +public class HistoricalActInfo implements Serializable { + private static final long serialVersionUID = -7554295919888726898L; + /** + * 实际参加活动个数 + */ + private Integer signInActNum; + /** + * 报名活动个数 + */ + private Integer signUpActNum; + /** + * 获得积分活动个数 + */ + private Integer obtainPointsActNum; + + public HistoricalActInfo(){ + this.signInActNum=0; + this.signUpActNum=0; + this.obtainPointsActNum=0; + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/HistoricalAuditResult.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/HistoricalAuditResult.java new file mode 100644 index 0000000000..54f307c152 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/HistoricalAuditResult.java @@ -0,0 +1,30 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 审核历史(待审核界面需要显示) + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 14:03 + */ +@Data +public class HistoricalAuditResult implements Serializable { + /** + * 最近一次拒绝原因 + */ + private String latestRefusedReason; + /** + * 最近一次拒绝的时间yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date latestAuditTime; + /** + * 返回文本:已拒绝5次 + */ + private String refusedCountDesc; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java index 78e5f52ce4..44a3151650 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java @@ -2,6 +2,7 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.work.AactUserDetailFormDTO; import com.epmet.dto.form.work.AuditingActUserFormDTO; import com.epmet.dto.result.work.*; import com.epmet.service.WorkActUserService; @@ -36,8 +37,7 @@ public class WorkActUserController { @PostMapping("auditinglist") public Result> getAuditingList(@RequestBody AuditingActUserFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, AuditingActUserFormDTO.AddUserInternalGroup.class); - List list=workActUserService.getAuditingList(formDTO); - return new Result>().ok(list); + return new Result>().ok(workActUserService.getAuditingList(formDTO)); } @@ -51,8 +51,7 @@ public class WorkActUserController { @PostMapping("passedlist") public Result> getPassedList(@RequestBody AuditingActUserFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, AuditingActUserFormDTO.AddUserInternalGroup.class); - List list=workActUserService.getPassedList(formDTO); - return new Result>().ok(list); + return new Result>().ok(workActUserService.getPassedList(formDTO)); } /** @@ -65,8 +64,7 @@ public class WorkActUserController { @PostMapping("rejectedlist") public Result> getRejectedlist(@RequestBody AuditingActUserFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, AuditingActUserFormDTO.AddUserInternalGroup.class); - List list=workActUserService.getRejectedlist(formDTO); - return new Result>().ok(list); + return new Result>().ok(workActUserService.getRejectedlist(formDTO)); } /** @@ -77,10 +75,9 @@ public class WorkActUserController { * @Date 2020/7/22 16:23 **/ @PostMapping("canceledlist") - public Result getCanceledList(@RequestBody AuditingActUserFormDTO formDTO){ + public Result> getCanceledList(@RequestBody AuditingActUserFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, AuditingActUserFormDTO.AddUserInternalGroup.class); - List list=workActUserService.getCanceledList(formDTO); - return new Result>().ok(list); + return new Result>().ok(workActUserService.getCanceledList(formDTO)); } /** @@ -93,8 +90,19 @@ public class WorkActUserController { @PostMapping("signupstat") public Result getActSignUpStat(@RequestBody AuditingActUserFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, AuditingActUserFormDTO.AddUserInternalGroup.class); - ActSignUpStatResultDTO resultDTO=workActUserService.getActSignUpStat(formDTO.getActId()); - return new Result().ok(resultDTO); + return new Result().ok(workActUserService.getActSignUpStat(formDTO.getActId())); } + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 报名审核-人员详情 + * @Date 2020/7/22 22:44 + **/ + @PostMapping("userdetail") + public Result queryAuditingUserDetail(@RequestBody AactUserDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AactUserDetailFormDTO.AddUserInternalGroup.class); + return new Result().ok(workActUserService.queryAuditingUserDetail(formDTO)); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserLogDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserLogDao.java index 52b3034e75..6e02e27e48 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserLogDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserLogDao.java @@ -18,8 +18,10 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.ActUserLogDTO; import com.epmet.entity.ActUserLogEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 用户活动关系日志表 @@ -29,5 +31,24 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ActUserLogDao extends BaseDao { - + + /** + * @return java.lang.Integer + * @param actId + * @param userId + * @author yinzuomei + * @description 被拒绝的总次数 + * @Date 2020/7/23 14:13 + **/ + Integer selectRefusedCount(@Param("actId") String actId, @Param("userId") String userId); + + /** + * @return com.epmet.dto.ActUserLogDTO + * @param actId + * @param userId + * @author yinzuomei + * @description 最后被拒绝的记录 + * @Date 2020/7/23 14:13 + **/ + ActUserLogDTO selectLatestRefused(@Param("actId") String actId, @Param("userId") String userId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java index facb735601..0aa11f07ef 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java @@ -61,4 +61,31 @@ public interface ActUserRelationDao extends BaseDao { * @Date 2020/7/22 18:20 **/ Integer selectCountUser(@Param("actId") String actId, @Param("status")String status); + + /** + * @return java.lang.Integer + * @param userId + * @author yinzuomei + * @description 实际参加活动个数(已经签到的) + * @Date 2020/7/23 15:56 + **/ + Integer countSignInActNum(String userId); + + /** + * @return java.lang.Integer + * @param userId + * @author yinzuomei + * @description 报名活动个数(act_user_realation) + * @Date 2020/7/23 15:57 + **/ + Integer countSignUpActNum(String userId); + + /** + * @return java.lang.Integer + * @param userId + * @author yinzuomei + * @description 获得积分活动个数 + * @Date 2020/7/23 15:57 + **/ + Integer countObtainPointsActNum(String userId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserLogEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserLogEntity.java index 101f3c9556..ac05ba61d1 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserLogEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserLogEntity.java @@ -18,13 +18,10 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; - /** * 用户活动关系日志表 * @@ -50,13 +47,14 @@ public class ActUserLogEntity extends BaseEpmetEntity { /** * 操作类型(已报名/待审核auditing, -审核通过passed, -审核不通过refused -取消报名canceld, -发放积分rewarded -拒绝发放积分refuse_reward -重新处理processing -) + * 审核通过passed, + * 审核不通过refused + * 取消报名canceld, + * 已签到signedin + * 发放积分rewarded + * 拒绝发放积分refuse_reward + * 重新处理processing + * ) */ private String operationType; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java index 82b846a23a..640be2d5cf 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java @@ -1,5 +1,6 @@ package com.epmet.service; +import com.epmet.dto.form.work.AactUserDetailFormDTO; import com.epmet.dto.form.work.AuditingActUserFormDTO; import com.epmet.dto.result.work.*; @@ -56,4 +57,13 @@ public interface WorkActUserService { * @Date 2020/7/22 17:02 **/ ActSignUpStatResultDTO getActSignUpStat(String actId); + + /** + * @return com.epmet.dto.result.work.AuditingUserDetailResultDTO + * @param formDTO + * @author yinzuomei + * @description 报名审核-待审核人员详情 + * @Date 2020/7/22 22:44 + **/ + AuditingUserDetailResultDTO queryAuditingUserDetail(AactUserDetailFormDTO formDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java index a28beae020..0a7004388b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java @@ -1,10 +1,15 @@ package com.epmet.service.impl; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.ActConstant; import com.epmet.dao.ActInfoDao; +import com.epmet.dao.ActUserLogDao; +import com.epmet.dao.ActUserRelationDao; +import com.epmet.dto.ActUserLogDTO; import com.epmet.dto.ActUserRelationDTO; import com.epmet.dto.HeartUserInfoDTO; +import com.epmet.dto.form.work.AactUserDetailFormDTO; import com.epmet.dto.form.work.AuditingActUserFormDTO; import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.dto.result.work.*; @@ -37,6 +42,10 @@ public class WorkActUserServiceImpl implements WorkActUserService { private EpmetUserOpenFeignClient epmetUserOpenFeignClient; @Autowired private ActInfoDao actInfoDao; + @Autowired + private ActUserLogDao actUserLogDao; + @Autowired + private ActUserRelationDao actUserRelationDao; /** * @param formDTO * @return java.util.List @@ -56,7 +65,7 @@ public class WorkActUserServiceImpl implements WorkActUserService { //查询出待审核的人员id集合 List userIdList=actUserRelationService.getUserIdList(formDTO.getActId(), ActConstant.ACT_USER_STATUS_AUDITING); //根据待审核的人员集合,查询出用户基本信息 - List userInfoList=this.queryUserBaseInfo(userIdList); + List userInfoList=this.queryUserBaseInfoList(userIdList); for(ActUserRelationDTO actUserRelationDTO:actUserRelationDTOList){ AuditingActUserResultDTO auditingDTO=new AuditingActUserResultDTO(); auditingDTO.setActUserRelationId(actUserRelationDTO.getId()); @@ -98,7 +107,7 @@ public class WorkActUserServiceImpl implements WorkActUserService { //查询已通过审核的人员id集合 List userIdList=actUserRelationService.getUserIdList(formDTO.getActId(), ActConstant.ACT_USER_STATUS_PASSED); //根据已通过的人员集合,查询出用户基本信息 - List userInfoList=this.queryUserBaseInfo(userIdList); + List userInfoList=this.queryUserBaseInfoList(userIdList); for(ActUserRelationDTO actUserRelationDTO:actUserRelationDTOList){ PassedActUserResultDTO passedDTO=new PassedActUserResultDTO(); passedDTO.setActUserRelationId(actUserRelationDTO.getId()); @@ -141,7 +150,7 @@ public class WorkActUserServiceImpl implements WorkActUserService { //查询已拒绝审核的人员id集合 List userIdList=actUserRelationService.getUserIdList(formDTO.getActId(), ActConstant.ACT_USER_STATUS_REFUSED); //根据已拒绝的人员集合,查询出用户基本信息 - List userInfoList=this.queryUserBaseInfo(userIdList); + List userInfoList=this.queryUserBaseInfoList(userIdList); for(ActUserRelationDTO actUserRelationDTO:actUserRelationDTOList){ RejectedActUserResultDTO rejectedDTO=new RejectedActUserResultDTO(); rejectedDTO.setActUserRelationId(actUserRelationDTO.getId()); @@ -185,7 +194,7 @@ public class WorkActUserServiceImpl implements WorkActUserService { //查询已取消审核的人员id集合 List userIdList=actUserRelationService.getUserIdList(formDTO.getActId(), ActConstant.ACT_USER_STATUS_CANCELD); //根据已取消的人员集合,查询出用户基本信息 - List userInfoList=this.queryUserBaseInfo(userIdList); + List userInfoList=this.queryUserBaseInfoList(userIdList); for(ActUserRelationDTO actUserRelationDTO:actUserRelationDTOList){ CanceledActUserResultDTO cancelDTO=new CanceledActUserResultDTO(); cancelDTO.setActUserRelationId(actUserRelationDTO.getId()); @@ -241,6 +250,89 @@ public class WorkActUserServiceImpl implements WorkActUserService { return actInfo; } + /** + * @param formDTO + * @return com.epmet.dto.result.work.AuditingUserDetailResultDTO + * @author yinzuomei + * @description 报名审核-待审核人员详情 + * @Date 2020/7/22 22:44 + **/ + @Override + public AuditingUserDetailResultDTO queryAuditingUserDetail(AactUserDetailFormDTO formDTO) { + ActUserRelationDTO actUserRelationDTO=actUserRelationService.get(formDTO.getActUserRelationId()); + UserBaseInfoResultDTO userBaseInfo=queryUserBaseInfo(actUserRelationDTO.getUserId()); + AuditingUserDetailResultDTO resultDTO=new AuditingUserDetailResultDTO(); + //基本信息赋值 + resultDTO.setActId(actUserRelationDTO.getActId()); + resultDTO.setUserId(actUserRelationDTO.getUserId()); + resultDTO.setRealName(userBaseInfo.getRealName()); + resultDTO.setGender(userBaseInfo.getGender()); + resultDTO.setMobile(userBaseInfo.getMobile()); + resultDTO.setIdNum(userBaseInfo.getIdNum()); + resultDTO.setAddress(userBaseInfo.getStreet()+userBaseInfo.getDistrict()+userBaseInfo.getBuildingAddress()); + resultDTO.setSignUpTime(actUserRelationDTO.getCreatedTime()); + /** + * 当前状态(已报名/待审核auditing, + 审核通过passed, + 审核不通过refused + 取消报名canceld, + ) + */ + resultDTO.setStatus(actUserRelationDTO.getStatus()); + HistoricalActInfo historicalActInfo=this.getHistoricalActInfo(actUserRelationDTO.getUserId()); + resultDTO.setHistoricalActInfo(historicalActInfo); + if(ActConstant.ACT_USER_STATUS_AUDITING.equals(resultDTO.getStatus())){ + //被拒绝过,才赋值 + Integer refusedCount=actUserLogDao.selectRefusedCount(actUserRelationDTO.getActId(),actUserRelationDTO.getUserId()); + if(null!=refusedCount&&refusedCount>0){ + ActUserLogDTO latestRefused=actUserLogDao.selectLatestRefused(actUserRelationDTO.getActId(),actUserRelationDTO.getUserId()); + HistoricalAuditResult historicalAuditResult=new HistoricalAuditResult(); + historicalAuditResult.setLatestAuditTime(latestRefused.getCreatedTime()); + historicalAuditResult.setLatestRefusedReason(latestRefused.getReason()); + historicalAuditResult.setRefusedCountDesc(String.format("已拒绝%s次",refusedCount)); + resultDTO.setHistoricalAuditResult(historicalAuditResult); + } + }else if(ActConstant.ACT_USER_STATUS_PASSED.equals(resultDTO.getStatus())||ActConstant.ACT_USER_STATUS_REFUSED.equals(resultDTO.getStatus())){ + AuditResult auditResult=new AuditResult(); + auditResult.setAuditTime(actUserRelationDTO.getAuditTime()); + auditResult.setRefusedReason(actUserRelationDTO.getFailureReason()); + resultDTO.setAuditResult(auditResult); + }else if(ActConstant.ACT_USER_STATUS_CANCELD.equals(resultDTO.getStatus())){ + CancelResult cancelResult=new CancelResult(); + cancelResult.setCancelReason(actUserRelationDTO.getCancelReason()); + cancelResult.setCancelTime(actUserRelationDTO.getCancelTime()); + resultDTO.setCancelResult(cancelResult); + } + return resultDTO; + } + + /** + * @return com.epmet.dto.result.work.HistoricalActInfo + * @param userId + * @author yinzuomei + * @description 用户历史活动情况 + * @Date 2020/7/23 15:56 + **/ + private HistoricalActInfo getHistoricalActInfo(String userId) { + HistoricalActInfo historicalActInfo=new HistoricalActInfo(); + /** + * 实际参加活动个数(已经签到的) + */ + Integer signInActNum=actUserRelationDao.countSignInActNum(userId); + historicalActInfo.setSignInActNum(signInActNum); + /** + * 报名活动个数(act_user_realation) + */ + Integer signUpActNum=actUserRelationDao.countSignUpActNum(userId); + historicalActInfo.setSignUpActNum(signUpActNum); + /** + * 获得积分活动个数 + */ + Integer obtainPointsActNum=actUserRelationDao.countObtainPointsActNum(userId); + historicalActInfo.setObtainPointsActNum(obtainPointsActNum); + return historicalActInfo; + } + private Boolean getVolunteerFlag(String userId) { HeartUserInfoDTO heartUserInfoDTO=heartUserInfoService.getByUserId(userId); //true: 是志愿者 false : 不是志愿者 @@ -257,7 +349,7 @@ public class WorkActUserServiceImpl implements WorkActUserService { * @description 传入用户id集合,返回用户的基本信息(包含微信基本信息) * @Date 2020/7/22 10:38 **/ - private List queryUserBaseInfo(List userIdList) { + private List queryUserBaseInfoList(List userIdList) { List userInfoList=new ArrayList<>(); if(null==userIdList||userIdList.size()==0){ return userInfoList; @@ -271,4 +363,22 @@ public class WorkActUserServiceImpl implements WorkActUserService { } return userInfoList; } + + /** + * @return com.epmet.dto.result.UserBaseInfoResultDTO + * @param userId + * @author yinzuomei + * @description 根据用户id获取用户基本信息 + * @Date 2020/7/23 12:52 + **/ + private UserBaseInfoResultDTO queryUserBaseInfo(String userId) { + List userIdList = new ArrayList<>(); + userIdList.add(userId); + //调用epemet_user服务获取用户的基本信息 + Result> resultUserList = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); + if (!resultUserList.success() || resultUserList.getData().size() < 1 || null == resultUserList.getData().get(0)) { + throw new RenException("查询用户基本信息失败"); + } + return resultUserList.getData().get(0); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserLogDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserLogDao.xml index 67716c10d3..5df946833d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserLogDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserLogDao.xml @@ -16,6 +16,30 @@ - - + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml index f7531ff65a..ff144eb5d6 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml @@ -61,4 +61,39 @@ AND aur.`STATUS` =#{status} AND aur.ACT_ID = #{actId} + + + + + + + + + \ No newline at end of file From 6471044f6ecf2f8534830cdd935f2e926c04eac8 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 23 Jul 2020 16:18:16 +0800 Subject: [PATCH 43/98] =?UTF-8?q?=E7=A7=AF=E5=88=86=E8=A7=84=E5=88=99?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/constant/StrConstant.java | 10 + epmet-gateway/pom.xml | 4 +- .../src/main/resources/bootstrap.yml | 2 + .../java/com/epmet/dto/form/EventFormDTO.java | 4 +- .../com/epmet/controller/EventController.java | 10 +- .../java/com/epmet/entity/EventEntity.java | 5 +- .../java/com/epmet/enu/SysResponseEnum.java | 6 +- .../epmet/service/impl/EventServiceImpl.java | 11 - .../db/migration/epmet_common_service.sql | 37 +- .../src/main/resources/mapper/EventDao.xml | 2 +- .../com/epmet/dto/form/PointRuleFormDTO.java | 40 +- .../com/epmet/common/enu/PointUnitEnum.java | 8 +- .../com/epmet/common/enu/SysResponseEnum.java | 1 + .../com/epmet/config/MqSubcribeConfig.java | 4 +- .../epmet/controller/BackDoorController.java | 23 +- .../com/epmet/entity/PointRuleEntity.java | 28 +- .../epmet/entity/RuleOperateLogEntity.java | 4 +- .../service/impl/PointRuleServiceImpl.java | 47 ++- .../resources/db/migration/epmet_point.sql | 6 +- .../main/resources/mapper/PointRuleDao.xml | 4 +- .../resources/mapper/RuleOperateLogDao.xml | 5 +- .../feign/OperCustomizeOpenFeignClient.java | 6 +- .../OperCustomizeOpenFeignClientFallback.java | 3 - .../CustomerFunctionController.java | 2 +- .../impl/CustomerFunctionServiceImpl.java | 357 +++++++++--------- 25 files changed, 340 insertions(+), 289 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java index a7ae559a01..ef2e916937 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java @@ -53,4 +53,14 @@ public interface StrConstant { * 反斜杠 */ String SEPARATOR = "/"; + + /** + * true + */ + String TRUE = "true"; + + /** + * true + */ + String FALSE = "false"; } diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index 057ba37342..7839322d12 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -282,7 +282,7 @@ lb://epmet-heart-server - http://127.0.0.1:8112 + lb://epmet-point-server @@ -367,7 +367,7 @@ lb://epmet-heart-server - http://127.0.0.1:8112 + lb://epmet-point-server diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index c2105542bb..851ac62764 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -353,6 +353,8 @@ renren: - /resi/group/** - /resi/partymember/** - /gov/grid/** + - /heart/** + - /point/** management: endpoints: web: diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/EventFormDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/EventFormDTO.java index 2c72dd5e4b..10aadcb475 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/EventFormDTO.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/EventFormDTO.java @@ -77,8 +77,8 @@ public class EventFormDTO implements Serializable { /** * 事件功能分组ID 来自oper_customize.customer_function表 */ - @NotBlank(message = "事件功能分组ID不能为空",groups = {AddGroup.class}) - private String eventGroupId; + @NotBlank(message = "功能分组ID不能为空",groups = {AddGroup.class}) + private String functionId; /** * 是否是通用事件 0-否,1-是;消息体内需要体现该字段,通用则说明由业务系统自己计算分值 diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/EventController.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/EventController.java index f07730295b..a9a8108669 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/EventController.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/EventController.java @@ -49,11 +49,11 @@ public class EventController { * "classId":"epmet_heart", * "appId":"202007161443499985fa2d397436d10356542134c8f008c48", * "appName":"党群e事通开发测试", - * "eventCode":"epmet_heart_active_send_point", - * "eventName":"活动发放积分", - * "eventDesc":"给参加活动的人发放积分", - * "eventGroupId":"1234", - * "isCommon":"1" + * "eventCode":"register_volunteer", + * "eventName":"认证志愿者", + * "eventDesc":"给注册志愿者的人发放积分", + * "functionId":"43addd0735230c01eedbb38d721076b0", + * "isCommon":"0" * } */ @PostMapping("addEvent") diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/EventEntity.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/EventEntity.java index 391b11ad40..7db253d389 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/EventEntity.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/EventEntity.java @@ -18,13 +18,10 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; - /** * 事件表 * @@ -71,7 +68,7 @@ public class EventEntity extends BaseEpmetEntity { /** * 事件功能分组ID 来自oper_customize.customer_function表 */ - private String eventGroupId; + private String functionId; /** * 是否是通用事件 0-否,1-是;消息体内需要体现该字段,通用则说明由业务系统自己计算分值 diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/enu/SysResponseEnum.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/enu/SysResponseEnum.java index a34883da65..373689f711 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/enu/SysResponseEnum.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/enu/SysResponseEnum.java @@ -11,17 +11,17 @@ public enum SysResponseEnum { * * 编码样式:【CCCBBOOXX】 * 编码示例说明: - * CCC 中心编码&业务系统 (120-内容扫描服务中心服务) + * CCC 中心编码&业务系统 (103-内容扫描服务中心服务) * BB 业务类型(00-默认 ) * OO 操作类型(00-默认) * */ /*通用枚举 */ - EXCEPTION(12001,"系统异常"), + EXCEPTION(10301,"系统异常"), /*事件 业务 01*/ - EVENT_HAS_ALREADY_EXIST(120010001,"事件已存在无需重复添加"), + EVENT_HAS_ALREADY_EXIST(103010001,"事件已存在无需重复添加"), ; private Integer code; diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/EventServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/EventServiceImpl.java index fed5a58ed3..53f892b9a5 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/EventServiceImpl.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/EventServiceImpl.java @@ -18,13 +18,10 @@ package com.epmet.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.tools.exception.EpmetErrorCode; -import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.EventDao; import com.epmet.dto.form.EventFormDTO; import com.epmet.entity.EventEntity; -import com.epmet.enu.SysResponseEnum; import com.epmet.service.EventService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -41,15 +38,7 @@ public class EventServiceImpl extends BaseServiceImpl imp @Override public void addEvent(EventFormDTO formDTO) { - if (baseDao.getCountByEventCode(formDTO.getEventCode()) > 0) { - log.warn("addEvent fail,msg:{}", SysResponseEnum.EVENT_HAS_ALREADY_EXIST.getMsg()); - return; - } - EventEntity eventEntity = ConvertUtils.sourceToTarget(formDTO, EventEntity.class); - if (eventEntity == null) { - throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); - } baseDao.insert(eventEntity); } diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/epmet_common_service.sql b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/epmet_common_service.sql index bcf0b493c7..2702dde08b 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/epmet_common_service.sql +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/epmet_common_service.sql @@ -418,21 +418,22 @@ INSERT INTO `calender` VALUES ('ffe45e7059c67874f88498cfcfd19b4c', 0, '20200424' SET FOREIGN_KEY_CHECKS = 1; #add by liujianjun 2020-07-16 -CREATE TABLE event( - ID VARCHAR(64) NOT NULL COMMENT '主键' , - CLASS_ID VARCHAR(32) COMMENT '消息网关事件类别ID 从消息网关获取事件类型Id' , - APP_ID VARCHAR(128) COMMENT '消息网关APP_ID' , - APP_NAME VARCHAR(32) COMMENT '消息网关APP_NAME' , - EVENT_CODE VARCHAR(32) COMMENT '事件标识 与消息网关事件tag一致' , - EVENT_NAME VARCHAR(32) COMMENT '事件名称' , - EVENT_DESC VARCHAR(64) COMMENT '事件说明' , - EVENT_GROUP_ID VARCHAR(512) COMMENT '事件功能分组ID 来自oper_customize.customer_function表' , - IS_COMMON VARCHAR(1) COMMENT '是否是通用事件 0-否,1-是;消息体内需要体现该字段,通用则说明由业务系统自己计算分值' , - DEL_FLAG VARCHAR(1) COMMENT '删除标识 0-否,1-是' , - 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 = '事件表'; +CREATE TABLE `event` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CLASS_ID` varchar(32) DEFAULT NULL COMMENT '消息网关事件类别ID 从消息网关获取事件类型Id', + `APP_ID` varchar(128) DEFAULT NULL COMMENT '消息网关APP_ID', + `APP_NAME` varchar(32) DEFAULT NULL COMMENT '消息网关APP_NAME', + `EVENT_CODE` varchar(32) DEFAULT NULL COMMENT '事件标识 与消息网关事件tag一致', + `EVENT_NAME` varchar(32) DEFAULT NULL COMMENT '事件名称', + `EVENT_DESC` varchar(64) DEFAULT NULL COMMENT '事件说明', + `FUNCTION_ID` varchar(64) DEFAULT NULL COMMENT '功能ID 来自oper_customize.customer_function表', + `IS_COMMON` varchar(1) DEFAULT NULL COMMENT '是否是通用事件 0-否,1-是;消息体内需要体现该字段,通用则说明由业务系统自己计算分值', + `DEL_FLAG` varchar(1) DEFAULT NULL COMMENT '删除标识 0-否,1-是', + `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 '更新时间', + PRIMARY KEY (`ID`), + UNIQUE KEY `unx_event_code` (`EVENT_CODE`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='事件表'; diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/EventDao.xml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/EventDao.xml index 9865ab0efa..e5418337ad 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/EventDao.xml +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/EventDao.xml @@ -11,7 +11,7 @@ - + diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointRuleFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointRuleFormDTO.java index fca065c9d6..5d3c6dabfa 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointRuleFormDTO.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointRuleFormDTO.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import lombok.Data; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; /** @@ -16,33 +17,51 @@ import java.io.Serializable; @Data public class PointRuleFormDTO implements Serializable { private static final long serialVersionUID = -3228252683629912008L; + + /** + * 客户Id + */ + @NotBlank(message = "客户Id不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private String customerId; + /** * 积分规则Id */ @NotBlank(message = "积分规则Id不能为空", groups = UpdateGroup.class) private String ruleId; + + /** + * 功能Id + */ + @NotBlank(message = "功能Id不能为空", groups = {AddGroup.class}) + private String functionId; + + /** + * 积分规则名称 + */ + @NotBlank(message = "积分规则名称不能为空", groups = AddGroup.class) + private String ruleName; /** * 积分 */ - @NotBlank(message = "积分不能为空", groups = {AddGroup.class, UpdateGroup.class}) - private String point; + @NotNull(message = "积分不能为空", groups = {UpdateGroup.class}) + private Integer point; /** * 是否开启 */ - @NotBlank(message = "是否开启不能为空", groups = {AddGroup.class, UpdateGroup.class}) + @NotBlank(message = "是否开启不能为空", groups = {UpdateGroup.class}) private String enabledFlag; /** - * 上限开启 + * 是否启用 */ - @NotBlank(message = "积分上限不能为空", groups = {AddGroup.class, UpdateGroup.class}) - private String upLimit; + @NotNull(message = "积分上限不能为空", groups = {UpdateGroup.class}) + private Integer upLimit; /** - * 积分规则Id + * 积分上限描述 */ - @NotBlank(message = "客户Id不能为空", groups = {AddGroup.class, UpdateGroup.class}) - private String customerId; + private String upLimitDesc; //=======系统添加时的属性====== /** @@ -58,9 +77,8 @@ public class PointRuleFormDTO implements Serializable { private String eventCode; /** - * 操作类型 加积分:add;减积分:subtract + * 操作类型 加积分:plus;减积分:minus */ - @NotBlank(message = "操作类型不能为空", groups = AddGroup.class) private String operateType; /** * 获得积分单位 次:time;分钟:minute;小时:hour diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/PointUnitEnum.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/PointUnitEnum.java index ab1d97453c..eefb1d8b4d 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/PointUnitEnum.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/PointUnitEnum.java @@ -14,12 +14,12 @@ public enum PointUnitEnum { ; private String code; - private String name; + private String desc; PointUnitEnum(String code, String name) { this.code = code; - this.name = name; + this.desc = name; } public static PointUnitEnum getEnum(String code) { @@ -36,7 +36,7 @@ public enum PointUnitEnum { return code; } - public String getName() { - return name; + public String getDesc() { + return desc; } } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/SysResponseEnum.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/SysResponseEnum.java index e7ff400906..5ae3c00775 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/SysResponseEnum.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/SysResponseEnum.java @@ -24,6 +24,7 @@ public enum SysResponseEnum { /*积分规则 业务 01*/ THIRD_SERVICE_ERROR(112010001,"调用第三方接口异常"), POINT_RULE_IS_NOT_EXIST(112010002,"积分规则不存在"), + POINT_ENABLE_FLAG_PARAM_ERROR(112010003,"积分规则开启状态参数错误"), ; private Integer code; diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/MqSubcribeConfig.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/MqSubcribeConfig.java index e7e1a33c7f..d8e6ceac75 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/MqSubcribeConfig.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/MqSubcribeConfig.java @@ -30,8 +30,8 @@ public class MqSubcribeConfig { event.setBelongAppId("202007161443499985fa2d397436d10356542134c8f008c48"); event.setEventClass("epmet_heart"); event.setEventTag("active_send_point"); - String callbackUrl = "http://192.168.51.49/point/callback/sendPoint"; - callbackUrl = ""; + String callbackUrl = "http://192.168.1.119/point/callback/sendPoint"; + //callbackUrl = ""; event.setCallbackUrl(callbackUrl); List subscribeFormDTOList = new ArrayList<>(); subscribeFormDTOList.add(event); diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/BackDoorController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/BackDoorController.java index 9d2b01d291..5c9dc10f67 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/BackDoorController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/BackDoorController.java @@ -1,6 +1,7 @@ package com.epmet.controller; -import com.epmet.commons.tools.security.dto.TokenDto; +import com.alibaba.fastjson.JSON; +import com.epmet.common.enu.PointUnitEnum; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; @@ -28,13 +29,23 @@ public class BackDoorController { * @param formDTO * @return */ - @PostMapping(value = "sysadd") + @PostMapping(value = "addpointrule") public Result add(@RequestBody PointRuleFormDTO formDTO) { - TokenDto tokenDTO = new TokenDto(); - tokenDTO.setUserId("default"); - formDTO.setCustomerId(tokenDTO.getCustomerId()); ValidatorUtils.validateEntity(formDTO, AddGroup.class); - pointRuleService.add(tokenDTO, formDTO); + pointRuleService.add(null, formDTO); return new Result().ok(true); } + + public static void main(String[] args) { + PointRuleFormDTO formDTO = new PointRuleFormDTO(); + formDTO.setPoint(0); + formDTO.setUpLimit(0); + //微笑山东 + formDTO.setCustomerId("57a648d230bf459b18ea23fc278c3de7"); + formDTO.setRuleDesc("认证志愿者会获得积分"); + formDTO.setEventCode("register_volunteer"); + formDTO.setPointUnit(PointUnitEnum.TIME.getCode()); + System.out.println(JSON.toJSONString(formDTO)); + + } } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleEntity.java index c2132a4292..dff7131269 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleEntity.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleEntity.java @@ -57,6 +57,11 @@ public class PointRuleEntity extends BaseEpmetEntity { */ private String eventCode; + /** + * 功能分组Id + */ + private String functionId; + /** * 操作类型 加积分:add;减积分:subtract */ @@ -93,20 +98,21 @@ public class PointRuleEntity extends BaseEpmetEntity { if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; PointRuleEntity entity = (PointRuleEntity) o; - return customerId.equals(entity.customerId) && - ruleName.equals(entity.ruleName) && - ruleDesc.equals(entity.ruleDesc) && - eventCode.equals(entity.eventCode) && - operateType.equals(entity.operateType) && - upLimit.equals(entity.upLimit) && - upLimitDesc.equals(entity.upLimitDesc) && - point.equals(entity.point) && - pointUnit.equals(entity.pointUnit) && - enabledFlag.equals(entity.enabledFlag); + return Objects.equals(customerId, entity.customerId) && + Objects.equals(ruleName, entity.ruleName) && + Objects.equals(ruleDesc, entity.ruleDesc) && + Objects.equals(eventCode, entity.eventCode) && + Objects.equals(functionId, entity.functionId) && + Objects.equals(operateType, entity.operateType) && + Objects.equals(upLimit, entity.upLimit) && + Objects.equals(upLimitDesc, entity.upLimitDesc) && + Objects.equals(point, entity.point) && + Objects.equals(pointUnit, entity.pointUnit) && + Objects.equals(enabledFlag, entity.enabledFlag); } @Override public int hashCode() { - return Objects.hash(super.hashCode(), customerId, ruleName, ruleDesc, eventCode, operateType, upLimit, upLimitDesc, point, pointUnit, enabledFlag); + return Objects.hash(super.hashCode(), customerId, ruleName, ruleDesc, eventCode, functionId, operateType, upLimit, upLimitDesc, point, pointUnit, enabledFlag); } } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/RuleOperateLogEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/RuleOperateLogEntity.java index 573a9f52da..b1bfa7c61a 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/RuleOperateLogEntity.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/RuleOperateLogEntity.java @@ -30,7 +30,7 @@ import lombok.EqualsAndHashCode; */ @Data @EqualsAndHashCode(callSuper=false) -@TableName("sys_operate_log") +@TableName("rule_operate_log") public class RuleOperateLogEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; @@ -58,7 +58,7 @@ public class RuleOperateLogEntity extends BaseEpmetEntity { /** * 变更前数据 JSON串 */ - private String befordData; + private String beforeData; /** * 变更后数据 JSON串 diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java index 8e40169645..a0ef4fed91 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java @@ -21,6 +21,8 @@ import com.alibaba.fastjson.JSON; import com.epmet.common.enu.PointUnitEnum; import com.epmet.common.enu.SysResponseEnum; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.Constant; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.enums.CommonOperateTypeEnum; import com.epmet.commons.tools.exception.RenException; @@ -44,8 +46,10 @@ import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.service.PointRuleService; import lombok.extern.slf4j.Slf4j; +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 org.springframework.util.CollectionUtils; import java.util.ArrayList; @@ -111,7 +115,7 @@ public class PointRuleServiceImpl extends BaseServiceImpl fun != null).collect(Collectors.toList()); return result; @@ -123,43 +127,60 @@ public class PointRuleServiceImpl extends BaseServiceImpl UPDATE point_rule diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/RuleOperateLogDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/RuleOperateLogDao.xml index e20a977e8f..0569aa74b5 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/RuleOperateLogDao.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/RuleOperateLogDao.xml @@ -6,11 +6,10 @@ - - + - + diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java index 8707b1cf55..81a0e35046 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java @@ -6,6 +6,9 @@ import com.epmet.dto.form.CustomerFunctionListFormDTO; import com.epmet.dto.result.DefaultFunctionListResultDTO; import com.epmet.feign.fallback.OperCustomizeOpenFeignClientFallback; 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; @@ -17,5 +20,6 @@ import java.util.List; */ @FeignClient(name = ServiceConstant.OPER_CUSTOMIZE_SERVER, fallback = OperCustomizeOpenFeignClientFallback.class) public interface OperCustomizeOpenFeignClient { - Result> getOpenedFunctionList(CustomerFunctionListFormDTO formDTO); + @PostMapping(value = "/oper/customize/customerfunction/getOpenedFunctionList", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result> getOpenedFunctionList(@RequestBody CustomerFunctionListFormDTO formDTO); } diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java index d8e2fa7249..ba959f424b 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java @@ -6,9 +6,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.CustomerFunctionListFormDTO; import com.epmet.dto.result.DefaultFunctionListResultDTO; import com.epmet.feign.OperCustomizeOpenFeignClient; -import org.springframework.http.MediaType; import org.springframework.stereotype.Component; -import org.springframework.web.bind.annotation.PostMapping; import java.util.List; @@ -26,7 +24,6 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe * @return */ @Override - @PostMapping(value = "/oper/customize/customerfunction/getOpenedFunctionList", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) public Result> getOpenedFunctionList(CustomerFunctionListFormDTO formDTO){ return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getOpenedFunctionList", formDTO); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionController.java index 71e165696b..45f4a7ed95 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionController.java @@ -133,7 +133,7 @@ public class CustomerFunctionController { * @param formDTO * @return */ - @PostMapping("openedfunctionlist") + @PostMapping("getOpenedFunctionList") public Result> getOpenedFunctionList(@RequestBody CustomerFunctionListFormDTO formDTO) { return new Result>().ok(customerFunctionService.getOpenedFunctionList(formDTO)); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionServiceImpl.java index dadf4257ea..8d57b09cdb 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionServiceImpl.java @@ -17,7 +17,6 @@ package com.epmet.service.impl; -import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; @@ -63,185 +62,181 @@ import java.util.stream.Collectors; @Service public class CustomerFunctionServiceImpl extends BaseServiceImpl implements CustomerFunctionService { - @Autowired - private CustomerFunctionRedis customerFunctionRedis; - @Autowired - private FunctionDao functionDao; - @Autowired - private OperCrmFeignClient operCrmFeignClient; - - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, CustomerFunctionDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, CustomerFunctionDTO.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 CustomerFunctionDTO get(String id) { - CustomerFunctionEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, CustomerFunctionDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(CustomerFunctionDTO dto) { - CustomerFunctionEntity entity = ConvertUtils.sourceToTarget(dto, CustomerFunctionEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(CustomerFunctionDTO dto) { - CustomerFunctionEntity entity = ConvertUtils.sourceToTarget(dto, CustomerFunctionEntity.class); - updateById(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); - } - - /** - * @param formDTO - * @return - * @Author sun - * @Description 运营端-获取客户功能(已勾选、未勾选)详情列表 - **/ - @Override - public CustomerFunctionListResultDTO customerFunctionList(CustomerFunctionListFormDTO formDTO) { - CustomerFunctionListResultDTO resultDTO = new CustomerFunctionListResultDTO(); - //1:调用oper-crm服务。查询客户基本信息 - Result result = operCrmFeignClient.queryCustomerInfo(formDTO.getCustomerId()); - if (!result.success() || null == result.getData()) { - throw new RenException(CustomerFunctionConstant.SELECT_CUSTOMER_EXCEPTION); - } - CustomerDTO customerDTO = result.getData(); - resultDTO.setCustomerId(customerDTO.getId()); - resultDTO.setCustomerName(customerDTO.getCustomerName()); - resultDTO.setLogo(customerDTO.getLogo()); - - //2:查询所有已上架功能列表(默认、定制功能) - List funList = functionDao.selectShopFunctionList(NumConstant.ONE); - if(null==funList||funList.size() csList = baseDao.selectCustomerFunctionList(formDTO.getCustomerId()); - - //4:封装数据,客户已拥有但已下架的功能不展示 - List defaultFunctionList = new ArrayList<>(); - List customizedFunctionList = new ArrayList<>(); - funList.forEach(fun -> { - //默认功能 - if (fun.getFunctionGroup() == NumConstant.ZERO) { - DefaultFunctionListResultDTO df = new DefaultFunctionListResultDTO(); - df.setFunctionId(fun.getId()); - df.setFunctionName(fun.getFunctionName()); - csList.forEach(cs -> { - if (fun.getId().equals(cs.getFunctionId())) { - df.setFlag(true); - } - }); - defaultFunctionList.add(df); - } - //定制功能 - if (fun.getFunctionGroup() == NumConstant.ONE) { - CustomizedFunctionListResultDTO cf = new CustomizedFunctionListResultDTO(); - cf.setFunctionId(fun.getId()); - cf.setFunctionName(fun.getFunctionName()); - csList.forEach(cs -> { - if (fun.getId().equals(cs.getFunctionId())) { - cf.setFlag(true); - } - }); - customizedFunctionList.add(cf); - } - }); - resultDTO.setDefaultFunctionList(defaultFunctionList); - resultDTO.setCustomizedFunctionList(customizedFunctionList); - return resultDTO; - } - - /** - * @param formDTO - * @return - * @Author sun - * @Description 运营端-保存客户功能关系数据 - **/ - @Override - @Transactional(rollbackFor = Exception.class) - public void saveCustomerFunction(SaveCustomerFunctionFormDTO formDTO) { - //1:逻辑删除旧的客户功能关联数据 - baseDao.updateByCustomerId(formDTO.getCustomerId()); - - //2:批量新增新的客户功能关系数据 - List entityList = new ArrayList<>(); - formDTO.getDefaultFunctionList().forEach(dfId -> { - CustomerFunctionEntity entity = new CustomerFunctionEntity(); - entity.setCustomerId(formDTO.getCustomerId()); - entity.setFunctionId(dfId); - entityList.add(entity); - }); - formDTO.getCustomizedFunctionList().forEach(cfId -> { - CustomerFunctionEntity entity = new CustomerFunctionEntity(); - entity.setCustomerId(formDTO.getCustomerId()); - entity.setFunctionId(cfId); - entityList.add(entity); - }); - insertBatch(entityList); - } - - @Override - public List getOpenedFunctionList(CustomerFunctionListFormDTO formDTO) { - if (StringUtils.isBlank(formDTO.getCustomerId())){ - throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); - } - List result = new ArrayList<>(); - //查询所有已上架功能列表(默认、定制功能) - List funList = functionDao.selectFunctionList(); - if(CollectionUtils.isEmpty(funList)){ - return result; - } - //查询当前客户已拥有的功能 - List openedList = baseDao.selectCustomerFunctionList(formDTO.getCustomerId()); - if(CollectionUtils.isEmpty(openedList)){ - log.warn("getOpenedFunctionList customerId:{} have any function",formDTO.getCustomerId()); - return result; - } - Set openedFunIdSet = openedList.stream().map(CustomerFunctionDTO::getFunctionId).collect(Collectors.toSet()); - for (FunctionDTO function : funList) { - if (openedFunIdSet.contains(function.getId())) { - DefaultFunctionListResultDTO resultDTO = ConvertUtils.sourceToTarget(function, DefaultFunctionListResultDTO.class); - if (resultDTO == null) { - log.error("getOpenedFunctionList convert return null,function:{}", JSON.toJSONString(function)); - continue; - } - result.add(resultDTO); - } - } - return result; - } + @Autowired + private CustomerFunctionRedis customerFunctionRedis; + @Autowired + private FunctionDao functionDao; + @Autowired + private OperCrmFeignClient operCrmFeignClient; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CustomerFunctionDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CustomerFunctionDTO.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 CustomerFunctionDTO get(String id) { + CustomerFunctionEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CustomerFunctionDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CustomerFunctionDTO dto) { + CustomerFunctionEntity entity = ConvertUtils.sourceToTarget(dto, CustomerFunctionEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CustomerFunctionDTO dto) { + CustomerFunctionEntity entity = ConvertUtils.sourceToTarget(dto, CustomerFunctionEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 运营端-获取客户功能(已勾选、未勾选)详情列表 + **/ + @Override + public CustomerFunctionListResultDTO customerFunctionList(CustomerFunctionListFormDTO formDTO) { + CustomerFunctionListResultDTO resultDTO = new CustomerFunctionListResultDTO(); + //1:调用oper-crm服务。查询客户基本信息 + Result result = operCrmFeignClient.queryCustomerInfo(formDTO.getCustomerId()); + if (!result.success() || null == result.getData()) { + throw new RenException(CustomerFunctionConstant.SELECT_CUSTOMER_EXCEPTION); + } + CustomerDTO customerDTO = result.getData(); + resultDTO.setCustomerId(customerDTO.getId()); + resultDTO.setCustomerName(customerDTO.getCustomerName()); + resultDTO.setLogo(customerDTO.getLogo()); + + //2:查询所有已上架功能列表(默认、定制功能) + List funList = functionDao.selectShopFunctionList(NumConstant.ONE); + if (null == funList || funList.size() < NumConstant.ONE) { + return resultDTO; + } + + //3:查询当前客户已拥有的功能 + List csList = baseDao.selectCustomerFunctionList(formDTO.getCustomerId()); + + //4:封装数据,客户已拥有但已下架的功能不展示 + List defaultFunctionList = new ArrayList<>(); + List customizedFunctionList = new ArrayList<>(); + funList.forEach(fun -> { + //默认功能 + if (fun.getFunctionGroup() == NumConstant.ZERO) { + DefaultFunctionListResultDTO df = new DefaultFunctionListResultDTO(); + df.setFunctionId(fun.getId()); + df.setFunctionName(fun.getFunctionName()); + csList.forEach(cs -> { + if (fun.getId().equals(cs.getFunctionId())) { + df.setFlag(true); + } + }); + defaultFunctionList.add(df); + } + //定制功能 + if (fun.getFunctionGroup() == NumConstant.ONE) { + CustomizedFunctionListResultDTO cf = new CustomizedFunctionListResultDTO(); + cf.setFunctionId(fun.getId()); + cf.setFunctionName(fun.getFunctionName()); + csList.forEach(cs -> { + if (fun.getId().equals(cs.getFunctionId())) { + cf.setFlag(true); + } + }); + customizedFunctionList.add(cf); + } + }); + resultDTO.setDefaultFunctionList(defaultFunctionList); + resultDTO.setCustomizedFunctionList(customizedFunctionList); + return resultDTO; + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 运营端-保存客户功能关系数据 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void saveCustomerFunction(SaveCustomerFunctionFormDTO formDTO) { + //1:逻辑删除旧的客户功能关联数据 + baseDao.updateByCustomerId(formDTO.getCustomerId()); + + //2:批量新增新的客户功能关系数据 + List entityList = new ArrayList<>(); + formDTO.getDefaultFunctionList().forEach(dfId -> { + CustomerFunctionEntity entity = new CustomerFunctionEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setFunctionId(dfId); + entityList.add(entity); + }); + formDTO.getCustomizedFunctionList().forEach(cfId -> { + CustomerFunctionEntity entity = new CustomerFunctionEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setFunctionId(cfId); + entityList.add(entity); + }); + insertBatch(entityList); + } + + @Override + public List getOpenedFunctionList(CustomerFunctionListFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getCustomerId())) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + List result = new ArrayList<>(); + //查询所有已上架功能列表(默认、定制功能) + List funList = functionDao.selectFunctionList(); + if (CollectionUtils.isEmpty(funList)) { + return result; + } + //查询当前客户已拥有的功能 + List openedList = baseDao.selectCustomerFunctionList(formDTO.getCustomerId()); + if (CollectionUtils.isEmpty(openedList)) { + log.warn("getOpenedFunctionList customerId:{} have any function", formDTO.getCustomerId()); + return result; + } + Set openedFunIdSet = openedList.stream().map(CustomerFunctionDTO::getFunctionId).collect(Collectors.toSet()); + return funList.stream().filter(fun -> openedFunIdSet.contains(fun.getId())) + .map(fun -> { + DefaultFunctionListResultDTO resultDTO = new DefaultFunctionListResultDTO(); + resultDTO.setFunctionId(fun.getId()); + resultDTO.setFunctionName(fun.getFunctionName()); + return resultDTO; + }).collect(Collectors.toList()); + } } \ No newline at end of file From 0d9d30ef15451c54d8e18f13140c0158b71c4c57 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 23 Jul 2020 17:04:08 +0800 Subject: [PATCH 44/98] =?UTF-8?q?heart-work:=E6=8A=A5=E5=90=8D=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8-=E4=BA=BA=E5=91=98=E5=8E=86=E5=8F=B2=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8=E6=83=85=E5=86=B5api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/work/UserHistoricalActFormDTO.java | 22 ++++++++ .../result/work/UserHistoricalActInfoDTO.java | 56 +++++++++++++++++++ .../work/UserHistoricalActResultDTO.java | 54 ++++++++++++++++++ .../controller/WorkActUserController.java | 14 +++++ .../com/epmet/dao/ActUserRelationDao.java | 10 ++++ .../com/epmet/service/WorkActUserService.java | 10 ++++ .../service/impl/WorkActUserServiceImpl.java | 27 +++++++++ .../resources/mapper/ActUserRelationDao.xml | 27 +++++++++ 8 files changed, 220 insertions(+) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/UserHistoricalActFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserHistoricalActInfoDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserHistoricalActResultDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/UserHistoricalActFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/UserHistoricalActFormDTO.java new file mode 100644 index 0000000000..26e2944e35 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/UserHistoricalActFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.form.work; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 报名审核-人员历史活动情况入参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 16:12 + */ +@Data +public class UserHistoricalActFormDTO implements Serializable { + public interface AddUserInternalGroup {} + /** + * 居民端用户id + */ + @NotBlank(message = "居民端用户id不能为空", groups = {AddUserInternalGroup.class}) + private String userId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserHistoricalActInfoDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserHistoricalActInfoDTO.java new file mode 100644 index 0000000000..c4bbb1f100 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserHistoricalActInfoDTO.java @@ -0,0 +1,56 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 历史活动列表 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 16:19 + */ +@Data +public class UserHistoricalActInfoDTO implements Serializable { + private static final long serialVersionUID = 3703921511083310251L; + /** + * 活动id + */ + private String actId; + /** + * 活动标题 + */ + private String title; + /** + * 活动地址 + */ + private String actAddress; + /** + * 签到时间yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date signInTime; + /** + * 服务时长单位120分钟 + */ + private Integer kindNessTime; + /** + * 可得积分 + */ + private Integer reward; + /** + * 正常发放:agree, 拒绝发放:deny + */ + private String rewardFlag; + /** + * 拒绝给分的理由 + */ + private String denyRewardReason; + + /** + * 已处理: handled; 默认"",重新处理时reward_flag置为空字符串 + */ + private String processFlag; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserHistoricalActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserHistoricalActResultDTO.java new file mode 100644 index 0000000000..a6046ffd63 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserHistoricalActResultDTO.java @@ -0,0 +1,54 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 16:15 + */ +@Data +public class UserHistoricalActResultDTO implements Serializable { + private static final long serialVersionUID = 7437428110692437615L; + /** + * 居民端用户id + */ + private String userId; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * 昵称 + */ + private String nickName; + + /** + * 姓名 + */ + private String realName; + + /** + * 实际参加活动个数 + */ + private Integer signInActNum; + /** + * 报名活动个数 + */ + private Integer signUpActNum; + /** + * 获得积分活动个数 + */ + private Integer obtainPointsActNum; + + /** + *历史活动列表 + */ + private List actInfoList; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java index 44a3151650..2e280d6cce 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java @@ -4,6 +4,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.work.AactUserDetailFormDTO; import com.epmet.dto.form.work.AuditingActUserFormDTO; +import com.epmet.dto.form.work.UserHistoricalActFormDTO; import com.epmet.dto.result.work.*; import com.epmet.service.WorkActUserService; import org.springframework.beans.factory.annotation.Autowired; @@ -105,4 +106,17 @@ public class WorkActUserController { ValidatorUtils.validateEntity(formDTO, AactUserDetailFormDTO.AddUserInternalGroup.class); return new Result().ok(workActUserService.queryAuditingUserDetail(formDTO)); } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param + * @author yinzuomei + * @description 报名审核-人员历史活动情况 + * @Date 2020/7/23 16:12 + **/ + @PostMapping("historicalact") + public Result queryUserHistoricalAct(@RequestBody UserHistoricalActFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, UserHistoricalActFormDTO.AddUserInternalGroup.class); + return new Result().ok(workActUserService.queryUserHistoricalAct(formDTO)); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java index 547ea17bc7..2c901f5717 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java @@ -19,6 +19,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.ActUserRelationDTO; +import com.epmet.dto.result.work.UserHistoricalActInfoDTO; import com.epmet.entity.ActUserRelationEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -108,4 +109,13 @@ public interface ActUserRelationDao extends BaseDao { * @Date 2020/7/23 15:57 **/ Integer countObtainPointsActNum(String userId); + + /** + * @return java.util.List + * @param userId + * @author yinzuomei + * @description 根据userId,查询参与活动记录 + * @Date 2020/7/23 16:46 + **/ + List selectAllByUserId(String userId); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java index 640be2d5cf..cfa875b824 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java @@ -2,6 +2,7 @@ package com.epmet.service; import com.epmet.dto.form.work.AactUserDetailFormDTO; import com.epmet.dto.form.work.AuditingActUserFormDTO; +import com.epmet.dto.form.work.UserHistoricalActFormDTO; import com.epmet.dto.result.work.*; import java.util.List; @@ -66,4 +67,13 @@ public interface WorkActUserService { * @Date 2020/7/22 22:44 **/ AuditingUserDetailResultDTO queryAuditingUserDetail(AactUserDetailFormDTO formDTO); + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 报名审核-人员历史活动情况 + * @Date 2020/7/23 16:16 + **/ + UserHistoricalActResultDTO queryUserHistoricalAct(UserHistoricalActFormDTO formDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java index 0a7004388b..50dd295bf1 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java @@ -11,6 +11,7 @@ import com.epmet.dto.ActUserRelationDTO; import com.epmet.dto.HeartUserInfoDTO; import com.epmet.dto.form.work.AactUserDetailFormDTO; import com.epmet.dto.form.work.AuditingActUserFormDTO; +import com.epmet.dto.form.work.UserHistoricalActFormDTO; import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.dto.result.work.*; import com.epmet.feign.EpmetUserOpenFeignClient; @@ -306,6 +307,32 @@ public class WorkActUserServiceImpl implements WorkActUserService { return resultDTO; } + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 报名审核-人员历史活动情况 + * @Date 2020/7/23 16:16 + **/ + @Override + public UserHistoricalActResultDTO queryUserHistoricalAct(UserHistoricalActFormDTO formDTO) { + UserHistoricalActResultDTO resultDTO=new UserHistoricalActResultDTO(); + UserBaseInfoResultDTO userBaseInfoResultDTO=this.queryUserBaseInfo(formDTO.getUserId()); + //基本信息 + resultDTO.setUserId(formDTO.getUserId()); + resultDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); + resultDTO.setNickName(userBaseInfoResultDTO.getNickname()); + resultDTO.setRealName(userBaseInfoResultDTO.getRealName()); + //参与活动统计值 + HistoricalActInfo historicalActInfo=getHistoricalActInfo(formDTO.getUserId()); + resultDTO.setSignInActNum(historicalActInfo.getSignInActNum()); + resultDTO.setSignUpActNum(historicalActInfo.getSignUpActNum()); + resultDTO.setObtainPointsActNum(historicalActInfo.getObtainPointsActNum()); + //历史活动列表 + resultDTO.setActInfoList(actUserRelationDao.selectAllByUserId(formDTO.getUserId())); + return resultDTO; + } + /** * @return com.epmet.dto.result.work.HistoricalActInfo * @param userId diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml index 5d54c3309b..1c60d1b7af 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml @@ -129,4 +129,31 @@ and REWARD_FLAG='agree' AND acu.USER_ID = #{userId} + + + From 3629bd26620144579d898d39d1d3be0986454e45 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 23 Jul 2020 17:33:30 +0800 Subject: [PATCH 45/98] =?UTF-8?q?=E7=A7=AF=E5=88=86=E8=A7=84=E5=88=99?= =?UTF-8?q?=E6=B6=88=E8=B4=B9=E6=B6=88=E6=81=AF=E6=8E=A5=E5=8F=A3=E6=9A=82?= =?UTF-8?q?=E5=AD=98=EF=BC=9B2=E6=8E=A5=E5=85=A5=E9=92=89=E9=92=89?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=97=A5=E5=BF=97=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/mq/eventmsg/BasePointEventMsg.java | 45 +++++++++++++ .../epmet-heart/epmet-heart-server/pom.xml | 9 +++ .../src/main/resources/logback-spring.xml | 8 ++- .../epmet-point/epmet-point-server/pom.xml | 9 +++ .../controller/MqPointCallbackController.java | 63 ++++++++++++++++++- .../src/main/resources/logback-spring.xml | 8 ++- 6 files changed, 137 insertions(+), 5 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/BasePointEventMsg.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/BasePointEventMsg.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/BasePointEventMsg.java new file mode 100644 index 0000000000..435234f7dd --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/BasePointEventMsg.java @@ -0,0 +1,45 @@ +package com.epmet.commons.tools.dto.form.mq.eventmsg; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:积分相关事件消息体 + * + * @author lyn + * @date 2020/7/23 16:34 + */ +@Data +public class BasePointEventMsg implements Serializable { + private static final long serialVersionUID = 4037225404113743943L; + + /** + * 操作人机关id + */ + private String opAgencyId; + + /** + * 客户Id + */ + private String customerId; + /** + * 被操作用户id + */ + private String userId; + + /** + * 加减分标识 plus/minus + */ + private String actionFlag; + + /** + * 积分值 + */ + private Integer point; + + /** + * 是否是通用事件,通用事件不走规则 + */ + private Boolean isCommon; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/pom.xml b/epmet-module/epmet-heart/epmet-heart-server/pom.xml index e245a2cdc9..892bc020c0 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/pom.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/pom.xml @@ -138,6 +138,9 @@ producerService/producer/sendMsg 202007161443499985fa2d397436d10356542134c8f008c48 52d9d9b0e7d0eb5b8b81c205b579e07c + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 @@ -176,6 +179,9 @@ producerService/producer/sendMsg 202007161443499985fa2d397436d10356542134c8f008c48 52d9d9b0e7d0eb5b8b81c205b579e07c + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 @@ -214,6 +220,9 @@ producerService/producer/sendMsg 202007161443499985fa2d397436d10356542134c8f008c48 52d9d9b0e7d0eb5b8b81c205b579e07c + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/logback-spring.xml index 512e302761..aacc15fdab 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/logback-spring.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,13 @@ 15 - - + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} diff --git a/epmet-module/epmet-point/epmet-point-server/pom.xml b/epmet-module/epmet-point/epmet-point-server/pom.xml index a6eef46a98..170eaf13f1 100644 --- a/epmet-module/epmet-point/epmet-point-server/pom.xml +++ b/epmet-module/epmet-point/epmet-point-server/pom.xml @@ -137,6 +137,9 @@ false + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 @@ -169,6 +172,9 @@ true + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 @@ -201,6 +207,9 @@ true + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/MqPointCallbackController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/MqPointCallbackController.java index aeaca6e25d..51146befb0 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/MqPointCallbackController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/MqPointCallbackController.java @@ -2,12 +2,17 @@ package com.epmet.controller; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.dto.form.mq.ReceiveMqMsg; +import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.service.UserPointActionLogService; import dto.form.SendPointFormDTO; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -16,7 +21,6 @@ import org.springframework.web.bind.annotation.RestController; * * @date: 2020/7/21 9:04 * @author: jianjun liu - * email:liujianjun@git.elinkit.com.cn */ @Slf4j @RestController @@ -24,6 +28,9 @@ import org.springframework.web.bind.annotation.RestController; public class MqPointCallbackController { private Logger logger = LogManager.getLogger(MqPointCallbackController.class); + @Autowired + private UserPointActionLogService userPointActionLogService; + /** * desc:爱心活动积分发放 * @@ -38,8 +45,62 @@ public class MqPointCallbackController { return "success"; } SendPointFormDTO formDTO = ConvertUtils.sourceToTarget(mqMsg.getMsg(), SendPointFormDTO.class); + try { + //TODO 调用调整积分方法去给用户加减积分 userPointActionLogService. + } catch (Exception e) { + logger.error("activeSendPoint consume fail,msg:{}",JSON.toJSONString(mqMsg.getMsg())); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getMsg()); + } log.info("activeSendPoint consumer success,formDTO:{}", JSON.toJSONString(formDTO)); return "success"; } + + /** + * desc:爱心互助-志愿者注册消息 + * + * @param mqMsg + * @return + */ + @RequestMapping("registervolunteer") + public String registerVolunteer(ReceiveMqMsg mqMsg) { + log.debug("registerVolunteer receive mqMsg:{}", JSON.toJSONString(mqMsg)); + if (mqMsg == null || StringUtils.isBlank(mqMsg.getMsg())) { + log.warn("registerVolunteer mqMsg is empty"); + return "success"; + } + BasePointEventMsg formDTO = ConvertUtils.sourceToTarget(mqMsg.getMsg(), BasePointEventMsg.class); + try { + //TODO 调用调整积分方法去给用户加减积分 userPointActionLogService. + } catch (Exception e) { + logger.error("registerVolunteer consume fail,msg:{}",JSON.toJSONString(mqMsg.getMsg())); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getMsg()); + } + log.info("registerVolunteer consumer success,formDTO:{}", JSON.toJSONString(formDTO)); + return "success"; + } + + /** + * desc:爱心互助-发布实况消息 + * + * @param mqMsg + * @return + */ + @RequestMapping("pubactivelive") + public String pubActiveLive(ReceiveMqMsg mqMsg) { + log.debug("pubActiveLive receive mqMsg:{}", JSON.toJSONString(mqMsg)); + if (mqMsg == null || StringUtils.isBlank(mqMsg.getMsg())) { + log.warn("pubActiveLive mqMsg is empty"); + return "success"; + } + BasePointEventMsg formDTO = ConvertUtils.sourceToTarget(mqMsg.getMsg(), BasePointEventMsg.class); + try { + //TODO 调用调整积分方法去给用户加减积分 userPointActionLogService. + } catch (Exception e) { + logger.error("pubActiveLive consume fail,msg:{}",JSON.toJSONString(mqMsg.getMsg())); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getMsg()); + } + log.info("pubActiveLive consumer success,formDTO:{}", JSON.toJSONString(formDTO)); + return "success"; + } } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/logback-spring.xml index e862b078ef..916c58edbb 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/logback-spring.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/logback-spring.xml @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,13 @@ 15 - - + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} From 423a9fef1d2f547a9f155bb4a2570b4edbf2f5b3 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Thu, 23 Jul 2020 17:35:01 +0800 Subject: [PATCH 46/98] =?UTF-8?q?=E7=88=B1=E5=BF=83=E4=BA=92=E5=8A=A9-?= =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=AB=AF=E6=8E=A5=E5=8F=A33?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/exception/EpmetErrorCode.java | 2 + .../main/java/com/epmet/dto/ActInfoDTO.java | 9 +- .../dto/form/resi/ActUserClockLogFormDTO.java | 81 -------------- .../form/resi/ResiActRegistrationFormDTO.java | 61 +++++++++++ .../dto/form/resi/ResiActSignInFormDTO.java | 1 - .../ResiVolunteerAuthenticateFormDTO.java | 13 ++- .../com/epmet/feign/EpmetUserFeignClient.java | 14 +++ .../EpmetUserFeignClientFallBack.java | 8 +- .../controller/ResiActListController.java | 14 +++ .../main/java/com/epmet/dao/ActInfoDao.java | 10 ++ .../java/com/epmet/dao/ActUserLogDao.java | 12 ++- .../java/com/epmet/dao/HeartUserInfoDao.java | 10 ++ .../java/com/epmet/dao/VolunteerInfoDao.java | 26 ++++- .../com/epmet/entity/VolunteerInfoEntity.java | 4 +- .../com/epmet/service/ActInfoService.java | 12 +++ .../com/epmet/service/ActUserLogService.java | 12 ++- .../epmet/service/ActUserRelationService.java | 12 +++ .../epmet/service/HeartUserInfoService.java | 10 ++ .../service/impl/ActInfoServiceImpl.java | 5 + .../service/impl/ActUserLogServiceImpl.java | 6 +- .../impl/ActUserRelationServiceImpl.java | 102 +++++++++++++++++- .../impl/HeartUserInfoServiceImpl.java | 5 + .../impl/VolunteerInfoServiceImpl.java | 39 +++++-- .../src/main/resources/mapper/ActInfoDao.xml | 13 +++ .../main/resources/mapper/ActUserLogDao.xml | 12 ++- .../resources/mapper/HeartUserInfoDao.xml | 23 ++++ .../resources/mapper/VolunteerInfoDao.xml | 28 ++++- .../com/epmet/controller/UserController.java | 14 +++ 28 files changed, 453 insertions(+), 105 deletions(-) delete mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ActUserClockLogFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActRegistrationFormDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 59a602b124..b977a2e76f 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -76,6 +76,8 @@ public enum EpmetErrorCode { // 爱心互助 居民端 NOT_IN_THE_SIGN_IN_RANGE(8510, "您还未进入指定的签到范围~"), + NON_CERTIFIED_VOLUNTEER(8511, "活动报名失败,请先认证志愿者"), + ACT_TIME_CONFLICT(8512, "活动时间冲突"), // 该错误不会提示给前端,只是后端传输错误信息用。 ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"), diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java index ad18a98c8b..5b6859f190 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java @@ -247,4 +247,11 @@ public class ActInfoDTO implements Serializable { */ private String delFlag; -} \ No newline at end of file + // 虚字段 + + /** + * 用户id + */ + private String userId; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ActUserClockLogFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ActUserClockLogFormDTO.java deleted file mode 100644 index fa7e943ebf..0000000000 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ActUserClockLogFormDTO.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * 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.epmet.dto.form.resi; - -import lombok.Data; - -import javax.validation.constraints.NotBlank; -import java.io.Serializable; -import java.math.BigDecimal; -import java.util.ArrayList; - -/** - * 用户活动打卡参数 - * - * @author zhangyong - * @since v1.0.0 2020-07-14 - */ -@Data -public class ActUserClockLogFormDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 用户ID - */ - private String userId; - /** - * 活动ID - */ - @NotBlank(message = "活动ID不能为空") - private String actId; - /** - * 打卡类型(0-打卡,1-更新打卡) - */ - @NotBlank(message = "打卡类型不能为空") - private String clockType; - /** - * 打卡位置经度 - */ - @NotBlank(message = "打卡位置经度不能为空") - private BigDecimal clockLongitude; - /** - * 打卡位置纬度 - */ - @NotBlank(message = "打卡位置纬度不能为空") - private BigDecimal clockLatitude; - /** - * 打卡地址 - */ - @NotBlank(message = "打卡地址不能为空") - private String clockAddress; - /** - * 打卡描述 - */ - @NotBlank(message = "打卡描述不能为空") - private String clockDesc; - /** - * 打卡是否有效(0-否,1-是) - */ - @NotBlank(message = "打卡是否有效不能为空") - private String effectiveFlag; - /** - * 打卡图片 - */ - private ArrayList images; -} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActRegistrationFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActRegistrationFormDTO.java new file mode 100644 index 0000000000..378b38e40c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActRegistrationFormDTO.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.epmet.dto.form.resi; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 活动报名参数 + * + * @author zhangyong + * @since v1.0.0 2020-07-20 + */ +@Data +public class ResiActRegistrationFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + //>>>>>>>>>>>>>>>>>校验分组开始>>>>>>>>>>>>>>>>>>>>> + /** + * 添加用户操作的内部异常分组 + * 出现错误会提示给前端7000错误码,返回信息为:服务器开小差... + */ + public interface AddUserInternalGroup {} + + // <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<< + + /** + * 用户Id + */ + private String userId; + + /** + * 活动ID + */ + @NotBlank(message = "活动ID不能为空", groups = { AddUserInternalGroup.class }) + private String actId; + + /** + * 客户ID + */ + @NotBlank(message = "客户ID不能为空", groups = { AddUserInternalGroup.class }) + private String customerId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActSignInFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActSignInFormDTO.java index a587969ca2..54363137f7 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActSignInFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActSignInFormDTO.java @@ -21,7 +21,6 @@ import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import javax.validation.constraints.NotBlank; -import java.awt.*; import java.io.Serializable; import java.math.BigDecimal; import java.util.List; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiVolunteerAuthenticateFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiVolunteerAuthenticateFormDTO.java index 26b8591599..497f36f06e 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiVolunteerAuthenticateFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiVolunteerAuthenticateFormDTO.java @@ -34,6 +34,17 @@ public class ResiVolunteerAuthenticateFormDTO implements Serializable { // <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<< + /** + * 用户id + */ + private String userId; + + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空", groups = {AddUserShowGroup.class }) + private String customerId; + /** * 姓 */ @@ -97,7 +108,7 @@ public class ResiVolunteerAuthenticateFormDTO implements Serializable { * 头像 */ @NotBlank(message = "头像不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) - private String headImgUrl; + private String avatarUrl; /** * 志愿者签名 diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index f98f1bc474..c8e1660cd3 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -1,7 +1,10 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.UserRoleFormDTO; +import com.epmet.dto.form.WxUserInfoFormDTO; import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.dto.result.UserRoleResultDTO; import com.epmet.feign.fallback.EpmetUserFeignClientFallBack; @@ -43,4 +46,15 @@ public interface EpmetUserFeignClient { **/ @PostMapping(value = "epmetuser/userrole/getuserroleinfobyuserid/{userId}", consumes = MediaType.APPLICATION_JSON_VALUE) Result> getUserRoleInfoByUserId(@PathVariable("userId") String userId); + + /** + * 同步-居民基础信息、用户微信信息 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 14:37 2020-07-23 + **/ + @PostMapping("epmetuser/user/updateUserBaseAndWxUserInfo") + Result updateUserBaseAndWxUserInfo(@RequestBody WxUserInfoFormDTO formDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java index 71447cb0a6..1238fceed5 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java @@ -1,9 +1,10 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.UserWechatDTO; +import com.epmet.dto.form.WxUserInfoFormDTO; import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.dto.result.UserRoleResultDTO; import com.epmet.feign.EpmetUserFeignClient; @@ -28,4 +29,9 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { public Result> getUserRoleInfoByUserId(String userId) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getUserRoleInfoByUserId", userId); } + + @Override + public Result updateUserBaseAndWxUserInfo(WxUserInfoFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "updateUserBaseAndWxUserInfo", formDTO); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java index 7231d7132a..721723b58e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java @@ -282,4 +282,18 @@ public class ResiActListController { return actSignInRecService.actSignIn(tokenDto, formDTO); } + /** + * 活动报名 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 16:46 2020-07-23 + **/ + @PostMapping("registration") + public Result registration(@LoginUser TokenDto tokenDto, @RequestBody ResiActRegistrationFormDTO formDTO) { + return actUserRelationService.registration(tokenDto, formDTO); + } + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java index 1d4cf03f8b..802096fd8f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java @@ -215,4 +215,14 @@ public interface ActInfoDao extends BaseDao { * @Date 09:56 2020-07-22 **/ List selectListActContent(@Param("actId") String actId); + + /** + * 查询当前报名的活动开始时间-结束时间,是否与其他已报名,未结束的活动,存在交集情况 + * + * @param actInfoDTO + * @return java.lang.Integer + * @Author zhangyong + * @Date 17:17 2020-07-23 + **/ + Integer checkActTime(ActInfoDTO actInfoDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserLogDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserLogDao.java index 6e02e27e48..348a259dde 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserLogDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserLogDao.java @@ -51,4 +51,14 @@ public interface ActUserLogDao extends BaseDao { * @Date 2020/7/23 14:13 **/ ActUserLogDTO selectLatestRefused(@Param("actId") String actId, @Param("userId") String userId); -} \ No newline at end of file + + /** + * 查询我累计【报名过】的活动次数 + * + * @param userId + * @return java.lang.Integer + * @Author zhangyong + * @Date 16:12 2020-07-23 + **/ + Integer countActTimesOfParticipation(@Param("userId") String userId); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java index 4a22ba2ce6..71e1fc67cd 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java @@ -66,4 +66,14 @@ public interface HeartUserInfoDao extends BaseDao { * @Date 18:06 2020-07-22 **/ List selectListLeaderboard(ResiActBaseFormDTO formDTO); + + /** + * 根据用户id,修改用户信息表 + * + * @param dto + * @return void + * @Author zhangyong + * @Date 16:27 2020-07-23 + **/ + void updateHeartUserInfoByUserId(HeartUserInfoDTO dto); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java index 2d23a8d37c..5ceec37857 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java @@ -20,6 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.VolunteerInfoEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 志愿者信息 @@ -29,5 +30,26 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface VolunteerInfoDao extends BaseDao { - -} \ No newline at end of file + + /** + * 查询用户是否是志愿者身份 + * >0 是 + * 0 不是 + * + * @param userId + * @return java.lang.String + * @Author zhangyong + * @Date 14:33 2020-07-23l + **/ + Integer queryVolunteerFlagByUserId(@Param("userId") String userId); + + /** + * 根据用户ID,修改志愿者信息 + * + * @param entity + * @return void + * @Author zhangyong + * @Date 15:05 2020-07-23 + **/ + void updateVolunteerInfoByUserId(VolunteerInfoEntity entity); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/VolunteerInfoEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/VolunteerInfoEntity.java index 6d1a11c42b..484e911fe1 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/VolunteerInfoEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/VolunteerInfoEntity.java @@ -44,8 +44,8 @@ public class VolunteerInfoEntity extends BaseEpmetEntity { private String userId; /** - * 客户id - */ + * 客户id + */ private String customerId; /** diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java index ec70e7e44b..4f67a60cd8 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java @@ -26,6 +26,8 @@ import com.epmet.dto.result.resi.*; import com.epmet.entity.ActInfoEntity; import com.epmet.commons.tools.utils.Result; + +import java.util.Date; import java.util.List; import java.util.Map; @@ -212,4 +214,14 @@ public interface ActInfoService extends BaseService { * @Date 13:39 2020-07-21 **/ Result rejectDetail(TokenDto tokenDto, ResiActDetailFormDTO formDto); + + /** + * 查询当前报名的活动开始时间-结束时间,是否与其他已报名,未结束的活动,存在交集情况 + * + * @param actInfoDTO + * @return java.lang.Integer + * @Author zhangyong + * @Date 17:17 2020-07-23 + **/ + Integer checkActTime(ActInfoDTO actInfoDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserLogService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserLogService.java index 8edb4ef9c5..4eb8fbe83d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserLogService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserLogService.java @@ -92,4 +92,14 @@ public interface ActUserLogService extends BaseService { * @date 2020-07-19 */ void delete(String[] ids); -} \ No newline at end of file + + /** + * 查询我累计报名过的活动次数 + * + * @param userId + * @return java.lang.Integer + * @Author zhangyong + * @Date 16:12 2020-07-23 + **/ + Integer countActTimesOfParticipation(String userId); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java index 17d7d0c93b..f3a135ee6a 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java @@ -22,6 +22,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.ActUserRelationDTO; +import com.epmet.dto.form.resi.ResiActRegistrationFormDTO; import com.epmet.dto.form.resi.ResiActUserCancelSignUpFormDTO; import com.epmet.entity.ActUserRelationEntity; import org.apache.ibatis.annotations.Param; @@ -138,4 +139,15 @@ public interface ActUserRelationService extends BaseService { * @Date 17:42 2020-07-22 **/ Result> leaderboard(ResiActBaseFormDTO formDTO); + + /** + * 根据用户id,修改用户信息表 + * + * @param dto + * @return void + * @Author zhangyong + * @Date 16:27 2020-07-23 + **/ + void updateHeartUserInfoByUserId(HeartUserInfoDTO dto); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java index 550e13d878..18e96e4c23 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java @@ -370,4 +370,9 @@ public class ActInfoServiceImpl extends BaseServiceImpl page(Map params) { @@ -168,4 +193,79 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl NumConstant.ZERO){ + satisfy = true; + } else { + logger.info("活动报名失败,请先认证志愿者"); + throw new RenException(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER.getCode()); + } + } else { + // 活动不限制志愿者身份,但要求是 居民身份 + Result> userRoleInfo = epmetUserFeignClient.getUserRoleInfoByUserId(formDTO.getUserId()); + for (UserRoleResultDTO roleResultDTO :userRoleInfo.getData()){ + if (EpmetRoleKeyConstant.REGISTERED_RESI.equals(roleResultDTO.getRoleKey())){ + satisfy = true; + } + } + if (!satisfy){ + logger.info("活动报名失败,请完善居民信息"); + throw new RenException(EpmetErrorCode.CANNOT_AUDIT_WARM.getCode()); + } + } + if (satisfy){ + this.actStartSignUp(actInfoDTO, formDTO); + } + return new Result(); + } + + private void actStartSignUp(ActInfoDTO actInfoDTO, ResiActRegistrationFormDTO formDTO){ + boolean signUp = true; + Integer auditingNum = actUserLogService.countActTimesOfParticipation(formDTO.getUserId()); + if (auditingNum > NumConstant.ZERO){ + // 2.判断本次报名的活动与之前未结束的活动报名时间 是否产生交集,产生则 报名失败 + actInfoDTO.setUserId(formDTO.getUserId()); + Integer actTimeFlag = actInfoService.checkActTime(actInfoDTO); + if (actTimeFlag > NumConstant.ZERO){ + signUp = false; + logger.info("活动报名失败,活动时间冲突"); + throw new RenException(EpmetErrorCode.ACT_TIME_CONFLICT.getCode()); + } + } else { + // 3.第一次报名 + HeartUserInfoEntity entity = new HeartUserInfoEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setUserId(formDTO.getUserId()); + entity.setVolunteerFlag(true); + entity.setKindnessTime(NumConstant.ZERO); + entity.setParticipationNum(NumConstant.ZERO); + entity.setObtainPointNum(NumConstant.ZERO); + heartUserInfoDao.insert(entity); + } + if (signUp){ + // 4.插入用户活动关系表 + ActUserRelationEntity entity = new ActUserRelationEntity(); + entity.setActId(formDTO.getActId()); + entity.setUserId(formDTO.getUserId()); + entity.setStatus(ActUserRelationStatusConstant.AUDITING); + baseDao.insert(entity); + + // 5.插入活动日志表 + ActUserLogEntity userLogEntity = new ActUserLogEntity(); + userLogEntity.setActId(formDTO.getActId()); + userLogEntity.setUserId(formDTO.getUserId()); + userLogEntity.setOperationType(ActUserRelationStatusConstant.AUDITING); + actUserLogService.insert(userLogEntity); + } + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartUserInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartUserInfoServiceImpl.java index 72e98f3ab0..fead42e055 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartUserInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartUserInfoServiceImpl.java @@ -150,4 +150,9 @@ public class HeartUserInfoServiceImpl extends BaseServiceImpl>().ok(resultDTOS); } + + @Override + public void updateHeartUserInfoByUserId(HeartUserInfoDTO dto) { + baseDao.updateHeartUserInfoByUserId(dto); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java index 88dd354a4c..84e78622c8 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java @@ -20,16 +20,21 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.VolunteerInfoDao; +import com.epmet.dto.HeartUserInfoDTO; import com.epmet.dto.VolunteerInfoDTO; +import com.epmet.dto.form.WxUserInfoFormDTO; import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; import com.epmet.entity.VolunteerInfoEntity; +import com.epmet.feign.EpmetUserFeignClient; import com.epmet.redis.VolunteerInfoRedis; +import com.epmet.service.HeartUserInfoService; import com.epmet.service.VolunteerInfoService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -52,19 +57,33 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl NumConstant.ZERO){ + // 是志愿者:更新志愿者信息表 + baseDao.updateVolunteerInfoByUserId(volunteerInfoEntity); + } else { + // 不是志愿者:插入志愿者信息表 + baseDao.insert(volunteerInfoEntity); + // 更新用户信息表的 是否是志愿者标识 + HeartUserInfoDTO userInfoDTO = new HeartUserInfoDTO(); + userInfoDTO.setUserId(tokenDto.getUserId()); + userInfoDTO.setVolunteerFlag(true); + heartUserInfoService.updateHeartUserInfoByUserId(userInfoDTO); + } + // 更新用户基础信息表 并 更新用户微信表 + WxUserInfoFormDTO wxUserInfoFormDTO = ConvertUtils.sourceToTarget(formDTO, WxUserInfoFormDTO.class); + return epmetUserFeignClient.updateUserBaseAndWxUserInfo(wxUserInfoFormDTO); } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml index 4b50ae3bd4..2680e43176 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml @@ -444,4 +444,17 @@ AND c.ACT_ID = #{actId} ORDER BY c.ORDER_NUM ASC + + + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserLogDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserLogDao.xml index 5df946833d..ed56feda4b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserLogDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserLogDao.xml @@ -42,4 +42,14 @@ order by acl.CREATED_TIME desc limit 1 - \ No newline at end of file + + + + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml index 1c4fdba03f..107007c2dc 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml @@ -55,4 +55,27 @@ ORDER BY ui.KINDNESS_TIME DESC, ui.PARTICIPATION_NUM DESC LIMIT #{pageNo}, #{pageSize} + + + UPDATE heart_user_info + SET + + VOLUNTEER_FLAG = 1, + + + KINDNESS_TIME = #{kindnessTime}, + + + PARTICIPATION_NUM = #{participationNum}, + + + OBTAIN_POINT_NUM = #{obtainPointNum}, + + + UPDATED_BY = #{userId}, + + UPDATED_TIME = now() + WHERE DEL_FLAG = '0' + AND USER_ID = #{userId} + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml index 48854253bb..3555334a07 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml @@ -17,5 +17,31 @@ + - \ No newline at end of file + + UPDATE volunteer_info + SET + + CUSTOMER_ID = #{customerId}, + + + VOLUNTEER_INTRODUCE = #{volunteerIntroduce}, + + + VOLUNTEER_SIGNATURE = #{volunteerSignature}, + + + UPDATED_BY = #{userId}, + + UPDATED_TIME = now() + WHERE DEL_FLAG = '0' + AND USER_ID = #{userId} + + diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java index 9c0f40c8ef..3d028bdfe7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java @@ -132,4 +132,18 @@ public class UserController { return new Result().ok(userService.saveWxUser(formDTO)); } + /** + * 居民端个人信息-同步用户微信信息 + * 供Feign调用 + * + * @param wxUserInfoFormDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 14:51 2020-07-23 + **/ + @PostMapping("updateUserBaseAndWxUserInfo") + public Result updateUserBaseAndWxUserInfo(@RequestBody WxUserInfoFormDTO wxUserInfoFormDTO) { ; + ValidatorUtils.validateEntity(wxUserInfoFormDTO); + return userService.updateWxUserInfo(wxUserInfoFormDTO); + } } From f4764503989009cee61aef0c51673986a8da7c09 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 23 Jul 2020 18:28:10 +0800 Subject: [PATCH 47/98] =?UTF-8?q?heart-work:=E5=AE=A1=E6=A0=B8=E3=80=81?= =?UTF-8?q?=E6=8B=92=E7=BB=9Dapi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/constant/StrConstant.java | 10 ++ .../epmet/dto/form/work/AuditUserFormDTO.java | 31 +++++ .../epmet-heart/epmet-heart-server/pom.xml | 6 + .../java/com/epmet/constant/ActConstant.java | 32 ++++- .../epmet/constant/ActMessageConstant.java | 13 ++ .../controller/WorkActUserController.java | 31 ++++- .../com/epmet/service/WorkActUserService.java | 19 +++ .../service/impl/WorkActUserServiceImpl.java | 123 ++++++++++++++++++ 8 files changed, 260 insertions(+), 5 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AuditUserFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java index ef2e916937..944c8afb2f 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java @@ -63,4 +63,14 @@ public interface StrConstant { * true */ String FALSE = "false"; + + /** + * * + */ + String STAR="*"; + + /** + * 空字符串 + */ + String EPMETY_STR=""; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AuditUserFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AuditUserFormDTO.java new file mode 100644 index 0000000000..580aa5ea7c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AuditUserFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form.work; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 审核通过、拒绝入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 17:28 + */ +@Data +public class AuditUserFormDTO implements Serializable { + private static final long serialVersionUID = 243279409415285207L; + public interface AddUserInternalGroup { + } + public interface UserShowGroup extends CustomerClientShowGroup { + } + /** + * 列表页返回的主键 + */ + @NotBlank(message = "主键不能为空", groups = {AddUserInternalGroup.class}) + private String actUserRelationId; + + @NotBlank(message = "拒绝理由不能为空", groups = {UserShowGroup.class}) + private String rejectReason; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/pom.xml b/epmet-module/epmet-heart/epmet-heart-server/pom.xml index e245a2cdc9..ea9bf2cfa6 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/pom.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/pom.xml @@ -76,6 +76,12 @@ 2.0.0 compile + + com.epmet + epmet-message-client + 2.0.0 + compile + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java index 5b6016b8b1..a13c2bed23 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java @@ -49,22 +49,22 @@ public interface ActConstant { String SPONSOR_GRID="grid"; /** - * 活动操作日志:取消活动 + * act_operation_rec活动操作日志:取消活动 */ String ACT_OPER_TYPE_CANCEL="cancel"; /** - * 活动操作日志:发布活动 + * act_operation_rec活动操作日志:发布活动 */ String ACT_OPER_TYPE_PUBLISH="publish"; /** - * 活动操作日志:结束活动 + * act_operation_rec活动操作日志:结束活动 */ String ACT_OPER_TYPE_FINISH="finish"; /** - * 活动操作日志:重新发布活动 + * act_operation_rec活动操作日志:重新发布活动 */ String ACT_OPER_TYPE_UPDATE="update"; @@ -87,4 +87,28 @@ public interface ActConstant { * (4)act_user_relation表的status:取消报名canceld, */ String ACT_USER_STATUS_CANCELD="canceld"; + + /*操作类型(已报名/待审核auditing, + 审核通过passed, + 审核不通过refused + 取消报名canceld, + 已签到signedin + 发放积分rewarded + 拒绝发放积分refuse_reward + 重新处理processing + )*/ + String ACT_USER_LOG_OPER_AUDITING="auditing"; + String ACT_USER_LOG_OPER_PASSED="passed"; + String ACT_USER_LOG_OPER_REFUSED="refused"; + String ACT_USER_LOG_OPER_CANCELD="canceld"; + String ACT_USER_LOG_OPER_SIGNEDIN="signedin"; + String ACT_USER_LOG_OPER_REWARDED="rewarded"; + String ACT_USER_LOG_OPER_REFUSE_REWARD="refuse_reward"; + String ACT_USER_LOG_OPER_PROCESSING="processing"; + + /** + * 审核通过类型:auto, manual + */ + String PASSEDTYPE_AUTO="auto"; + String PASSEDTYPE_MANUAL="manual"; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java new file mode 100644 index 0000000000..be7530973c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java @@ -0,0 +1,13 @@ +package com.epmet.constant; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 17:55 + */ +public interface ActMessageConstant { + String TITLE="您有一条活动消息"; + String AUDIT_PASSED="您报名的活动%s,已审核通过"; + String AUDIT_REFUSED="您报名的活动%s,审核未通过,原因:%s"; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java index 2e280d6cce..e3a6c97e49 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java @@ -3,6 +3,7 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.work.AactUserDetailFormDTO; +import com.epmet.dto.form.work.AuditUserFormDTO; import com.epmet.dto.form.work.AuditingActUserFormDTO; import com.epmet.dto.form.work.UserHistoricalActFormDTO; import com.epmet.dto.result.work.*; @@ -98,7 +99,7 @@ public class WorkActUserController { * @param formDTO * @return com.epmet.commons.tools.utils.Result * @author yinzuomei - * @description 报名审核-人员详情 + * @description 报名审核-人员详情(待审核、已通过,已拒绝,已取消报名用的是一个api) * @Date 2020/7/22 22:44 **/ @PostMapping("userdetail") @@ -119,4 +120,32 @@ public class WorkActUserController { ValidatorUtils.validateEntity(formDTO, UserHistoricalActFormDTO.AddUserInternalGroup.class); return new Result().ok(workActUserService.queryUserHistoricalAct(formDTO)); } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 报名审核-审核通过 + * @Date 2020/7/23 17:31 + **/ + @PostMapping("auditpass") + public Result auditPass(@RequestBody AuditUserFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, AuditUserFormDTO.AddUserInternalGroup.class); + workActUserService.auditPass(formDTO.getActUserRelationId()); + return new Result(); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 报名审核-拒绝报名 + * @Date 2020/7/23 18:08 + **/ + @PostMapping("auditrefuse") + public Result auditrefuse(@RequestBody AuditUserFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, AuditUserFormDTO.UserShowGroup.class,AuditUserFormDTO.AddUserInternalGroup.class); + workActUserService.auditRefuse(formDTO); + return new Result(); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java index cfa875b824..0d125567c4 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java @@ -1,6 +1,7 @@ package com.epmet.service; import com.epmet.dto.form.work.AactUserDetailFormDTO; +import com.epmet.dto.form.work.AuditUserFormDTO; import com.epmet.dto.form.work.AuditingActUserFormDTO; import com.epmet.dto.form.work.UserHistoricalActFormDTO; import com.epmet.dto.result.work.*; @@ -76,4 +77,22 @@ public interface WorkActUserService { * @Date 2020/7/23 16:16 **/ UserHistoricalActResultDTO queryUserHistoricalAct(UserHistoricalActFormDTO formDTO); + + /** + * @return void + * @param actUserRelationId + * @author yinzuomei + * @description 报名审核-审核通过 + * @Date 2020/7/23 17:30 + **/ + void auditPass(String actUserRelationId); + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 报名审核-拒绝报名 + * @Date 2020/7/23 18:14 + **/ + void auditRefuse(AuditUserFormDTO formDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java index 50dd295bf1..94754726ac 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java @@ -1,19 +1,31 @@ package com.epmet.service.impl; +import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.ActConstant; +import com.epmet.constant.ActMessageConstant; +import com.epmet.constant.ReadFlagConstant; import com.epmet.dao.ActInfoDao; import com.epmet.dao.ActUserLogDao; import com.epmet.dao.ActUserRelationDao; import com.epmet.dto.ActUserLogDTO; import com.epmet.dto.ActUserRelationDTO; import com.epmet.dto.HeartUserInfoDTO; +import com.epmet.dto.form.UserMessageFormDTO; import com.epmet.dto.form.work.AactUserDetailFormDTO; +import com.epmet.dto.form.work.AuditUserFormDTO; import com.epmet.dto.form.work.AuditingActUserFormDTO; import com.epmet.dto.form.work.UserHistoricalActFormDTO; import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.dto.result.work.*; +import com.epmet.entity.ActInfoEntity; +import com.epmet.entity.ActUserLogEntity; +import com.epmet.entity.ActUserRelationEntity; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.service.ActUserRelationService; import com.epmet.service.HeartUserInfoService; @@ -24,6 +36,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; +import java.util.Date; import java.util.List; /** @@ -47,6 +60,10 @@ public class WorkActUserServiceImpl implements WorkActUserService { private ActUserLogDao actUserLogDao; @Autowired private ActUserRelationDao actUserRelationDao; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + @Autowired + private LoginUserUtil loginUserUtil; /** * @param formDTO * @return java.util.List @@ -333,6 +350,112 @@ public class WorkActUserServiceImpl implements WorkActUserService { return resultDTO; } + /** + * @param actUserRelationId + * @return void + * @author yinzuomei + * @description 报名审核-审核通过 + * @Date 2020/7/23 17:30 + **/ + @Override + public void auditPass(String actUserRelationId) { + ActUserRelationEntity actUserRelationEntity=actUserRelationDao.selectById(actUserRelationId); + if(null==actUserRelationEntity||!ActConstant.ACT_USER_STATUS_AUDITING.equals(actUserRelationEntity.getStatus())){ + logger.info("当前用户不处理待审核状态"); + return ; + } + ActInfoEntity actInfo = actInfoDao.selectById(actUserRelationEntity.getActId()); + if(!actInfo.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); + } + Date auditTime=new Date(); + actUserRelationEntity.setStatus(ActConstant.ACT_USER_STATUS_PASSED); + actUserRelationEntity.setPassedType(ActConstant.PASSEDTYPE_MANUAL); + actUserRelationEntity.setAuditTime(auditTime); + actUserRelationEntity.setFailureReason(StrConstant.EPMETY_STR); + //更新关系记录表改为已通过 + actUserRelationDao.updateById(actUserRelationEntity); + + ActUserLogEntity actUserLogEntity=new ActUserLogEntity(); + actUserLogEntity.setActId(actUserRelationEntity.getActId()); + actUserLogEntity.setUserId(actUserRelationEntity.getUserId()); + actUserLogEntity.setOperationType(ActConstant.ACT_USER_LOG_OPER_PASSED); + actUserLogEntity.setReason(StrConstant.EPMETY_STR); + actUserLogEntity.setCreatedTime(auditTime); + //插入一条日志 + actUserLogDao.insert(actUserLogEntity); + //给居民发消息 + this.saveUserMessage(actUserRelationEntity,ActConstant.ACT_USER_STATUS_PASSED,actInfo); + } + + /** + * @param formDTO + * @return void + * @author yinzuomei + * @description 报名审核-拒绝报名 + * @Date 2020/7/23 18:14 + **/ + @Override + public void auditRefuse(AuditUserFormDTO formDTO) { + ActUserRelationEntity actUserRelationEntity=actUserRelationDao.selectById(formDTO.getActUserRelationId()); + if(null==actUserRelationEntity||!ActConstant.ACT_USER_STATUS_AUDITING.equals(actUserRelationEntity.getStatus())){ + logger.info("当前用户不处理待审核状态"); + return ; + } + ActInfoEntity actInfo = actInfoDao.selectById(actUserRelationEntity.getActId()); + if(!actInfo.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); + } + Date auditTime=new Date(); + actUserRelationEntity.setStatus(ActConstant.ACT_USER_STATUS_REFUSED); + actUserRelationEntity.setPassedType(ActConstant.PASSEDTYPE_MANUAL); + actUserRelationEntity.setAuditTime(auditTime); + //拒绝理由必填 + actUserRelationEntity.setFailureReason(formDTO.getRejectReason()); + //更新关系记录表改为已拒绝 + actUserRelationDao.updateById(actUserRelationEntity); + ActUserLogEntity actUserLogEntity=new ActUserLogEntity(); + actUserLogEntity.setActId(actUserRelationEntity.getActId()); + actUserLogEntity.setUserId(actUserRelationEntity.getUserId()); + actUserLogEntity.setOperationType(ActConstant.ACT_USER_LOG_OPER_REFUSED); + actUserLogEntity.setReason(StrConstant.EPMETY_STR); + actUserLogEntity.setCreatedTime(auditTime); + //插入一条日志 + actUserLogDao.insert(actUserLogEntity); + //给居民发消息 + this.saveUserMessage(actUserRelationEntity,ActConstant.ACT_USER_STATUS_REFUSED,actInfo); + } + + /** + * @param actUserRelationEntity + * @param type + * @return void + * @author yinzuomei + * @description 报名审核通过,拒绝通知居民 + * @Date 2020/7/23 18:01 + **/ + private void saveUserMessage(ActUserRelationEntity actUserRelationEntity, String type,ActInfoEntity actInfo) { + try { + UserMessageFormDTO userMessageFormDTO = new UserMessageFormDTO(); + userMessageFormDTO.setUserId(actUserRelationEntity.getUserId()); + userMessageFormDTO.setGridId(StrConstant.STAR); + userMessageFormDTO.setApp(AppClientConstant.APP_RESI); + userMessageFormDTO.setTitle(ActMessageConstant.TITLE); + userMessageFormDTO.setReadFlag(ReadFlagConstant.UN_READ); + if (ActConstant.ACT_USER_STATUS_PASSED.equals(type)) { + userMessageFormDTO.setMessageContent(String.format(ActMessageConstant.AUDIT_PASSED, actInfo.getTitle())); + } else if (ActConstant.ACT_USER_STATUS_REFUSED.equals(type)) { + userMessageFormDTO.setMessageContent(String.format(ActMessageConstant.AUDIT_REFUSED, actInfo.getTitle(), actUserRelationEntity.getFailureReason())); + } + Result result = epmetMessageOpenFeignClient.saveUserMessage(userMessageFormDTO); + if (result.success()) { + logger.info("审核成功,已成功发送站内信"); + } + } catch (Exception e) { + logger.error("审核结果,发送站内信异常", e.getMessage()); + } + } + /** * @return com.epmet.dto.result.work.HistoricalActInfo * @param userId From e8f05c0bb68ace869b92c6747d7a1b33eaf9a284 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 23 Jul 2020 23:06:32 +0800 Subject: [PATCH 48/98] =?UTF-8?q?heart-work:=E4=B8=BB=E5=8A=9E=E6=96=B9?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E3=80=81=E8=BF=9B=E8=A1=8C=E4=B8=AD=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8=E5=88=97=E8=A1=A8api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/work/ActListCommonFormDTO.java | 23 ++++ .../java/com/epmet/dto/result/work/Grid.java | 44 ++++++ .../result/work/InProgressActResultDTO.java | 71 ++++++++++ .../dto/result/work/SponsorResultDTO.java | 29 ++++ .../epmet/controller/WorkActController.java | 37 ++++++ .../main/java/com/epmet/dao/ActInfoDao.java | 10 ++ .../com/epmet/service/WorkActService.java | 33 +++++ .../service/impl/WorkActServiceImpl.java | 125 ++++++++++++++++++ .../service/impl/WorkActUserServiceImpl.java | 8 ++ .../src/main/resources/mapper/ActInfoDao.xml | 31 +++++ .../epmet/dto/result/ActSponsorGridInfo.java | 25 ++++ .../epmet/dto/result/ActSponsorResultDTO.java | 28 ++++ .../epmet/feign/GovOrgOpenFeignClient.java | 10 ++ .../GovOrgOpenFeignClientFallback.java | 12 ++ .../controller/CustomerAgencyController.java | 12 ++ .../com/epmet/dao/CustomerStaffAgencyDao.java | 20 +++ .../epmet/service/CustomerAgencyService.java | 9 ++ .../impl/CustomerAgencyServiceImpl.java | 20 +++ .../mapper/CustomerStaffAgencyDao.xml | 24 ++++ 19 files changed, 571 insertions(+) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActListCommonFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/Grid.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/SponsorResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ActSponsorGridInfo.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ActSponsorResultDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActListCommonFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActListCommonFormDTO.java new file mode 100644 index 0000000000..bc89178a5c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActListCommonFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form.work; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 21:21 + */ +@Data +public class ActListCommonFormDTO implements Serializable { + private static final long serialVersionUID = -8014343076037268806L; + public interface AddUserInternalGroup {} + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空", groups = {AddUserInternalGroup.class }) + private String customerId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/Grid.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/Grid.java new file mode 100644 index 0000000000..581eac9d9a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/Grid.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.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 添加组织-接口返参 + * + * @author sun + */ +@Data +public class Grid implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格Id + */ + private String gridId = ""; + /** + * 机关-网格名称 + */ + private String agencyGridName = ""; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActResultDTO.java new file mode 100644 index 0000000000..edf6102c7c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActResultDTO.java @@ -0,0 +1,71 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 21:23 + */ +@Data +public class InProgressActResultDTO implements Serializable { + private static final long serialVersionUID = -2631607663760353230L; + + /** + *活动id + */ + private String actId; + + /** + *活动标题 + */ + private String title; + + /** + * 活动封面 + */ + private String coverPic; + + /** + * 活动状态:报名中:signing_up;截止报名: end_sign_up; 已开始: in_progress; 已报满: enough + */ + private String status=""; + + /** + * 活动预计开始时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actStartTime; + + /** + * 活动预计结束时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actEndTime; + + /** + * true:固定名额 false: 不限制名额 + */ + private Boolean actQuotaCategory; + + /** + * 活动名额人数 + */ + private Integer actQuota; + + /** + * 已报名人数 + */ + private Integer signedUp; + + @JsonIgnore + private Date signUpEndTime; + @JsonIgnore + private Date signUpStartTime; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/SponsorResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/SponsorResultDTO.java new file mode 100644 index 0000000000..ee7006381f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/SponsorResultDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 20:23 + */ +@Data +public class SponsorResultDTO implements Serializable { + private static final long serialVersionUID = 2781093523201803701L; + /** + * 机关组织Id + */ + private String agencyId = ""; + /** + * 机关组织名称 + */ + private String agencyName = ""; + /** + * 机关下网格列表信息 + */ + private List agencyGridList; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java index 4bc41c41d3..e7ce6b50a8 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java @@ -1,8 +1,18 @@ package com.epmet.controller; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.work.ActListCommonFormDTO; +import com.epmet.dto.result.work.InProgressActResultDTO; +import com.epmet.dto.result.work.SponsorResultDTO; +import com.epmet.service.WorkActService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + /** * 工作端-发布活动相关api * @@ -12,4 +22,31 @@ import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/work/act") public class WorkActController { + @Autowired + private WorkActService workActService; + + /** + * @return com.epmet.commons.tools.utils.Result + * @param + * @author yinzuomei + * @description 活动主办方 + * @Date 2020/7/23 20:37 + **/ + @PostMapping("sponsorlist") + public Result querySponsorList(){ + return new Result().ok(workActService.querySponsorList()); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 进行中活动列表 + * @Date 2020/7/23 21:24 + **/ + @PostMapping("inprogresslist") + public Result> queryInProgressList(ActListCommonFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,ActListCommonFormDTO.AddUserInternalGroup.class); + return new Result>().ok(workActService.queryInProgressList(formDTO)); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java index 802096fd8f..6166d5ffdd 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java @@ -25,6 +25,7 @@ import com.epmet.dto.form.resi.ResiLatestActFormDTO; import com.epmet.dto.form.resi.ResiMyActFormDTO; import com.epmet.dto.result.resi.*; import com.epmet.dto.result.work.ActSignUpStatResultDTO; +import com.epmet.dto.result.work.InProgressActResultDTO; import com.epmet.entity.ActInfoEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -225,4 +226,13 @@ public interface ActInfoDao extends BaseDao { * @Date 17:17 2020-07-23 **/ Integer checkActTime(ActInfoDTO actInfoDTO); + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 查询正在进行中的活动列表 + * @Date 2020/7/23 21:58 + **/ + List selectInprogress(String customerId); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java new file mode 100644 index 0000000000..4a623371c8 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java @@ -0,0 +1,33 @@ +package com.epmet.service; + +import com.epmet.dto.form.work.ActListCommonFormDTO; +import com.epmet.dto.result.work.InProgressActResultDTO; +import com.epmet.dto.result.work.SponsorResultDTO; + +import java.util.List; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 20:36 + */ +public interface WorkActService { + /** + * @return com.epmet.dto.result.work.SponsorResultDTO + * @param + * @author yinzuomei + * @description 活动主办方 + * @Date 2020/7/23 20:37 + **/ + SponsorResultDTO querySponsorList(); + + /** + * @return com.epmet.dto.result.work.InProgressActResultDTO + * @param formDTO + * @author yinzuomei + * @description 进行中活动列表 + * @Date 2020/7/23 21:24 + **/ + List queryInProgressList(ActListCommonFormDTO formDTO); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java new file mode 100644 index 0000000000..161d838d57 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java @@ -0,0 +1,125 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.ActInfoDao; +import com.epmet.dto.form.work.ActListCommonFormDTO; +import com.epmet.dto.result.ActSponsorResultDTO; +import com.epmet.dto.result.work.Grid; +import com.epmet.dto.result.work.InProgressActResultDTO; +import com.epmet.dto.result.work.SponsorResultDTO; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.service.WorkActService; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 20:37 + */ +@Service +public class WorkActServiceImpl implements WorkActService { + private Logger logger = LogManager.getLogger(WorkActServiceImpl.class); + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private LoginUserUtil loginUserUtil; + @Autowired + private ActInfoDao actInfoDao; + + /** + * @return com.epmet.dto.result.work.SponsorResultDTO + * @author yinzuomei + * @description 活动主办方 + * @Date 2020/7/23 20:37 + **/ + @Override + public SponsorResultDTO querySponsorList() { + String staffId=loginUserUtil.getLoginUserId(); + if(StringUtils.isNotBlank(staffId)){ + Result result=govOrgOpenFeignClient.querySponsorList(staffId); + if(result.success()&&null!=result.getData()){ + SponsorResultDTO sponsorResultDTO=new SponsorResultDTO(); + sponsorResultDTO.setAgencyId(result.getData().getAgencyId()); + sponsorResultDTO.setAgencyName(result.getData().getAgencyName()); + sponsorResultDTO.setAgencyGridList(ConvertUtils.sourceToTarget(result.getData().getAgencyGridList(), Grid.class)); + return sponsorResultDTO; + } + } + logger.error("当前用户id获取为空"); + return null; + } + + /** + * @param formDTO + * @return com.epmet.dto.result.work.InProgressActResultDTO + * @author yinzuomei + * @description 进行中活动列表 + * @Date 2020/7/23 21:24 + **/ + @Override + public List queryInProgressList(ActListCommonFormDTO formDTO) { + List list = actInfoDao.selectInprogress(formDTO.getCustomerId()); + Date nowDate = new Date(); + for (InProgressActResultDTO inProgressActResultDTO : list) { +// 活动状态:报名中:signing_up;截止报名: end_sign_up; 已开始: in_progress; 已报满: enough + if (nowDate.compareTo(inProgressActResultDTO.getSignUpEndTime()) == -1 + || nowDate.compareTo(inProgressActResultDTO.getSignUpEndTime()) == 0) { + //截止报名时间之前(包含报名时间截止时间点) + if (!inProgressActResultDTO.getActQuotaCategory()) { + //如果是不限制名额,则显示报名中 + inProgressActResultDTO.setStatus("signing_up"); + continue; + } else { + //固定名额,且已报名人数<活动需要人数显示报名中 + if (inProgressActResultDTO.getActQuota() > inProgressActResultDTO.getSignedUp()) { + inProgressActResultDTO.setStatus("signing_up"); + continue; + } else if (inProgressActResultDTO.getActQuota().equals(inProgressActResultDTO.getSignedUp())) { + inProgressActResultDTO.setStatus("enough"); + continue; + } + } + } else if (nowDate.compareTo(inProgressActResultDTO.getSignUpEndTime()) == 1 + || nowDate.compareTo(inProgressActResultDTO.getActStartTime()) == -1) { + //活动报名截止-活动预计开始之间显示截止报名 + inProgressActResultDTO.setStatus("end_sign_up"); + continue; + } else if (nowDate.compareTo(inProgressActResultDTO.getActStartTime()) == 1 + || nowDate.compareTo(inProgressActResultDTO.getActStartTime()) == 0) { + //活动预计开始时间点之后,包含活动预计开始时间点,显示 已开始 + inProgressActResultDTO.setStatus("in_progress"); + continue; + } + } + return list; + } + + public static void main(String[] args) { + SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + try { + Date date1=format.parse("2020-07-23 13:00:00"); + Date yesterDate=format.parse("2020-07-22 13:00:00"); + Date date2=format.parse("2020-07-23 13:00:00"); + Date tommorrow=format.parse("2020-07-24 13:00:00"); + System.out.println(new Date().compareTo(yesterDate)); + System.out.println(date1.compareTo(tommorrow)); + System.out.println(date1.compareTo(date2)); + } catch (ParseException e) { + e.printStackTrace(); + } + + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java index 94754726ac..d98eafc875 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java @@ -365,6 +365,10 @@ public class WorkActUserServiceImpl implements WorkActUserService { return ; } ActInfoEntity actInfo = actInfoDao.selectById(actUserRelationEntity.getActId()); + if(null==actInfo){ + logger.error("查询活动为空actId="+actUserRelationEntity.getActId()); + return; + } if(!actInfo.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); } @@ -403,6 +407,10 @@ public class WorkActUserServiceImpl implements WorkActUserService { return ; } ActInfoEntity actInfo = actInfoDao.selectById(actUserRelationEntity.getActId()); + if(null==actInfo){ + logger.error("查询活动为空actId="+actUserRelationEntity.getActId()); + return; + } if(!actInfo.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml index 2680e43176..e16f3b8369 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml @@ -457,4 +457,35 @@ AND ((#{actStartTime} BETWEEN ACT_START_TIME AND ACT_END_TIME OR #{actEndTime} BETWEEN ACT_START_TIME AND ACT_END_TIME) or (ACT_START_TIME BETWEEN #{actStartTime} AND #{actEndTime} OR ACT_END_TIME BETWEEN #{actStartTime} AND #{actEndTime})); + + + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ActSponsorGridInfo.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ActSponsorGridInfo.java new file mode 100644 index 0000000000..d0d0fa1d86 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ActSponsorGridInfo.java @@ -0,0 +1,25 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 20:58 + */ +@Data +public class ActSponsorGridInfo implements Serializable { + private static final long serialVersionUID = -2797565581047800011L; + /** + * 网格Id + */ + private String gridId = ""; + /** + * 机关-网格名称 + */ + private String agencyGridName = ""; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ActSponsorResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ActSponsorResultDTO.java new file mode 100644 index 0000000000..f7f7c955a1 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ActSponsorResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 20:46 + */ +@Data +public class ActSponsorResultDTO implements Serializable { + /** + * 机关组织Id + */ + private String agencyId = ""; + /** + * 机关组织名称 + */ + private String agencyName = ""; + /** + * 机关下网格列表信息 + */ + private List agencyGridList; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index 4fbf1e6f59..c5c421b5a3 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -156,4 +156,14 @@ public interface GovOrgOpenFeignClient { */ @PostMapping("/gov/org/grid/gridsbystaffid/{staffId}") Result> listGridsbystaffid(@PathVariable("staffId") String staffId); + + /** + * @return com.epmet.commons.tools.utils.Result + * @param staffId + * @author yinzuomei + * @description 发布活动-主办方列表 + * @Date 2020/7/23 20:47 + **/ + @PostMapping("/gov/org/customeragency/querysponsorlist/{staffId}") + Result querySponsorList(@PathVariable("staffId") String staffId); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index 48fa9c84dc..dcc848725f 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -90,4 +90,16 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { public Result> listGridsbystaffid(String staffId) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "listGridsbystaffid", staffId); } + + /** + * @param staffId + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 发布活动-主办方列表 + * @Date 2020/7/23 20:47 + **/ + @Override + public Result querySponsorList(String staffId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "querySponsorList", staffId); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 6177a24ce6..83250c4c17 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -181,4 +181,16 @@ public class CustomerAgencyController { public Result getPublishAgencyList(@PathVariable("staffId") String staffId) { return new Result().ok(customerAgencyService.getPublishAgencyList(staffId)); } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param staffId + * @author yinzuomei + * @description 发布活动-主办方列表 + * @Date 2020/7/23 20:50 + **/ + @PostMapping("querysponsorlist/{staffId}") + Result querySponsorList(@PathVariable("staffId") String staffId){ + return new Result().ok(customerAgencyService.querySponsorList(staffId)); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java index 7f980cb8c8..8cfef54079 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java @@ -18,7 +18,9 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerStaffAgencyDTO; +import com.epmet.dto.result.ActSponsorGridInfo; import com.epmet.dto.result.StaffListResultDTO; import com.epmet.entity.CustomerStaffAgencyEntity; import org.apache.ibatis.annotations.Mapper; @@ -80,4 +82,22 @@ public interface CustomerStaffAgencyDao extends BaseDao selectActSponsorGrid(String staffId); + + /** + * @return com.epmet.dto.CustomerAgencyDTO + * @param staffId + * @author yinzuomei + * @description 根据staffId,查询我所属的组织信息 + * @Date 2020/7/23 21:10 + **/ + CustomerAgencyDTO selectMyAgency(String staffId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index 66586aeec4..cacba8512e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -169,4 +169,13 @@ public interface CustomerAgencyService extends BaseService * @Description 党建声音-政府端-可选发布单位接口调用-根据人员角色查询对应的不同发布单位 **/ PublishAgencyListResultDTO getPublishAgencyList(String staffId); + + /** + * @return com.epmet.dto.result.ActSponsorResultDTO + * @param staffId + * @author yinzuomei + * @description 发布活动-主办方列表 + * @Date 2020/7/23 20:50 + **/ + ActSponsorResultDTO querySponsorList(String staffId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index 23b07f5b93..69a1d4ec87 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -810,5 +810,25 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl list=customerStaffAgencyDao.selectActSponsorGrid(staffId); + resultDTO.setAgencyGridList(list); + return resultDTO; + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml index 21d9cf139c..222d4cc6d3 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml @@ -117,4 +117,28 @@ + + + + \ No newline at end of file From ddbff44121a4a479041792afda32a42e29ad465f Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 23 Jul 2020 23:30:20 +0800 Subject: [PATCH 49/98] =?UTF-8?q?heart-work:=E5=B7=B2=E7=BB=93=E6=9D=9F?= =?UTF-8?q?=E3=80=81=E5=B7=B2=E5=8F=96=E6=B6=88=E6=B4=BB=E5=8A=A8=E5=88=97?= =?UTF-8?q?=E8=A1=A8api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/work/CanceledActResultDTO.java | 55 ++++++++++++++++++ .../dto/result/work/FinishedActResultDTO.java | 56 +++++++++++++++++++ .../epmet/controller/WorkActController.java | 31 +++++++++- .../main/java/com/epmet/dao/ActInfoDao.java | 20 +++++++ .../com/epmet/service/WorkActService.java | 20 +++++++ .../service/impl/WorkActServiceImpl.java | 28 +++++++++- .../src/main/resources/mapper/ActInfoDao.xml | 40 +++++++++++++ 7 files changed, 246 insertions(+), 4 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActResultDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActResultDTO.java new file mode 100644 index 0000000000..887a457b4e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActResultDTO.java @@ -0,0 +1,55 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 23:09 + */ +@Data +public class CanceledActResultDTO implements Serializable { + private static final long serialVersionUID = 7026227776577088524L; + /** + *活动id + */ + private String actId; + + /** + *活动标题 + */ + private String title; + + /** + * 活动封面 + */ + private String coverPic; + + /** + * 活动预计开始时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actStartTime; + + /** + * 活动预计结束时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actEndTime; + + /** + * 取消活动的时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date cancelTime; + + /** + * 活动取消的原因 + */ + private String cancelReason; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActResultDTO.java new file mode 100644 index 0000000000..25f9d7e46b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActResultDTO.java @@ -0,0 +1,56 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 23:19 + */ +@Data +public class FinishedActResultDTO implements Serializable { + private static final long serialVersionUID = -8967999331248723146L; + + /** + *活动id + */ + private String actId; + + /** + *活动标题 + */ + private String title; + + /** + * 活动封面 + */ + private String coverPic; + + /** + * 活动预计开始时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actStartTime; + + /** + * 活动预计结束时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actEndTime; + /** + * 活动实际开始时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actualStartTime; + + /** + * 活动实际结束时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actualEndTime; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java index e7ce6b50a8..2e14ec9aac 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java @@ -3,11 +3,14 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.work.ActListCommonFormDTO; +import com.epmet.dto.result.work.CanceledActResultDTO; +import com.epmet.dto.result.work.FinishedActResultDTO; import com.epmet.dto.result.work.InProgressActResultDTO; import com.epmet.dto.result.work.SponsorResultDTO; import com.epmet.service.WorkActService; 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; @@ -45,8 +48,34 @@ public class WorkActController { * @Date 2020/7/23 21:24 **/ @PostMapping("inprogresslist") - public Result> queryInProgressList(ActListCommonFormDTO formDTO){ + public Result> queryInProgressList(@RequestBody ActListCommonFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO,ActListCommonFormDTO.AddUserInternalGroup.class); return new Result>().ok(workActService.queryInProgressList(formDTO)); } + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @author yinzuomei + * @description 已取消-活动列表 + * @Date 2020/7/23 23:11 + **/ + @PostMapping("canceledlist") + public Result> queryCanceledlist(@RequestBody ActListCommonFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,ActListCommonFormDTO.AddUserInternalGroup.class); + return new Result>().ok(workActService.queryCanceledList(formDTO)); + } + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @author yinzuomei + * @description 已结束-活动列表 + * @Date 2020/7/23 23:21 + **/ + @PostMapping("finishedlist") + public Result> queryFinishedList(@RequestBody ActListCommonFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,ActListCommonFormDTO.AddUserInternalGroup.class); + return new Result>().ok(workActService.queryFinishedList(formDTO)); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java index 6166d5ffdd..700c114b6d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java @@ -25,6 +25,8 @@ import com.epmet.dto.form.resi.ResiLatestActFormDTO; import com.epmet.dto.form.resi.ResiMyActFormDTO; import com.epmet.dto.result.resi.*; import com.epmet.dto.result.work.ActSignUpStatResultDTO; +import com.epmet.dto.result.work.CanceledActResultDTO; +import com.epmet.dto.result.work.FinishedActResultDTO; import com.epmet.dto.result.work.InProgressActResultDTO; import com.epmet.entity.ActInfoEntity; import org.apache.ibatis.annotations.Mapper; @@ -235,4 +237,22 @@ public interface ActInfoDao extends BaseDao { * @Date 2020/7/23 21:58 **/ List selectInprogress(String customerId); + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 已取消-活动列表 + * @Date 2020/7/23 23:13 + **/ + List selectCanceledList(String customerId); + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 已结束-活动列表 + * @Date 2020/7/23 23:21 + **/ + List selectFinishedList(String customerId); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java index 4a623371c8..3945c19213 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java @@ -1,6 +1,8 @@ package com.epmet.service; import com.epmet.dto.form.work.ActListCommonFormDTO; +import com.epmet.dto.result.work.CanceledActResultDTO; +import com.epmet.dto.result.work.FinishedActResultDTO; import com.epmet.dto.result.work.InProgressActResultDTO; import com.epmet.dto.result.work.SponsorResultDTO; @@ -30,4 +32,22 @@ public interface WorkActService { * @Date 2020/7/23 21:24 **/ List queryInProgressList(ActListCommonFormDTO formDTO); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 已取消-活动列表 + * @Date 2020/7/23 23:11 + **/ + List queryCanceledList(ActListCommonFormDTO formDTO); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 已结束-活动列表 + * @Date 2020/7/23 23:21 + **/ + List queryFinishedList(ActListCommonFormDTO formDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java index 161d838d57..cdeb80c3d3 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java @@ -6,9 +6,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dao.ActInfoDao; import com.epmet.dto.form.work.ActListCommonFormDTO; import com.epmet.dto.result.ActSponsorResultDTO; -import com.epmet.dto.result.work.Grid; -import com.epmet.dto.result.work.InProgressActResultDTO; -import com.epmet.dto.result.work.SponsorResultDTO; +import com.epmet.dto.result.work.*; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.WorkActService; import org.apache.commons.lang3.StringUtils; @@ -106,6 +104,30 @@ public class WorkActServiceImpl implements WorkActService { return list; } + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 已取消-活动列表 + * @Date 2020/7/23 23:11 + **/ + @Override + public List queryCanceledList(ActListCommonFormDTO formDTO) { + return actInfoDao.selectCanceledList(formDTO.getCustomerId()); + } + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 已结束-活动列表 + * @Date 2020/7/23 23:21 + **/ + @Override + public List queryFinishedList(ActListCommonFormDTO formDTO) { + return actInfoDao.selectFinishedList(formDTO.getCustomerId()); + } + public static void main(String[] args) { SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml index e16f3b8369..2ddf0c9398 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml @@ -488,4 +488,44 @@ and ai.CUSTOMER_ID=#{customerId} order by ai.CREATED_TIME desc + + + + + + From 1e6fd9417defbf55fad465bc9aa6f9130cfd7cf5 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Fri, 24 Jul 2020 09:06:28 +0800 Subject: [PATCH 50/98] =?UTF-8?q?=E7=88=B1=E5=BF=83=E4=BA=92=E5=8A=A9-?= =?UTF-8?q?=E6=9E=9A=E4=B8=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/constant/ActConstant.java | 57 ++++++++++++++- .../service/impl/ActInfoServiceImpl.java | 70 +++++++++---------- .../service/impl/ActSignInRecServiceImpl.java | 6 +- .../impl/ActUserRelationServiceImpl.java | 10 +-- .../utils/ActUserRelationStatusConstant.java | 43 ------------ .../epmet/utils/ActUserStatusConstant.java | 49 ------------- 6 files changed, 96 insertions(+), 139 deletions(-) delete mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ActUserRelationStatusConstant.java delete mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ActUserStatusConstant.java diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java index a13c2bed23..96e45bad87 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java @@ -88,14 +88,30 @@ public interface ActConstant { */ String ACT_USER_STATUS_CANCELD="canceld"; - /*操作类型(已报名/待审核auditing, + /** + * (5)act_user_relation表的REWARD_FLAG:给积分agree + */ + String ACT_USER_STATUS_AGREE="agree"; + + /** + * (6)act_user_relation表的REWARD_FLAG:不给积分deny + */ + String ACT_USER_STATUS_DENY="deny"; + + /** + * (7)act_user_relation表的SIGN_IN_FLAG:已签到 + */ + String ACT_USER_STATUS_SIGNED_IN="signed_in"; + + /*act_user_log表:操作类型( + 已报名/待审核auditing, 审核通过passed, 审核不通过refused 取消报名canceld, 已签到signedin - 发放积分rewarded + 发放积分rewarded 拒绝发放积分refuse_reward - 重新处理processing + 重新处理processing )*/ String ACT_USER_LOG_OPER_AUDITING="auditing"; String ACT_USER_LOG_OPER_PASSED="passed"; @@ -111,4 +127,39 @@ public interface ActConstant { */ String PASSEDTYPE_AUTO="auto"; String PASSEDTYPE_MANUAL="manual"; + + /** + * (1)用户活动页面按钮控制:我要报名 + */ + String CURRENT_STATUS_USER_SIGN_UP = "sign_up"; + + /** + * (2)用户活动页面按钮控制:已报满 + */ + String CURRENT_STATUS_USER_ENOUGH = "enough"; + + /** + * (3)用户活动页面按钮控制:截止报名 + */ + String CURRENT_STATUS_USER_END_SIGN_UP = "end_sign_up"; + + /** + * (4)用户活动页面按钮控制:已开始 + */ + String CURRENT_STATUS_USER_IN_PROGRESS = "in_progress"; + + /** + * (5)用户活动页面按钮控制:已结束 + */ + String CURRENT_STATUS_USER_FINISHED = "finished"; + + /** + * (6)用户活动页面按钮控制:已取消 + */ + String CURRENT_STATUS_USER_CANCELED = "canceled"; + + /** + * (7)用户活动页面按钮控制:已确认积分 + */ + String CURRENT_STATUS_USER_POINTS_CONFIRM = "points_confirm"; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java index 18e96e4c23..79d97f2bfa 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java @@ -20,18 +20,18 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.ActConstant; import com.epmet.dao.ActInfoDao; import com.epmet.dao.ActUserRelationDao; import com.epmet.dao.HeartUserInfoDao; -import com.epmet.dao.VolunteerInfoDao; import com.epmet.dto.ActInfoDTO; import com.epmet.dto.form.resi.*; import com.epmet.dto.result.resi.*; @@ -40,8 +40,6 @@ import com.epmet.entity.ActUserRelationEntity; import com.epmet.redis.ActInfoRedis; import com.epmet.service.ActInfoService; import com.epmet.service.ActUserRelationService; -import com.epmet.utils.ActUserRelationStatusConstant; -import com.epmet.utils.ActUserStatusConstant; import com.epmet.utils.CaculateDistance; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -228,12 +226,12 @@ public class ActInfoServiceImpl extends BaseServiceImpl signUpNum) { // 我要报名(不限名额或者未报满的) - return ActUserStatusConstant.SIGN_UP; + return ActConstant.CURRENT_STATUS_USER_SIGN_UP; } else { // 已报满(限制名额且已经报满的) - return ActUserStatusConstant.ENOUGH; + return ActConstant.CURRENT_STATUS_USER_ENOUGH; } } else if (currentTime.after(actInfoEntity.getSignUpEndTime()) && currentTime.before(actInfoEntity.getActStartTime())) { /*报名结束,活动未开始:显示:截止报名*/ - return ActUserStatusConstant.END_SIGN_UP; + return ActConstant.CURRENT_STATUS_USER_END_SIGN_UP; } else if (currentTime.after(actInfoEntity.getSignInStartTime()) && currentTime.before(actInfoEntity.getSignInEndTime())) { // 活动打卡时间段内: 显示:已开始 - return ActUserStatusConstant.IN_PROGRESS; + return ActConstant.CURRENT_STATUS_USER_IN_PROGRESS; } else { - return ActUserStatusConstant.FINISHED; + return ActConstant.CURRENT_STATUS_USER_FINISHED; } } @@ -298,58 +296,58 @@ public class ActInfoServiceImpl extends BaseServiceImpl= actInfoEntity.getActQuota()) { - return ActUserStatusConstant.ENOUGH; + return ActConstant.CURRENT_STATUS_USER_ENOUGH; } // (报名审核未通过或者已经取消报名的)可再次报名-我要报名 - if (ActUserRelationStatusConstant.REFUSED.equals(actUserStatus) || ActUserRelationStatusConstant.CANCELD.equals(actUserStatus)) { - return ActUserStatusConstant.SIGN_UP; + if (ActConstant.ACT_USER_STATUS_REFUSED.equals(actUserStatus) || ActConstant.ACT_USER_STATUS_CANCELD.equals(actUserStatus)) { + return ActConstant.CURRENT_STATUS_USER_SIGN_UP; } } else if (currentTime.after(actInfoEntity.getSignUpEndTime()) && currentTime.before(actInfoEntity.getActStartTime())) { /* 报名截止但 活动未开始 */ // 已经取消报名的-报名截止 - if (ActUserRelationStatusConstant.CANCELD.equals(actUserStatus)) { - return ActUserStatusConstant.END_SIGN_UP; + if (ActConstant.ACT_USER_STATUS_CANCELD.equals(actUserStatus)) { + return ActConstant.CURRENT_STATUS_USER_END_SIGN_UP; } // 已报名审核不通过 -报名截止 - if (ActUserRelationStatusConstant.REFUSED.equals(actUserStatus)) { - return ActUserStatusConstant.END_SIGN_UP; + if (ActConstant.ACT_USER_STATUS_REFUSED.equals(actUserStatus)) { + return ActConstant.CURRENT_STATUS_USER_END_SIGN_UP; } // 已报名且审核通过、未审核 -取消报名 - if (ActUserRelationStatusConstant.PASSED.equals(actUserStatus) || ActUserRelationStatusConstant.AUDITING.equals(actUserStatus)) { - return ActUserStatusConstant.CANCELD; + if (ActConstant.ACT_USER_STATUS_PASSED.equals(actUserStatus) || ActConstant.ACT_USER_STATUS_AUDITING.equals(actUserStatus)) { + return ActConstant.ACT_USER_STATUS_CANCELD; } } - return ActUserStatusConstant.FINISHED; + return ActConstant.CURRENT_STATUS_USER_FINISHED; } @Override diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInRecServiceImpl.java index 88719c0b99..5cc716d8b4 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInRecServiceImpl.java @@ -22,6 +22,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.ActConstant; import com.epmet.dao.ActSignInPicDao; import com.epmet.dao.ActSignInRecDao; import com.epmet.dao.ActUserLogDao; @@ -35,7 +36,6 @@ import com.epmet.entity.ActUserLogEntity; import com.epmet.redis.ActSignInRecRedis; import com.epmet.service.ActLiveRecService; import com.epmet.service.ActSignInRecService; -import com.epmet.utils.ActUserRelationStatusConstant; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -74,14 +74,14 @@ public class ActSignInRecServiceImpl extends BaseServiceImpl Date: Fri, 24 Jul 2020 10:39:02 +0800 Subject: [PATCH 51/98] =?UTF-8?q?heart-work:act=5Fuser=5Flog=E5=88=A0?= =?UTF-8?q?=E9=99=A4*=20=E5=8F=91=E6=94=BE=E7=A7=AF=E5=88=86rewarded=20?= =?UTF-8?q?=E6=8B=92=E7=BB=9D=E5=8F=91=E6=94=BE=E7=A7=AF=E5=88=86refuse=5F?= =?UTF-8?q?reward=20=E9=87=8D=E6=96=B0=E5=A4=84=E7=90=86processing?= =?UTF-8?q?=E8=BF=99=E4=B8=89=E4=B8=AA=E6=93=8D=E4=BD=9C=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=EF=BC=8C=E5=9C=A8act=5Fpoint=5Flog=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/ActUserLogDTO.java | 3 --- .../src/main/java/com/epmet/constant/ActConstant.java | 6 ------ .../src/main/java/com/epmet/entity/ActUserLogEntity.java | 3 --- 3 files changed, 12 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserLogDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserLogDTO.java index aecb1b1750..fa3ec4ecd8 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserLogDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserLogDTO.java @@ -55,9 +55,6 @@ public class ActUserLogDTO implements Serializable { * 审核不通过refused * 取消报名canceld, * 已签到signedin - * 发放积分rewarded - * 拒绝发放积分refuse_reward - * 重新处理processing * ) */ private String operationType; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java index a13c2bed23..b15e4c5893 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java @@ -93,18 +93,12 @@ public interface ActConstant { 审核不通过refused 取消报名canceld, 已签到signedin - 发放积分rewarded - 拒绝发放积分refuse_reward - 重新处理processing )*/ String ACT_USER_LOG_OPER_AUDITING="auditing"; String ACT_USER_LOG_OPER_PASSED="passed"; String ACT_USER_LOG_OPER_REFUSED="refused"; String ACT_USER_LOG_OPER_CANCELD="canceld"; String ACT_USER_LOG_OPER_SIGNEDIN="signedin"; - String ACT_USER_LOG_OPER_REWARDED="rewarded"; - String ACT_USER_LOG_OPER_REFUSE_REWARD="refuse_reward"; - String ACT_USER_LOG_OPER_PROCESSING="processing"; /** * 审核通过类型:auto, manual diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserLogEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserLogEntity.java index ac05ba61d1..49716d0dac 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserLogEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserLogEntity.java @@ -51,9 +51,6 @@ public class ActUserLogEntity extends BaseEpmetEntity { * 审核不通过refused * 取消报名canceld, * 已签到signedin - * 发放积分rewarded - * 拒绝发放积分refuse_reward - * 重新处理processing * ) */ private String operationType; From 185c7efca405dc8118636b245a074489d6051fcc Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 24 Jul 2020 11:01:23 +0800 Subject: [PATCH 52/98] =?UTF-8?q?heart-work:=E5=B7=B2=E7=BB=93=E6=9D=9F?= =?UTF-8?q?=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/work/CanceledUserResultDTO.java | 62 ++++++++++++++ .../dto/result/work/JoinedUserResultDTO.java | 82 +++++++++++++++++++ .../controller/WorkActUserController.java | 26 ++++++ .../main/java/com/epmet/dao/ActInfoDao.java | 23 +++++- .../com/epmet/service/WorkActUserService.java | 18 ++++ .../service/impl/WorkActUserServiceImpl.java | 72 ++++++++++++++++ .../src/main/resources/mapper/ActInfoDao.xml | 49 +++++++++++ .../resources/mapper/ActUserRelationDao.xml | 12 ++- 8 files changed, 337 insertions(+), 7 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledUserResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/JoinedUserResultDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledUserResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledUserResultDTO.java new file mode 100644 index 0000000000..6a02a9796d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledUserResultDTO.java @@ -0,0 +1,62 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 已结束-已取消报名人员列表 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/24 10:51 + */ +@Data +public class CanceledUserResultDTO implements Serializable { + private static final long serialVersionUID = 5261680369821817096L; + /** + * 主键 + */ + private String actUserRelationId; + + /** + * 活动id + */ + private String actId; + + /** + * 用户id + */ + private String userId; + + /** + * 姓名 + */ + private String realName; + + /** + * 昵称 + */ + private String nickName; + + /** + * 头像 + */ + private String headImgUrl; + /** + * true: 是志愿者 false : 不是志愿者 + */ + private Boolean volunteerFlag; + + /** + * 取消时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date cancelTime; + + /** + * 取消原因 + */ + private String cancelReason; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/JoinedUserResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/JoinedUserResultDTO.java new file mode 100644 index 0000000000..821364850a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/JoinedUserResultDTO.java @@ -0,0 +1,82 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 已结束-已参加人员列表 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/24 9:54 + */ +@Data +public class JoinedUserResultDTO implements Serializable { + private static final long serialVersionUID = 3120376299314043862L; + /** + * 主键 + */ + private String actUserRelationId; + + /** + * 活动id + */ + private String actId; + + /** + * 用户id + */ + private String userId; + + /** + * 姓名 + */ + private String realName; + + /** + * 昵称 + */ + private String nickName; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * true已签到 false:未签到 + */ + private Boolean signInFlag; + + /** + * true: 是志愿者 false : 不是志愿者 + */ + private Boolean volunteerFlag; + + /** + * 报名时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date signUpTime; + + /** + * 积分说明,接口直接返回:积分+5 或者 积分+0 + */ + private String pointsDes; + + /** + * 活动奖励积分 + */ + @JsonIgnore + private Integer reward; + + /** + * 已给分:agree, 不给分:deny 默认"" + */ + @JsonIgnore + private String rewardFlag; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java index e3a6c97e49..ff87861170 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java @@ -148,4 +148,30 @@ public class WorkActUserController { workActUserService.auditRefuse(formDTO); return new Result(); } + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @author yinzuomei + * @description 已结束-已参加人员列表 + * @Date 2020/7/24 10:17 + **/ + @PostMapping("joinuserlist") + public Result> queryJoinUserList(@RequestBody AuditingActUserFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, AuditingActUserFormDTO.AddUserInternalGroup.class); + return new Result>().ok(workActUserService.queryJoinUserList(formDTO)); + } + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @author yinzuomei + * @description 已结束-已取消报名人员列表 + * @Date 2020/7/24 10:53 + **/ + @PostMapping("canceleduserlist") + public Result> queryCanceledUserList(@RequestBody AuditingActUserFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, AuditingActUserFormDTO.AddUserInternalGroup.class); + return new Result>().ok(workActUserService.queryCanceledUserList(formDTO)); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java index 700c114b6d..86bbf2afde 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java @@ -24,10 +24,7 @@ import com.epmet.dto.form.resi.ResiActDetailFormDTO; import com.epmet.dto.form.resi.ResiLatestActFormDTO; import com.epmet.dto.form.resi.ResiMyActFormDTO; import com.epmet.dto.result.resi.*; -import com.epmet.dto.result.work.ActSignUpStatResultDTO; -import com.epmet.dto.result.work.CanceledActResultDTO; -import com.epmet.dto.result.work.FinishedActResultDTO; -import com.epmet.dto.result.work.InProgressActResultDTO; +import com.epmet.dto.result.work.*; import com.epmet.entity.ActInfoEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -255,4 +252,22 @@ public interface ActInfoDao extends BaseDao { * @Date 2020/7/23 23:21 **/ List selectFinishedList(String customerId); + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 已结束-已参加人员列表 + * @Date 2020/7/24 10:18 + **/ + List queryJoinUserList(String actId); + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 已结束-已取消报名人员列表 + * @Date 2020/7/24 10:55 + **/ + List queryCanceledUserList(String actId); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java index 0d125567c4..035f4792a3 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java @@ -95,4 +95,22 @@ public interface WorkActUserService { * @Date 2020/7/23 18:14 **/ void auditRefuse(AuditUserFormDTO formDTO); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 已结束-已参加人员列表 + * @Date 2020/7/24 10:17 + **/ + List queryJoinUserList(AuditingActUserFormDTO formDTO); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 已结束-已取消报名人员列表 + * @Date 2020/7/24 10:54 + **/ + List queryCanceledUserList(AuditingActUserFormDTO formDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java index d98eafc875..0061c0186b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java @@ -434,6 +434,78 @@ public class WorkActUserServiceImpl implements WorkActUserService { this.saveUserMessage(actUserRelationEntity,ActConstant.ACT_USER_STATUS_REFUSED,actInfo); } + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 已结束-已参加人员列表 + * @Date 2020/7/24 10:17 + **/ + @Override + public List queryJoinUserList(AuditingActUserFormDTO formDTO) { + List list=actInfoDao.queryJoinUserList(formDTO.getActId()); + if(null!=list&&list.size()>0){ + //查询已通过审核的人员id集合 + List userIdList=actUserRelationService.getUserIdList(formDTO.getActId(), ActConstant.ACT_USER_STATUS_PASSED); + //根据已通过的人员集合,查询出用户基本信息 + List userInfoList=this.queryUserBaseInfoList(userIdList); + for(JoinedUserResultDTO joinedUserResultDTO:list){ + //积分描述赋值 + if(ActConstant.ACT_USER_STATUS_AGREE.equals(joinedUserResultDTO.getRewardFlag())){ + joinedUserResultDTO.setPointsDes(String.format("积分+%s",joinedUserResultDTO.getReward())); + }else if(ActConstant.ACT_USER_STATUS_DENY.equals(joinedUserResultDTO.getRewardFlag())){ + joinedUserResultDTO.setPointsDes("积分+0"); + } + //志愿者标识赋值 + joinedUserResultDTO.setVolunteerFlag(this.getVolunteerFlag(joinedUserResultDTO.getUserId())); + //基础信息赋值 + for(UserBaseInfoResultDTO userBaseInfo:userInfoList){ + if(joinedUserResultDTO.getUserId().equals(userBaseInfo.getUserId())){ + joinedUserResultDTO.setRealName(userBaseInfo.getRealName()); + joinedUserResultDTO.setNickName(userBaseInfo.getNickname()); + joinedUserResultDTO.setHeadImgUrl(userBaseInfo.getHeadImgUrl()); + break; + } + + } + } + } + return list; + } + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 已结束-已取消报名人员列表 + * @Date 2020/7/24 10:54 + **/ + @Override + public List queryCanceledUserList(AuditingActUserFormDTO formDTO) { + List list=actInfoDao.queryCanceledUserList(formDTO.getActId()); + if(null!=list&&list.size()>0){ + //查询已取消报名的人员id集合 + List userIdList=actUserRelationService.getUserIdList(formDTO.getActId(), ActConstant.ACT_USER_STATUS_CANCELD); + //根据已取消报名的人员集合,查询出用户基本信息 + List userInfoList=this.queryUserBaseInfoList(userIdList); + for(CanceledUserResultDTO canceledUserResultDTO:list){ + //志愿者标识赋值 + canceledUserResultDTO.setVolunteerFlag(this.getVolunteerFlag(canceledUserResultDTO.getUserId())); + //基础信息赋值 + for(UserBaseInfoResultDTO userBaseInfo:userInfoList){ + if(canceledUserResultDTO.getUserId().equals(userBaseInfo.getUserId())){ + canceledUserResultDTO.setRealName(userBaseInfo.getRealName()); + canceledUserResultDTO.setNickName(userBaseInfo.getNickname()); + canceledUserResultDTO.setHeadImgUrl(userBaseInfo.getHeadImgUrl()); + break; + } + + } + } + } + return list; + } + /** * @param actUserRelationEntity * @param type diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml index 2ddf0c9398..ce22f96e49 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml @@ -528,4 +528,53 @@ ORDER BY ai.ACTUAL_END_TIME DESC + + + + + + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml index 1c60d1b7af..ac63e1f255 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml @@ -33,7 +33,9 @@ act_user_relation aur WHERE aur.DEL_FLAG = '0' - AND aur.`STATUS` = #{status} + + AND aur.`STATUS` = #{status} + AND aur.ACT_ID = #{actId} order by aur.CREATED_TIME desc @@ -46,7 +48,9 @@ act_user_relation aur WHERE aur.DEL_FLAG = '0' - AND aur.`STATUS` =#{status} + + AND aur.`STATUS` =#{status} + AND aur.ACT_ID = #{actId} order by aur.CREATED_TIME desc @@ -58,7 +62,9 @@ act_user_relation aur WHERE aur.DEL_FLAG = '0' - AND aur.`STATUS` =#{status} + + AND aur.`STATUS` =#{status} + AND aur.ACT_ID = #{actId} From e0a154b41702881be80c4750a1eda38a0265d31e Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 24 Jul 2020 11:10:57 +0800 Subject: [PATCH 53/98] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../oper-crm/oper-crm-server/deploy/docker-compose-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-test.yml b/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-test.yml index ef1e3d8974..97697a5f27 100644 --- a/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-test.yml +++ b/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-crm-server: container_name: oper-crm-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/oper-crm-server:0.3.29 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/oper-crm-server:0.3.30 ports: - "8090:8090" network_mode: host # 使用现有网络 From 6f83776e2cbab3bd9f8d8f05fe465b4e649ffb0d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 24 Jul 2020 11:15:25 +0800 Subject: [PATCH 54/98] =?UTF-8?q?heart-work:=E4=BF=AE=E6=94=B9=E5=85=A5?= =?UTF-8?q?=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...gActUserFormDTO.java => ActIdFormDTO.java} | 11 ++++--- .../controller/GrantPointsController.java | 7 ++++ .../controller/WorkActUserController.java | 33 +++++++++---------- .../com/epmet/service/WorkActUserService.java | 17 ++++------ .../service/impl/WorkActUserServiceImpl.java | 17 ++++------ 5 files changed, 42 insertions(+), 43 deletions(-) rename epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/{AuditingActUserFormDTO.java => ActIdFormDTO.java} (50%) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AuditingActUserFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActIdFormDTO.java similarity index 50% rename from epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AuditingActUserFormDTO.java rename to epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActIdFormDTO.java index 9fb58c8179..632b567c11 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AuditingActUserFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActIdFormDTO.java @@ -6,18 +6,19 @@ import javax.validation.constraints.NotBlank; import java.io.Serializable; /** - * 报名审核-待审核列表入参 + * 活动id通用formdto * * @author yinzuomei@elink-cn.com - * @date 2020/7/21 22:12 + * @date 2020/7/24 11:07 */ @Data -public class AuditingActUserFormDTO implements Serializable { - private static final long serialVersionUID = 3811387419859675753L; +public class ActIdFormDTO implements Serializable { + private static final long serialVersionUID = 7151533863877527886L; + public interface AddUserInternalGroup {} /** * 活动id */ - @NotBlank(message = "活动id不能为空", groups = { AddUserInternalGroup.class }) + @NotBlank(message = "活动id不能为空", groups = { ActIdFormDTO.AddUserInternalGroup.class }) private String actId; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/GrantPointsController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/GrantPointsController.java index f28d58a269..aec0849ddd 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/GrantPointsController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/GrantPointsController.java @@ -1,5 +1,7 @@ package com.epmet.controller; +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -12,4 +14,9 @@ import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("grantpoints") public class GrantPointsController { + @PostMapping("pendinglist") + public Result queryPendingList(){ + return new Result(); + } + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java index ff87861170..d7d1d0eb2e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java @@ -2,10 +2,7 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.dto.form.work.AactUserDetailFormDTO; -import com.epmet.dto.form.work.AuditUserFormDTO; -import com.epmet.dto.form.work.AuditingActUserFormDTO; -import com.epmet.dto.form.work.UserHistoricalActFormDTO; +import com.epmet.dto.form.work.*; import com.epmet.dto.result.work.*; import com.epmet.service.WorkActUserService; import org.springframework.beans.factory.annotation.Autowired; @@ -37,8 +34,8 @@ public class WorkActUserController { * @Date 2020/7/21 22:24 **/ @PostMapping("auditinglist") - public Result> getAuditingList(@RequestBody AuditingActUserFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO, AuditingActUserFormDTO.AddUserInternalGroup.class); + public Result> getAuditingList(@RequestBody ActIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); return new Result>().ok(workActUserService.getAuditingList(formDTO)); } @@ -51,8 +48,8 @@ public class WorkActUserController { * @Date 2020/7/22 15:16 **/ @PostMapping("passedlist") - public Result> getPassedList(@RequestBody AuditingActUserFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO, AuditingActUserFormDTO.AddUserInternalGroup.class); + public Result> getPassedList(@RequestBody ActIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); return new Result>().ok(workActUserService.getPassedList(formDTO)); } @@ -64,8 +61,8 @@ public class WorkActUserController { * @Date 2020/7/22 15:49 **/ @PostMapping("rejectedlist") - public Result> getRejectedlist(@RequestBody AuditingActUserFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO, AuditingActUserFormDTO.AddUserInternalGroup.class); + public Result> getRejectedlist(@RequestBody ActIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); return new Result>().ok(workActUserService.getRejectedlist(formDTO)); } @@ -77,8 +74,8 @@ public class WorkActUserController { * @Date 2020/7/22 16:23 **/ @PostMapping("canceledlist") - public Result> getCanceledList(@RequestBody AuditingActUserFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO, AuditingActUserFormDTO.AddUserInternalGroup.class); + public Result> getCanceledList(@RequestBody ActIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); return new Result>().ok(workActUserService.getCanceledList(formDTO)); } @@ -90,8 +87,8 @@ public class WorkActUserController { * @Date 2020/7/22 16:43 **/ @PostMapping("signupstat") - public Result getActSignUpStat(@RequestBody AuditingActUserFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO, AuditingActUserFormDTO.AddUserInternalGroup.class); + public Result getActSignUpStat(@RequestBody ActIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); return new Result().ok(workActUserService.getActSignUpStat(formDTO.getActId())); } @@ -157,8 +154,8 @@ public class WorkActUserController { * @Date 2020/7/24 10:17 **/ @PostMapping("joinuserlist") - public Result> queryJoinUserList(@RequestBody AuditingActUserFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO, AuditingActUserFormDTO.AddUserInternalGroup.class); + public Result> queryJoinUserList(@RequestBody ActIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); return new Result>().ok(workActUserService.queryJoinUserList(formDTO)); } @@ -170,8 +167,8 @@ public class WorkActUserController { * @Date 2020/7/24 10:53 **/ @PostMapping("canceleduserlist") - public Result> queryCanceledUserList(@RequestBody AuditingActUserFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO, AuditingActUserFormDTO.AddUserInternalGroup.class); + public Result> queryCanceledUserList(@RequestBody ActIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); return new Result>().ok(workActUserService.queryCanceledUserList(formDTO)); } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java index 035f4792a3..bcd3807014 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java @@ -1,9 +1,6 @@ package com.epmet.service; -import com.epmet.dto.form.work.AactUserDetailFormDTO; -import com.epmet.dto.form.work.AuditUserFormDTO; -import com.epmet.dto.form.work.AuditingActUserFormDTO; -import com.epmet.dto.form.work.UserHistoricalActFormDTO; +import com.epmet.dto.form.work.*; import com.epmet.dto.result.work.*; import java.util.List; @@ -22,7 +19,7 @@ public interface WorkActUserService { * @description 报名审核-待审核列表 * @Date 2020/7/21 22:25 **/ - List getAuditingList(AuditingActUserFormDTO formDTO); + List getAuditingList(ActIdFormDTO formDTO); /** * @return java.util.List @@ -31,7 +28,7 @@ public interface WorkActUserService { * @description 报名审核-已通过列表 * @Date 2020/7/22 15:16 **/ - List getPassedList(AuditingActUserFormDTO formDTO); + List getPassedList(ActIdFormDTO formDTO); /** * @return java.util.List @@ -40,7 +37,7 @@ public interface WorkActUserService { * @description 报名审核-已拒绝列表 * @Date 2020/7/22 15:50 **/ - List getRejectedlist(AuditingActUserFormDTO formDTO); + List getRejectedlist(ActIdFormDTO formDTO); /** * @return java.util.List @@ -49,7 +46,7 @@ public interface WorkActUserService { * @description 报名审核-已取消报名列表 * @Date 2020/7/22 16:35 **/ - List getCanceledList(AuditingActUserFormDTO formDTO); + List getCanceledList(ActIdFormDTO formDTO); /** * @return com.epmet.dto.result.work.ActSignUpStatResultDTO @@ -103,7 +100,7 @@ public interface WorkActUserService { * @description 已结束-已参加人员列表 * @Date 2020/7/24 10:17 **/ - List queryJoinUserList(AuditingActUserFormDTO formDTO); + List queryJoinUserList(ActIdFormDTO formDTO); /** * @return java.util.List @@ -112,5 +109,5 @@ public interface WorkActUserService { * @description 已结束-已取消报名人员列表 * @Date 2020/7/24 10:54 **/ - List queryCanceledUserList(AuditingActUserFormDTO formDTO); + List queryCanceledUserList(ActIdFormDTO formDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java index 0061c0186b..6d6c81157a 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java @@ -16,10 +16,7 @@ import com.epmet.dto.ActUserLogDTO; import com.epmet.dto.ActUserRelationDTO; import com.epmet.dto.HeartUserInfoDTO; import com.epmet.dto.form.UserMessageFormDTO; -import com.epmet.dto.form.work.AactUserDetailFormDTO; -import com.epmet.dto.form.work.AuditUserFormDTO; -import com.epmet.dto.form.work.AuditingActUserFormDTO; -import com.epmet.dto.form.work.UserHistoricalActFormDTO; +import com.epmet.dto.form.work.*; import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.dto.result.work.*; import com.epmet.entity.ActInfoEntity; @@ -72,7 +69,7 @@ public class WorkActUserServiceImpl implements WorkActUserService { * @Date 2020/7/21 22:25 **/ @Override - public List getAuditingList(AuditingActUserFormDTO formDTO) { + public List getAuditingList(ActIdFormDTO formDTO) { List list=new ArrayList<>(); //查询出待审核的人员列表 List actUserRelationDTOList=actUserRelationService.getUserList(formDTO.getActId(), ActConstant.ACT_USER_STATUS_AUDITING); @@ -114,7 +111,7 @@ public class WorkActUserServiceImpl implements WorkActUserService { * @Date 2020/7/22 15:16 **/ @Override - public List getPassedList(AuditingActUserFormDTO formDTO) { + public List getPassedList(ActIdFormDTO formDTO) { List resultList=new ArrayList<>(); //查询已通过的人员列表 List actUserRelationDTOList=actUserRelationService.getUserList(formDTO.getActId(), ActConstant.ACT_USER_STATUS_PASSED); @@ -157,7 +154,7 @@ public class WorkActUserServiceImpl implements WorkActUserService { * @Date 2020/7/22 15:50 **/ @Override - public List getRejectedlist(AuditingActUserFormDTO formDTO) { + public List getRejectedlist(ActIdFormDTO formDTO) { List resultList=new ArrayList<>(); //查询已拒绝的人员列表 List actUserRelationDTOList=actUserRelationService.getUserList(formDTO.getActId(), ActConstant.ACT_USER_STATUS_REFUSED); @@ -201,7 +198,7 @@ public class WorkActUserServiceImpl implements WorkActUserService { * @Date 2020/7/22 16:35 **/ @Override - public List getCanceledList(AuditingActUserFormDTO formDTO) { + public List getCanceledList(ActIdFormDTO formDTO) { List resultList=new ArrayList<>(); //查询已取消的人员列表 List actUserRelationDTOList=actUserRelationService.getUserList(formDTO.getActId(), ActConstant.ACT_USER_STATUS_CANCELD); @@ -442,7 +439,7 @@ public class WorkActUserServiceImpl implements WorkActUserService { * @Date 2020/7/24 10:17 **/ @Override - public List queryJoinUserList(AuditingActUserFormDTO formDTO) { + public List queryJoinUserList(ActIdFormDTO formDTO) { List list=actInfoDao.queryJoinUserList(formDTO.getActId()); if(null!=list&&list.size()>0){ //查询已通过审核的人员id集合 @@ -481,7 +478,7 @@ public class WorkActUserServiceImpl implements WorkActUserService { * @Date 2020/7/24 10:54 **/ @Override - public List queryCanceledUserList(AuditingActUserFormDTO formDTO) { + public List queryCanceledUserList(ActIdFormDTO formDTO) { List list=actInfoDao.queryCanceledUserList(formDTO.getActId()); if(null!=list&&list.size()>0){ //查询已取消报名的人员id集合 From 94e99edd5733c5ecdbb4f842f0c372930c52c065 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 24 Jul 2020 13:26:24 +0800 Subject: [PATCH 55/98] =?UTF-8?q?heart-work:act=5Fuser=5Flog=E5=8E=BB?= =?UTF-8?q?=E9=99=A4=E5=B7=B2=E7=AD=BE=E5=88=B0signedin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/ActUserLogDTO.java | 1 - .../src/main/java/com/epmet/constant/ActConstant.java | 2 -- .../src/main/java/com/epmet/entity/ActUserLogEntity.java | 1 - 3 files changed, 4 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserLogDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserLogDTO.java index fa3ec4ecd8..52b18e59e4 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserLogDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserLogDTO.java @@ -54,7 +54,6 @@ public class ActUserLogDTO implements Serializable { * 审核通过passed, * 审核不通过refused * 取消报名canceld, - * 已签到signedin * ) */ private String operationType; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java index bad108b99d..465955cf64 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java @@ -108,13 +108,11 @@ public interface ActConstant { 审核通过passed, 审核不通过refused 取消报名canceld, - 已签到signedin )*/ String ACT_USER_LOG_OPER_AUDITING="auditing"; String ACT_USER_LOG_OPER_PASSED="passed"; String ACT_USER_LOG_OPER_REFUSED="refused"; String ACT_USER_LOG_OPER_CANCELD="canceld"; - String ACT_USER_LOG_OPER_SIGNEDIN="signedin"; /** * 审核通过类型:auto, manual diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserLogEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserLogEntity.java index 49716d0dac..6dd224fec0 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserLogEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserLogEntity.java @@ -50,7 +50,6 @@ public class ActUserLogEntity extends BaseEpmetEntity { * 审核通过passed, * 审核不通过refused * 取消报名canceld, - * 已签到signedin * ) */ private String operationType; From 26343ea21902eef98f72f6f978767073fcbc082c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 24 Jul 2020 13:33:14 +0800 Subject: [PATCH 56/98] =?UTF-8?q?heart-work:ACT=5FPOINT=5FLOG=EF=BC=9AEFFE?= =?UTF-8?q?CT=5FFLAG=E6=96=B0=E5=A2=9E1=E6=9C=89=E6=95=880=E6=97=A0?= =?UTF-8?q?=E6=95=88=EF=BC=8C=E5=8F=AA=E6=9C=89=E5=9C=A8=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E7=9C=9F=E6=AD=A3=E7=BB=93=E6=9D=9F=E5=90=8E=E6=89=8D=E6=98=AF?= =?UTF-8?q?1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/ActPointLogDTO.java | 9 +++++++-- .../main/java/com/epmet/entity/ActPointLogEntity.java | 9 ++++++--- .../src/main/resources/mapper/ActPointLogDao.xml | 1 + 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActPointLogDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActPointLogDTO.java index 2d878f2615..d7510db23d 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActPointLogDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActPointLogDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -98,5 +99,9 @@ public class ActPointLogDTO implements Serializable { * 更新时间 */ private Date updatedTime; - + /** + * 1有效0无效,只有在活动真正结束后才是1 + * true有效 false无效 + */ + private Boolean effectFlag; } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActPointLogEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActPointLogEntity.java index 1a437316e1..0b50778f81 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActPointLogEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActPointLogEntity.java @@ -18,13 +18,10 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; - /** * 活动发放积分日志表 * @@ -69,4 +66,10 @@ public class ActPointLogEntity extends BaseEpmetEntity { */ private String remark; + + /** + * 1有效0无效,只有在活动真正结束后才是1 + * true有效 false无效 + */ + private Boolean effectFlag; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActPointLogDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActPointLogDao.xml index 9da8bf431c..0695ec7f4c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActPointLogDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActPointLogDao.xml @@ -11,6 +11,7 @@ + From 8e4d11745f35ccc1f06ffff9b889f4b7b77a7537 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 24 Jul 2020 14:58:21 +0800 Subject: [PATCH 57/98] =?UTF-8?q?heart-work:ACT=5FPOINT=5FLOG=E8=A1=A8?= =?UTF-8?q?=E5=88=A0=E9=99=A4POINT=5FTYPE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/entity/ActPointLogEntity.java | 5 ----- .../src/main/resources/mapper/ActPointLogDao.xml | 1 - 2 files changed, 6 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActPointLogEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActPointLogEntity.java index 0b50778f81..f96ba508d9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActPointLogEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActPointLogEntity.java @@ -45,11 +45,6 @@ public class ActPointLogEntity extends BaseEpmetEntity { */ private String userId; - /** - * 加积分:add ; 减积分:subtract - */ - private String pointType; - /** * 积分值 */ diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActPointLogDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActPointLogDao.xml index 0695ec7f4c..ec6a181d3b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActPointLogDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActPointLogDao.xml @@ -7,7 +7,6 @@ - From 41a251dc3ad05b5a3a3aa02e3dc2cffd3467d1da Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 24 Jul 2020 14:58:53 +0800 Subject: [PATCH 58/98] =?UTF-8?q?heart-work:ACT=5FPOINT=5FLOG=E8=A1=A8?= =?UTF-8?q?=E5=88=A0=E9=99=A4POINT=5FTYPE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/ActPointLogDTO.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActPointLogDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActPointLogDTO.java index d7510db23d..c19938d48f 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActPointLogDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActPointLogDTO.java @@ -49,11 +49,6 @@ public class ActPointLogDTO implements Serializable { */ private String userId; - /** - * 加积分:add ; 减积分:subtract - */ - private String pointType; - /** * 积分值 */ From 2fdb9e3485276da5f9c1c5f215a5767c2fa71553 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 24 Jul 2020 15:43:36 +0800 Subject: [PATCH 59/98] heart-work:canceled --- .../main/java/com/epmet/constant/ActConstant.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java index 465955cf64..c5387c8ce4 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java @@ -84,9 +84,9 @@ public interface ActConstant { String ACT_USER_STATUS_REFUSED="refused"; /** - * (4)act_user_relation表的status:取消报名canceld, + * (4)act_user_relation表的status:取消报名canceled, */ - String ACT_USER_STATUS_CANCELD="canceld"; + String ACT_USER_STATUS_CANCELD="canceled"; /** * (5)act_user_relation表的REWARD_FLAG:给积分agree @@ -112,7 +112,7 @@ public interface ActConstant { String ACT_USER_LOG_OPER_AUDITING="auditing"; String ACT_USER_LOG_OPER_PASSED="passed"; String ACT_USER_LOG_OPER_REFUSED="refused"; - String ACT_USER_LOG_OPER_CANCELD="canceld"; + String ACT_USER_LOG_OPER_CANCELD="canceled"; /** * 审核通过类型:auto, manual @@ -154,4 +154,11 @@ public interface ActConstant { * (7)用户活动页面按钮控制:已确认积分 */ String CURRENT_STATUS_USER_POINTS_CONFIRM = "points_confirm"; + + /** + * act_user_rea + */ + String HANDLED="handled"; + + String RESET="reset"; } From 4458ea0725ddca61205f557ea89c1725505265d2 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 24 Jul 2020 15:47:46 +0800 Subject: [PATCH 60/98] =?UTF-8?q?heart-work:=E7=BB=99=E5=88=86=E3=80=81?= =?UTF-8?q?=E4=B8=8D=E7=BB=99=E5=88=86=E3=80=81=E9=87=8D=E6=96=B0=E5=A4=84?= =?UTF-8?q?=E7=90=86canceled?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/ActUserLogDTO.java | 2 +- .../com/epmet/dto/ActUserRelationDTO.java | 5 +- .../epmet/dto/form/work/AuditUserFormDTO.java | 6 +- .../dto/form/work/GrantPointsFormDTO.java | 30 +++ .../dto/result/work/PendingUserResultDTO.java | 50 ++++ .../epmet/dto/result/work/UserBaseInfo.java | 45 ++++ .../controller/GrantPointsController.java | 61 ++++- .../controller/WorkActUserController.java | 2 +- .../com/epmet/dao/ActUserRelationDao.java | 18 ++ .../com/epmet/entity/ActUserLogEntity.java | 2 +- .../epmet/entity/ActUserRelationEntity.java | 2 +- .../com/epmet/service/GrantPointsService.java | 48 ++++ .../com/epmet/service/WorkActUserService.java | 33 ++- .../service/impl/GrantPointsServiceImpl.java | 236 ++++++++++++++++++ .../service/impl/WorkActUserServiceImpl.java | 16 +- .../src/main/resources/mapper/ActInfoDao.xml | 2 +- .../resources/mapper/ActUserRelationDao.xml | 27 ++ 17 files changed, 570 insertions(+), 15 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/GrantPointsFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PendingUserResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserBaseInfo.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/GrantPointsService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/GrantPointsServiceImpl.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserLogDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserLogDTO.java index 52b18e59e4..a7bff8713b 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserLogDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserLogDTO.java @@ -53,7 +53,7 @@ public class ActUserLogDTO implements Serializable { * 操作类型(已报名/待审核auditing, * 审核通过passed, * 审核不通过refused - * 取消报名canceld, + * 取消报名canceled, * ) */ private String operationType; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserRelationDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserRelationDTO.java index 57952477e7..2c7c7a2d8d 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserRelationDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserRelationDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -52,7 +53,7 @@ public class ActUserRelationDTO implements Serializable { * 当前状态(已报名/待审核auditing, 审核通过passed, 审核不通过refused -取消报名canceld, +取消报名canceled, ) */ private String status; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AuditUserFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AuditUserFormDTO.java index 580aa5ea7c..0df68ec7a8 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AuditUserFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AuditUserFormDTO.java @@ -17,15 +17,15 @@ public class AuditUserFormDTO implements Serializable { private static final long serialVersionUID = 243279409415285207L; public interface AddUserInternalGroup { } - public interface UserShowGroup extends CustomerClientShowGroup { + public interface RefusedUserShowGroup extends CustomerClientShowGroup { } /** * 列表页返回的主键 */ - @NotBlank(message = "主键不能为空", groups = {AddUserInternalGroup.class}) + @NotBlank(message = "主键不能为空", groups = {AddUserInternalGroup.class,RefusedUserShowGroup.class}) private String actUserRelationId; - @NotBlank(message = "拒绝理由不能为空", groups = {UserShowGroup.class}) + @NotBlank(message = "拒绝理由不能为空", groups = {RefusedUserShowGroup.class}) private String rejectReason; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/GrantPointsFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/GrantPointsFormDTO.java new file mode 100644 index 0000000000..b3b79453b5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/GrantPointsFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.form.work; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 积分发放给分,不给分,通用入参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/24 13:10 + */ +@Data +public class GrantPointsFormDTO implements Serializable { + private static final long serialVersionUID = 4785107755585941804L; + public interface AddUserInternalGroup { + } + public interface DenyUserShowGroup extends CustomerClientShowGroup { + } + /** + * 积分发放待处理列表返参中的actUserRelationId + */ + @NotBlank(message = "主键不能为空", groups = {AddUserInternalGroup.class,DenyUserShowGroup.class}) + private String actUserRelationId; + + @NotBlank(message = "理由不能为空", groups = {DenyUserShowGroup.class}) + private String denyRewardReason; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PendingUserResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PendingUserResultDTO.java new file mode 100644 index 0000000000..d8f3837265 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PendingUserResultDTO.java @@ -0,0 +1,50 @@ +package com.epmet.dto.result.work; + +import com.epmet.commons.tools.constant.StrConstant; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 积分发放-待处理列表 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/24 12:20 + */ +@Data +public class PendingUserResultDTO implements Serializable { + private static final long serialVersionUID = -5744298386442386198L; + /** + * 活动id + */ + private String actId; + + /** + * 活动标题 + */ + private String title; + + /** + * 积分奖励 + */ + private Integer reward; + + /** + * 已签到人员列表 + */ + private List signedInList; + + /** + * 未签到人员列表 + */ + private List noSignInList; + public PendingUserResultDTO(String actId){ + this.actId= actId; + this.title=StrConstant.EPMETY_STR; + this.reward=0; + this.signedInList=new ArrayList<>(); + this.noSignInList=new ArrayList<>(); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserBaseInfo.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserBaseInfo.java new file mode 100644 index 0000000000..b7ec382f5e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserBaseInfo.java @@ -0,0 +1,45 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 积分发放待处理界面,用户基本信息 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/24 12:22 + */ +@Data +public class UserBaseInfo implements Serializable { + private static final long serialVersionUID = 4316319460642833716L; + /** + * act_user_relation主键 + */ + private String actUserRelationId; + + /** + * 用户id + */ + private String userId; + + /** + * 姓名 + */ + private String realName; + + /** + * 微信昵称 + */ + private String nickName; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * true: 是志愿者 false : 不是志愿者 + */ + private Boolean volunteerFlag; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/GrantPointsController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/GrantPointsController.java index aec0849ddd..86e935c2a3 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/GrantPointsController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/GrantPointsController.java @@ -1,7 +1,14 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.work.ActIdFormDTO; +import com.epmet.dto.form.work.GrantPointsFormDTO; +import com.epmet.dto.result.work.PendingUserResultDTO; +import com.epmet.service.GrantPointsService; +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; @@ -14,9 +21,61 @@ import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("grantpoints") public class GrantPointsController { + @Autowired + private GrantPointsService grantPointsService; + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 积分发放-待处理列表 + * @Date 2020/7/24 12:28 + **/ @PostMapping("pendinglist") - public Result queryPendingList(){ + public Result queryPendingList(@RequestBody ActIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); + return new Result().ok(grantPointsService.queryPendingList(formDTO.getActId())); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 积分发放-不给分 + * @Date 2020/7/24 13:14 + **/ + @PostMapping("deny") + public Result deny(@RequestBody GrantPointsFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, GrantPointsFormDTO.DenyUserShowGroup.class); + grantPointsService.deny(formDTO); return new Result(); } + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 积分发放-给分 + * @Date 2020/7/24 13:13 + **/ + @PostMapping("agree") + public Result agree(@RequestBody GrantPointsFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, GrantPointsFormDTO.AddUserInternalGroup.class); + grantPointsService.agree(formDTO); + return new Result(); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 积分发放-重新处理 + * @Date 2020/7/24 15:16 + **/ + @PostMapping("reset") + public Result reset(@RequestBody GrantPointsFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, GrantPointsFormDTO.AddUserInternalGroup.class); + grantPointsService.reset(formDTO); + return new Result(); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java index d7d1d0eb2e..59769d69b9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java @@ -141,7 +141,7 @@ public class WorkActUserController { **/ @PostMapping("auditrefuse") public Result auditrefuse(@RequestBody AuditUserFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO, AuditUserFormDTO.UserShowGroup.class,AuditUserFormDTO.AddUserInternalGroup.class); + ValidatorUtils.validateEntity(formDTO, AuditUserFormDTO.RefusedUserShowGroup.class); workActUserService.auditRefuse(formDTO); return new Result(); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java index 2c901f5717..bb6598d312 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java @@ -118,4 +118,22 @@ public interface ActUserRelationDao extends BaseDao { * @Date 2020/7/23 16:46 **/ List selectAllByUserId(String userId); + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 查询待处理的记录 + * @Date 2020/7/24 13:02 + **/ + List selectInProgress(String actId); + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 查询待处理的人员id集合 + * @Date 2020/7/24 13:02 + **/ + List selectInProgressUserIds(String actId); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserLogEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserLogEntity.java index 6dd224fec0..751f535f5f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserLogEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserLogEntity.java @@ -49,7 +49,7 @@ public class ActUserLogEntity extends BaseEpmetEntity { * 操作类型(已报名/待审核auditing, * 审核通过passed, * 审核不通过refused - * 取消报名canceld, + * 取消报名canceled, * ) */ private String operationType; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserRelationEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserRelationEntity.java index 4eb9a68cdd..f5af4a176d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserRelationEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserRelationEntity.java @@ -52,7 +52,7 @@ public class ActUserRelationEntity extends BaseEpmetEntity { * 当前状态(已报名/待审核auditing, 审核通过passed, 审核不通过refused -取消报名canceld, +取消报名canceled, ) */ private String status; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/GrantPointsService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/GrantPointsService.java new file mode 100644 index 0000000000..92d306ac92 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/GrantPointsService.java @@ -0,0 +1,48 @@ +package com.epmet.service; + +import com.epmet.dto.form.work.GrantPointsFormDTO; +import com.epmet.dto.result.work.PendingUserResultDTO; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/24 12:26 + */ +public interface GrantPointsService { + /** + * @return com.epmet.dto.result.work.PendingUserResultDTO + * @param actId + * @author yinzuomei + * @description 积分发放-待处理列表 + * @Date 2020/7/24 12:28 + **/ + PendingUserResultDTO queryPendingList(String actId); + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 积分发放-给分 + * @Date 2020/7/24 13:34 + **/ + void agree(GrantPointsFormDTO formDTO); + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 积分发放-不给分 + * @Date 2020/7/24 15:03 + **/ + void deny(GrantPointsFormDTO formDTO); + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 积分发放-重新处理 + * @Date 2020/7/24 15:16 + **/ + void reset(GrantPointsFormDTO formDTO); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java index bcd3807014..281d8e7556 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java @@ -1,6 +1,10 @@ package com.epmet.service; -import com.epmet.dto.form.work.*; +import com.epmet.dto.form.work.AactUserDetailFormDTO; +import com.epmet.dto.form.work.ActIdFormDTO; +import com.epmet.dto.form.work.AuditUserFormDTO; +import com.epmet.dto.form.work.UserHistoricalActFormDTO; +import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.dto.result.work.*; import java.util.List; @@ -110,4 +114,31 @@ public interface WorkActUserService { * @Date 2020/7/24 10:54 **/ List queryCanceledUserList(ActIdFormDTO formDTO); + + /** + * @return com.epmet.dto.result.UserBaseInfoResultDTO + * @param userId + * @author yinzuomei + * @description 根据用户id获取用户基本信息 + * @Date 2020/7/24 12:47 + **/ + UserBaseInfoResultDTO queryUserBaseInfo(String userId); + + /** + * @return java.util.List + * @param userIdList + * @author yinzuomei + * @description 传入用户id集合,返回用户的基本信息(包含微信基本信息) + * @Date 2020/7/24 12:47 + **/ + List queryUserBaseInfoList(List userIdList); + + /** + * @return java.lang.Boolean + * @param userId + * @author yinzuomei + * @description 根据用户id判断是否志愿者 + * @Date 2020/7/24 12:52 + **/ + Boolean getVolunteerFlag(String userId); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/GrantPointsServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/GrantPointsServiceImpl.java new file mode 100644 index 0000000000..7374577050 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/GrantPointsServiceImpl.java @@ -0,0 +1,236 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.constant.ActConstant; +import com.epmet.dao.ActUserRelationDao; +import com.epmet.dto.ActInfoDTO; +import com.epmet.dto.ActPointLogDTO; +import com.epmet.dto.ActUserRelationDTO; +import com.epmet.dto.form.work.GrantPointsFormDTO; +import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.dto.result.work.PendingUserResultDTO; +import com.epmet.dto.result.work.UserBaseInfo; +import com.epmet.service.*; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 积分发放 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/24 12:27 + */ +@Service +public class GrantPointsServiceImpl implements GrantPointsService { + private Logger logger = LogManager.getLogger(GrantPointsServiceImpl.class); + @Autowired + private ActInfoService actInfoService; + @Autowired + private ActUserRelationDao actUserRelationDao; + @Autowired + private WorkActUserService workActUserService; + @Autowired + private ActUserRelationService actUserRelationService; + @Autowired + private ActPointLogService actPointLogService; + @Autowired + private LoginUserUtil loginUserUtil; + /** + * @param actId + * @return com.epmet.dto.result.work.PendingUserResultDTO + * @author yinzuomei + * @description 积分发放-待处理列表 + * @Date 2020/7/24 12:28 + **/ + @Override + public PendingUserResultDTO queryPendingList(String actId) { + PendingUserResultDTO pendingUserResultDTO = new PendingUserResultDTO(actId); + ActInfoDTO actInfoDTO = actInfoService.get(actId); + if (null == actInfoDTO) { + return pendingUserResultDTO; + } + pendingUserResultDTO.setActId(actId); + pendingUserResultDTO.setReward(actInfoDTO.getReward()); + pendingUserResultDTO.setTitle(actInfoDTO.getTitle()); + //已签到人员列表 + List signedInList = new ArrayList<>(); + //未签到人员列表 + List noSignInList = new ArrayList<>(); + List signedActUserList = actUserRelationDao.selectInProgress(actId); + List userIdList = actUserRelationDao.selectInProgressUserIds(actId); + List userInfoList = workActUserService.queryUserBaseInfoList(userIdList); + for (ActUserRelationDTO actUserRelation : signedActUserList) { + UserBaseInfo userBaseInfo = new UserBaseInfo(); + userBaseInfo.setActUserRelationId(actUserRelation.getId()); + userBaseInfo.setUserId(actUserRelation.getUserId()); + userBaseInfo.setVolunteerFlag(workActUserService.getVolunteerFlag(actUserRelation.getUserId())); + for (UserBaseInfoResultDTO userBaseInfoResultDTO : userInfoList) { + if (actUserRelation.getUserId().equals(userBaseInfoResultDTO.getUserId())) { + userBaseInfo.setRealName(userBaseInfoResultDTO.getRealName()); + userBaseInfo.setNickName(userBaseInfoResultDTO.getNickname()); + userBaseInfo.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); + break; + } + } + if (ActConstant.ACT_USER_STATUS_SIGNED_IN.equals(actUserRelation.getSignInFlag())) { + //已签到 + signedInList.add(userBaseInfo); + } else { + //未签到 + noSignInList.add(userBaseInfo); + } + } + pendingUserResultDTO.setNoSignInList(noSignInList); + pendingUserResultDTO.setSignedInList(signedInList); + return pendingUserResultDTO; + } + + /** + * @param formDTO + * @return void + * @author yinzuomei + * @description 积分发放-给分 + * @Date 2020/7/24 13:34 + **/ + @Override + public void agree(GrantPointsFormDTO formDTO) { + //是否是待处理 + ActUserRelationDTO actUserRelationDTO=actUserRelationService.get(formDTO.getActUserRelationId()); + if(null==actUserRelationDTO){ + logger.warn("积分发放-给分act_user_relation is null,actUserRelationId="+formDTO.getActUserRelationId()); + return; + } + //如果是已处理直接返回 + if(ActConstant.HANDLED.equals(actUserRelationDTO.getProcessFlag())){ + logger.info("积分发放-给分act_user_relation already handled,actUserRelationId="+formDTO.getActUserRelationId()); + return; + } + //查取分值 + ActInfoDTO actInfoDTO=actInfoService.get(actUserRelationDTO.getActId()); + if (null == actInfoDTO || ActConstant.ACT_STATUS_FINISHED.equals(actInfoDTO.getActStatus())) { + logger.warn("积分发放-给分act_info is null or act_info is finished"); + return; + } + if(!loginUserUtil.getLoginUserId().equals(actInfoDTO.getCreatedBy())){ + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); + } + //更新act_user_relation改为已处理,给分 + actUserRelationDTO.setProcessFlag(ActConstant.HANDLED); + actUserRelationDTO.setRewardFlag(ActConstant.ACT_USER_STATUS_AGREE); + actUserRelationDTO.setDenyRewardReason(StrConstant.EPMETY_STR); + actUserRelationService.update(actUserRelationDTO); + //增加一条act_point_log + ActPointLogDTO actPointLogDTO=new ActPointLogDTO(); + actPointLogDTO.setActId(actUserRelationDTO.getActId()); + actPointLogDTO.setUserId(actUserRelationDTO.getUserId()); + actPointLogDTO.setPoints(actInfoDTO.getReward()); + actPointLogDTO.setOperateType(ActConstant.ACT_USER_STATUS_AGREE); + actPointLogDTO.setRemark(StrConstant.EPMETY_STR); + /** + * 1有效0无效,只有在活动真正结束后才是1 + * true有效 false无效 + */ + actPointLogDTO.setEffectFlag(false); + actPointLogService.save(actPointLogDTO); + } + + /** + * @param formDTO + * @return void + * @author yinzuomei + * @description 积分发放-不给分 + * @Date 2020/7/24 15:03 + **/ + @Override + public void deny(GrantPointsFormDTO formDTO) { + //是否是待处理 + ActUserRelationDTO actUserRelationDTO=actUserRelationService.get(formDTO.getActUserRelationId()); + if(null==actUserRelationDTO){ + logger.warn("积分发放-不给分act_user_relation is null,actUserRelationId="+formDTO.getActUserRelationId()); + return; + } + //如果是已处理直接返回 + if(ActConstant.HANDLED.equals(actUserRelationDTO.getProcessFlag())){ + logger.info("积分发放-不给分act_user_relation already handled,actUserRelationId="+formDTO.getActUserRelationId()); + return; + } + //查取分值 + ActInfoDTO actInfoDTO=actInfoService.get(actUserRelationDTO.getActId()); + if (null == actInfoDTO || ActConstant.ACT_STATUS_FINISHED.equals(actInfoDTO.getActStatus())) { + logger.warn("积分发放-不给分act_info is null or act_info is finished"); + return; + } + if(!loginUserUtil.getLoginUserId().equals(actInfoDTO.getCreatedBy())){ + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); + } + //更新act_user_relation改为已处理,给分 + actUserRelationDTO.setProcessFlag(ActConstant.HANDLED); + actUserRelationDTO.setRewardFlag(ActConstant.ACT_USER_STATUS_DENY); + actUserRelationDTO.setDenyRewardReason(formDTO.getDenyRewardReason()); + actUserRelationService.update(actUserRelationDTO); + //增加一条act_point_log + ActPointLogDTO actPointLogDTO=new ActPointLogDTO(); + actPointLogDTO.setActId(actUserRelationDTO.getActId()); + actPointLogDTO.setUserId(actUserRelationDTO.getUserId()); + actPointLogDTO.setPoints(actInfoDTO.getReward()); + actPointLogDTO.setOperateType(ActConstant.ACT_USER_STATUS_DENY); + actPointLogDTO.setRemark(formDTO.getDenyRewardReason()); + /** + * 1有效0无效,只有在活动真正结束后才是1 + * true有效 false无效 + */ + actPointLogDTO.setEffectFlag(false); + actPointLogService.save(actPointLogDTO); + } + + /** + * @param formDTO + * @return void + * @author yinzuomei + * @description 积分发放-重新处理 + * @Date 2020/7/24 15:16 + **/ + @Override + public void reset(GrantPointsFormDTO formDTO) { + ActUserRelationDTO actUserRelationDTO=actUserRelationService.get(formDTO.getActUserRelationId()); + if(null==actUserRelationDTO){ + logger.warn("积分发放-重新处理act_user_relation is null,actUserRelationId="+formDTO.getActUserRelationId()); + return; + } + //查取分值 + ActInfoDTO actInfoDTO=actInfoService.get(actUserRelationDTO.getActId()); + if (null == actInfoDTO || ActConstant.ACT_STATUS_FINISHED.equals(actInfoDTO.getActStatus())) { + logger.warn("积分发放-重新处理act_info is null or act_info is finished"); + return; + } + if(!loginUserUtil.getLoginUserId().equals(actInfoDTO.getCreatedBy())){ + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); + } + //更新act_user_relation改为未处理 初始状态 + actUserRelationDTO.setProcessFlag(StrConstant.EPMETY_STR); + actUserRelationDTO.setRewardFlag(StrConstant.EPMETY_STR); + actUserRelationDTO.setDenyRewardReason(StrConstant.EPMETY_STR); + actUserRelationService.update(actUserRelationDTO); + //增加一条act_point_log + ActPointLogDTO actPointLogDTO=new ActPointLogDTO(); + actPointLogDTO.setActId(actUserRelationDTO.getActId()); + actPointLogDTO.setUserId(actUserRelationDTO.getUserId()); + actPointLogDTO.setPoints(actInfoDTO.getReward()); + actPointLogDTO.setOperateType(ActConstant.RESET); + actPointLogDTO.setRemark(StrConstant.EPMETY_STR); + /** + * 1有效0无效,只有在活动真正结束后才是1 + * true有效 false无效 + */ + actPointLogDTO.setEffectFlag(false); + actPointLogService.save(actPointLogDTO); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java index 6d6c81157a..3ec8d2dea5 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java @@ -560,7 +560,15 @@ public class WorkActUserServiceImpl implements WorkActUserService { return historicalActInfo; } - private Boolean getVolunteerFlag(String userId) { + /** + * @return java.lang.Boolean + * @param userId + * @author yinzuomei + * @description 根据用户id判断是否志愿者 + * @Date 2020/7/24 12:51 + **/ + @Override + public Boolean getVolunteerFlag(String userId) { HeartUserInfoDTO heartUserInfoDTO=heartUserInfoService.getByUserId(userId); //true: 是志愿者 false : 不是志愿者 if(null!=heartUserInfoDTO){ @@ -576,7 +584,8 @@ public class WorkActUserServiceImpl implements WorkActUserService { * @description 传入用户id集合,返回用户的基本信息(包含微信基本信息) * @Date 2020/7/22 10:38 **/ - private List queryUserBaseInfoList(List userIdList) { + @Override + public List queryUserBaseInfoList(List userIdList) { List userInfoList=new ArrayList<>(); if(null==userIdList||userIdList.size()==0){ return userInfoList; @@ -598,7 +607,8 @@ public class WorkActUserServiceImpl implements WorkActUserService { * @description 根据用户id获取用户基本信息 * @Date 2020/7/23 12:52 **/ - private UserBaseInfoResultDTO queryUserBaseInfo(String userId) { + @Override + public UserBaseInfoResultDTO queryUserBaseInfo(String userId) { List userIdList = new ArrayList<>(); userIdList.add(userId); //调用epemet_user服务获取用户的基本信息 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml index ce22f96e49..380e0197a7 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml @@ -573,7 +573,7 @@ and ai.DEL_FLAG='0') WHERE aur.DEL_FLAG = '0' - AND aur.`STATUS` = 'canceld' + AND aur.`STATUS` = 'canceled' AND aur.ACT_ID =#{actId} order by aur.CANCEL_TIME desc diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml index ac63e1f255..d2872098fd 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml @@ -162,4 +162,31 @@ ORDER BY acr.CREATED_TIME DESC + + + + + + From cfd46b1bdffdeb0e0d9434f2208800d092a1f798 Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 24 Jul 2020 16:44:30 +0800 Subject: [PATCH 61/98] =?UTF-8?q?=E6=B7=BB=E5=8A=A0appId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/LoginServiceImpl.java | 5 +- .../commons/tools/enums/MqMethodPathEnum.java | 1 + .../tools/utils/HttpClientManager.java | 6 +- .../java/com/epmet/dto/result/EventDTO.java | 112 ++++++++++++++++++ .../common-service-server/pom.xml | 10 ++ .../com/epmet/controller/EventController.java | 27 +++++ .../java/com/epmet/service/EventService.java | 6 + .../epmet/service/impl/EventServiceImpl.java | 25 +++- .../src/main/resources/bootstrap.yml | 10 +- .../src/main/resources/bootstrap.yml | 18 +-- 10 files changed, 204 insertions(+), 16 deletions(-) create mode 100644 epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/EventDTO.java diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java index 695c187105..5221a30b33 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java @@ -4,6 +4,7 @@ import cn.binarywang.wx.miniapp.api.WxMaService; import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo; import cn.binarywang.wx.miniapp.bean.WxMaUserInfo; +import com.alibaba.fastjson.JSON; import com.epmet.common.token.constant.LoginConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; @@ -120,10 +121,10 @@ public class LoginServiceImpl implements LoginService { wxMaJscode2SessionResult = wxMaServiceUtils.resiWxMaService().jsCode2SessionInfo(wxCode); } } catch (WxErrorException e) { - log.error("->[getMaOpenId]::error[{}]", "解析微信code失败"); + log.error("->[getMaOpenId]::error[{}]", "解析微信code失败",e); } if (null == wxMaJscode2SessionResult) { - log.error(String.format("解析微信用户信息失败,app[%s],wxCode[%s]",app,wxCode)); + log.error(String.format("解析微信用户信息失败,app[%s],wxCode[%s],result:[%S]",app,wxCode, JSON.toJSONString(wxMaJscode2SessionResult))); throw new RenException("解析微信用户信息失败"); } else if (StringUtils.isBlank(wxMaJscode2SessionResult.getOpenid())) { log.error(String.format("获取微信openid失败,app[%s],wxCode[%s]",app,wxCode)); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/MqMethodPathEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/MqMethodPathEnum.java index 014722de84..d74e47dab6 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/MqMethodPathEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/MqMethodPathEnum.java @@ -9,6 +9,7 @@ package com.epmet.commons.tools.enums; **/ public enum MqMethodPathEnum { SEND_MSG("producerService/producer/sendMsg", "发送消息"), + GET_EVENT_LIST("/eventClass/getList", "获取时间类型列表"), ; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java index 9f8ba52d28..6d91832472 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java @@ -27,7 +27,6 @@ import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; import org.apache.http.entity.mime.HttpMultipartMode; import org.apache.http.entity.mime.MultipartEntityBuilder; -import org.apache.http.entity.mime.content.FileBody; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; @@ -45,11 +44,10 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; import java.security.cert.CertificateException; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -188,7 +186,7 @@ public class HttpClientManager { // HttpEntity reqEntity = MultipartEntityBuilder.create() // .addPart("media", fileBody).build(); // httppost.setEntity(reqEntity); - return execute(httppost); + return execute(httppost,false); } catch (Exception e) { log.error("send exception", e); throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/EventDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/EventDTO.java new file mode 100644 index 0000000000..e95e09002a --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/EventDTO.java @@ -0,0 +1,112 @@ +/** + * 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.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 事件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-16 + */ +@Data +public class EventDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 消息网关事件类别ID 从消息网关获取事件类型Id + */ + private String classId; + + /** + * 消息网关APP_ID + */ + private String appId; + + /** + * 消息网关APP_NAME + */ + private String appName; + + /** + * 事件标识 与消息网关事件tag一致 + */ + private String eventCode; + + /** + * 事件名称 + */ + private String eventName; + + /** + * 事件说明 + */ + private String eventDesc; + + /** + * 事件功能分组ID 来自oper_customize.customer_function表 + */ + private String functionId; + + /** + * 是否是通用事件 0-否,1-是;消息体内需要体现该字段,通用则说明由业务系统自己计算分值 + */ + private String isCommon; + + /** + * 删除标识 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/epmet-module/epmet-common-service/common-service-server/pom.xml b/epmet-module/epmet-common-service/common-service-server/pom.xml index 2c694bbd67..69b16c5a01 100644 --- a/epmet-module/epmet-common-service/common-service-server/pom.xml +++ b/epmet-module/epmet-common-service/common-service-server/pom.xml @@ -116,6 +116,11 @@ false + + https://epmet-dev.elinkservice.cn/estos/ + producerService/producer/sendMsg + 202007161443499985fa2d397436d10356542134c8f008c48 + 52d9d9b0e7d0eb5b8b81c205b579e07c @@ -177,6 +182,11 @@ true + + https://epmet-dev.elinkservice.cn/estos/ + producerService/producer/sendMsg + 202007161443499985fa2d397436d10356542134c8f008c48 + 52d9d9b0e7d0eb5b8b81c205b579e07c diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/EventController.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/EventController.java index a9a8108669..5fb6ca00bd 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/EventController.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/EventController.java @@ -17,15 +17,24 @@ package com.epmet.controller; +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.config.MqConfig; +import com.epmet.commons.tools.enums.MqMethodPathEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.form.EventFormDTO; +import com.epmet.dto.result.EventDTO; import com.epmet.service.EventService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.Map; + /** * 事件表 @@ -39,6 +48,24 @@ public class EventController { @Autowired private EventService eventService; + @Autowired + private MqConfig mqConfig; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = eventService.page(params); + return new Result>().ok(page); + } + @GetMapping("geteventclass") + public Result getEventClass(@RequestParam Map params){ + params.put("token", mqConfig.getToken()); + params.put("appId", mqConfig.getAppId()); + Result result = HttpClientManager.getInstance().sendPostByHttps(mqConfig.getHost().concat(MqMethodPathEnum.GET_EVENT_LIST.getCode()), JSON.toJSONString(params)); + if (result.success()){ + return new Result<>().ok(JSON.parseArray(result.getData())); + } + return new Result<>().error(EpmetErrorCode.SERVER_ERROR.getMsg()); + } /** * desc:添加事件,如果已存在则不作任何改动,直接返回成功 diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/EventService.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/EventService.java index fc60058fc2..8e2c4cb635 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/EventService.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/EventService.java @@ -18,9 +18,13 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; import com.epmet.dto.form.EventFormDTO; +import com.epmet.dto.result.EventDTO; import com.epmet.entity.EventEntity; +import java.util.Map; + /** * 事件表 * @@ -32,4 +36,6 @@ public interface EventService extends BaseService { void addEvent(EventFormDTO formDTO); void updateEvent(EventFormDTO formDTO); + + PageData page(Map params); } \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/EventServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/EventServiceImpl.java index 53f892b9a5..5fe736adb3 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/EventServiceImpl.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/EventServiceImpl.java @@ -17,15 +17,23 @@ package com.epmet.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.EventDao; import com.epmet.dto.form.EventFormDTO; +import com.epmet.dto.result.EventDTO; import com.epmet.entity.EventEntity; import com.epmet.service.EventService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; +import java.util.Map; + /** * 事件表 * @@ -35,7 +43,14 @@ import org.springframework.stereotype.Service; @Slf4j @Service public class EventServiceImpl extends BaseServiceImpl implements EventService { - + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, EventDTO.class); + } @Override public void addEvent(EventFormDTO formDTO) { EventEntity eventEntity = ConvertUtils.sourceToTarget(formDTO, EventEntity.class); @@ -46,4 +61,12 @@ public class EventServiceImpl extends BaseServiceImpl imp public void updateEvent(EventFormDTO formDTO) { //baseDao.update(eventEntity); } + 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; + } } \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml index 146d5758dd..ec2f2c7a2b 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml @@ -117,4 +117,12 @@ ribbon: #pageHelper分页插件 pagehelper: helper-dialect: mysql - reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + +#亿联云消息网关 +elink: + mq: + appId: @elink.mq.appId@ #项目接入亿联云的应用Id + token: @elink.mq.token@ #项目接入亿联云的应用token 相当于secret + host: @elink.mq.host@ #亿联云消息网关服务地址 + sendMsgPath: @elink.mq.sendMsgPath@ #发送消息路径 \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml index 8571a47da1..72477fb20d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml @@ -118,17 +118,19 @@ pagehelper: helper-dialect: mysql reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 -#亿联云消息网关 -elink: - mq: - appId: @elink.mq.appId@ #项目接入亿联云的应用Id - token: @elink.mq.token@ #项目接入亿联云的应用token 相当于secret - host: @elink.mq.host@ #亿联云消息网关服务地址 - sendMsgPath: @elink.mq.sendMsgPath@ #发送消息路径 + openapi: scan: server: url: @openapi.scan.server.url@ method: imgSyncScan: /imgSyncScan - textSyncScan: /textSyncScan \ No newline at end of file + textSyncScan: /textSyncScan + +#亿联云消息网关 +elink: + mq: + appId: @elink.mq.appId@ #项目接入亿联云的应用Id + token: @elink.mq.token@ #项目接入亿联云的应用token 相当于secret + host: @elink.mq.host@ #亿联云消息网关服务地址 + sendMsgPath: @elink.mq.sendMsgPath@ #发送消息路径 \ No newline at end of file From 8f106d7f9794d25575697df1c1abf275747004ef Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 24 Jul 2020 18:23:55 +0800 Subject: [PATCH 62/98] =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-auth/deploy/docker-compose-test.yml | 2 +- .../epmet-job/epmet-job-server/deploy/docker-compose-test.yml | 2 +- .../epmet-third-server/deploy/docker-compose-test.yml | 2 +- .../gov-org/gov-org-server/deploy/docker-compose-test.yml | 2 +- .../resi-guide/resi-guide-server/deploy/docker-compose-test.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/epmet-auth/deploy/docker-compose-test.yml b/epmet-auth/deploy/docker-compose-test.yml index d15b071181..ef83cd722f 100644 --- a/epmet-auth/deploy/docker-compose-test.yml +++ b/epmet-auth/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-auth-server: container_name: epmet-auth-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-auth:0.3.36 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-auth:0.3.48 ports: - "8081:8081" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-test.yml b/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-test.yml index 9fc81b43c5..2749306424 100644 --- a/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-test.yml +++ b/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-job-server: container_name: epmet-job-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-job-server:0.3.22 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-job-server:0.3.23 ports: - "8084:8084" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml index 60cf655960..c396270821 100644 --- a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml +++ b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-third-server: container_name: epmet-third-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-third-server:0.0.14 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-third-server:0.0.58 ports: - "8110:8110" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml index a6e6dd4760..a912b71cc2 100644 --- a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml +++ b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-org-server:0.3.74 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-org-server:0.3.76 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-test.yml b/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-test.yml index 3aef647382..3fde6f4ec8 100644 --- a/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-test.yml +++ b/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-guide-server: container_name: resi-guide-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-guide-server:0.3.17 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-guide-server:0.3.18 ports: - "8091:8091" network_mode: host # 使用现有网络 From 24a841a0a766b34fdd354415ad65a1ea53c981ab Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Fri, 24 Jul 2020 18:56:17 +0800 Subject: [PATCH 63/98] =?UTF-8?q?=E7=88=B1=E5=BF=83=E4=BA=92=E5=8A=A9?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4-=E4=B8=80=E6=B3=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/resi/ResiActInsertLiveFormDTO.java | 5 + .../com/epmet/feign/EpmetUserFeignClient.java | 11 --- .../EpmetUserFeignClientFallBack.java | 4 - .../java/com/epmet/dao/ActLiveRecDao.java | 12 ++- .../java/com/epmet/dao/ActSignInRecDao.java | 15 ++- .../com/epmet/service/ActLiveRecService.java | 7 -- .../epmet/service/ActSignInRecService.java | 5 - .../service/impl/ActLiveRecServiceImpl.java | 40 ++++---- .../service/impl/ActSignInRecServiceImpl.java | 58 +++++------ .../impl/ActUserRelationServiceImpl.java | 95 ++++++++++++++----- .../impl/HeartUserInfoServiceImpl.java | 58 ++++++----- .../com/epmet/utils/ValidityVerification.java | 6 +- .../src/main/resources/mapper/ActInfoDao.xml | 12 +-- .../main/resources/mapper/ActLiveRecDao.xml | 31 ++++++ .../main/resources/mapper/ActSignInRecDao.xml | 37 +++++++- .../resources/mapper/HeartUserInfoDao.xml | 3 +- .../epmet/feign/EpmetUserOpenFeignClient.java | 11 +++ .../EpmetUserOpenFeignClientFallback.java | 5 + .../epmet/controller/UserRoleController.java | 4 +- 19 files changed, 275 insertions(+), 144 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActInsertLiveFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActInsertLiveFormDTO.java index d84b3b4698..42ee3576fe 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActInsertLiveFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActInsertLiveFormDTO.java @@ -90,4 +90,9 @@ public class ResiActInsertLiveFormDTO implements Serializable { * 用户id */ private String userId; + + /** + * id + */ + private String id; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index c8e1660cd3..55455d5122 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -36,17 +36,6 @@ public interface EpmetUserFeignClient { @PostMapping("epmetuser/userbaseinfo/queryuserbaseinfo") Result> heartQueryUserBaseInfo(@RequestBody List userIds); - /** - * 根据用户ID,查询用户所属角色: 多种身份 - * - * @param userId - * @return com.epmet.commons.tools.utils.Result> - * @Author zhangyong - * @Date 14:13 2020-07-23 - **/ - @PostMapping(value = "epmetuser/userrole/getuserroleinfobyuserid/{userId}", consumes = MediaType.APPLICATION_JSON_VALUE) - Result> getUserRoleInfoByUserId(@PathVariable("userId") String userId); - /** * 同步-居民基础信息、用户微信信息 * diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java index 1238fceed5..37beeef602 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java @@ -25,10 +25,6 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "heartQueryUserBaseInfo", userIds); } - @Override - public Result> getUserRoleInfoByUserId(String userId) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getUserRoleInfoByUserId", userId); - } @Override public Result updateUserBaseAndWxUserInfo(WxUserInfoFormDTO formDTO) { diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActLiveRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActLiveRecDao.java index 61d04aa888..ce9999af87 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActLiveRecDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActLiveRecDao.java @@ -20,7 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.ActLivePicDTO; import com.epmet.dto.ActLiveRecDTO; -import com.epmet.dto.form.resi.ResiActContentFormDTO; +import com.epmet.dto.form.resi.ResiActInsertLiveFormDTO; import com.epmet.entity.ActLiveRecEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -55,4 +55,14 @@ public interface ActLiveRecDao extends BaseDao { * @Date 17:04 2020-07-22 **/ List selectListActLiveImg(@Param("liveId") List liveIds); + + /** + * 插入活动实况表 + * + * @param formDTO + * @return void + * @Author zhangyong + * @Date 18:05 2020-07-24 + **/ + void insertActLiveRec(ResiActInsertLiveFormDTO formDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSignInRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSignInRecDao.java index 04c13f13cd..ca383df81f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSignInRecDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSignInRecDao.java @@ -18,6 +18,8 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.ActSignInRecDTO; +import com.epmet.dto.form.resi.ResiActSignInFormDTO; import com.epmet.entity.ActSignInRecEntity; import org.apache.ibatis.annotations.Mapper; @@ -29,5 +31,14 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ActSignInRecDao extends BaseDao { - -} \ No newline at end of file + + /** + * 插入活动签到记录表 + * + * @param dto + * @return void + * @Author zhangyong + * @Date 18:05 2020-07-24 + **/ + void insertActSignInRec(ActSignInRecDTO dto); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java index 4185eedf75..79d95ce9e7 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java @@ -18,19 +18,12 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.ActLiveRecDTO; -import com.epmet.dto.form.resi.ResiActContentFormDTO; import com.epmet.dto.form.resi.ResiActInsertLiveFormDTO; -import com.epmet.dto.form.resi.ResiActSignInFormDTO; import com.epmet.dto.result.resi.ResiActLiveRecResultDTO; import com.epmet.entity.ActLiveRecEntity; -import java.util.List; -import java.util.Map; - /** * 活动实况记录 * diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSignInRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSignInRecService.java index 84aec10141..c2ba4124ce 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSignInRecService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSignInRecService.java @@ -18,16 +18,11 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.ActSignInRecDTO; import com.epmet.dto.form.resi.ResiActSignInFormDTO; import com.epmet.entity.ActSignInRecEntity; -import java.util.List; -import java.util.Map; - /** * 活动签到记录 * diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java index b5038ce2ab..79d8a52dbe 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java @@ -20,11 +20,10 @@ package com.epmet.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.ActLivePicDao; import com.epmet.dao.ActLiveRecDao; -import com.epmet.dao.ActUserLogDao; -import com.epmet.dao.ActUserRelationDao; import com.epmet.dto.ActLivePicDTO; import com.epmet.dto.ActLiveRecDTO; import com.epmet.dto.form.resi.ResiActInsertLiveFormDTO; @@ -32,9 +31,11 @@ import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.dto.result.resi.ResiActLiveRecResultDTO; import com.epmet.entity.ActLivePicEntity; import com.epmet.entity.ActLiveRecEntity; +import com.epmet.entity.ActSignInRecEntity; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.redis.ActLiveRecRedis; import com.epmet.service.ActLiveRecService; +import com.epmet.utils.ValidityVerification; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -99,26 +100,29 @@ public class ActLiveRecServiceImpl extends BaseServiceImpl inSertlive(TokenDto tokenDto, ResiActInsertLiveFormDTO formDTO) { formDTO.setUserId(tokenDto.getUserId()); + // 文本校验 + ValidityVerification verification = new ValidityVerification(); + verification.textScanVerification(formDTO.getDesc(),"添加实况-文本内容审核失败"); + // 图片校验 + verification.imgScanVerification(formDTO.getImages(),"添加实况-图片审核失败"); + // 存储活动实况记录表 - ActLiveRecEntity actLiveRecEntity = new ActLiveRecEntity(); - actLiveRecEntity.setActId(formDTO.getActId()); - actLiveRecEntity.setUserId(formDTO.getUserId()); - actLiveRecEntity.setLongitude(formDTO.getLongitude()); - actLiveRecEntity.setLatitude(formDTO.getLatitude()); - actLiveRecEntity.setAddress(formDTO.getAddress()); - actLiveRecEntity.setDesc(formDTO.getDesc()); - baseDao.insert(actLiveRecEntity); + String uuid = UUID.randomUUID().toString().replaceAll("-",""); + formDTO.setId(uuid); + baseDao.insertActLiveRec(formDTO); //存储活动实况图片 List imgList = formDTO.getImages(); - for (int i = 0; i < imgList.size(); i++) { - String imgUrl = imgList.get(i); - ActLivePicEntity actLivePicEntity = new ActLivePicEntity(); - actLivePicEntity.setLiveId(actLiveRecEntity.getId()); - actLivePicEntity.setPicUrl(imgUrl); - actLivePicEntity.setSort(i + NumConstant.ONE); - actLivePicDao.insert(actLivePicEntity); + if (null != imgList){ + for (int i = 0; i < imgList.size(); i++) { + String imgUrl = imgList.get(i); + ActLivePicEntity actLivePicEntity = new ActLivePicEntity(); + actLivePicEntity.setLiveId(uuid); + actLivePicEntity.setPicUrl(imgUrl); + actLivePicEntity.setSort(i + NumConstant.ONE); + actLivePicDao.insert(actLivePicEntity); + } } - return new Result().ok(actLiveRecEntity.getId()); + return new Result().ok(uuid); } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInRecServiceImpl.java index 5cc716d8b4..4bd516e4f9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInRecServiceImpl.java @@ -25,22 +25,23 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.constant.ActConstant; import com.epmet.dao.ActSignInPicDao; import com.epmet.dao.ActSignInRecDao; -import com.epmet.dao.ActUserLogDao; import com.epmet.dao.ActUserRelationDao; +import com.epmet.dto.ActSignInRecDTO; import com.epmet.dto.ActUserRelationDTO; import com.epmet.dto.form.resi.ResiActInsertLiveFormDTO; import com.epmet.dto.form.resi.ResiActSignInFormDTO; import com.epmet.entity.ActSignInPicEntity; import com.epmet.entity.ActSignInRecEntity; -import com.epmet.entity.ActUserLogEntity; import com.epmet.redis.ActSignInRecRedis; import com.epmet.service.ActLiveRecService; import com.epmet.service.ActSignInRecService; +import com.epmet.utils.ValidityVerification; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; +import java.util.UUID; /** * 活动签到记录 @@ -57,9 +58,6 @@ public class ActSignInRecServiceImpl extends BaseServiceImpl inSertlive = actLiveRecService.inSertlive(tokenDto, liveFormDTO); - liveId = inSertlive.getData(); + //实况id, 当sync_live=1时此列有值 + dto.setLiveId(inSertlive.getData()); } - // 存储活动签到记录表 - ActSignInRecEntity actSignInRecEntity = new ActSignInRecEntity(); - actSignInRecEntity.setActId(formDTO.getActId()); - actSignInRecEntity.setUserId(formDTO.getUserId()); - actSignInRecEntity.setLongitude(formDTO.getLongitude()); - actSignInRecEntity.setLatitude(formDTO.getLatitude()); - actSignInRecEntity.setAddress(formDTO.getAddress()); - actSignInRecEntity.setDesc(formDTO.getDesc()); - actSignInRecEntity.setSyncLive(formDTO.getSyncLive()); - actSignInRecEntity.setLiveId(liveId); - baseDao.insert(actSignInRecEntity); + String uuid = UUID.randomUUID().toString().replaceAll("-",""); + dto.setId(uuid); + baseDao.insertActSignInRec(dto); //存储活动签到图片 List imgList = formDTO.getImages(); - for (int i = 0; i < imgList.size(); i++) { - String imgUrl = imgList.get(i); - ActSignInPicEntity actLivePicEntity = new ActSignInPicEntity(); - actLivePicEntity.setSignInId(actSignInRecEntity.getId()); - actLivePicEntity.setPicUrl(imgUrl); - actLivePicEntity.setSort(i + NumConstant.ONE); - actSignInPicDao.insert(actLivePicEntity); + if (null != imgList){ + for (int i = 0; i < imgList.size(); i++) { + String imgUrl = imgList.get(i); + ActSignInPicEntity actLivePicEntity = new ActSignInPicEntity(); + actLivePicEntity.setSignInId(uuid); + actLivePicEntity.setPicUrl(imgUrl); + actLivePicEntity.setSort(i + NumConstant.ONE); + actSignInPicDao.insert(actLivePicEntity); + } } return new Result(); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java index d1782fc0f8..53bc8a11f0 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java @@ -42,7 +42,7 @@ import com.epmet.dto.result.UserRoleResultDTO; import com.epmet.entity.ActUserLogEntity; import com.epmet.entity.ActUserRelationEntity; import com.epmet.entity.HeartUserInfoEntity; -import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.redis.ActUserRelationRedis; import com.epmet.service.ActInfoService; import com.epmet.service.ActUserLogService; @@ -76,7 +76,7 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl0 当前用户是志愿者 + Integer volunteerFlag = volunteerInfoDao.queryVolunteerFlagByUserId(formDTO.getActId()); if (actInfoDTO.getVolunteerLimit()){ - // 活动只能志愿者参加 - Integer volunteerFlag = volunteerInfoDao.queryVolunteerFlagByUserId(formDTO.getUserId()); - if (volunteerFlag > NumConstant.ZERO){ - satisfy = true; - } else { - logger.info("活动报名失败,请先认证志愿者"); - throw new RenException(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER.getCode()); - } + // 活动只能志愿者参加, 当前用户是否满足条件 + satisfy = this.volunteerParticipationAct(volunteerFlag); } else { - // 活动不限制志愿者身份,但要求是 居民身份 - Result> userRoleInfo = epmetUserFeignClient.getUserRoleInfoByUserId(formDTO.getUserId()); - for (UserRoleResultDTO roleResultDTO :userRoleInfo.getData()){ - if (EpmetRoleKeyConstant.REGISTERED_RESI.equals(roleResultDTO.getRoleKey())){ - satisfy = true; - } - } - if (!satisfy){ - logger.info("活动报名失败,请完善居民信息"); - throw new RenException(EpmetErrorCode.CANNOT_AUDIT_WARM.getCode()); - } + // 活动不限制志愿者身份,但要求是 居民身份, 当前用户是否满足条件 + satisfy = this.resiParticipationAct(formDTO.getUserId()); } if (satisfy){ - this.actStartSignUp(actInfoDTO, formDTO); + // 开始报名 + this.actStartSignUp(actInfoDTO, formDTO, volunteerFlag); } return new Result(); } - private void actStartSignUp(ActInfoDTO actInfoDTO, ResiActRegistrationFormDTO formDTO){ + /** + * 开始报名活动 + * + * @param actInfoDTO 活动详情 + * @param formDTO 接口请求入参 + * @param volunteerFlag >0 当前用户是志愿者 + * @return void + * @Author zhangyong + * @Date 15:31 2020-07-24 + **/ + private void actStartSignUp(ActInfoDTO actInfoDTO, ResiActRegistrationFormDTO formDTO, Integer volunteerFlag){ boolean signUp = true; Integer auditingNum = actUserLogService.countActTimesOfParticipation(formDTO.getUserId()); if (auditingNum > NumConstant.ZERO){ @@ -246,7 +244,7 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl NumConstant.ZERO); entity.setKindnessTime(NumConstant.ZERO); entity.setParticipationNum(NumConstant.ZERO); entity.setObtainPointNum(NumConstant.ZERO); @@ -264,8 +262,53 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl NumConstant.ZERO){ + satisfy = true; + return satisfy; + } else { + logger.info("活动报名失败,请先认证志愿者"); + throw new RenException(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER.getCode()); + } + } + + /** + * 活动报名,不限制志愿者身份,但要求是 居民身份。当前用户是否符合 + * @param userId + * @return boolean + * @Author zhangyong + * @Date 15:04 2020-07-24 + **/ + private boolean resiParticipationAct(String userId){ + boolean satisfy = false; + // 活动不限制志愿者身份,但要求是 居民身份 + Result> userRoleInfo = epmetUserOpenFeignClient.getUserRoleInfoByUserId(userId); + if (userRoleInfo.success()){ + for (UserRoleResultDTO roleResultDTO :userRoleInfo.getData()){ + if (EpmetRoleKeyConstant.REGISTERED_RESI.equals(roleResultDTO.getRoleKey())){ + satisfy = true; + } + } + } + if (!satisfy){ + logger.info("活动报名失败,请完善居民信息"); + throw new RenException(EpmetErrorCode.CANNOT_AUDIT_WARM.getCode()); + } else { + return satisfy; + } + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartUserInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartUserInfoServiceImpl.java index fead42e055..a8d0dfacfe 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartUserInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartUserInfoServiceImpl.java @@ -20,21 +20,24 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.HeartUserInfoDao; import com.epmet.dto.HeartUserInfoDTO; -import com.epmet.dto.UserWechatDTO; import com.epmet.dto.form.resi.ResiActBaseFormDTO; import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.dto.result.resi.ResiLeaderboardResultDTO; import com.epmet.entity.HeartUserInfoEntity; -import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.redis.HeartUserInfoRedis; import com.epmet.service.HeartUserInfoService; import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -52,11 +55,11 @@ import java.util.Map; */ @Service public class HeartUserInfoServiceImpl extends BaseServiceImpl implements HeartUserInfoService { - + private Logger logger = LogManager.getLogger(HeartUserInfoServiceImpl.class); @Autowired private HeartUserInfoRedis heartUserInfoRedis; @Autowired - private EpmetUserFeignClient epmetUserFeignClient; + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; @Override public PageData page(Map params) { @@ -124,28 +127,35 @@ public class HeartUserInfoServiceImpl extends BaseServiceImpl> leaderboard(ResiActBaseFormDTO formDTO) { + List resultDTOS = new ArrayList<>(); // 获取排好序的 排行榜 List leaderboardList = baseDao.selectListLeaderboard(formDTO); - // 根据用户ID获取微信昵称、头像 - List userIds = new ArrayList<>(); - for (HeartUserInfoDTO list : leaderboardList){ - userIds.add(list.getUserId()); - } - // 查询用户微信基础信息 - Result> userWxInfos = epmetUserFeignClient.heartQueryUserBaseInfo(userIds); - - List resultDTOS = new ArrayList<>(); - for (HeartUserInfoDTO list : leaderboardList){ - ResiLeaderboardResultDTO dto = new ResiLeaderboardResultDTO(); - dto.setKindnessTime(list.getKindnessTime()); - dto.setVolunteerFlag(list.getVolunteerFlag()); - dto.setParticipationNum(list.getParticipationNum()); - List wxInfo = userWxInfos.getData(); - for (UserBaseInfoResultDTO wx : wxInfo){ - if (list.getUserId().equals(wx.getUserId())){ - dto.setHeadImg(wx.getHeadImgUrl()); - dto.setNickname(wx.getNickname()); + if (leaderboardList.size() > NumConstant.ZERO){ + // 根据用户ID获取微信昵称、头像 + List userIds = new ArrayList<>(); + for (HeartUserInfoDTO list : leaderboardList){ + userIds.add(list.getUserId()); + } + // 查询用户微信基础信息 + Result> userWxInfos = epmetUserOpenFeignClient.queryUserBaseInfo(userIds); + if (userWxInfos.success() && userWxInfos.getData().size() > NumConstant.ZERO){ + for (HeartUserInfoDTO list : leaderboardList){ + ResiLeaderboardResultDTO dto = new ResiLeaderboardResultDTO(); + dto.setKindnessTime(list.getKindnessTime()); + dto.setVolunteerFlag(list.getVolunteerFlag()); + dto.setParticipationNum(list.getParticipationNum()); + List wxInfo = userWxInfos.getData(); + for (UserBaseInfoResultDTO wx : wxInfo){ + if (list.getUserId().equals(wx.getUserId())){ + dto.setHeadImg(wx.getHeadImgUrl()); + dto.setNickname(wx.getNickname()); + } + } + resultDTOS.add(dto); } + } else { + logger.info("查询用户基本信息接口返回失败"); + throw new RenException("查询用户基本信息失败"); } } return new Result>().ok(resultDTOS); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ValidityVerification.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ValidityVerification.java index 2b56bdc176..48deaa99b9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ValidityVerification.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ValidityVerification.java @@ -64,11 +64,13 @@ public class ValidityVerification { /** * 图片列表校验 * @param imgList 被校验的图片列表 + * @param businessEnum 业务枚举,定义校验失败后,输出的日志信息 + * * @return void * @auther zhangyong * @Date 14:42 2020-07-15 **/ - public void imgScanVerification(List imgList){ + public void imgScanVerification(List imgList, String businessEnum){ if (NumConstant.ZERO != imgList.size()){ ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO(); imgList.forEach(url -> { @@ -82,6 +84,8 @@ public class ValidityVerification { throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); } else { if (!imgScanResult.getData().isAllPass()) { + // 业务枚举:例如:评论话题失败,评论内容为:%s" + log.error(String.format(businessEnum)); throw new RenException(EpmetErrorCode.IMG_SCAN_FAILED.getCode()); } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml index 380e0197a7..41545a7269 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml @@ -450,12 +450,12 @@ resultType="java.lang.Integer"> SELECT COUNT(1) - FROM act_info - WHERE DEL_FLAG = '0' - AND USER_ID = #{userId} - AND ACT_STATUS = 'published' - AND ((#{actStartTime} BETWEEN ACT_START_TIME AND ACT_END_TIME OR #{actEndTime} BETWEEN ACT_START_TIME AND ACT_END_TIME) - or (ACT_START_TIME BETWEEN #{actStartTime} AND #{actEndTime} OR ACT_END_TIME BETWEEN #{actStartTime} AND #{actEndTime})); + FROM act_info i LEFT JOIN act_user_relation r ON i.ID = r.ACT_ID + WHERE i.DEL_FLAG = '0' + AND r.USER_ID = #{userId} + AND i.ACT_STATUS = 'published' + AND ((#{actStartTime} BETWEEN i.ACT_START_TIME AND i.ACT_END_TIME OR #{actEndTime} BETWEEN i.ACT_START_TIME AND i.ACT_END_TIME) + or (i.ACT_START_TIME BETWEEN #{actStartTime} AND #{actEndTime} OR i.ACT_END_TIME BETWEEN #{actStartTime} AND #{actEndTime})); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLiveRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLiveRecDao.xml index 6e0281baf5..6b3c8d92ea 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLiveRecDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLiveRecDao.xml @@ -48,4 +48,35 @@ order by SORT asc + + + INSERT INTO act_live_rec ( + ID, + ACT_ID, + USER_ID, + LONGITUDE, + LATITUDE, + ADDRESS, + `DESC`, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME) + VALUES + ( #{id}, + #{actId}, + #{userId}, + #{longitude}, + #{latitude}, + #{address}, + #{desc}, + 0, + 0, + #{userId}, + now(), + #{userId}, + now()) + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSignInRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSignInRecDao.xml index 6ac88d72a1..c1e6956935 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSignInRecDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSignInRecDao.xml @@ -21,5 +21,38 @@ - - \ No newline at end of file + + INSERT INTO act_sign_in_rec ( + ID, + ACT_ID, + USER_ID, + LONGITUDE, + LATITUDE, + ADDRESS, + `DESC`, + SYNC_LIVE, + LIVE_ID, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME) + VALUES + ( #{id}, + #{actId}, + #{userId}, + #{longitude}, + #{latitude}, + #{address}, + #{desc}, + #{syncLive}, + #{liveId}, + 0, + 0, + #{userId}, + now(), + #{userId}, + now()) + + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml index 107007c2dc..3a9473fa15 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml @@ -45,8 +45,7 @@ resultType="com.epmet.dto.HeartUserInfoDTO"> SELECT ui.USER_ID userId, - volunteerFlag, - IF(ui.VOLUNTEER_FLAG = 1, true , false ) + ui.VOLUNTEER_FLAG volunteerFlag, ui.KINDNESS_TIME kindnessTime, ui.PARTICIPATION_NUM participationNum FROM heart_user_info ui diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 8a4de9898e..e9f080a3b5 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -148,4 +148,15 @@ public interface EpmetUserOpenFeignClient { **/ @PostMapping("/epmetuser/userbaseinfo/queryuserbaseinfo") Result> queryUserBaseInfo(@RequestBody List userIdList); + + /** + * 根据用户ID,查询用户所属角色: 多种身份 + * + * @param userId + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 14:13 2020-07-23 + **/ + @GetMapping(value = "epmetuser/userrole/getuserroleinfobyuserid/{userId}") + Result> getUserRoleInfoByUserId(@PathVariable("userId") String userId); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index bb2cbe9d77..1eafedfbd2 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -98,4 +98,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result> queryUserBaseInfo(List userIdList) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "queryUserBaseInfo", userIdList); } + + @Override + public Result> getUserRoleInfoByUserId(String userId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getUserRoleInfoByUserId", userId); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserRoleController.java index f73fc1b52f..7a1bbbe99d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserRoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserRoleController.java @@ -128,8 +128,8 @@ public class UserRoleController { * @Author zhangyong * @Date 14:24 2020-07-23 **/ - @PostMapping("getuserroleinfobyuserid/{userId}") - public Result> getUserRoleInfoByUserId(@PathVariable String userId) { + @GetMapping("getuserroleinfobyuserid/{userId}") + public Result> getUserRoleInfoByUserId(@PathVariable("userId") String userId) { return userRoleService.getUserRoleInfoByUserId(userId); } } From 8e83a93a86e7b9aa27ead5ea83f88ff9a17b7d11 Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 24 Jul 2020 18:56:40 +0800 Subject: [PATCH 64/98] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E7=BD=91=E5=85=B3=E4=BA=8B=E4=BB=B6=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/dto/form/mq/EventClassDto.java | 41 +++++++++++++ .../tools/dto/form/mq/MqBaseMsgDTO.java | 7 ++- .../{MqConfigDTO.java => MqBaseParamDTO.java} | 2 +- .../commons/tools/enums/MqMethodPathEnum.java | 2 +- .../commons/tools/utils/SendMqMsgUtils.java | 59 ++++++++++++++++--- .../com/epmet/controller/EventController.java | 17 ++---- 6 files changed, 106 insertions(+), 22 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/EventClassDto.java rename epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/{MqConfigDTO.java => MqBaseParamDTO.java} (83%) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/EventClassDto.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/EventClassDto.java new file mode 100644 index 0000000000..fb82587822 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/EventClassDto.java @@ -0,0 +1,41 @@ +package com.epmet.commons.tools.dto.form.mq; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:消息网关事件类型dto + * + * @author lyn + * @date 2020/7/24 18:30 + */ +@Data +public class EventClassDto implements Serializable { + private static final long serialVersionUID = 6923860669547819790L; + /** + * appId + */ + private String appId; + /** + * 事件类型Id + */ + private Integer id; + /** + * 事件标识 + */ + private String eventClass; + /** + * 事件名称 + */ + private String eventClassName; + /** + * 0''未删''1''已删 + */ + private Integer delFlag; + /** + * 事件计数 + */ + private Integer eventCount; + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqBaseMsgDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqBaseMsgDTO.java index 812d2e5baa..6e9318549e 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqBaseMsgDTO.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqBaseMsgDTO.java @@ -3,6 +3,8 @@ package com.epmet.commons.tools.dto.form.mq; import lombok.Data; import org.springframework.stereotype.Component; +import javax.validation.constraints.NotBlank; + /** * 消息网关基础信息 * @@ -11,20 +13,23 @@ import org.springframework.stereotype.Component; **/ @Data @Component -public class MqBaseMsgDTO extends MqConfigDTO { +public class MqBaseMsgDTO extends MqBaseParamDTO { private static final long serialVersionUID = 8176470786428432009L; /** * mq的事件类型 */ + @NotBlank(message = "事件类型不能为空") private String eventClass; /** * 事件code */ + @NotBlank(message = "事件标识不能为空") private String eventTag; /** * 消息体 */ + @NotBlank(message = "消息体不能为空") private String msg; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqConfigDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqBaseParamDTO.java similarity index 83% rename from epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqConfigDTO.java rename to epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqBaseParamDTO.java index 24a388f8ae..9ad8df6cf4 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqConfigDTO.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqBaseParamDTO.java @@ -11,7 +11,7 @@ import java.io.Serializable; * @date 2020-07-21 14:33 **/ @Data -public class MqConfigDTO implements Serializable { +public class MqBaseParamDTO implements Serializable { private String appId; private String token; private String requestUrl; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/MqMethodPathEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/MqMethodPathEnum.java index d74e47dab6..866229d1d9 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/MqMethodPathEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/MqMethodPathEnum.java @@ -9,7 +9,7 @@ package com.epmet.commons.tools.enums; **/ public enum MqMethodPathEnum { SEND_MSG("producerService/producer/sendMsg", "发送消息"), - GET_EVENT_LIST("/eventClass/getList", "获取时间类型列表"), + GET_EVENT_LIST("eventClass/getList", "获取事件类型列表"), ; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/SendMqMsgUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/SendMqMsgUtils.java index 65fb179ca3..dede8d5706 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/SendMqMsgUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/SendMqMsgUtils.java @@ -4,14 +4,21 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.epmet.commons.tools.config.MqConfig; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.form.mq.EventClassDto; import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; import com.epmet.commons.tools.dto.form.mq.MqReturnBaseResult; import com.epmet.commons.tools.enums.MqMethodPathEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.ValidateException; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.DefaultGroup; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** * 发送亿联云消息工具类 * @@ -21,7 +28,7 @@ import org.springframework.stereotype.Component; @Slf4j @Component public class SendMqMsgUtils { - private static MqConfig mqStaticConfig; + private static MqConfig mqConfig; /** * desc:发送mq消息 @@ -29,19 +36,19 @@ public class SendMqMsgUtils { * @return */ public static Result sendMsg(MqBaseMsgDTO msg) { - if (mqStaticConfig == null) { - mqStaticConfig = SpringContextUtils.getBean(MqConfig.class); + if (mqConfig == null) { + mqConfig = SpringContextUtils.getBean(MqConfig.class); } log.debug("sendMsg param:{}", JSON.toJSONString(msg)); try { // TODO - //ValidatorUtils.validateEntity(msg, null); + ValidatorUtils.validateEntity(msg, DefaultGroup.class); } catch (ValidateException e) { return new Result().error(e.getMsg()); } - msg.setAppId(mqStaticConfig.getAppId()); - msg.setRequestUrl(mqStaticConfig.getHost().concat(MqMethodPathEnum.SEND_MSG.getCode())); - msg.setToken(mqStaticConfig.getToken()); + msg.setAppId(mqConfig.getAppId()); + msg.setRequestUrl(mqConfig.getHost().concat(MqMethodPathEnum.SEND_MSG.getCode())); + msg.setToken(mqConfig.getToken()); try { Result result = HttpClientManager.getInstance().sendPostByHttps(msg.getRequestUrl(), JSON.toJSONString(msg)); log.debug("sendMsg result:{}", JSON.toJSONString(result)); @@ -66,4 +73,42 @@ public class SendMqMsgUtils { } + /** + * desc:发送mq消息 + * + * @return + */ + public static Result> getEventClassList() { + if (mqConfig == null) { + mqConfig = SpringContextUtils.getBean(MqConfig.class); + } + Map param = new HashMap<>(); + param.put("appId", mqConfig.getAppId()); + param.put("token", mqConfig.getToken()); + String requestUrl = mqConfig.getHost().concat(MqMethodPathEnum.GET_EVENT_LIST.getCode()); + + try { + Result result = HttpClientManager.getInstance().sendPostByHttps(requestUrl, JSON.toJSONString(param)); + log.debug("getEventClassList result:{}", JSON.toJSONString(result)); + if (result.success()) { + MqReturnBaseResult resultResult = JSON.parseObject(result.getData(), MqReturnBaseResult.class); + if (resultResult.getErrCode().equals(NumConstant.ZERO)) { + List eventClassDto = JSON.parseArray(resultResult.getData(), EventClassDto.class); + return new Result>().ok(eventClassDto); + } else { + log.error("sendMsg fail,resultData:{}", JSON.toJSONString(resultResult)); + return new Result>().error(EpmetErrorCode.SERVER_ERROR.getCode(), resultResult.getErrMsg()); + } + } + Result> resultResult = new Result<>(); + resultResult.error(result.getCode(), result.getMsg()); + resultResult.setInternalMsg(result.getInternalMsg()); + return resultResult; + } catch (Exception e) { + log.debug("sendMsg exception", e); + return new Result>().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + } + + } diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/EventController.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/EventController.java index 5fb6ca00bd..4c3212b878 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/EventController.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/EventController.java @@ -17,19 +17,17 @@ package com.epmet.controller; -import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.config.MqConfig; -import com.epmet.commons.tools.enums.MqMethodPathEnum; -import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.SendMqMsgUtils; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.form.EventFormDTO; import com.epmet.dto.result.EventDTO; import com.epmet.service.EventService; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -42,6 +40,7 @@ import java.util.Map; * @author generator generator@elink-cn.com * @since v1.0.0 2020-07-16 */ +@Slf4j @RestController @RequestMapping("event") public class EventController { @@ -57,14 +56,8 @@ public class EventController { return new Result>().ok(page); } @GetMapping("geteventclass") - public Result getEventClass(@RequestParam Map params){ - params.put("token", mqConfig.getToken()); - params.put("appId", mqConfig.getAppId()); - Result result = HttpClientManager.getInstance().sendPostByHttps(mqConfig.getHost().concat(MqMethodPathEnum.GET_EVENT_LIST.getCode()), JSON.toJSONString(params)); - if (result.success()){ - return new Result<>().ok(JSON.parseArray(result.getData())); - } - return new Result<>().error(EpmetErrorCode.SERVER_ERROR.getMsg()); + public Result getEventClass(){ + return SendMqMsgUtils.getEventClassList(); } /** From ac5f4ec2e9eab4a93b86aaa349d95cfa7f6b18db Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Sat, 25 Jul 2020 10:28:55 +0800 Subject: [PATCH 65/98] =?UTF-8?q?=E7=88=B1=E5=BF=83=E4=BA=92=E5=8A=A9-?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/feign/EpmetUserFeignClient.java | 49 ------------------- .../EpmetUserFeignClientFallBack.java | 33 ------------- .../service/impl/ActLiveRecServiceImpl.java | 8 ++- .../impl/VolunteerInfoServiceImpl.java | 19 +++---- .../epmet/feign/EpmetUserOpenFeignClient.java | 11 +++++ .../EpmetUserOpenFeignClientFallback.java | 5 ++ 6 files changed, 25 insertions(+), 100 deletions(-) delete mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java delete mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java deleted file mode 100644 index 55455d5122..0000000000 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.epmet.feign; - -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.UserRoleFormDTO; -import com.epmet.dto.form.WxUserInfoFormDTO; -import com.epmet.dto.result.UserBaseInfoResultDTO; -import com.epmet.dto.result.UserRoleResultDTO; -import com.epmet.feign.fallback.EpmetUserFeignClientFallBack; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; - -import java.util.List; - - -/** - * 用户模块 - * - * @author zhangyong - * @date 2020/7/22 14:51 - */ -@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallBack.class) -public interface EpmetUserFeignClient { - - /** - * @param userIds - * @return com.epmet.commons.tools.utils.Result> - * @author zhangyong - * @description 传入用户id集合,返回用户的基本信息(包含微信基本信息) - * @Date 2020/7/22 9:30 - **/ - @PostMapping("epmetuser/userbaseinfo/queryuserbaseinfo") - Result> heartQueryUserBaseInfo(@RequestBody List userIds); - - /** - * 同步-居民基础信息、用户微信信息 - * - * @param formDTO - * @return com.epmet.commons.tools.utils.Result - * @Author zhangyong - * @Date 14:37 2020-07-23 - **/ - @PostMapping("epmetuser/user/updateUserBaseAndWxUserInfo") - Result updateUserBaseAndWxUserInfo(@RequestBody WxUserInfoFormDTO formDTO); -} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java deleted file mode 100644 index 37beeef602..0000000000 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.epmet.feign.fallback; - -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.commons.tools.utils.ModuleUtils; -import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.WxUserInfoFormDTO; -import com.epmet.dto.result.UserBaseInfoResultDTO; -import com.epmet.dto.result.UserRoleResultDTO; -import com.epmet.feign.EpmetUserFeignClient; -import org.springframework.stereotype.Component; - -import java.util.List; - - -/** - * @author zhangyong - * @date 2020/7/22 14:51 - */ -@Component -public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { - - @Override - public Result> heartQueryUserBaseInfo(List userIds) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "heartQueryUserBaseInfo", userIds); - } - - - @Override - public Result updateUserBaseAndWxUserInfo(WxUserInfoFormDTO formDTO) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "updateUserBaseAndWxUserInfo", formDTO); - } -} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java index 79d8a52dbe..45e15e53e6 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java @@ -20,7 +20,6 @@ package com.epmet.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.ActLivePicDao; import com.epmet.dao.ActLiveRecDao; @@ -31,8 +30,7 @@ import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.dto.result.resi.ResiActLiveRecResultDTO; import com.epmet.entity.ActLivePicEntity; import com.epmet.entity.ActLiveRecEntity; -import com.epmet.entity.ActSignInRecEntity; -import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.redis.ActLiveRecRedis; import com.epmet.service.ActLiveRecService; import com.epmet.utils.ValidityVerification; @@ -55,7 +53,7 @@ public class ActLiveRecServiceImpl extends BaseServiceImpl> userWxInfos = epmetUserFeignClient.heartQueryUserBaseInfo(userIds); + Result> userWxInfos = epmetUserOpenFeignClient.queryUserBaseInfo(userIds); // 根据活动实况id,查询对应实况的图片集合 List actLiveImg = baseDao.selectListActLiveImg(liveIds); // 数据汇总 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java index 84e78622c8..3429acbb2f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java @@ -17,34 +17,24 @@ package com.epmet.service.impl; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.VolunteerInfoDao; import com.epmet.dto.HeartUserInfoDTO; -import com.epmet.dto.VolunteerInfoDTO; import com.epmet.dto.form.WxUserInfoFormDTO; import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; import com.epmet.entity.VolunteerInfoEntity; -import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.redis.VolunteerInfoRedis; import com.epmet.service.HeartUserInfoService; import com.epmet.service.VolunteerInfoService; -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; - /** * 志愿者信息 * @@ -58,7 +48,7 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl> getUserRoleInfoByUserId(@PathVariable("userId") String userId); + + /** + * 同步-居民基础信息、用户微信信息 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 14:37 2020-07-23 + **/ + @PostMapping("epmetuser/user/updateUserBaseAndWxUserInfo") + Result updateUserBaseAndWxUserInfo(@RequestBody WxUserInfoFormDTO formDTO); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 1eafedfbd2..4bf31e518b 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -103,4 +103,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result> getUserRoleInfoByUserId(String userId) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getUserRoleInfoByUserId", userId); } + + @Override + public Result updateUserBaseAndWxUserInfo(WxUserInfoFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "updateUserBaseAndWxUserInfo", formDTO); + } } From ba87e8f8ced6415daf971bf472cf6db9fd64b6c7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 26 Jul 2020 19:29:38 +0800 Subject: [PATCH 66/98] =?UTF-8?q?heart-work:=E7=A7=AF=E5=88=86=E5=8F=91?= =?UTF-8?q?=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/exception/EpmetErrorCode.java | 4 + .../com/epmet/dto/ActOperationRecDTO.java | 9 +- .../epmet/dto/form/work/CancelActFormDTO.java | 32 ++ .../dto/form/work/DraftActInfoFormDTO.java | 4 - .../dto/result/work/ActPreviewResultDTO.java | 4 +- .../work/CanceledActDetailResultDTO.java | 119 +++++ .../dto/result/work/DeniedUserResultDTO.java | 57 +++ .../result/work/ObtainedUserResultDTO.java | 51 ++ .../epmet/constant/ActMessageConstant.java | 10 + .../controller/GrantPointsController.java | 47 ++ .../epmet/controller/WorkActController.java | 67 ++- .../controller/WorkActDraftController.java | 39 +- .../java/com/epmet/dao/ActContentDao.java | 13 +- .../main/java/com/epmet/dao/ActInfoDao.java | 9 + .../com/epmet/dao/ActUserRelationDao.java | 20 + .../com/epmet/dao/LatestActContentDao.java | 9 + .../epmet/entity/ActOperationRecEntity.java | 6 +- .../com/epmet/service/GrantPointsService.java | 23 + .../epmet/service/WorkActDraftService.java | 23 +- .../com/epmet/service/WorkActService.java | 43 +- .../service/impl/GrantPointsServiceImpl.java | 67 +++ .../impl/LatestActContentServiceImpl.java | 2 +- .../service/impl/WorkActDraftServiceImpl.java | 316 +------------ .../service/impl/WorkActServiceImpl.java | 442 +++++++++++++++++- .../service/impl/WorkActUserServiceImpl.java | 8 + .../main/resources/mapper/ActContentDao.xml | 13 +- .../src/main/resources/mapper/ActInfoDao.xml | 26 ++ .../resources/mapper/ActUserRelationDao.xml | 39 ++ .../resources/mapper/LatestActContentDao.xml | 5 + 29 files changed, 1105 insertions(+), 402 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/CancelActFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/DeniedUserResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ObtainedUserResultDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index b977a2e76f..1c4adc9bf3 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -54,6 +54,10 @@ public enum EpmetErrorCode { ACT_CONTENT_TEXT_SCAN_FAILED(8116,"活动详情内容审核失败,请重新编辑"), ACT_CONTENT_IMG_SCAN_FAILED(8117,"活动详情图片失败,请重新编辑"), ACT_COVER_PIC_SCAN_FAILED(8118,"活动封面图片审核失败,请重新编辑"), + ACT_START_TIME_ERROR(8119,"活动预计开始时间应早于活动预计结束时间"), + ACT_SIGN_IN_START_TIME_ERROR(8120,"签到开始时间应早于签到结束时间"), + ACT_SIGN_UP_END_TIME_ERROR(8121,"活动报名截止时间应早于活动预计开始时间"), + CANNOT_AUDIT_WARM(8201, "请完善居民信息"), NOT_DEL_AGENCY(8202, "该机关存在下级机关,不允许删除"), diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActOperationRecDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActOperationRecDTO.java index 00b8294271..955997a340 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActOperationRecDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActOperationRecDTO.java @@ -53,9 +53,14 @@ public class ActOperationRecDTO implements Serializable { private String type; /** - * 1通知用户0不通知 + * 1通知用户0不通知,取消活动时默认true */ - private Boolean noticeUser; + private Boolean noticeUser; + + /** + * 备注,取消活动时此列有值 + */ + private String remark; /** * 删除标记 diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/CancelActFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/CancelActFormDTO.java new file mode 100644 index 0000000000..1ae524df14 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/CancelActFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.form.work; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/26 17:23 + */ +@Data +public class CancelActFormDTO implements Serializable { + private static final long serialVersionUID = -5297836691628421645L; + public interface AddUserInternalGroup {} + public interface UserShowGroup extends CustomerClientShowGroup { + } + /** + * 活动id + */ + @NotBlank(message = "活动id不能为空", groups = {AddUserInternalGroup.class }) + private String actId; + + /** + * 取消原因 + */ + @NotBlank(message = "取消原因不能为空", groups = {UserShowGroup.class}) + private String cancelReason; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java index 55cd75a090..1d128594ff 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java @@ -1,6 +1,5 @@ package com.epmet.dto.form.work; -import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import javax.validation.Valid; @@ -22,9 +21,6 @@ public class DraftActInfoFormDTO implements Serializable { public interface AddUserInternalGroup { } - public interface AddDraftUserShowGroup extends CustomerClientShowGroup { - } - @Valid private List actContent; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java index f5869bdb87..eb6f07693c 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java @@ -43,13 +43,13 @@ public class ActPreviewResultDTO implements Serializable { private Integer reward; /** - * 活动开始时间yyyy-MM-dd HH:mm + * 活动预计开始时间yyyy-MM-dd HH:mm */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date actStartTime; /** - * 活动结束时间yyyy-MM-dd HH:mm + * 活动预计结束时间yyyy-MM-dd HH:mm */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date actEndTime; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java new file mode 100644 index 0000000000..a361a5511e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java @@ -0,0 +1,119 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 已取消-活动详情 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/26 18:02 + */ +@Data +public class CanceledActDetailResultDTO implements Serializable { + private static final long serialVersionUID = 4438884084461494174L; + + /** + *活动id + */ + private String actId; + + /** + * 活动标题 + */ + private String title; + + /** + * 报名截止时间:yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date signUpEndTime; + + /** + * 活动开始时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actStartTime; + + /** + * 活动结束时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * true:固定名额 false: 不限制名额 + */ + private Boolean actQuotaCategory; + + /** + * 联系人 + */ + private String sponsorContacts; + + /** + * 联系电话 + */ + private String sponsorTel; + /** + * 活动积分 + */ + private Integer reward; + /** + * 主办方名称 + */ + private String sponsorName; + /** + * 报名条件 + */ + private String requirement; + /** + * 取消时间yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date cancelTime; + /** + * 取消理由 + */ + private String cancelReason; + /** + * 活动详情 + */ + private List actContent; + + @Override + public String toString() { + return "CanceledActDetailResultDTO{" + + "actId='" + actId + '\'' + + ", title='" + title + '\'' + + ", signUpEndTime=" + signUpEndTime + + ", actStartTime=" + actStartTime + + ", actEndTime=" + actEndTime + + ", actAddress='" + actAddress + '\'' + + ", actQuota=" + actQuota + + ", actQuotaCategory=" + actQuotaCategory + + ", sponsorContacts='" + sponsorContacts + '\'' + + ", sponsorTel='" + sponsorTel + '\'' + + ", reward=" + reward + + ", sponsorName='" + sponsorName + '\'' + + ", requirement='" + requirement + '\'' + + ", cancelTime=" + cancelTime + + ", cancelReason='" + cancelReason + '\'' + + ", actContent=" + actContent + + '}'; + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/DeniedUserResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/DeniedUserResultDTO.java new file mode 100644 index 0000000000..c7ca1833bb --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/DeniedUserResultDTO.java @@ -0,0 +1,57 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 积分发放-已拒绝列表 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/26 19:01 + */ +@Data +public class DeniedUserResultDTO implements Serializable { + private static final long serialVersionUID = 110993452055116412L; + + /** + * 给分或者不给分,重新处理入参用 + */ + private String actUserRelationId; + + /** + * 用户id + */ + private String userId; + + /** + * 活动id + */ + private String actId; + + /** + * 姓名 + */ + private String realName; + + /** + * 昵称 + */ + private String nickName; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * true:是志愿者 false:不是志愿者 + */ + private Boolean volunteerFlag; + + /** + * 拒绝原因 + */ + private String denyRewardReason; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ObtainedUserResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ObtainedUserResultDTO.java new file mode 100644 index 0000000000..05cf6e2674 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ObtainedUserResultDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 积分发放-已发放列表 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/26 18:43 + */ +@Data +public class ObtainedUserResultDTO implements Serializable { + private static final long serialVersionUID = 8187248601958392521L; + /** + * 给分或者不给分,重新处理入参用 + */ + private String actUserRelationId; + + /** + * 用户id + */ + private String userId; + + /** + * 活动id + */ + private String actId; + + /** + * 姓名 + */ + private String realName; + + /** + * 昵称 + */ + private String nickName; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * true:是志愿者 false:不是志愿者 + */ + private Boolean volunteerFlag; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java index be7530973c..b7bf8cce40 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java @@ -8,6 +8,16 @@ package com.epmet.constant; */ public interface ActMessageConstant { String TITLE="您有一条活动消息"; + /** + * 报名审核成功,给居民端用户发送消息 + */ String AUDIT_PASSED="您报名的活动%s,已审核通过"; + /** + * 拒绝用户的报名,给居民端用户发送消息 + */ String AUDIT_REFUSED="您报名的活动%s,审核未通过,原因:%s"; + /** + * 活动被取消,给已经通过审核的居民端用户,发送消息 + */ + String ACT_CANCELED="您报名的活动%s,已取消,原因:%s"; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/GrantPointsController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/GrantPointsController.java index 86e935c2a3..72f402337a 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/GrantPointsController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/GrantPointsController.java @@ -4,14 +4,20 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.work.ActIdFormDTO; import com.epmet.dto.form.work.GrantPointsFormDTO; +import com.epmet.dto.result.work.CanceledUserResultDTO; +import com.epmet.dto.result.work.DeniedUserResultDTO; +import com.epmet.dto.result.work.ObtainedUserResultDTO; import com.epmet.dto.result.work.PendingUserResultDTO; import com.epmet.service.GrantPointsService; +import com.epmet.service.WorkActUserService; 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.List; + /** * 工作端-积分发放api * @@ -23,6 +29,8 @@ import org.springframework.web.bind.annotation.RestController; public class GrantPointsController { @Autowired private GrantPointsService grantPointsService; + @Autowired + private WorkActUserService workActUserService ; /** * @return com.epmet.commons.tools.utils.Result @@ -78,4 +86,43 @@ public class GrantPointsController { grantPointsService.reset(formDTO); return new Result(); } + + /** + * @param actIdFormDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @description 积分发放-已发放列表 + * @Date 2020/7/26 18:46 + **/ + @PostMapping("agreedlist") + public Result> agreedList(@RequestBody ActIdFormDTO actIdFormDTO) { + ValidatorUtils.validateEntity(actIdFormDTO, ActIdFormDTO.AddUserInternalGroup.class); + return new Result>().ok(grantPointsService.agreedList(actIdFormDTO)); + } + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param actIdFormDTO + * @author yinzuomei + * @description 积分发放-已拒绝列表 + * @Date 2020/7/26 19:02 + **/ + @PostMapping("deniedlist") + public Result> deniedList(@RequestBody ActIdFormDTO actIdFormDTO){ + ValidatorUtils.validateEntity(actIdFormDTO, ActIdFormDTO.AddUserInternalGroup.class); + return new Result>().ok(grantPointsService.deniedList(actIdFormDTO)); + } + + /** + * @param actIdFormDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @description 积分发放-已取消报名列表 + * @Date 2020/7/26 19:19 + **/ + @PostMapping("canceleduserlist") + public Result> canceledUserList(@RequestBody ActIdFormDTO actIdFormDTO) { + ValidatorUtils.validateEntity(actIdFormDTO, ActIdFormDTO.AddUserInternalGroup.class); + return new Result>().ok(workActUserService.queryCanceledUserList(actIdFormDTO)); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java index 2e14ec9aac..aca1f4aee4 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java @@ -2,11 +2,8 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.dto.form.work.ActListCommonFormDTO; -import com.epmet.dto.result.work.CanceledActResultDTO; -import com.epmet.dto.result.work.FinishedActResultDTO; -import com.epmet.dto.result.work.InProgressActResultDTO; -import com.epmet.dto.result.work.SponsorResultDTO; +import com.epmet.dto.form.work.*; +import com.epmet.dto.result.work.*; import com.epmet.service.WorkActService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -28,6 +25,19 @@ public class WorkActController { @Autowired private WorkActService workActService; + /** + * @return com.epmet.commons.tools.utils.Result + * @param + * @author yinzuomei + * @description 发布活动-删除历史活动草稿 + * @Date 2020/7/20 18:15 + **/ + @PostMapping("deletedraft") + public Result deleteDraft(){ + workActService.deleteDraft(); + return new Result(); + } + /** * @return com.epmet.commons.tools.utils.Result * @param @@ -40,6 +50,26 @@ public class WorkActController { return new Result().ok(workActService.querySponsorList()); } + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 发布活动 + * @Date 2020/7/21 18:32 + **/ + @PostMapping("publish") + public Result publishAct(@RequestBody PublishActInfoFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, PublishActInfoFormDTO.AddUserShowGroup.class, PublishActInfoFormDTO.AddUserInternalGroup.class); + for (PublishActContentFormDTO actContentFormDTO : formDTO.getActContent()) { + ValidatorUtils.validateEntity(actContentFormDTO, + PublishActContentFormDTO.UserShowGroup.class, + PublishActContentFormDTO.UserInternalGroup.class + ); + } + PublishActResultDTO resultDTO = workActService.publishAct(formDTO); + return new Result().ok(resultDTO); + } + /** * @return com.epmet.commons.tools.utils.Result * @param formDTO @@ -78,4 +108,31 @@ public class WorkActController { ValidatorUtils.validateEntity(formDTO,ActListCommonFormDTO.AddUserInternalGroup.class); return new Result>().ok(workActService.queryFinishedList(formDTO)); } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 取消活动 + * @Date 2020/7/26 17:26 + **/ + @PostMapping("cancelact") + public Result cancelAct(@RequestBody CancelActFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,CancelActFormDTO.UserShowGroup.class,CancelActFormDTO.AddUserInternalGroup.class); + workActService.cancelAct(formDTO); + return new Result(); + } + + /** + * @param actIdFormDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 已取消-活动详情 + * @Date 2020/7/26 18:00 + **/ + @PostMapping("canceleddetail") + public Result canceledDetail(@RequestBody ActIdFormDTO actIdFormDTO) { + ValidatorUtils.validateEntity(actIdFormDTO, ActIdFormDTO.AddUserInternalGroup.class); + return new Result().ok(workActService.canceledDetail(actIdFormDTO.getActId())); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java index f69b65b065..e960a2f926 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java @@ -37,19 +37,6 @@ public class WorkActDraftController { return new Result().ok(initResultDTO); } - /** - * @return com.epmet.commons.tools.utils.Result - * @param - * @author yinzuomei - * @description 发布活动-删除历史活动草稿 - * @Date 2020/7/20 18:15 - **/ - @PostMapping("deletedraft") - public Result deleteDraft(){ - workActDraftService.deleteDraft(); - return new Result(); - } - /** * @return com.epmet.commons.tools.utils.Result * @param @@ -72,9 +59,8 @@ public class WorkActDraftController { **/ @PostMapping("saveact") public Result saveAct(@RequestBody DraftActInfoFormDTO formDTO){ - //起码活动标题不能为空 - ValidatorUtils.validateEntity(formDTO, DraftActInfoFormDTO.AddDraftUserShowGroup.class, - DraftActInfoFormDTO.AddUserInternalGroup.class); + //起码客户id不能为空 + ValidatorUtils.validateEntity(formDTO,DraftActInfoFormDTO.AddUserInternalGroup.class); //如果录入了活动内容,需要校验 content、contentType if (null != formDTO.getActContent() && formDTO.getActContent().size() > 0) { for(DraftActContentFormDTO actContentFormDTO:formDTO.getActContent()){ @@ -102,25 +88,4 @@ public class WorkActDraftController { return new Result().ok(resultDTO); } - /** - * @param formDTO - * @return com.epmet.commons.tools.utils.Result - * @author yinzuomei - * @description 发布活动 - * @Date 2020/7/21 18:32 - **/ - @PostMapping("publish") - public Result publishAct(@RequestBody PublishActInfoFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO, PublishActInfoFormDTO.AddUserShowGroup.class, PublishActInfoFormDTO.AddUserInternalGroup.class); - for (PublishActContentFormDTO actContentFormDTO : formDTO.getActContent()) { - ValidatorUtils.validateEntity(actContentFormDTO, - PublishActContentFormDTO.UserShowGroup.class, - PublishActContentFormDTO.UserInternalGroup.class - ); - } - PublishActResultDTO resultDTO = workActDraftService.publishAct(formDTO); - return new Result().ok(resultDTO); - } - - } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActContentDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActContentDao.java index 2d7ef0de25..c125c2d9f4 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActContentDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActContentDao.java @@ -18,9 +18,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.work.ActPreviewContentResultDTO; import com.epmet.entity.ActContentEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 活动内容 * @@ -29,5 +32,13 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ActContentDao extends BaseDao { - + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 根据活动id查询活动详情 + * @Date 2020/7/26 18:26 + **/ + List selectByActId(String actId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java index 86bbf2afde..4766a2823c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java @@ -270,4 +270,13 @@ public interface ActInfoDao extends BaseDao { * @Date 2020/7/24 10:55 **/ List queryCanceledUserList(String actId); + + /** + * @return com.epmet.dto.result.work.CanceledActDetailResultDTO + * @param actId + * @author yinzuomei + * @description 工作端-查询已取消活动详情 + * @Date 2020/7/26 18:29 + **/ + CanceledActDetailResultDTO selectCanceledActInfo(String actId); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java index bb6598d312..526ca76a1f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java @@ -19,6 +19,8 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.ActUserRelationDTO; +import com.epmet.dto.result.work.DeniedUserResultDTO; +import com.epmet.dto.result.work.ObtainedUserResultDTO; import com.epmet.dto.result.work.UserHistoricalActInfoDTO; import com.epmet.entity.ActUserRelationEntity; import org.apache.ibatis.annotations.Mapper; @@ -136,4 +138,22 @@ public interface ActUserRelationDao extends BaseDao { * @Date 2020/7/24 13:02 **/ List selectInProgressUserIds(String actId); + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 积分发放-已发放列表 + * @Date 2020/7/26 18:48 + **/ + List selectAgreedList(String actId); + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 积分发放-已拒绝列表 + * @Date 2020/7/26 19:11 + **/ + List selectDeniedList(String actId); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActContentDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActContentDao.java index a0cbb2b6e5..acf7fe8557 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActContentDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActContentDao.java @@ -60,4 +60,13 @@ public interface LatestActContentDao extends BaseDao { * @Date 2020/7/21 18:07 **/ List previewActContent(String actId); + + /** + * @return int + * @param actId + * @author yinzuomei + * @description 根据活动id删除活动详情 物理删除 + * @Date 2020/7/24 16:08 + **/ + int deleteByActId(String actId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActOperationRecEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActOperationRecEntity.java index aef5e68fe0..5a54f8f5c5 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActOperationRecEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActOperationRecEntity.java @@ -49,8 +49,12 @@ public class ActOperationRecEntity extends BaseEpmetEntity { private String type; /** - * 1通知用户0不通知 + * 1通知用户0不通知,取消活动时默认true */ private Boolean noticeUser; + /** + * 备注,取消活动时此列有值 + */ + private String remark; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/GrantPointsService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/GrantPointsService.java index 92d306ac92..e8d53e3b44 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/GrantPointsService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/GrantPointsService.java @@ -1,8 +1,13 @@ package com.epmet.service; +import com.epmet.dto.form.work.ActIdFormDTO; import com.epmet.dto.form.work.GrantPointsFormDTO; +import com.epmet.dto.result.work.DeniedUserResultDTO; +import com.epmet.dto.result.work.ObtainedUserResultDTO; import com.epmet.dto.result.work.PendingUserResultDTO; +import java.util.List; + /** * 描述一下 * @@ -45,4 +50,22 @@ public interface GrantPointsService { * @Date 2020/7/24 15:16 **/ void reset(GrantPointsFormDTO formDTO); + + /** + * @return java.util.List + * @param actIdFormDTO + * @author yinzuomei + * @description 积分发放-已发放列表 + * @Date 2020/7/26 18:47 + **/ + List agreedList(ActIdFormDTO actIdFormDTO); + + /** + * @return java.util.List + * @param actIdFormDTO + * @author yinzuomei + * @description 积分发放-已拒绝列表 + * @Date 2020/7/26 19:02 + **/ + List deniedList(ActIdFormDTO actIdFormDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java index e08b1671e4..cc0683b91c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java @@ -2,8 +2,10 @@ package com.epmet.service; import com.epmet.dto.form.work.ActPreviewFormDTO; import com.epmet.dto.form.work.DraftActInfoFormDTO; -import com.epmet.dto.form.work.PublishActInfoFormDTO; -import com.epmet.dto.result.work.*; +import com.epmet.dto.result.work.ActPreviewResultDTO; +import com.epmet.dto.result.work.LatestDraftActInfoResultDTO; +import com.epmet.dto.result.work.PublishActInitResultDTO; +import com.epmet.dto.result.work.SaveActDraftResultDTO; /** * 工作端活动草稿 @@ -22,15 +24,6 @@ public interface WorkActDraftService { **/ PublishActInitResultDTO publishActInit(); - /** - * @return void - * @param - * @author yinzuomei - * @description 发布活动-删除历史活动草稿 - * @Date 2020/7/20 18:15 - **/ - void deleteDraft(); - /** * @return com.epmet.dto.result.work.LatestDraftActInfoResultDTO * @param @@ -58,12 +51,4 @@ public interface WorkActDraftService { **/ ActPreviewResultDTO previewActDetail(ActPreviewFormDTO formDTO); - /** - * @return com.epmet.dto.result.work.PublishActResultDTO - * @param formDTO - * @author yinzuomei - * @description 发布活动 - * @Date 2020/7/21 18:33 - **/ - PublishActResultDTO publishAct(PublishActInfoFormDTO formDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java index 3945c19213..b4e83a2aa1 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java @@ -1,10 +1,9 @@ package com.epmet.service; import com.epmet.dto.form.work.ActListCommonFormDTO; -import com.epmet.dto.result.work.CanceledActResultDTO; -import com.epmet.dto.result.work.FinishedActResultDTO; -import com.epmet.dto.result.work.InProgressActResultDTO; -import com.epmet.dto.result.work.SponsorResultDTO; +import com.epmet.dto.form.work.CancelActFormDTO; +import com.epmet.dto.form.work.PublishActInfoFormDTO; +import com.epmet.dto.result.work.*; import java.util.List; @@ -15,6 +14,15 @@ import java.util.List; * @date 2020/7/23 20:36 */ public interface WorkActService { + /** + * @return void + * @param + * @author yinzuomei + * @description 发布活动-删除历史活动草稿 + * @Date 2020/7/20 18:15 + **/ + void deleteDraft(); + /** * @return com.epmet.dto.result.work.SponsorResultDTO * @param @@ -24,6 +32,15 @@ public interface WorkActService { **/ SponsorResultDTO querySponsorList(); + /** + * @return com.epmet.dto.result.work.PublishActResultDTO + * @param formDTO + * @author yinzuomei + * @description 发布活动 + * @Date 2020/7/21 18:33 + **/ + PublishActResultDTO publishAct(PublishActInfoFormDTO formDTO); + /** * @return com.epmet.dto.result.work.InProgressActResultDTO * @param formDTO @@ -50,4 +67,22 @@ public interface WorkActService { * @Date 2020/7/23 23:21 **/ List queryFinishedList(ActListCommonFormDTO formDTO); + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 取消活动 + * @Date 2020/7/26 17:26 + **/ + void cancelAct(CancelActFormDTO formDTO); + + /** + * @return void + * @param actId + * @author yinzuomei + * @description 已取消-活动详情 + * @Date 2020/7/26 18:00 + **/ + CanceledActDetailResultDTO canceledDetail(String actId); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/GrantPointsServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/GrantPointsServiceImpl.java index 7374577050..024b325ff9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/GrantPointsServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/GrantPointsServiceImpl.java @@ -9,8 +9,11 @@ import com.epmet.dao.ActUserRelationDao; import com.epmet.dto.ActInfoDTO; import com.epmet.dto.ActPointLogDTO; import com.epmet.dto.ActUserRelationDTO; +import com.epmet.dto.form.work.ActIdFormDTO; import com.epmet.dto.form.work.GrantPointsFormDTO; import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.dto.result.work.DeniedUserResultDTO; +import com.epmet.dto.result.work.ObtainedUserResultDTO; import com.epmet.dto.result.work.PendingUserResultDTO; import com.epmet.dto.result.work.UserBaseInfo; import com.epmet.service.*; @@ -233,4 +236,68 @@ public class GrantPointsServiceImpl implements GrantPointsService { actPointLogDTO.setEffectFlag(false); actPointLogService.save(actPointLogDTO); } + + /** + * @param actIdFormDTO + * @return java.util.List + * @author yinzuomei + * @description 积分发放-已发放列表 + * @Date 2020/7/26 18:47 + **/ + @Override + public List agreedList(ActIdFormDTO actIdFormDTO) { + List list = actUserRelationDao.selectAgreedList(actIdFormDTO.getActId()); + if (null == list || list.size() < 0) { + return new ArrayList<>(); + } + List userIdList = new ArrayList<>(); + for (ObtainedUserResultDTO obtainedUserResultDTO : list) { + obtainedUserResultDTO.setVolunteerFlag(workActUserService.getVolunteerFlag(obtainedUserResultDTO.getUserId())); + userIdList.add(obtainedUserResultDTO.getUserId()); + } + List userBaseInfoResultDTOList = workActUserService.queryUserBaseInfoList(userIdList); + for (ObtainedUserResultDTO obtainedUser : list) { + for (UserBaseInfoResultDTO userBaseInfoResultDTO : userBaseInfoResultDTOList) { + if (obtainedUser.getUserId().equals(userBaseInfoResultDTO.getUserId())) { + obtainedUser.setRealName(userBaseInfoResultDTO.getRealName()); + obtainedUser.setNickName(userBaseInfoResultDTO.getNickname()); + obtainedUser.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); + break; + } + } + } + return list; + } + + /** + * @param actIdFormDTO + * @return java.util.List + * @author yinzuomei + * @description 积分发放-已拒绝列表 + * @Date 2020/7/26 19:02 + **/ + @Override + public List deniedList(ActIdFormDTO actIdFormDTO) { + List list = actUserRelationDao.selectDeniedList(actIdFormDTO.getActId()); + if (null == list || list.size() < 0) { + return new ArrayList<>(); + } + List userIdList = new ArrayList<>(); + for (DeniedUserResultDTO deniedUserResultDTO : list) { + deniedUserResultDTO.setVolunteerFlag(workActUserService.getVolunteerFlag(deniedUserResultDTO.getUserId())); + userIdList.add(deniedUserResultDTO.getUserId()); + } + List userBaseInfoResultDTOList = workActUserService.queryUserBaseInfoList(userIdList); + for (DeniedUserResultDTO deniedUser : list) { + for (UserBaseInfoResultDTO userBaseInfoResultDTO : userBaseInfoResultDTOList) { + if (deniedUser.getUserId().equals(userBaseInfoResultDTO.getUserId())) { + deniedUser.setRealName(userBaseInfoResultDTO.getRealName()); + deniedUser.setNickName(userBaseInfoResultDTO.getNickname()); + deniedUser.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); + break; + } + } + } + return list; + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java index e60c7d539e..38930a1467 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java @@ -93,7 +93,7 @@ public class LatestActContentServiceImpl extends BaseServiceImpl dtoList) { //先删除之前的 - this.deleteByActId(dtoList.get(0).getActId()); + baseDao.deleteByActId(dtoList.get(0).getActId()); //再插入新的 for(LatestActContentDTO dto:dtoList){ LatestActContentEntity entity = ConvertUtils.sourceToTarget(dto, LatestActContentEntity.class); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java index 1c75dfdb57..a1b008430e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java @@ -1,31 +1,13 @@ package com.epmet.service.impl; -import com.alibaba.fastjson.JSON; -import com.epmet.commons.tools.exception.EpmetErrorCode; -import com.epmet.commons.tools.exception.RenException; -import com.epmet.commons.tools.scan.param.ImgScanParamDTO; -import com.epmet.commons.tools.scan.param.ImgTaskDTO; -import com.epmet.commons.tools.scan.param.TextScanParamDTO; -import com.epmet.commons.tools.scan.param.TextTaskDTO; -import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.security.user.LoginUserUtil; -import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.commons.tools.utils.Result; -import com.epmet.commons.tools.utils.ScanContentUtils; -import com.epmet.constant.ActConstant; -import com.epmet.dao.ActContentDao; -import com.epmet.dao.ActInfoDao; -import com.epmet.dao.ActOperationRecDao; -import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.LatestActContentDTO; import com.epmet.dto.LatestActInfoDTO; -import com.epmet.dto.form.work.*; +import com.epmet.dto.form.work.ActPreviewFormDTO; +import com.epmet.dto.form.work.DraftActContentFormDTO; +import com.epmet.dto.form.work.DraftActInfoFormDTO; import com.epmet.dto.result.work.*; -import com.epmet.entity.ActContentEntity; -import com.epmet.entity.ActInfoEntity; -import com.epmet.entity.ActOperationRecEntity; -import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.LatestActContentService; import com.epmet.service.LatestActInfoService; import com.epmet.service.WorkActDraftService; @@ -33,14 +15,11 @@ import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.Date; import java.util.List; -import java.util.UUID; /** * 工作端活动草稿 @@ -57,20 +36,6 @@ public class WorkActDraftServiceImpl implements WorkActDraftService { private LatestActInfoService latestActInfoService; @Autowired private LatestActContentService latestActContentService; - @Value("${openapi.scan.server.url}") - private String scanApiUrl; - @Value("${openapi.scan.method.textSyncScan}") - private String textSyncScanMethod; - @Value("${openapi.scan.method.imgSyncScan}") - private String imgSyncScanMethod; - @Autowired - private ActInfoDao actInfoDao; - @Autowired - private ActContentDao actContentDao; - @Autowired - private ActOperationRecDao actOperationRecDao; - @Autowired - private GovOrgOpenFeignClient govOrgOpenFeignClient; /** * @return com.epmet.dto.form.work.PublishActInitResultDTO @@ -96,19 +61,6 @@ public class WorkActDraftServiceImpl implements WorkActDraftService { return resultDTO; } - /** - * @return void - * @author yinzuomei - * @description 发布活动-删除历史活动草稿 - * @Date 2020/7/20 18:15 - **/ - @Override - public void deleteDraft() { - String currentUserId=loginUserUtil.getLoginUserId(); - if(StringUtils.isNotBlank(currentUserId)){ - latestActInfoService.deleteAllDraft(currentUserId); - } - } /** * @return com.epmet.dto.result.work.LatestDraftActInfoResultDTO @@ -148,7 +100,7 @@ public class WorkActDraftServiceImpl implements WorkActDraftService { if(null!=formDTO.getActContent()&&formDTO.getActContent().size()>0){ //保存活动内容 List actContentList=this.constructLatestActContent(formDTO.getActContent(),actDraftId); - //删除之前的内容 + //删除之前的内容,保存本次的修改 物理删除 latestActContentService.saveLatestActContentDTOList(actContentList); } SaveActDraftResultDTO resultDTO=new SaveActDraftResultDTO(); @@ -175,266 +127,6 @@ public class WorkActDraftServiceImpl implements WorkActDraftService { return actPreviewResultDTO; } - /** - * @param formDTO - * @return com.epmet.dto.result.work.PublishActResultDTO - * @author yinzuomei - * @description 发布活动 - * @Date 2020/7/21 18:33 - **/ - @Override - @Transactional(rollbackFor = Exception.class) - public PublishActResultDTO publishAct(PublishActInfoFormDTO formDTO) { - PublishActResultDTO publishActResultDTO=new PublishActResultDTO(); - //内容审核(活动标题、招募要求、活动内容图文) - this.auditAct(formDTO); - logger.info("发布活动,审核成功"); - - //构造属性保存活动属性,活动内容 - ActInfoEntity actInfoEntity=this.constructActInfo(formDTO); - actInfoDao.insert(actInfoEntity); - - List actContentEntityList=this.constructActContent(formDTO.getActContent(),actInfoEntity.getId()); - for(ActContentEntity actContentEntity:actContentEntityList){ - actContentDao.insert(actContentEntity); - } - //插入一条操作日志 - ActOperationRecEntity actOperationRecEntity=new ActOperationRecEntity(); - actOperationRecEntity.setActId(actInfoEntity.getId()); - actOperationRecEntity.setType(ActConstant.ACT_OPER_TYPE_PUBLISH); - actOperationRecEntity.setNoticeUser(false); - actOperationRecDao.insert(actOperationRecEntity); - - //删除所有的草稿 - this.deleteDraft(); - publishActResultDTO.setActId(actInfoEntity.getId()); - - return publishActResultDTO; - } - - /** - * @return com.epmet.entity.ActInfoEntity - * @param formDTO - * @author yinzuomei - * @description 发布活动-构造act_info - * @Date 2020/7/21 20:00 - **/ - private ActInfoEntity constructActInfo(PublishActInfoFormDTO formDTO) { - ActInfoEntity actInfoEntity = ConvertUtils.sourceToTarget(formDTO, ActInfoEntity.class); - //活动名额类型(0-不限名额,1-固定名额) - if(actInfoEntity.getActQuota()==0){ - actInfoEntity.setActQuotaCategory(false); - }else{ - actInfoEntity.setActQuotaCategory(true); - } - actInfoEntity.setSignUpStartTime(new Date()); - actInfoEntity.setActStatus(ActConstant.ACT_STATUS_PUBLISHED); - - //1已经总结0未总结 - actInfoEntity.setSummaryFlag(false); - if(ActConstant.SPONSOR_AGENCY.equals(actInfoEntity.getSponsorType())){ - //调用gov_org服务获取当前组织的上一级机关id TODO - Result result=govOrgOpenFeignClient.getAgencyById(formDTO.getSponsorId()); - if(result.success()&&null!=result.getData()){ - actInfoEntity.setPid(result.getData().getPid()); - }else{ - logger.warn("根据agencyId查询组织信息失败,agencyId=",formDTO.getSponsorId()); - } - }else{ - actInfoEntity.setPid(""); - } - return actInfoEntity; - } - - /** - * @return java.util.List - * @param actContent - * @param actId - * @author yinzuomei - * @description 发布活动-构造活动详情act_content - * @Date 2020/7/21 19:59 - **/ - private List constructActContent(List actContent, String actId) { - List list=new ArrayList<>(); - int orderNum=1; - for(PublishActContentFormDTO actContentFormDTO:actContent){ - ActContentEntity actContentEntity=new ActContentEntity(); - actContentEntity.setActId(actId); - actContentEntity.setContent(actContentFormDTO.getContent()); - actContentEntity.setContentType(actContentFormDTO.getContentType()); - actContentEntity.setOrderNum(orderNum); - list.add(actContentEntity); - orderNum++; - } - return list; - } - - /** - * @return void - * @param formDTO - * @author yinzuomei - * @description 活动相关内容审核(活动标题、招募要求、活动内容图文) - * @Date 2020/7/21 19:20 - **/ - private void auditAct(PublishActInfoFormDTO formDTO) { - //1、活动标题 - if (StringUtils.isNotBlank(formDTO.getTitle())) { - this.auditActTitle(formDTO.getTitle()); - } - //2、活动封面 - if(StringUtils.isNotBlank(formDTO.getCoverPic())){ - this.auditActCoverPic(formDTO.getCoverPic()); - } - - //3、招募要求 - if (StringUtils.isNotBlank(formDTO.getRequirement())) { - this.auditActRequirement(formDTO.getRequirement()); - } - //4、活动内容 - if(null==formDTO.getActContent()||formDTO.getActContent().size()<1){ - return; - } - List textList=new ArrayList<>(); - List imgList=new ArrayList<>(); - for(PublishActContentFormDTO actContent:formDTO.getActContent()){ - if(ActConstant.ACT_CONTENT_TYPE_TEXT.equals(actContent.getContentType())){ - textList.add(actContent.getContent()); - }else if(ActConstant.ACT_CONTENT_TYPE_IMG.equals(actContent.getContentType())){ - imgList.add(actContent.getContent()); - } - } - this.auditActContent(textList,imgList); - } - - /** - * @return void - * @param textList - * @param imgList - * @author yinzuomei - * @description 活动详情审核 - * @Date 2020/7/21 19:21 - **/ - private void auditActContent(List textList, List imgList) { - //审核活动详情中的内容 - if(null!=textList&&textList.size()>0){ - TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); - textList.forEach(content -> { - TextTaskDTO taskDTO = new TextTaskDTO(); - taskDTO.setContent(content); - taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); - textScanParamDTO.getTasks().add(taskDTO); - }); - Result contentSyncScanRes = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); - if (!contentSyncScanRes.success()) { - logger.error("活动详情内容审核接口失败,返参:", JSON.toJSONString(contentSyncScanRes)); - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); - } else { - if (!contentSyncScanRes.getData().isAllPass()) { - throw new RenException(EpmetErrorCode.ACT_REQ_SCAN_FAILED.getCode()); - } - } - logger.info("活动详情内容审核成功"); - } - if(null!=imgList&&imgList.size()>0){ - //审核活动详情中的图片 - ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO(); - imgList.forEach(url -> { - ImgTaskDTO task = new ImgTaskDTO(); - task.setDataId(UUID.randomUUID().toString().replace("-", "")); - task.setUrl(url); - imgScanParamDTO.getTasks().add(task); - }); - Result imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO); - if (!imgScanResult.success()){ - logger.error("活动详情图片审核接口失败,返参:", JSON.toJSONString(imgScanResult)); - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); - } else { - if (!imgScanResult.getData().isAllPass()) { - throw new RenException(EpmetErrorCode.ACT_CONTENT_IMG_SCAN_FAILED.getCode()); - } - } - logger.info("活动详情图片审核成功"); - } - } - - /** - * @return void - * @param requirement - * @author yinzuomei - * @description 活动招募条件审核 - * @Date 2020/7/21 19:21 - **/ - private void auditActRequirement(String requirement) { - TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); - TextTaskDTO taskDTO = new TextTaskDTO(); - taskDTO.setContent(requirement); - taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); - textScanParamDTO.getTasks().add(taskDTO); - Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); - if (!textSyncScanResult.success()) { - logger.error("活动报名条件审核接口返回失败,返参:", JSON.toJSONString(textSyncScanResult)); - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); - } else { - if (!textSyncScanResult.getData().isAllPass()) { - logger.error("活动报名条件审核失败,报名条件:",requirement); - throw new RenException(EpmetErrorCode.ACT_REQ_SCAN_FAILED.getCode()); - } - } - logger.info("活动报名条件审核成功"); - } - - /** - * @return void - * @param coverPic - * @author yinzuomei - * @description 活动封面图片审核 - * @Date 2020/7/21 19:21 - **/ - private void auditActCoverPic(String coverPic) { - ImgScanParamDTO coverPicScanParamDTO = new ImgScanParamDTO(); - ImgTaskDTO coverImgtask = new ImgTaskDTO(); - coverImgtask.setDataId(UUID.randomUUID().toString().replace("-", "")); - coverImgtask.setUrl(coverPic); - coverPicScanParamDTO.getTasks().add(coverImgtask); - Result coverPicScanRes = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), coverPicScanParamDTO); - if (!coverPicScanRes.success()){ - logger.error("活动封面审核失败接口返回失败,返参:",JSON.toJSONString(coverPicScanRes)); - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); - } else { - if (!coverPicScanRes.getData().isAllPass()) { - logger.error("活动封面审核失败,封面图片地址:",coverPic); - throw new RenException(EpmetErrorCode.ACT_COVER_PIC_SCAN_FAILED.getCode()); - } - } - logger.info("活动封面审核成功"); - } - - /** - * @return void - * @param title - * @author yinzuomei - * @description 活动标题审核 - * @Date 2020/7/21 19:21 - **/ - private void auditActTitle(String title) { - TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); - TextTaskDTO taskDTO = new TextTaskDTO(); - taskDTO.setContent(title); - taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); - textScanParamDTO.getTasks().add(taskDTO); - Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); - if (!textSyncScanResult.success()) { - logger.error("活动标题审核接口返回失败,返参:", JSON.toJSONString(textSyncScanResult)); - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); - } else { - if (!textSyncScanResult.getData().isAllPass()) { - logger.error("活动标题审核失败,标题内容:",title); - throw new RenException(EpmetErrorCode.ACT_TITLE_SCAN_FAILED.getCode()); - } - } - logger.info("活动标题审核通过"); - } - /** * @return java.util.List * @param actContent diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java index cdeb80c3d3..257b8a810d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java @@ -1,24 +1,57 @@ package com.epmet.service.impl; +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.scan.param.ImgScanParamDTO; +import com.epmet.commons.tools.scan.param.ImgTaskDTO; +import com.epmet.commons.tools.scan.param.TextScanParamDTO; +import com.epmet.commons.tools.scan.param.TextTaskDTO; +import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.ScanContentUtils; +import com.epmet.constant.ActConstant; +import com.epmet.constant.ActMessageConstant; +import com.epmet.constant.ReadFlagConstant; +import com.epmet.dao.ActContentDao; import com.epmet.dao.ActInfoDao; +import com.epmet.dao.ActOperationRecDao; +import com.epmet.dao.ActUserRelationDao; +import com.epmet.dto.ActInfoDTO; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.form.UserMessageFormDTO; import com.epmet.dto.form.work.ActListCommonFormDTO; +import com.epmet.dto.form.work.CancelActFormDTO; +import com.epmet.dto.form.work.PublishActContentFormDTO; +import com.epmet.dto.form.work.PublishActInfoFormDTO; import com.epmet.dto.result.ActSponsorResultDTO; import com.epmet.dto.result.work.*; +import com.epmet.entity.ActContentEntity; +import com.epmet.entity.ActInfoEntity; +import com.epmet.entity.ActOperationRecEntity; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.service.ActInfoService; +import com.epmet.service.LatestActInfoService; import com.epmet.service.WorkActService; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.text.ParseException; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.UUID; /** * 描述一下 @@ -29,12 +62,44 @@ import java.util.List; @Service public class WorkActServiceImpl implements WorkActService { private Logger logger = LogManager.getLogger(WorkActServiceImpl.class); + @Value("${openapi.scan.server.url}") + private String scanApiUrl; + @Value("${openapi.scan.method.textSyncScan}") + private String textSyncScanMethod; + @Value("${openapi.scan.method.imgSyncScan}") + private String imgSyncScanMethod; @Autowired private GovOrgOpenFeignClient govOrgOpenFeignClient; @Autowired private LoginUserUtil loginUserUtil; @Autowired private ActInfoDao actInfoDao; + @Autowired + private LatestActInfoService latestActInfoService; + @Autowired + private ActContentDao actContentDao; + @Autowired + private ActOperationRecDao actOperationRecDao; + @Autowired + private ActInfoService actInfoService; + @Autowired + private ActUserRelationDao actUserRelationDao; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + + /** + * @return void + * @author yinzuomei + * @description 发布活动-删除历史活动草稿 + * @Date 2020/7/20 18:15 + **/ + @Override + public void deleteDraft() { + String currentUserId=loginUserUtil.getLoginUserId(); + if(StringUtils.isNotBlank(currentUserId)){ + latestActInfoService.deleteAllDraft(currentUserId); + } + } /** * @return com.epmet.dto.result.work.SponsorResultDTO @@ -59,6 +124,308 @@ public class WorkActServiceImpl implements WorkActService { return null; } + /** + * @param formDTO + * @return com.epmet.dto.result.work.PublishActResultDTO + * @author yinzuomei + * @description 发布活动 + * @Date 2020/7/21 18:33 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public PublishActResultDTO publishAct(PublishActInfoFormDTO formDTO) { + //校验参数 + this.checkPublishFormDTO(formDTO); + PublishActResultDTO publishActResultDTO=new PublishActResultDTO(); + //内容审核(活动标题、招募要求、活动内容图文) + this.auditAct(formDTO); + logger.info("发布活动,审核成功"); + + //构造属性保存活动属性,活动内容 + ActInfoEntity actInfoEntity=this.constructActInfo(formDTO); + actInfoDao.insert(actInfoEntity); + + List actContentEntityList=this.constructActContent(formDTO.getActContent(),actInfoEntity.getId()); + for(ActContentEntity actContentEntity:actContentEntityList){ + actContentDao.insert(actContentEntity); + } + //插入一条操作日志 + ActOperationRecEntity actOperationRecEntity=new ActOperationRecEntity(); + actOperationRecEntity.setActId(actInfoEntity.getId()); + actOperationRecEntity.setType(ActConstant.ACT_OPER_TYPE_PUBLISH); + actOperationRecEntity.setNoticeUser(false); + actOperationRecEntity.setRemark(StrConstant.EPMETY_STR); + actOperationRecDao.insert(actOperationRecEntity); + + //删除所有的草稿 + this.deleteDraft(); + publishActResultDTO.setActId(actInfoEntity.getId()); + + return publishActResultDTO; + } + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description + * @Date 2020/7/24 16:45 + **/ + private void checkPublishFormDTO(PublishActInfoFormDTO formDTO) { + //1、活动预计开始时间、活动预计结束时间 + if(formDTO.getActStartTime().compareTo(formDTO.getActEndTime())!=-1){ + throw new RenException(EpmetErrorCode.ACT_START_TIME_ERROR.getCode()); + } + //2、签到开始时间、签到结束时间 + if(formDTO.getSignInStartTime().compareTo(formDTO.getSignInEndTime())!=-1){ + throw new RenException(EpmetErrorCode.ACT_SIGN_IN_START_TIME_ERROR.getCode()); + } + //3、报名截止时间(应该在活动预计开始时间之前) + if(formDTO.getSignUpEndTime().compareTo(formDTO.getActStartTime())!=-1){ + throw new RenException((EpmetErrorCode.ACT_SIGN_UP_END_TIME_ERROR.getCode())); + } + } + + public static void main(String[] args) { + SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + try { + Date yesterDate=format.parse("2020-07-25 13:00:00"); + Date today=format.parse("2020-07-26 13:00:00"); + Date tommorrow=format.parse("2020-07-27 13:00:00"); + Date today1=format.parse("2020-07-26 13:00:00"); + System.out.println(yesterDate.compareTo(today)); + System.out.println(tommorrow.compareTo(today)); + System.out.println(today.compareTo(today1)); + } catch (ParseException e) { + e.printStackTrace(); + } + + } + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 活动相关内容审核(活动标题、招募要求、活动内容图文) + * @Date 2020/7/21 19:20 + **/ + private void auditAct(PublishActInfoFormDTO formDTO) { + //1、活动标题 + if (StringUtils.isNotBlank(formDTO.getTitle())) { + this.auditActTitle(formDTO.getTitle()); + } + //2、活动封面 + if(StringUtils.isNotBlank(formDTO.getCoverPic())){ + this.auditActCoverPic(formDTO.getCoverPic()); + } + + //3、招募要求 + if (StringUtils.isNotBlank(formDTO.getRequirement())) { + this.auditActRequirement(formDTO.getRequirement()); + } + //4、活动内容 + if(null==formDTO.getActContent()||formDTO.getActContent().size()<1){ + return; + } + List textList=new ArrayList<>(); + List imgList=new ArrayList<>(); + for(PublishActContentFormDTO actContent:formDTO.getActContent()){ + if(ActConstant.ACT_CONTENT_TYPE_TEXT.equals(actContent.getContentType())){ + textList.add(actContent.getContent()); + }else if(ActConstant.ACT_CONTENT_TYPE_IMG.equals(actContent.getContentType())){ + imgList.add(actContent.getContent()); + } + } + this.auditActContent(textList,imgList); + } + + /** + * @return com.epmet.entity.ActInfoEntity + * @param formDTO + * @author yinzuomei + * @description 发布活动-构造act_info + * @Date 2020/7/21 20:00 + **/ + private ActInfoEntity constructActInfo(PublishActInfoFormDTO formDTO) { + ActInfoEntity actInfoEntity = ConvertUtils.sourceToTarget(formDTO, ActInfoEntity.class); + //活动名额类型(0-不限名额,1-固定名额) + if(actInfoEntity.getActQuota()==0){ + actInfoEntity.setActQuotaCategory(false); + }else{ + actInfoEntity.setActQuotaCategory(true); + } + actInfoEntity.setSignUpStartTime(new Date()); + actInfoEntity.setActStatus(ActConstant.ACT_STATUS_PUBLISHED); + + //1已经总结0未总结 + actInfoEntity.setSummaryFlag(false); + if(ActConstant.SPONSOR_AGENCY.equals(actInfoEntity.getSponsorType())){ + //调用gov_org服务获取当前组织的上一级机关id + Result result=govOrgOpenFeignClient.getAgencyById(formDTO.getSponsorId()); + if(result.success()&&null!=result.getData()){ + actInfoEntity.setPid(result.getData().getPid()); + }else{ + logger.warn("根据agencyId查询组织信息失败,agencyId=",formDTO.getSponsorId()); + } + }else{ + actInfoEntity.setPid(""); + } + return actInfoEntity; + } + + /** + * @return java.util.List + * @param actContent + * @param actId + * @author yinzuomei + * @description 发布活动-构造活动详情act_content + * @Date 2020/7/21 19:59 + **/ + private List constructActContent(List actContent, String actId) { + List list=new ArrayList<>(); + int orderNum=1; + for(PublishActContentFormDTO actContentFormDTO:actContent){ + ActContentEntity actContentEntity=new ActContentEntity(); + actContentEntity.setActId(actId); + actContentEntity.setContent(actContentFormDTO.getContent()); + actContentEntity.setContentType(actContentFormDTO.getContentType()); + actContentEntity.setOrderNum(orderNum); + list.add(actContentEntity); + orderNum++; + } + return list; + } + + /** + * @return void + * @param textList + * @param imgList + * @author yinzuomei + * @description 活动详情审核 + * @Date 2020/7/21 19:21 + **/ + private void auditActContent(List textList, List imgList) { + //审核活动详情中的内容 + if(null!=textList&&textList.size()>0){ + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + textList.forEach(content -> { + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setContent(content); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScanParamDTO.getTasks().add(taskDTO); + }); + Result contentSyncScanRes = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!contentSyncScanRes.success()) { + logger.error("活动详情内容审核接口失败,返参:", JSON.toJSONString(contentSyncScanRes)); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!contentSyncScanRes.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.ACT_REQ_SCAN_FAILED.getCode()); + } + } + logger.info("活动详情内容审核成功"); + } + if(null!=imgList&&imgList.size()>0){ + //审核活动详情中的图片 + ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO(); + imgList.forEach(url -> { + ImgTaskDTO task = new ImgTaskDTO(); + task.setDataId(UUID.randomUUID().toString().replace("-", "")); + task.setUrl(url); + imgScanParamDTO.getTasks().add(task); + }); + Result imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO); + if (!imgScanResult.success()){ + logger.error("活动详情图片审核接口失败,返参:", JSON.toJSONString(imgScanResult)); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!imgScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.ACT_CONTENT_IMG_SCAN_FAILED.getCode()); + } + } + logger.info("活动详情图片审核成功"); + } + } + + /** + * @return void + * @param requirement + * @author yinzuomei + * @description 活动招募条件审核 + * @Date 2020/7/21 19:21 + **/ + private void auditActRequirement(String requirement) { + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setContent(requirement); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + logger.error("活动报名条件审核接口返回失败,返参:", JSON.toJSONString(textSyncScanResult)); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + logger.error("活动报名条件审核失败,报名条件:",requirement); + throw new RenException(EpmetErrorCode.ACT_REQ_SCAN_FAILED.getCode()); + } + } + logger.info("活动报名条件审核成功"); + } + + /** + * @return void + * @param coverPic + * @author yinzuomei + * @description 活动封面图片审核 + * @Date 2020/7/21 19:21 + **/ + private void auditActCoverPic(String coverPic) { + ImgScanParamDTO coverPicScanParamDTO = new ImgScanParamDTO(); + ImgTaskDTO coverImgtask = new ImgTaskDTO(); + coverImgtask.setDataId(UUID.randomUUID().toString().replace("-", "")); + coverImgtask.setUrl(coverPic); + coverPicScanParamDTO.getTasks().add(coverImgtask); + Result coverPicScanRes = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), coverPicScanParamDTO); + if (!coverPicScanRes.success()){ + logger.error("活动封面审核失败接口返回失败,返参:", JSON.toJSONString(coverPicScanRes)); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!coverPicScanRes.getData().isAllPass()) { + logger.error("活动封面审核失败,封面图片地址:",coverPic); + throw new RenException(EpmetErrorCode.ACT_COVER_PIC_SCAN_FAILED.getCode()); + } + } + logger.info("活动封面审核成功"); + } + + /** + * @return void + * @param title + * @author yinzuomei + * @description 活动标题审核 + * @Date 2020/7/21 19:21 + **/ + private void auditActTitle(String title) { + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setContent(title); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + logger.error("活动标题审核接口返回失败,返参:", JSON.toJSONString(textSyncScanResult)); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + logger.error("活动标题审核失败,标题内容:",title); + throw new RenException(EpmetErrorCode.ACT_TITLE_SCAN_FAILED.getCode()); + } + } + logger.info("活动标题审核通过"); + } + /** * @param formDTO * @return com.epmet.dto.result.work.InProgressActResultDTO @@ -128,20 +495,69 @@ public class WorkActServiceImpl implements WorkActService { return actInfoDao.selectFinishedList(formDTO.getCustomerId()); } - public static void main(String[] args) { - SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - - try { - Date date1=format.parse("2020-07-23 13:00:00"); - Date yesterDate=format.parse("2020-07-22 13:00:00"); - Date date2=format.parse("2020-07-23 13:00:00"); - Date tommorrow=format.parse("2020-07-24 13:00:00"); - System.out.println(new Date().compareTo(yesterDate)); - System.out.println(date1.compareTo(tommorrow)); - System.out.println(date1.compareTo(date2)); - } catch (ParseException e) { - e.printStackTrace(); + /** + * @param formDTO + * @return void + * @author yinzuomei + * @description 取消活动 + * @Date 2020/7/26 17:26 + **/ + @Override + public void cancelAct(CancelActFormDTO formDTO) { + ActInfoDTO actInfoDTO=actInfoService.get(formDTO.getActId()); + if(null==actInfoDTO){ + logger.error("act_info is null"); + return ; + } + //插入取消活动操作日志 + ActOperationRecEntity actOperationRecEntity=new ActOperationRecEntity(); + actOperationRecEntity.setActId(formDTO.getActId()); + actOperationRecEntity.setType(ActConstant.ACT_OPER_TYPE_CANCEL); + actOperationRecEntity.setNoticeUser(true); + actOperationRecEntity.setRemark(formDTO.getCancelReason()); + actOperationRecDao.insert(actOperationRecEntity); + //更新活动标识,改为已取消 + actInfoDTO.setCancelReason(formDTO.getCancelReason()); + actInfoDTO.setCancelTime(actOperationRecEntity.getCreatedTime()); + actInfoDTO.setActStatus(ActConstant.ACT_STATUS_CANCELED); + actInfoService.update(actInfoDTO); + //查询已经通过审核的用户,发送消息 + List userIdList=actUserRelationDao.selectUserIdList(formDTO.getActId(),ActConstant.ACT_USER_STATUS_PASSED); + if(null!=userIdList&&userIdList.size()>0){ + List userMessageFormDTOS=new ArrayList<>(); + for(String userId:userIdList){ + UserMessageFormDTO userMessageFormDTO = new UserMessageFormDTO(); + userMessageFormDTO.setUserId(userId); + userMessageFormDTO.setGridId(StrConstant.STAR); + userMessageFormDTO.setApp(AppClientConstant.APP_RESI); + userMessageFormDTO.setTitle(ActMessageConstant.TITLE); + userMessageFormDTO.setReadFlag(ReadFlagConstant.UN_READ); + userMessageFormDTO.setMessageContent(String.format(ActMessageConstant.ACT_CANCELED, + actInfoDTO.getTitle(), + formDTO.getCancelReason())); + userMessageFormDTOS.add(userMessageFormDTO); + } + Result sendMessageRes= epmetMessageOpenFeignClient.saveUserMessageList(userMessageFormDTOS); + if(sendMessageRes.success()){ + logger.info("给审核通过的用户发送消息成功"); + } } } + + /** + * @param actId + * @return void + * @author yinzuomei + * @description 已取消-活动详情 + * @Date 2020/7/26 18:00 + **/ + @Override + public CanceledActDetailResultDTO canceledDetail(String actId) { + CanceledActDetailResultDTO canceledActDetailResultDTO=actInfoDao.selectCanceledActInfo(actId); + if(null!=canceledActDetailResultDTO){ + canceledActDetailResultDTO.setActContent(actContentDao.selectByActId(actId)); + } + return canceledActDetailResultDTO; + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java index 3ec8d2dea5..411e6f1cc6 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java @@ -369,6 +369,10 @@ public class WorkActUserServiceImpl implements WorkActUserService { if(!actInfo.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); } + if(actInfo.getActStatus().equals(ActConstant.ACT_STATUS_CANCELED)){ + logger.info("活动已经取消,无需处理"); + return; + } Date auditTime=new Date(); actUserRelationEntity.setStatus(ActConstant.ACT_USER_STATUS_PASSED); actUserRelationEntity.setPassedType(ActConstant.PASSEDTYPE_MANUAL); @@ -408,6 +412,10 @@ public class WorkActUserServiceImpl implements WorkActUserService { logger.error("查询活动为空actId="+actUserRelationEntity.getActId()); return; } + if(actInfo.getActStatus().equals(ActConstant.ACT_STATUS_CANCELED)){ + logger.info("活动已经取消,无需处理"); + return; + } if(!actInfo.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActContentDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActContentDao.xml index 4f6c46667e..6d38c0a679 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActContentDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActContentDao.xml @@ -17,5 +17,16 @@ - + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml index 380e0197a7..368115e3e2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml @@ -577,4 +577,30 @@ AND aur.ACT_ID =#{actId} order by aur.CANCEL_TIME desc + + + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml index d2872098fd..507206fa64 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml @@ -189,4 +189,43 @@ AND aur.PROCESS_FLAG != 'handled' AND aur.ACT_ID = #{actId} + + + + + + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActContentDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActContentDao.xml index 68f536b24d..a4aade9b30 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActContentDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActContentDao.xml @@ -50,4 +50,9 @@ ORDER BY lac.ORDER_NUM ASC + + + + delete from latest_act_content lac where lac.ACT_ID=#{actId} + \ No newline at end of file From 8a510a6b0d289392036a87573e337c77d75a7354 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 26 Jul 2020 20:18:33 +0800 Subject: [PATCH 67/98] =?UTF-8?q?heart-work:=E5=B7=B2=E7=BB=93=E6=9D=9F-?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E6=B4=BB=E5=8A=A8=E5=AE=9E=E9=99=85=E5=BC=80?= =?UTF-8?q?=E5=A7=8B=E7=BB=93=E6=9D=9F=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/exception/EpmetErrorCode.java | 2 +- .../epmet/commons/tools/utils/DateUtils.java | 8 ++++ .../dto/form/work/SaveActualTimeFormDTO.java | 40 +++++++++++++++++++ .../epmet/controller/WorkActController.java | 15 +++++++ .../com/epmet/service/WorkActService.java | 10 +++++ .../service/impl/WorkActServiceImpl.java | 27 +++++++++++-- 6 files changed, 97 insertions(+), 5 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActualTimeFormDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 1c4adc9bf3..f715f35b01 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -57,7 +57,7 @@ public enum EpmetErrorCode { ACT_START_TIME_ERROR(8119,"活动预计开始时间应早于活动预计结束时间"), ACT_SIGN_IN_START_TIME_ERROR(8120,"签到开始时间应早于签到结束时间"), ACT_SIGN_UP_END_TIME_ERROR(8121,"活动报名截止时间应早于活动预计开始时间"), - + ACT_ACTUAL_START_TIME_ERROR(8122,"实际开始时间应早于实际结束时间"), CANNOT_AUDIT_WARM(8201, "请完善居民信息"), NOT_DEL_AGENCY(8202, "该机关存在下级机关,不允许删除"), diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index e76c5a4c33..c652bde696 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -502,4 +502,12 @@ public class DateUtils { return null; } + public static Integer calculateMin(Date startDate,Date endDate){ + long start=startDate.getTime(); + long end=endDate.getTime(); + // 计算差多少分钟 + int minutes = (int) ((end - start) / (1000 * 60)); + System.out.println("两个时间之间的分钟差为:" + minutes); + return minutes; + } } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActualTimeFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActualTimeFormDTO.java new file mode 100644 index 0000000000..8380ece57c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActualTimeFormDTO.java @@ -0,0 +1,40 @@ +package com.epmet.dto.form.work; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 已结束-保存活动实际开始结束时间 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/26 19:43 + */ +@Data +public class SaveActualTimeFormDTO implements Serializable { + private static final long serialVersionUID = -3668309257254318868L; + + public interface AddUserInternalGroup { + } + + public interface UserShowGroup extends CustomerClientShowGroup { + } + + /** + * 活动id + */ + @NotBlank(message = "活动id不能为空", groups = {AddUserInternalGroup.class}) + private String actId; + /** + * 实际开始时间yyyy-MM-dd HH:mm + */ + @NotBlank(message = "实际开始时间不能为空", groups = {UserShowGroup.class}) + private String actualStartTime; + /** + * 实际结束时间yyyy-MM-dd HH:mm + */ + @NotBlank(message = "实际结束时间不能为空", groups = {UserShowGroup.class}) + private String actualEndTime; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java index aca1f4aee4..818f4e48b7 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java @@ -135,4 +135,19 @@ public class WorkActController { ValidatorUtils.validateEntity(actIdFormDTO, ActIdFormDTO.AddUserInternalGroup.class); return new Result().ok(workActService.canceledDetail(actIdFormDTO.getActId())); } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 已结束-保存活动实际开始结束时间 + * @Date 2020/7/26 19:48 + **/ + @PostMapping("saveactualtime") + public Result saveActualTime(@RequestBody SaveActualTimeFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SaveActualTimeFormDTO.UserShowGroup.class, + SaveActualTimeFormDTO.AddUserInternalGroup.class); + workActService.saveActualTime(formDTO); + return new Result(); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java index b4e83a2aa1..971240c5c8 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java @@ -3,6 +3,7 @@ package com.epmet.service; import com.epmet.dto.form.work.ActListCommonFormDTO; import com.epmet.dto.form.work.CancelActFormDTO; import com.epmet.dto.form.work.PublishActInfoFormDTO; +import com.epmet.dto.form.work.SaveActualTimeFormDTO; import com.epmet.dto.result.work.*; import java.util.List; @@ -85,4 +86,13 @@ public interface WorkActService { * @Date 2020/7/26 18:00 **/ CanceledActDetailResultDTO canceledDetail(String actId); + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 已结束-保存活动实际开始结束时间 + * @Date 2020/7/26 19:49 + **/ + void saveActualTime(SaveActualTimeFormDTO formDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java index 257b8a810d..1e713b226e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java @@ -12,6 +12,7 @@ import com.epmet.commons.tools.scan.param.TextTaskDTO; import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.ActConstant; @@ -24,10 +25,7 @@ import com.epmet.dao.ActUserRelationDao; import com.epmet.dto.ActInfoDTO; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.form.UserMessageFormDTO; -import com.epmet.dto.form.work.ActListCommonFormDTO; -import com.epmet.dto.form.work.CancelActFormDTO; -import com.epmet.dto.form.work.PublishActContentFormDTO; -import com.epmet.dto.form.work.PublishActInfoFormDTO; +import com.epmet.dto.form.work.*; import com.epmet.dto.result.ActSponsorResultDTO; import com.epmet.dto.result.work.*; import com.epmet.entity.ActContentEntity; @@ -560,4 +558,25 @@ public class WorkActServiceImpl implements WorkActService { } return canceledActDetailResultDTO; } + + /** + * @param formDTO + * @return void + * @author yinzuomei + * @description 已结束-保存活动实际开始结束时间 + * @Date 2020/7/26 19:49 + **/ + @Override + public void saveActualTime(SaveActualTimeFormDTO formDTO) { + if(formDTO.getActualStartTime().compareTo(formDTO.getActualEndTime())!=-1){ + throw new RenException(EpmetErrorCode.ACT_ACTUAL_START_TIME_ERROR.getCode()); + } + ActInfoDTO actInfoDTO=actInfoService.get(formDTO.getActId()); + Date actualStartTime= DateUtils.minStrToSecondDate(formDTO.getActualStartTime()); + actInfoDTO.setActualStartTime(actualStartTime); + Date actualEndTime= DateUtils.minStrToSecondDate(formDTO.getActualEndTime()); + actInfoDTO.setActualEndTime(actualEndTime); + actInfoDTO.setServiceMin(DateUtils.calculateMin(actualStartTime,actualEndTime)); + actInfoService.update(actInfoDTO); + } } From 750583687a4a9316d35a2dd9fd7d080e7d3a79c9 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 26 Jul 2020 21:42:34 +0800 Subject: [PATCH 68/98] =?UTF-8?q?heart-work:=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../work/FinishedActDetailResultDTO.java | 109 ++++++++++++++++++ .../work/InProgressActDetailResultDTO.java | 92 +++++++++++++++ .../result/work/InProgressActResultDTO.java | 9 ++ .../epmet/controller/WorkActController.java | 26 +++++ .../main/java/com/epmet/dao/ActInfoDao.java | 18 +++ .../com/epmet/service/WorkActService.java | 23 +++- .../service/impl/WorkActServiceImpl.java | 34 ++++++ .../src/main/resources/mapper/ActInfoDao.xml | 61 +++++++++- 8 files changed, 364 insertions(+), 8 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java new file mode 100644 index 0000000000..dceee4956d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java @@ -0,0 +1,109 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 已结束-活动详情 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/26 20:52 + */ +@Data +public class FinishedActDetailResultDTO implements Serializable { + private static final long serialVersionUID = 6780614493878658227L; + /** + * 活动id + */ + private String actId; + + /** + * 活动标题 + */ + private String title; + + /** + * 报名截止时间:yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date signUpEndTime; + + /** + * 活动预计开始时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actStartTime; + + /** + * 活动预计结束时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * true:固定名额 false: 不限制名额 + */ + private Boolean actQuotaCategory; + + /** + * 联系人 + */ + private String sponsorContacts; + + /** + * 联系电话 + */ + private String sponsorTel; + + /** + * 活动积分 + */ + private Integer reward; + + /** + * 主办方名称 + */ + private String sponsorName; + + /** + * 报名条件 + */ + private String requirement; + + /** + * 是否添加回顾:true已经总结 false:未总结 + */ + private Boolean summaryFlag; + + /** + * 活动详情 + */ + private List actContent; + + /** + * 实际开始时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actualStartTime; + + /** + * 实际结束时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actualEndTime; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java new file mode 100644 index 0000000000..c1c0ed4515 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java @@ -0,0 +1,92 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 进行中-活动详情 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/26 21:26 + */ +@Data +public class InProgressActDetailResultDTO implements Serializable { + private static final long serialVersionUID = -2159602705968655263L; + + /** + * 活动id + */ + private String actId; + + /** + * 活动标题 + */ + private String title; + + /** + * 报名截止时间:yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date signUpEndTime; + + /** + * 活动预计开始时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actStartTime; + + /** + * 活动预计结束时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * true:固定名额 false: 不限制名额 + */ + private Boolean actQuotaCategory; + + /** + * 联系人 + */ + private String sponsorContacts; + + /** + * 联系电话 + */ + private String sponsorTel; + + /** + * 活动积分 + */ + private Integer reward; + + /** + * 主办方名称 + */ + private String sponsorName; + + /** + * 报名条件 + */ + private String requirement; + + /** + * 活动详情 + */ + private List actContent; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActResultDTO.java index edf6102c7c..5e25e5fab0 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActResultDTO.java @@ -64,8 +64,17 @@ public class InProgressActResultDTO implements Serializable { */ private Integer signedUp; + /** + * 报名截止时间 + */ @JsonIgnore + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date signUpEndTime; + + /** + * 报名开始时间 + */ @JsonIgnore + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date signUpStartTime; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java index 818f4e48b7..dd0a773058 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java @@ -150,4 +150,30 @@ public class WorkActController { workActService.saveActualTime(formDTO); return new Result(); } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 已结束-活动详情 + * @Date 2020/7/26 21:01 + **/ + @PostMapping("finisheddeatil") + public Result finishedDeatil(@RequestBody ActIdFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); + return new Result().ok(workActService.finishedDeatil(formDTO)); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 进行中-活动详情 + * @Date 2020/7/26 21:33 + **/ + @PostMapping("inprogressdetail") + public Result inProgressDetail(@RequestBody ActIdFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); + return new Result().ok(workActService.inProgressDetail(formDTO.getActId())); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java index 4766a2823c..fc1b09d56c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java @@ -279,4 +279,22 @@ public interface ActInfoDao extends BaseDao { * @Date 2020/7/26 18:29 **/ CanceledActDetailResultDTO selectCanceledActInfo(String actId); + + /** + * @return com.epmet.dto.result.work.FinishedActDetailResultDTO + * @param actId + * @author yinzuomei + * @description 已结束-活动详情 + * @Date 2020/7/26 21:04 + **/ + FinishedActDetailResultDTO selectFinishedDetail(String actId); + + /** + * @return com.epmet.dto.result.work.InProgressActDetailResultDTO + * @param actId + * @author yinzuomei + * @description 进行中-活动详情 + * @Date 2020/7/26 21:35 + **/ + InProgressActDetailResultDTO selectInProgressDetail(String actId); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java index 971240c5c8..22975d0ec0 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java @@ -1,9 +1,6 @@ package com.epmet.service; -import com.epmet.dto.form.work.ActListCommonFormDTO; -import com.epmet.dto.form.work.CancelActFormDTO; -import com.epmet.dto.form.work.PublishActInfoFormDTO; -import com.epmet.dto.form.work.SaveActualTimeFormDTO; +import com.epmet.dto.form.work.*; import com.epmet.dto.result.work.*; import java.util.List; @@ -95,4 +92,22 @@ public interface WorkActService { * @Date 2020/7/26 19:49 **/ void saveActualTime(SaveActualTimeFormDTO formDTO); + + /** + * @param formDTO + * @return com.epmet.dto.result.work.FinishedActDetailResultDTO + * @author yinzuomei + * @description 已结束-活动详情 + * @Date 2020/7/26 21:02 + **/ + FinishedActDetailResultDTO finishedDeatil(ActIdFormDTO formDTO); + + /** + * @return com.epmet.dto.result.work.InProgressActDetailResultDTO + * @param actId + * @author yinzuomei + * @description 进行中-活动详情 + * @Date 2020/7/26 21:34 + **/ + InProgressActDetailResultDTO inProgressDetail(String actId); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java index 1e713b226e..ac14c06eed 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java @@ -579,4 +579,38 @@ public class WorkActServiceImpl implements WorkActService { actInfoDTO.setServiceMin(DateUtils.calculateMin(actualStartTime,actualEndTime)); actInfoService.update(actInfoDTO); } + + /** + * @param formDTO + * @return com.epmet.dto.result.work.FinishedActDetailResultDTO + * @author yinzuomei + * @description 已结束-活动详情 + * @Date 2020/7/26 21:02 + **/ + @Override + public FinishedActDetailResultDTO finishedDeatil(ActIdFormDTO formDTO) { + FinishedActDetailResultDTO resultDTO = actInfoDao.selectFinishedDetail(formDTO.getActId()); + if (null != resultDTO) { + List list = actContentDao.selectByActId(formDTO.getActId()); + resultDTO.setActContent(list); + } + return resultDTO; + } + + /** + * @param actId + * @return com.epmet.dto.result.work.InProgressActDetailResultDTO + * @author yinzuomei + * @description 进行中-活动详情 + * @Date 2020/7/26 21:34 + **/ + @Override + public InProgressActDetailResultDTO inProgressDetail(String actId) { + InProgressActDetailResultDTO resultDTO = actInfoDao.selectInProgressDetail(actId); + if (null != resultDTO) { + List list = actContentDao.selectByActId(actId); + resultDTO.setActContent(list); + } + return resultDTO; + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml index 4686b14efc..644e5864f4 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml @@ -506,7 +506,7 @@ AND ai.ACT_STATUS = 'canceled' AND ai.CUSTOMER_ID = #{customerId} ORDER BY - ai.CANCEL_TIME DESC + ai.CREATED_TIME DESC @@ -526,7 +526,7 @@ AND ai.ACT_STATUS = 'finished' AND ai.CUSTOMER_ID = #{customerId} ORDER BY - ai.ACTUAL_END_TIME DESC + ai.CREATED_TIME DESC @@ -556,7 +556,8 @@ - SELECT aur.id as actUserRelationId, aur.ACT_ID , @@ -579,7 +580,8 @@ - SELECT ai.id AS actId, ai.TITLE AS title, @@ -603,4 +605,55 @@ and ai.id=#{actId} and ai.ACT_STATUS='canceled' + + + + + + From 51d8e62877eaa0096b722641a8c43350efa96938 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 26 Jul 2020 23:11:42 +0800 Subject: [PATCH 69/98] =?UTF-8?q?heart-work:=E5=8F=91=E5=B8=83=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/exception/EpmetErrorCode.java | 3 + .../java/com/epmet/dto/ActPointLogDTO.java | 5 - .../java/com/epmet/dto/ActStatisticalDTO.java | 15 +- .../epmet/controller/WorkActController.java | 14 ++ .../com/epmet/dao/ActUserRelationDao.java | 19 +++ .../com/epmet/entity/ActPointLogEntity.java | 6 - .../epmet/entity/ActStatisticalEntity.java | 15 +- .../com/epmet/service/WorkActService.java | 9 ++ .../service/impl/GrantPointsServiceImpl.java | 15 -- .../service/impl/WorkActServiceImpl.java | 136 ++++++++++++++++-- .../main/resources/mapper/ActPointLogDao.xml | 1 - .../resources/mapper/ActStatisticalDao.xml | 2 - .../resources/mapper/ActUserRelationDao.xml | 24 ++++ 13 files changed, 194 insertions(+), 70 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index f715f35b01..be9c66519e 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -58,6 +58,9 @@ public enum EpmetErrorCode { ACT_SIGN_IN_START_TIME_ERROR(8120,"签到开始时间应早于签到结束时间"), ACT_SIGN_UP_END_TIME_ERROR(8121,"活动报名截止时间应早于活动预计开始时间"), ACT_ACTUAL_START_TIME_ERROR(8122,"实际开始时间应早于实际结束时间"), + HAVE_HANDLE(8123,"存在待处理事项,请先处理"), + ACTUAL_TIME(8124,"请录入实际开始时间,实际结束时间"), + CANNOT_AUDIT_WARM(8201, "请完善居民信息"), NOT_DEL_AGENCY(8202, "该机关存在下级机关,不允许删除"), diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActPointLogDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActPointLogDTO.java index c19938d48f..6b6daf74c2 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActPointLogDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActPointLogDTO.java @@ -94,9 +94,4 @@ public class ActPointLogDTO implements Serializable { * 更新时间 */ private Date updatedTime; - /** - * 1有效0无效,只有在活动真正结束后才是1 - * true有效 false无效 - */ - private Boolean effectFlag; } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActStatisticalDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActStatisticalDTO.java index 233b5c2188..b1bc9f1898 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActStatisticalDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActStatisticalDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -44,7 +45,7 @@ public class ActStatisticalDTO implements Serializable { private String actId; /** - * 已报名总人数(已报名/待审核auditing,审核通过passed,审核不通过refused取消报名canceld总人数) + * 报名总人数(已报名/待审核auditing,审核通过passed,审核不通过refused取消报名canceld总人数) */ private Integer signupNum; @@ -73,16 +74,6 @@ public class ActStatisticalDTO implements Serializable { */ private Integer signedInUserNum; - /** - * 添加实况总人数 - */ - private Integer liveUserNum; - - /** - * 实况总记录数 - */ - private Integer liveCount; - /** * 发放积分总人数 */ diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java index dd0a773058..dda4fe56b0 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java @@ -176,4 +176,18 @@ public class WorkActController { ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); return new Result().ok(workActService.inProgressDetail(formDTO.getActId())); } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 已结束-确认结束活动 + * @Date 2020/7/26 21:48 + **/ + @PostMapping("finishact") + public Result finishAct(@RequestBody ActIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); + workActService.finishAct(formDTO.getActId()); + return new Result(); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java index 526ca76a1f..3b50cf440b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java @@ -156,4 +156,23 @@ public interface ActUserRelationDao extends BaseDao { * @Date 2020/7/26 19:11 **/ List selectDeniedList(String actId); + + /** + * @return java.lang.Integer + * @param actId + * @author yinzuomei + * @description 活动已签到人数 + * @Date 2020/7/26 22:34 + **/ + Integer selectCountSinedIn(String actId); + + /** + * @return java.lang.Integer + * @param actId + * @param rewardFlag + * @author yinzuomei + * @description 查询发放积分的总人数、拒绝发放积分的总人数 + * @Date 2020/7/26 22:38 + **/ + Integer selectCountByReward(@Param("actId") String actId, @Param("rewardFlag")String rewardFlag); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActPointLogEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActPointLogEntity.java index f96ba508d9..e18170b8a3 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActPointLogEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActPointLogEntity.java @@ -61,10 +61,4 @@ public class ActPointLogEntity extends BaseEpmetEntity { */ private String remark; - - /** - * 1有效0无效,只有在活动真正结束后才是1 - * true有效 false无效 - */ - private Boolean effectFlag; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActStatisticalEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActStatisticalEntity.java index 61de147e46..cc1a41fa9a 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActStatisticalEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActStatisticalEntity.java @@ -18,13 +18,10 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; - /** * 活动统计信息 * @@ -44,7 +41,7 @@ public class ActStatisticalEntity extends BaseEpmetEntity { private String actId; /** - * 已报名总人数(已报名/待审核auditing,审核通过passed,审核不通过refused取消报名canceld总人数) + * 报名总人数(已报名/待审核auditing,审核通过passed,审核不通过refused取消报名canceld总人数) */ private Integer signupNum; @@ -73,16 +70,6 @@ public class ActStatisticalEntity extends BaseEpmetEntity { */ private Integer signedInUserNum; - /** - * 添加实况总人数 - */ - private Integer liveUserNum; - - /** - * 实况总记录数 - */ - private Integer liveCount; - /** * 发放积分总人数 */ diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java index 22975d0ec0..c00fab9abe 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java @@ -110,4 +110,13 @@ public interface WorkActService { * @Date 2020/7/26 21:34 **/ InProgressActDetailResultDTO inProgressDetail(String actId); + + /** + * @return void + * @param actId + * @author yinzuomei + * @description 已结束-确认结束活动 + * @Date 2020/7/26 21:48 + **/ + void finishAct(String actId); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/GrantPointsServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/GrantPointsServiceImpl.java index 024b325ff9..ccdab4e19e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/GrantPointsServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/GrantPointsServiceImpl.java @@ -137,11 +137,6 @@ public class GrantPointsServiceImpl implements GrantPointsService { actPointLogDTO.setPoints(actInfoDTO.getReward()); actPointLogDTO.setOperateType(ActConstant.ACT_USER_STATUS_AGREE); actPointLogDTO.setRemark(StrConstant.EPMETY_STR); - /** - * 1有效0无效,只有在活动真正结束后才是1 - * true有效 false无效 - */ - actPointLogDTO.setEffectFlag(false); actPointLogService.save(actPointLogDTO); } @@ -186,11 +181,6 @@ public class GrantPointsServiceImpl implements GrantPointsService { actPointLogDTO.setPoints(actInfoDTO.getReward()); actPointLogDTO.setOperateType(ActConstant.ACT_USER_STATUS_DENY); actPointLogDTO.setRemark(formDTO.getDenyRewardReason()); - /** - * 1有效0无效,只有在活动真正结束后才是1 - * true有效 false无效 - */ - actPointLogDTO.setEffectFlag(false); actPointLogService.save(actPointLogDTO); } @@ -229,11 +219,6 @@ public class GrantPointsServiceImpl implements GrantPointsService { actPointLogDTO.setPoints(actInfoDTO.getReward()); actPointLogDTO.setOperateType(ActConstant.RESET); actPointLogDTO.setRemark(StrConstant.EPMETY_STR); - /** - * 1有效0无效,只有在活动真正结束后才是1 - * true有效 false无效 - */ - actPointLogDTO.setEffectFlag(false); actPointLogService.save(actPointLogDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java index ac14c06eed..3c6407fb1c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java @@ -11,19 +11,12 @@ import com.epmet.commons.tools.scan.param.TextScanParamDTO; import com.epmet.commons.tools.scan.param.TextTaskDTO; import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.security.user.LoginUserUtil; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.commons.tools.utils.Result; -import com.epmet.commons.tools.utils.ScanContentUtils; +import com.epmet.commons.tools.utils.*; import com.epmet.constant.ActConstant; import com.epmet.constant.ActMessageConstant; import com.epmet.constant.ReadFlagConstant; -import com.epmet.dao.ActContentDao; -import com.epmet.dao.ActInfoDao; -import com.epmet.dao.ActOperationRecDao; -import com.epmet.dao.ActUserRelationDao; -import com.epmet.dto.ActInfoDTO; -import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dao.*; +import com.epmet.dto.*; import com.epmet.dto.form.UserMessageFormDTO; import com.epmet.dto.form.work.*; import com.epmet.dto.result.ActSponsorResultDTO; @@ -33,9 +26,7 @@ import com.epmet.entity.ActInfoEntity; import com.epmet.entity.ActOperationRecEntity; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; -import com.epmet.service.ActInfoService; -import com.epmet.service.LatestActInfoService; -import com.epmet.service.WorkActService; +import com.epmet.service.*; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -84,6 +75,14 @@ public class WorkActServiceImpl implements WorkActService { private ActUserRelationDao actUserRelationDao; @Autowired private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + @Autowired + private ActStatisticalService actStatisticalService; + @Autowired + private ActUserRelationService actUserRelationService; + @Autowired + private HeartUserInfoDao heartUserInfoDao; + @Autowired + private HeartUserInfoService heartUserInfoService; /** * @return void @@ -247,13 +246,22 @@ public class WorkActServiceImpl implements WorkActService { **/ private ActInfoEntity constructActInfo(PublishActInfoFormDTO formDTO) { ActInfoEntity actInfoEntity = ConvertUtils.sourceToTarget(formDTO, ActInfoEntity.class); + //报名开始、报名截止、活动预计开始、活动预计截止、签到开始、签到截止 + actInfoEntity.setSignUpEndTime(DateUtils.minStrToSecondDate(formDTO.getSignUpEndTime())); + actInfoEntity.setSignInStartTime(DateUtils.minStrToSecondDate(formDTO.getSignInStartTime())); + actInfoEntity.setSignInEndTime(DateUtils.minStrToSecondDate(formDTO.getSignInEndTime())); + actInfoEntity.setActStartTime(DateUtils.minStrToSecondDate(formDTO.getActStartTime())); + actInfoEntity.setActEndTime(DateUtils.minStrToSecondDate(formDTO.getActEndTime())); //活动名额类型(0-不限名额,1-固定名额) if(actInfoEntity.getActQuota()==0){ actInfoEntity.setActQuotaCategory(false); }else{ actInfoEntity.setActQuotaCategory(true); } - actInfoEntity.setSignUpStartTime(new Date()); + Date nowDate=new Date(); + actInfoEntity.setSignUpStartTime(nowDate); + actInfoEntity.setCreatedTime(nowDate); + actInfoEntity.setUpdatedTime(nowDate); actInfoEntity.setActStatus(ActConstant.ACT_STATUS_PUBLISHED); //1已经总结0未总结 @@ -267,7 +275,7 @@ public class WorkActServiceImpl implements WorkActService { logger.warn("根据agencyId查询组织信息失败,agencyId=",formDTO.getSponsorId()); } }else{ - actInfoEntity.setPid(""); + actInfoEntity.setPid(StrConstant.EPMETY_STR); } return actInfoEntity; } @@ -507,6 +515,9 @@ public class WorkActServiceImpl implements WorkActService { logger.error("act_info is null"); return ; } + if(!actInfoDTO.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); + } //插入取消活动操作日志 ActOperationRecEntity actOperationRecEntity=new ActOperationRecEntity(); actOperationRecEntity.setActId(formDTO.getActId()); @@ -613,4 +624,99 @@ public class WorkActServiceImpl implements WorkActService { } return resultDTO; } + + /** + * @param actId + * @return void + * @author yinzuomei + * @description 已结束-确认结束活动 + * @Date 2020/7/26 21:48 + **/ + @Override + public void finishAct(String actId) { + ActInfoDTO actInfoDTO=actInfoService.get(actId); + //校验是否可以结束 + this.checkActInfoDTO(actInfoDTO); + //act_info表改为已完成 + actInfoDTO.setActStatus(ActConstant.ACT_STATUS_FINISHED); + actInfoService.update(actInfoDTO); + //发放爱心时长、参与活动并获得积分的次数 + updateHeartUserInfo(actInfoDTO); + //保存结束活动日志 + this.saveActOperationRec(actId); + //生成统计表 + this.saveActStatistical(actId); + //发放积分调用事件 TODO + } + + private void updateHeartUserInfo(ActInfoDTO actInfoDTO) { + List actUserRelationDTOList=actUserRelationService.getUserList(actInfoDTO.getId(),StrConstant.EPMETY_STR); + for(ActUserRelationDTO actUserRelation:actUserRelationDTOList){ + HeartUserInfoDTO heartUserInfoDTO=heartUserInfoDao.selectByUserId(actUserRelation.getUserId()); + if(null==heartUserInfoDTO){ + continue; + } + if(ActConstant.ACT_USER_STATUS_AGREE.equals(actUserRelation.getRewardFlag())){ + heartUserInfoDTO.setObtainPointNum(heartUserInfoDTO.getObtainPointNum()+1); + } + //爱心时长发放(签到的。未签到但是有积分的) + if(ActConstant.ACT_USER_STATUS_SIGNED_IN.equals(actUserRelation.getSignInFlag())){ + //已签到的 + heartUserInfoDTO.setKindnessTime(heartUserInfoDTO.getKindnessTime()+actInfoDTO.getServiceMin()); + }else{ + //未签到,但是有积分的 + if(ActConstant.ACT_USER_STATUS_AGREE.equals(actUserRelation.getRewardFlag())){ + heartUserInfoDTO.setKindnessTime(heartUserInfoDTO.getKindnessTime()+actInfoDTO.getServiceMin()); + } + } + heartUserInfoService.update(heartUserInfoDTO); + } + } + + private void saveActStatistical(String actId) { + ActStatisticalDTO actStatisticalDTO=new ActStatisticalDTO(); + actStatisticalDTO.setActId(actId); + //报名总人数(已报名/待审核auditing,审核通过passed,审核不通过refused取消报名canceld总人数) + actStatisticalDTO.setSignupNum(actUserRelationDao.selectCountUser(actId,StrConstant.EPMETY_STR)); + // 待审核总数 + actStatisticalDTO.setAuditingNum(actUserRelationDao.selectCountUser(actId,ActConstant.ACT_USER_STATUS_AUDITING)); + //审核不通过总人数 + actStatisticalDTO.setPassedNum(actUserRelationDao.selectCountUser(actId,ActConstant.ACT_USER_STATUS_PASSED)); + //审核不通过总人数 + actStatisticalDTO.setRefusedNum(actUserRelationDao.selectCountUser(actId,ActConstant.ACT_USER_STATUS_REFUSED)); + //取消报名的人数 + actStatisticalDTO.setCanceldNum(actUserRelationDao.selectCountUser(actId,ActConstant.ACT_USER_STATUS_CANCELD)); + //活动已签到人数 + actStatisticalDTO.setSignedInUserNum(actUserRelationDao.selectCountSinedIn(actId)); + //发放积分总人数 + actStatisticalDTO.setRewardUserNum(actUserRelationDao.selectCountByReward(actId,ActConstant.ACT_USER_STATUS_AGREE)); + //拒绝发放积分总人数 + actStatisticalDTO.setDenyRewardUserNum(actUserRelationDao.selectCountByReward(actId,ActConstant.ACT_USER_STATUS_DENY)); + actStatisticalService.save(actStatisticalDTO); + } + + private void saveActOperationRec(String actId) { + ActOperationRecEntity actOperationRecEntity=new ActOperationRecEntity(); + actOperationRecEntity.setActId(actId); + actOperationRecEntity.setType(ActConstant.ACT_OPER_TYPE_FINISH); + actOperationRecEntity.setNoticeUser(false); + actOperationRecEntity.setRemark(StrConstant.EPMETY_STR); + actOperationRecDao.insert(actOperationRecEntity); + } + + private ActInfoDTO checkActInfoDTO(ActInfoDTO actInfoDTO) { + if(!actInfoDTO.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); + } + List list=actUserRelationDao.selectInProgress(actInfoDTO.getId()); + if(null!=list&&list.size()>0){ + throw new RenException(EpmetErrorCode.HAVE_HANDLE.getCode()); + } + if(null==actInfoDTO.getActualStartTime()||null==actInfoDTO.getActualEndTime()){ + throw new RenException(EpmetErrorCode.ACTUAL_TIME.getCode()); + } + return actInfoDTO; + } + + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActPointLogDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActPointLogDao.xml index ec6a181d3b..322fda60fb 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActPointLogDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActPointLogDao.xml @@ -10,7 +10,6 @@ - diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActStatisticalDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActStatisticalDao.xml index 7fd6faa626..4381ff3e2d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActStatisticalDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActStatisticalDao.xml @@ -12,8 +12,6 @@ - - diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml index 507206fa64..7640d4f3c1 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml @@ -228,4 +228,28 @@ AND aur.ACT_ID = #{actId} order by aur.UPDATED_TIME desc + + + + + + From 4a382f7c3c9351b4e1fa42c10f5a131b29cb5c29 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 27 Jul 2020 09:59:45 +0800 Subject: [PATCH 70/98] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E7=9A=84=E4=BA=8B=E4=BB=B6=E7=B1=BB=E5=9E=8B=E6=9E=9A=E4=B8=BE?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/enums/EventEnum.java | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java new file mode 100644 index 0000000000..679307bbf7 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java @@ -0,0 +1,46 @@ +package com.epmet.commons.tools.enums; + +/** + * 系统支持的事件枚举类 + * + * @author jianjun liu + * @date 2020-07-03 11:14 + **/ +public enum EventEnum { + ACTIVE_SEND_POINT("active_send_point", "epmet_heart", "活动发放积分"), + REGISTER_VOLUNTEER("register_volunteer", "epmet_heart", "认证志愿者"), + ; + + private String eventClass; + private String eventCode; + private String eventDesc; + + + EventEnum(String eventCode, String eventClass, String eventDesc) { + this.eventCode = eventCode; + this.eventClass = eventClass; + this.eventDesc = eventDesc; + } + + public static EventEnum getEnum(String code) { + EventEnum[] values = EventEnum.values(); + for (EventEnum value : values) { + if (code != null && value.getEventCode().equals(code)) { + return value; + } + } + return null; + } + + public String getEventCode() { + return eventCode; + } + + public String getEventClass() { + return eventClass; + } + + public String getEventDesc() { + return eventDesc; + } +} From ba3aeb55cb7952ef6339d18964c7de3a48b3e50e Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 27 Jul 2020 10:02:03 +0800 Subject: [PATCH 71/98] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E7=9A=84=E4=BA=8B=E4=BB=B6=E7=B1=BB=E5=9E=8B=E6=9E=9A=E4=B8=BE?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/commons/tools/enums/EventEnum.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java index 679307bbf7..7211406134 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java @@ -22,10 +22,10 @@ public enum EventEnum { this.eventDesc = eventDesc; } - public static EventEnum getEnum(String code) { + public static EventEnum getEnum(String eventCode) { EventEnum[] values = EventEnum.values(); for (EventEnum value : values) { - if (code != null && value.getEventCode().equals(code)) { + if (eventCode != null && value.getEventCode().equals(eventCode)) { return value; } } From f8830603f446a9044885d76855ce93a0f62729b7 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 27 Jul 2020 10:07:08 +0800 Subject: [PATCH 72/98] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E7=9A=84=E4=BA=8B=E4=BB=B6=E7=B1=BB=E5=9E=8B=E6=9E=9A=E4=B8=BE?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/commons/tools/enums/EventEnum.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java index 7211406134..e1fc5cf810 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java @@ -12,12 +12,12 @@ public enum EventEnum { ; private String eventClass; - private String eventCode; + private String eventTag; private String eventDesc; - EventEnum(String eventCode, String eventClass, String eventDesc) { - this.eventCode = eventCode; + EventEnum(String eventTag, String eventClass, String eventDesc) { + this.eventTag = eventTag; this.eventClass = eventClass; this.eventDesc = eventDesc; } @@ -25,15 +25,15 @@ public enum EventEnum { public static EventEnum getEnum(String eventCode) { EventEnum[] values = EventEnum.values(); for (EventEnum value : values) { - if (eventCode != null && value.getEventCode().equals(eventCode)) { + if (eventCode != null && value.getEventTag().equals(eventCode)) { return value; } } return null; } - public String getEventCode() { - return eventCode; + public String getEventTag() { + return eventTag; } public String getEventClass() { From 2dd2c7fd113981b356c4b0314cd04ae756289c83 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 27 Jul 2020 10:24:42 +0800 Subject: [PATCH 73/98] =?UTF-8?q?heart-work:=E7=A7=AF=E5=88=86=E5=8F=91?= =?UTF-8?q?=E6=94=BE=E6=B7=BB=E5=8A=A0=E6=B6=88=E6=81=AF=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/constant/MqConstant.java | 20 ++++++ .../form/mq/eventmsg/ActPointEventMsg.java | 18 +++++ .../work/CanceledActDetailResultDTO.java | 8 +++ .../work/FinishedActDetailResultDTO.java | 7 ++ .../work/InProgressActDetailResultDTO.java | 9 +++ .../epmet/constant/ActMessageConstant.java | 2 + .../service/impl/WorkActServiceImpl.java | 68 ++++++++++++++++++- .../src/main/resources/mapper/ActInfoDao.xml | 9 ++- 8 files changed, 137 insertions(+), 4 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/MqConstant.java create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/ActPointEventMsg.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/MqConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/MqConstant.java new file mode 100644 index 0000000000..8ccaba98b4 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/MqConstant.java @@ -0,0 +1,20 @@ +package com.epmet.commons.tools.constant; + +/** + * 消息常亮 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/27 9:58 + */ +public interface MqConstant { + + /** + * 加分 plus + */ + String PLUS="plus"; + + /** + * 减分标识 minus + */ + String MINUS="minus"; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/ActPointEventMsg.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/ActPointEventMsg.java new file mode 100644 index 0000000000..60db245a07 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/ActPointEventMsg.java @@ -0,0 +1,18 @@ +package com.epmet.commons.tools.dto.form.mq.eventmsg; + +import lombok.Data; + +/** + * 结束活动,发放活动积分消息体 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/27 9:26 + */ +@Data +public class ActPointEventMsg extends BasePointEventMsg{ + /** + * 参与活动的备注 + */ + private String remark; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java index a361a5511e..3239a78ced 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java @@ -1,6 +1,7 @@ package com.epmet.dto.result.work; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -94,6 +95,13 @@ public class CanceledActDetailResultDTO implements Serializable { * 活动详情 */ private List actContent; + /** + * true,我发布的,false,其他人发布的 + */ + private Boolean isMyPublish; + + @JsonIgnore + private String createdBy; @Override public String toString() { diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java index dceee4956d..5e9d4a991d 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java @@ -1,6 +1,7 @@ package com.epmet.dto.result.work; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -105,5 +106,11 @@ public class FinishedActDetailResultDTO implements Serializable { */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date actualEndTime; + /** + * true,我发布的,false,其他人发布的 + */ + private Boolean isMyPublish; + @JsonIgnore + private String createdBy; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java index c1c0ed4515..cc9e66a9bf 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java @@ -1,6 +1,7 @@ package com.epmet.dto.result.work; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -89,4 +90,12 @@ public class InProgressActDetailResultDTO implements Serializable { * 活动详情 */ private List actContent; + + /** + * true,我发布的,false,其他人发布的 + */ + private Boolean isMyPublish; + + @JsonIgnore + private String createdBy; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java index b7bf8cce40..c025257c6f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java @@ -20,4 +20,6 @@ public interface ActMessageConstant { * 活动被取消,给已经通过审核的居民端用户,发送消息 */ String ACT_CANCELED="您报名的活动%s,已取消,原因:%s"; + + String ACT_POINTS_EVENT_REMARK="参与%s"; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java index 3c6407fb1c..98313d7d6c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java @@ -1,8 +1,14 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.MqConstant; import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; +import com.epmet.commons.tools.dto.form.mq.eventmsg.ActPointEventMsg; +import com.epmet.commons.tools.enums.EventEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.scan.param.ImgScanParamDTO; @@ -24,6 +30,7 @@ import com.epmet.dto.result.work.*; import com.epmet.entity.ActContentEntity; import com.epmet.entity.ActInfoEntity; import com.epmet.entity.ActOperationRecEntity; +import com.epmet.entity.ActUserRelationEntity; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.*; @@ -566,6 +573,11 @@ public class WorkActServiceImpl implements WorkActService { CanceledActDetailResultDTO canceledActDetailResultDTO=actInfoDao.selectCanceledActInfo(actId); if(null!=canceledActDetailResultDTO){ canceledActDetailResultDTO.setActContent(actContentDao.selectByActId(actId)); + if(canceledActDetailResultDTO.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ + canceledActDetailResultDTO.setIsMyPublish(true); + }else{ + canceledActDetailResultDTO.setIsMyPublish(false); + } } return canceledActDetailResultDTO; } @@ -604,6 +616,11 @@ public class WorkActServiceImpl implements WorkActService { if (null != resultDTO) { List list = actContentDao.selectByActId(formDTO.getActId()); resultDTO.setActContent(list); + if(resultDTO.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ + resultDTO.setIsMyPublish(true); + }else{ + resultDTO.setIsMyPublish(false); + } } return resultDTO; } @@ -621,6 +638,11 @@ public class WorkActServiceImpl implements WorkActService { if (null != resultDTO) { List list = actContentDao.selectByActId(actId); resultDTO.setActContent(list); + if(resultDTO.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ + resultDTO.setIsMyPublish(true); + }else{ + resultDTO.setIsMyPublish(false); + } } return resultDTO; } @@ -646,7 +668,51 @@ public class WorkActServiceImpl implements WorkActService { this.saveActOperationRec(actId); //生成统计表 this.saveActStatistical(actId); - //发放积分调用事件 TODO + //发放积分调用事件 + if(actInfoDTO.getReward()>0){ + this.grantActPoints(actInfoDTO); + } + } + + private void grantActPoints(ActInfoDTO actInfoDTO) { + //查询已经给分的用户 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(actInfoDTO.getId()), FieldConstant.ID, actInfoDTO.getId()) + .eq("PROCESS_FLAG",ActConstant.HANDLED) + .eq("REWARD_FLAG",ActConstant.ACT_USER_STATUS_AGREE); + List actUserRelationEntityList=actUserRelationDao.selectList(wrapper); + if(null==actUserRelationEntityList||actUserRelationEntityList.size()<1){ + logger.info("不存在给分的记录,无需发送消息时间"); + return; + } + Result userResult=govOrgOpenFeignClient.getAgencyByStaff(loginUserUtil.getLoginUserId()); + if(!userResult.success()||null==userResult.getData()){ + logger.error(String.format("根据staffId查询所属的组织机构失败,staffId=%s",loginUserUtil.getLoginUserId())); + } + String opAgencyId=userResult.getData().getId(); + String remark=String.format(ActMessageConstant.ACT_POINTS_EVENT_REMARK,actInfoDTO.getTitle()); + MqBaseMsgDTO mqBaseMsgDTO=new MqBaseMsgDTO(); + //mq的事件类型 + mqBaseMsgDTO.setEventClass(EventEnum.ACTIVE_SEND_POINT.getEventClass()); + //事件code + mqBaseMsgDTO.setEventTag(EventEnum.ACTIVE_SEND_POINT.getEventTag()); + List actPointEventMsgList=new ArrayList<>(); + for(ActUserRelationEntity actUserRelationEntity:actUserRelationEntityList){ + ActPointEventMsg actPointEventMsg=new ActPointEventMsg(); + actPointEventMsg.setOpAgencyId(opAgencyId); + actPointEventMsg.setCustomerId(actInfoDTO.getCustomerId()); + actPointEventMsg.setUserId(actUserRelationEntity.getUserId()); + actPointEventMsg.setActionFlag(MqConstant.PLUS); + actPointEventMsg.setPoint(actInfoDTO.getReward()); + actPointEventMsg.setIsCommon(true); + actPointEventMsg.setRemark(remark); + actPointEventMsgList.add(actPointEventMsg); + } + mqBaseMsgDTO.setMsg(JSON.toJSONString(actPointEventMsgList)); + Result result=SendMqMsgUtils.sendMsg(mqBaseMsgDTO); + if(!result.success()){ + logger.error("活动积分发放失败"); + } } private void updateHeartUserInfo(ActInfoDTO actInfoDTO) { diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml index 644e5864f4..4d54cbd05e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml @@ -597,7 +597,8 @@ ai.SPONSOR_NAME AS sponsorName, ai.REQUIREMENT AS requirement, ai.CANCEL_TIME AS cancelTime, - ai.CANCEL_REASON AS cancelReason + ai.CANCEL_REASON AS cancelReason, + ai.CREATED_BY as createdBy FROM act_info ai WHERE @@ -625,7 +626,8 @@ ai.REQUIREMENT AS requirement, AI.SUMMARY_FLAG AS summaryFlag, AI.ACTUAL_START_TIME AS actualStartTime, - AI.ACTUAL_END_TIME AS actualEndTime + AI.ACTUAL_END_TIME AS actualEndTime, + ai.CREATED_BY as createdBy FROM act_info ai WHERE @@ -649,7 +651,8 @@ ai.SPONSOR_TEL AS sponsorTel, ai.REWARD AS reward, ai.SPONSOR_NAME AS sponsorName, - ai.REQUIREMENT AS requirement + ai.REQUIREMENT AS requirement, + ai.CREATED_BY as createdBy FROM act_info ai WHERE From c219e036f9f4770b2348114b0905ce2af3ad3470 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 27 Jul 2020 10:26:31 +0800 Subject: [PATCH 74/98] =?UTF-8?q?heart-work:=E7=A7=AF=E5=88=86=E5=8F=91?= =?UTF-8?q?=E6=94=BE=E6=B7=BB=E5=8A=A0=E6=B6=88=E6=81=AF=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?remark?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/WorkActServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java index 98313d7d6c..33e5c1f463 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java @@ -685,11 +685,13 @@ public class WorkActServiceImpl implements WorkActService { logger.info("不存在给分的记录,无需发送消息时间"); return; } + //查询当前用户所属组织信息 Result userResult=govOrgOpenFeignClient.getAgencyByStaff(loginUserUtil.getLoginUserId()); if(!userResult.success()||null==userResult.getData()){ logger.error(String.format("根据staffId查询所属的组织机构失败,staffId=%s",loginUserUtil.getLoginUserId())); } String opAgencyId=userResult.getData().getId(); + //备注 String remark=String.format(ActMessageConstant.ACT_POINTS_EVENT_REMARK,actInfoDTO.getTitle()); MqBaseMsgDTO mqBaseMsgDTO=new MqBaseMsgDTO(); //mq的事件类型 From 96c85b64584cd08ff42ab93395249e2721456fd4 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 27 Jul 2020 11:05:20 +0800 Subject: [PATCH 75/98] =?UTF-8?q?heart-work:=E4=BF=9D=E5=AD=98=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=9B=9E=E9=A1=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/exception/EpmetErrorCode.java | 2 +- .../dto/form/work/SummaryActFormDTO.java | 33 ++++++++++ .../epmet/controller/WorkActController.java | 17 +++++ .../com/epmet/service/WorkActService.java | 9 +++ .../service/impl/WorkActServiceImpl.java | 63 +++++++++++++++++-- 5 files changed, 118 insertions(+), 6 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SummaryActFormDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index be9c66519e..7ec8b301fd 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -60,7 +60,7 @@ public enum EpmetErrorCode { ACT_ACTUAL_START_TIME_ERROR(8122,"实际开始时间应早于实际结束时间"), HAVE_HANDLE(8123,"存在待处理事项,请先处理"), ACTUAL_TIME(8124,"请录入实际开始时间,实际结束时间"), - + ACTUAL_NOT_FINISHED(8125,"请先结束活动"), CANNOT_AUDIT_WARM(8201, "请完善居民信息"), NOT_DEL_AGENCY(8202, "该机关存在下级机关,不允许删除"), diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SummaryActFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SummaryActFormDTO.java new file mode 100644 index 0000000000..bd5f3a2655 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SummaryActFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.form.work; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import java.io.Serializable; +import java.util.List; + +/** + * 保存添加回顾入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/27 10:33 + */ +@Data +public class SummaryActFormDTO implements Serializable { + private static final long serialVersionUID = -3610355661618180808L; + public interface AddUserInternalGroup {} + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + /** + * 活动id + */ + @NotBlank(message = "活动id不能为空", groups = {AddUserInternalGroup.class }) + private String actId; + + @Valid + @Size(min=1,message = "活动详情不能为空",groups = {AddUserShowGroup.class}) + private List actContent; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java index dda4fe56b0..4dcdc3a5c1 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java @@ -190,4 +190,21 @@ public class WorkActController { workActService.finishAct(formDTO.getActId()); return new Result(); } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 保存添加回顾 + * @Date 2020/7/27 10:45 + **/ + @PostMapping("summaryact") + public Result summaryAct(@RequestBody SummaryActFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, SummaryActFormDTO.AddUserInternalGroup.class); + if(null!=formDTO.getActContent()&&formDTO.getActContent().size()>0){ + ValidatorUtils.validateEntity(formDTO.getActContent(), SummaryActFormDTO.AddUserShowGroup.class); + } + workActService.summaryAct(formDTO); + return new Result(); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java index c00fab9abe..c2440d3206 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java @@ -119,4 +119,13 @@ public interface WorkActService { * @Date 2020/7/26 21:48 **/ void finishAct(String actId); + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 保存添加回顾 + * @Date 2020/7/27 10:45 + **/ + void summaryAct(SummaryActFormDTO formDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java index 33e5c1f463..dcc8bb902f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java @@ -27,10 +27,7 @@ import com.epmet.dto.form.UserMessageFormDTO; import com.epmet.dto.form.work.*; import com.epmet.dto.result.ActSponsorResultDTO; import com.epmet.dto.result.work.*; -import com.epmet.entity.ActContentEntity; -import com.epmet.entity.ActInfoEntity; -import com.epmet.entity.ActOperationRecEntity; -import com.epmet.entity.ActUserRelationEntity; +import com.epmet.entity.*; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.*; @@ -90,6 +87,8 @@ public class WorkActServiceImpl implements WorkActService { private HeartUserInfoDao heartUserInfoDao; @Autowired private HeartUserInfoService heartUserInfoService; + @Autowired + private ActSummaryDao actSummaryDao; /** * @return void @@ -657,6 +656,10 @@ public class WorkActServiceImpl implements WorkActService { @Override public void finishAct(String actId) { ActInfoDTO actInfoDTO=actInfoService.get(actId); + if(null==actInfoDTO){ + logger.error("act_info is null"); + return; + } //校验是否可以结束 this.checkActInfoDTO(actInfoDTO); //act_info表改为已完成 @@ -773,18 +776,68 @@ public class WorkActServiceImpl implements WorkActService { } private ActInfoDTO checkActInfoDTO(ActInfoDTO actInfoDTO) { + //只有我发布的活动,我可以就结束 if(!actInfoDTO.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); } + //待处理事项为空时才可以结束活动 List list=actUserRelationDao.selectInProgress(actInfoDTO.getId()); if(null!=list&&list.size()>0){ throw new RenException(EpmetErrorCode.HAVE_HANDLE.getCode()); } + //先填写实际开始时间、实际结束时间 if(null==actInfoDTO.getActualStartTime()||null==actInfoDTO.getActualEndTime()){ throw new RenException(EpmetErrorCode.ACTUAL_TIME.getCode()); } return actInfoDTO; } - + /** + * @param formDTO + * @return void + * @author yinzuomei + * @description 保存添加回顾 + * @Date 2020/7/27 10:45 + **/ + @Override + public void summaryAct(SummaryActFormDTO formDTO) { + ActInfoDTO actInfoDTO=actInfoService.get(formDTO.getActId()); + if(null==actInfoDTO){ + logger.info("act_info is null"); + return; + } + if(!actInfoDTO.getActStatus().equals(ActConstant.ACT_STATUS_FINISHED)){ + //先结束活动,才能添加回顾 + throw new RenException(EpmetErrorCode.ACTUAL_NOT_FINISHED.getCode()); + } + if(!actInfoDTO.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ + //只有我发布的活动,才可以添加回顾 + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); + } + //审核 + List textList=new ArrayList<>(); + List imgList=new ArrayList<>(); + for(PublishActContentFormDTO actContent:formDTO.getActContent()){ + if(ActConstant.ACT_CONTENT_TYPE_TEXT.equals(actContent.getContentType())){ + textList.add(actContent.getContent()); + }else if(ActConstant.ACT_CONTENT_TYPE_IMG.equals(actContent.getContentType())){ + imgList.add(actContent.getContent()); + } + } + this.auditActContent(textList,imgList); + //插入act_summary记录 + int orderNum=1; + for(PublishActContentFormDTO actContentFormDTO:formDTO.getActContent()){ + ActSummaryEntity actSummaryEntity=new ActSummaryEntity(); + actSummaryEntity.setActId(formDTO.getActId()); + actSummaryEntity.setContent(actContentFormDTO.getContent()); + actSummaryEntity.setContentType(actContentFormDTO.getContentType()); + actSummaryEntity.setOrderNum(orderNum); + actSummaryDao.insert(actSummaryEntity); + orderNum++; + } + //更新act_info表的SUMMARY_FLAG=true + actInfoDTO.setSummaryFlag(true); + actInfoService.update(actInfoDTO); + } } From 2523e7ffb36b335d438738fd10a7dc216f668ca7 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Mon, 27 Jul 2020 13:38:01 +0800 Subject: [PATCH 76/98] =?UTF-8?q?=E7=88=B1=E5=BF=83=E4=BA=92=E5=8A=A9-?= =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=AB=AF-=E5=A2=9E=E5=8A=A0=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E5=8F=91=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/enums/EventEnum.java | 1 + .../form/resi/ResiActInsertLiveFormDTO.java | 6 +++ .../dto/form/resi/ResiActSignInFormDTO.java | 6 +++ .../epmet/constant/ActMessageConstant.java | 10 +++++ .../service/impl/ActLiveRecServiceImpl.java | 36 ++++++++++++++++ .../impl/ActUserRelationServiceImpl.java | 2 +- .../impl/VolunteerInfoServiceImpl.java | 43 ++++++++++++++++++- .../com/epmet/utils/ValidityVerification.java | 2 +- .../src/main/resources/mapper/ActInfoDao.xml | 17 +++++--- 9 files changed, 112 insertions(+), 11 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java index e1fc5cf810..68347c29f9 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java @@ -9,6 +9,7 @@ package com.epmet.commons.tools.enums; public enum EventEnum { ACTIVE_SEND_POINT("active_send_point", "epmet_heart", "活动发放积分"), REGISTER_VOLUNTEER("register_volunteer", "epmet_heart", "认证志愿者"), + ACTIVE_INSERT_LIVE("active_insert_live", "epmet_heart", "添加活动实况"), ; private String eventClass; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActInsertLiveFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActInsertLiveFormDTO.java index 42ee3576fe..54182f0da3 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActInsertLiveFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActInsertLiveFormDTO.java @@ -95,4 +95,10 @@ public class ResiActInsertLiveFormDTO implements Serializable { * id */ private String id; + + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空", groups = {AddUserShowGroup.class }) + private String customerId; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActSignInFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActSignInFormDTO.java index 54363137f7..69c1486c7f 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActSignInFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActSignInFormDTO.java @@ -96,4 +96,10 @@ public class ResiActSignInFormDTO implements Serializable { * 用户id */ private String userId; + + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空", groups = {AddUserShowGroup.class }) + private String customerId; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java index c025257c6f..ac8ba13bfc 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java @@ -22,4 +22,14 @@ public interface ActMessageConstant { String ACT_CANCELED="您报名的活动%s,已取消,原因:%s"; String ACT_POINTS_EVENT_REMARK="参与%s"; + + /** + * 居民端-用户认证志愿者,发送消息 + */ + String POINTS_EVENT_VOLUNTEER_AUTHENTICATE="用户%s,认证志愿者"; + + /** + * 居民端-添加实况,发送消息 + */ + String ACT_POINTS_EVENT_VOLUNTEER_LIVE="用户%s,添加活动实况,活动:%s"; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java index 45e15e53e6..1eb66ab5f8 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java @@ -17,10 +17,17 @@ package com.epmet.service.impl; +import com.alibaba.fastjson.JSON; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.MqConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; +import com.epmet.commons.tools.dto.form.mq.eventmsg.ActPointEventMsg; +import com.epmet.commons.tools.enums.EventEnum; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.SendMqMsgUtils; +import com.epmet.constant.ActMessageConstant; import com.epmet.dao.ActLivePicDao; import com.epmet.dao.ActLiveRecDao; import com.epmet.dto.ActLivePicDTO; @@ -34,6 +41,8 @@ import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.redis.ActLiveRecRedis; import com.epmet.service.ActLiveRecService; import com.epmet.utils.ValidityVerification; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -48,6 +57,7 @@ import java.util.*; */ @Service public class ActLiveRecServiceImpl extends BaseServiceImpl implements ActLiveRecService { + private Logger logger = LogManager.getLogger(VolunteerInfoServiceImpl.class); @Autowired private ActLiveRecRedis actLiveRecRedis; @@ -121,6 +131,32 @@ public class ActLiveRecServiceImpl extends BaseServiceImpl().ok(uuid); } + + private void grantActPoints(ResiActInsertLiveFormDTO formDTO){ + //备注 + String remark=String.format(ActMessageConstant.ACT_POINTS_EVENT_VOLUNTEER_LIVE,formDTO.getUserId(),formDTO.getActId()); + MqBaseMsgDTO mqBaseMsgDTO=new MqBaseMsgDTO(); + //mq的事件类型 + mqBaseMsgDTO.setEventClass(EventEnum.ACTIVE_INSERT_LIVE.getEventClass()); + //事件code + mqBaseMsgDTO.setEventTag(EventEnum.ACTIVE_INSERT_LIVE.getEventTag()); + List actPointEventMsgList=new ArrayList<>(); + ActPointEventMsg actPointEventMsg=new ActPointEventMsg(); + actPointEventMsg.setCustomerId(formDTO.getCustomerId()); + actPointEventMsg.setUserId(formDTO.getUserId()); + actPointEventMsg.setActionFlag(MqConstant.PLUS); + actPointEventMsg.setIsCommon(false); + actPointEventMsg.setRemark(remark); + actPointEventMsgList.add(actPointEventMsg); + + mqBaseMsgDTO.setMsg(JSON.toJSONString(actPointEventMsgList)); + Result result= SendMqMsgUtils.sendMsg(mqBaseMsgDTO); + if(!result.success()){ + logger.error("添加活动实况,事件发送失败"); + } + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java index 53bc8a11f0..dbdb98eee5 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java @@ -202,7 +202,7 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl0 当前用户是志愿者 - Integer volunteerFlag = volunteerInfoDao.queryVolunteerFlagByUserId(formDTO.getActId()); + Integer volunteerFlag = volunteerInfoDao.queryVolunteerFlagByUserId(formDTO.getUserId()); if (actInfoDTO.getVolunteerLimit()){ // 活动只能志愿者参加, 当前用户是否满足条件 satisfy = this.volunteerParticipationAct(volunteerFlag); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java index 3429acbb2f..182da8e261 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java @@ -17,24 +17,37 @@ package com.epmet.service.impl; +import com.alibaba.fastjson.JSON; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.MqConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; +import com.epmet.commons.tools.dto.form.mq.eventmsg.ActPointEventMsg; +import com.epmet.commons.tools.enums.EventEnum; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.SendMqMsgUtils; +import com.epmet.constant.ActMessageConstant; import com.epmet.dao.VolunteerInfoDao; import com.epmet.dto.HeartUserInfoDTO; import com.epmet.dto.form.WxUserInfoFormDTO; import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; +import com.epmet.entity.ActUserRelationEntity; import com.epmet.entity.VolunteerInfoEntity; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.redis.VolunteerInfoRedis; import com.epmet.service.HeartUserInfoService; import com.epmet.service.VolunteerInfoService; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; 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.List; + /** * 志愿者信息 * @@ -43,6 +56,7 @@ import org.springframework.transaction.annotation.Transactional; */ @Service public class VolunteerInfoServiceImpl extends BaseServiceImpl implements VolunteerInfoService { + private Logger logger = LogManager.getLogger(VolunteerInfoServiceImpl.class); @Autowired private VolunteerInfoRedis volunteerInfoRedis; @@ -66,17 +80,42 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl actPointEventMsgList=new ArrayList<>(); + ActPointEventMsg actPointEventMsg=new ActPointEventMsg(); + actPointEventMsg.setCustomerId(formDTO.getCustomerId()); + actPointEventMsg.setUserId(formDTO.getUserId()); + actPointEventMsg.setActionFlag(MqConstant.PLUS); + actPointEventMsg.setIsCommon(false); + actPointEventMsg.setRemark(remark); + actPointEventMsgList.add(actPointEventMsg); + + mqBaseMsgDTO.setMsg(JSON.toJSONString(actPointEventMsgList)); + Result result= SendMqMsgUtils.sendMsg(mqBaseMsgDTO); + if(!result.success()){ + logger.error("志愿者认证事件发送失败"); + } + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ValidityVerification.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ValidityVerification.java index 48deaa99b9..4bb60ab49f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ValidityVerification.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ValidityVerification.java @@ -71,7 +71,7 @@ public class ValidityVerification { * @Date 14:42 2020-07-15 **/ public void imgScanVerification(List imgList, String businessEnum){ - if (NumConstant.ZERO != imgList.size()){ + if (null != imgList && NumConstant.ZERO != imgList.size()){ ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO(); imgList.forEach(url -> { ImgTaskDTO task = new ImgTaskDTO(); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml index 4d54cbd05e..784972957b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml @@ -66,9 +66,10 @@ IF(u.USER_ID = #{userId},'signed_up','no_signed_up') as signupFlag FROM act_info i LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' - LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID + LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND (re.`STATUS` = 'auditing' OR re.`STATUS` = 'passed') GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID WHERE i.DEL_FLAG = '0' AND i.ACT_STATUS = 'published' + AND = ]]> NOW() -- 报名截止时间 >= 当前时间 AND (i.ACT_QUOTA_CATEGORY = 0 OR i.ACT_QUOTA > IFNULL(c.signupNum, 0)) -- 不限名额或者报名人数未报满 AND i.CUSTOMER_ID = #{customerId} ORDER BY i.ACT_QUOTA_CATEGORY DESC,i.CREATED_TIME DESC @@ -91,9 +92,10 @@ IF(u.USER_ID = #{userId},'signed_up','no_signed_up') as signupFlag FROM act_info i LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' - LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID + LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND (re.`STATUS` = 'auditing' OR re.`STATUS` = 'passed') GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID WHERE i.DEL_FLAG = '0' AND i.ACT_STATUS = 'published' + AND = ]]> NOW() -- 报名截止时间 >= 当前时间 AND i.ACT_QUOTA_CATEGORY = 1 -- 固定名额 AND i.ACT_QUOTA = IFNULL(c.signupNum, 0) -- 名额已满 AND i.CUSTOMER_ID = #{customerId} @@ -117,7 +119,7 @@ IF(u.USER_ID = #{userId},'signed_up','no_signed_up') as signupFlag FROM act_info i LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' - LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID + LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND (re.`STATUS` = 'auditing' OR re.`STATUS` = 'passed') GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID WHERE i.DEL_FLAG = '0' -- 活动开始时间 > 当前时间 并且 报名截止时间 < 当前时间 报名已结束,活动未开始 未开始 AND ( ]]> NOW() AND NOW() ) @@ -143,10 +145,10 @@ IF(u.USER_ID = #{userId},'1','0') as signupFlag -- 用户报名状态(0-未报名,1已报名) FROM act_info i LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' - LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID + LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` = 'passed' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID WHERE i.DEL_FLAG = '0' -- 活动开始时间 <= 当前时间 并且活动结束时间 >= 当前时间 进行中 - AND ( NOW() AND = ]]> NOW() ) + AND ( NOW() AND = ]]> NOW() ) AND i.ACT_STATUS != 'canceled' AND i.CUSTOMER_ID = #{customerId} ORDER BY i.CREATED_TIME DESC @@ -169,9 +171,10 @@ IF(u.USER_ID = #{userId},'1','0') as signupFlag -- 用户报名状态(0-未报名,1已报名) FROM act_info i LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' - LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID + LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` = 'passed' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID WHERE i.DEL_FLAG = '0' - AND i.ACT_STATUS = 'finished' + AND i.ACT_STATUS != 'canceled' + AND NOW() AND i.CUSTOMER_ID = #{customerId} ORDER BY i.CREATED_TIME DESC LIMIT #{pageNo}, #{pageSize} From 77690bca12070083f2e7740a5234303818b59f58 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 27 Jul 2020 13:43:27 +0800 Subject: [PATCH 77/98] =?UTF-8?q?heart-work:=E9=87=8D=E6=96=B0=E7=BC=96?= =?UTF-8?q?=E8=BE=91-=E8=8E=B7=E5=8F=96=E6=B4=BB=E5=8A=A8=E8=AF=A6?= =?UTF-8?q?=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/work/ReEditActInfoResultDTO.java | 151 ++++++++++++++++++ .../epmet/controller/WorkActController.java | 13 ++ .../com/epmet/service/WorkActService.java | 9 ++ .../service/impl/WorkActServiceImpl.java | 24 +++ 4 files changed, 197 insertions(+) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java new file mode 100644 index 0000000000..a0191a6f3a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java @@ -0,0 +1,151 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * 重新编辑-获取活动详情 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/27 11:14 + */ +@Data +public class ReEditActInfoResultDTO implements Serializable { + private static final long serialVersionUID = 512857031034752008L; + + /** + * 活动id + */ + private String actId; + + /** + * 活动标题 + */ + private String title; + + /** + * 封面图地址 + */ + private String coverPic; + + /** + * 活动地址 + */ + private String actAddress; + + /** + * 活动地址-经度 + */ + private BigDecimal actLongitude; + + /** + *活动地址-维度 + */ + private BigDecimal actLatitude; + /** + * 活动预计开始时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actStartTime; + + /** + * 活动预计结束时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actEndTime; + + /** + * 活动人数 + */ + private Integer actQuota; + /** + * 活动积分 + */ + private Integer reward; + /** + * 身份限制:1只有志愿者才可以参加活动0不限制志愿者身份 + */ + private Boolean volunteerLimit; + + /** + * 审核开关:1报名人员需要人工审核0不需要 + */ + private Boolean auditSwitch; + + /** + * 报名截止时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date signUpEndTime; + /** + * 报名条件 + */ + private String requirement; + + /** + * 打卡开始时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date signInStartTime; + + /** + * 打卡签到截止时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date signInEndTime; + + /** + * 活动签到打卡地点 + */ + private String signInAddress; + + /** + * 活动签到打卡位置经度 + */ + private BigDecimal signinLongitude; + + /** + * 活动签到打卡位置纬度 + */ + private BigDecimal signInLatitude; + + /** + * 活动签到打卡半径(单位:米) + */ + private Integer signInRadius; + + /** + * 主办方id(机关或网格的id) + */ + private String sponsorId; + + /** + * 活动主办方名称(机关或网格的名称) + */ + private String sponsorName; + + /** + * 联系人 + */ + private String sponsorContacts; + + /** + * 联系电话 + */ + private String sponsorTel; + + /** + * 发布名义:网格主办:grid;组织主办:agency + */ + private String sponsorType; + + /** + * 活动详情 + */ + private List actContent; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java index 4dcdc3a5c1..d1dc5ee508 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java @@ -207,4 +207,17 @@ public class WorkActController { workActService.summaryAct(formDTO); return new Result(); } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 重新编辑-获取活动详情 + * @Date 2020/7/27 13:36 + **/ + @PostMapping("getactinfo") + public Result getActInfo(@RequestBody ActIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); + return new Result().ok(workActService.getActInfo(formDTO.getActId())); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java index c2440d3206..b1cb90e829 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java @@ -128,4 +128,13 @@ public interface WorkActService { * @Date 2020/7/27 10:45 **/ void summaryAct(SummaryActFormDTO formDTO); + + /** + * @return com.epmet.dto.result.work.ReEditActInfoResultDTO + * @param actId + * @author yinzuomei + * @description 重新编辑-获取活动详情 + * @Date 2020/7/27 13:36 + **/ + ReEditActInfoResultDTO getActInfo(String actId); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java index dcc8bb902f..2d16b608c2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java @@ -840,4 +840,28 @@ public class WorkActServiceImpl implements WorkActService { actInfoDTO.setSummaryFlag(true); actInfoService.update(actInfoDTO); } + + /** + * @param actId + * @return com.epmet.dto.result.work.ReEditActInfoResultDTO + * @author yinzuomei + * @description 重新编辑-获取活动详情 + * @Date 2020/7/27 13:36 + **/ + @Override + public ReEditActInfoResultDTO getActInfo(String actId) { + ActInfoDTO actInfoDTO=actInfoService.get(actId); + if(null==actInfoDTO){ + logger.error("act_info is null"); + return null; + } + if(!actInfoDTO.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); + } + ReEditActInfoResultDTO resultDTO= ConvertUtils.sourceToTarget(actInfoDTO, ReEditActInfoResultDTO.class); + resultDTO.setActId(actId); + List actContent=actContentDao.selectByActId(actId); + resultDTO.setActContent(actContent); + return resultDTO; + } } From 17e32575db02c6717e4cb012e87781b158cb9ae2 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 27 Jul 2020 14:55:27 +0800 Subject: [PATCH 78/98] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-auth/pom.xml | 6 ++ .../com/epmet/dto/form/GovWxmpFormDTO.java | 4 + .../epmet/dto/form/LoginByWxCodeFormDTO.java | 2 + .../epmet/dto/form/ResiWxPhoneFormDTO.java | 2 + .../epmet/redis/CustomerAppWxServiceUtil.java | 98 +++++++++++++++++++ .../java/com/epmet/service/LoginService.java | 3 +- .../service/impl/GovLoginServiceImpl.java | 2 +- .../epmet/service/impl/LoginServiceImpl.java | 30 ++++-- .../epmet/commons/tools/redis/RedisKeys.java | 9 ++ .../java/com/epmet/dto/CustomerAppDTO.java | 97 ++++++++++++++++++ .../dto/form/CustomerAppSecretFormDTO.java | 42 ++++++++ .../epmet/feign/OperCrmOpenFeignClient.java | 24 ++++- .../OperCrmOpenFeignClientFallback.java | 20 ++++ .../controller/CustomerAppController.java | 88 +++++++++++++++++ .../java/com/epmet/dao/CustomerAppDao.java | 35 +++++++ .../com/epmet/entity/CustomerAppEntity.java | 63 ++++++++++++ .../epmet/service/CustomerAppIdService.java | 92 +++++++++++++++++ .../impl/CustomerAppIdServiceImpl.java | 96 ++++++++++++++++++ .../src/main/resources/CustomerAppDao.xml | 25 +++++ 19 files changed, 724 insertions(+), 14 deletions(-) create mode 100644 epmet-auth/src/main/java/com/epmet/redis/CustomerAppWxServiceUtil.java create mode 100644 epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerAppDTO.java create mode 100644 epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/CustomerAppSecretFormDTO.java create mode 100644 epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerAppController.java create mode 100644 epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerAppDao.java create mode 100644 epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerAppEntity.java create mode 100644 epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerAppIdService.java create mode 100644 epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerAppIdServiceImpl.java create mode 100644 epmet-module/oper-crm/oper-crm-server/src/main/resources/CustomerAppDao.xml diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index d96a621883..838cf9a1bd 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -122,6 +122,12 @@ 2.0.0 compile + + com.epmet + oper-crm-client + 2.0.0 + compile + diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpFormDTO.java index 8bab423dec..55abfd3bce 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpFormDTO.java @@ -19,5 +19,9 @@ public class GovWxmpFormDTO extends LoginCommonFormDTO implements Serializable { */ @NotBlank(message = "wxCode不能为空",groups = {AddUserInternalGroup.class}) private String wxCode; + /** + * appId + */ + private String appId; } diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/LoginByWxCodeFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/LoginByWxCodeFormDTO.java index 8ddfe9edff..3f59baf4d7 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/form/LoginByWxCodeFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/LoginByWxCodeFormDTO.java @@ -29,4 +29,6 @@ public class LoginByWxCodeFormDTO extends LoginCommonFormDTO implements Serializ * 加密算法的初始向量 */ private String iv; + + private String appId; } diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/ResiWxPhoneFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/ResiWxPhoneFormDTO.java index f0148b3c14..f710be379e 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/form/ResiWxPhoneFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/ResiWxPhoneFormDTO.java @@ -32,4 +32,6 @@ public class ResiWxPhoneFormDTO implements Serializable { */ @NotBlank(message = "iv不能为空",groups = {AddUserInternalGroup.class}) private String iv; + + private String appId; } diff --git a/epmet-auth/src/main/java/com/epmet/redis/CustomerAppWxServiceUtil.java b/epmet-auth/src/main/java/com/epmet/redis/CustomerAppWxServiceUtil.java new file mode 100644 index 0000000000..a9f5f4901a --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/redis/CustomerAppWxServiceUtil.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

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

+ * 版权所有,侵权必究! + */ + +package com.epmet.redis; + +import cn.binarywang.wx.miniapp.api.WxMaService; +import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl; +import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl; +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerAppDTO; +import com.epmet.dto.form.CustomerAppSecretFormDTO; +import com.epmet.feign.OperCrmOpenFeignClient; +import com.google.common.collect.Maps; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; + +import javax.annotation.PostConstruct; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 客户app Redis + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Component +public class CustomerAppWxServiceUtil { + private Logger logger = LogManager.getLogger(CustomerAppWxServiceUtil.class); + + /** + * 过期时长为30分钟,单位:秒 + */ + private final static long MINUTE_THIRTY_EXPIRE = 60 * 60 * 24 * 7L; + private final static String JSON_STR = "JSON"; + + @Autowired + private RedisUtils redisUtils; + @Autowired + private OperCrmOpenFeignClient operCrmOpenFeignClient; + + private static Map maServices = Maps.newHashMap(); + @PostConstruct + private void initWxMa() { + Result> configAllAppResult = operCrmOpenFeignClient.getConfigAllApp(); + if (configAllAppResult != null && configAllAppResult.success() && CollectionUtils.isEmpty(configAllAppResult.getData())) { + maServices = configAllAppResult.getData().stream() + .map(a -> { + WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl(); + config.setAppid(a.getAppId()); + config.setSecret(a.getSecret()); + config.setMsgDataFormat(JSON_STR); + + WxMaService service = new WxMaServiceImpl(); + service.setWxMaConfig(config); + return service; + }).collect(Collectors.toMap(s -> s.getWxMaConfig().getAppid(), a -> a)); + } + logger.info("initWxMa success:{}", JSON.toJSONString(maServices)); + } + public WxMaService getWxMaService(String appId) { + WxMaService wxMaService = maServices.get(appId); + if (wxMaService == null){ + logger.error("getMaService appId:{} is not config from customer_app",appId); + } + return wxMaService; + } + public String get(String appId) { + String key = RedisKeys.getAppSecretKey(appId); + String secret = (String) redisUtils.get(key); + if (StringUtils.isBlank(secret)) { + CustomerAppSecretFormDTO param = new CustomerAppSecretFormDTO(); + param.setAppId(appId); + Result result = operCrmOpenFeignClient.getSecretByAppId(param); + if (result.success()) { + secret = result.getData(); + if (StringUtils.isNotBlank(secret)) { + redisUtils.set(key, secret, MINUTE_THIRTY_EXPIRE); + } + } + } + return secret; + } + +} diff --git a/epmet-auth/src/main/java/com/epmet/service/LoginService.java b/epmet-auth/src/main/java/com/epmet/service/LoginService.java index 248e7c4d97..a0e429eff9 100644 --- a/epmet-auth/src/main/java/com/epmet/service/LoginService.java +++ b/epmet-auth/src/main/java/com/epmet/service/LoginService.java @@ -45,11 +45,12 @@ public interface LoginService { * @return cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult * @param app * @param wxCode + * @param appId 非必填 * @Author yinzuomei * @Description 解析wxCode * @Date 2020/4/19 0:24 **/ - WxMaJscode2SessionResult getWxMaUser(String app, String wxCode); + WxMaJscode2SessionResult getWxMaUser(String app, String wxCode, String appId); /** * @return java.lang.String diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java index 406ae0fe6f..6e6c16f6bb 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java @@ -141,7 +141,7 @@ public class GovLoginServiceImpl implements GovLoginService { @Override public UserTokenResultDTO loginByWxCode(GovWxmpFormDTO formDTO) { //1、解析微信用户 - WxMaJscode2SessionResult wxMaJscode2SessionResult = loginService.getWxMaUser(formDTO.getApp(), formDTO.getWxCode()); + WxMaJscode2SessionResult wxMaJscode2SessionResult = loginService.getWxMaUser(formDTO.getApp(), formDTO.getWxCode(), formDTO.getAppId()); if(null!=wxMaJscode2SessionResult){ logger.info(String.format("app=%s,wxCode=%s,openId=%s",formDTO.getApp(),formDTO.getWxCode(),wxMaJscode2SessionResult.getOpenid())); } diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java index 695c187105..89fbdbebb0 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java @@ -22,6 +22,7 @@ import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.OperAccessOpenFeignClient; import com.epmet.jwt.JwtTokenProperties; import com.epmet.jwt.JwtTokenUtils; +import com.epmet.redis.CustomerAppWxServiceUtil; import com.epmet.service.CaptchaService; import com.epmet.service.LoginService; import com.epmet.utils.WxMaServiceUtils; @@ -66,6 +67,8 @@ public class LoginServiceImpl implements LoginService { @Autowired private OperAccessOpenFeignClient operAccessOpenFeignClient; + @Autowired + private CustomerAppWxServiceUtil customerAppWxServiceUtil; /** * 居民端微信小程序登录 @@ -82,7 +85,7 @@ public class LoginServiceImpl implements LoginService { throw new RenException("参数错误"); } //1、根据wxCode获取微信信息 - WxMaJscode2SessionResult wxMaJscode2SessionResult = this.getWxMaUser(formDTO.getApp(),formDTO.getWxCode()); + WxMaJscode2SessionResult wxMaJscode2SessionResult = this.getWxMaUser(formDTO.getApp(),formDTO.getWxCode(),formDTO.getAppId()); logger.info("openId=[" + wxMaJscode2SessionResult.getOpenid() + "]unionId=[" + wxMaJscode2SessionResult.getUnionid() + "]"); //2、根据openId查询数据库,没有则直接插入一条记录 String userId = this.getUserId(formDTO, wxMaJscode2SessionResult); @@ -109,15 +112,19 @@ public class LoginServiceImpl implements LoginService { * @date 2020/3/14 20:16 */ @Override - public WxMaJscode2SessionResult getWxMaUser(String app,String wxCode) { + public WxMaJscode2SessionResult getWxMaUser(String app,String wxCode,String appId) { WxMaJscode2SessionResult wxMaJscode2SessionResult = null; try { - if (LoginConstant.APP_GOV.equals(app)) { - wxMaJscode2SessionResult = wxMaServiceUtils.govWxMaService().jsCode2SessionInfo(wxCode); - } else if (LoginConstant.APP_OPER.equals(app)) { - wxMaJscode2SessionResult = wxMaServiceUtils.operWxMaService().jsCode2SessionInfo(wxCode); - } else if (LoginConstant.APP_RESI.equals(app)) { - wxMaJscode2SessionResult = wxMaServiceUtils.resiWxMaService().jsCode2SessionInfo(wxCode); + if (StringUtils.isNotBlank(appId)){ + wxMaJscode2SessionResult = customerAppWxServiceUtil.getWxMaService(appId).jsCode2SessionInfo(wxCode); + }else{ + if (LoginConstant.APP_GOV.equals(app)) { + wxMaJscode2SessionResult = wxMaServiceUtils.govWxMaService().jsCode2SessionInfo(wxCode); + } else if (LoginConstant.APP_OPER.equals(app)) { + wxMaJscode2SessionResult = wxMaServiceUtils.operWxMaService().jsCode2SessionInfo(wxCode); + } else if (LoginConstant.APP_RESI.equals(app)) { + wxMaJscode2SessionResult = wxMaServiceUtils.resiWxMaService().jsCode2SessionInfo(wxCode); + } } } catch (WxErrorException e) { log.error("->[getMaOpenId]::error[{}]", "解析微信code失败"); @@ -137,7 +144,12 @@ public class LoginServiceImpl implements LoginService { String phone=""; try { ValidatorUtils.validateEntity(formDTO, ResiWxPhoneFormDTO.AddUserInternalGroup.class); - WxMaService wxMaService = wxMaServiceUtils.resiWxMaService(); + WxMaService wxMaService = null; + if (StringUtils.isNotBlank(formDTO.getAppId())){ + wxMaService = customerAppWxServiceUtil.getWxMaService(formDTO.getAppId()); + }else{ + wxMaService = wxMaServiceUtils.resiWxMaService(); + } WxMaJscode2SessionResult wxMaJscode2SessionResult = wxMaService.jsCode2SessionInfo(formDTO.getWxCode()); WxMaPhoneNumberInfo phoneNoInfo = wxMaService.getUserService().getPhoneNoInfo(wxMaJscode2SessionResult.getSessionKey(), formDTO.getEncryptedData(), diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index dcf93d3a24..fc0dc2fe49 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -254,4 +254,13 @@ public class RedisKeys { return rootPrefix.concat("tags:grid:relationTag:").concat(gridId).concat(StrConstant.COLON).concat(tagId); } + /** + * appId secret 缓存Key + * @param appId + * @return + */ + public static String getAppSecretKey(String appId) { + return rootPrefix.concat("oper:crm:appid:secret").concat(appId); + } + } diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerAppDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerAppDTO.java new file mode 100644 index 0000000000..5a58975a7d --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerAppDTO.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.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 客户表 appId表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-27 + */ +@Data +public class CustomerAppDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 小程序的appId + */ + private String appId; + + /** + * resi,work + */ + private String client; + + /** + * app的secret + */ + private String secret; + + /** + * 0:停用,1:启用 + */ + private Integer enableFlag; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer 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/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/CustomerAppSecretFormDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/CustomerAppSecretFormDTO.java new file mode 100644 index 0000000000..bed538b63b --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/CustomerAppSecretFormDTO.java @@ -0,0 +1,42 @@ +/** + * 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.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 客户表 appId表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-27 + */ +@Data +public class CustomerAppSecretFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 小程序的appId + */ + @NotBlank(message = "小程序Id不能为空") + private String appId; +} \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java index 5b220aa698..71cc77831d 100644 --- a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java @@ -1,13 +1,16 @@ package com.epmet.feign; +import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerAppDTO; import com.epmet.dto.CustomerDTO; -import org.springframework.cloud.openfeign.FeignClient; - -import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.dto.form.CustomerAppSecretFormDTO; import com.epmet.feign.fallback.OperCrmOpenFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; +import java.util.List; + /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 * @@ -23,4 +26,19 @@ public interface OperCrmOpenFeignClient { */ @PostMapping("/oper/crm/customer/getcostomerInfo") Result getCustomerInfo(CustomerDTO dto); + + /** + * 获取客户appId信息 + * @param dto + * @return + */ + @PostMapping("/oper/crm/customerapp/getsecretbyappid") + Result getSecretByAppId(CustomerAppSecretFormDTO dto); + + /** + * 获取所有已配置的app信息 + * @return + */ + @PostMapping("/oper/crm/customerapp/getconfigallapp") + Result getConfigAllApp(); } diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java index 39594aa4fe..81b74a4f7c 100644 --- a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java @@ -3,10 +3,14 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerAppDTO; import com.epmet.dto.CustomerDTO; +import com.epmet.dto.form.CustomerAppSecretFormDTO; import com.epmet.feign.OperCrmOpenFeignClient; import org.springframework.stereotype.Component; +import java.util.List; + /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 * @@ -19,4 +23,20 @@ public class OperCrmOpenFeignClientFallback implements OperCrmOpenFeignClient { public Result getCustomerInfo(CustomerDTO dto) { return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getCustomerInfo", dto); } + + /** + * 获取客户appId信息 + * + * @param dto + * @return + */ + @Override + public Result getSecretByAppId(CustomerAppSecretFormDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getSecretByAppId", dto); + } + + @Override + public Result> getConfigAllApp() { + return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getConfigAllApp", null); + } } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerAppController.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerAppController.java new file mode 100644 index 0000000000..90bdfd56c4 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerAppController.java @@ -0,0 +1,88 @@ +/** + * 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.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.CustomerAppDTO; +import com.epmet.dto.form.CustomerAppSecretFormDTO; +import com.epmet.service.CustomerAppIdService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + + +/** + * 客户表 app表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-27 + */ +@RestController +@RequestMapping("customerapp") +public class CustomerAppController { + + @Autowired + private CustomerAppIdService customerAppIdService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = customerAppIdService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CustomerAppDTO data = customerAppIdService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CustomerAppDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + customerAppIdService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CustomerAppDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + customerAppIdService.update(dto); + return new Result(); + } + @PostMapping("getsecretbyappid") + public Result getSecretByAppId(@RequestBody CustomerAppSecretFormDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, DefaultGroup.class); + return new Result().ok(customerAppIdService.selectSecretByAppId(dto.getAppId())); + } + @PostMapping("getconfigallapp") + public Result> getConfigAllApp(){ + return new Result>().ok(customerAppIdService.list(null)); + } + + +} \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerAppDao.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerAppDao.java new file mode 100644 index 0000000000..b69ea9fe11 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerAppDao.java @@ -0,0 +1,35 @@ +/** + * 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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.CustomerAppEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 客户表 appId表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-27 + */ +@Mapper +public interface CustomerAppDao extends BaseDao { + + String selectSecretByAppId(@Param("appId") String appId); +} \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerAppEntity.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerAppEntity.java new file mode 100644 index 0000000000..89d62c233d --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerAppEntity.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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 客户表 appId表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_app") +public class CustomerAppEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 小程序的appId + */ + private String appId; + + /** + * resi,work + */ + private String client; + + /** + * app的secret + */ + private String secret; + + /** + * 0:停用,1:启用 + */ + private Integer enableFlag; + +} diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerAppIdService.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerAppIdService.java new file mode 100644 index 0000000000..3da3da447d --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerAppIdService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.CustomerAppDTO; +import com.epmet.entity.CustomerAppEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户表 appId表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-27 + */ +public interface CustomerAppIdService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-27 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-27 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CustomerAppIdDTO + * @author generator + * @date 2020-07-27 + */ + CustomerAppDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-27 + */ + void save(CustomerAppDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-27 + */ + void update(CustomerAppDTO dto); + + /** + * desc:获取客户app secret + * @param appId + * @return + */ + String selectSecretByAppId(String appId); +} \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerAppIdServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerAppIdServiceImpl.java new file mode 100644 index 0000000000..44dfa97eb9 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerAppIdServiceImpl.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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.CustomerAppDao; +import com.epmet.dto.CustomerAppDTO; +import com.epmet.entity.CustomerAppEntity; +import com.epmet.service.CustomerAppIdService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Map; + +/** + * 客户表 appId表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-27 + */ +@Service +public class CustomerAppIdServiceImpl extends BaseServiceImpl implements CustomerAppIdService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CustomerAppDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CustomerAppDTO.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 CustomerAppDTO get(String id) { + CustomerAppEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CustomerAppDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CustomerAppDTO dto) { + CustomerAppEntity entity = ConvertUtils.sourceToTarget(dto, CustomerAppEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CustomerAppDTO dto) { + CustomerAppEntity entity = ConvertUtils.sourceToTarget(dto, CustomerAppEntity.class); + updateById(entity); + } + + @Override + public String selectSecretByAppId(String appId) { + return baseDao.selectSecretByAppId(appId); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/CustomerAppDao.xml b/epmet-module/oper-crm/oper-crm-server/src/main/resources/CustomerAppDao.xml new file mode 100644 index 0000000000..599ef18c59 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/CustomerAppDao.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 46aafc4c09a7fde0a88bdc37a03685bb0b6b27e7 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Mon, 27 Jul 2020 15:01:59 +0800 Subject: [PATCH 79/98] =?UTF-8?q?=E7=88=B1=E5=BF=83=E4=BA=92=E5=8A=A9-?= =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ResiActListController.java | 5 +-- .../main/java/com/epmet/dao/ActInfoDao.java | 4 +-- .../com/epmet/dao/ActUserRelationDao.java | 22 +++++++++++++ .../com/epmet/service/ActLiveRecService.java | 2 +- .../service/impl/ActInfoServiceImpl.java | 10 +++++- .../service/impl/ActLiveRecServiceImpl.java | 2 +- .../service/impl/ActSignInRecServiceImpl.java | 2 +- .../impl/ActUserRelationServiceImpl.java | 25 ++++++++++----- .../src/main/resources/mapper/ActInfoDao.xml | 17 +++++----- .../resources/mapper/ActUserRelationDao.xml | 32 +++++++++++++++++++ 10 files changed, 97 insertions(+), 24 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java index 721723b58e..f77002c42c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java @@ -263,9 +263,10 @@ public class ResiActListController { * @Date 10:29 2020-07-23 **/ @PostMapping("insertlive") - public Result inSertlive(@LoginUser TokenDto tokenDto, @RequestBody ResiActInsertLiveFormDTO formDTO) { + public Result insertLive(@LoginUser TokenDto tokenDto, @RequestBody ResiActInsertLiveFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); - return actLiveRecService.inSertlive(tokenDto, formDTO); + Result result = actLiveRecService.insertLive(tokenDto, formDTO); + return new Result(); } /** diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java index fc1b09d56c..ce0d39cb16 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java @@ -119,7 +119,7 @@ public interface ActInfoDao extends BaseDao { * @Author zhangyong * @Date 13:53 2020-07-20 **/ - List selectListActMyHavePassed(ResiMyActFormDTO formDTO); + List selectListMyActIHavePassed(ResiMyActFormDTO formDTO); /** * 我的活动-已结束 @@ -240,7 +240,7 @@ public interface ActInfoDao extends BaseDao { * @param customerId * @author yinzuomei * @description 已取消-活动列表 - * @Date 2020/7/23 23:13 + * @Date 2020/7/23 23:13 **/ List selectCanceledList(String customerId); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java index 3b50cf440b..379875b0a8 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java @@ -175,4 +175,26 @@ public interface ActUserRelationDao extends BaseDao { * @Date 2020/7/26 22:38 **/ Integer selectCountByReward(@Param("actId") String actId, @Param("rewardFlag")String rewardFlag); + + /** + * 取消报名 + * 根据用户id和活动id,修改 用户活动关系表 + * + * @param entity + * @return void + * @Author zhangyong + * @Date 14:39 2020-07-22 + **/ + void cancelSignUp(ActUserRelationEntity entity); + + /** + * 当前用户是否曾报名参加过该活动 + * + * @param actId + * @param userId + * @return java.lang.Integer + * @Author zhangyong + * @Date 14:35 2020-07-27 + **/ + Integer selectCountByActIdAndUserId(@Param("actId") String actId, @Param("userId")String userId); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java index 79d95ce9e7..aae4ece4a6 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java @@ -52,5 +52,5 @@ public interface ActLiveRecService extends BaseService { * @Author zhangyong * @Date 13:40 2020-07-23 **/ - Result inSertlive(TokenDto tokenDto, ResiActInsertLiveFormDTO formDTO); + Result insertLive(TokenDto tokenDto, ResiActInsertLiveFormDTO formDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java index 79d97f2bfa..8e6b0bcd5f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java @@ -152,6 +152,8 @@ public class ActInfoServiceImpl extends BaseServiceImpl> myActListAuditing(TokenDto tokenDto, ResiMyActFormDTO formDto) { formDto.setUserId(tokenDto.getUserId()); + int pageIndex = (formDto.getPageNo() - NumConstant.ONE) * formDto.getPageSize(); + formDto.setPageNo(pageIndex); List myAct = baseDao.selectListMyActAuditing(formDto); return new Result>().ok(myAct); } @@ -159,6 +161,8 @@ public class ActInfoServiceImpl extends BaseServiceImpl> myActListRefused(TokenDto tokenDto, ResiMyActFormDTO formDto) { formDto.setUserId(tokenDto.getUserId()); + int pageIndex = (formDto.getPageNo() - NumConstant.ONE) * formDto.getPageSize(); + formDto.setPageNo(pageIndex); List myAct = baseDao.selectListActRefused(formDto); return new Result>().ok(myAct); } @@ -166,13 +170,17 @@ public class ActInfoServiceImpl extends BaseServiceImpl> myActListPassed(TokenDto tokenDto, ResiMyActFormDTO formDto) { formDto.setUserId(tokenDto.getUserId()); - List myAct = baseDao.selectListActMyHavePassed(formDto); + int pageIndex = (formDto.getPageNo() - NumConstant.ONE) * formDto.getPageSize(); + formDto.setPageNo(pageIndex); + List myAct = baseDao.selectListMyActIHavePassed(formDto); return new Result>().ok(myAct); } @Override public Result> myActListCanceld(TokenDto tokenDto, ResiMyActFormDTO formDto) { formDto.setUserId(tokenDto.getUserId()); + int pageIndex = (formDto.getPageNo() - NumConstant.ONE) * formDto.getPageSize(); + formDto.setPageNo(pageIndex); List myAct = baseDao.selectListMyActCanceld(formDto); return new Result>().ok(myAct); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java index 1eb66ab5f8..d03cb6f4b7 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java @@ -106,7 +106,7 @@ public class ActLiveRecServiceImpl extends BaseServiceImpl inSertlive(TokenDto tokenDto, ResiActInsertLiveFormDTO formDTO) { + public Result insertLive(TokenDto tokenDto, ResiActInsertLiveFormDTO formDTO) { formDTO.setUserId(tokenDto.getUserId()); // 文本校验 ValidityVerification verification = new ValidityVerification(); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInRecServiceImpl.java index 4bd516e4f9..c874a61640 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInRecServiceImpl.java @@ -86,7 +86,7 @@ public class ActSignInRecServiceImpl extends BaseServiceImpl inSertlive = actLiveRecService.inSertlive(tokenDto, liveFormDTO); + Result inSertlive = actLiveRecService.insertLive(tokenDto, liveFormDTO); //实况id, 当sync_live=1时此列有值 dto.setLiveId(inSertlive.getData()); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java index dbdb98eee5..9105a148cf 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java @@ -251,20 +251,29 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl= ]]> NOW() -- 报名截止时间 >= 当前时间 @@ -92,7 +92,7 @@ IF(u.USER_ID = #{userId},'signed_up','no_signed_up') as signupFlag FROM act_info i LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' - LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND (re.`STATUS` = 'auditing' OR re.`STATUS` = 'passed') GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID + LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID WHERE i.DEL_FLAG = '0' AND i.ACT_STATUS = 'published' AND = ]]> NOW() -- 报名截止时间 >= 当前时间 @@ -119,7 +119,7 @@ IF(u.USER_ID = #{userId},'signed_up','no_signed_up') as signupFlag FROM act_info i LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' - LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND (re.`STATUS` = 'auditing' OR re.`STATUS` = 'passed') GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID + LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID WHERE i.DEL_FLAG = '0' -- 活动开始时间 > 当前时间 并且 报名截止时间 < 当前时间 报名已结束,活动未开始 未开始 AND ( ]]> NOW() AND NOW() ) @@ -195,7 +195,7 @@ IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 'auditing' AS actCurrentState -- 活动状态 FROM act_info i LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND u.DEL_FLAG = '0' - LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID + LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID WHERE i.DEL_FLAG = '0' AND u.USER_ID = #{userId} AND u.`STATUS` = 'auditing' @@ -218,7 +218,7 @@ IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 'passed' AS actCurrentState -- 活动状态 FROM act_info i LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND u.DEL_FLAG = '0' - LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID + LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID WHERE i.DEL_FLAG = '0' AND u.USER_ID = #{userId} AND u.`STATUS` = 'passed' @@ -241,7 +241,7 @@ IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 'refused' AS actCurrentState -- 活动状态 FROM act_info i LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND u.DEL_FLAG = '0' - LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID + LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID WHERE i.DEL_FLAG = '0' AND u.USER_ID = #{userId} AND u.`STATUS` = 'refused' @@ -264,7 +264,7 @@ IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 'canceld' AS actCurrentState -- 活动状态 FROM act_info i LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND u.DEL_FLAG = '0' - LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID + LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID WHERE i.DEL_FLAG = '0' AND u.USER_ID = #{userId} AND NOW() -- 活动结束时间 < 当前时间, 活动已结束 @@ -457,7 +457,8 @@ WHERE i.DEL_FLAG = '0' AND r.USER_ID = #{userId} AND i.ACT_STATUS = 'published' - AND ((#{actStartTime} BETWEEN i.ACT_START_TIME AND i.ACT_END_TIME OR #{actEndTime} BETWEEN i.ACT_START_TIME AND i.ACT_END_TIME) + AND r.`STATUS` != 'refused' AND r.`STATUS` != 'canceled' + AND ((#{actStartTime} BETWEEN i.ACT_START_TIME AND i.ACT_END_TIME OR #{actEndTime} BETWEEN i.ACT_START_TIME AND i.ACT_END_TIME) or (i.ACT_START_TIME BETWEEN #{actStartTime} AND #{actEndTime} OR i.ACT_END_TIME BETWEEN #{actStartTime} AND #{actEndTime})); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml index 7640d4f3c1..57de2ff10f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml @@ -252,4 +252,36 @@ and aur.REWARD_FLAG=#{rewardFlag} AND aur.ACT_ID = #{actId} + + + UPDATE act_user_relation + SET + + STATUS = #{status}, + + + CANCEL_TIME = #{cancelTime}, + CANCEL_REASON = #{cancelReason}, + + + UPDATED_BY = #{userId}, + + UPDATED_TIME = NOW() + WHERE + DEL_FLAG = '0' + AND ACT_ID = #{actId} + AND USER_ID = #{userId} + + + + From ee8584e8543e4bb8007a02e15c3b847a100dbe26 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 27 Jul 2020 15:12:07 +0800 Subject: [PATCH 80/98] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-auth/deploy/docker-compose-dev.yml | 2 +- epmet-auth/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-auth/deploy/docker-compose-dev.yml b/epmet-auth/deploy/docker-compose-dev.yml index 47c85008cf..5f9e8bf5c8 100644 --- a/epmet-auth/deploy/docker-compose-dev.yml +++ b/epmet-auth/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-auth-server: container_name: epmet-auth-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.50 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.51 ports: - "8081:8081" network_mode: host # 使用现有网络 diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index 22aacf2b62..16488992d7 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.50 + 0.3.51 com.epmet epmet-cloud From c0e5578683520b1f8b9923af3faeb73e0f0fa40a Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 27 Jul 2020 15:26:02 +0800 Subject: [PATCH 81/98] =?UTF-8?q?heart-work:=E9=87=8D=E6=96=B0=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E6=B4=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/form/work/RePublishFormDTO.java | 194 ++++++++++++++++++ .../dto/result/work/PublishActResultDTO.java | 3 + .../epmet/constant/ActMessageConstant.java | 8 + .../epmet/controller/WorkActController.java | 24 ++- .../java/com/epmet/dao/ActContentDao.java | 9 + .../com/epmet/dao/ActUserRelationDao.java | 9 + .../com/epmet/service/WorkActService.java | 9 + .../service/impl/WorkActServiceImpl.java | 168 ++++++++++++++- .../main/resources/mapper/ActContentDao.xml | 8 + .../resources/mapper/ActUserRelationDao.xml | 13 ++ 10 files changed, 442 insertions(+), 3 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java new file mode 100644 index 0000000000..f3bce130df --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java @@ -0,0 +1,194 @@ +package com.epmet.dto.form.work; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.Valid; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 重新发布活动-入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/27 13:49 + */ +@Data +public class RePublishFormDTO implements Serializable { + private static final long serialVersionUID = -959956652123514886L; + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + @Valid + @Size(min=1,message = "活动详情不能为空",groups = {AddUserShowGroup.class}) + private List actContent; + + /** + * 活动id + */ + @NotBlank(message = "活动id不能为空", groups = {AddUserInternalGroup.class}) + private String actId; + + /** + * 是否通知已报名人员:true 通知 false 不通知 + */ + @NotNull(message = "是否通知已报名人员标志不能为空",groups ={AddUserInternalGroup.class} ) + private Boolean noticePassedPeople; + + + /** + * 活动标题 + */ + @NotBlank(message = "活动标题不能为空", groups = {AddUserShowGroup.class}) + @Length(min=1, max=50,message = "活动标题限50字以内", groups = {AddUserShowGroup.class}) + private String title; + + /** + * 封面图 + */ + @NotBlank(message = "封面图不能为空", groups = {AddUserShowGroup.class}) + private String coverPic; + + /** + * 活动地点 + */ + @NotBlank(message = "活动地点不能为空", groups = {AddUserShowGroup.class}) + private String actAddress; + + /** + * 活动地点-经度 + */ + @NotNull(message = "活动地点经度不能为空", groups = {AddUserInternalGroup.class}) + private BigDecimal actLongitude; + + /** + * 活动地点-纬度 + */ + @NotNull(message = "活动地点经度不能为空", groups = {AddUserInternalGroup.class}) + private BigDecimal actLatitude; + + /** + * 活动预计开始时间yyyy-MM-dd HH:mm + */ + @NotBlank(message = "活动预计开始时间不能为空", groups = {AddUserShowGroup.class}) + private String actStartTime; + + /** + * 活动预计结束时间yyyy-MM-dd HH:mm + */ + @NotBlank(message = "活动预计结束时间不能为空", groups = {AddUserShowGroup.class}) + private String actEndTime; + + /** + * 活动人数 + */ + @Min(0) + private Integer actQuota; + + /** + * 活动积分 + */ + @Min(0) + private Integer reward; + + /** + * 报名审核:true:只有志愿者才可以参加活动,false: 只要是居民就可以参加活动 + */ + @NotNull(message = "报名身份不能为空", groups = {AddUserInternalGroup.class}) + private Boolean volunteerLimit; + + /** + * 报名审核: true: 需人工审核 false: 无需审核 + */ + @NotNull(message = "报名审核方式不能为空", groups = {AddUserInternalGroup.class}) + private Boolean auditSwitch; + + /** + * 报名截止时间:yyyy-MM-dd HH:mm + */ + @NotBlank(message = "报名截止时间不能为空", groups = {AddUserShowGroup.class}) + private String signUpEndTime; + + /** + * 报名条件 + */ + @NotBlank(message = "报名条件不能为空", groups = {AddUserShowGroup.class}) + @Length(min=1, max=50,message = "报名条件限200字以内", groups = {AddUserShowGroup.class}) + private String requirement; + + /** + * 签到开始时间:yyyy-MM-dd HH:mm + */ + @NotBlank(message = "签到开始时间不能为空", groups = {AddUserShowGroup.class}) + private String signInStartTime; + + /** + * 签到结束时间: yyyy-MM-dd HH:mm + */ + @NotBlank(message = "签到结束时间不能为空", groups = {AddUserShowGroup.class}) + private String signInEndTime; + + /** + * 签到地址 + */ + @NotBlank(message = "签到地址不能为空", groups = {AddUserShowGroup.class}) + private String signInAddress; + + /** + * 签到地址-纬度 + */ + @NotNull(message = "签到地址-纬度不能为空", groups = {AddUserInternalGroup.class}) + private BigDecimal signInLatitude; + + /** + * 签到地址-经度 + */ + @NotNull(message = "签到地址-经度不能为空", groups = {AddUserInternalGroup.class}) + private BigDecimal signInLongitude; + + /** + * 签到有效范围(米) + */ + @Min(0) + @NotNull(message = "签到有效范围不能为空", groups = {AddUserShowGroup.class}) + private Integer signInRadius; + + /** + * 主办方id + */ + @NotBlank(message = "主办方id不能为空", groups = {AddUserInternalGroup.class}) + private String sponsorId; + + /** + * 主办方类型:以网格名义:grid , 以机关名义: agency + */ + @NotBlank(message = "主办方类型不能为空", groups = {AddUserInternalGroup.class}) + private String sponsorType; + + /** + * 主办方名称 + */ + @NotBlank(message = "主办方名称不能为空", groups = {AddUserShowGroup.class}) + private String sponsorName; + + /** + * 联系人 + */ + @NotBlank(message = "联系人不能为空", groups = {AddUserShowGroup.class}) + private String sponsorContacts; + + /** + * 联系电话 + */ + @NotBlank(message = "联系电话不能为空", groups = {AddUserShowGroup.class}) + private String sponsorTel; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PublishActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PublishActResultDTO.java index 5fdc6a5c06..bc9c9549cd 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PublishActResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PublishActResultDTO.java @@ -13,5 +13,8 @@ import java.io.Serializable; @Data public class PublishActResultDTO implements Serializable { private static final long serialVersionUID = 4699176252192192495L; + /** + * 活动id + */ private String actId; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java index ac8ba13bfc..8f711ee2d2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java @@ -21,6 +21,9 @@ public interface ActMessageConstant { */ String ACT_CANCELED="您报名的活动%s,已取消,原因:%s"; + /** + * 发放积分(结束活动)时调用消息的备注 + */ String ACT_POINTS_EVENT_REMARK="参与%s"; /** @@ -32,4 +35,9 @@ public interface ActMessageConstant { * 居民端-添加实况,发送消息 */ String ACT_POINTS_EVENT_VOLUNTEER_LIVE="用户%s,添加活动实况,活动:%s"; + + /** + * 工作端-重新发布活动,通知待审核+已经审核通过的用户 + */ + String RE_PUBLISH_ACT="您好,您参与的%s活动,%s,请注意查看"; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java index d1dc5ee508..8501fb6ac8 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java @@ -66,8 +66,7 @@ public class WorkActController { PublishActContentFormDTO.UserInternalGroup.class ); } - PublishActResultDTO resultDTO = workActService.publishAct(formDTO); - return new Result().ok(resultDTO); + return new Result().ok(workActService.publishAct(formDTO)); } /** @@ -220,4 +219,25 @@ public class WorkActController { ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); return new Result().ok(workActService.getActInfo(formDTO.getActId())); } + + /** + * @param rePublishFormDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 重新发布活动 + * @Date 2020/7/27 13:55 + **/ + @PostMapping("republish") + public Result rePublish(@RequestBody RePublishFormDTO rePublishFormDTO) { + ValidatorUtils.validateEntity(rePublishFormDTO, RePublishFormDTO.AddUserShowGroup.class, RePublishFormDTO.AddUserInternalGroup.class); + for (PublishActContentFormDTO actContentFormDTO : rePublishFormDTO.getActContent()) { + ValidatorUtils.validateEntity(actContentFormDTO, + PublishActContentFormDTO.UserShowGroup.class, + PublishActContentFormDTO.UserInternalGroup.class + ); + } + return new Result().ok(workActService.rePublish(rePublishFormDTO)); + } + + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActContentDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActContentDao.java index c125c2d9f4..8ff05abcde 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActContentDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActContentDao.java @@ -41,4 +41,13 @@ public interface ActContentDao extends BaseDao { * @Date 2020/7/26 18:26 **/ List selectByActId(String actId); + + /** + * @return int + * @param actId + * @author yinzuomei + * @description 根据活动id,将原来的活动详情删除,del_flag=1 + * @Date 2020/7/27 14:06 + **/ + int updateDelFlagByActId(String actId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java index 3b50cf440b..ef70fce4fb 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java @@ -175,4 +175,13 @@ public interface ActUserRelationDao extends BaseDao { * @Date 2020/7/26 22:38 **/ Integer selectCountByReward(@Param("actId") String actId, @Param("rewardFlag")String rewardFlag); + + /** + * @return java.util.List + * @param actId 活动id + * @author yinzuomei + * @description 根据活动id,查询待审核+已经审核通过的人员 + * @Date 2020/7/27 14:59 + **/ + List selectAuditingAndPassedList(String actId); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java index b1cb90e829..8aca54049d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java @@ -137,4 +137,13 @@ public interface WorkActService { * @Date 2020/7/27 13:36 **/ ReEditActInfoResultDTO getActInfo(String actId); + + /** + * @return com.epmet.dto.result.work.PublishActResultDTO + * @param rePublishFormDTO + * @author yinzuomei + * @description 重新发布活动 + * @Date 2020/7/27 13:55 + **/ + PublishActResultDTO rePublish(RePublishFormDTO rePublishFormDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java index 2d16b608c2..e7b24e69fb 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java @@ -171,7 +171,7 @@ public class WorkActServiceImpl implements WorkActService { * @return void * @param formDTO * @author yinzuomei - * @description + * @description 第一次发布 * @Date 2020/7/24 16:45 **/ private void checkPublishFormDTO(PublishActInfoFormDTO formDTO) { @@ -189,6 +189,28 @@ public class WorkActServiceImpl implements WorkActService { } } + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 重新发布 + * @Date 2020/7/24 16:45 + **/ + private void checkRePublishFormDTO(RePublishFormDTO formDTO) { + //1、活动预计开始时间、活动预计结束时间 + if(formDTO.getActStartTime().compareTo(formDTO.getActEndTime())!=-1){ + throw new RenException(EpmetErrorCode.ACT_START_TIME_ERROR.getCode()); + } + //2、签到开始时间、签到结束时间 + if(formDTO.getSignInStartTime().compareTo(formDTO.getSignInEndTime())!=-1){ + throw new RenException(EpmetErrorCode.ACT_SIGN_IN_START_TIME_ERROR.getCode()); + } + //3、报名截止时间(应该在活动预计开始时间之前) + if(formDTO.getSignUpEndTime().compareTo(formDTO.getActStartTime())!=-1){ + throw new RenException((EpmetErrorCode.ACT_SIGN_UP_END_TIME_ERROR.getCode())); + } + } + public static void main(String[] args) { SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @@ -243,6 +265,43 @@ public class WorkActServiceImpl implements WorkActService { this.auditActContent(textList,imgList); } + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 重新发布活动,内容审核 + * @Date 2020/7/27 14:01 + **/ + private void auditRePublishAct(RePublishFormDTO formDTO) { + //1、活动标题 + if (StringUtils.isNotBlank(formDTO.getTitle())) { + this.auditActTitle(formDTO.getTitle()); + } + //2、活动封面 + if(StringUtils.isNotBlank(formDTO.getCoverPic())){ + this.auditActCoverPic(formDTO.getCoverPic()); + } + + //3、招募要求 + if (StringUtils.isNotBlank(formDTO.getRequirement())) { + this.auditActRequirement(formDTO.getRequirement()); + } + //4、活动内容 + if(null==formDTO.getActContent()||formDTO.getActContent().size()<1){ + return; + } + List textList=new ArrayList<>(); + List imgList=new ArrayList<>(); + for(PublishActContentFormDTO actContent:formDTO.getActContent()){ + if(ActConstant.ACT_CONTENT_TYPE_TEXT.equals(actContent.getContentType())){ + textList.add(actContent.getContent()); + }else if(ActConstant.ACT_CONTENT_TYPE_IMG.equals(actContent.getContentType())){ + imgList.add(actContent.getContent()); + } + } + this.auditActContent(textList,imgList); + } + /** * @return com.epmet.entity.ActInfoEntity * @param formDTO @@ -286,6 +345,49 @@ public class WorkActServiceImpl implements WorkActService { return actInfoEntity; } + /** + * @return com.epmet.entity.ActInfoEntity + * @param formDTO + * @author yinzuomei + * @description 重新发布=构造act_info + * @Date 2020/7/27 14:02 + **/ + private ActInfoEntity constructRePublishActInfo(RePublishFormDTO formDTO) { + ActInfoEntity actInfoEntity = ConvertUtils.sourceToTarget(formDTO, ActInfoEntity.class); + //报名开始、报名截止、活动预计开始、活动预计截止、签到开始、签到截止 + actInfoEntity.setSignUpEndTime(DateUtils.minStrToSecondDate(formDTO.getSignUpEndTime())); + actInfoEntity.setSignInStartTime(DateUtils.minStrToSecondDate(formDTO.getSignInStartTime())); + actInfoEntity.setSignInEndTime(DateUtils.minStrToSecondDate(formDTO.getSignInEndTime())); + actInfoEntity.setActStartTime(DateUtils.minStrToSecondDate(formDTO.getActStartTime())); + actInfoEntity.setActEndTime(DateUtils.minStrToSecondDate(formDTO.getActEndTime())); + //活动名额类型(0-不限名额,1-固定名额) + if(actInfoEntity.getActQuota()==0){ + actInfoEntity.setActQuotaCategory(false); + }else{ + actInfoEntity.setActQuotaCategory(true); + } + Date nowDate=new Date(); + actInfoEntity.setSignUpStartTime(nowDate); + actInfoEntity.setCreatedTime(nowDate); + actInfoEntity.setUpdatedTime(nowDate); + actInfoEntity.setActStatus(ActConstant.ACT_STATUS_PUBLISHED); + + //1已经总结0未总结 + actInfoEntity.setSummaryFlag(false); + if(ActConstant.SPONSOR_AGENCY.equals(actInfoEntity.getSponsorType())){ + //调用gov_org服务获取当前组织的上一级机关id + Result result=govOrgOpenFeignClient.getAgencyById(formDTO.getSponsorId()); + if(result.success()&&null!=result.getData()){ + actInfoEntity.setPid(result.getData().getPid()); + }else{ + logger.warn("重新发布活动,根据agencyId查询组织信息失败,agencyId=",formDTO.getSponsorId()); + } + }else{ + actInfoEntity.setPid(StrConstant.EPMETY_STR); + } + return actInfoEntity; + } + /** * @return java.util.List * @param actContent @@ -864,4 +966,68 @@ public class WorkActServiceImpl implements WorkActService { resultDTO.setActContent(actContent); return resultDTO; } + + /** + * @param rePublishFormDTO + * @return com.epmet.dto.result.work.PublishActResultDTO + * @author yinzuomei + * @description 重新发布活动 + * @Date 2020/7/27 13:55 + **/ + @Override + public PublishActResultDTO rePublish(RePublishFormDTO rePublishFormDTO) { + ActInfoDTO originalActInfo=actInfoService.get(rePublishFormDTO.getActId()); + if(null==originalActInfo){ + logger.error("act_info is null"); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + if(!originalActInfo.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); + } + //校验参数 + this.checkRePublishFormDTO(rePublishFormDTO); + PublishActResultDTO publishActResultDTO=new PublishActResultDTO(); + //内容审核(活动标题、招募要求、活动内容图文) + this.auditRePublishAct(rePublishFormDTO); + logger.info("重新发布活动,审核成功"); + + //构造属性保存活动属性,活动内容 + ActInfoEntity newActInfoEntity=this.constructRePublishActInfo(rePublishFormDTO); + newActInfoEntity.setId(rePublishFormDTO.getActId()); + actInfoDao.updateById(newActInfoEntity); + //删除原来的 + actContentDao.updateDelFlagByActId(rePublishFormDTO.getActId()); + //插入编辑后的活动详情 + List actContentEntityList=this.constructActContent(rePublishFormDTO.getActContent(),rePublishFormDTO.getActId()); + for(ActContentEntity actContentEntity:actContentEntityList){ + actContentDao.insert(actContentEntity); + } + //插入一条操作日志 + ActOperationRecEntity actOperationRecEntity=new ActOperationRecEntity(); + actOperationRecEntity.setActId(rePublishFormDTO.getActId()); + actOperationRecEntity.setType(ActConstant.ACT_OPER_TYPE_UPDATE); + actOperationRecEntity.setNoticeUser(rePublishFormDTO.getNoticePassedPeople()); + actOperationRecEntity.setRemark(StrConstant.EPMETY_STR); + actOperationRecDao.insert(actOperationRecEntity); + + //删除所有的草稿 + this.deleteDraft(); + publishActResultDTO.setActId(rePublishFormDTO.getActId()); + //发送消息通知-暂时不做了 + /*if(rePublishFormDTO.getNoticePassedPeople()){ + this.noticePassedPeople(originalActInfo,newActInfoEntity); + }*/ + return publishActResultDTO; + } + + private void noticePassedPeople(ActInfoDTO originalActInfo, ActInfoEntity newActInfoEntity) { + /* List actUserRelationDTOList=actUserRelationDao.selectAuditingAndPassedList(originalActInfo.getId()); + if(null==actUserRelationDTOList||actUserRelationDTOList.size()<1){ + logger.info("不存在待审核人员、已经审核用户,无需发送站内信"); + return; + } + String originalTitle=originalActInfo.getTitle(); + + //活动地点、活动预计开始时间、活动预计结束时间、活动积分、签到时间开始、签到结束时间、签到地点*/ + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActContentDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActContentDao.xml index 6d38c0a679..10b82ac717 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActContentDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActContentDao.xml @@ -29,4 +29,12 @@ AND ac.ACT_ID = #{actId} order by orderNum asc + + + + UPDATE act_content ac + SET ac.DEL_FLAG = '1' + WHERE + ac.ACT_ID = #{actId} + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml index 7640d4f3c1..3ad005ad08 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml @@ -252,4 +252,17 @@ and aur.REWARD_FLAG=#{rewardFlag} AND aur.ACT_ID = #{actId} + + + From 059b95202742a61aef8fbaa24bca8a53b876ae88 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 27 Jul 2020 15:32:09 +0800 Subject: [PATCH 82/98] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-gateway/pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index dadaab41ed..c5f5ab311c 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -108,7 +108,7 @@ - + lb://epmet-auth-server lb://epmet-admin-server @@ -130,6 +130,7 @@ lb://oper-customize-server lb://oper-crm-server + lb://resi-guide-server From 0a752feafd3de56eb9ad2d903c1359c85a1e3ea6 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 27 Jul 2020 15:35:13 +0800 Subject: [PATCH 83/98] =?UTF-8?q?=E5=85=BC=E5=AE=B9=E5=A4=9A=E4=B8=AAappId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/form/GovWxmpEnteOrgFormDTO.java | 5 +++++ .../java/com/epmet/service/impl/GovLoginServiceImpl.java | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpEnteOrgFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpEnteOrgFormDTO.java index 0f1c8f6ff7..298fa611bc 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpEnteOrgFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpEnteOrgFormDTO.java @@ -39,5 +39,10 @@ public class GovWxmpEnteOrgFormDTO implements Serializable { @NotBlank(message = "组织id不能为空",groups = {AddUserInternalGroup.class}) private String rootAgencyId; + /** + * desc:小程序appId + */ + private String appId; + } diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java index 5853df538d..d9134aabec 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java @@ -19,7 +19,6 @@ import com.epmet.constant.SmsTemplateConstant; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.GovStaffRoleDTO; -import com.epmet.dto.UserWechatDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.feign.*; @@ -273,7 +272,7 @@ public class GovLoginServiceImpl implements GovLoginService { } CustomerStaffDTO customerStaff = customerStaffDTOResult.getData(); //2、解析微信用户 - WxMaJscode2SessionResult wxMaJscode2SessionResult = loginService.getWxMaUser(LoginConstant.APP_GOV, formDTO.getWxCode()); + WxMaJscode2SessionResult wxMaJscode2SessionResult = loginService.getWxMaUser(LoginConstant.APP_GOV, formDTO.getWxCode(), formDTO.getAppId()); //3、记录staff_wechat,并记录用户激活状态,激活时间 this.savestaffwechat(customerStaff.getUserId(), wxMaJscode2SessionResult.getOpenid()); From 7a75dd5afe5c00f5027470d10441de16f8953f27 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Mon, 27 Jul 2020 16:12:10 +0800 Subject: [PATCH 84/98] =?UTF-8?q?=E7=88=B1=E5=BF=83=E4=BA=92=E5=8A=A9-?= =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ResiActListController.java | 7 ++- .../java/com/epmet/dao/HeartUserInfoDao.java | 4 +- .../com/epmet/service/ActLiveRecService.java | 6 +- .../service/impl/ActInfoServiceImpl.java | 6 +- .../service/impl/ActLiveRecServiceImpl.java | 57 ++++++++++++------- .../resources/mapper/HeartUserInfoDao.xml | 2 +- 6 files changed, 50 insertions(+), 32 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java index f77002c42c..c39e1a78b6 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java @@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; +import java.util.Map; /** * 居民端-活动相关api @@ -196,14 +197,14 @@ public class ResiActListController { /** * 活动详情-已结束-现场实况列表 * - * @param actId + * @param map{actId:""} * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 13:39 2020-07-21 **/ @PostMapping("livereclist") - public Result liveRecList(@RequestBody String actId) { - return actLiveRecService.liveRecList(actId); + public Result liveRecList(@RequestBody Map map) { + return actLiveRecService.liveRecList(map); } // diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java index 71e1fc67cd..5e0bfb3785 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java @@ -49,11 +49,11 @@ public interface HeartUserInfoDao extends BaseDao { * 查询用户是否是志愿者:1是志愿者,0不是志愿者 * * @param userId - * @return java.lang.Integer + * @return java.lang.Boolean * @Author zhangyong * @Date 13:53 2020-07-22 **/ - Integer selectUserVolunteerFlag(@Param("userId") String userId); + Boolean selectUserVolunteerFlag(@Param("userId") String userId); /** * 爱心榜 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java index aae4ece4a6..9ebe84e2ff 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java @@ -24,6 +24,8 @@ import com.epmet.dto.form.resi.ResiActInsertLiveFormDTO; import com.epmet.dto.result.resi.ResiActLiveRecResultDTO; import com.epmet.entity.ActLiveRecEntity; +import java.util.Map; + /** * 活动实况记录 * @@ -35,12 +37,12 @@ public interface ActLiveRecService extends BaseService { /** * 活动详情-已结束-现场实况列表 * - * @param actId + * @param map * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 13:39 2020-07-21 **/ - Result liveRecList(String actId); + Result liveRecList(Map map); /** * 活动-添加实况 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java index 8e6b0bcd5f..3890401d3e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java @@ -199,6 +199,8 @@ public class ActInfoServiceImpl extends BaseServiceImpl> actLookBack(ResiActBaseFormDTO formDTO) { + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageNo(pageIndex); List lookBackAct = baseDao.selectListLookBackAct(formDTO); return new Result>().ok(lookBackAct); } @@ -211,8 +213,8 @@ public class ActInfoServiceImpl extends BaseServiceImpl liveRecList(String actId) { + public Result liveRecList(Map map) { + // 数据汇总 + ResiActLiveRecResultDTO resultDto = new ResiActLiveRecResultDTO(); // 查询实况记录 - List actLives = baseDao.selectListActLives(actId); + List actLives = baseDao.selectListActLives(map.get("actId")); List userIds = new ArrayList<>(); List liveIds = new ArrayList<>(); for (ActLiveRecDTO actLive : actLives){ userIds.add(actLive.getUserId()); liveIds.add(actLive.getId()); } - // 查询用户微信基础信息 - Result> userWxInfos = epmetUserOpenFeignClient.queryUserBaseInfo(userIds); - // 根据活动实况id,查询对应实况的图片集合 - List actLiveImg = baseDao.selectListActLiveImg(liveIds); - // 数据汇总 - ResiActLiveRecResultDTO resultDto = new ResiActLiveRecResultDTO(); - List dataContainer = new ArrayList<>(); - for (int k = 0; k < actLives.size(); k++) { - Map map = new HashMap<>(); - map.put("nickname", userWxInfos.getData().get(k).getNickname()); - map.put("headImg", userWxInfos.getData().get(k).getHeadImgUrl()); - map.put("desc", actLives.get(k).getDesc()); - map.put("createdTime", actLives.get(k).getCreatedTime()); - // 查询打卡对应图片 - List imgUrlList = new ArrayList<>(); - for (ActLivePicDTO urlDto : actLiveImg) { - if (actLives.get(k).getId().equals(urlDto.getLiveId())) { - imgUrlList.add(urlDto.getPicUrl()); + if (actLives.size() > NumConstant.ZERO){ + // 查询用户微信基础信息 + Result> userWxInfos = epmetUserOpenFeignClient.queryUserBaseInfo(userIds); + if (userWxInfos.getData().size() > NumConstant.ZERO){ + // 根据活动实况id,查询对应实况的图片集合 + List actLiveImg = baseDao.selectListActLiveImg(liveIds); + + List dataContainer = new ArrayList<>(); + for (int k = 0; k < actLives.size(); k++) { + Map base = new HashMap<>(); + base.put("nickname", userWxInfos.getData().get(k).getNickname()); + base.put("headImg", userWxInfos.getData().get(k).getHeadImgUrl()); + base.put("desc", actLives.get(k).getDesc()); + base.put("createdTime", actLives.get(k).getCreatedTime()); + // 查询打卡对应图片 + List imgUrlList = new ArrayList<>(); + for (ActLivePicDTO urlDto : actLiveImg) { + if (actLives.get(k).getId().equals(urlDto.getLiveId())) { + imgUrlList.add(urlDto.getPicUrl()); + } + } + base.put("images", imgUrlList); + dataContainer.add(base); } + resultDto.setActLives(dataContainer); + resultDto.setActLiveNum(dataContainer.size()); + } else { + logger.error("未查到用户基础信息"); + throw new RenException("未查到用户基础信息"); } - map.put("images", imgUrlList); - dataContainer.add(map); } return new Result().ok(resultDto); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml index 3a9473fa15..9908c46e37 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml @@ -32,7 +32,7 @@ - + UPDATE act_user_relation SET - - STATUS = #{status}, - - - CANCEL_TIME = #{cancelTime}, - CANCEL_REASON = #{cancelReason}, - + DEL_FLAG = '1', UPDATED_BY = #{userId}, From 99589dfa80902b3c8a940e3b948d2306b72b61f2 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 27 Jul 2020 18:42:04 +0800 Subject: [PATCH 94/98] =?UTF-8?q?=E5=85=BC=E5=AE=B9appId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/redis/CustomerAppWxServiceUtil.java | 9 +++------ .../java/com/epmet/service/impl/LoginServiceImpl.java | 10 ++++++---- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/redis/CustomerAppWxServiceUtil.java b/epmet-auth/src/main/java/com/epmet/redis/CustomerAppWxServiceUtil.java index 4c2a0a0e38..9d74299267 100644 --- a/epmet-auth/src/main/java/com/epmet/redis/CustomerAppWxServiceUtil.java +++ b/epmet-auth/src/main/java/com/epmet/redis/CustomerAppWxServiceUtil.java @@ -41,7 +41,7 @@ import java.util.stream.Collectors; */ @Component public class CustomerAppWxServiceUtil implements ApplicationRunner { - private Logger logger = LogManager.getLogger(CustomerAppWxServiceUtil.class); + private static Logger logger = LogManager.getLogger(CustomerAppWxServiceUtil.class); /** * 过期时长为30分钟,单位:秒 @@ -58,10 +58,7 @@ public class CustomerAppWxServiceUtil implements ApplicationRunner { private static Map maServices = Maps.newHashMap(); - private void initWxMa() { - - } - public WxMaService getWxMaService(String appId) { + public static WxMaService getWxMaService(String appId) { WxMaService wxMaService = maServices.get(appId); if (wxMaService == null){ logger.error("getMaService appId:{} is not config from customer_app",appId); @@ -90,7 +87,7 @@ public class CustomerAppWxServiceUtil implements ApplicationRunner { try { Result> configAllAppResult = operCrmOpenFeignClient.getConfigAllApp(); logger.info("initWxMa operCrmOpenFeignClient.getConfigAllApp result:{}", JSON.toJSONString(configAllAppResult)); - if (configAllAppResult == null || configAllAppResult.success()){ + if (configAllAppResult == null || !configAllAppResult.success()){ logger.info("initWxMa operCrmOpenFeignClient.getConfigAllApp fail"); return; } diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java index 89fbdbebb0..62b3e43892 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java @@ -67,8 +67,6 @@ public class LoginServiceImpl implements LoginService { @Autowired private OperAccessOpenFeignClient operAccessOpenFeignClient; - @Autowired - private CustomerAppWxServiceUtil customerAppWxServiceUtil; /** * 居民端微信小程序登录 @@ -116,7 +114,11 @@ public class LoginServiceImpl implements LoginService { WxMaJscode2SessionResult wxMaJscode2SessionResult = null; try { if (StringUtils.isNotBlank(appId)){ - wxMaJscode2SessionResult = customerAppWxServiceUtil.getWxMaService(appId).jsCode2SessionInfo(wxCode); + WxMaService wxMaService = CustomerAppWxServiceUtil.getWxMaService(appId); + if (wxMaService == null){ + throw new RenException("解析微信用户信息失败"); + } + wxMaJscode2SessionResult = wxMaService.jsCode2SessionInfo(wxCode); }else{ if (LoginConstant.APP_GOV.equals(app)) { wxMaJscode2SessionResult = wxMaServiceUtils.govWxMaService().jsCode2SessionInfo(wxCode); @@ -146,7 +148,7 @@ public class LoginServiceImpl implements LoginService { ValidatorUtils.validateEntity(formDTO, ResiWxPhoneFormDTO.AddUserInternalGroup.class); WxMaService wxMaService = null; if (StringUtils.isNotBlank(formDTO.getAppId())){ - wxMaService = customerAppWxServiceUtil.getWxMaService(formDTO.getAppId()); + wxMaService = CustomerAppWxServiceUtil.getWxMaService(formDTO.getAppId()); }else{ wxMaService = wxMaServiceUtils.resiWxMaService(); } From 3fe8621ce0af534c0f582b59d600eb55ecdb5bae Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 27 Jul 2020 18:43:52 +0800 Subject: [PATCH 95/98] =?UTF-8?q?=E9=83=A8=E7=BD=B2user?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-auth/deploy/docker-compose-dev.yml | 2 +- epmet-auth/deploy/docker-compose-prod.yml | 2 +- epmet-auth/deploy/docker-compose-test.yml | 2 +- epmet-auth/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-auth/deploy/docker-compose-dev.yml b/epmet-auth/deploy/docker-compose-dev.yml index d0300473bc..b95ceaba5d 100644 --- a/epmet-auth/deploy/docker-compose-dev.yml +++ b/epmet-auth/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-auth-server: container_name: epmet-auth-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.54 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.55 ports: - "8081:8081" network_mode: host # 使用现有网络 diff --git a/epmet-auth/deploy/docker-compose-prod.yml b/epmet-auth/deploy/docker-compose-prod.yml index be9ebc4737..0afba96920 100644 --- a/epmet-auth/deploy/docker-compose-prod.yml +++ b/epmet-auth/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-auth-server: container_name: epmet-auth-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-auth:0.3.54 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-auth:0.3.55 ports: - "8081:8081" network_mode: host # 使用现有网络 diff --git a/epmet-auth/deploy/docker-compose-test.yml b/epmet-auth/deploy/docker-compose-test.yml index ec420ae27e..ff10d2224e 100644 --- a/epmet-auth/deploy/docker-compose-test.yml +++ b/epmet-auth/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-auth-server: container_name: epmet-auth-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-auth:0.3.54 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-auth:0.3.55 ports: - "8081:8081" network_mode: host # 使用现有网络 diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index c9f4218ed0..affb22da4d 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.54 + 0.3.55 com.epmet epmet-cloud From cfb591219155c3ecfb808926e13fcaa9e4875db3 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 27 Jul 2020 18:43:56 +0800 Subject: [PATCH 96/98] =?UTF-8?q?heart-work:=E6=B5=8B=E8=AF=95bug=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/ActInfoDTO.java | 2 +- .../work/AuditingUserDetailResultDTO.java | 1 + .../result/work/ReEditActInfoResultDTO.java | 2 +- .../epmet/constant/ActMessageConstant.java | 6 +- .../java/com/epmet/dao/LatestActInfoDao.java | 9 +++ .../impl/LatestActContentServiceImpl.java | 1 + .../impl/LatestActInfoServiceImpl.java | 13 ++-- .../service/impl/WorkActServiceImpl.java | 60 +++++++------------ .../service/impl/WorkActUserServiceImpl.java | 6 ++ .../main/resources/mapper/ActContentDao.xml | 2 +- .../resources/mapper/LatestActContentDao.xml | 2 +- .../resources/mapper/LatestActInfoDao.xml | 5 ++ 12 files changed, 60 insertions(+), 49 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java index 5b6859f190..b747b77985 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java @@ -112,7 +112,7 @@ public class ActInfoDTO implements Serializable { /** * 活动签到打卡位置经度 */ - private BigDecimal signinLongitude; + private BigDecimal signInLongitude; /** * 活动签到打卡位置纬度 diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingUserDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingUserDetailResultDTO.java index b04972b890..764c81b2fe 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingUserDetailResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingUserDetailResultDTO.java @@ -100,4 +100,5 @@ public class AuditingUserDetailResultDTO implements Serializable { * 审核历史(待审核界面需要显示) */ private HistoricalAuditResult historicalAuditResult; + private String actUserRelationId; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java index a0191a6f3a..80f668afae 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java @@ -107,7 +107,7 @@ public class ReEditActInfoResultDTO implements Serializable { /** * 活动签到打卡位置经度 */ - private BigDecimal signinLongitude; + private BigDecimal signInLongitude; /** * 活动签到打卡位置纬度 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java index 8f711ee2d2..5fcbb51334 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java @@ -11,15 +11,15 @@ public interface ActMessageConstant { /** * 报名审核成功,给居民端用户发送消息 */ - String AUDIT_PASSED="您报名的活动%s,已审核通过"; + String AUDIT_PASSED="您报名的%s活动,已审核通过"; /** * 拒绝用户的报名,给居民端用户发送消息 */ - String AUDIT_REFUSED="您报名的活动%s,审核未通过,原因:%s"; + String AUDIT_REFUSED="您报名的%s活动,审核未通过,原因:%s"; /** * 活动被取消,给已经通过审核的居民端用户,发送消息 */ - String ACT_CANCELED="您报名的活动%s,已取消,原因:%s"; + String ACT_CANCELED="您报名的%s活动,已取消,原因:%s"; /** * 发放积分(结束活动)时调用消息的备注 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActInfoDao.java index d1a00cb15d..caf1adf16f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActInfoDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActInfoDao.java @@ -58,4 +58,13 @@ public interface LatestActInfoDao extends BaseDao { * @Date 2020/7/21 17:56 **/ ActPreviewResultDTO previewActInfo(String actDraftId); + + /** + * @return int + * @param id + * @author yinzuomei + * @description 逻辑删除表记录 + * @Date 2020/7/27 17:10 + **/ + int updateToDelById(String id); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java index 38930a1467..9d73f7866a 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java @@ -124,6 +124,7 @@ public class LatestActContentServiceImpl extends BaseServiceImpl implements LatestActInfoService { - + private Logger logger = LogManager.getLogger(LatestActInfoServiceImpl.class); @Autowired private LatestActInfoRedis latestActInfoRedis; @Autowired @@ -96,13 +97,16 @@ public class LatestActInfoServiceImpl extends BaseServiceImpl actContentEntityList=this.constructActContent(formDTO.getActContent(),actInfoEntity.getId()); @@ -169,44 +169,23 @@ public class WorkActServiceImpl implements WorkActService { /** * @return void - * @param formDTO + * @param actInfoEntity * @author yinzuomei * @description 第一次发布 * @Date 2020/7/24 16:45 **/ - private void checkPublishFormDTO(PublishActInfoFormDTO formDTO) { + private void checkPublishFormDTO(ActInfoEntity actInfoEntity) { //1、活动预计开始时间、活动预计结束时间 - if(formDTO.getActStartTime().compareTo(formDTO.getActEndTime())!=-1){ + if(actInfoEntity.getActStartTime().compareTo(actInfoEntity.getActEndTime())!=-1){ throw new RenException(EpmetErrorCode.ACT_START_TIME_ERROR.getCode()); } //2、签到开始时间、签到结束时间 - if(formDTO.getSignInStartTime().compareTo(formDTO.getSignInEndTime())!=-1){ + if(actInfoEntity.getSignInStartTime().compareTo(actInfoEntity.getSignInEndTime())!=-1){ throw new RenException(EpmetErrorCode.ACT_SIGN_IN_START_TIME_ERROR.getCode()); } + int n=actInfoEntity.getSignUpEndTime().compareTo(actInfoEntity.getActStartTime()); //3、报名截止时间(应该在活动预计开始时间之前) - if(formDTO.getSignUpEndTime().compareTo(formDTO.getActStartTime())!=-1){ - throw new RenException((EpmetErrorCode.ACT_SIGN_UP_END_TIME_ERROR.getCode())); - } - } - - /** - * @return void - * @param formDTO - * @author yinzuomei - * @description 重新发布 - * @Date 2020/7/24 16:45 - **/ - private void checkRePublishFormDTO(RePublishFormDTO formDTO) { - //1、活动预计开始时间、活动预计结束时间 - if(formDTO.getActStartTime().compareTo(formDTO.getActEndTime())!=-1){ - throw new RenException(EpmetErrorCode.ACT_START_TIME_ERROR.getCode()); - } - //2、签到开始时间、签到结束时间 - if(formDTO.getSignInStartTime().compareTo(formDTO.getSignInEndTime())!=-1){ - throw new RenException(EpmetErrorCode.ACT_SIGN_IN_START_TIME_ERROR.getCode()); - } - //3、报名截止时间(应该在活动预计开始时间之前) - if(formDTO.getSignUpEndTime().compareTo(formDTO.getActStartTime())!=-1){ + if(n!=-1){ throw new RenException((EpmetErrorCode.ACT_SIGN_UP_END_TIME_ERROR.getCode())); } } @@ -215,10 +194,10 @@ public class WorkActServiceImpl implements WorkActService { SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { - Date yesterDate=format.parse("2020-07-25 13:00:00"); - Date today=format.parse("2020-07-26 13:00:00"); - Date tommorrow=format.parse("2020-07-27 13:00:00"); - Date today1=format.parse("2020-07-26 13:00:00"); + Date yesterDate=format.parse("2020-07-26 13:00:00"); + Date today=format.parse("2020-07-27 13:00:00"); + Date tommorrow=format.parse("2020-07-28 13:00:00"); + Date today1=format.parse("2020-07-27 13:00:00"); System.out.println(yesterDate.compareTo(today)); System.out.println(tommorrow.compareTo(today)); System.out.println(today.compareTo(today1)); @@ -644,6 +623,7 @@ public class WorkActServiceImpl implements WorkActService { List userMessageFormDTOS=new ArrayList<>(); for(String userId:userIdList){ UserMessageFormDTO userMessageFormDTO = new UserMessageFormDTO(); + userMessageFormDTO.setCustomerId(actInfoDTO.getCustomerId()); userMessageFormDTO.setUserId(userId); userMessageFormDTO.setGridId(StrConstant.STAR); userMessageFormDTO.setApp(AppClientConstant.APP_RESI); @@ -960,6 +940,9 @@ public class WorkActServiceImpl implements WorkActService { if(!actInfoDTO.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); } + if(!ActConstant.ACT_STATUS_PUBLISHED.equals(actInfoDTO.getActStatus())){ + throw new RenException("只有进行中的活动才可以编辑"); + } ReEditActInfoResultDTO resultDTO= ConvertUtils.sourceToTarget(actInfoDTO, ReEditActInfoResultDTO.class); resultDTO.setActId(actId); List actContent=actContentDao.selectByActId(actId); @@ -984,15 +967,18 @@ public class WorkActServiceImpl implements WorkActService { if(!originalActInfo.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); } + if(!ActConstant.ACT_STATUS_PUBLISHED.equals(originalActInfo.getActStatus())){ + throw new RenException("只有进行中的活动才可以编辑"); + } + //构造属性保存活动属性,活动内容 + ActInfoEntity newActInfoEntity=this.constructRePublishActInfo(rePublishFormDTO); //校验参数 - this.checkRePublishFormDTO(rePublishFormDTO); + this.checkPublishFormDTO(newActInfoEntity); PublishActResultDTO publishActResultDTO=new PublishActResultDTO(); //内容审核(活动标题、招募要求、活动内容图文) this.auditRePublishAct(rePublishFormDTO); logger.info("重新发布活动,审核成功"); - //构造属性保存活动属性,活动内容 - ActInfoEntity newActInfoEntity=this.constructRePublishActInfo(rePublishFormDTO); newActInfoEntity.setId(rePublishFormDTO.getActId()); actInfoDao.updateById(newActInfoEntity); //删除原来的 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java index 411e6f1cc6..c2f121e972 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.service.impl; +import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; @@ -278,6 +279,7 @@ public class WorkActUserServiceImpl implements WorkActUserService { UserBaseInfoResultDTO userBaseInfo=queryUserBaseInfo(actUserRelationDTO.getUserId()); AuditingUserDetailResultDTO resultDTO=new AuditingUserDetailResultDTO(); //基本信息赋值 + resultDTO.setActUserRelationId(actUserRelationDTO.getId()); resultDTO.setActId(actUserRelationDTO.getActId()); resultDTO.setUserId(actUserRelationDTO.getUserId()); resultDTO.setRealName(userBaseInfo.getRealName()); @@ -318,6 +320,7 @@ public class WorkActUserServiceImpl implements WorkActUserService { cancelResult.setCancelTime(actUserRelationDTO.getCancelTime()); resultDTO.setCancelResult(cancelResult); } + resultDTO.setVolunteerFlag(getVolunteerFlag(actUserRelationDTO.getUserId())); return resultDTO; } @@ -522,6 +525,7 @@ public class WorkActUserServiceImpl implements WorkActUserService { private void saveUserMessage(ActUserRelationEntity actUserRelationEntity, String type,ActInfoEntity actInfo) { try { UserMessageFormDTO userMessageFormDTO = new UserMessageFormDTO(); + userMessageFormDTO.setCustomerId(actInfo.getCustomerId()); userMessageFormDTO.setUserId(actUserRelationEntity.getUserId()); userMessageFormDTO.setGridId(StrConstant.STAR); userMessageFormDTO.setApp(AppClientConstant.APP_RESI); @@ -535,6 +539,8 @@ public class WorkActUserServiceImpl implements WorkActUserService { Result result = epmetMessageOpenFeignClient.saveUserMessage(userMessageFormDTO); if (result.success()) { logger.info("审核成功,已成功发送站内信"); + }else{ + logger.error("审核成功,发送站内信失败"+ JSON.toJSONString(result)); } } catch (Exception e) { logger.error("审核结果,发送站内信异常", e.getMessage()); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActContentDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActContentDao.xml index 10b82ac717..6a0027bd5e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActContentDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActContentDao.xml @@ -27,7 +27,7 @@ WHERE ac.DEL_FLAG = '0' AND ac.ACT_ID = #{actId} - order by orderNum asc + order by ORDER_NUM asc diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActContentDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActContentDao.xml index a4aade9b30..c11277cc32 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActContentDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActContentDao.xml @@ -53,6 +53,6 @@ - delete from latest_act_content lac where lac.ACT_ID=#{actId} + delete from latest_act_content where ACT_ID=#{actId} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml index 28b43cd8cf..a2e33b2245 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml @@ -118,4 +118,9 @@ lai.DEL_FLAG = '0' AND lai.ID = #{actDraftId} + + + + update latest_act_info set DEL_FLAG='1' where id=#{id} + \ No newline at end of file From 267e0f1636a48dff0a73b735ff042b4b6a70c2ea Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 27 Jul 2020 18:46:44 +0800 Subject: [PATCH 97/98] =?UTF-8?q?heart-work:=E6=B5=8B=E8=AF=95=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java index 76ac6ca878..b8f1def9d3 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java @@ -22,6 +22,7 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:47 */ +//@FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallback = EpmetMessageOpenFeignClientFallback.class,url = "http://127.0.0.1:8085") @FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallback = EpmetMessageOpenFeignClientFallback.class) public interface EpmetMessageOpenFeignClient { /** From 1333ecee5c7958b9e6119a277215da8c5bcb33b7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 27 Jul 2020 18:57:32 +0800 Subject: [PATCH 98/98] heart-work:gateway+1 --- epmet-gateway/deploy/docker-compose-dev.yml | 2 +- epmet-gateway/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-gateway/deploy/docker-compose-dev.yml b/epmet-gateway/deploy/docker-compose-dev.yml index 702ce1f34e..b4dc44a7df 100644 --- a/epmet-gateway/deploy/docker-compose-dev.yml +++ b/epmet-gateway/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-gateway-server: container_name: epmet-gateway-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.27 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.28 ports: - "8080:8080" network_mode: host # 使用现有网络 diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index 543e0e4545..3944de1695 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.27 + 0.3.28 com.epmet epmet-cloud