wxz 3 years ago
parent
commit
d59e4c1fbc
  1. 18
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/BadgeController.java
  2. 8
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/BadgeService.java
  3. 14
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/BadgeServiceImpl.java

18
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/BadgeController.java

@ -7,8 +7,6 @@ import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.CertificationAddFormDTO; import com.epmet.dto.form.CertificationAddFormDTO;
import com.epmet.dto.form.OpenedOrClosedFormDTO; import com.epmet.dto.form.OpenedOrClosedFormDTO;
import com.epmet.modules.person.service.BadgeService; import com.epmet.modules.person.service.BadgeService;
import com.epmet.resi.mine.dto.from.BadgeListFormDTO;
import com.epmet.resi.mine.dto.from.OperListFormDTO;
import com.epmet.resi.mine.dto.result.BadgeListResultDTO; import com.epmet.resi.mine.dto.result.BadgeListResultDTO;
import com.epmet.resi.mine.dto.result.OperListResultDTO; import com.epmet.resi.mine.dto.result.OperListResultDTO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -37,9 +35,11 @@ public class BadgeController {
* @date 2020/11/3 4:11 下午 * @date 2020/11/3 4:11 下午
*/ */
@PostMapping("list") @PostMapping("list")
public Result<List<BadgeListResultDTO>> getBadgeList(@LoginUser TokenDto tokenDto,@RequestBody BadgeListFormDTO badgeListFormDTO){ // public Result<List<BadgeListResultDTO>> getBadgeList(@LoginUser TokenDto tokenDto,@RequestBody BadgeListFormDTO badgeListFormDTO){
ValidatorUtils.validateEntity(badgeListFormDTO, BadgeListFormDTO.BadgeList.class); public Result<List<BadgeListResultDTO>> getBadgeList(@LoginUser TokenDto tokenDto){
return new Result<List<BadgeListResultDTO>>().ok(badgeService.getBadgeList(tokenDto,badgeListFormDTO)); // ValidatorUtils.validateEntity(badgeListFormDTO, BadgeListFormDTO.BadgeList.class);
// return new Result<List<BadgeListResultDTO>>().ok(badgeService.getBadgeList(tokenDto,badgeListFormDTO));
return new Result<List<BadgeListResultDTO>>().ok(badgeService.getBadgeList(tokenDto.getCustomerId(),tokenDto.getUserId()));
} }
/** /**
@ -49,9 +49,11 @@ public class BadgeController {
* @date 2020/11/3 4:28 下午 * @date 2020/11/3 4:28 下午
*/ */
@PostMapping("operlist") @PostMapping("operlist")
public Result<List<OperListResultDTO>> getOperList(@LoginUser TokenDto tokenDto,@RequestBody OperListFormDTO operListFormDTO){ // public Result<List<OperListResultDTO>> getOperList(@LoginUser TokenDto tokenDto,@RequestBody OperListFormDTO operListFormDTO){
ValidatorUtils.validateEntity(operListFormDTO, OperListFormDTO.OperList.class); public Result<List<OperListResultDTO>> getOperList(@LoginUser TokenDto tokenDto){
return new Result<List<OperListResultDTO>>().ok(badgeService.getOperList(tokenDto,operListFormDTO)); // ValidatorUtils.validateEntity(operListFormDTO, OperListFormDTO.OperList.class);
// return new Result<List<OperListResultDTO>>().ok(badgeService.getOperList(tokenDto,operListFormDTO));
return new Result<List<OperListResultDTO>>().ok(badgeService.getOperList(tokenDto.getCustomerId(),tokenDto.getUserId()));
} }
/** /**

8
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/BadgeService.java

@ -4,8 +4,6 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.CertificationAddFormDTO; import com.epmet.dto.form.CertificationAddFormDTO;
import com.epmet.dto.form.OpenedOrClosedFormDTO; import com.epmet.dto.form.OpenedOrClosedFormDTO;
import com.epmet.resi.mine.dto.from.BadgeListFormDTO;
import com.epmet.resi.mine.dto.from.OperListFormDTO;
import com.epmet.resi.mine.dto.result.BadgeListResultDTO; import com.epmet.resi.mine.dto.result.BadgeListResultDTO;
import com.epmet.resi.mine.dto.result.OperListResultDTO; import com.epmet.resi.mine.dto.result.OperListResultDTO;
@ -23,7 +21,8 @@ public interface BadgeService {
* @author zxc * @author zxc
* @date 2020/11/3 4:11 下午 * @date 2020/11/3 4:11 下午
*/ */
List<BadgeListResultDTO> getBadgeList(TokenDto tokenDto,BadgeListFormDTO badgeListFormDTO); // List<BadgeListResultDTO> getBadgeList(TokenDto tokenDto,BadgeListFormDTO badgeListFormDTO);
List<BadgeListResultDTO> getBadgeList(String customerId,String userId);
/** /**
* @Description 个人中心-获取徽章可操作列表点亮取消认证 * @Description 个人中心-获取徽章可操作列表点亮取消认证
@ -31,7 +30,8 @@ public interface BadgeService {
* @author zxc * @author zxc
* @date 2020/11/3 4:28 下午 * @date 2020/11/3 4:28 下午
*/ */
List<OperListResultDTO> getOperList(TokenDto tokenDto,OperListFormDTO operListFormDTO); // List<OperListResultDTO> getOperList(TokenDto tokenDto,OperListFormDTO operListFormDTO);
List<OperListResultDTO> getOperList(String customerId,String userId);
/** /**
* @Description 个人中心-提交徽章认证 * @Description 个人中心-提交徽章认证

14
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/BadgeServiceImpl.java

@ -12,8 +12,6 @@ import com.epmet.dto.result.UserBadgeListResultDTO;
import com.epmet.dto.result.UserOperListResultDTO; import com.epmet.dto.result.UserOperListResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.modules.person.service.BadgeService; import com.epmet.modules.person.service.BadgeService;
import com.epmet.resi.mine.dto.from.BadgeListFormDTO;
import com.epmet.resi.mine.dto.from.OperListFormDTO;
import com.epmet.resi.mine.dto.result.BadgeListResultDTO; import com.epmet.resi.mine.dto.result.BadgeListResultDTO;
import com.epmet.resi.mine.dto.result.OperListResultDTO; import com.epmet.resi.mine.dto.result.OperListResultDTO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -41,10 +39,10 @@ public class BadgeServiceImpl implements BadgeService {
* @date 2020/11/3 4:11 下午 * @date 2020/11/3 4:11 下午
*/ */
@Override @Override
public List<BadgeListResultDTO> getBadgeList(TokenDto tokenDto,BadgeListFormDTO badgeListFormDTO) { public List<BadgeListResultDTO> getBadgeList(String customerId,String userId) {
UserBadgeListFormDTO form = new UserBadgeListFormDTO(); UserBadgeListFormDTO form = new UserBadgeListFormDTO();
form.setCustomerId(badgeListFormDTO.getCustomerId()); form.setCustomerId(customerId);
form.setUserId(tokenDto.getUserId()); form.setUserId(userId);
Result<List<UserBadgeListResultDTO>> listResult = epmetUserOpenFeignClient.selectBadgeList(form); Result<List<UserBadgeListResultDTO>> listResult = epmetUserOpenFeignClient.selectBadgeList(form);
if (!listResult.success()){ if (!listResult.success()){
throw new RenException("获取徽章点亮列表失败......"); throw new RenException("获取徽章点亮列表失败......");
@ -63,10 +61,10 @@ public class BadgeServiceImpl implements BadgeService {
* @date 2020/11/3 4:28 下午 * @date 2020/11/3 4:28 下午
*/ */
@Override @Override
public List<OperListResultDTO> getOperList(TokenDto tokenDto,OperListFormDTO operListFormDTO) { public List<OperListResultDTO> getOperList(String customerId,String userId) {
UserOperListFormDTO userOperListFormDTO = new UserOperListFormDTO(); UserOperListFormDTO userOperListFormDTO = new UserOperListFormDTO();
userOperListFormDTO.setCustomerId(operListFormDTO.getCustomerId()); userOperListFormDTO.setCustomerId(customerId);
userOperListFormDTO.setUserId(tokenDto.getUserId()); userOperListFormDTO.setUserId(userId);
Result<List<UserOperListResultDTO>> listResult = epmetUserOpenFeignClient.selectOperList(userOperListFormDTO); Result<List<UserOperListResultDTO>> listResult = epmetUserOpenFeignClient.selectOperList(userOperListFormDTO);
if (!listResult.success()){ if (!listResult.success()){
throw new RenException("获取徽章列表失败......"); throw new RenException("获取徽章列表失败......");

Loading…
Cancel
Save