From 6e9e61bd053afdff2c3090b0f67b8027ae6c619e Mon Sep 17 00:00:00 2001 From: liuchuang <123456> Date: Mon, 25 Jan 2021 16:43:30 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E5=BF=97=E6=84=BF=E8=80=85=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E7=AE=A1=E7=90=86=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc/controller/ApiAppUserController.java | 12 ++ .../esua/epdc/feign/UserFeignClient.java | 14 ++- .../fallback/UserFeignClientFallback.java | 5 + .../esua/epdc/service/AppUserService.java | 21 +++- .../epdc/service/impl/AppUserServiceImpl.java | 5 + .../elink/esua/epdc/dto/VolunteerInfoDTO.java | 5 + .../elink/esua/epdc/dto/VolunteerTagDTO.java | 91 ++++++++++++++ .../epdc/dto/VolunteerTagRelationDTO.java | 81 +++++++++++++ .../form/EpdcAppVolunteerListFormDTO.java | 5 + .../EpdcCompleteVolunteerInfoV2FormDTO.java | 5 + .../epdc/result/VolunteerTagsResultDTO.java | 36 ++++++ .../EpdcAppVolunteerInfoController.java | 18 +++ .../controller/VolunteerInfoController.java | 19 +++ .../controller/VolunteerTagController.java | 84 +++++++++++++ .../VolunteerTagRelationController.java | 87 ++++++++++++++ .../elink/esua/epdc/dao/VolunteerTagDao.java | 44 +++++++ .../epdc/dao/VolunteerTagRelationDao.java | 42 +++++++ .../esua/epdc/entity/VolunteerTagEntity.java | 61 ++++++++++ .../entity/VolunteerTagRelationEntity.java | 51 ++++++++ .../epdc/service/VolunteerInfoService.java | 4 +- .../service/VolunteerTagRelationService.java | 104 ++++++++++++++++ .../epdc/service/VolunteerTagService.java | 105 +++++++++++++++++ .../impl/VolunteerInfoServiceImpl.java | 23 +++- .../impl/VolunteerTagRelationServiceImpl.java | 111 ++++++++++++++++++ .../service/impl/VolunteerTagServiceImpl.java | 106 +++++++++++++++++ .../resources/mapper/VolunteerInfoDao.xml | 9 +- .../main/resources/mapper/VolunteerTagDao.xml | 24 ++++ .../mapper/VolunteerTagRelationDao.xml | 22 ++++ 28 files changed, 1179 insertions(+), 15 deletions(-) create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/VolunteerTagDTO.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/VolunteerTagRelationDTO.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/VolunteerTagsResultDTO.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/VolunteerTagController.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/VolunteerTagRelationController.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerTagDao.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerTagRelationDao.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/VolunteerTagEntity.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/VolunteerTagRelationEntity.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerTagRelationService.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerTagService.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerTagRelationServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerTagServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerTagDao.xml create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerTagRelationDao.xml diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppUserController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppUserController.java index 517bb39d..25b5f75e 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppUserController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppUserController.java @@ -415,4 +415,16 @@ public class ApiAppUserController { } return appUserService.getPointsByUserId(userDetail); } + + /** + * 志愿者标签 + * + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author Liuchuang + * @since 2021/1/25 15:03 + */ + @GetMapping("volunteer/tags") + public Result> getVolunteerTags() { + return appUserService.listOfVolunteerTags(); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java index 039d76d8..c7b33fa9 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java @@ -369,7 +369,7 @@ public interface UserFeignClient { @PostMapping(value = "app-user/epdc-app/user/needCachingUserInfo", consumes = MediaType.APPLICATION_JSON_VALUE) Result needCachingUserInfo(EpdcAppQueryUserInfoFormDTO formDTO); - /* + /** * 志愿者列表 v2 * @param dto * @return com.elink.esua.epdc.commons.tools.utils.Result> @@ -380,7 +380,7 @@ public interface UserFeignClient { Result listVolunteerV2(EpdcAppVolunteerListFormDTO dto); - /* + /** * 志愿者列表 * @param dto * @return com.elink.esua.epdc.commons.tools.utils.Result> @@ -594,4 +594,14 @@ public interface UserFeignClient { @PostMapping(value = "app-user/epdc-app/verificationqrcode/getuserinfobycode", consumes = MediaType.APPLICATION_JSON_VALUE) Result getUserInfoByCode(EpdcUserPointsVerificationCheckFormDTO formDto); + /** + * 志愿者标签 + * + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author Liuchuang + * @since 2021/1/25 15:03 + */ + @GetMapping("app-user/epdc-app/volunteerinfo/tags") + Result> getVolunteerTags(); + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java index 0423fd86..e49cd132 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java @@ -288,4 +288,9 @@ public class UserFeignClientFallback implements UserFeignClient { public Result getUserInfoByCode(EpdcUserPointsVerificationCheckFormDTO formDto) { return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "getUserInfoByCode", formDto); } + + @Override + public Result> getVolunteerTags() { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "getVolunteerTags", null); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java index 00361109..4e44115b 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java @@ -261,7 +261,7 @@ public interface AppUserService { */ Result getUserWxPhone(EpdcAppUserMaInfoFormDTO formDto); - /* + /** * 志愿者列表 v2 * @param tokenDto * @param dto @@ -272,7 +272,7 @@ public interface AppUserService { Result listVolunteerV2(TokenDto tokenDto, EpdcAppVolunteerListFormDTO dto); - /* + /** * 志愿者列表 * @param tokenDto * @param dto @@ -362,7 +362,7 @@ public interface AppUserService { **/ Result> gridRanking(EpdcScreenGridRankingFormDTO dto); /** - * @Description 以人找房 + * @Description 以人找房 * @Author songyunpeng * @Date 2020/9/19 * @Param [dto] @@ -370,7 +370,7 @@ public interface AppUserService { **/ Result> selectHouseByPeople(EpdcScreenHouseInfoByPeopleFormDTO dto); /** - * @Description 以房找人接口 + * @Description 以房找人接口 * @Author songyunpeng * @Date 2020/9/19 * @Param [dto] @@ -378,7 +378,7 @@ public interface AppUserService { **/ Result> selectPeopleByHouse(EpdcScreenPopulationInfoByHouseFormDTO dto); /** - * @Description 以人找人接口 + * @Description 以人找人接口 * @Author songyunpeng * @Date 2020/9/19 * @Param [dto] @@ -386,7 +386,7 @@ public interface AppUserService { **/ Result> selectPeopleByCurrentAddress(EpdcScreenResidentInfoByCurrentAddressFormDTO dto); /** - * @Description + * @Description * @Author songyunpeng * @Date 2020/12/9 * @Param [userDetail] @@ -401,4 +401,13 @@ public interface AppUserService { * @return com.elink.esua.epdc.commons.tools.utils.Result **/ Result getPointsByUserId(TokenDto userDetail); + + /** + * 志愿者标签 + * + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author Liuchuang + * @since 2021/1/25 15:03 + */ + Result> listOfVolunteerTags(); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java index 6a5ca76f..7be1c77a 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java @@ -1648,4 +1648,9 @@ public class AppUserServiceImpl implements AppUserService { return userFeignClient.getPointsByUserId(userDetail.getUserId()); } + @Override + public Result> listOfVolunteerTags() { + return userFeignClient.getVolunteerTags(); + } + } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/VolunteerInfoDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/VolunteerInfoDTO.java index 44df7742..914d6be1 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/VolunteerInfoDTO.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/VolunteerInfoDTO.java @@ -217,4 +217,9 @@ public class VolunteerInfoDTO implements Serializable { * 志愿者排序 */ private Integer volunteerOrder; + + /** + * 志愿者标签ID + */ + private String tagId; } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/VolunteerTagDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/VolunteerTagDTO.java new file mode 100644 index 00000000..12408331 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/VolunteerTagDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 志愿者标签表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-01-25 + */ +@Data +public class VolunteerTagDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 标签名称 + */ + private String tagName; + + /** + * 描述 + */ + private String description; + + /** + * 排序 + */ + private Integer sort; + + /** + * 启用标识 0:否,1:是 + */ + private String enableFlag; + + /** + * 删除标识 0:否,1:是 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/VolunteerTagRelationDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/VolunteerTagRelationDTO.java new file mode 100644 index 00000000..be54f023 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/VolunteerTagRelationDTO.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.elink.esua.epdc.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 志愿者标签关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-01-25 + */ +@Data +public class VolunteerTagRelationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 标签ID + */ + private String tagId; + + /** + * 志愿者ID + */ + private String volunteerId; + + /** + * 删除标识 0:否,1:是 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcAppVolunteerListFormDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcAppVolunteerListFormDTO.java index 1b27ed97..a76f1cfb 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcAppVolunteerListFormDTO.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcAppVolunteerListFormDTO.java @@ -35,4 +35,9 @@ public class EpdcAppVolunteerListFormDTO { * 搜索条件:昵称 */ private String nickname; + + /** + * 志愿者标签ID + */ + private String volunteerTagId; } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/v2/EpdcCompleteVolunteerInfoV2FormDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/v2/EpdcCompleteVolunteerInfoV2FormDTO.java index 59c2ea3c..2329a7d0 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/v2/EpdcCompleteVolunteerInfoV2FormDTO.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/v2/EpdcCompleteVolunteerInfoV2FormDTO.java @@ -118,5 +118,10 @@ public class EpdcCompleteVolunteerInfoV2FormDTO implements Serializable { * 志愿者签名 */ private String volunteerSignature; + + /** + * 标签ID + */ + private String volunteerTagId; } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/VolunteerTagsResultDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/VolunteerTagsResultDTO.java new file mode 100644 index 00000000..c17f3771 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/VolunteerTagsResultDTO.java @@ -0,0 +1,36 @@ +package com.elink.esua.epdc.dto.epdc.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 志愿者标签 + * + * @author Liuchuang + * @since 2021/1/25 15:01 + */ +@Data +public class VolunteerTagsResultDTO implements Serializable { + private static final long serialVersionUID = 8355829005926490150L; + + /** + * ID + */ + private String id; + + /** + * 标签名称 + */ + private String tagName; + + /** + * 描述 + */ + private String description; + + /** + * 排序 + */ + private Integer sort; +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppVolunteerInfoController.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppVolunteerInfoController.java index dd7ef36f..99898a5a 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppVolunteerInfoController.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppVolunteerInfoController.java @@ -11,7 +11,9 @@ import com.elink.esua.epdc.dto.epdc.form.v2.EpdcCompleteVolunteerInfoV2FormDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListCountResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; +import com.elink.esua.epdc.dto.epdc.result.VolunteerTagsResultDTO; import com.elink.esua.epdc.service.VolunteerInfoService; +import com.elink.esua.epdc.service.VolunteerTagService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -29,6 +31,9 @@ public class EpdcAppVolunteerInfoController { @Autowired private VolunteerInfoService volunteerInfoService; + @Autowired + private VolunteerTagService volunteerTagService; + /** * 根据用户id 进行志愿者认证 * @param userId @@ -93,4 +98,17 @@ public class EpdcAppVolunteerInfoController { return result; } + /** + * 志愿者标签 + * + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author Liuchuang + * @since 2021/1/25 15:03 + */ + @GetMapping("tags") + public Result> getVolunteerTags() { + List data = volunteerTagService.listOfVolunteerTags(); + return new Result>().ok(data); + } + } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/VolunteerInfoController.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/VolunteerInfoController.java index bef629c1..8d8d6227 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/VolunteerInfoController.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/VolunteerInfoController.java @@ -29,9 +29,11 @@ import com.elink.esua.epdc.dto.VolunteerInfoDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcVolunteerKindnessTimeFormDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcVolunteerKindnessTimeUpdateFormDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO; +import com.elink.esua.epdc.dto.epdc.result.VolunteerTagsResultDTO; import com.elink.esua.epdc.excel.VolunteerInfoExcel; import com.elink.esua.epdc.service.UserTagService; import com.elink.esua.epdc.service.VolunteerInfoService; +import com.elink.esua.epdc.service.VolunteerTagService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -59,6 +61,9 @@ public class VolunteerInfoController { @Autowired private UserTagService userTagService; //标签表 + @Autowired + private VolunteerTagService volunteerTagService; + /** * @Description: 查询志愿者列表数据 * @Param: [params] @@ -126,6 +131,7 @@ public class VolunteerInfoController { VolunteerInfoDTO dto = new VolunteerInfoDTO(); dto.setVolunteerOrder(formDto.getVolunteerOrder()); dto.setId(formDto.getId()); + dto.setTagId(formDto.getTagId()); volunteerInfoService.update(dto); return new Result(); } @@ -238,4 +244,17 @@ public class VolunteerInfoController { return volunteerInfoService.updateKindnessTime(formDto); } + /** + * 志愿者标签 + * + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author Liuchuang + * @since 2021/1/25 16:22 + */ + @GetMapping("getVolunteerTags") + public Result> getVolunteerTags() { + List data = volunteerTagService.listOfVolunteerTags(); + return new Result>().ok(data); + } + } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/VolunteerTagController.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/VolunteerTagController.java new file mode 100644 index 00000000..2acd26b8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/VolunteerTagController.java @@ -0,0 +1,84 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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.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.VolunteerTagDTO; +import com.elink.esua.epdc.service.VolunteerTagService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 志愿者标签表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-01-25 + */ +@RestController +@RequestMapping("volunteertag") +public class VolunteerTagController { + + @Autowired + private VolunteerTagService volunteerTagService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = volunteerTagService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + VolunteerTagDTO data = volunteerTagService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody VolunteerTagDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + volunteerTagService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody VolunteerTagDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + volunteerTagService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + volunteerTagService.delete(ids); + return new Result(); + } + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/VolunteerTagRelationController.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/VolunteerTagRelationController.java new file mode 100644 index 00000000..337ec687 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/VolunteerTagRelationController.java @@ -0,0 +1,87 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.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.VolunteerTagRelationDTO; +import com.elink.esua.epdc.service.VolunteerTagRelationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 志愿者标签关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-01-25 + */ +@RestController +@RequestMapping("volunteertagrelation") +public class VolunteerTagRelationController { + + @Autowired + private VolunteerTagRelationService volunteerTagRelationService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = volunteerTagRelationService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + VolunteerTagRelationDTO data = volunteerTagRelationService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody VolunteerTagRelationDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + volunteerTagRelationService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody VolunteerTagRelationDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + volunteerTagRelationService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + volunteerTagRelationService.delete(ids); + return new Result(); + } + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerTagDao.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerTagDao.java new file mode 100644 index 00000000..8b122dd9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerTagDao.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.epdc.result.VolunteerTagsResultDTO; +import com.elink.esua.epdc.entity.VolunteerTagEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 志愿者标签表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-01-25 + */ +@Mapper +public interface VolunteerTagDao extends BaseDao { + + /** + * 志愿者标签 + * + * @return java.util.List + * @author Liuchuang + * @since 2021/1/25 15:11 + */ + List selectListOfVolunteerTags(); +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerTagRelationDao.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerTagRelationDao.java new file mode 100644 index 00000000..ae09173d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerTagRelationDao.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.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.VolunteerTagRelationEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 志愿者标签关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-01-25 + */ +@Mapper +public interface VolunteerTagRelationDao extends BaseDao { + + /** + * 根据志愿者ID删除志愿者标签 + * + * @param volunteerId 志愿者ID + * @return void + * @author Liuchuang + * @since 2021/1/25 15:47 + */ + void updateDelFlagByVolunteerId(String volunteerId); +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/VolunteerTagEntity.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/VolunteerTagEntity.java new file mode 100644 index 00000000..d959bda0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/VolunteerTagEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 志愿者标签表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-01-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_volunteer_tag") +public class VolunteerTagEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 标签名称 + */ + private String tagName; + + /** + * 描述 + */ + private String description; + + /** + * 排序 + */ + private Integer sort; + + /** + * 启用标识 0:否,1:是 + */ + private String enableFlag; + +} \ 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/VolunteerTagRelationEntity.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/VolunteerTagRelationEntity.java new file mode 100644 index 00000000..3d4151cf --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/VolunteerTagRelationEntity.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License 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.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 志愿者标签关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-01-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_volunteer_tag_relation") +public class VolunteerTagRelationEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 标签ID + */ + private String tagId; + + /** + * 志愿者ID + */ + private String volunteerId; + +} \ 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/VolunteerInfoService.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerInfoService.java index 1bb7769c..06d14863 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerInfoService.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerInfoService.java @@ -211,7 +211,7 @@ public interface VolunteerInfoService extends BaseService { */ Result modifyVolunteerKindnessTime(EpdcVolunteerKindnessTimeFormDTO formDto); - /* + /** * 志愿者列表v2 * @param dto * @return com.elink.esua.epdc.commons.tools.utils.Result> @@ -221,7 +221,7 @@ public interface VolunteerInfoService extends BaseService { Result listVolunteerV2(EpdcAppVolunteerListFormDTO dto); - /* + /** * 志愿者列表 * @param dto * @return com.elink.esua.epdc.commons.tools.utils.Result> diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerTagRelationService.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerTagRelationService.java new file mode 100644 index 00000000..09714cfc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerTagRelationService.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.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.VolunteerTagRelationDTO; +import com.elink.esua.epdc.entity.VolunteerTagRelationEntity; + +import java.util.List; +import java.util.Map; + +/** + * 志愿者标签关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-01-25 + */ +public interface VolunteerTagRelationService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-01-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-01-25 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return VolunteerTagRelationDTO + * @author generator + * @date 2021-01-25 + */ + VolunteerTagRelationDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-01-25 + */ + void save(VolunteerTagRelationDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-01-25 + */ + void update(VolunteerTagRelationDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-01-25 + */ + void delete(String[] ids); + + /** + * 更新志愿者标签 + * + * @return boolean + * @author Liuchuang + * @since 2021/1/25 15:42 + */ + boolean insertOrUpdateVolunteerTag(VolunteerTagRelationDTO tagDto); +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerTagService.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerTagService.java new file mode 100644 index 00000000..1dc29840 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerTagService.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.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.VolunteerTagDTO; +import com.elink.esua.epdc.dto.epdc.result.VolunteerTagsResultDTO; +import com.elink.esua.epdc.entity.VolunteerTagEntity; + +import java.util.List; +import java.util.Map; + +/** + * 志愿者标签表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-01-25 + */ +public interface VolunteerTagService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-01-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-01-25 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return VolunteerTagDTO + * @author generator + * @date 2021-01-25 + */ + VolunteerTagDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-01-25 + */ + void save(VolunteerTagDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-01-25 + */ + void update(VolunteerTagDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-01-25 + */ + void delete(String[] ids); + + /** + * 志愿者标签 + * + * @return java.util.List + * @author Liuchuang + * @since 2021/1/25 15:09 + */ + List listOfVolunteerTags(); +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerInfoServiceImpl.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerInfoServiceImpl.java index 500a09c2..c8d53b28 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerInfoServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerInfoServiceImpl.java @@ -33,9 +33,7 @@ import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.constant.UserFieldConsant; import com.elink.esua.epdc.constant.VolunteerInfoNoticeConstant; import com.elink.esua.epdc.dao.VolunteerInfoDao; -import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; -import com.elink.esua.epdc.dto.UserTagDTO; -import com.elink.esua.epdc.dto.VolunteerInfoDTO; +import com.elink.esua.epdc.dto.*; import com.elink.esua.epdc.dto.epdc.form.*; import com.elink.esua.epdc.dto.epdc.form.v2.EpdcCompleteVolunteerInfoV2FormDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO; @@ -47,6 +45,8 @@ import com.elink.esua.epdc.feign.AdminFeignClient; import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO; import com.elink.esua.epdc.service.UserTagRelationService; import com.elink.esua.epdc.service.VolunteerInfoService; +import com.elink.esua.epdc.service.VolunteerTagRelationService; +import com.elink.esua.epdc.service.VolunteerTagService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -70,7 +70,10 @@ public class VolunteerInfoServiceImpl 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.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.dao.VolunteerTagRelationDao; +import com.elink.esua.epdc.dto.VolunteerTagRelationDTO; +import com.elink.esua.epdc.entity.VolunteerTagRelationEntity; +import com.elink.esua.epdc.service.VolunteerTagRelationService; +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 qu qu@elink-cn.com + * @since v1.0.0 2021-01-25 + */ +@Service +public class VolunteerTagRelationServiceImpl extends BaseServiceImpl implements VolunteerTagRelationService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, VolunteerTagRelationDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, VolunteerTagRelationDTO.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 VolunteerTagRelationDTO get(String id) { + VolunteerTagRelationEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, VolunteerTagRelationDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(VolunteerTagRelationDTO dto) { + VolunteerTagRelationEntity entity = ConvertUtils.sourceToTarget(dto, VolunteerTagRelationEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(VolunteerTagRelationDTO dto) { + VolunteerTagRelationEntity entity = ConvertUtils.sourceToTarget(dto, VolunteerTagRelationEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean insertOrUpdateVolunteerTag(VolunteerTagRelationDTO tagDto) { + // 删除已绑定志愿者标签 + baseDao.updateDelFlagByVolunteerId(tagDto.getVolunteerId()); + // 插入新志愿者标签 + VolunteerTagRelationEntity entity = new VolunteerTagRelationEntity(); + entity.setVolunteerId(tagDto.getVolunteerId()); + entity.setTagId(tagDto.getTagId()); + return insert(entity); + } + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerTagServiceImpl.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerTagServiceImpl.java new file mode 100644 index 00000000..0e4c627a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerTagServiceImpl.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.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.dao.VolunteerTagDao; +import com.elink.esua.epdc.dto.VolunteerTagDTO; +import com.elink.esua.epdc.dto.epdc.result.VolunteerTagsResultDTO; +import com.elink.esua.epdc.entity.VolunteerTagEntity; +import com.elink.esua.epdc.service.VolunteerTagService; +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 qu qu@elink-cn.com + * @since v1.0.0 2021-01-25 + */ +@Service +public class VolunteerTagServiceImpl extends BaseServiceImpl implements VolunteerTagService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, "", false), + getWrapper(params) + ); + return getPageData(page, VolunteerTagDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, VolunteerTagDTO.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); + wrapper.orderByAsc("SORT"); + + return wrapper; + } + + @Override + public VolunteerTagDTO get(String id) { + VolunteerTagEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, VolunteerTagDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(VolunteerTagDTO dto) { + VolunteerTagEntity entity = ConvertUtils.sourceToTarget(dto, VolunteerTagEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(VolunteerTagDTO dto) { + VolunteerTagEntity entity = ConvertUtils.sourceToTarget(dto, VolunteerTagEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public List listOfVolunteerTags() { + return baseDao.selectListOfVolunteerTags(); + } + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml index 02fb796f..327fa1f6 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml @@ -110,9 +110,11 @@ u.POINTS points, date_format(v.REGIST_TIME,'%Y.%m.%d %H.%i') registTimeString, v.REGIST_TIME registTime, - v.VOLUNTEER_ORDER volunteerOrder + v.VOLUNTEER_ORDER volunteerOrder, + vt.TAG_ID FROM epdc_volunteer_info v left join epdc_user u on v.USER_ID = u.ID + left join epdc_volunteer_tag_relation vt on vt.VOLUNTEER_ID = v.ID and vt.DEL_FLAG = '0' where v.ID = #{id} @@ -225,12 +227,17 @@ v.VOLUNTEER_SIGNATURE volunteerSignature FROM epdc_volunteer_info v + LEFT JOIN epdc_volunteer_tag_relation vt ON vt.VOLUNTEER_ID = v.ID + AND vt.DEL_FLAG = '0' WHERE v.DEL_FLAG = 0 AND v.AUDIT_STATUS != 2 AND v.VOLUNTEER_NICKNAME like concat('%', #{nickname}, '%') + + AND vt.TAG_ID = #{volunteerTagId} + ORDER BY v.VOLUNTEER_ORDER ASC ,CONVERT(v.VOLUNTEER_NICKNAME USING gbk) LIMIT #{pageIndex},#{pageSize} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerTagDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerTagDao.xml new file mode 100644 index 00000000..09ddc12b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerTagDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerTagRelationDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerTagRelationDao.xml new file mode 100644 index 00000000..40ec1ae6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerTagRelationDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + UPDATE epdc_volunteer_tag_relation SET DEL_FLAG = '1' WHERE VOLUNTEER_ID = #{volunteerId} + + + From 3aa66536ead676dc7d1239bd43043a90a2fec318 Mon Sep 17 00:00:00 2001 From: liuchuang <123456> Date: Tue, 26 Jan 2021 14:34:43 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=BF=97=E6=84=BF=E8=80=85=E6=A0=87=E7=AD=BE=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../elink/esua/epdc/dto/result/EpdcCompleteUserInfoDTO.java | 5 +++++ .../com/elink/esua/epdc/service/impl/AppUserServiceImpl.java | 1 + .../src/main/resources/mapper/VolunteerInfoDao.xml | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcCompleteUserInfoDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcCompleteUserInfoDTO.java index a2ba7ae8..469cfea3 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcCompleteUserInfoDTO.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcCompleteUserInfoDTO.java @@ -93,4 +93,9 @@ public class EpdcCompleteUserInfoDTO implements Serializable { * 自我介绍 */ private String introduce; + + /** + * 志愿者标签 + */ + private String volunteerTagId; } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java index 7be1c77a..e44a9900 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java @@ -892,6 +892,7 @@ public class AppUserServiceImpl implements AppUserService { dto.setVolunteerNickname(volunteerInfoDTO.getData().getVolunteerNickname()); dto.setVolunteerSignature(volunteerInfoDTO.getData().getVolunteerSignature()); dto.setIntroduce(volunteerInfoDTO.getData().getIntroduce()); + dto.setVolunteerTagId(volunteerInfoDTO.getData().getTagId()); // 如果用户表的身份证号为空,则尝试使用志愿者表中的身份证 if (null == dto.getIdentityNo() || "".equals(dto.getIdentityNo())) { dto.setIdentityNo(volunteerInfoDTO.getData().getIdentityNo()); diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml index 327fa1f6..29569058 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml @@ -204,8 +204,10 @@ From 665d24f63114ccb4d22d5bd18f9e210469585540 Mon Sep 17 00:00:00 2001 From: songyunpeng Date: Thu, 28 Jan 2021 18:19:28 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E9=80=9A=E7=9F=A5=E7=B1=BB=E5=88=AB?= =?UTF-8?q?=E6=8E=92=E5=BA=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/ModuleCategoryDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/resources/mapper/ModuleCategoryDao.xml b/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/resources/mapper/ModuleCategoryDao.xml index 82cb89f6..abae1d1e 100644 --- a/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/resources/mapper/ModuleCategoryDao.xml +++ b/esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/resources/mapper/ModuleCategoryDao.xml @@ -65,7 +65,7 @@ SORT from epdc_module_category where DEL_FLAG='0' and ENABLE_FLAG ='1' and PID = #{pid} - order by UPDATED_TIME desc,sort + order by sort,UPDATED_TIME desc LIMIT #{pageIndex},#{pageSize} - + SELECT + COUNT(t.userId) + FROM (SELECT + u.ID as userId, + u.NICKNAME as nickname, + u.REGISTER_TIME as registerTime, + u.FACE_IMG as faceImg + FROM + ( + select u.ID, + u.NICKNAME , + u.FACE_IMG, + if(u.DEPT_ID is null or u.DEPT_ID= '0',ug.GRID_ID,u.DEPT_ID) as GRID_ID, + u.REGISTER_TIME from epdc_user u + LEFT JOIN ( select * from (select * from epdc_user_grid_relation order by CREATED_TIME)t group by t.USER_ID)ug ON ug.USER_ID = u.ID AND ug.DEL_FLAG = '0' + where u.DEL_FLAG ='0' and u.PARTY_FLAG = '0' AND u.STATE = '1' and (u.IDENTITY_NO is null or u.IDENTITY_NO = '') + )u + WHERE + + u.GRID_ID = #{gridId} + + u.GRID_ID in + + #{item} + + + + GROUP BY + u.ID + ORDER BY u.REGISTER_TIME DESC) t From 684ea9fed4c66c3666a6b91c6cdded15de5253bd Mon Sep 17 00:00:00 2001 From: songyunpeng Date: Fri, 5 Feb 2021 09:58:36 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E7=A7=AF=E5=88=86bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/aop/UserBehaviorAop.java | 7 ++- .../esua/epdc/feign/UsersFeignClient.java | 10 +++++ .../fallback/UsersFeignClientFallback.java | 5 +++ .../esua/epdc/mq/PointsModifyConsumer.java | 45 ++++++++++++------- 4 files changed, 50 insertions(+), 17 deletions(-) diff --git a/esua-epdc/epdc-commons/epdc-commons-points-tools/src/main/java/com/elink/esua/epdc/pointcommons/tools/aop/UserBehaviorAop.java b/esua-epdc/epdc-commons/epdc-commons-points-tools/src/main/java/com/elink/esua/epdc/pointcommons/tools/aop/UserBehaviorAop.java index 6bb2d401..de5763f4 100644 --- a/esua-epdc/epdc-commons/epdc-commons-points-tools/src/main/java/com/elink/esua/epdc/pointcommons/tools/aop/UserBehaviorAop.java +++ b/esua-epdc/epdc-commons/epdc-commons-points-tools/src/main/java/com/elink/esua/epdc/pointcommons/tools/aop/UserBehaviorAop.java @@ -165,7 +165,12 @@ public class UserBehaviorAop { behaviorDto.setBehavior(behaviorCode); behaviorDto.setReferenceId(referenceId); behaviorDto.setUserId(userId); - behaviorDto.setGridId(Long.parseLong(gridId)); + try { + behaviorDto.setGridId(Long.parseLong(gridId)); + }catch (Exception e){ + //如果网格ID获取失败 赋值为0L + behaviorDto.setGridId(0L); + } behaviorDto.setOperationTime(new Date()); log.info("动作发送信息:动作编码:"+behaviorCode+" 用户ID:"+userId+",业务ID:"+referenceId+",网格ID:"+gridId+",操作时间:"+behaviorDto.getOperationTime()); //发送mq diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/feign/UsersFeignClient.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/feign/UsersFeignClient.java index a1c8f1a5..47d41623 100644 --- a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/feign/UsersFeignClient.java +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/feign/UsersFeignClient.java @@ -66,5 +66,15 @@ public interface UsersFeignClient { **/ @GetMapping(value = "app-user/epdc-app/user/getUserGridIdByUserId/{userId}", consumes = MediaType.APPLICATION_JSON_VALUE) Result getUserGridIdByUserId(@PathVariable String userId); + + /** + * @Description 获取用户第一次扫码网格的信息 + * @Author songyunpeng + * @Date 2020/6/2 + * @Param [userId] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @GetMapping(value = "app-user/usergrid/getUserFirstScanGird/{userId}", consumes = MediaType.APPLICATION_JSON_VALUE) + Result getUserFirstScanGird(@PathVariable("userId") String userId); } diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/feign/fallback/UsersFeignClientFallback.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/feign/fallback/UsersFeignClientFallback.java index dc258cb6..ef21e6da 100644 --- a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/feign/fallback/UsersFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/feign/fallback/UsersFeignClientFallback.java @@ -41,4 +41,9 @@ public class UsersFeignClientFallback implements UsersFeignClient { return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "getUserGridIdByUserId", userId); } + @Override + public Result getUserFirstScanGird(String userId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "getUserFirstScanGird", userId); + } + } diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/mq/PointsModifyConsumer.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/mq/PointsModifyConsumer.java index e0a339da..0296e9b0 100644 --- a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/mq/PointsModifyConsumer.java +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/mq/PointsModifyConsumer.java @@ -2,11 +2,11 @@ package com.elink.esua.epdc.mq; import com.alibaba.fastjson.JSONObject; import com.elink.esua.epdc.commons.tools.constant.RocketMqConstant; -import com.elink.esua.epdc.commons.tools.exception.RenException; import com.elink.esua.epdc.commons.tools.security.content.dto.form.ParentAndAllDeptDTO; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.UserDTO; +import com.elink.esua.epdc.dto.UserGridRelationDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcUserPointsFormDTO; import com.elink.esua.epdc.dto.form.PointsLogsAddFormDTO; import com.elink.esua.epdc.dto.form.PointsLogsFormDTO; @@ -85,7 +85,7 @@ public class PointsModifyConsumer implements RocketMQListener { String body = new String(messageExt.getBody(), charset); BehaviorDto dto = JSONObject.parseObject(body, BehaviorDto.class); String info = this.handlePoints(dto); - log.info("EPDC-POINTS-SERVER消费消息END:{topic:{}, msgId:{}, body:{}, info:{}}", RocketMqConstant.MQ_TOPIC_ORGANIZATION, messageExt.getMsgId(), body,info); + log.info("EPDC-POINTS-SERVER消费消息END:{topic:{}, msgId:{}, body:{}, info:{}}", RocketMqConstant.MQ_TOPIC_ORGANIZATION, messageExt.getMsgId(), body, info); } catch (Exception e) { log.info("EPDC-POINTS-SERVER消费消息失败:msgId:{}", messageExt.getMsgId()); e.printStackTrace(); @@ -114,7 +114,7 @@ public class PointsModifyConsumer implements RocketMQListener { if (pointsRuleResultDTO == null) { return "获取积分规则失败"; } - if(pointsRuleResultDTO.getUpperLimitVal() == 0){ + if (pointsRuleResultDTO.getUpperLimitVal() == 0) { return "积分限值为0,无法加分"; } pointsLogsFormDTO.setRuleCode(pointsRuleResultDTO.getRuleCode()); @@ -179,7 +179,7 @@ public class PointsModifyConsumer implements RocketMQListener { //添加操作日志 -- 开始 addRuleLog(pointsRuleResultDTO, dto, userDTO); //添加操作日志 -- 结束 - return "积分操作成功!动作描述:"+pointsRuleResultDTO.getBehaviorDesc() +" 积分描述:"+pointsRuleResultDTO.getRuleDesc() +" 分数统计:" +pointsRuleResultDTO.getPoints(); + return "积分操作成功!动作描述:" + pointsRuleResultDTO.getBehaviorDesc() + " 积分描述:" + pointsRuleResultDTO.getRuleDesc() + " 分数统计:" + pointsRuleResultDTO.getPoints(); } private void addRuleLog(PointsRuleResultDTO pointsRuleResultDTO, BehaviorDto dto, UserDTO userDTO) { @@ -195,20 +195,33 @@ public class PointsModifyConsumer implements RocketMQListener { pointsLogsAddFormDTO.setOperationDesc(pointsRuleResultDTO.getRuleDesc()); pointsLogsAddFormDTO.setOperationTime(dto.getOperationTime()); pointsLogsAddFormDTO.setOperationMode("user"); - if(dto.getGridId()!=null){ - pointsLogsAddFormDTO.setGridId(dto.getGridId()); - Result parentAndAllDept = adminFeignClient.getParentAndAllDept(dto.getGridId()); - if(parentAndAllDept==null || parentAndAllDept.getData()==null){ - throw new RenException("获取所属部门信息失败!"); + if (dto.getGridId() != null) { + if (0L == dto.getGridId()) { + //用户网格ID为空,获取第一次扫码网格 + Result userFirstScanGird = usersFeignClient.getUserFirstScanGird(dto.getUserId()); + if (userFirstScanGird != null && userFirstScanGird.getData() != null) { + UserGridRelationDTO userGridRelationDTO = new UserGridRelationDTO(); + pointsLogsAddFormDTO.setGridId(userGridRelationDTO.getGridId()); + pointsLogsAddFormDTO.setGrid(userGridRelationDTO.getGrid()); + pointsLogsAddFormDTO.setAllDeptIds(userGridRelationDTO.getAllDeptIds()); + pointsLogsAddFormDTO.setAllDeptNames(userGridRelationDTO.getAllDeptNames()); + pointsLogsAddFormDTO.setParentDeptIds(userGridRelationDTO.getParentDeptIds()); + pointsLogsAddFormDTO.setParentDeptNames(userGridRelationDTO.getParentDeptNames()); + } + } else { + Result parentAndAllDept = adminFeignClient.getParentAndAllDept(dto.getGridId()); + if (parentAndAllDept != null || parentAndAllDept.getData() != null) { + ParentAndAllDeptDTO parentAndAllDeptDTO = parentAndAllDept.getData(); + pointsLogsAddFormDTO.setGridId(parentAndAllDeptDTO.getGridId()); + pointsLogsAddFormDTO.setGrid(parentAndAllDeptDTO.getGrid()); + pointsLogsAddFormDTO.setAllDeptIds(parentAndAllDeptDTO.getAllDeptIds()); + pointsLogsAddFormDTO.setAllDeptNames(parentAndAllDeptDTO.getAllDeptNames()); + pointsLogsAddFormDTO.setParentDeptIds(parentAndAllDeptDTO.getParentDeptIds()); + pointsLogsAddFormDTO.setParentDeptNames(parentAndAllDeptDTO.getParentDeptNames()); + } } - ParentAndAllDeptDTO parentAndAllDeptDTO = parentAndAllDept.getData(); - pointsLogsAddFormDTO.setGrid(parentAndAllDeptDTO.getGrid()); - pointsLogsAddFormDTO.setAllDeptIds(parentAndAllDeptDTO.getAllDeptIds()); - pointsLogsAddFormDTO.setAllDeptNames(parentAndAllDeptDTO.getAllDeptNames()); - pointsLogsAddFormDTO.setParentDeptIds(parentAndAllDeptDTO.getParentDeptIds()); - pointsLogsAddFormDTO.setParentDeptNames(parentAndAllDeptDTO.getParentDeptNames()); } - pointsLogsAddFormDTO.setLavePoints(userDTO.getPoints()+pointsRuleResultDTO.getPoints()); + pointsLogsAddFormDTO.setLavePoints(userDTO.getPoints() + pointsRuleResultDTO.getPoints()); PointsLogsEntity pointsLogsEntity = ConvertUtils.sourceToTarget(pointsLogsAddFormDTO, PointsLogsEntity.class); pointsLogsService.insert(pointsLogsEntity); } From c1f44181d252c16656f4f39a889a0e275314f385 Mon Sep 17 00:00:00 2001 From: liuchuang <123456> Date: Mon, 22 Feb 2021 13:52:38 +0800 Subject: [PATCH 9/9] =?UTF-8?q?1=E3=80=81=E9=A1=BA=E9=81=93=E6=8D=8E?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=96=B0=E5=A2=9E=E8=AE=A2=E5=8D=95=E7=8A=B6?= =?UTF-8?q?=E6=80=81=202=E3=80=81=E6=8B=BC=E5=9B=A2=E8=B4=AD=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=8F=96=E8=B4=A7=E7=8A=B6=E6=80=81=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../elink/esua/epdc/dto/GroupBuyInfoDTO.java | 5 ++++ .../dto/form/EpdcAddGroupBuyInfoFormDTO.java | 8 ++++++- .../EpdcSelectGroupBuyDetailResultDTO.java | 7 +++++- .../EpdcSelectGroupBuyInfoListResultDTO.java | 7 ++++-- ...SelectMyGroupBuyJoinInfoListResultDTO.java | 7 +++++- ...ectMyGroupBuyPublishInfoListResultDTO.java | 6 ++++- .../EpdcSelectSdsInfoListResultDTO.java | 7 +++++- .../groupbuy/entity/GroupBuyInfoEntity.java | 6 ++++- .../service/impl/GroupBuyInfoServiceImpl.java | 20 +++++++++------- .../mapper/groupBuy/GroupBuyInfoDao.xml | 24 ++++++++++++++----- .../main/resources/mapper/sds/SdsInfoDao.xml | 5 ++-- 11 files changed, 77 insertions(+), 25 deletions(-) diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/GroupBuyInfoDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/GroupBuyInfoDTO.java index 972c386e..b5a75faf 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/GroupBuyInfoDTO.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/GroupBuyInfoDTO.java @@ -207,4 +207,9 @@ public class GroupBuyInfoDTO implements Serializable { */ List images; + /** + * 取货方式:1-包邮,2-自提 + */ + private Integer pickupMethod; + } diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAddGroupBuyInfoFormDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAddGroupBuyInfoFormDTO.java index 0dec3d14..77910054 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAddGroupBuyInfoFormDTO.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAddGroupBuyInfoFormDTO.java @@ -140,4 +140,10 @@ public class EpdcAddGroupBuyInfoFormDTO implements Serializable { private Boolean isConReview = false; -} \ No newline at end of file + /** + * 取货方式:1-包邮,2-自提 + */ + @NotNull(message = "取货方式不能为空") + private Integer pickupMethod; + +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSelectGroupBuyDetailResultDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSelectGroupBuyDetailResultDTO.java index 7e14aa79..31507c89 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSelectGroupBuyDetailResultDTO.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSelectGroupBuyDetailResultDTO.java @@ -93,4 +93,9 @@ public class EpdcSelectGroupBuyDetailResultDTO implements Serializable { */ private List groupBuyPriceNumber; -} \ No newline at end of file + /** + * 取货方式:1-包邮,2-自提 + */ + private Integer pickupMethod; + +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSelectGroupBuyInfoListResultDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSelectGroupBuyInfoListResultDTO.java index 99eb0f01..18f74b3a 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSelectGroupBuyInfoListResultDTO.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSelectGroupBuyInfoListResultDTO.java @@ -65,6 +65,9 @@ public class EpdcSelectGroupBuyInfoListResultDTO implements Serializable { */ private String topFlag; + /** + * 取货方式:1-包邮,2-自提 + */ + private Integer pickupMethod; - -} \ No newline at end of file +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSelectMyGroupBuyJoinInfoListResultDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSelectMyGroupBuyJoinInfoListResultDTO.java index 5c65483e..b5bbf2ba 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSelectMyGroupBuyJoinInfoListResultDTO.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSelectMyGroupBuyJoinInfoListResultDTO.java @@ -65,4 +65,9 @@ public class EpdcSelectMyGroupBuyJoinInfoListResultDTO implements Serializable { */ private List groupBuyImg; -} \ No newline at end of file + /** + * 取货方式:1-包邮,2-自提 + */ + private Integer pickupMethod; + +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSelectMyGroupBuyPublishInfoListResultDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSelectMyGroupBuyPublishInfoListResultDTO.java index a2b2b59a..76cc31c4 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSelectMyGroupBuyPublishInfoListResultDTO.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSelectMyGroupBuyPublishInfoListResultDTO.java @@ -65,5 +65,9 @@ public class EpdcSelectMyGroupBuyPublishInfoListResultDTO implements Serializabl */ private List groupBuyImg; + /** + * 取货方式:1-包邮,2-自提 + */ + private Integer pickupMethod; -} \ No newline at end of file +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSelectSdsInfoListResultDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSelectSdsInfoListResultDTO.java index 84d67481..0be337c5 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSelectSdsInfoListResultDTO.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSelectSdsInfoListResultDTO.java @@ -53,4 +53,9 @@ public class EpdcSelectSdsInfoListResultDTO implements Serializable { * 出发时间 */ private Date departureTime; -} \ No newline at end of file + + /** + * 订单状态:0-进行中,1-已结束 + */ + private Integer status; +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/groupbuy/entity/GroupBuyInfoEntity.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/groupbuy/entity/GroupBuyInfoEntity.java index a10021f1..cf1b5a53 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/groupbuy/entity/GroupBuyInfoEntity.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/groupbuy/entity/GroupBuyInfoEntity.java @@ -22,6 +22,7 @@ import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; import lombok.Data; import lombok.EqualsAndHashCode; +import javax.validation.constraints.NotNull; import java.util.Date; /** @@ -165,6 +166,9 @@ public class GroupBuyInfoEntity extends BaseEpdcEntity { */ private String cancelReason; - + /** + * 取货方式:1-包邮,2-自提 + */ + private Integer pickupMethod; } diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/groupbuy/service/impl/GroupBuyInfoServiceImpl.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/groupbuy/service/impl/GroupBuyInfoServiceImpl.java index 85642796..2ebe3e27 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/groupbuy/service/impl/GroupBuyInfoServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/groupbuy/service/impl/GroupBuyInfoServiceImpl.java @@ -198,6 +198,16 @@ public class GroupBuyInfoServiceImpl extends BaseServiceImpl5){ + return new Result().error("人数价格信息最多填写五条"); + } + if(formDTO.getGroupBuyImg()!=null && formDTO.getGroupBuyImg().size()>3){ + return new Result().error("图片最多上传三张"); + } + //内容审核 - start Boolean isConReview = formDTO.getIsConReview(); List textList = new ArrayList<>(); @@ -223,15 +233,7 @@ public class GroupBuyInfoServiceImpl extends BaseServiceImpl5){ - return new Result().error("人数价格信息最多填写五条"); - } - if(formDTO.getGroupBuyImg()!=null && formDTO.getGroupBuyImg().size()>3){ - return new Result().error("图片最多上传三张"); - } + //插入或更新后插入价格人数和图片表 insertPriceNumAndImgs(groupBuyInfoEntity.getId(),formDTO.getGroupBuyImg(),formDTO.getGroupBuyPriceNumber()); diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/groupBuy/GroupBuyInfoDao.xml b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/groupBuy/GroupBuyInfoDao.xml index 38155591..5422635c 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/groupBuy/GroupBuyInfoDao.xml +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/groupBuy/GroupBuyInfoDao.xml @@ -8,13 +8,14 @@ +