diff --git a/esua-epdc/epdc-admin/epdc-admin-server/pom.xml b/esua-epdc/epdc-admin/epdc-admin-server/pom.xml index edb7fc784..223bae618 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/pom.xml +++ b/esua-epdc/epdc-admin/epdc-admin-server/pom.xml @@ -93,7 +93,7 @@ test - 9092 + 9055 test @@ -106,7 +106,7 @@ prod - 9092 + 9055 prod diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/application-test.yml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/application-test.yml index f63f14cb3..f35566981 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/application-test.yml +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/application-test.yml @@ -1,16 +1,16 @@ spring: redis: database: 2 - host: redis + host: 47.104.224.45 timeout: 30s port: 6379 - password: 123456 + password: elink@888 datasource: druid: - driver-class-name: com.mysql.jdbc.Driver - url: jdbc:mysql://localhost:3306/renren_cloud?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false - username: renren - password: 123456 + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://47.104.224.45:3308/esua_epdc_admin?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai + username: epdc + password: elink833066 initial-size: 10 max-active: 100 min-idle: 10 diff --git a/esua-epdc/epdc-auth/pom.xml b/esua-epdc/epdc-auth/pom.xml index a58634179..fbff0aacd 100644 --- a/esua-epdc/epdc-auth/pom.xml +++ b/esua-epdc/epdc-auth/pom.xml @@ -108,7 +108,7 @@ test - 9091 + 9056 test @@ -127,7 +127,7 @@ prod - 9091 + 9056 prod diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/ServiceConstant.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/ServiceConstant.java index 9bbee1b69..fb585d6cf 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/ServiceConstant.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/ServiceConstant.java @@ -24,7 +24,7 @@ public interface ServiceConstant { */ String EPDC_AUTH_SERVER = "epdc-auth-server"; /** - * + * 路由 */ String EPDC_GATEWAY_SERVER = "epdc-gateway-server"; /** @@ -54,7 +54,7 @@ public interface ServiceConstant { /** * 党群议事模块 */ - String EPDC_ISSUE_SERVER = "epdc-issue-server"; + String EPDC_EVENTS_SERVER = "epdc-events-server"; /** * 生活服务模块 */ @@ -67,7 +67,6 @@ public interface ServiceConstant { * APP用户模块 */ String EPDC_USER_SERVER = "epdc-user-server"; - /** * DEMO服务 */ diff --git a/esua-epdc/epdc-gateway/pom.xml b/esua-epdc/epdc-gateway/pom.xml index 3f87d5d64..e65419204 100644 --- a/esua-epdc/epdc-gateway/pom.xml +++ b/esua-epdc/epdc-gateway/pom.xml @@ -79,10 +79,9 @@ elink@888 - - http://127.0.0.1:9091 - - http://127.0.0.1:9092 + lb://epdc-auth-server + lb://epdc-admin-server + lb://epdc-activiti-server lb://epdc-api-server lb://epdc-app-server @@ -97,8 +96,8 @@ lb://epdc-news-server lb://epdc-oss-server - lb://epdc-issue-server - + lb://epdc-events-server + lb://epdc-services-server @@ -134,7 +133,7 @@ lb://epdc-neighbor-server lb://epdc-news-server lb://epdc-oss-server - lb://epdc-issue-server + lb://epdc-events-server lb://epdc-services-server lb://epdc-user-server lb://epdc-demo-server @@ -169,7 +168,7 @@ lb://epdc-neighbor-server lb://epdc-news-server lb://epdc-oss-server - lb://epdc-issue-server + lb://epdc-events-server lb://epdc-services-server lb://epdc-user-server lb://epdc-demo-server diff --git a/esua-epdc/epdc-gateway/src/main/resources/application.yml b/esua-epdc/epdc-gateway/src/main/resources/application.yml index 5bcdacdd7..667a89c9a 100644 --- a/esua-epdc/epdc-gateway/src/main/resources/application.yml +++ b/esua-epdc/epdc-gateway/src/main/resources/application.yml @@ -96,11 +96,11 @@ spring: filters: - StripPrefix=0 #党群议事模块 - - id: epdc-issue-server - uri: @gateway.routes.epdc-issue-server.uri@ + - id: epdc-events-server + uri: @gateway.routes.epdc-events-server.uri@ order: 11 predicates: - - Path=/issue/** + - Path=/events/** filters: - StripPrefix=0 #生活服务模块 diff --git a/esua-epdc/epdc-module/epdc-app/epdc-app-client/pom.xml b/esua-epdc/epdc-module/epdc-app/epdc-app-client/pom.xml index 317158413..2b9c90eb5 100644 --- a/esua-epdc/epdc-module/epdc-app/epdc-app-client/pom.xml +++ b/esua-epdc/epdc-module/epdc-app/epdc-app-client/pom.xml @@ -35,7 +35,7 @@ com.esua.epdc - epdc-issue-client + epdc-events-client 1.0.0 @@ -50,4 +50,4 @@ - \ No newline at end of file + diff --git a/esua-epdc/epdc-module/epdc-issue/epdc-issue-client/pom.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-client/pom.xml similarity index 80% rename from esua-epdc/epdc-module/epdc-issue/epdc-issue-client/pom.xml rename to esua-epdc/epdc-module/epdc-events/epdc-events-client/pom.xml index 8326823a8..7e5ea539d 100644 --- a/esua-epdc/epdc-module/epdc-issue/epdc-issue-client/pom.xml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/pom.xml @@ -3,14 +3,14 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - epdc-issue + epdc-events com.esua.epdc 1.0.0 4.0.0 - epdc-issue-client + epdc-events-client jar - \ No newline at end of file + diff --git a/esua-epdc/epdc-module/epdc-issue/epdc-issue-client/src/main/java/com/elink/esua/epdc/epdc.gitkeep b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/epdc.gitkeep similarity index 100% rename from esua-epdc/epdc-module/epdc-issue/epdc-issue-client/src/main/java/com/elink/esua/epdc/epdc.gitkeep rename to esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/epdc.gitkeep diff --git a/esua-epdc/epdc-module/epdc-issue/epdc-issue-server/pom.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml similarity index 97% rename from esua-epdc/epdc-module/epdc-issue/epdc-issue-server/pom.xml rename to esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml index 0770eac63..bca64010c 100644 --- a/esua-epdc/epdc-module/epdc-issue/epdc-issue-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml @@ -3,19 +3,19 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - epdc-issue + epdc-events com.esua.epdc 1.0.0 4.0.0 - epdc-issue-server + epdc-events-server jar com.esua.epdc - epdc-issue-client + epdc-events-client 1.0.0 @@ -143,4 +143,4 @@ - \ No newline at end of file + diff --git a/esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/java/com/elink/esua/epdc/IssueApplication.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/EventsApplication.java similarity index 86% rename from esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/java/com/elink/esua/epdc/IssueApplication.java rename to esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/EventsApplication.java index 5094f5232..9da702350 100644 --- a/esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/java/com/elink/esua/epdc/IssueApplication.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/EventsApplication.java @@ -22,10 +22,10 @@ import org.springframework.cloud.openfeign.EnableFeignClients; @SpringBootApplication @EnableDiscoveryClient @EnableFeignClients -public class IssueApplication { +public class EventsApplication { public static void main(String[] args) { - SpringApplication.run(IssueApplication.class, args); + SpringApplication.run(EventsApplication.class, args); } } diff --git a/esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/java/com/elink/esua/epdc/config/ModuleConfigImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/config/ModuleConfigImpl.java similarity index 95% rename from esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/java/com/elink/esua/epdc/config/ModuleConfigImpl.java rename to esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/config/ModuleConfigImpl.java index 2746a1d64..3f74b9b45 100644 --- a/esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/java/com/elink/esua/epdc/config/ModuleConfigImpl.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/config/ModuleConfigImpl.java @@ -21,6 +21,6 @@ import org.springframework.stereotype.Service; public class ModuleConfigImpl implements ModuleConfig { @Override public String getName() { - return "issue"; + return "events"; } } diff --git a/esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/application.yml similarity index 93% rename from esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/application.yml rename to esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/application.yml index 4f17b8847..5fbb1cb04 100644 --- a/esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/application.yml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/application.yml @@ -1,11 +1,11 @@ server: port: @server.port@ servlet: - context-path: /issue + context-path: /events spring: application: - name: epdc-issue-server + name: epdc-events-server # 环境 dev|test|prod profiles: active: @spring.profiles.active@ @@ -28,7 +28,7 @@ spring: register-enabled: @nacos.register-enabled@ alibaba: seata: - tx-service-group: epdc-issue-server-fescar-service-group + tx-service-group: epdc-events-server-fescar-service-group datasource: druid: driver-class-name: com.mysql.jdbc.Driver diff --git a/esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/i18n/messages.properties b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/messages.properties similarity index 100% rename from esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/i18n/messages.properties rename to esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/messages.properties diff --git a/esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/i18n/messages_en_US.properties b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/messages_en_US.properties similarity index 100% rename from esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/i18n/messages_en_US.properties rename to esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/messages_en_US.properties diff --git a/esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/i18n/messages_zh_CN.properties b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/messages_zh_CN.properties similarity index 100% rename from esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/i18n/messages_zh_CN.properties rename to esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/messages_zh_CN.properties diff --git a/esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/i18n/messages_zh_TW.properties b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/messages_zh_TW.properties similarity index 100% rename from esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/i18n/messages_zh_TW.properties rename to esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/messages_zh_TW.properties diff --git a/esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/i18n/validation.properties b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/validation.properties similarity index 100% rename from esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/i18n/validation.properties rename to esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/validation.properties diff --git a/esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/i18n/validation_en_US.properties b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/validation_en_US.properties similarity index 100% rename from esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/i18n/validation_en_US.properties rename to esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/validation_en_US.properties diff --git a/esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/i18n/validation_zh_CN.properties b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/validation_zh_CN.properties similarity index 100% rename from esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/i18n/validation_zh_CN.properties rename to esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/validation_zh_CN.properties diff --git a/esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/i18n/validation_zh_TW.properties b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/validation_zh_TW.properties similarity index 100% rename from esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/i18n/validation_zh_TW.properties rename to esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/i18n/validation_zh_TW.properties diff --git a/esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/logback-spring.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/logback-spring.xml similarity index 99% rename from esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/logback-spring.xml rename to esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/logback-spring.xml index 205095d2f..79a7dad72 100644 --- a/esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/logback-spring.xml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/logback-spring.xml @@ -2,7 +2,7 @@ - + - \ No newline at end of file + diff --git a/esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/registry.conf b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/registry.conf similarity index 100% rename from esua-epdc/epdc-module/epdc-issue/epdc-issue-server/src/main/resources/registry.conf rename to esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/registry.conf diff --git a/esua-epdc/epdc-module/epdc-issue/pom.xml b/esua-epdc/epdc-module/epdc-events/pom.xml similarity index 78% rename from esua-epdc/epdc-module/epdc-issue/pom.xml rename to esua-epdc/epdc-module/epdc-events/pom.xml index 65faf1ba4..7a601facc 100644 --- a/esua-epdc/epdc-module/epdc-issue/pom.xml +++ b/esua-epdc/epdc-module/epdc-events/pom.xml @@ -9,12 +9,12 @@ 4.0.0 - epdc-issue + epdc-events pom - epdc-issue-client - epdc-issue-server + epdc-events-client + epdc-events-server - \ No newline at end of file + diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PartyMembersDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PartyMembersDTO.java index b7420d1e9..9df45cd5f 100755 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PartyMembersDTO.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PartyMembersDTO.java @@ -19,6 +19,8 @@ package com.elink.esua.epdc.dto; import java.io.Serializable; import java.util.Date; +import java.util.List; + import lombok.Data; @@ -32,9 +34,9 @@ import lombok.Data; public class PartyMembersDTO implements Serializable { private static final long serialVersionUID = 1L; - private String tagName; + private String tagIds; - private String tagDesc; + private String tagName; private String id; @@ -46,7 +48,7 @@ public class PartyMembersDTO implements Serializable { private String post; - private String postId; + private String postValue; private String cadreFlag; @@ -56,17 +58,17 @@ public class PartyMembersDTO implements Serializable { private String streetName; - private String streetId; + private long streetId; private String communityName; - private String communityId; + private long communityId; private String gridName; - private String gridId; + private long gridId; - private String deptId; + private long deptId; private Integer revision; diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PartyTagRelationDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PartyTagRelationDTO.java new file mode 100755 index 000000000..a8f243fa6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PartyTagRelationDTO.java @@ -0,0 +1,54 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto; + + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 党员标签关系表 + * + * @author Mark sunlightcs@gmail.com + * @since v1.0.0 2019-09-04 + */ +@Data +public class PartyTagRelationDTO implements Serializable { + private static final long serialVersionUID = 1L; + + private String id; + + private String partyId; + + private String tagId; + + private Integer revision; + + private String createdBy; + + private Date createdTime; + + private String updatedBy; + + private Date updatedTime; + + private String delFlag; + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/PartyMembersController.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/PartyMembersController.java index 73862ba15..c18a36440 100755 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/PartyMembersController.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/PartyMembersController.java @@ -18,6 +18,7 @@ package com.elink.esua.epdc.controller; import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.commons.tools.validator.AssertUtils; @@ -29,6 +30,7 @@ import com.elink.esua.epdc.dto.PartyMembersDTO; import com.elink.esua.epdc.excel.PartyMembersExcel; import com.elink.esua.epdc.service.PartyMembersService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; @@ -45,14 +47,13 @@ import java.util.Map; @RestController @RequestMapping("/partymembers") public class PartyMembersController { + @Autowired private PartyMembersService partyMembersService; @GetMapping("page") public Result> page(@RequestParam Map params){ - PageData page = partyMembersService.pageDIY(params); - - return new Result>().ok(page); + return partyMembersService.pageDIY(params); } @GetMapping("{id}") @@ -66,7 +67,7 @@ public class PartyMembersController { public Result save(@RequestBody PartyMembersDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - + dto.setDeptId(SecurityUser.getDeptId()); partyMembersService.save(dto); return new Result(); diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/PartyTagRelationController.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/PartyTagRelationController.java new file mode 100755 index 000000000..afb401335 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/PartyTagRelationController.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.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.PartyTagRelationDTO; +import com.elink.esua.epdc.excel.PartyTagRelationExcel; +import com.elink.esua.epdc.service.PartyTagRelationService; +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 Mark sunlightcs@gmail.com + * @since v1.0.0 2019-09-04 + */ +@RestController +@RequestMapping("/partytagrelation") +public class PartyTagRelationController { + @Autowired + private PartyTagRelationService partyTagRelationService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = partyTagRelationService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + PartyTagRelationDTO data = partyTagRelationService.get(id); + + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody PartyTagRelationDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + partyTagRelationService.save(dto); + + return new Result(); + } + + @PutMapping + public Result update(@RequestBody PartyTagRelationDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + partyTagRelationService.update(dto); + + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + partyTagRelationService.delete(ids); + + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = partyTagRelationService.list(params); + + ExcelUtils.exportExcelToTarget(response, null, list, PartyTagRelationExcel.class); + } + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserTagController.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserTagController.java index 0548fdfcc..630d0815e 100755 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserTagController.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserTagController.java @@ -51,10 +51,15 @@ public class UserTagController { @GetMapping("page") public Result> page(@RequestParam Map params){ PageData page = userTagService.page(params); - return new Result>().ok(page); } + @GetMapping("list") + public Result> list(@RequestParam Map params){ + List list = userTagService.list(params); + return new Result>().ok(list); + } + @GetMapping("{id}") public Result get(@PathVariable("id") String id){ UserTagDTO data = userTagService.get(id); diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PartyMembersDao.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PartyMembersDao.java index 63d7a8a47..8ad93f7d1 100755 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PartyMembersDao.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PartyMembersDao.java @@ -22,6 +22,7 @@ import com.elink.esua.epdc.dto.PartyMembersDTO; import com.elink.esua.epdc.entity.PartyMembersEntity; import org.apache.ibatis.annotations.Mapper; +import java.io.Serializable; import java.util.List; import java.util.Map; @@ -36,5 +37,5 @@ public interface PartyMembersDao extends BaseDao { List pageDIY(Map params); - + PartyMembersDTO selectByIdNew(String id); } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PartyTagRelationDao.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PartyTagRelationDao.java new file mode 100755 index 000000000..8329ec861 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PartyTagRelationDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.PartyTagRelationEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 党员标签关系表 + * + * @author Mark sunlightcs@gmail.com + * @since v1.0.0 2019-09-04 + */ +@Mapper +public interface PartyTagRelationDao extends BaseDao { + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PartyMembersEntity.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PartyMembersEntity.java index 1694f1351..3eb40dd29 100755 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PartyMembersEntity.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PartyMembersEntity.java @@ -60,7 +60,7 @@ public class PartyMembersEntity extends BaseEpdcEntity { /** * 职务ID(字典表) */ - private String postId; + private String postValue; /** * 干部下沉标识(0-否,1-是) */ @@ -80,7 +80,7 @@ public class PartyMembersEntity extends BaseEpdcEntity { /** * 街道ID */ - private String streetId; + private long streetId; /** * 社区名称 */ @@ -88,7 +88,7 @@ public class PartyMembersEntity extends BaseEpdcEntity { /** * 社区ID */ - private String communityId; + private long communityId; /** * 网格名称 */ @@ -96,10 +96,10 @@ public class PartyMembersEntity extends BaseEpdcEntity { /** * 网格ID */ - private String gridId; + private long gridId; /** * 部门ID */ - private String deptId; + private long deptId; } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PartyTagRelationEntity.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PartyTagRelationEntity.java new file mode 100755 index 000000000..a5231fec1 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PartyTagRelationEntity.java @@ -0,0 +1,53 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 党员标签关系表 + * + * @author Mark sunlightcs@gmail.com + * @since v1.0.0 2019-09-04 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_party_tag_relation") +public class PartyTagRelationEntity extends BaseEpdcEntity { + private static final long serialVersionUID = 1L; + + /** + * 党员ID + */ + private String partyId; + /** + * 标签ID + */ + private String tagId; + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/PartyTagRelationExcel.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/PartyTagRelationExcel.java new file mode 100755 index 000000000..9b7a9cc94 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/PartyTagRelationExcel.java @@ -0,0 +1,52 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 党员标签关系表 + * + * @author Mark sunlightcs@gmail.com + * @since v1.0.0 2019-09-04 + */ +@Data +public class PartyTagRelationExcel { + @Excel(name = "主键") + private String id; + @Excel(name = "党员ID") + private String partyId; + @Excel(name = "标签ID") + private String tagId; + @Excel(name = "乐观锁") + private Integer revision; + @Excel(name = "创建人") + private String createdBy; + @Excel(name = "创建时间") + private Date createdTime; + @Excel(name = "更新人") + private String updatedBy; + @Excel(name = "更新时间") + private Date updatedTime; + @Excel(name = "删除标记") + private String delFlag; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/redis/PartyTagRelationRedis.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/redis/PartyTagRelationRedis.java new file mode 100755 index 000000000..e2bde59e9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/redis/PartyTagRelationRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 党员标签关系表 + * + * @author Mark sunlightcs@gmail.com + * @since v1.0.0 2019-09-04 + */ +@Component +public class PartyTagRelationRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PartyMembersService.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PartyMembersService.java index 3c3969e5a..58097743c 100755 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PartyMembersService.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PartyMembersService.java @@ -19,6 +19,7 @@ package com.elink.esua.epdc.service; import com.elink.esua.epdc.commons.mybatis.service.BaseService; import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.PartyMembersDTO; import com.elink.esua.epdc.entity.PartyMembersEntity; @@ -35,7 +36,7 @@ public interface PartyMembersService extends BaseService { PageData page(Map params); - PageData pageDIY(Map params); + Result> pageDIY(Map params); List list(Map params); diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PartyTagRelationService.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PartyTagRelationService.java new file mode 100755 index 000000000..2a82e316e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PartyTagRelationService.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.PartyTagRelationDTO; +import com.elink.esua.epdc.entity.PartyTagRelationEntity; + +import java.util.List; +import java.util.Map; + +/** + * 党员标签关系表 + * + * @author Mark sunlightcs@gmail.com + * @since v1.0.0 2019-09-04 + */ +public interface PartyTagRelationService extends BaseService { + + PageData page(Map params); + + List list(Map params); + + PartyTagRelationDTO get(String id); + + void save(PartyTagRelationDTO dto); + + void update(PartyTagRelationDTO dto); + + void delete(String[] ids); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PartyMembersServiceImpl.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PartyMembersServiceImpl.java index 771e82db9..e442eee5c 100755 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PartyMembersServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PartyMembersServiceImpl.java @@ -17,6 +17,9 @@ package com.elink.esua.epdc.service.impl; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.elink.esua.epdc.commons.mybatis.enums.DelFlagEnum; @@ -25,11 +28,14 @@ import com.elink.esua.epdc.commons.tools.constant.Constant; import com.elink.esua.epdc.commons.tools.exception.RenException; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dao.PartyMembersDao; import com.elink.esua.epdc.dto.PartyMembersDTO; +import com.elink.esua.epdc.dto.PartyTagRelationDTO; import com.elink.esua.epdc.entity.PartyMembersEntity; import com.elink.esua.epdc.redis.PartyMembersRedis; import com.elink.esua.epdc.service.PartyMembersService; +import com.elink.esua.epdc.service.PartyTagRelationService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -47,8 +53,11 @@ import java.util.Map; */ @Service public class PartyMembersServiceImpl extends BaseServiceImpl implements PartyMembersService { + @Autowired private PartyMembersRedis partyMembersRedis; + @Autowired + private PartyTagRelationService partyTagRelationService; @Override public PageData page(Map params) { @@ -61,10 +70,10 @@ public class PartyMembersServiceImpl extends BaseServiceImpl pageDIY(Map params) { - //IPage page = getPage(params); - - return null; + public Result> pageDIY(Map params) { + IPage page = getPage(params); + List list = baseDao.pageDIY(params); + return new Result>().ok(new PageData<>(list,page.getTotal())); } @Override @@ -86,17 +95,27 @@ public class PartyMembersServiceImpl extends BaseServiceImpl + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.enums.DelFlagEnum; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.exception.RenException; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.dao.PartyTagRelationDao; +import com.elink.esua.epdc.dto.PartyTagRelationDTO; +import com.elink.esua.epdc.entity.PartyTagRelationEntity; +import com.elink.esua.epdc.redis.PartyTagRelationRedis; +import com.elink.esua.epdc.service.PartyTagRelationService; +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 Mark sunlightcs@gmail.com + * @since v1.0.0 2019-09-04 + */ +@Service +public class PartyTagRelationServiceImpl extends BaseServiceImpl implements PartyTagRelationService { + @Autowired + private PartyTagRelationRedis partyTagRelationRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, Constant.CREATED_TIME, false), + getWrapper(params) + ); + + return getPageData(page, PartyTagRelationDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PartyTagRelationDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get("id"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), "id", id); + //wrapper.eq(Constant.DEL_FLAG, DelFlagEnum.NORMAL.value()); + + return wrapper; + } + + @Override + public PartyTagRelationDTO get(String id) { + PartyTagRelationEntity entity = baseDao.selectById(id); + + return ConvertUtils.sourceToTarget(entity, PartyTagRelationDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PartyTagRelationDTO dto) { + PartyTagRelationEntity entity = ConvertUtils.sourceToTarget(dto, PartyTagRelationEntity.class); + + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PartyTagRelationDTO dto) { + PartyTagRelationEntity entity = ConvertUtils.sourceToTarget(dto, PartyTagRelationEntity.class); + + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + //逻辑删除 + //logicDelete(ids, PartyTagRelationEntity.class); + + //物理删除 + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PartyMembersDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PartyMembersDao.xml index eaac392ed..97da21ac0 100755 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PartyMembersDao.xml +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PartyMembersDao.xml @@ -9,7 +9,7 @@ - + @@ -30,13 +30,13 @@ - + - + @@ -56,8 +56,51 @@ + + + diff --git a/esua-epdc/epdc-module/pom.xml b/esua-epdc/epdc-module/pom.xml index 3897c8f95..68c359200 100644 --- a/esua-epdc/epdc-module/pom.xml +++ b/esua-epdc/epdc-module/pom.xml @@ -21,7 +21,7 @@ epdc-api epdc-heart epdc-news - epdc-issue + epdc-events epdc-neighbor epdc-services epdc-app diff --git a/renren-cloud-generator/src/main/resources/application.yml b/renren-cloud-generator/src/main/resources/application.yml index 61f108e3f..f88851291 100644 --- a/renren-cloud-generator/src/main/resources/application.yml +++ b/renren-cloud-generator/src/main/resources/application.yml @@ -9,7 +9,7 @@ spring: type: com.alibaba.druid.pool.DruidDataSource #MySQL配置 driverClassName: com.mysql.jdbc.Driver - url: jdbc:mysql://47.104.224.45:3308/esua_epdc_user?useUnicode=true&characterEncoding=UTF-8&useSSL=false + url: jdbc:mysql://47.104.224.45:3308/esua_epdc_news?useUnicode=true&characterEncoding=UTF-8&useSSL=false username: epdc password: elink833066 #oracle配置 diff --git a/renren-cloud-generator/src/main/resources/generator.properties b/renren-cloud-generator/src/main/resources/generator.properties index f3773c04a..d04d3682d 100644 --- a/renren-cloud-generator/src/main/resources/generator.properties +++ b/renren-cloud-generator/src/main/resources/generator.properties @@ -1,15 +1,15 @@ #\u4EE3\u7801\u751F\u6210\u5668\uFF0C\u914D\u7F6E\u4FE1\u606F -main=com.elink.esua.epdc +main= #\u5305\u540D -package=com.elink.esua -moduleName=epdc +package=com.elink.esua.epdc +moduleName= #\u4F5C\u8005 -author=qu +author=yujintao #\u7248\u672C\u53F7 version=v1.0.0 #Email -email=qu@gmail.com +email=yujintao@elink-cn.com #\u8868\u524D\u7F00(\u7C7B\u540D\u4E0D\u4F1A\u5305\u542B\u8868\u524D\u7F00) tablePrefix=epdc_ diff --git a/renren-cloud-generator/src/main/resources/template/Controller.java.vm b/renren-cloud-generator/src/main/resources/template/Controller.java.vm index aef445590..f12a2030d 100644 --- a/renren-cloud-generator/src/main/resources/template/Controller.java.vm +++ b/renren-cloud-generator/src/main/resources/template/Controller.java.vm @@ -28,8 +28,6 @@ import ${main}.commons.tools.validator.group.DefaultGroup; import ${package}.dto.${className}DTO; import ${package}.excel.${className}Excel; import ${package}.service.${className}Service; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -46,71 +44,50 @@ import java.util.Map; */ @RestController @RequestMapping("${moduleName}/${pathName}") -@Api(tags="${comments}") public class ${className}Controller { + @Autowired private ${className}Service ${classname}Service; @GetMapping("page") - @ApiOperation("分页") - @ApiImplicitParams({ - @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , - @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") , - @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") , - @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") - }) - public Result> page(@ApiIgnore @RequestParam Map params){ + public Result> page(@RequestParam Map params){ PageData<${className}DTO> page = ${classname}Service.page(params); - return new Result>().ok(page); } @GetMapping("{id}") - @ApiOperation("信息") public Result<${className}DTO> get(@PathVariable("id") String id){ ${className}DTO data = ${classname}Service.get(id); - return new Result<${className}DTO>().ok(data); } @PostMapping - @ApiOperation("保存") public Result save(@RequestBody ${className}DTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - ${classname}Service.save(dto); - return new Result(); } @PutMapping - @ApiOperation("修改") public Result update(@RequestBody ${className}DTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - ${classname}Service.update(dto); - return new Result(); } @DeleteMapping - @ApiOperation("删除") public Result delete(@RequestBody String[] ids){ //效验数据 AssertUtils.isArrayEmpty(ids, "id"); - ${classname}Service.delete(ids); - return new Result(); } @GetMapping("export") - @ApiOperation("导出") - public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { List<${className}DTO> list = ${classname}Service.list(params); - ExcelUtils.exportExcelToTarget(response, null, list, ${className}Excel.class); } diff --git a/renren-cloud-generator/src/main/resources/template/DTO.java.vm b/renren-cloud-generator/src/main/resources/template/DTO.java.vm index 186eaf379..83d0e1db5 100644 --- a/renren-cloud-generator/src/main/resources/template/DTO.java.vm +++ b/renren-cloud-generator/src/main/resources/template/DTO.java.vm @@ -17,9 +17,6 @@ package ${package}.dto; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - import java.io.Serializable; import java.util.Date; import lombok.Data; @@ -35,12 +32,14 @@ import java.math.BigDecimal; * @since ${version} ${date} */ @Data -@ApiModel(value = "${comments}") public class ${className}DTO implements Serializable { + private static final long serialVersionUID = 1L; #foreach ($column in $columns) - @ApiModelProperty(value = "$column.comments") + /** + * $column.comments + */ private $column.attrType $column.attrname; #end diff --git a/renren-cloud-generator/src/main/resources/template/Entity.java.vm b/renren-cloud-generator/src/main/resources/template/Entity.java.vm index 3773d95bb..78f0b951e 100644 --- a/renren-cloud-generator/src/main/resources/template/Entity.java.vm +++ b/renren-cloud-generator/src/main/resources/template/Entity.java.vm @@ -17,12 +17,9 @@ package ${package}.entity; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; -import ${main}.commons.mybatis.entity.BaseEntity; +import ${main}.commons.mybatis.entity.BaseEpdcEntity; import lombok.Data; import lombok.EqualsAndHashCode; @@ -40,15 +37,17 @@ import java.util.Date; @Data @EqualsAndHashCode(callSuper=false) @TableName("${tableName}") -public class ${className}Entity extends BaseEntity { +public class ${className}Entity extends BaseEpdcEntity { + private static final long serialVersionUID = 1L; #foreach ($column in $columns) -#if($column.columnName != 'id' && $column.columnName != 'creator' && $column.columnName != 'create_date') +#if($column.columnName != 'ID' && $column.columnName != 'CREATED_TIME' && $column.columnName != 'CREATED_BY' && $column.columnName != 'UPDATED_TIME' && $column.columnName != 'UPDATED_BY' && $column.columnName != 'DEL_FLAG') /** * $column.comments */ private $column.attrType $column.attrname; + #end #end } \ No newline at end of file diff --git a/renren-cloud-generator/src/main/resources/template/Excel.java.vm b/renren-cloud-generator/src/main/resources/template/Excel.java.vm index be114909f..eee884747 100644 --- a/renren-cloud-generator/src/main/resources/template/Excel.java.vm +++ b/renren-cloud-generator/src/main/resources/template/Excel.java.vm @@ -33,9 +33,11 @@ import java.util.Date; */ @Data public class ${className}Excel { + #foreach ($column in $columns) @Excel(name = "$!column.comments") private $column.attrType $column.attrname; + #end } \ No newline at end of file diff --git a/renren-cloud-generator/src/main/resources/template/Service.java.vm b/renren-cloud-generator/src/main/resources/template/Service.java.vm index d43bf027c..c1d4cf168 100644 --- a/renren-cloud-generator/src/main/resources/template/Service.java.vm +++ b/renren-cloud-generator/src/main/resources/template/Service.java.vm @@ -33,15 +33,63 @@ import java.util.Map; */ public interface ${className}Service extends BaseService<${className}Entity> { + /** + * 默认分页 + * + * @param params + * @return PageData<${className}DTO> + * @author + * @date + */ PageData<${className}DTO> page(Map params); + /** + * 默认查询 + * + * @param params + * @return java.util.List<${className}DTO> + * @author + * @date + */ List<${className}DTO> list(Map params); + /** + * 单条查询 + * + * @param id + * @return ${className}DTO + * @author + * @date + */ ${className}DTO get(String id); + /** + * 默认保存 + * + * @param dto + * @return void + * @author + * @date + */ void save(${className}DTO dto); + /** + * 默认更新 + * + * @param dto + * @return void + * @author + * @date + */ void update(${className}DTO dto); + /** + * 批量删除 + * + * @param ids + * @return void + * @author + * @date + */ void delete(String[] ids); } \ No newline at end of file diff --git a/renren-cloud-generator/src/main/resources/template/ServiceImpl.java.vm b/renren-cloud-generator/src/main/resources/template/ServiceImpl.java.vm index cbf9143b2..90258609d 100644 --- a/renren-cloud-generator/src/main/resources/template/ServiceImpl.java.vm +++ b/renren-cloud-generator/src/main/resources/template/ServiceImpl.java.vm @@ -19,15 +19,14 @@ package ${package}.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import ${main}.commons.mybatis.enums.DelFlagEnum; +import ${main}.commons.mybatis.enums.EpdcDelFlagEnum; import ${main}.commons.mybatis.service.impl.BaseServiceImpl; -import ${main}.commons.tools.exception.RenException; import ${main}.commons.tools.page.PageData; import ${main}.commons.tools.utils.ConvertUtils; +import ${package}.commons.tools.constant.FieldConstant; import ${package}.dao.${className}Dao; import ${package}.dto.${className}DTO; import ${package}.entity.${className}Entity; -import ${package}.exception.ModuleErrorCode; import ${package}.redis.${className}Redis; import ${package}.service.${className}Service; import org.apache.commons.lang3.StringUtils; @@ -47,16 +46,16 @@ import java.util.Map; */ @Service public class ${className}ServiceImpl extends BaseServiceImpl<${className}Dao, ${className}Entity> implements ${className}Service { + @Autowired private ${className}Redis ${classname}Redis; @Override public PageData<${className}DTO> page(Map params) { IPage<${className}Entity> page = baseDao.selectPage( - getPage(params, Constant.CREATE_DATE, false), + getPage(params, FieldConstant.CREATED_TIME, false), getWrapper(params) ); - return getPageData(page, ${className}DTO.class); } @@ -68,11 +67,11 @@ public class ${className}ServiceImpl extends BaseServiceImpl<${className}Dao, ${ } private QueryWrapper<${className}Entity> getWrapper(Map params){ - String id = (String)params.get("id"); + String id = (String)params.get(FieldConstant.ID_HUMP); QueryWrapper<${className}Entity> wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), "id", id); - //wrapper.eq(Constant.DEL_FLAG, DelFlagEnum.NORMAL.value()); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id) + .eq(FieldConstant.DEL_FLAG, EpdcDelFlagEnum.NORMAL.value()); return wrapper; } @@ -80,7 +79,6 @@ public class ${className}ServiceImpl extends BaseServiceImpl<${className}Dao, ${ @Override public ${className}DTO get(String id) { ${className}Entity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, ${className}DTO.class); } @@ -88,7 +86,6 @@ public class ${className}ServiceImpl extends BaseServiceImpl<${className}Dao, ${ @Transactional(rollbackFor = Exception.class) public void save(${className}DTO dto) { ${className}Entity entity = ConvertUtils.sourceToTarget(dto, ${className}Entity.class); - insert(entity); } @@ -96,7 +93,6 @@ public class ${className}ServiceImpl extends BaseServiceImpl<${className}Dao, ${ @Transactional(rollbackFor = Exception.class) public void update(${className}DTO dto) { ${className}Entity entity = ConvertUtils.sourceToTarget(dto, ${className}Entity.class); - updateById(entity); } @@ -105,7 +101,6 @@ public class ${className}ServiceImpl extends BaseServiceImpl<${className}Dao, ${ public void delete(String[] ids) { //逻辑删除 //logicDelete(ids, ${className}Entity.class); - //物理删除 baseDao.deleteBatchIds(Arrays.asList(ids)); }