Browse Source

拼团购 顺道捎 bug修改

feature/syp_points
songyunpeng 5 years ago
parent
commit
9f3aadfb13
  1. 18
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppUserController.java
  2. 9
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java
  3. 6
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java
  4. 14
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CustomServiceImpl.java
  5. 2
      esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAddGroupBuyInfoFormDTO.java

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

@ -5,11 +5,12 @@ import com.elink.esua.epdc.commons.tools.annotation.LoginUser;
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.VolunteerInfoDTO;
import com.elink.esua.epdc.dto.epdc.form.*;
import com.elink.esua.epdc.dto.epdc.result.*;
import com.elink.esua.epdc.dto.form.*;
import com.elink.esua.epdc.dto.result.EpdcAppRegisterCallbackDTO;
import com.elink.esua.epdc.dto.result.EpdcAppAuthorizationDTO;
import com.elink.esua.epdc.dto.result.EpdcAppRegisterCallbackDTO;
import com.elink.esua.epdc.dto.result.EpdcCompleteUserInfoDTO;
import com.elink.esua.epdc.pointcommons.tools.annotation.RecordUserBehavior;
import com.elink.esua.epdc.service.AppUserService;
@ -384,4 +385,19 @@ public class ApiAppUserController {
}
return appUserService.userSign(userDetail);
}
/**
* @Description 验证是否是志愿者
* @Author songyunpeng
* @Date 2020/12/9
* @Param [userDetail]
* @return com.elink.esua.epdc.commons.tools.utils.Result
**/
@GetMapping("user/volunteerVerify")
public Result<VolunteerInfoDTO> volunteerVerify(@LoginUser TokenDto userDetail){
if(userDetail==null){
return new Result().error("用户未登录");
}
return appUserService.volunteerVerify(userDetail);
}
}

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

@ -4,6 +4,7 @@ import com.elink.esua.epdc.common.token.dto.TokenDto;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.DeptOption;
import com.elink.esua.epdc.dto.VolunteerInfoDTO;
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.*;
@ -384,4 +385,12 @@ public interface AppUserService {
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.epdc.result.EpdcScreenResidentInfoByCurrentAddressResultDTO>>
**/
Result<PageData<EpdcScreenResidentInfoByCurrentAddressResultDTO>> selectPeopleByCurrentAddress(EpdcScreenResidentInfoByCurrentAddressFormDTO dto);
/**
* @Description
* @Author songyunpeng
* @Date 2020/12/9
* @Param [userDetail]
* @return com.elink.esua.epdc.commons.tools.utils.Result
**/
Result<VolunteerInfoDTO> volunteerVerify(TokenDto userDetail);
}

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

@ -60,7 +60,6 @@ import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
@ -1626,4 +1625,9 @@ public class AppUserServiceImpl implements AppUserService {
return userFeignClient.selectPeopleByCurrentAddress(dto);
}
@Override
public Result<VolunteerInfoDTO> volunteerVerify(TokenDto userDetail) {
return userFeignClient.selectUserVolunteerInfo(userDetail.getUserId());
}
}

14
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CustomServiceImpl.java

@ -7,10 +7,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.DeptOption;
import com.elink.esua.epdc.dto.ParentAndAllDeptDTO;
import com.elink.esua.epdc.dto.VolunteerInfoDTO;
import com.elink.esua.epdc.dto.form.*;
import com.elink.esua.epdc.dto.result.*;
import com.elink.esua.epdc.feign.AdminFeignClient;
import com.elink.esua.epdc.feign.CustomFeignClient;
import com.elink.esua.epdc.feign.UserFeignClient;
import com.elink.esua.epdc.redis.AppUserRedis;
import com.elink.esua.epdc.service.CustomService;
import org.apache.commons.lang3.StringUtils;
@ -32,6 +34,8 @@ public class CustomServiceImpl implements CustomService {
@Autowired
private CustomFeignClient customFeignClient;
@Autowired
private UserFeignClient userFeignClient;
@Autowired
private AppUserRedis appUserRedis;
/**
@ -197,6 +201,11 @@ public class CustomServiceImpl implements CustomService {
if(StringUtils.isBlank(tokenDto.getUserId())){
return new Result<List<EpdcSelectGroupBuyInfoListResultDTO>>().error("无效的token");
}
//验证是否是志愿者
Result<VolunteerInfoDTO> volunteerInfoDTOResult = userFeignClient.selectUserVolunteerInfo(tokenDto.getUserId());
if(volunteerInfoDTOResult==null || volunteerInfoDTOResult.getData()==null || StringUtils.isBlank(volunteerInfoDTOResult.getData().getId())){
return new Result().error("未查到该用户志愿者信息!");
}
formDTO.setUserId(tokenDto.getUserId());
formDTO.setFaceImg(tokenDto.getFaceImg());
formDTO.setRealName(tokenDto.getRealName());
@ -247,6 +256,11 @@ public class CustomServiceImpl implements CustomService {
if(StringUtils.isBlank(tokenDto.getUserId())){
return new Result<List<EpdcSelectGroupBuyInfoListResultDTO>>().error("无效的token");
}
//验证是否是志愿者
Result<VolunteerInfoDTO> volunteerInfoDTOResult = userFeignClient.selectUserVolunteerInfo(tokenDto.getUserId());
if(volunteerInfoDTOResult==null || volunteerInfoDTOResult.getData()==null || StringUtils.isBlank(volunteerInfoDTOResult.getData().getId())){
return new Result().error("未查到该用户志愿者信息!");
}
formDTO.setUserId(tokenDto.getUserId());
formDTO.setFaceImg(tokenDto.getFaceImg());
formDTO.setRealName(tokenDto.getRealName());

2
esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAddGroupBuyInfoFormDTO.java

@ -46,7 +46,7 @@ public class EpdcAddGroupBuyInfoFormDTO implements Serializable {
* 标题
*/
@NotBlank(message = "标题不能为空")
@Size(min = 1,max = 16,message = "标题在16字以内")
@Size(min = 1,max = 50,message = "标题在50字以内")
private String groupBuyTitle;
/**

Loading…
Cancel
Save