Browse Source

志愿者认证页面、个人信息查询接口、认证提交接口v2修改

feature/syp_points
zhangyongzhangyong 6 years ago
parent
commit
69aca03ccb
  1. 17
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/v2/ApiAppUserV2Controller.java
  2. 12
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java
  3. 6
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java
  4. 12
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java
  5. 63
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java
  6. 2
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/VolunteerInfoDTO.java
  7. 123
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/v2/EpdcCompleteVolunteerInfoV2FormDTO.java
  8. 20
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcUserInfoResultDTO.java
  9. 16
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppVolunteerInfoController.java
  10. 2
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/VolunteerInfoEntity.java
  11. 10
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerInfoService.java
  12. 32
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerInfoServiceImpl.java
  13. 7
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml

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.enums.BehaviorEnum;
import com.elink.esua.epdc.commons.tools.utils.Result; 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.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.EpdcAppUserRegisterFormDTO;
import com.elink.esua.epdc.dto.form.v2.EpdcCompleteUserInfoFormV2DTO; import com.elink.esua.epdc.dto.form.v2.EpdcCompleteUserInfoFormV2DTO;
import com.elink.esua.epdc.dto.result.EpdcAppAuthorizationDTO; import com.elink.esua.epdc.dto.result.EpdcAppAuthorizationDTO;
@ -89,4 +90,20 @@ public class ApiAppUserV2Controller {
ValidatorUtils.validateEntity(formDto); ValidatorUtils.validateEntity(formDto);
return appUserService.completeUserInfo(tokenDto, 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);
}
} }

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

@ -7,6 +7,7 @@ import com.elink.esua.epdc.dto.UserDTO;
import com.elink.esua.epdc.dto.UserGridRelationDTO; import com.elink.esua.epdc.dto.UserGridRelationDTO;
import com.elink.esua.epdc.dto.UserWxFormIdDTO; import com.elink.esua.epdc.dto.UserWxFormIdDTO;
import com.elink.esua.epdc.dto.epdc.form.*; 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.*;
import com.elink.esua.epdc.dto.epdc.result.EpdcWorkUserResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcWorkUserResultDTO;
import com.elink.esua.epdc.feign.fallback.UserFeignClientFallback; import com.elink.esua.epdc.feign.fallback.UserFeignClientFallback;
@ -377,4 +378,15 @@ public interface UserFeignClient {
**/ **/
@GetMapping("app-user/epdc-app/volunteerinfo/list") @GetMapping("app-user/epdc-app/volunteerinfo/list")
Result<List<EpdcAppVolunteerListResultDTO>> listVolunteer(EpdcAppVolunteerListFormDTO dto); 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);
} }

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

@ -8,6 +8,7 @@ import com.elink.esua.epdc.dto.UserDTO;
import com.elink.esua.epdc.dto.UserGridRelationDTO; import com.elink.esua.epdc.dto.UserGridRelationDTO;
import com.elink.esua.epdc.dto.UserWxFormIdDTO; import com.elink.esua.epdc.dto.UserWxFormIdDTO;
import com.elink.esua.epdc.dto.epdc.form.*; 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.*;
import com.elink.esua.epdc.feign.UserFeignClient; import com.elink.esua.epdc.feign.UserFeignClient;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -185,4 +186,9 @@ public class UserFeignClientFallback implements UserFeignClient {
public Result<List<EpdcAppVolunteerListResultDTO>> listVolunteer(EpdcAppVolunteerListFormDTO dto) { public Result<List<EpdcAppVolunteerListResultDTO>> listVolunteer(EpdcAppVolunteerListFormDTO dto) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "listVolunteer", 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);
}
} }

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

@ -3,6 +3,7 @@ package com.elink.esua.epdc.service;
import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.common.token.dto.TokenDto;
import com.elink.esua.epdc.commons.tools.utils.Result; 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.*;
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.EpdcAppVolunteerListResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcUserGridResultDTO; 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.EpdcUserInfoResultDTO;
@ -268,4 +269,15 @@ public interface AppUserService {
* @Date 15:33 2020-05-18 * @Date 15:33 2020-05-18
**/ **/
Result<List<EpdcAppVolunteerListResultDTO>> listVolunteer(EpdcAppVolunteerListFormDTO dto); Result<List<EpdcAppVolunteerListResultDTO>> listVolunteer(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);
} }

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

@ -24,6 +24,7 @@ import com.elink.esua.epdc.dto.epdc.EpdcGridLeaderRegisterDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcGridLeaderRegisterFormDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcGridLeaderRegisterFormDTO;
import com.elink.esua.epdc.dto.epdc.GridLeaderRegisterDTO; import com.elink.esua.epdc.dto.epdc.GridLeaderRegisterDTO;
import com.elink.esua.epdc.dto.epdc.form.*; 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.*;
import com.elink.esua.epdc.dto.form.*; import com.elink.esua.epdc.dto.form.*;
import com.elink.esua.epdc.dto.form.v2.EpdcCompleteUserInfoFormV2DTO; import com.elink.esua.epdc.dto.form.v2.EpdcCompleteUserInfoFormV2DTO;
@ -1417,4 +1418,66 @@ public class AppUserServiceImpl implements AppUserService {
public Result<List<EpdcAppVolunteerListResultDTO>> listVolunteer(EpdcAppVolunteerListFormDTO dto) { public Result<List<EpdcAppVolunteerListResultDTO>> listVolunteer(EpdcAppVolunteerListFormDTO dto) {
return userFeignClient.listVolunteer(dto); 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 volunteerFlag = UserTagUtils.containIdentity(tokenDto.getUserTagInfos(), UserTagEnum.VOLUNTEER);
// 当前是否为党员
boolean partyFlag = UserTagUtils.containIdentity(tokenDto.getUserTagInfos(), UserTagEnum.PARTY_MEMBER);
// 此次完善信息后是否变为党员
boolean newPartyFlag = Boolean.FALSE;
UserDTO user = getUserInfoById(tokenDto.getUserId());
if (!volunteerFlag) {
// 处理和验证身份证号码
String identityNo = fixAndCheckIdentityNo(formDto.getIdentityNo());
String realName = ModuleUtils.replaceIllegalCharacter(formDto.getRealName());
if (partyFlag) {
// 如果是党员,不再进行完善个人信息处理
if (!user.getIdentityNo().equals(identityNo) || !user.getRealName().equals(realName)) {
return new Result().error("姓名或身份证号码有误,请核实信息");
}
} else {
// 非党员,调用用户完善个人信息接口
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());
// 新增志愿者
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 (!partyFlag && newPartyFlag) {
initPartyGroupInfo(cachingUserInfoDTO);
}
return new Result().ok(authorizationDto);
}
} }

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

@ -198,7 +198,7 @@ public class VolunteerInfoDTO implements Serializable {
private String registTimeString; private String registTimeString;
/** /**
* 志愿者签名昵称 * 志愿者昵称
*/ */
private String volunteerNickname; private String volunteerNickname;

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

20
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcUserInfoResultDTO.java

@ -30,4 +30,24 @@ public class EpdcUserInfoResultDTO implements Serializable {
* 用户积分等级 * 用户积分等级
*/ */
private Integer grade; private Integer grade;
/**
* 志愿者昵称
*/
private String volunteerNickname;
/**
* 志愿者头像
*/
private String volunteerFaceImg;
/**
* 志愿者签名
*/
private String volunteerSignature;
/**
* 自我介绍
*/
private String introduce;
} }

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

@ -7,6 +7,7 @@ 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.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.dto.epdc.form.EpdcAppVolunteerListFormDTO; 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.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.EpdcAppVolunteerListResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO;
import com.elink.esua.epdc.service.VolunteerInfoService; import com.elink.esua.epdc.service.VolunteerInfoService;
@ -74,4 +75,19 @@ public class EpdcAppVolunteerInfoController {
return volunteerInfoService.listVolunteer(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
**/
@GetMapping("v2/insertVolunteerInfo")
public Result<Integer> insertV2VolunteerInfo(@RequestBody EpdcCompleteVolunteerInfoV2FormDTO formDTO) {
//效验数据
ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class);
Result<Integer> result = volunteerInfoService.insertV2VolunteerInfo(formDTO);
return result;
}
} }

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

@ -135,7 +135,7 @@ public class VolunteerInfoEntity extends DeptScope {
private Long auditor; private Long auditor;
/** /**
* 志愿者签名昵称 * 志愿者昵称
*/ */
private String volunteerNickname; private String volunteerNickname;

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

@ -25,6 +25,7 @@ import com.elink.esua.epdc.dto.VolunteerInfoDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcAppVolunteerListFormDTO; 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.EpdcCompleteVolunteerInfoFormDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcVolunteerKindnessTimeFormDTO; 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.EpdcAdjustVolunteerPointsDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListResultDTO; 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.EpdcGetVolunteerRankDTO;
@ -215,4 +216,13 @@ public interface VolunteerInfoService extends BaseService<VolunteerInfoEntity> {
* @Date 15:33 2020-05-18 * @Date 15:33 2020-05-18
**/ **/
Result<List<EpdcAppVolunteerListResultDTO>> listVolunteer(EpdcAppVolunteerListFormDTO dto); 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);
} }

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

@ -40,6 +40,7 @@ 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.EpdcCompleteVolunteerInfoFormDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; 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.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.EpdcAdjustVolunteerPointsDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListResultDTO; 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.EpdcGetVolunteerRankDTO;
@ -395,4 +396,35 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
List<EpdcAppVolunteerListResultDTO> data = baseDao.selectListVolunteer(dto); List<EpdcAppVolunteerListResultDTO> data = baseDao.selectListVolunteer(dto);
return new Result().ok(data); 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());
insert(volunteerEntity);
this.sendNotice(volunteerEntity);
userTagRelationService.addUserTagRelation(volunteerEntity.getUserId(), UserTagEnum.VOLUNTEER.value());
return new Result().ok(NumConstant.ONE);
}
} }

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

@ -25,12 +25,17 @@
WHEN IFNULL(eu.POINTS_TOTLE,0) &lt;= 0 THEN 0 WHEN IFNULL(eu.POINTS_TOTLE,0) &lt;= 0 THEN 0
ELSE ELSE
IFNULL(FLOOR(IFNULL(eu.POINTS_TOTLE,0) / IFNULL(g.POINTS,0) * IFNULL(g.GRADE,0)),0) IFNULL(FLOOR(IFNULL(eu.POINTS_TOTLE,0) / IFNULL(g.POINTS,0) * IFNULL(g.GRADE,0)),0)
END grade END grade,
v.VOLUNTEER_NICKNAME volunteerNickname,
v.VOLUNTEER_FACE_IMG volunteerFaceImg,
v.VOLUNTEER_SIGNATURE volunteerSignature,
v.INTRODUCE introduce
FROM FROM
epdc_user eu epdc_user eu
Left Join (select * from epdc_user_grid_relation where USER_ID = #{id} order by UPDATED_TIME desc limit 0,1) eugr 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) on(eu.id=eugr.USER_ID)
left join epdc_points_grade g ON 1=1 AND g.DEL_FLAG = 0 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 AND v.DEL_FLAG = 0
WHERE WHERE
eu.ID = #{id} eu.ID = #{id}
</select> </select>

Loading…
Cancel
Save