Browse Source

Merge remote-tracking branch 'origin/feature/lc_modifyZhiyuanzhe'

feature/syp_points
liuchuang 5 years ago
parent
commit
8602e9b361
  1. 1
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NumConstant.java
  2. 86
      esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/ImgConfigDTO.java
  3. 21
      esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/v2/EpdcCompleteUserInfoFormV2DTO.java
  4. 21
      esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcCompleteUserInfoDTO.java
  5. 22
      esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcImgConfigResultDTO.java
  6. 41
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActBannerController.java
  7. 15
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppUserController.java
  8. 38
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiImgConfigController.java
  9. 107
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ImgConfigController.java
  10. 17
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/v2/ApiAppUserV2Controller.java
  11. 56
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/dao/ImgConfigDao.java
  12. 56
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/entity/ImgConfigEntity.java
  13. 65
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/excel/ImgConfigExcel.java
  14. 32
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/ActBannerFeignClient.java
  15. 16
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java
  16. 39
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java
  17. 25
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/ActBannerFeignClientFallback.java
  18. 10
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java
  19. 21
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java
  20. 47
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/redis/ImgConfigRedis.java
  21. 26
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActBannerService.java
  22. 23
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java
  23. 117
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ImgConfigService.java
  24. 23
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActBannerServiceImpl.java
  25. 77
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java
  26. 120
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ImgConfigServiceImpl.java
  27. 44
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/mapper/ImgConfigDao.xml
  28. 7
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActBannerDTO.java
  29. 30
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/EpdcAppActBannerFormDTO.java
  30. 27
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/EpdcAppActBannerResultDTO.java
  31. 7
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActBannerController.java
  32. 52
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/EpdcActBannerController.java
  33. 38
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActBannerDao.java
  34. 6
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActBannerEntity.java
  35. 16
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActBannerService.java
  36. 32
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActBannerServiceImpl.java
  37. 4
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java
  38. 33
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActBannerDao.xml
  39. 17
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/VolunteerInfoDTO.java
  40. 33
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcAppVolunteerListFormDTO.java
  41. 123
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/v2/EpdcCompleteVolunteerInfoV2FormDTO.java
  42. 36
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcAppVolunteerListResultDTO.java
  43. 29
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppVolunteerInfoController.java
  44. 21
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerInfoDao.java
  45. 16
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/VolunteerInfoEntity.java
  46. 23
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerInfoService.java
  47. 48
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerInfoServiceImpl.java
  48. 6
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml
  49. 72
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml

1
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NumConstant.java

@ -14,6 +14,7 @@ public interface NumConstant {
int TWO = 2;
int THREE = 3;
int FOUR = 4;
int FIVE = 5;
int SIX = 6;
int ONE_NEG = -1;

86
esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/ImgConfigDTO.java

@ -0,0 +1,86 @@
/**
* 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 zhangyong
* @since v1.0.0 2020-05-27
*/
@Data
public class ImgConfigDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 类型(0-志愿者咨询热线)
*/
private String imgType;
/**
* 图片地址
*/
private String imgUrl;
/**
* 排序
*/
private Integer sort;
/**
* 乐观锁
*/
private Integer revision;
/**
* 删除标识 0未删除 1删除
*/
private String delFlag;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

21
esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/v2/EpdcCompleteUserInfoFormV2DTO.java

@ -3,6 +3,7 @@ package com.elink.esua.epdc.dto.form.v2;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
/**
@ -78,4 +79,24 @@ public class EpdcCompleteUserInfoFormV2DTO implements Serializable {
* 认证类型 参考 UserAuthTypeEnum
*/
private String userAuthType;
/**
* 志愿者昵称
*/
private String volunteerNickname;
/**
* 志愿者头像
*/
private String volunteerFaceImg;
/**
* 志愿者签名
*/
private String volunteerSignature;
/**
* 自我介绍
*/
private String introduce;
}

21
esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcCompleteUserInfoDTO.java

@ -72,4 +72,25 @@ public class EpdcCompleteUserInfoDTO implements Serializable {
* 居住网格名称
*/
private String gridName;
/**
* 志愿者昵称
*/
private String volunteerNickname;
/**
* 志愿者头像
*/
private String volunteerFaceImg;
/**
* 志愿者签名
*/
private String volunteerSignature;
/**
* 自我介绍
*/
private String introduce;
}

22
esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcImgConfigResultDTO.java

@ -0,0 +1,22 @@
package com.elink.esua.epdc.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* APP 获取咨询热线图片 返回参数
*
* @author zhangyong
* @date 2020/05/27 18:30
*/
@Data
public class EpdcImgConfigResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 图片地址
*/
private String imgUrl;
}

41
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActBannerController.java

@ -0,0 +1,41 @@
package com.elink.esua.epdc.controller;
import com.elink.esua.epdc.activity.form.EpdcAppActBannerFormDTO;
import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.service.ActBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* APP 活动Banner相关接口
*
* @author zhangyong
* @date 2020/05/25 18:30
*/
@RestController
@RequestMapping("heart/actbanner")
public class ApiActBannerController {
@Autowired
private ActBannerService actBannerService;
/**
* 获取上架的banner列表
*
* @param formDto
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO>>
* @Author zhangyong
* @Date 18:27 2020-05-25
**/
@GetMapping("banner/list")
public Result<List<EpdcAppActBannerResultDTO>> bannerList(EpdcAppActBannerFormDTO formDto) {
ValidatorUtils.validateEntity(formDto);
return actBannerService.getBannerList(formDto);
}
}

15
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppUserController.java

@ -6,6 +6,7 @@ import com.elink.esua.epdc.commons.tools.enums.BehaviorEnum;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.dto.epdc.form.*;
import com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcUserGridResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO;
import com.elink.esua.epdc.dto.epdc.result.UserInvitationRecordResultDTO;
@ -328,4 +329,18 @@ public class ApiAppUserController {
ValidatorUtils.validateEntity(formDto);
return appUserService.getUserWxPhone(formDto);
}
/*
* 志愿者列表
* @param tokenDto
* @param dto
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListResultDTO>>
* @Author zhangyong
* @Date 15:33 2020-05-18
**/
@GetMapping("volunteer/list")
public Result<List<EpdcAppVolunteerListResultDTO>> volunteerList(@LoginUser TokenDto tokenDto, EpdcAppVolunteerListFormDTO dto) {
ValidatorUtils.validateEntity(dto);
return appUserService.listVolunteer(tokenDto, dto);
}
}

38
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiImgConfigController.java

@ -0,0 +1,38 @@
package com.elink.esua.epdc.controller;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.result.EpdcImgConfigResultDTO;
import com.elink.esua.epdc.service.ImgConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* APP 获取咨询热线图片
*
* @author zhangyong
* @date 2020/05/27 18:30
*/
@RestController
@RequestMapping("imgConfig")
public class ApiImgConfigController {
@Autowired
private ImgConfigService imgConfigService;
/**
* 根据 志愿者模块图片类型 查询图片列表
* @param imgType 志愿者模块图片类型
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.EpdcImgConfigResultDTO>>
* @Author zhangyong
* @Date 17:04 2020-05-27
**/
@GetMapping("getImgUrl/{imgType}")
public Result<List<EpdcImgConfigResultDTO>> getImgUrlList(@PathVariable("imgType") String imgType){
return imgConfigService.listImgUrl(imgType);
}
}

107
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ImgConfigController.java

@ -0,0 +1,107 @@
/**
* 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.ImgConfigDTO;
import com.elink.esua.epdc.dto.SysSimpleDictDTO;
import com.elink.esua.epdc.excel.ImgConfigExcel;
import com.elink.esua.epdc.service.ImgConfigService;
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 zhangyong
* @since v1.0.0 2020-05-27
*/
@RestController
@RequestMapping("imgconfig")
public class ImgConfigController {
@Autowired
private ImgConfigService imgConfigService;
@GetMapping("page")
public Result<PageData<ImgConfigDTO>> page(@RequestParam Map<String, Object> params){
PageData<ImgConfigDTO> page = imgConfigService.page(params);
return new Result<PageData<ImgConfigDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<ImgConfigDTO> get(@PathVariable("id") String id){
ImgConfigDTO data = imgConfigService.get(id);
return new Result<ImgConfigDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody ImgConfigDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
imgConfigService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody ImgConfigDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
imgConfigService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
imgConfigService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<ImgConfigDTO> list = imgConfigService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, ImgConfigExcel.class);
}
/**
* 根据数据字典类型获取简版数据字典列表用于页面下拉菜单
*
* @param dictType
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.SysSimpleDictDTO>>
* @Author zhangyong
* @Date 15:27 2020-05-27
**/
@GetMapping("heartImgType/{dictType}")
public Result<List<SysSimpleDictDTO>> listSimpleDictInfo(@PathVariable("dictType") String dictType){
return imgConfigService.getListSimpleDictInfo(dictType);
}
}

17
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/v2/ApiAppUserV2Controller.java

@ -7,6 +7,7 @@ import com.elink.esua.epdc.commons.tools.constant.Constant;
import com.elink.esua.epdc.commons.tools.enums.BehaviorEnum;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.dto.epdc.form.v2.EpdcCompleteVolunteerInfoV2FormDTO;
import com.elink.esua.epdc.dto.form.EpdcAppUserRegisterFormDTO;
import com.elink.esua.epdc.dto.form.v2.EpdcCompleteUserInfoFormV2DTO;
import com.elink.esua.epdc.dto.result.EpdcAppAuthorizationDTO;
@ -89,4 +90,20 @@ public class ApiAppUserV2Controller {
ValidatorUtils.validateEntity(formDto);
return appUserService.completeUserInfo(tokenDto, formDto);
}
/**
* 志愿者认证 V2接口
*
* @param tokenDto
* @param formDto
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @Author zhangyong
* @Date 09:49 2020-05-26
**/
@PostMapping("volunteer/" + Constant.VERSION_CONTROL + "/authenticate")
public Result volunteerAuthenticate(@LoginUser TokenDto tokenDto, @RequestBody EpdcCompleteVolunteerInfoV2FormDTO formDto) {
ValidatorUtils.validateEntity(formDto);
return appUserService.volunteerV2Authenticate(tokenDto, formDto);
}
}

56
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/dao/ImgConfigDao.java

@ -0,0 +1,56 @@
/**
* 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.ImgConfigDTO;
import com.elink.esua.epdc.dto.result.EpdcImgConfigResultDTO;
import com.elink.esua.epdc.entity.ImgConfigEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* 图片配置表
*
* @author zhangyong
* @since v1.0.0 2020-05-27
*/
@Mapper
public interface ImgConfigDao extends BaseDao<ImgConfigEntity> {
/**
* 图片配置 首页查询
* @param params
* @return java.util.List<com.elink.esua.epdc.dto.ImgConfigDTO>
* @Author zhangyong
* @Date 17:25 2020-05-27
**/
List<ImgConfigDTO> selectListImgConfig(Map<String, Object> params);
/**
* 根据 志愿者模块图片类型 查询图片列表
* @param imgType 志愿者模块图片类型
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.EpdcImgConfigResultDTO>>
* @Author zhangyong
* @Date 17:04 2020-05-27
**/
List<EpdcImgConfigResultDTO> selectListImgConfigByImgType(String imgType);
}

56
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/entity/ImgConfigEntity.java

@ -0,0 +1,56 @@
/**
* 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 zhangyong
* @since v1.0.0 2020-05-27
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_img_config")
public class ImgConfigEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 类型(0-志愿者咨询热线)
*/
private String imgType;
/**
* 图片地址
*/
private String imgUrl;
/**
* 排序
*/
private Integer sort;
}

65
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/excel/ImgConfigExcel.java

@ -0,0 +1,65 @@
/**
* 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.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 图片配置表
*
* @author zhangyong
* @since v1.0.0 2020-05-27
*/
@Data
public class ImgConfigExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "类型(0-志愿者咨询热线)")
private String imgType;
@Excel(name = "图片地址")
private String imgUrl;
@Excel(name = "排序")
private Integer sort;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "删除标识 0:未删除 1:删除")
private String delFlag;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

32
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/ActBannerFeignClient.java

@ -0,0 +1,32 @@
package com.elink.esua.epdc.feign;
import com.elink.esua.epdc.activity.form.EpdcAppActBannerFormDTO;
import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO;
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.feign.fallback.ActBannerFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import java.util.List;
/**
* Banner-移动app端
* @Author zhangyong
* @Date 18:27 2020-05-25
*/
@FeignClient(name = ServiceConstant.EPDC_HEART_SERVER, fallback = ActBannerFeignClientFallback.class)
public interface ActBannerFeignClient {
/**
* 获取上架的banner列表
*
* @param formDto
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO>>
* @Author zhangyong
* @Date 18:27 2020-05-25
**/
@GetMapping(value = "heart/epdc-app/actbanner/banner/list", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<List<EpdcAppActBannerResultDTO>> selectBannerList(EpdcAppActBannerFormDTO formDto);
}

16
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java

@ -2,10 +2,7 @@ package com.elink.esua.epdc.feign;
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.CompleteDeptDTO;
import com.elink.esua.epdc.dto.DeptOption;
import com.elink.esua.epdc.dto.ParentAndAllDeptDTO;
import com.elink.esua.epdc.dto.SysUserDTO;
import com.elink.esua.epdc.dto.*;
import com.elink.esua.epdc.dto.epdc.GridLeaderRegisterDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcAppIndexPanelResultDTO;
import com.elink.esua.epdc.feign.fallback.AdminFeignClientFallback;
@ -90,4 +87,15 @@ public interface AdminFeignClient {
**/
@GetMapping("sys/dept/party/getDeptTreeForEpiDemic")
Result<DeptOption> getDeptTreeForEpiDemic();
/**
* 根据数据字典类型获取简版数据字典列表用于页面下拉菜单
*
* @param dictType
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.SysSimpleDictDTO>>
* @Author zhangyong
* @Date 15:27 2020-05-27
**/
@GetMapping("sys/dict/listSimple/{dictType}")
Result<List<SysSimpleDictDTO>> getListSimpleDictInfo(@PathVariable("dictType") String dictType);
}

39
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java

@ -2,11 +2,9 @@ package com.elink.esua.epdc.feign;
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.CachingUserInfoDTO;
import com.elink.esua.epdc.dto.UserDTO;
import com.elink.esua.epdc.dto.UserGridRelationDTO;
import com.elink.esua.epdc.dto.UserWxFormIdDTO;
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.*;
import com.elink.esua.epdc.dto.epdc.result.EpdcWorkUserResultDTO;
import com.elink.esua.epdc.feign.fallback.UserFeignClientFallback;
@ -367,4 +365,37 @@ public interface UserFeignClient {
*/
@PostMapping(value = "app-user/epdc-app/user/needCachingUserInfo", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<CachingUserInfoDTO> needCachingUserInfo(EpdcAppQueryUserInfoFormDTO formDTO);
/*
* 志愿者列表
* @param dto
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListResultDTO>>
* @Author zhangyong
* @Date 15:33 2020-05-18
**/
@GetMapping("app-user/epdc-app/volunteerinfo/list")
Result<List<EpdcAppVolunteerListResultDTO>> listVolunteer(EpdcAppVolunteerListFormDTO dto);
/**
* 志愿者添加 V2接口
*
* @param formDTO
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @Author zhangyong
* @Date 09:49 2020-05-26
**/
@PostMapping(value = "app-user/epdc-app/volunteerinfo/v2/insertVolunteerInfo", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<Integer> insertV2VolunteerInfo(EpdcCompleteVolunteerInfoV2FormDTO formDTO);
/**
* 根据用户id获取志愿者详情
*
* @param userId
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @Author zhangyong
* @Date 09:49 2020-05-26
**/
@GetMapping(value = "app-user/volunteerinfo/getVolunteerInfoDTOByUserId/{userId}")
Result<VolunteerInfoDTO> selectUserVolunteerInfo(@PathVariable("userId") String userId);
}

25
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/ActBannerFeignClientFallback.java

@ -0,0 +1,25 @@
package com.elink.esua.epdc.feign.fallback;
import com.elink.esua.epdc.activity.form.EpdcAppActBannerFormDTO;
import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO;
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.feign.ActBannerFeignClient;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* Banner-移动app端
* @Author zhangyong
* @Date 18:27 2020-05-25
*/
@Component
public class ActBannerFeignClientFallback implements ActBannerFeignClient {
@Override
public Result<List<EpdcAppActBannerResultDTO>> selectBannerList(EpdcAppActBannerFormDTO formDto) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "selectBannerList", formDto);
}
}

10
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java

@ -3,10 +3,7 @@ package com.elink.esua.epdc.feign.fallback;
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.CompleteDeptDTO;
import com.elink.esua.epdc.dto.DeptOption;
import com.elink.esua.epdc.dto.ParentAndAllDeptDTO;
import com.elink.esua.epdc.dto.SysUserDTO;
import com.elink.esua.epdc.dto.*;
import com.elink.esua.epdc.dto.epdc.GridLeaderRegisterDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcAppIndexPanelResultDTO;
import com.elink.esua.epdc.feign.AdminFeignClient;
@ -51,4 +48,9 @@ public class AdminFeignClientFallback implements AdminFeignClient {
public Result<DeptOption> getDeptTreeForEpiDemic() {
return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getDeptTreeForEpiDemic");
}
@Override
public Result<List<SysSimpleDictDTO>> getListSimpleDictInfo(String dictType) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getListSimpleDictInfo", dictType);
}
}

21
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java

@ -3,11 +3,9 @@ package com.elink.esua.epdc.feign.fallback;
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.CachingUserInfoDTO;
import com.elink.esua.epdc.dto.UserDTO;
import com.elink.esua.epdc.dto.UserGridRelationDTO;
import com.elink.esua.epdc.dto.UserWxFormIdDTO;
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.*;
import com.elink.esua.epdc.feign.UserFeignClient;
import org.springframework.stereotype.Component;
@ -180,4 +178,19 @@ public class UserFeignClientFallback implements UserFeignClient {
public Result<CachingUserInfoDTO> needCachingUserInfo(EpdcAppQueryUserInfoFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "needCachingUserInfo", formDTO);
}
@Override
public Result<List<EpdcAppVolunteerListResultDTO>> listVolunteer(EpdcAppVolunteerListFormDTO dto) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "listVolunteer", dto);
}
@Override
public Result<Integer> insertV2VolunteerInfo(EpdcCompleteVolunteerInfoV2FormDTO dto) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "insertV2VolunteerInfo", dto);
}
@Override
public Result<VolunteerInfoDTO> selectUserVolunteerInfo(String userId) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "selectUserVolunteerInfo", "userId");
}
}

47
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/redis/ImgConfigRedis.java

@ -0,0 +1,47 @@
/**
* 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.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 图片配置表
*
* @author zhangyong
* @since v1.0.0 2020-05-27
*/
@Component
public class ImgConfigRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

26
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActBannerService.java

@ -0,0 +1,26 @@
package com.elink.esua.epdc.service;
import com.elink.esua.epdc.activity.form.EpdcAppActBannerFormDTO;
import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO;
import com.elink.esua.epdc.commons.tools.utils.Result;
import java.util.List;
/**
* APP 活动Banner相关接口
*
* @author zhangyong
* @date 2020/05/25 18:30
*/
public interface ActBannerService {
/**
* 获取上架的banner列表
*
* @param formDto
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO>>
* @Author zhangyong
* @Date 18:27 2020-05-25
**/
Result<List<EpdcAppActBannerResultDTO>> getBannerList(EpdcAppActBannerFormDTO formDto);
}

23
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java

@ -3,6 +3,8 @@ package com.elink.esua.epdc.service;
import com.elink.esua.epdc.common.token.dto.TokenDto;
import com.elink.esua.epdc.commons.tools.utils.Result;
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.EpdcAppVolunteerListResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcUserGridResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO;
import com.elink.esua.epdc.dto.epdc.result.UserInvitationRecordResultDTO;
@ -258,4 +260,25 @@ public interface AppUserService {
* @date 2020/2/20 17:24
*/
Result<String> getUserWxPhone(EpdcAppUserMaInfoFormDTO formDto);
/*
* 志愿者列表
* @param tokenDto
* @param dto
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListResultDTO>>
* @Author zhangyong
* @Date 15:33 2020-05-18
**/
Result<List<EpdcAppVolunteerListResultDTO>> listVolunteer(TokenDto tokenDto, EpdcAppVolunteerListFormDTO dto);
/**
* 志愿者认证 V2接口
*
* @param tokenDto
* @param formDto
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @Author zhangyong
* @Date 09:49 2020-05-26
**/
Result volunteerV2Authenticate(TokenDto tokenDto, EpdcCompleteVolunteerInfoV2FormDTO formDto);
}

117
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ImgConfigService.java

@ -0,0 +1,117 @@
/**
* 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.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.ImgConfigDTO;
import com.elink.esua.epdc.dto.SysSimpleDictDTO;
import com.elink.esua.epdc.dto.result.EpdcImgConfigResultDTO;
import com.elink.esua.epdc.entity.ImgConfigEntity;
import java.util.List;
import java.util.Map;
/**
* 图片配置表
*
* @author zhangyong
* @since v1.0.0 2020-05-27
*/
public interface ImgConfigService extends BaseService<ImgConfigEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ImgConfigDTO>
* @author generator
* @date 2020-05-27
*/
PageData<ImgConfigDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ImgConfigDTO>
* @author generator
* @date 2020-05-27
*/
List<ImgConfigDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return ImgConfigDTO
* @author generator
* @date 2020-05-27
*/
ImgConfigDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-05-27
*/
void save(ImgConfigDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-05-27
*/
void update(ImgConfigDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-05-27
*/
void delete(String[] ids);
/**
* 根据数据字典类型获取简版数据字典列表用于页面下拉菜单
*
* @param dictType
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.SysSimpleDictDTO>>
* @Author zhangyong
* @Date 15:27 2020-05-27
**/
Result<List<SysSimpleDictDTO>> getListSimpleDictInfo(String dictType);
/**
* 根据 志愿者模块图片类型 查询图片列表
* @param imgType 志愿者模块图片类型
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.EpdcImgConfigResultDTO>>
* @Author zhangyong
* @Date 17:04 2020-05-27
**/
Result<List<EpdcImgConfigResultDTO>> listImgUrl(String imgType);
}

23
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActBannerServiceImpl.java

@ -0,0 +1,23 @@
package com.elink.esua.epdc.service.impl;
import com.elink.esua.epdc.activity.form.EpdcAppActBannerFormDTO;
import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.feign.ActBannerFeignClient;
import com.elink.esua.epdc.service.ActBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class ActBannerServiceImpl implements ActBannerService {
@Autowired
private ActBannerFeignClient actBannerFeignClient;
@Override
public Result<List<EpdcAppActBannerResultDTO>> getBannerList(EpdcAppActBannerFormDTO formDto) {
return actBannerFeignClient.selectBannerList(formDto);
}
}

77
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java

@ -16,6 +16,9 @@ import com.elink.esua.epdc.commons.tools.enums.UserTagEnum;
import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum;
import com.elink.esua.epdc.commons.tools.exception.RenException;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import com.elink.esua.epdc.commons.tools.redis.UserDetailRedis;
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser;
import com.elink.esua.epdc.commons.tools.security.user.UserDetail;
import com.elink.esua.epdc.commons.tools.utils.*;
import com.elink.esua.epdc.dto.*;
import com.elink.esua.epdc.dto.enums.GroupUserStateEnum;
@ -24,10 +27,8 @@ import com.elink.esua.epdc.dto.epdc.EpdcGridLeaderRegisterDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcGridLeaderRegisterFormDTO;
import com.elink.esua.epdc.dto.epdc.GridLeaderRegisterDTO;
import com.elink.esua.epdc.dto.epdc.form.*;
import com.elink.esua.epdc.dto.epdc.result.EpdcUserGridResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcUserRegisterInfoResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO;
import com.elink.esua.epdc.dto.epdc.result.UserInvitationRecordResultDTO;
import com.elink.esua.epdc.dto.epdc.form.v2.EpdcCompleteVolunteerInfoV2FormDTO;
import com.elink.esua.epdc.dto.epdc.result.*;
import com.elink.esua.epdc.dto.form.*;
import com.elink.esua.epdc.dto.form.v2.EpdcCompleteUserInfoFormV2DTO;
import com.elink.esua.epdc.dto.group.form.GroupUserFormDTO;
@ -879,6 +880,18 @@ public class AppUserServiceImpl implements AppUserService {
Result<UserDTO> result = userFeignClient.getUserInfoById(tokenDto.getUserId());
if (result.success() && null != result.getData()) {
EpdcCompleteUserInfoDTO dto = ConvertUtils.sourceToTarget(result.getData(), EpdcCompleteUserInfoDTO.class);
// 获取志愿者表中的新增字段
Result<VolunteerInfoDTO> volunteerInfoDTO = userFeignClient.selectUserVolunteerInfo(tokenDto.getUserId());
if (volunteerInfoDTO.success() && null != volunteerInfoDTO.getData()){
dto.setVolunteerFaceImg(volunteerInfoDTO.getData().getVolunteerFaceImg());
dto.setVolunteerNickname(volunteerInfoDTO.getData().getVolunteerNickname());
dto.setVolunteerSignature(volunteerInfoDTO.getData().getVolunteerSignature());
dto.setIntroduce(volunteerInfoDTO.getData().getIntroduce());
// 如果用户表的身份证号为空,则尝试使用志愿者表中的身份证
if (null == dto.getIdentityNo() || "".equals(dto.getIdentityNo())) {
dto.setIdentityNo(volunteerInfoDTO.getData().getIdentityNo());
}
}
if (("0").equals(result.getData().getState())) {
dto.setGridId(tokenDto.getGridId());
//未完善信息获取用户当前所在的网格的后两级机构(社区-网格),返回给前端
@ -1415,4 +1428,60 @@ public class AppUserServiceImpl implements AppUserService {
}
return new Result().ok(authorizationDto);
}
@Override
public Result<List<EpdcAppVolunteerListResultDTO>> listVolunteer(TokenDto tokenDto, EpdcAppVolunteerListFormDTO dto) {
dto.setGridId(tokenDto.getGridId());
return userFeignClient.listVolunteer(dto);
}
@Override
public Result volunteerV2Authenticate(TokenDto tokenDto, EpdcCompleteVolunteerInfoV2FormDTO formDto) {
logger.info("志愿者认证wxCode=" + formDto.getWxCode() + ";userId=" + tokenDto.getUserId());
if (StringUtils.isNotBlank(formDto.getSmsCode())) {
this.checkSmsCode(formDto.getMobile(), formDto.getSmsCode());
}
// 此次完善信息后是否变为党员
boolean newPartyFlag = Boolean.FALSE;
UserDTO user = getUserInfoById(tokenDto.getUserId());
// 处理和验证身份证号码
String identityNo = fixAndCheckIdentityNo(formDto.getIdentityNo());
// 调用用户完善个人信息接口
EpdcCompleteUserInfoFormV2DTO epdcCompleteUserInfoFormDTO = ConvertUtils.sourceToTarget(formDto, EpdcCompleteUserInfoFormV2DTO.class);
// set 党员标识,将志愿者完善信息视为党员完善信息,方便身份证号码唯一校验等操作
epdcCompleteUserInfoFormDTO.setPartyFlag(YesOrNoEnum.YES.value());
epdcCompleteUserInfoFormDTO.setUserAuthType(UserAuthTypeEnum.VOLUNTEER_AUTH.value());
Result<UserDTO> result = completeUserInfoCore(tokenDto, epdcCompleteUserInfoFormDTO);
UserDTO completeUser = result.getData();
user.setGrid(completeUser.getGrid());
user.setState(completeUser.getState());
if (YesOrNoEnum.YES.value().equals(completeUser.getPartyFlag())) {
newPartyFlag = Boolean.TRUE;
}
formDto.setSex(IdentityNoUtils.getSex(identityNo));
formDto.setBirthday(DateUtils.parse(IdentityNoUtils.getBirthday(identityNo), DateUtils.DATE_PATTERN));
formDto.setUserId(tokenDto.getUserId());
formDto.setGridId(tokenDto.getGridId());
// 新增 or 修改 志愿者信息
Result<Integer> insertCountResult = userFeignClient.insertV2VolunteerInfo(formDto);
if (!insertCountResult.success()) {
return insertCountResult;
}
// 更新用户缓存信息
Result<CachingUserInfoDTO> cachingUserResult = userFeignClient.needCachingUserInfoByUserId(tokenDto.getUserId());
CachingUserInfoDTO cachingUserInfoDTO = cachingUserResult.getData();
EpdcAppAuthorizationDTO authorizationDto = cachingUserInfoForAuthorization(cachingUserInfoDTO, user.getGrid(), user.getState());
if ( newPartyFlag) {
initPartyGroupInfo(cachingUserInfoDTO);
}
return new Result().ok(authorizationDto);
}
}

120
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ImgConfigServiceImpl.java

@ -0,0 +1,120 @@
/**
* 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.commons.tools.utils.Result;
import com.elink.esua.epdc.dao.ImgConfigDao;
import com.elink.esua.epdc.dto.ImgConfigDTO;
import com.elink.esua.epdc.dto.SysSimpleDictDTO;
import com.elink.esua.epdc.dto.result.EpdcImgConfigResultDTO;
import com.elink.esua.epdc.entity.ImgConfigEntity;
import com.elink.esua.epdc.feign.AdminFeignClient;
import com.elink.esua.epdc.redis.ImgConfigRedis;
import com.elink.esua.epdc.service.ImgConfigService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 图片配置表
*
* @author zhangyong
* @since v1.0.0 2020-05-27
*/
@Service
public class ImgConfigServiceImpl extends BaseServiceImpl<ImgConfigDao, ImgConfigEntity> implements ImgConfigService {
@Autowired
private ImgConfigRedis imgConfigRedis;
@Autowired
private AdminFeignClient adminFeignClient;
@Override
public PageData<ImgConfigDTO> page(Map<String, Object> params) {
IPage<ImgConfigDTO> page = getPage(params);
List<ImgConfigDTO> list = baseDao.selectListImgConfig(params);
return new PageData<>(list, page.getTotal());
}
@Override
public List<ImgConfigDTO> list(Map<String, Object> params) {
List<ImgConfigEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ImgConfigDTO.class);
}
private QueryWrapper<ImgConfigEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<ImgConfigEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public ImgConfigDTO get(String id) {
ImgConfigEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ImgConfigDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ImgConfigDTO dto) {
ImgConfigEntity entity = ConvertUtils.sourceToTarget(dto, ImgConfigEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ImgConfigDTO dto) {
ImgConfigEntity entity = ConvertUtils.sourceToTarget(dto, ImgConfigEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public Result<List<SysSimpleDictDTO>> getListSimpleDictInfo(String dictType) {
return adminFeignClient.getListSimpleDictInfo(dictType);
}
@Override
public Result<List<EpdcImgConfigResultDTO>> listImgUrl(String imgType) {
List<EpdcImgConfigResultDTO> list = baseDao.selectListImgConfigByImgType(imgType);
return new Result<List<EpdcImgConfigResultDTO>>().ok(list);
}
}

44
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/mapper/ImgConfigDao.xml

@ -0,0 +1,44 @@
<?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.ImgConfigDao">
<resultMap type="com.elink.esua.epdc.entity.ImgConfigEntity" id="imgConfigMap">
<result property="id" column="ID"/>
<result property="imgType" column="IMG_TYPE"/>
<result property="imgUrl" column="IMG_URL"/>
<result property="sort" column="SORT"/>
<result property="revision" column="REVISION"/>
<result property="delFlag" column="DEL_FLAG"/>
<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="selectListImgConfig" resultType="com.elink.esua.epdc.dto.ImgConfigDTO">
SELECT
ID id,
IMG_TYPE imgType,
IMG_URL imgUrl,
SORT sort,
CREATED_TIME createdTime
FROM
`epdc_img_config`
WHERE DEL_FLAG = 0
<if test="imgType != null and imgType != ''">
AND IMG_TYPE = #{imgType,jdbcType=VARCHAR}
</if>
ORDER BY SORT,CREATED_TIME DESC
</select>
<select id="selectListImgConfigByImgType" resultType="com.elink.esua.epdc.dto.result.EpdcImgConfigResultDTO">
SELECT
IMG_URL imgUrl
FROM
`epdc_img_config`
WHERE DEL_FLAG = 0
AND IMG_TYPE = #{imgType,jdbcType=VARCHAR}
ORDER BY SORT,CREATED_TIME DESC
</select>
</mapper>

7
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActBannerDTO.java

@ -98,5 +98,8 @@ public class ActBannerDTO implements Serializable {
*/
private Date createdTime;
}
/**
* banner排序
*/
private String sort;
}

30
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/EpdcAppActBannerFormDTO.java

@ -0,0 +1,30 @@
package com.elink.esua.epdc.activity.form;
import lombok.Data;
import javax.validation.constraints.Min;
import java.io.Serializable;
/**
* banner 列表入参
*
* @author zhangyong
* @since v1.0.0 2020-05-25
*/
@Data
public class EpdcAppActBannerFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 页码
*/
@Min(value = 1, message = "页码必须大于0")
private Integer pageIndex;
/**
* 页容量
*/
@Min(value = 1, message = "页容量必须大于0")
private Integer pageSize;
}

27
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/EpdcAppActBannerResultDTO.java

@ -0,0 +1,27 @@
package com.elink.esua.epdc.activity.result;
import lombok.Data;
import java.io.Serializable;
/**
* banner 列表返回列表
*
* @author zhangyong
* @since v1.0.0 2020-05-25
*/
@Data
public class EpdcAppActBannerResultDTO implements Serializable {
private static final long serialVersionUID = 3908231797102233188L;
/**
* banner标题
*/
private String title;
/**
* banner图片
*/
private String bannerImg;
}

7
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActBannerController.java

@ -46,7 +46,7 @@ import java.util.Map;
@RestController
@RequestMapping("actbanner")
public class ActBannerController {
@Autowired
private ActBannerService actBannerService;
@ -78,8 +78,7 @@ public class ActBannerController {
public Result save(@RequestBody ActBannerDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
actBannerService.save(dto);
return new Result();
return actBannerService.save(dto);
}
@PutMapping
@ -104,4 +103,4 @@ public class ActBannerController {
ExcelUtils.exportExcelToTarget(response, null, list, ActBannerExcel.class);
}
}
}

52
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/EpdcActBannerController.java

@ -0,0 +1,52 @@
/**
* 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.modules.activity.controller;
import com.elink.esua.epdc.activity.form.EpdcAppActBannerFormDTO;
import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO;
import com.elink.esua.epdc.commons.tools.constant.Constant;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.modules.activity.service.ActBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping(Constant.EPDC_APP + "actbanner")
public class EpdcActBannerController {
@Autowired
private ActBannerService actBannerService;
/**
* 获取上架的banner列表
*
* @param formDto
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO>>
* @Author zhangyong
* @Date 18:27 2020-05-25
**/
@GetMapping("banner/list")
public Result<List<EpdcAppActBannerResultDTO>> bannerList(@RequestBody EpdcAppActBannerFormDTO formDto) {
ValidatorUtils.validateEntity(formDto);
return actBannerService.getBannerList(formDto);
}
}

38
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActBannerDao.java

@ -18,6 +18,8 @@
package com.elink.esua.epdc.modules.activity.dao;
import com.elink.esua.epdc.activity.ActBannerDTO;
import com.elink.esua.epdc.activity.form.EpdcAppActBannerFormDTO;
import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.modules.activity.entity.ActBannerEntity;
import org.apache.ibatis.annotations.Mapper;
@ -67,12 +69,32 @@ public interface ActBannerDao extends BaseDao<ActBannerEntity> {
*/
void updateBannerByActId(String actId);
/**
* @Description: 手机端banner查询根据创建时间 正序排列
* @Param: [params]
* @return: java.util.List<com.elink.esua.epdc.modules.activity.entity.ActBannerEntity>
* @Author: zy
* @Date: 2020-02-08
*/
/**
* @Description: 手机端banner查询根据创建时间 正序排列
* @Param: [params]
* @return: java.util.List<com.elink.esua.epdc.modules.activity.entity.ActBannerEntity>
* @Author: zy
* @Date: 2020-02-08
*/
List<ActBannerDTO> getAppActBannerlist(Map<String, Object> params);
}
/**
* 获取已经上架的banner数量
*
* @param
* @return int
* @Author zhangyong
* @Date 16:47 2020-05-25
**/
int getBannerStatusNumber();
/**
* 获取上架的banner列表
*
* @param formDto
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO>>
* @Author zhangyong
* @Date 18:27 2020-05-25
**/
List<EpdcAppActBannerResultDTO> selectListBannerList(EpdcAppActBannerFormDTO formDto);
}

6
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActBannerEntity.java

@ -87,4 +87,8 @@ public class ActBannerEntity extends BaseEpdcEntity {
*/
private Long deptId;
}
/**
* banner排序
*/
private String sort;
}

16
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActBannerService.java

@ -18,6 +18,8 @@
package com.elink.esua.epdc.modules.activity.service;
import com.elink.esua.epdc.activity.ActBannerDTO;
import com.elink.esua.epdc.activity.form.EpdcAppActBannerFormDTO;
import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
@ -77,7 +79,7 @@ public interface ActBannerService extends BaseService<ActBannerEntity> {
* @author generator
* @date 2019-12-19
*/
void save(ActBannerDTO dto);
Result save(ActBannerDTO dto);
/**
* 默认更新
@ -130,4 +132,14 @@ public interface ActBannerService extends BaseService<ActBannerEntity> {
* @since 2020/2/6 21:22
*/
void takeOffBannerByActId(String actId);
}
/**
* 获取上架的banner列表
*
* @param formDto
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO>>
* @Author zhangyong
* @Date 18:27 2020-05-25
**/
Result<List<EpdcAppActBannerResultDTO>> getBannerList(EpdcAppActBannerFormDTO formDto);
}

32
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActBannerServiceImpl.java

@ -20,8 +20,11 @@ package com.elink.esua.epdc.modules.activity.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.activity.ActBannerDTO;
import com.elink.esua.epdc.activity.form.EpdcAppActBannerFormDTO;
import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.constant.NumConstant;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
@ -101,10 +104,13 @@ public class ActBannerServiceImpl extends BaseServiceImpl<ActBannerDao, ActBanne
updateEntity.setStatusTime(new Date());
// 上架
if (ActStateConstant.ACT_BANNER_STATUS_UNDERCARRIAGE.equals(entity.getStatus())) {
// 上架前banner表处理
this.takeOffOtherBanners();
updateEntity.setStatus(ActStateConstant.ACT_BANNER_STATUS_GROUNDING);
updateById(updateEntity);
// 上架的banner数量不能超过5条
if (NumConstant.FIVE > baseDao.getBannerStatusNumber()) {
updateEntity.setStatus(ActStateConstant.ACT_BANNER_STATUS_GROUNDING);
updateById(updateEntity);
} else {
return new Result().error("Banner上架数量不能超过5条");
}
// 下架
} else if (ActStateConstant.ACT_BANNER_STATUS_GROUNDING.equals(entity.getStatus())) {
updateEntity.setStatus(ActStateConstant.ACT_BANNER_STATUS_UNDERCARRIAGE);
@ -115,9 +121,15 @@ public class ActBannerServiceImpl extends BaseServiceImpl<ActBannerDao, ActBanne
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ActBannerDTO dto) {
public Result save(ActBannerDTO dto) {
ActBannerEntity entity = ConvertUtils.sourceToTarget(dto, ActBannerEntity.class);
insert(entity);
// 上架的banner数量不能超过5条
if (NumConstant.FIVE > baseDao.getBannerStatusNumber()) {
insert(entity);
} else {
return new Result().error("Banner上架数量不能超过5条");
}
return new Result();
}
@Override
@ -152,4 +164,12 @@ public class ActBannerServiceImpl extends BaseServiceImpl<ActBannerDao, ActBanne
baseDao.updateBannerByActId(actId);
}
@Override
public Result<List<EpdcAppActBannerResultDTO>> getBannerList(EpdcAppActBannerFormDTO formDto) {
int pageIndex = (formDto.getPageIndex() - NumConstant.ONE) * formDto.getPageSize();
formDto.setPageIndex(pageIndex);
List<EpdcAppActBannerResultDTO> data = baseDao.selectListBannerList(formDto);
return new Result().ok(data);
}
}

4
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java

@ -128,10 +128,6 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
public Result save(ActInfoDTO dto) {
ActInfoEntity entity = ConvertUtils.sourceToTarget(dto, ActInfoEntity.class);
if (insert(entity)) {
if (NumConstant.ONE_STR.equals(dto.getIsBanner())) {
// 保存到banner
this.saveActInfoToBanner(entity.getId(), dto);
}
// 创建定时任务(活动开始后将未审核的报名人员自动置为审核通过或不通过)
return this.saveActToScheduleJob(entity.getId(), dto.getActStartTime());
}

33
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActBannerDao.xml

@ -21,6 +21,7 @@
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
<result property="sort" column="SORT"/>
</resultMap>
<select id="getActBannerlist" resultMap="actBannerMap">
SELECT
@ -40,19 +41,19 @@
banner.CREATED_BY,
banner.CREATED_TIME,
banner.UPDATED_BY,
banner.UPDATED_TIME
banner.UPDATED_TIME,
banner.SORT
FROM
epdc_act_banner banner
WHERE
banner.DEL_FLAG = '0'
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( banner.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<if test="status != null and status != ''">
AND banner.STATUS = #{status}
</if>
ORDER BY
banner.CREATED_TIME DESC
banner.`STATUS` DESC,
banner.SORT,
banner.STATUS_TIME DESC
</select>
<select id="getBannerInfo" resultType="com.elink.esua.epdc.activity.ActBannerDTO">
@ -109,4 +110,24 @@
ORDER BY
banner.CREATED_TIME DESC
</select>
</mapper>
<select id="getBannerStatusNumber" resultType="int">
SELECT
COUNT(1)
FROM epdc_act_banner b
WHERE b.DEL_FLAG = 0
AND b.`STATUS` = 1
</select>
<select id="selectListBannerList" resultType="com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO">
SELECT
TITLE title,
BANNER_IMG bannerImg
FROM
epdc_act_banner
WHERE
`STATUS` = 1
AND DEL_FLAG = 0
ORDER BY SORT,STATUS_TIME DESC
</select>
</mapper>

17
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/VolunteerInfoDTO.java

@ -196,4 +196,19 @@ public class VolunteerInfoDTO implements Serializable {
* 志愿者注册时间
*/
private String registTimeString;
}
/**
* 志愿者昵称
*/
private String volunteerNickname;
/**
* 志愿者头像
*/
private String volunteerFaceImg;
/**
* 志愿者签名
*/
private String volunteerSignature;
}

33
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcAppVolunteerListFormDTO.java

@ -0,0 +1,33 @@
package com.elink.esua.epdc.dto.epdc.form;
import lombok.Data;
import javax.validation.constraints.Min;
import java.util.List;
/**
* 志愿者列表
*
* @author zhangyong
* @since v1.0.0 2020-05-18
*/
@Data
public class EpdcAppVolunteerListFormDTO {
/**
* 页码
*/
@Min(value = 1, message = "页码必须大于0")
private Integer pageIndex;
/**
* 页容量
*/
@Min(value = 1, message = "页容量必须大于0")
private Integer pageSize;
/**
* 数据权限
*/
private Long gridId;
}

123
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/v2/EpdcCompleteVolunteerInfoV2FormDTO.java

@ -0,0 +1,123 @@
package com.elink.esua.epdc.dto.epdc.form.v2;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;
/**
* 移动端完善用户信息 v2接口
*
* @author zhangyong
* @date 2020/05/26 10:56
*/
@Data
public class EpdcCompleteVolunteerInfoV2FormDTO implements Serializable {
private static final long serialVersionUID = 8364421744640317634L;
/**
* 用户Id
*/
private String userId;
/**
* 真实姓名
*/
@NotBlank(message = "真实姓名不能为空")
private String realName;
/**
* 手机号
*/
@NotBlank(message = "手机号不能为空")
private String mobile;
/**
* 短信验证码
* 移动端决定是否上送验证码
*/
private String smsCode;
/**
* 身份证号码
*/
@NotBlank(message = "身份证号码不能为空")
private String identityNo;
/**
* 所在道路
*/
@NotBlank(message = "所在道路不能为空")
private String road;
/**
* 小区名
*/
private String villageName;
/**
* 住处楼栋-单元-房间
*/
private String dwellingPlace;
/**
* 居住网格id
*/
private Long gridId;
/**
* 微信code
*/
private String wxCode;
/**
* 用户信息
*/
private String encryptedData;
/**
* 加密算法的初始向量
*/
private String iv;
/**
* 自我介绍
*/
private String introduce;
/*----------------------志愿者新增所需字段---------------------------*/
/**
* 出生日期
*/
private Date birthday;
/*----------------------用户认证所需字段-----------------------------*/
/**
* 0女1男
*/
private String sex;
/**
* 志愿者昵称
*/
@Size(min = 1, max = 10, message = "志愿者昵称不能为空,不能超过10字")
private String volunteerNickname;
/**
* 志愿者头像
*/
@NotBlank(message = "志愿者头像不能为空")
private String volunteerFaceImg;
/**
* 志愿者签名
*/
@Size(min = 1, max = 30, message = "志愿者签名,不能超过30字")
private String volunteerSignature;
}

36
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcAppVolunteerListResultDTO.java

@ -0,0 +1,36 @@
package com.elink.esua.epdc.dto.epdc.result;
import lombok.Data;
import java.io.Serializable;
/**
* 移动端接口-志愿者列表接口返回值
* @Author zhangyong
* @Date 2020-05-18
*/
@Data
public class EpdcAppVolunteerListResultDTO implements Serializable {
private static final long serialVersionUID = 3908231797102233188L;
/**
* 志愿者ID
*/
private String id;
/**
* 用户昵称
*/
private String nickname;
/**
* 头像
*/
private String faceImg;
/**
* 志愿者签名
*/
private String volunteerSignature;
}

29
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppVolunteerInfoController.java

@ -5,7 +5,10 @@ import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.dto.epdc.form.EpdcAppVolunteerListFormDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcCompleteVolunteerInfoFormDTO;
import com.elink.esua.epdc.dto.epdc.form.v2.EpdcCompleteVolunteerInfoV2FormDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO;
import com.elink.esua.epdc.service.VolunteerInfoService;
import org.springframework.beans.factory.annotation.Autowired;
@ -60,6 +63,32 @@ public class EpdcAppVolunteerInfoController {
return volunteerInfoService.getRankingList();
}
/**
* 志愿者列表
* @param dto
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.EpdcAppVolunteerListResultDTO>>
* @Author zhangyong
* @Date 15:08 2020-05-18
**/
@GetMapping("list")
public Result<List<EpdcAppVolunteerListResultDTO>> volunteerList(@RequestBody EpdcAppVolunteerListFormDTO dto) {
return volunteerInfoService.listVolunteer(dto);
}
/**
* 志愿者添加 V2接口
*
* @param formDTO
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @Author zhangyong
* @Date 09:49 2020-05-26
**/
@PostMapping("v2/insertVolunteerInfo")
public Result<Integer> insertV2VolunteerInfo(@RequestBody EpdcCompleteVolunteerInfoV2FormDTO formDTO) {
//效验数据
ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class);
Result<Integer> result = volunteerInfoService.insertV2VolunteerInfo(formDTO);
return result;
}
}

21
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerInfoDao.java

@ -20,8 +20,11 @@ package com.elink.esua.epdc.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.UserTagDTO;
import com.elink.esua.epdc.dto.VolunteerInfoDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcAppVolunteerListFormDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcVolunteerKindnessTimeFormDTO;
import com.elink.esua.epdc.dto.epdc.form.v2.EpdcCompleteVolunteerInfoV2FormDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO;
import com.elink.esua.epdc.entity.VolunteerInfoEntity;
import org.apache.ibatis.annotations.Mapper;
@ -128,4 +131,22 @@ public interface VolunteerInfoDao extends BaseDao<VolunteerInfoEntity> {
* @since 2020/2/7 18:34
*/
void updateVolunteerKindnessTime(EpdcVolunteerKindnessTimeFormDTO formDto);
/**
* 志愿者列表
* @param dto
* @return java.util.List<com.elink.esua.epdc.dto.result.EpdcAppVolunteerListResultDTO>
* @Author zhangyong
* @Date 15:08 2020-05-18
**/
List<EpdcAppVolunteerListResultDTO> selectListVolunteer(EpdcAppVolunteerListFormDTO dto);
/**
* 志愿者认证修改
* @param formDTO
* @return void
* @Author zhangyong
* @Date 19:52 2020-05-27
**/
void updateVolunteerAauthentication(EpdcCompleteVolunteerInfoV2FormDTO formDTO);
}

16
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/VolunteerInfoEntity.java

@ -134,4 +134,18 @@ public class VolunteerInfoEntity extends DeptScope {
*/
private Long auditor;
}
/**
* 志愿者昵称
*/
private String volunteerNickname;
/**
* 志愿者头像
*/
private String volunteerFaceImg;
/**
* 志愿者签名
*/
private String volunteerSignature;
}

23
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerInfoService.java

@ -22,9 +22,12 @@ import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.UserTagDTO;
import com.elink.esua.epdc.dto.VolunteerInfoDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcAppVolunteerListFormDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcCompleteVolunteerInfoFormDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcVolunteerKindnessTimeFormDTO;
import com.elink.esua.epdc.dto.epdc.form.v2.EpdcCompleteVolunteerInfoV2FormDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO;
import com.elink.esua.epdc.entity.VolunteerInfoEntity;
@ -204,4 +207,24 @@ public interface VolunteerInfoService extends BaseService<VolunteerInfoEntity> {
* @since 2020/2/7 18:37
*/
Result modifyVolunteerKindnessTime(EpdcVolunteerKindnessTimeFormDTO formDto);
/*
* 志愿者列表
* @param dto
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListResultDTO>>
* @Author zhangyong
* @Date 15:33 2020-05-18
**/
Result<List<EpdcAppVolunteerListResultDTO>> listVolunteer(EpdcAppVolunteerListFormDTO dto);
/**
* 插入一条志愿者数据
* @param formDTO
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @Author zhangyong
* @Date 09:49 2020-05-26
*/
Result<Integer> insertV2VolunteerInfo(EpdcCompleteVolunteerInfoV2FormDTO formDTO);
}

48
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerInfoServiceImpl.java

@ -28,6 +28,7 @@ import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.constant.NumConstant;
import com.elink.esua.epdc.commons.tools.enums.UserTagEnum;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.constant.UserFieldConsant;
@ -36,10 +37,13 @@ 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.epdc.form.EpdcAppVolunteerListFormDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcCompleteVolunteerInfoFormDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcVolunteerKindnessTimeFormDTO;
import com.elink.esua.epdc.dto.epdc.form.v2.EpdcCompleteVolunteerInfoV2FormDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO;
import com.elink.esua.epdc.entity.VolunteerInfoEntity;
import com.elink.esua.epdc.feign.AdminFeignClient;
@ -386,4 +390,48 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
return new Result();
}
@Override
public Result<List<EpdcAppVolunteerListResultDTO>> listVolunteer(EpdcAppVolunteerListFormDTO dto) {
int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize();
dto.setPageIndex(pageIndex);
List<EpdcAppVolunteerListResultDTO> data = baseDao.selectListVolunteer(dto);
return new Result().ok(data);
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result<Integer> insertV2VolunteerInfo(EpdcCompleteVolunteerInfoV2FormDTO formDTO) {
VolunteerInfoEntity volunteerEntity = ConvertUtils.sourceToTarget(formDTO, VolunteerInfoEntity.class);
// 补全其他字段
volunteerEntity.setRegistTime(new Date());// 注册时间
volunteerEntity.setAuditStatus(NumConstant.ZERO_STR); // 审核状态 默认自动审核通过
volunteerEntity.setAuditTime(volunteerEntity.getRegistTime()); // 审核时间
String address = volunteerEntity.getRoad()
.concat(StringUtils.isNotBlank(volunteerEntity.getVillageName()) ? volunteerEntity.getVillageName() : StringUtils.EMPTY)
.concat(StringUtils.isNotBlank(volunteerEntity.getDwellingPlace()) ? volunteerEntity.getDwellingPlace() : StringUtils.EMPTY);
volunteerEntity.setAddress(address); // 居住地址
// 获取部门信息
Result<ParentAndAllDeptDTO> dtoResult = adminFeignClient.getParentAndAllDept(String.valueOf(volunteerEntity.getGridId()));
// 机构信息
DeptEntityUtils.loadDeptInfo(
ConvertUtils.sourceToTarget(dtoResult.getData(), DeptEntityUtils.DeptDto.class),
volunteerEntity
);
// deleteVolunteerByUserId(volunteerEntity.getUserId());
VolunteerInfoDTO dto = baseDao.selectOneVolunteerInfoDTO(formDTO.getUserId());
if(null != dto) {
volunteerEntity.setId(dto.getId());
updateById(volunteerEntity);
} else {
insert(volunteerEntity);
this.sendNotice(volunteerEntity);
userTagRelationService.addUserTagRelation(volunteerEntity.getUserId(), UserTagEnum.VOLUNTEER.value());
}
return new Result().ok(NumConstant.ONE);
}
}

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

@ -13,7 +13,10 @@
eu.NICKNAME AS nickname,
eu.FACE_IMG AS faceImg,
eu.MOBILE AS mobile,
eu.IDENTITY_NO AS identityNo,
CASE SUM(IFNULL(eu.IDENTITY_NO,0))
WHEN 0 THEN v.IDENTITY_NO
ELSE eu.IDENTITY_NO
END AS identityNo,
eugr.ALL_DEPT_NAMES AS deptName,
eu.REAL_NAME AS realName,
eu.ROAD AS road,
@ -31,6 +34,7 @@
Left Join (select * from epdc_user_grid_relation where USER_ID = #{id} order by UPDATED_TIME desc limit 0,1) eugr
on(eu.id=eugr.USER_ID)
left join epdc_points_grade g ON 1=1 AND g.DEL_FLAG = 0
LEFT JOIN epdc_volunteer_info v ON eu.ID = v.USER_ID
WHERE
eu.ID = #{id}
</select>

72
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml

@ -34,6 +34,9 @@
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
<result property="volunteerNickname" column="VOLUNTEER_NICKNAME"/>
<result property="volunteerFaceImg" column="VOLUNTEER_FACE_IMG"/>
<result property="volunteerSignature" column="VOLUNTEER_SIGNATURE"/>
</resultMap>
<!--根据查询条件,返回首页 志愿者信息列表-->
@ -178,8 +181,8 @@
DATE_FORMAT(NOW(),'%Y-%m-%d') generate_date,
vi.ID volunteer_id,
vi.USER_ID,
eu.FACE_IMG,
eu.NICKNAME,
vi.VOLUNTEER_FACE_IMG as FACE_IMG,
vi.VOLUNTEER_NICKNAME as NICKNAME,
eu.PARTY_FLAG,
vi.KINDNESS_TIME,
vi.PARTICIPATION_NUM
@ -206,4 +209,69 @@
USER_ID = #{userId}
AND DEL_FLAG = '0'
</update>
<select id="selectListVolunteer" resultType="com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListResultDTO">
SELECT
v.ID id,
v.VOLUNTEER_NICKNAME nickname,
v.VOLUNTEER_FACE_IMG faceImg,
v.VOLUNTEER_SIGNATURE volunteerSignature
FROM
epdc_volunteer_info v
WHERE
v.DEL_FLAG = 0
AND v.AUDIT_STATUS != 2
<if test="gridId!=null and gridId != ''">
and v.GRID_ID = #{gridId}
</if>
ORDER BY CONVERT(v.VOLUNTEER_NICKNAME USING gbk)
LIMIT #{pageIndex},#{pageSize}
</select>
<update id="updateVolunteerAauthentication" parameterType="com.elink.esua.epdc.dto.epdc.form.v2.EpdcCompleteVolunteerInfoV2FormDTO">
UPDATE epdc_volunteer_info
SET
<if test="realName != null and realName != '' ">
REAL_NAME = #{realName},
</if>
<if test="mobile != null and mobile != '' ">
MOBILE = #{mobile},
</if>
<if test="identityNo != null and identityNo != '' ">
IDENTITY_NO = #{identityNo},
</if>
<if test="road != null and road != '' ">
ROAD = #{road},
</if>
<if test="villageName != null and villageName != '' ">
VILLAGE_NAME = #{villageName},
</if>
<if test="dwellingPlace != null and dwellingPlace != '' ">
DWELLING_PLACE = #{dwellingPlace},
</if>
<if test="gridId != null and gridId != '' ">
GRID_ID = #{gridId},
</if>
<if test="introduce != null and introduce != '' ">
INTRODUCE = #{introduce},
</if>
<if test="birthday != null and birthday != '' ">
BIRTHDAY = #{birthday},
</if>
<if test="sex != null and sex != '' ">
SEX = #{sex},
</if>
<if test="volunteerNickname != null and volunteerNickname != '' ">
VOLUNTEER_NICKNAME = #{volunteerNickname},
</if>
<if test="volunteerFaceImg != null and volunteerFaceImg != '' ">
VOLUNTEER_FACE_IMG = #{volunteerFaceImg},
</if>
<if test="volunteerSignature != null and volunteerSignature != '' ">
VOLUNTEER_SIGNATURE = #{volunteerSignature}
</if>
WHERE
USER_ID = #{userId}
AND DEL_FLAG = '0'
</update>
</mapper>

Loading…
Cancel
Save