Browse Source

Merge remote-tracking branch 'origin/feature/lc_ptgsds' into feature/syp_workLogs

feature/syp_points
liuchuang 5 years ago
parent
commit
0c4a8d0170
  1. 7
      esua-epdc/epdc-commons/epdc-commons-points-tools/src/main/java/com/elink/esua/epdc/pointcommons/tools/aop/UserBehaviorAop.java
  2. 5
      esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcCompleteUserInfoDTO.java
  3. 12
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppUserController.java
  4. 14
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java
  5. 5
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java
  6. 21
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java
  7. 6
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java
  8. 5
      esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/GroupBuyInfoDTO.java
  9. 8
      esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAddGroupBuyInfoFormDTO.java
  10. 7
      esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSelectGroupBuyDetailResultDTO.java
  11. 7
      esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSelectGroupBuyInfoListResultDTO.java
  12. 7
      esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSelectMyGroupBuyJoinInfoListResultDTO.java
  13. 6
      esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSelectMyGroupBuyPublishInfoListResultDTO.java
  14. 7
      esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSelectSdsInfoListResultDTO.java
  15. 6
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/groupbuy/entity/GroupBuyInfoEntity.java
  16. 20
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/groupbuy/service/impl/GroupBuyInfoServiceImpl.java
  17. 3
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/sds/service/impl/SdsInfoServiceImpl.java
  18. 17
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/logback-spring.xml
  19. 24
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/groupBuy/GroupBuyInfoDao.xml
  20. 5
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/sds/SdsInfoDao.xml
  21. 2
      esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/resources/mapper/ModuleCategoryDao.xml
  22. 10
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/feign/UsersFeignClient.java
  23. 5
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/feign/fallback/UsersFeignClientFallback.java
  24. 45
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/mq/PointsModifyConsumer.java
  25. 5
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/VolunteerInfoDTO.java
  26. 91
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/VolunteerTagDTO.java
  27. 81
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/VolunteerTagRelationDTO.java
  28. 5
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcAppVolunteerListFormDTO.java
  29. 5
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/v2/EpdcCompleteVolunteerInfoV2FormDTO.java
  30. 36
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/VolunteerTagsResultDTO.java
  31. 18
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppVolunteerInfoController.java
  32. 19
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/VolunteerInfoController.java
  33. 84
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/VolunteerTagController.java
  34. 87
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/VolunteerTagRelationController.java
  35. 44
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerTagDao.java
  36. 42
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerTagRelationDao.java
  37. 61
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/VolunteerTagEntity.java
  38. 51
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/VolunteerTagRelationEntity.java
  39. 4
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerInfoService.java
  40. 104
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerTagRelationService.java
  41. 105
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerTagService.java
  42. 23
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerInfoServiceImpl.java
  43. 111
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerTagRelationServiceImpl.java
  44. 106
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerTagServiceImpl.java
  45. 36
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml
  46. 13
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml
  47. 24
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerTagDao.xml
  48. 22
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerTagRelationDao.xml
  49. 1
      esua-epdc/pom.xml

7
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

5
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;
}

12
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<java.util.List<com.elink.esua.epdc.dto.epdc.result.VolunteerTagsResultDTO>>
* @author Liuchuang
* @since 2021/1/25 15:03
*/
@GetMapping("volunteer/tags")
public Result<List<VolunteerTagsResultDTO>> getVolunteerTags() {
return appUserService.listOfVolunteerTags();
}
}

14
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<CachingUserInfoDTO> needCachingUserInfo(EpdcAppQueryUserInfoFormDTO formDTO);
/*
/**
* 志愿者列表 v2
* @param dto
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListResultDTO>>
@ -380,7 +380,7 @@ public interface UserFeignClient {
Result<EpdcAppVolunteerListCountResultDTO> listVolunteerV2(EpdcAppVolunteerListFormDTO dto);
/*
/**
* 志愿者列表
* @param dto
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListResultDTO>>
@ -594,4 +594,14 @@ public interface UserFeignClient {
@PostMapping(value = "app-user/epdc-app/verificationqrcode/getuserinfobycode", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<EpdcUserPointsVerificationResultDTO> getUserInfoByCode(EpdcUserPointsVerificationCheckFormDTO formDto);
/**
* 志愿者标签
*
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.epdc.result.VolunteerTagsResultDTO>>
* @author Liuchuang
* @since 2021/1/25 15:03
*/
@GetMapping("app-user/epdc-app/volunteerinfo/tags")
Result<List<VolunteerTagsResultDTO>> getVolunteerTags();
}

5
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<EpdcUserPointsVerificationResultDTO> getUserInfoByCode(EpdcUserPointsVerificationCheckFormDTO formDto) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "getUserInfoByCode", formDto);
}
@Override
public Result<List<VolunteerTagsResultDTO>> getVolunteerTags() {
return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "getVolunteerTags", null);
}
}

21
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<String> getUserWxPhone(EpdcAppUserMaInfoFormDTO formDto);
/*
/**
* 志愿者列表 v2
* @param tokenDto
* @param dto
@ -272,7 +272,7 @@ public interface AppUserService {
Result<EpdcAppVolunteerListCountResultDTO> listVolunteerV2(TokenDto tokenDto, EpdcAppVolunteerListFormDTO dto);
/*
/**
* 志愿者列表
* @param tokenDto
* @param dto
@ -362,7 +362,7 @@ public interface AppUserService {
**/
Result<PageData<EpdcScreenGridRankingResultDTO>> gridRanking(EpdcScreenGridRankingFormDTO dto);
/**
* @Description 以人找房
* @Description 以人找房
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
@ -370,7 +370,7 @@ public interface AppUserService {
**/
Result<PageData<EpdcScreenHouseInfoByPeopleResultDTO>> selectHouseByPeople(EpdcScreenHouseInfoByPeopleFormDTO dto);
/**
* @Description 以房找人接口
* @Description 以房找人接口
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
@ -378,7 +378,7 @@ public interface AppUserService {
**/
Result<PageData<EpdcScreenPopulationInfoByHouseResultDTO>> selectPeopleByHouse(EpdcScreenPopulationInfoByHouseFormDTO dto);
/**
* @Description 以人找人接口
* @Description 以人找人接口
* @Author songyunpeng
* @Date 2020/9/19
* @Param [dto]
@ -386,7 +386,7 @@ public interface AppUserService {
**/
Result<PageData<EpdcScreenResidentInfoByCurrentAddressResultDTO>> 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<com.elink.esua.epdc.dto.epdc.result.EpdcAppUserPointsResultDTO>
**/
Result<EpdcAppUserPointsResultDTO> getPointsByUserId(TokenDto userDetail);
/**
* 志愿者标签
*
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.epdc.result.VolunteerTagsResultDTO>>
* @author Liuchuang
* @since 2021/1/25 15:03
*/
Result<List<VolunteerTagsResultDTO>> listOfVolunteerTags();
}

6
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());
@ -1648,4 +1649,9 @@ public class AppUserServiceImpl implements AppUserService {
return userFeignClient.getPointsByUserId(userDetail.getUserId());
}
@Override
public Result<List<VolunteerTagsResultDTO>> listOfVolunteerTags() {
return userFeignClient.getVolunteerTags();
}
}

5
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<String> images;
/**
* 取货方式1-包邮2-自提
*/
private Integer pickupMethod;
}

8
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;
}
/**
* 取货方式1-包邮2-自提
*/
@NotNull(message = "取货方式不能为空")
private Integer pickupMethod;
}

7
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<GroupBuyPriceNumberDTO> groupBuyPriceNumber;
}
/**
* 取货方式1-包邮2-自提
*/
private Integer pickupMethod;
}

7
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;
}
}

7
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<String> groupBuyImg;
}
/**
* 取货方式1-包邮2-自提
*/
private Integer pickupMethod;
}

6
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<String> groupBuyImg;
/**
* 取货方式1-包邮2-自提
*/
private Integer pickupMethod;
}
}

7
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;
}
/**
* 订单状态0-进行中1-已结束
*/
private Integer status;
}

6
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;
}

20
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 BaseServiceImpl<GroupBuyInfoDao, Gr
@Override
@Transactional(rollbackFor = Exception.class)
public Result publishOrUpdate(EpdcAddGroupBuyInfoFormDTO formDTO) {
if(formDTO.getGroupBuyPriceNumber().size()==0){
return new Result().error("人数价格信息至少填写一条");
}
if(formDTO.getGroupBuyPriceNumber().size()>5){
return new Result().error("人数价格信息最多填写五条");
}
if(formDTO.getGroupBuyImg()!=null && formDTO.getGroupBuyImg().size()>3){
return new Result().error("图片最多上传三张");
}
//内容审核 - start
Boolean isConReview = formDTO.getIsConReview();
List<String> textList = new ArrayList<>();
@ -223,15 +233,7 @@ public class GroupBuyInfoServiceImpl extends BaseServiceImpl<GroupBuyInfoDao, Gr
//新增
insert(groupBuyInfoEntity);
}
if(formDTO.getGroupBuyPriceNumber().size()==0){
return new Result().error("人数价格信息至少填写一条");
}
if(formDTO.getGroupBuyPriceNumber().size()>5){
return new Result().error("人数价格信息最多填写五条");
}
if(formDTO.getGroupBuyImg()!=null && formDTO.getGroupBuyImg().size()>3){
return new Result().error("图片最多上传三张");
}
//插入或更新后插入价格人数和图片表
insertPriceNumAndImgs(groupBuyInfoEntity.getId(),formDTO.getGroupBuyImg(),formDTO.getGroupBuyPriceNumber());

3
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/sds/service/impl/SdsInfoServiceImpl.java

@ -164,6 +164,9 @@ public class SdsInfoServiceImpl extends BaseServiceImpl<SdsInfoDao, SdsInfoEntit
//查看详情 新增浏览次数
log.info("查询ID为:" + id);
SdsInfoEntity sdsInfoEntity = selectById(id);
if(sdsInfoEntity==null){
return new Result<EpdcSelectSdsInfoDetailResultDTO>().error("未查找到该顺道捎信息");
}
sdsInfoEntity.setBrowseNum(sdsInfoEntity.getBrowseNum()==null?1:sdsInfoEntity.getBrowseNum()+1);
updateById(sdsInfoEntity);
return new Result<EpdcSelectSdsInfoDetailResultDTO>().ok(this.baseDao.getSdsDetail(id));

17
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/logback-spring.xml

@ -133,14 +133,7 @@
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.elink.esua.epdc" level="INFO"/>
<logger name="com.elink.esua.epdc.modules.archives.dao" level="DEBUG"/>
<logger name="com.elink.esua.epdc.modules.archivesdept.dao" level="DEBUG"/>
<logger name="com.elink.esua.epdc.modules.dept.dao" level="DEBUG"/>
<logger name="com.elink.esua.epdc.modules.epidemic.dao" level="DEBUG"/>
<logger name="com.elink.esua.epdc.modules.feign.dao" level="DEBUG"/>
<logger name="com.elink.esua.epdc.modules.module.dao" level="DEBUG"/>
<logger name="com.elink.esua.epdc.modules.specialuser.dao" level="DEBUG"/>
<logger name="com.elink.esua.epdc.modules.groupbuy.dao" level="DEBUG"/>
<logger name="com.elink.esua.epdc.dao" level="DEBUG"/>
<root level="INFO">
<appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="INFO_FILE"/>
@ -151,10 +144,10 @@
<!-- 生产环境 -->
<springProfile name="prod">
<logger name="org.springframework.web" level="ERROR"/>
<logger name="org.springboot.sample" level="ERROR"/>
<logger name="com.elink.esua.epdc" level="ERROR"/>
<root level="ERROR">
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.elink.esua.epdc" level="INFO"/>
<root level="INFO">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="INFO_FILE"/>

24
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/groupBuy/GroupBuyInfoDao.xml

@ -8,13 +8,14 @@
<result property="groupBuyStatus" column="groupBuyStatus"/>
<result property="groupBuyPublishTime" column="groupBuyPublishTime"/>
<result property="topFlag" column="TOP_FLAG"/>
<result property="pickupMethod" column="PICKUP_METHOD"/>
<collection property="groupBuyImg" ofType="java.lang.String">
<result property="image" column="IMG_URL"/>
</collection>
</resultMap>
<select id="getGroupBuyList"
resultMap="getGroupBuyListMap">
select egbi.ID, egbi.GROUP_BUY_TITLE, egbi.groupBuyStatus, egbi.groupBuyPublishTime, egbi.TOP_FLAG,t1.IMG_URL
select egbi.ID, egbi.GROUP_BUY_TITLE, egbi.groupBuyStatus, egbi.groupBuyPublishTime, egbi.TOP_FLAG,egbi.PICKUP_METHOD,t1.IMG_URL
from (
select t.ID,
t.GROUP_BUY_TITLE,
@ -22,7 +23,8 @@
t.CREATED_TIME as groupBuyPublishTime,
t.TOP_FLAG,
t.TOP_TIME,
t.CREATED_TIME
t.CREATED_TIME,
t.PICKUP_METHOD
from epdc_group_buy_info t
where t.DEL_FLAG = '0'
and t.SHIELD_FLAG = '0'
@ -43,6 +45,7 @@
<result property="cancelReason" column="CANCEL_REASON"/>
<result property="groupBuyStatus" column="groupBuyStatus"/>
<result property="groupBuyEndTime" column="GROUP_BUY_END_TIME"/>
<result property="pickupMethod" column="PICKUP_METHOD"/>
<collection property="groupBuyImg" ofType="java.lang.String">
<result property="image" column="IMG_URL"/>
</collection>
@ -74,7 +77,8 @@
t2.GROUP_BUY_NUMBER,
t2.GROUP_BUY_PRICE,
t1.IMG_URL,
t.GROUP_BUY_END_TIME
t.GROUP_BUY_END_TIME,
t.PICKUP_METHOD
from epdc_group_buy_info t
left join
epdc_custom_img t1
@ -103,6 +107,7 @@
<result property="groupBuyStatus" column="groupBuyStatus"/>
<result property="groupBuyPublishTime" column="groupBuyPublishTime"/>
<result property="isEvaluation" column="isEvaluation"/>
<result property="pickupMethod" column="PICKUP_METHOD"/>
<collection property="groupBuyImg" ofType="java.lang.String">
<result property="image" column="IMG_URL"/>
</collection>
@ -114,6 +119,7 @@
egbi.groupBuyStatus,
egbi.groupBuyPublishTime,
egbi.isEvaluation,
egbi.PICKUP_METHOD,
t1.IMG_URL
from (
select t.ID,
@ -125,7 +131,8 @@
where egbe.DEL_FLAG = '0'
and egbe.USER_ID = t2.USER_ID
and egbe.GROUP_BUY_ID = t.ID) = 0, 0, 1) isEvaluation,
t.CREATED_TIME
t.CREATED_TIME,
t.PICKUP_METHOD
from epdc_group_buy_info t
left join epdc_group_buy_sign_up t2 on t2.GROUP_BUY_ID = t.ID and t2.DEL_FLAG = '0'
where t.DEL_FLAG = '0'
@ -146,6 +153,7 @@
<result property="groupBuyStatus" column="groupBuyStatus"/>
<result property="groupBuyPublishTime" column="groupBuyPublishTime"/>
<result property="isEdit" column="isEdit"/>
<result property="pickupMethod" column="PICKUP_METHOD"/>
<collection property="groupBuyImg" ofType="java.lang.String">
<result property="image" column="IMG_URL"/>
</collection>
@ -157,6 +165,7 @@
egbi.groupBuyStatus,
egbi.groupBuyPublishTime,
egbi.isEdit,
egbi.PICKUP_METHOD,
t1.IMG_URL
from(
select t.ID,
@ -164,7 +173,8 @@
if(t.GROUP_BUY_STATUS = '0' and t.GROUP_BUY_END_TIME is not null and t.GROUP_BUY_END_TIME &lt; now(),4,t.GROUP_BUY_STATUS) as groupBuyStatus,
t.CREATED_TIME as groupBuyPublishTime,
if(t.GROUP_BUY_STATUS = 10 or t.GROUP_BUY_STATUS = 5 or t2.ID is not null,0,1)isEdit,
t.CREATED_TIME
t.CREATED_TIME,
t.PICKUP_METHOD
from epdc_group_buy_info t
left join
(select * from epdc_group_buy_sign_up where DEL_FLAG = '0' and SIGN_UP_STATUS != 10 group by GROUP_BUY_ID)t2
@ -224,6 +234,7 @@
<result property="cancelReason" column="CANCEL_REASON"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="groupBuyEndTime" column="GROUP_BUY_END_TIME"/>
<result property="pickupMethod" column="PICKUP_METHOD"/>
<collection property="prices" ofType="com.elink.esua.epdc.dto.GroupBuyPriceNumberDTO">
<result property="groupBuyNumber" column="GROUP_BUY_NUMBER"/>
<result property="groupBuyPrice" column="GROUP_BUY_PRICE"/>
@ -249,7 +260,8 @@
n.GROUP_BUY_NUMBER,
n.GROUP_BUY_PRICE,
img.IMG_URL,
i.GROUP_BUY_END_TIME
i.GROUP_BUY_END_TIME,
i.PICKUP_METHOD
FROM
`epdc_group_buy_info` i
LEFT JOIN epdc_group_buy_price_number n ON n.GROUP_BUY_ID = i.ID

5
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/sds/SdsInfoDao.xml

@ -40,7 +40,8 @@
t.ID,
t.DEPARTURE,
t.DESTINATION,
t.DEPARTURE_TIME
t.DEPARTURE_TIME,
CASE WHEN DEPARTURE_TIME > NOW() THEN 0 ELSE 1 END AS `STATUS`
from epdc_sds_info t
where t.DEL_FLAG = '0' and t.SHIELD_FLAG = '0'
<if test="type!=null and type!='' and type == '0'.toString()">
@ -82,4 +83,4 @@
<update id="updateGridByDeptId">
UPDATE epdc_sds_info SET GRID = #{newDeptName}, UPDATED_TIME = NOW() WHERE GRID_ID = #{deptId}
</update>
</mapper>
</mapper>

2
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>
<select id="getModuleCategoryIdsHierarchy" resultType="java.lang.String">

10
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<Long> getUserGridIdByUserId(@PathVariable String userId);
/**
* @Description 获取用户第一次扫码网格的信息
* @Author songyunpeng
* @Date 2020/6/2
* @Param [userId]
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.UserGridRelationDTO>
**/
@GetMapping(value = "app-user/usergrid/getUserFirstScanGird/{userId}", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<UserGridRelationDTO> getUserFirstScanGird(@PathVariable("userId") String userId);
}

5
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<UserGridRelationDTO> getUserFirstScanGird(String userId) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "getUserFirstScanGird", userId);
}
}

45
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<MessageExt> {
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<MessageExt> {
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<MessageExt> {
//添加操作日志 -- 开始
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<MessageExt> {
pointsLogsAddFormDTO.setOperationDesc(pointsRuleResultDTO.getRuleDesc());
pointsLogsAddFormDTO.setOperationTime(dto.getOperationTime());
pointsLogsAddFormDTO.setOperationMode("user");
if(dto.getGridId()!=null){
pointsLogsAddFormDTO.setGridId(dto.getGridId());
Result<ParentAndAllDeptDTO> parentAndAllDept = adminFeignClient.getParentAndAllDept(dto.getGridId());
if(parentAndAllDept==null || parentAndAllDept.getData()==null){
throw new RenException("获取所属部门信息失败!");
if (dto.getGridId() != null) {
if (0L == dto.getGridId()) {
//用户网格ID为空,获取第一次扫码网格
Result<UserGridRelationDTO> 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<ParentAndAllDeptDTO> 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);
}

5
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;
}

91
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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;
/**
* 启用标识 01
*/
private String enableFlag;
/**
* 删除标识 01
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

81
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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;
/**
* 删除标识 01
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

5
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;
}

5
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;
}

36
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;
}

18
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<java.util.List<com.elink.esua.epdc.dto.epdc.result.VolunteerTagsResultDTO>>
* @author Liuchuang
* @since 2021/1/25 15:03
*/
@GetMapping("tags")
public Result<List<VolunteerTagsResultDTO>> getVolunteerTags() {
List<VolunteerTagsResultDTO> data = volunteerTagService.listOfVolunteerTags();
return new Result<List<VolunteerTagsResultDTO>>().ok(data);
}
}

19
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<java.util.List<com.elink.esua.epdc.dto.epdc.result.VolunteerTagsResultDTO>>
* @author Liuchuang
* @since 2021/1/25 16:22
*/
@GetMapping("getVolunteerTags")
public Result<List<VolunteerTagsResultDTO>> getVolunteerTags() {
List<VolunteerTagsResultDTO> data = volunteerTagService.listOfVolunteerTags();
return new Result<List<VolunteerTagsResultDTO>>().ok(data);
}
}

84
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<PageData<VolunteerTagDTO>> page(@RequestParam Map<String, Object> params){
PageData<VolunteerTagDTO> page = volunteerTagService.page(params);
return new Result<PageData<VolunteerTagDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<VolunteerTagDTO> get(@PathVariable("id") String id){
VolunteerTagDTO data = volunteerTagService.get(id);
return new Result<VolunteerTagDTO>().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();
}
}

87
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<PageData<VolunteerTagRelationDTO>> page(@RequestParam Map<String, Object> params){
PageData<VolunteerTagRelationDTO> page = volunteerTagRelationService.page(params);
return new Result<PageData<VolunteerTagRelationDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<VolunteerTagRelationDTO> get(@PathVariable("id") String id){
VolunteerTagRelationDTO data = volunteerTagRelationService.get(id);
return new Result<VolunteerTagRelationDTO>().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();
}
}

44
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<VolunteerTagEntity> {
/**
* 志愿者标签
*
* @return java.util.List<com.elink.esua.epdc.dto.epdc.result.VolunteerTagsResultDTO>
* @author Liuchuang
* @since 2021/1/25 15:11
*/
List<VolunteerTagsResultDTO> selectListOfVolunteerTags();
}

42
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<VolunteerTagRelationEntity> {
/**
* 根据志愿者ID删除志愿者标签
*
* @param volunteerId 志愿者ID
* @return void
* @author Liuchuang
* @since 2021/1/25 15:47
*/
void updateDelFlagByVolunteerId(String volunteerId);
}

61
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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;
/**
* 启用标识 01
*/
private String enableFlag;
}

51
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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;
}

4
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<VolunteerInfoEntity> {
*/
Result modifyVolunteerKindnessTime(EpdcVolunteerKindnessTimeFormDTO formDto);
/*
/**
* 志愿者列表v2
* @param dto
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListResultDTO>>
@ -221,7 +221,7 @@ public interface VolunteerInfoService extends BaseService<VolunteerInfoEntity> {
Result<EpdcAppVolunteerListCountResultDTO> listVolunteerV2(EpdcAppVolunteerListFormDTO dto);
/*
/**
* 志愿者列表
* @param dto
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListResultDTO>>

104
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<VolunteerTagRelationEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<VolunteerTagRelationDTO>
* @author generator
* @date 2021-01-25
*/
PageData<VolunteerTagRelationDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<VolunteerTagRelationDTO>
* @author generator
* @date 2021-01-25
*/
List<VolunteerTagRelationDTO> list(Map<String, Object> 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);
}

105
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<VolunteerTagEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<VolunteerTagDTO>
* @author generator
* @date 2021-01-25
*/
PageData<VolunteerTagDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<VolunteerTagDTO>
* @author generator
* @date 2021-01-25
*/
List<VolunteerTagDTO> list(Map<String, Object> 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<com.elink.esua.epdc.dto.epdc.result.VolunteerTagsResultDTO>
* @author Liuchuang
* @since 2021/1/25 15:09
*/
List<VolunteerTagsResultDTO> listOfVolunteerTags();
}

23
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<VolunteerInfoDao,
private AdminFeignClient adminFeignClient;
@Autowired
private UserTagRelationService userTagRelationService; //用户标签关系表
private UserTagRelationService userTagRelationService;
@Autowired
private VolunteerTagRelationService volunteerTagRelationService;
/**
* 根据查询条件返回首页 志愿者信息列表
@ -147,6 +150,12 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
public void update(VolunteerInfoDTO dto) {
VolunteerInfoEntity entity = ConvertUtils.sourceToTarget(dto, VolunteerInfoEntity.class);
updateById(entity);
// 更新志愿者标签
VolunteerTagRelationDTO tagDto = new VolunteerTagRelationDTO();
tagDto.setVolunteerId(dto.getId());
tagDto.setTagId(dto.getTagId());
volunteerTagRelationService.insertOrUpdateVolunteerTag(tagDto);
}
@Override
@ -437,6 +446,12 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
this.sendNotice(volunteerEntity);
userTagRelationService.addUserTagRelation(volunteerEntity.getUserId(), UserTagEnum.VOLUNTEER.value());
}
// 更新志愿者标签
VolunteerTagRelationDTO tagDto = new VolunteerTagRelationDTO();
tagDto.setVolunteerId(volunteerEntity.getId());
tagDto.setTagId(formDTO.getVolunteerTagId());
volunteerTagRelationService.insertOrUpdateVolunteerTag(tagDto);
return new Result().ok(NumConstant.ONE);
}

111
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerTagRelationServiceImpl.java

@ -0,0 +1,111 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<VolunteerTagRelationDao, VolunteerTagRelationEntity> implements VolunteerTagRelationService {
@Override
public PageData<VolunteerTagRelationDTO> page(Map<String, Object> params) {
IPage<VolunteerTagRelationEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, VolunteerTagRelationDTO.class);
}
@Override
public List<VolunteerTagRelationDTO> list(Map<String, Object> params) {
List<VolunteerTagRelationEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, VolunteerTagRelationDTO.class);
}
private QueryWrapper<VolunteerTagRelationEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<VolunteerTagRelationEntity> 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);
}
}

106
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<VolunteerTagDao, VolunteerTagEntity> implements VolunteerTagService {
@Override
public PageData<VolunteerTagDTO> page(Map<String, Object> params) {
IPage<VolunteerTagEntity> page = baseDao.selectPage(
getPage(params, "", false),
getWrapper(params)
);
return getPageData(page, VolunteerTagDTO.class);
}
@Override
public List<VolunteerTagDTO> list(Map<String, Object> params) {
List<VolunteerTagEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, VolunteerTagDTO.class);
}
private QueryWrapper<VolunteerTagEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<VolunteerTagEntity> 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<VolunteerTagsResultDTO> listOfVolunteerTags() {
return baseDao.selectListOfVolunteerTags();
}
}

36
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml

@ -326,7 +326,7 @@
</select>
<!--查询待认证用户数量-->
<select id="selectCountUnauthorizedAmount" resultType="Integer">
<!--<select id="selectCountUnauthorizedAmount" resultType="Integer">
SELECT
COUNT(DISTINCT(u.ID))
FROM
@ -344,6 +344,40 @@
</foreach>
</otherwise>
</choose>
</select>-->
<!--查询待认证用户数量-->
<select id="selectCountUnauthorizedAmount" resultType="Integer">
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
<choose>
<when test="gridId != null and gridId > 0">u.GRID_ID = #{gridId}</when>
<otherwise>
u.GRID_ID in
<foreach collection="gridIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</otherwise>
</choose>
GROUP BY
u.ID
ORDER BY u.REGISTER_TIME DESC) t
</select>
<!-- 获取用户列表:党员认证失败 -->

13
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}
</select>
@ -202,8 +204,10 @@
<!-- 根据用户id查询志愿者信息 -->
<select id="selectOneVolunteerInfoDTO" parameterType="java.lang.String"
resultType="com.elink.esua.epdc.dto.VolunteerInfoDTO">
select *
select m.*,
vt.tag_id
from epdc_volunteer_info m
left join epdc_volunteer_tag_relation vt on vt.VOLUNTEER_ID = m.id and vt.del_flag = '0'
where m.DEL_FLAG='0'
and m.USER_ID=#{userId}
</select>
@ -225,12 +229,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
<if test="nickname != null and nickname != '' ">
AND v.VOLUNTEER_NICKNAME like concat('%', #{nickname}, '%')
</if>
<if test="volunteerTagId != null and volunteerTagId != '' ">
AND vt.TAG_ID = #{volunteerTagId}
</if>
ORDER BY v.VOLUNTEER_ORDER ASC ,CONVERT(v.VOLUNTEER_NICKNAME USING gbk)
LIMIT #{pageIndex},#{pageSize}
</select>

24
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerTagDao.xml

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.dao.VolunteerTagDao">
<resultMap type="com.elink.esua.epdc.entity.VolunteerTagEntity" id="volunteerTagMap">
<result property="id" column="ID"/>
<result property="tagName" column="TAG_NAME"/>
<result property="description" column="DESCRIPTION"/>
<result property="sort" column="SORT"/>
<result property="enableFlag" column="ENABLE_FLAG"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="selectListOfVolunteerTags" resultType="com.elink.esua.epdc.entity.VolunteerTagEntity">
SELECT ID, TAG_NAME, DESCRIPTION, SORT FROM epdc_volunteer_tag WHERE DEL_FLAG = '0' AND ENABLE_FLAG = '1' ORDER BY SORT
</select>
</mapper>

22
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerTagRelationDao.xml

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.dao.VolunteerTagRelationDao">
<resultMap type="com.elink.esua.epdc.entity.VolunteerTagRelationEntity" id="volunteerTagRelationMap">
<result property="id" column="ID"/>
<result property="tagId" column="TAG_ID"/>
<result property="volunteerId" column="VOLUNTEER_ID"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<update id="updateDelFlagByVolunteerId">
UPDATE epdc_volunteer_tag_relation SET DEL_FLAG = '1' WHERE VOLUNTEER_ID = #{volunteerId}
</update>
</mapper>

1
esua-epdc/pom.xml

@ -115,6 +115,7 @@
</pluginManagement>
</build>
<repositories>
<repository>
<id>alimaven</id>

Loading…
Cancel
Save