## 自助服务权限接口调整;

This commit is contained in:
cabbage 2025-08-06 17:20:01 +08:00
parent 773e734cbc
commit 4439c7faf7
3 changed files with 6 additions and 42 deletions

View File

@ -1,19 +1,12 @@
package com.hzs.member.self.controller.api;
import com.hzs.common.core.constant.CountryConstants;
import com.hzs.common.core.enums.EGrade;
import com.hzs.common.core.enums.EYesNo;
import com.hzs.common.core.web.controller.BaseController;
import com.hzs.common.core.web.domain.AjaxResult;
import com.hzs.common.domain.member.ext.CuMemberExt;
import com.hzs.common.security.utils.SecurityUtils;
import com.hzs.member.base.service.ICuMemberService;
import com.hzs.member.self.service.ICuSelfServiceLogService;
import com.hzs.member.self.vo.SelfVO;
import com.hzs.system.config.IGradeServiceApi;
import com.hzs.system.config.dto.GradeDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@ -28,42 +21,22 @@ import org.springframework.web.bind.annotation.RestController;
public class ApiSelfController extends BaseController {
@Autowired
private ICuMemberService cuMemberService;
@Autowired
private ICuSelfServiceLogService cuSelfServiceLogService;
@DubboReference
IGradeServiceApi iGradeServiceApi;
private ICuSelfServiceLogService iCuSelfServiceLogService;
/**
* 自助权限查询
*/
@GetMapping("/authority")
public AjaxResult validateSelfAuthority() {
CuMemberExt cuMember = cuMemberService.getMenuMember(SecurityUtils.getUserId());
// 获取等级
GradeDTO gradeDTO = iGradeServiceApi.getGrade(cuMember.getPkSettleGrade()).getData();
if (EGrade.START_UP.getValue() == gradeDTO.getGradeValue()) {
// 会员等级需要实名认证
return AjaxResult.success(SelfVO.builder()
.existRealName(EYesNo.YES.getIntValue())
.build());
}
Long userId = SecurityUtils.getUserId();
Integer pkCountry = SecurityUtils.getPkCountry();
Integer showAddress = cuSelfServiceLogService.showHiddenAddress(cuMember.getPkId(), pkCountry);
Integer showAddress = iCuSelfServiceLogService.showHiddenAddress(userId, pkCountry);
SelfVO selfVO = SelfVO.builder()
.existAddress(showAddress)
.existOrderSelf(showAddress)
.selfRevokeOrder(showAddress)
.existDomicile(cuSelfServiceLogService.showIndexDomicile(pkCountry, cuMember.getPkId()))
.existDomicile(iCuSelfServiceLogService.showIndexDomicile(pkCountry, userId))
.existRealName(EYesNo.YES.getIntValue())
.existMemberMonth(EYesNo.YES.getIntValue())
.build();
if (!pkCountry.equals(CountryConstants.CHINA_COUNTRY)) {
selfVO.setSelfRevokeOrder(EYesNo.NO.getIntValue());
}
return AjaxResult.success(selfVO);
}

View File

@ -17,24 +17,15 @@ import java.io.Serializable;
public class SelfVO implements Serializable {
/**
* 存在收货地址 0 存在 1不存在
* 存在修改收货地址 0 存在 1不存在
*/
private Integer existAddress;
/**
* 存在订单自提
*/
private Integer existOrderSelf;
/**
* 存在户籍变更
*/
private Integer existDomicile;
/**
* 存在月统计数据
*/
private Integer existMemberMonth;
/**
* 存在自助撤单 0 存在 1不存在
*/

View File

@ -215,7 +215,7 @@
order by css.creation_time desc
</select>
<!-- 查询用户是否存在已支付订单-->
<!-- 查询用户是否存在已支付订单-->
<select id="showHiddenAddressList" resultType="java.lang.Integer">
select count(0)
from sa_order so