## 自助服务权限接口调整;
This commit is contained in:
parent
dd26c901fa
commit
7778c004ba
|
@ -1,19 +1,12 @@
|
||||||
package com.hzs.member.self.controller.api;
|
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.enums.EYesNo;
|
||||||
import com.hzs.common.core.web.controller.BaseController;
|
import com.hzs.common.core.web.controller.BaseController;
|
||||||
import com.hzs.common.core.web.domain.AjaxResult;
|
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.common.security.utils.SecurityUtils;
|
||||||
import com.hzs.member.base.service.ICuMemberService;
|
|
||||||
import com.hzs.member.self.service.ICuSelfServiceLogService;
|
import com.hzs.member.self.service.ICuSelfServiceLogService;
|
||||||
import com.hzs.member.self.vo.SelfVO;
|
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 lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
@ -28,42 +21,22 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
public class ApiSelfController extends BaseController {
|
public class ApiSelfController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ICuMemberService cuMemberService;
|
private ICuSelfServiceLogService iCuSelfServiceLogService;
|
||||||
@Autowired
|
|
||||||
private ICuSelfServiceLogService cuSelfServiceLogService;
|
|
||||||
|
|
||||||
@DubboReference
|
|
||||||
IGradeServiceApi iGradeServiceApi;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自助权限查询
|
* 自助权限查询
|
||||||
*/
|
*/
|
||||||
@GetMapping("/authority")
|
@GetMapping("/authority")
|
||||||
public AjaxResult validateSelfAuthority() {
|
public AjaxResult validateSelfAuthority() {
|
||||||
CuMemberExt cuMember = cuMemberService.getMenuMember(SecurityUtils.getUserId());
|
Long userId = 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());
|
|
||||||
}
|
|
||||||
|
|
||||||
Integer pkCountry = SecurityUtils.getPkCountry();
|
Integer pkCountry = SecurityUtils.getPkCountry();
|
||||||
Integer showAddress = cuSelfServiceLogService.showHiddenAddress(cuMember.getPkId(), pkCountry);
|
Integer showAddress = iCuSelfServiceLogService.showHiddenAddress(userId, pkCountry);
|
||||||
SelfVO selfVO = SelfVO.builder()
|
SelfVO selfVO = SelfVO.builder()
|
||||||
.existAddress(showAddress)
|
.existAddress(showAddress)
|
||||||
.existOrderSelf(showAddress)
|
|
||||||
.selfRevokeOrder(showAddress)
|
.selfRevokeOrder(showAddress)
|
||||||
.existDomicile(cuSelfServiceLogService.showIndexDomicile(pkCountry, cuMember.getPkId()))
|
.existDomicile(iCuSelfServiceLogService.showIndexDomicile(pkCountry, userId))
|
||||||
.existRealName(EYesNo.YES.getIntValue())
|
.existRealName(EYesNo.YES.getIntValue())
|
||||||
.existMemberMonth(EYesNo.YES.getIntValue())
|
|
||||||
.build();
|
.build();
|
||||||
if (!pkCountry.equals(CountryConstants.CHINA_COUNTRY)) {
|
|
||||||
selfVO.setSelfRevokeOrder(EYesNo.NO.getIntValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
return AjaxResult.success(selfVO);
|
return AjaxResult.success(selfVO);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,24 +17,15 @@ import java.io.Serializable;
|
||||||
public class SelfVO implements Serializable {
|
public class SelfVO implements Serializable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 存在收货地址 0 存在 1不存在
|
* 存在修改收货地址 0 存在 1不存在
|
||||||
*/
|
*/
|
||||||
private Integer existAddress;
|
private Integer existAddress;
|
||||||
|
|
||||||
/**
|
|
||||||
* 存在订单自提
|
|
||||||
*/
|
|
||||||
private Integer existOrderSelf;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 存在户籍变更
|
* 存在户籍变更
|
||||||
*/
|
*/
|
||||||
private Integer existDomicile;
|
private Integer existDomicile;
|
||||||
|
|
||||||
/**
|
|
||||||
* 存在月统计数据
|
|
||||||
*/
|
|
||||||
private Integer existMemberMonth;
|
|
||||||
/**
|
/**
|
||||||
* 存在自助撤单 0 存在 1不存在
|
* 存在自助撤单 0 存在 1不存在
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -215,7 +215,7 @@
|
||||||
order by css.creation_time desc
|
order by css.creation_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 查询用户是否存在已支付订单-->
|
<!-- 查询用户是否存在已支付订单-->
|
||||||
<select id="showHiddenAddressList" resultType="java.lang.Integer">
|
<select id="showHiddenAddressList" resultType="java.lang.Integer">
|
||||||
select count(0)
|
select count(0)
|
||||||
from sa_order so
|
from sa_order so
|
||||||
|
|
Loading…
Reference in New Issue