## 0元会员只能购买188流程;
This commit is contained in:
		
							parent
							
								
									b7cf82d3b9
								
							
						
					
					
						commit
						d035446d6b
					
				| 
						 | 
				
			
			@ -9,11 +9,7 @@ import java.io.Serializable;
 | 
			
		|||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @Description: 用户权限DTO
 | 
			
		||||
 * @Author: jiang chao
 | 
			
		||||
 * @Time: 2023/5/22 14:37
 | 
			
		||||
 * @Classname: UserAuthorityDTO
 | 
			
		||||
 * @PackageName: com.hzs.system.sys.dto
 | 
			
		||||
 * 用户权限DTO
 | 
			
		||||
 */
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
@AllArgsConstructor
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -35,8 +35,6 @@ import com.hzs.system.base.ICountryServiceApi;
 | 
			
		|||
import com.hzs.system.base.ISystemConfigServiceApi;
 | 
			
		||||
import com.hzs.system.config.IGradeServiceApi;
 | 
			
		||||
import com.hzs.system.config.dto.GradeDTO;
 | 
			
		||||
import com.hzs.system.sys.IUserServiceApi;
 | 
			
		||||
import com.hzs.system.sys.dto.UserAuthorityDTO;
 | 
			
		||||
import lombok.extern.slf4j.Slf4j;
 | 
			
		||||
import org.apache.dubbo.config.annotation.DubboReference;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
| 
						 | 
				
			
			@ -69,20 +67,11 @@ public class ApiMemberStructureController extends BaseController {
 | 
			
		|||
    @DubboReference
 | 
			
		||||
    IGradeServiceApi iGradeServiceApi;
 | 
			
		||||
    @DubboReference
 | 
			
		||||
    IUserServiceApi iUserServiceApi;
 | 
			
		||||
    @DubboReference
 | 
			
		||||
    ICountryServiceApi iCountryServiceApi;
 | 
			
		||||
    @DubboReference
 | 
			
		||||
    ISystemConfigServiceApi systemConfigServiceApi;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @param build
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    public List<Tree<String>> setTreeList(List<Tree<String>> build, Integer numberOfPlies, Map<Integer, BdCountry> allCountryData) {
 | 
			
		||||
//        Integer pkCountry = SecurityUtils.getPkCountry();
 | 
			
		||||
//        String nationalFlag1 = allCountryData.get(pkCountry).getNationalFlag1();
 | 
			
		||||
//        String nationalFlag2 = allCountryData.get(pkCountry).getNationalFlag2();
 | 
			
		||||
        for (Tree<String> stringTree : build) {
 | 
			
		||||
            Integer level = (Integer) stringTree.get("level");
 | 
			
		||||
            if (level < (numberOfPlies - 1)) {
 | 
			
		||||
| 
						 | 
				
			
			@ -280,9 +269,6 @@ public class ApiMemberStructureController extends BaseController {
 | 
			
		|||
    public AjaxResult azFramework() {
 | 
			
		||||
        Integer level = 1;
 | 
			
		||||
        List<Tree<String>> result = null;
 | 
			
		||||
        // 体系
 | 
			
		||||
        UserAuthorityDTO userAuthorityDTO = iUserServiceApi.getUserAuthority(SecurityUtils.getUserId()).getData();
 | 
			
		||||
        List<Integer> vertexIdList = userAuthorityDTO.getVertexIdList();
 | 
			
		||||
        Date date = new Date();
 | 
			
		||||
        String time = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, date);
 | 
			
		||||
        LocalDate beforeLocalDate = DateUtils.getStringToLocalDate(time).minus(1, ChronoUnit.DAYS);
 | 
			
		||||
| 
						 | 
				
			
			@ -293,90 +279,33 @@ public class ApiMemberStructureController extends BaseController {
 | 
			
		|||
        if (csPeriod != null) {
 | 
			
		||||
            period = csPeriod.getPkId();
 | 
			
		||||
        }
 | 
			
		||||
        // 查询当天 (秒结)
 | 
			
		||||
//        if (settleDate != null
 | 
			
		||||
//                && DateUtils.parseDateToFormat(DateUtils.YYYY_MM_DD, settleDate).equals(DateUtils.parseDateToFormat(DateUtils.YYYY_MM_DD, new Date()))) {
 | 
			
		||||
        if (1 == 2) {
 | 
			
		||||
            // 会员结算秒结表
 | 
			
		||||
            String settleTableName = TableNameConstants.CU_MEMBER_SECOND + period;
 | 
			
		||||
            // 查询所有用户表数据 id
 | 
			
		||||
            // 查询秒结 表 如果 秒结表 没有则去 历史表
 | 
			
		||||
            Integer tableNumber = iCuMemberTreeService.queryExistOracleTable(settleTableName);
 | 
			
		||||
            if (tableNumber != null && tableNumber == 1) {
 | 
			
		||||
                List<CuMemberSettleExt> cuMemberSettleExts;
 | 
			
		||||
                // 查询今日会员表是否有值
 | 
			
		||||
                Long treeMemberCount = iCuMemberTreeService.selectByselectByTreeMemberCount(settleTableName, pkMember);
 | 
			
		||||
                if (treeMemberCount > 0) {
 | 
			
		||||
                    //表格存在
 | 
			
		||||
                    cuMemberSettleExts = iCuMemberTreeService.selectByTreeMemberList(pkMember, settleTableName, level, vertexIdList);
 | 
			
		||||
                } else {
 | 
			
		||||
                    DateTime dateTime = DateUtil.offsetDay(DateUtils.currentDate(), -1);
 | 
			
		||||
                    time = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, dateTime);
 | 
			
		||||
                    csPeriod = iCuMemberSettlePeriodService.getCuMemberSettlePeriodByDate(time);
 | 
			
		||||
                    if (csPeriod != null) {
 | 
			
		||||
                        period = csPeriod.getPkId();
 | 
			
		||||
                    }
 | 
			
		||||
                    settleTableName = TableNameConstants.CU_MEMBER_SETTLE + period;
 | 
			
		||||
                    cuMemberSettleExts = iCuMemberTreeService.selectByTreeMemberList(pkMember, settleTableName, level, vertexIdList);
 | 
			
		||||
                }
 | 
			
		||||
                // 查询顶点
 | 
			
		||||
                CuMemberSettleExt memberSettleExt = iCuMemberTreeService.queryCuMemberTreeByPkMemberTable(settleTableName, pkMember);
 | 
			
		||||
                if (MemberConstants.GJ30720200CODE.equals(memberSettleExt.getParentMemberCode())) {
 | 
			
		||||
                    memberSettleExt.setParentMemberCode(memberSettleExt.getMemberCode());
 | 
			
		||||
                }
 | 
			
		||||
                memberSettleExt.setLevel(0);
 | 
			
		||||
                // 添加自身
 | 
			
		||||
                cuMemberSettleExts.add(memberSettleExt);
 | 
			
		||||
                List<Tree<String>> build = iCuMemberService.systemAzSetListTree(cuMemberSettleExts, memberSettleExt);
 | 
			
		||||
                // 安置架构 无点位 追加空点位
 | 
			
		||||
                R<Map<Integer, BdCountry>> allCountryMap = iCountryServiceApi.getAllCountryMap();
 | 
			
		||||
                Map<Integer, BdCountry> allCountryData = allCountryMap.getData();
 | 
			
		||||
                result = setTreeList(build, level, allCountryData);
 | 
			
		||||
            } else {
 | 
			
		||||
                // 查询表格是否存在
 | 
			
		||||
                tableNumber = iCuMemberTreeService.queryExistOracleTable(settleTableName);
 | 
			
		||||
                if (tableNumber == null) {
 | 
			
		||||
                    settleTableName = null;
 | 
			
		||||
                }
 | 
			
		||||
                // 查询顶点
 | 
			
		||||
                CuMemberSettleExt memberSettleExt = iCuMemberTreeService.queryCuMemberTreeByPkMemberTable(settleTableName, pkMember);
 | 
			
		||||
                if (MemberConstants.GJ30720200CODE.equals(memberSettleExt.getParentMemberCode())) {
 | 
			
		||||
                    memberSettleExt.setParentMemberCode(memberSettleExt.getMemberCode());
 | 
			
		||||
                }
 | 
			
		||||
                memberSettleExt.setLevel(0);
 | 
			
		||||
                //查询下级
 | 
			
		||||
                List<CuMemberSettleExt> list = iCuMemberTreeService.queryCuMemberTreePlaceParentHistoryTable(settleTableName, pkMember, new ArrayList<>(), level);
 | 
			
		||||
                // 无法查询到自身 所有单独查询自身并且添加
 | 
			
		||||
                list.add(memberSettleExt);
 | 
			
		||||
                List<Tree<String>> build = iCuMemberService.systemAzSetListTree(list, memberSettleExt);
 | 
			
		||||
                // 安置架构 无点位 追加空点位
 | 
			
		||||
                R<Map<Integer, BdCountry>> allCountryMap = iCountryServiceApi.getAllCountryMap();
 | 
			
		||||
                Map<Integer, BdCountry> allCountryData = allCountryMap.getData();
 | 
			
		||||
                result = setTreeList(build, level, allCountryData);
 | 
			
		||||
 | 
			
		||||
        // 查询 历史
 | 
			
		||||
        String settleTableName = TableNameConstants.CU_MEMBER_SETTLE + period;
 | 
			
		||||
        Integer tableNumber = iCuMemberTreeService.queryExistOracleTable(settleTableName);
 | 
			
		||||
        if (tableNumber != null && tableNumber == 1) {
 | 
			
		||||
            // 表示表格存在
 | 
			
		||||
            // 查询顶点
 | 
			
		||||
            CuMemberSettleExt memberSettleExt = iCuMemberTreeService.queryCuMemberTreeByPkMemberTable(settleTableName, pkMember);
 | 
			
		||||
            if (null == memberSettleExt.getPkPlaceParent()) {
 | 
			
		||||
                // 0元会员
 | 
			
		||||
                return AjaxResult.success();
 | 
			
		||||
            }
 | 
			
		||||
        } else {
 | 
			
		||||
            // 查询 历史
 | 
			
		||||
            String settleTableName = TableNameConstants.CU_MEMBER_SETTLE + period;
 | 
			
		||||
            Integer tableNumber = iCuMemberTreeService.queryExistOracleTable(settleTableName);
 | 
			
		||||
            if (tableNumber != null && tableNumber == 1) {
 | 
			
		||||
                // 表示表格存在
 | 
			
		||||
                // 查询顶点
 | 
			
		||||
                CuMemberSettleExt memberSettleExt = iCuMemberTreeService.queryCuMemberTreeByPkMemberTable(settleTableName, pkMember);
 | 
			
		||||
                if (MemberConstants.GJ30720200CODE.equals(memberSettleExt.getParentMemberCode())) {
 | 
			
		||||
                    memberSettleExt.setParentMemberCode(memberSettleExt.getMemberCode());
 | 
			
		||||
                }
 | 
			
		||||
                memberSettleExt.setLevel(0);
 | 
			
		||||
                //查询下级
 | 
			
		||||
                List<CuMemberSettleExt> list = iCuMemberTreeService.queryCuMemberTreePlaceParentHistoryFramework(settleTableName, pkMember, new ArrayList<>(), level);
 | 
			
		||||
                // 无法查询到自身 所有单独查询自身并且添加
 | 
			
		||||
                list.add(memberSettleExt);
 | 
			
		||||
                List<Tree<String>> build = iCuMemberService.systemAzSetListTree(list, memberSettleExt);
 | 
			
		||||
                // 安置架构 无点位 追加空点位
 | 
			
		||||
                R<Map<Integer, BdCountry>> allCountryMap = iCountryServiceApi.getAllCountryMap();
 | 
			
		||||
                Map<Integer, BdCountry> allCountryData = allCountryMap.getData();
 | 
			
		||||
                result = setTreeList(build, level, allCountryData);
 | 
			
		||||
            if (MemberConstants.GJ30720200CODE.equals(memberSettleExt.getParentMemberCode())) {
 | 
			
		||||
                memberSettleExt.setParentMemberCode(memberSettleExt.getMemberCode());
 | 
			
		||||
            }
 | 
			
		||||
            memberSettleExt.setLevel(0);
 | 
			
		||||
            //查询下级
 | 
			
		||||
            List<CuMemberSettleExt> list = iCuMemberTreeService.queryCuMemberTreePlaceParentHistoryFramework(settleTableName, pkMember, new ArrayList<>(), level);
 | 
			
		||||
            // 无法查询到自身 所有单独查询自身并且添加
 | 
			
		||||
            list.add(memberSettleExt);
 | 
			
		||||
            List<Tree<String>> build = iCuMemberService.systemAzSetListTree(list, memberSettleExt);
 | 
			
		||||
            // 安置架构 无点位 追加空点位
 | 
			
		||||
            R<Map<Integer, BdCountry>> allCountryMap = iCountryServiceApi.getAllCountryMap();
 | 
			
		||||
            Map<Integer, BdCountry> allCountryData = allCountryMap.getData();
 | 
			
		||||
            result = setTreeList(build, level, allCountryData);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        BdBonusExpand bdBonusExpand = systemConfigServiceApi.getBdBonusExpand().getData();
 | 
			
		||||
        assert result != null;
 | 
			
		||||
        String leftFirstSurplusStr = result.get(0).get("leftFirstSurplus").toString();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -551,17 +551,7 @@ public abstract class ParentOrderController extends BaseController {
 | 
			
		|||
    protected OrderReturn getOrderReturn(SaOrder saOrder, OrderParam orderParam) {
 | 
			
		||||
        // 封装订单信息
 | 
			
		||||
        long maxPayTime = iSaOrderService.getIsToBePayTime(orderParam.getPkSettleCountry(), saOrder.getOrderType());
 | 
			
		||||
        // 剩余支付秒数
 | 
			
		||||
        //查询带关闭参数
 | 
			
		||||
        // 获取行政区划map
 | 
			
		||||
        Integer pkLoginCountry = orderParam.getPkLoginSettleCountry();
 | 
			
		||||
        BigDecimal orderAmount = saOrder.getOrderAmount();
 | 
			
		||||
        if (!Objects.equals(pkLoginCountry, saOrder.getPkCountry())) {
 | 
			
		||||
            // 结算国当地币 转美金  美金登录当地币
 | 
			
		||||
            CurrencyDTO loginCountryCurrency = iCurrencyServiceApi.getCurrency(pkLoginCountry).getData();
 | 
			
		||||
            CurrencyDTO settleCountryCurrency = iCurrencyServiceApi.getCurrency(saOrder.getPkCountry()).getData();
 | 
			
		||||
            orderAmount = ComputeUtil.computeMultiply(ComputeUtil.computeDivide(orderAmount, settleCountryCurrency.getInExchangeRate()), loginCountryCurrency.getInExchangeRate());
 | 
			
		||||
        }
 | 
			
		||||
        Map<Integer, String> areaMap = iAreaServiceApi.getAreaMap(orderParam.getPkSettleCountry()).getData();
 | 
			
		||||
        OrderReturn orderReturn = OrderReturn.builder()
 | 
			
		||||
                .orderCode(saOrder.getOrderCode())
 | 
			
		||||
| 
						 | 
				
			
			@ -635,7 +625,7 @@ public abstract class ParentOrderController extends BaseController {
 | 
			
		|||
            return AjaxResult.error(SaOrderMsgConstants.TERMINATED_NOT_DECLARATION);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return AjaxResult.success();
 | 
			
		||||
        return AjaxResult.success(cuMember);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -12,6 +12,8 @@ import com.hzs.common.core.constant.msg.SaOrderMsgConstants;
 | 
			
		|||
import com.hzs.common.core.domain.R;
 | 
			
		||||
import com.hzs.common.core.enums.EDelivery;
 | 
			
		||||
import com.hzs.common.core.enums.EOrderType;
 | 
			
		||||
import com.hzs.common.core.enums.EOrderTypeExtend;
 | 
			
		||||
import com.hzs.common.core.enums.ESpecialArea;
 | 
			
		||||
import com.hzs.common.core.utils.CommonUtil;
 | 
			
		||||
import com.hzs.common.core.utils.StringUtils;
 | 
			
		||||
import com.hzs.common.core.web.domain.AjaxResult;
 | 
			
		||||
| 
						 | 
				
			
			@ -72,16 +74,26 @@ public class ApiRegSaOrderController extends ParentOrderController {
 | 
			
		|||
        initSecurityOrderParam(orderParam);
 | 
			
		||||
        // 验证必输项
 | 
			
		||||
        if (null == source
 | 
			
		||||
                || validateFieldNotNull(orderParam, orderParam.getValidConfirmField())
 | 
			
		||||
                || !checkRecMsgBoolean(orderParam)) {
 | 
			
		||||
            return AjaxResult.error(MemberMsgConstants.REQUIRED_NOT_EMPTY);
 | 
			
		||||
        }
 | 
			
		||||
        orderParam.setSource(source);
 | 
			
		||||
        // 0元会员专区处理
 | 
			
		||||
        if (ESpecialArea.MEMBER_AREA.getValue() == orderParam.getSpecialArea()) {
 | 
			
		||||
            orderParam.setOrderTypeExtend(EOrderTypeExtend.REG_REP.getValue());
 | 
			
		||||
            orderParam.setSpecialArea(ESpecialArea.getMemberArea(orderParam.getSpecialArea()));
 | 
			
		||||
        } else {
 | 
			
		||||
            // 校验安置位置
 | 
			
		||||
            if (validateFieldNotNull(orderParam, orderParam.getValidConfirmField())) {
 | 
			
		||||
                return AjaxResult.error(MemberMsgConstants.REQUIRED_NOT_EMPTY);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
        AjaxResult result = validateSaveMember(orderParam);
 | 
			
		||||
        if ((Integer) result.get(AjaxResult.CODE_TAG) == HttpStatus.ERROR) {
 | 
			
		||||
            return result;
 | 
			
		||||
            AjaxResult result = validateSaveMember(orderParam);
 | 
			
		||||
            if ((Integer) result.get(AjaxResult.CODE_TAG) == HttpStatus.ERROR) {
 | 
			
		||||
                return result;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // 购物车中的商品相关信息
 | 
			
		||||
        convertShoppingCarToSku(orderParam);
 | 
			
		||||
        if (getOrderService().confirmRegSaOrderByOrderParam(orderParam)) {
 | 
			
		||||
| 
						 | 
				
			
			@ -296,6 +308,9 @@ public class ApiRegSaOrderController extends ParentOrderController {
 | 
			
		|||
            return AjaxResult.error(SaOrderMsgConstants.SPECIAL_AREA_NOT_EMPTY);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // 0元会员专区处理
 | 
			
		||||
        orderParam.setSpecialArea(ESpecialArea.getMemberArea(orderParam.getSpecialArea()));
 | 
			
		||||
 | 
			
		||||
        if ((checkRecPostageMsgBoolean(orderParam) && orderParam.getDeliveryWay() == EDelivery.FAST_MAIL.getValue())) {
 | 
			
		||||
            // 验证必输项,一个条件未填写都不计算邮费
 | 
			
		||||
            initSecurityOrderParam(orderParam);
 | 
			
		||||
| 
						 | 
				
			
			@ -431,8 +446,6 @@ public class ApiRegSaOrderController extends ParentOrderController {
 | 
			
		|||
 | 
			
		||||
    /**
 | 
			
		||||
     * 校验会员等级, 计算会员等级
 | 
			
		||||
     *
 | 
			
		||||
     * @param orderParam 参数
 | 
			
		||||
     */
 | 
			
		||||
    @PostMapping("/valid-mem-level")
 | 
			
		||||
    public AjaxResult validateMemberLevel(@RequestBody OrderParam orderParam) {
 | 
			
		||||
| 
						 | 
				
			
			@ -443,6 +456,8 @@ public class ApiRegSaOrderController extends ParentOrderController {
 | 
			
		|||
                orderParam.getOrderItemsParams().size() == 0) {
 | 
			
		||||
            return AjaxResult.error("没有选择商品!");
 | 
			
		||||
        }
 | 
			
		||||
        // 0元会员专区处理
 | 
			
		||||
        orderParam.setSpecialArea(ESpecialArea.getMemberArea(orderParam.getSpecialArea()));
 | 
			
		||||
        orderParam.setCenterCodeId(SecurityUtils.getUserId());
 | 
			
		||||
        convertShoppingCarToSku(orderParam);
 | 
			
		||||
        // 计算等级
 | 
			
		||||
| 
						 | 
				
			
			@ -472,8 +487,6 @@ public class ApiRegSaOrderController extends ParentOrderController {
 | 
			
		|||
 | 
			
		||||
    /**
 | 
			
		||||
     * 快速注册
 | 
			
		||||
     *
 | 
			
		||||
     * @param orderParam 参数
 | 
			
		||||
     */
 | 
			
		||||
    @PostMapping("/quick-reg")
 | 
			
		||||
    public AjaxResult quickRegistration(@RequestBody OrderParam orderParam) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -456,14 +456,17 @@ public class SaOrderServiceImpl extends ServiceImpl<SaOrderMapper, SaOrder> impl
 | 
			
		|||
    public Boolean confirmRegSaOrderByOrderParam(OrderParam orderParam) {
 | 
			
		||||
        boolean isToBePay = getIsToBePayByOrderType(orderParam.getPkSettleCountry(), orderParam.getSpecialArea());
 | 
			
		||||
        CuMember cuMember = saOrderHandle.packageSaveUser(orderParam, iMemberServiceApi.queryMember(orderParam.getCenterCodeId()).getData());
 | 
			
		||||
        // 获取会员编号、会员主键
 | 
			
		||||
        if (isToBePay) {
 | 
			
		||||
            cuMember = iMemberServiceApi.createMemberIdAndCode(cuMember, Boolean.FALSE).getData();
 | 
			
		||||
        } else if ((CountryConstants.CHINA_COUNTRY.equals(orderParam.getPkSettleCountry())) &&
 | 
			
		||||
                (EOrderType.REGISTER_ORDER.getValue() == orderParam.getSpecialArea()
 | 
			
		||||
                        || EOrderType.SPECIAL_REGISTER_ORDER.getValue() == orderParam.getSpecialArea())) {
 | 
			
		||||
            // 2023.10.16按最新需求,注册订单需要在支付前需要显示会员编号
 | 
			
		||||
            cuMember = iMemberServiceApi.createRegisterMemberCode(cuMember).getData();
 | 
			
		||||
 | 
			
		||||
        if (!EOrderTypeExtend.REG_REP.getValue().equals(orderParam.getOrderTypeExtend())) {
 | 
			
		||||
            // 非0元需要获取会员编号、会员主键
 | 
			
		||||
            // 获取会员编号、会员主键
 | 
			
		||||
            if (isToBePay) {
 | 
			
		||||
                cuMember = iMemberServiceApi.createMemberIdAndCode(cuMember, Boolean.FALSE).getData();
 | 
			
		||||
            } else if (EOrderType.REGISTER_ORDER.getValue() == orderParam.getSpecialArea()
 | 
			
		||||
                    || EOrderType.SPECIAL_REGISTER_ORDER.getValue() == orderParam.getSpecialArea()) {
 | 
			
		||||
                // 2023.10.16按最新需求,注册订单需要在支付前需要显示会员编号
 | 
			
		||||
                cuMember = iMemberServiceApi.createRegisterMemberCode(cuMember).getData();
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        SaOrderExt saOrderExt = packageWholeSaOrder(orderParam, cuMember);
 | 
			
		||||
| 
						 | 
				
			
			@ -554,15 +557,17 @@ public class SaOrderServiceImpl extends ServiceImpl<SaOrderMapper, SaOrder> impl
 | 
			
		|||
 | 
			
		||||
        // 验证推荐等级,判断什么级别可以推荐什么级别
 | 
			
		||||
        if (EOrderType.REGISTER_ORDER.getValue() == saOrderExt.getOrderType()) {
 | 
			
		||||
            // 判断推荐范围,验证该推荐人是否有推荐的权限
 | 
			
		||||
            CuMember parentCuMember = getCuMemberByKey(cuMember.getPkParent());
 | 
			
		||||
            if (!EOrderTypeExtend.REG_REP.getValue().equals(saOrderExt.getOrderTypeExtend())) {
 | 
			
		||||
                // 判断推荐范围,验证该推荐人是否有推荐的权限
 | 
			
		||||
                CuMember parentCuMember = getCuMemberByKey(cuMember.getPkParent());
 | 
			
		||||
 | 
			
		||||
            if (parentCuMember.getPkSettleCountry() != null && cuMember.getPkSettleCountry() != null && Objects.equals(parentCuMember.getPkSettleCountry(), cuMember.getPkSettleCountry())) {
 | 
			
		||||
                GradeDTO validateGradeDTO = queryGradeConfigByCondition(parentCuMember.getPkSettleCountry(), parentCuMember.getPkSettleGrade());
 | 
			
		||||
                // 获取推荐人可以推荐的等级
 | 
			
		||||
                if (validateGradeDTO == null || validateGradeDTO.getBdGradeScopeExtList() == null ||
 | 
			
		||||
                        validateGradeDTO.getBdGradeScopeExtList().stream().noneMatch(bdGradeScope -> gradeDTO.getPkId().equals(bdGradeScope.getPkScope()))) {
 | 
			
		||||
                    return true;
 | 
			
		||||
                if (parentCuMember.getPkSettleCountry() != null && cuMember.getPkSettleCountry() != null && Objects.equals(parentCuMember.getPkSettleCountry(), cuMember.getPkSettleCountry())) {
 | 
			
		||||
                    GradeDTO validateGradeDTO = queryGradeConfigByCondition(parentCuMember.getPkSettleCountry(), parentCuMember.getPkSettleGrade());
 | 
			
		||||
                    // 获取推荐人可以推荐的等级
 | 
			
		||||
                    if (validateGradeDTO == null || validateGradeDTO.getBdGradeScopeExtList() == null ||
 | 
			
		||||
                            validateGradeDTO.getBdGradeScopeExtList().stream().noneMatch(bdGradeScope -> gradeDTO.getPkId().equals(bdGradeScope.getPkScope()))) {
 | 
			
		||||
                        return true;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -1035,7 +1040,7 @@ public class SaOrderServiceImpl extends ServiceImpl<SaOrderMapper, SaOrder> impl
 | 
			
		|||
        }
 | 
			
		||||
        // 封装订单信息
 | 
			
		||||
        SaOrderExt saOrderExt = saOrderHandle.packageSaveSaOrder(orderParam, cuMember, orderCode);
 | 
			
		||||
        if (null != orderParam.getOrderTypeExtend() && EOrderTypeExtend.REG_REP.getValue() == orderParam.getOrderTypeExtend()) {
 | 
			
		||||
        if (null != orderParam.getOrderTypeExtend() && EOrderTypeExtend.REG_REP.getValue().equals(orderParam.getOrderTypeExtend())) {
 | 
			
		||||
            saOrderExt.setOrderType(EOrderType.REPURCHASE_ORDER.getValue());
 | 
			
		||||
            saOrderExt.setOrderTypeExtend(orderParam.getOrderTypeExtend());
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -1058,11 +1063,7 @@ public class SaOrderServiceImpl extends ServiceImpl<SaOrderMapper, SaOrder> impl
 | 
			
		|||
            saOrderExt.setOrderAssAchieve(ComputeUtil.computeAddMultiply(saOrderExt.getOrderAssAchieve(), saOrderItems.getAssAchievement(), saOrderItems.getQuantity()));
 | 
			
		||||
            productIdList.add(saOrderItems.getPkProduct());
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        if (CountryConstants.CHINA_COUNTRY.equals(saOrderExt.getPkCountry())) {
 | 
			
		||||
            // 中国金额四舍五入保留2位小数
 | 
			
		||||
            saOrderExt.setOrderAmount(saOrderExt.getOrderAmount().setScale(2, RoundingMode.HALF_UP));
 | 
			
		||||
        }
 | 
			
		||||
        saOrderExt.setOrderAmount(saOrderExt.getOrderAmount().setScale(2, RoundingMode.HALF_UP));
 | 
			
		||||
 | 
			
		||||
        if (productIdList.size() > 0 && saOrderExt.getRecProvince() != null) {
 | 
			
		||||
            // 根据产品,先查看是否由仓库,有仓库的话修改仓库
 | 
			
		||||
| 
						 | 
				
			
			@ -1904,41 +1905,41 @@ public class SaOrderServiceImpl extends ServiceImpl<SaOrderMapper, SaOrder> impl
 | 
			
		|||
        log.info("在线支付回调接受的参数, order : {}", saOrderExt);
 | 
			
		||||
        saOrderExt.setPayType(EOrderPayType.ONLINE.getValue());
 | 
			
		||||
 | 
			
		||||
//        if (EOrderType.REGISTER_ORDER.getValue() == saOrderExt.getOrderType()) {
 | 
			
		||||
//            // 注册订单
 | 
			
		||||
//            if (saOrderExt.getPkCreator().equals(saOrderExt.getPkMember())) {
 | 
			
		||||
//                // 自注册分享订单
 | 
			
		||||
//                payShareSaOrder(saOrderExt);
 | 
			
		||||
//                return Boolean.TRUE;
 | 
			
		||||
//            }
 | 
			
		||||
//        } else if (EOrderType.REPURCHASE_ORDER.getValue() == saOrderExt.getOrderType()) {
 | 
			
		||||
//            // 复购订单
 | 
			
		||||
//            // 判断是否消费过生成了会员
 | 
			
		||||
//            CuMember cuMember = getCuMemberByKey(saOrderExt.getPkMember());
 | 
			
		||||
//            if (cuMember == null) {
 | 
			
		||||
//                // 自注册分享订单
 | 
			
		||||
//                payShareSaOrder(saOrderExt);
 | 
			
		||||
//                return Boolean.TRUE;
 | 
			
		||||
//            }
 | 
			
		||||
//        }
 | 
			
		||||
        CuMember newCuMember = null;
 | 
			
		||||
        if (saOrderExt.getPkMember() != null) {
 | 
			
		||||
            newCuMember = getCuMemberByKey(saOrderExt.getPkMember());
 | 
			
		||||
        }
 | 
			
		||||
        if (EOrderType.REGISTER_ORDER.getValue() == saOrderExt.getOrderType()
 | 
			
		||||
                || EOrderType.SPECIAL_REGISTER_ORDER.getValue() == saOrderExt.getOrderType()) {
 | 
			
		||||
            // 注册订单
 | 
			
		||||
            boolean isToBePay = getIsToBePayByOrderType(saOrderExt.getPkCountry(), saOrderExt.getOrderType());
 | 
			
		||||
            OrderParam orderParam = redisService.getCacheObject(CacheConstants.TEMP_PARAM + pkMember + orderCode);
 | 
			
		||||
            if (newCuMember == null && !isToBePay) {
 | 
			
		||||
                newCuMember = packageCuMember(orderParam);
 | 
			
		||||
 | 
			
		||||
            if (EOrderTypeExtend.REG_REP.getValue() == saOrderExt.getOrderTypeExtend()) {
 | 
			
		||||
                // TODO 注册转复购
 | 
			
		||||
                log.info("==========新注册转复购==========");
 | 
			
		||||
                // 188分享订单,复购订单 扩展类型为 注册转复购
 | 
			
		||||
                OrderParam orderParam = redisService.getCacheObject(CacheConstants.TEMP_PARAM + pkMember + orderCode);
 | 
			
		||||
                orderParam.setIsHaiFun(Boolean.TRUE);
 | 
			
		||||
                orderParam.setOrderTypeExtend(saOrderExt.getOrderTypeExtend());
 | 
			
		||||
 | 
			
		||||
                saOrderExt = packageSaOrder(orderParam, newCuMember);
 | 
			
		||||
                saOrderExt.setPayType(EOrderPayType.ONLINE.getValue());
 | 
			
		||||
                if (newCuMember == null) {
 | 
			
		||||
                    throw new RuntimeException("生成会员失败");
 | 
			
		||||
                }
 | 
			
		||||
                payRegSaOrder(saOrderExt, newCuMember, null, Boolean.TRUE);
 | 
			
		||||
            } else {
 | 
			
		||||
                // 注册订单
 | 
			
		||||
                boolean isToBePay = getIsToBePayByOrderType(saOrderExt.getPkCountry(), saOrderExt.getOrderType());
 | 
			
		||||
                OrderParam orderParam = redisService.getCacheObject(CacheConstants.TEMP_PARAM + pkMember + orderCode);
 | 
			
		||||
                if (newCuMember == null && !isToBePay) {
 | 
			
		||||
                    newCuMember = packageCuMember(orderParam);
 | 
			
		||||
                    saOrderExt = packageSaOrder(orderParam, newCuMember);
 | 
			
		||||
                    saOrderExt.setPayType(EOrderPayType.ONLINE.getValue());
 | 
			
		||||
                }
 | 
			
		||||
                if (newCuMember == null) {
 | 
			
		||||
                    throw new RuntimeException("生成会员失败");
 | 
			
		||||
                }
 | 
			
		||||
                payRegSaOrder(saOrderExt, newCuMember, null, Boolean.FALSE);
 | 
			
		||||
            }
 | 
			
		||||
            if (newCuMember == null) {
 | 
			
		||||
                throw new RuntimeException("生成会员失败");
 | 
			
		||||
            }
 | 
			
		||||
            payRegSaOrder(saOrderExt, newCuMember, null, Boolean.FALSE);
 | 
			
		||||
        } else if (EOrderType.UPGRADE_ORDER.getValue() == saOrderExt.getOrderType()
 | 
			
		||||
                || EOrderType.SPECIAL_UPGRADE_ORDER.getValue() == saOrderExt.getOrderType()) {
 | 
			
		||||
            // 升级订单
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -25,24 +25,16 @@ import java.util.List;
 | 
			
		|||
public class ApiAreaClassifyController extends BaseController {
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private IBdAreaClassifyService areaClassifyService;
 | 
			
		||||
    private IBdAreaClassifyService iBdAreaClassifyService;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询分类列表
 | 
			
		||||
     *
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    @GetMapping("list")
 | 
			
		||||
    @GetMapping("/list")
 | 
			
		||||
    public AjaxResult list(AreaClassifyParam areaClassifyParam) {
 | 
			
		||||
        areaClassifyParam.setEnableState(EYesNo.YES.getIntValue());
 | 
			
		||||
        Integer pkCountry;
 | 
			
		||||
        if (areaClassifyParam.getPkCountry() != null) {
 | 
			
		||||
            pkCountry = areaClassifyParam.getPkCountry();
 | 
			
		||||
        } else {
 | 
			
		||||
            pkCountry = SecurityUtils.getPkCountry();
 | 
			
		||||
        }
 | 
			
		||||
        areaClassifyParam.setPkCountry(pkCountry);
 | 
			
		||||
        List<AreaClassifyVo> list = areaClassifyService.selectByAreaClassifyList(areaClassifyParam);
 | 
			
		||||
        areaClassifyParam.setPkCountry(SecurityUtils.getPkCountry());
 | 
			
		||||
        List<AreaClassifyVo> list = iBdAreaClassifyService.selectByAreaClassifyList(areaClassifyParam);
 | 
			
		||||
        return AjaxResult.success(list);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -50,25 +42,22 @@ public class ApiAreaClassifyController extends BaseController {
 | 
			
		|||
    /**
 | 
			
		||||
     * 查询第一层分类
 | 
			
		||||
     */
 | 
			
		||||
    @GetMapping("get-first-classify")
 | 
			
		||||
    @GetMapping("/get-first-classify")
 | 
			
		||||
    public AjaxResult getFirstClassify() {
 | 
			
		||||
        AreaClassifyParam areaClassifyParam = new AreaClassifyParam();
 | 
			
		||||
        areaClassifyParam.setHierarchy(0);
 | 
			
		||||
        List<AreaClassifyVo> list = areaClassifyService.selectByAreaClassifyList(areaClassifyParam);
 | 
			
		||||
        List<AreaClassifyVo> list = iBdAreaClassifyService.selectByAreaClassifyList(areaClassifyParam);
 | 
			
		||||
        return AjaxResult.success(list);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询
 | 
			
		||||
     *
 | 
			
		||||
     * @param areaClassifyParam
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    @GetMapping("get-hierarchy-list")
 | 
			
		||||
    @GetMapping("/get-hierarchy-list")
 | 
			
		||||
    public AjaxResult getLevelList(AreaClassifyParam areaClassifyParam) {
 | 
			
		||||
        TreeNodeConfig treeNodeConfig = new TreeNodeConfig();
 | 
			
		||||
        treeNodeConfig.setDeep(4);
 | 
			
		||||
        List<AreaClassifyVo> list = areaClassifyService.selectByAreaClassifyList(areaClassifyParam);
 | 
			
		||||
        List<AreaClassifyVo> list = iBdAreaClassifyService.selectByAreaClassifyList(areaClassifyParam);
 | 
			
		||||
        List<Tree<String>> build = TreeUtil.build(list, "0", treeNodeConfig,
 | 
			
		||||
                (treeNode, tree) -> {
 | 
			
		||||
                    tree.setId(treeNode.getPkId().toString());
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,58 +1,42 @@
 | 
			
		|||
package com.hzs.sale.product.controller.manage.params;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.annotation.TableField;
 | 
			
		||||
import com.baomidou.mybatisplus.annotation.TableId;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @Description:
 | 
			
		||||
 * @Author: yuhui
 | 
			
		||||
 * @Time: 2022/11/1 14:48
 | 
			
		||||
 * @Classname: AreaClassifyParam
 | 
			
		||||
 * @PackageName: com.hzs.sale.product.controller.manage.params
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
public class AreaClassifyParam {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
    private Integer pkId;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 专区分类
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
    private String classifyName;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 排序
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
    private Integer sort;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 是否启用
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
    private Integer enableState;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 上级专区主键
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
    private Long pkParent;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 分类图片
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
    private String classifyImg;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -10,9 +10,6 @@ import java.util.List;
 | 
			
		|||
 | 
			
		||||
/**
 | 
			
		||||
 * 商品分类 服务类
 | 
			
		||||
 *
 | 
			
		||||
 * @author hzs
 | 
			
		||||
 * @since 2022-09-05
 | 
			
		||||
 */
 | 
			
		||||
public interface IBdAreaClassifyService extends IService<BdAreaClassify> {
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,10 +3,7 @@ package com.hzs.sale.product.service.impl;
 | 
			
		|||
import cn.hutool.core.bean.BeanUtil;
 | 
			
		||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 | 
			
		||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
			
		||||
import com.hzs.common.core.domain.R;
 | 
			
		||||
import com.hzs.common.core.enums.EDelFlag;
 | 
			
		||||
import com.hzs.common.core.enums.ETransactionKey;
 | 
			
		||||
import com.hzs.common.core.enums.EYesNo;
 | 
			
		||||
import com.hzs.common.domain.sale.product.BdAreaClassify;
 | 
			
		||||
import com.hzs.common.domain.sale.product.BdAreaClassifySpecialArea;
 | 
			
		||||
import com.hzs.common.security.utils.SecurityUtils;
 | 
			
		||||
| 
						 | 
				
			
			@ -15,9 +12,7 @@ import com.hzs.sale.product.mapper.BdAreaClassifyMapper;
 | 
			
		|||
import com.hzs.sale.product.service.IBdAreaClassifyService;
 | 
			
		||||
import com.hzs.sale.product.service.IBdAreaClassifySpecialAreaService;
 | 
			
		||||
import com.hzs.sale.product.vo.AreaClassifyVo;
 | 
			
		||||
import com.hzs.system.base.ITransactionServiceApi;
 | 
			
		||||
import com.hzs.system.sys.dto.LoginUser;
 | 
			
		||||
import org.apache.dubbo.config.annotation.DubboReference;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
import org.springframework.transaction.annotation.Transactional;
 | 
			
		||||
| 
						 | 
				
			
			@ -36,8 +31,6 @@ public class BdAreaClassifyServiceImpl extends ServiceImpl<BdAreaClassifyMapper,
 | 
			
		|||
    private IBdAreaClassifyService iBdAreaClassifyService;
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private IBdAreaClassifySpecialAreaService iBdAreaClassifySpecialAreaService;
 | 
			
		||||
    @DubboReference
 | 
			
		||||
    ITransactionServiceApi iTransactionServiceApi;
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    @Transactional(rollbackFor = Exception.class)
 | 
			
		||||
| 
						 | 
				
			
			@ -46,8 +39,6 @@ public class BdAreaClassifyServiceImpl extends ServiceImpl<BdAreaClassifyMapper,
 | 
			
		|||
        areaClassify.setPkCreator(loginUser.getUserId());
 | 
			
		||||
        areaClassify.setCreationTime(new Date());
 | 
			
		||||
        areaClassify.setPkCountry(loginUser.getDataCountry());
 | 
			
		||||
        R<Integer> transaction = iTransactionServiceApi.createTransaction(loginUser.getDataCountry(), ETransactionKey.SPEC, areaClassify.getClassifyName(), EYesNo.NO, EYesNo.NO);
 | 
			
		||||
        areaClassify.setPkTransactionKey(transaction.getData());
 | 
			
		||||
        baseMapper.insert(areaClassify);
 | 
			
		||||
        List<BdAreaClassifySpecialArea> list = new ArrayList<>();
 | 
			
		||||
        if (areaClassifyParam.getSpecialAreaList() != null) {
 | 
			
		||||
| 
						 | 
				
			
			@ -73,8 +64,6 @@ public class BdAreaClassifyServiceImpl extends ServiceImpl<BdAreaClassifyMapper,
 | 
			
		|||
        BdAreaClassify areaClassify = BeanUtil.copyProperties(areaClassifyParam, BdAreaClassify.class);
 | 
			
		||||
        areaClassify.setPkModified(loginUser.getUserId());
 | 
			
		||||
        areaClassify.setModifiedTime(new Date());
 | 
			
		||||
        R<Integer> transaction = iTransactionServiceApi.createTransaction(loginUser.getDataCountry(), ETransactionKey.SPEC, areaClassify.getClassifyName(), EYesNo.NO, EYesNo.NO);
 | 
			
		||||
        areaClassify.setPkTransactionKey(transaction.getData());
 | 
			
		||||
        baseMapper.updateById(areaClassify);
 | 
			
		||||
        // 清空 中间表数据重新添加
 | 
			
		||||
        iBdAreaClassifySpecialAreaService.deleteByAreaClassifyPk(areaClassify.getPkId());
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,6 +3,7 @@ package com.hzs.sale.shopping.controller.api;
 | 
			
		|||
import cn.hutool.core.collection.CollectionUtil;
 | 
			
		||||
import cn.hutool.json.JSONUtil;
 | 
			
		||||
import com.hzs.common.core.constant.CacheConstants;
 | 
			
		||||
import com.hzs.common.core.enums.ESpecialArea;
 | 
			
		||||
import com.hzs.common.core.service.RedisService;
 | 
			
		||||
import com.hzs.common.core.utils.StringUtils;
 | 
			
		||||
import com.hzs.common.core.web.controller.BaseController;
 | 
			
		||||
| 
						 | 
				
			
			@ -46,10 +47,11 @@ public class ApiShoppingCartController extends BaseController {
 | 
			
		|||
        if (StringUtils.isNull(scr)) {
 | 
			
		||||
            return AjaxResult.error("购物车为空");
 | 
			
		||||
        }
 | 
			
		||||
        if (null == scr.getPkCountry() || scr.getPkCountry() == 0) {
 | 
			
		||||
            scr.setPkCountry(SecurityUtils.getPkCountry());
 | 
			
		||||
        }
 | 
			
		||||
        String key = CacheConstants.SHOPPIN_GCART + SecurityUtils.getPkCountry() + "_" + SecurityUtils.getUserId();
 | 
			
		||||
        scr.setPkCountry(SecurityUtils.getPkCountry());
 | 
			
		||||
        // 0元会员专区处理
 | 
			
		||||
        scr.setSpecialArea(ESpecialArea.getMemberArea(scr.getSpecialArea()));
 | 
			
		||||
 | 
			
		||||
        String key = CacheConstants.SHOPPIN_GCART + scr.getPkCountry() + "_" + SecurityUtils.getUserId();
 | 
			
		||||
        Map<String, Object> shoppingCartRedisMap = redisService.getCacheMap(key);
 | 
			
		||||
        if (shoppingCartRedisMap == null) {
 | 
			
		||||
            shoppingCartRedisMap = new HashMap<>();
 | 
			
		||||
| 
						 | 
				
			
			@ -92,10 +94,11 @@ public class ApiShoppingCartController extends BaseController {
 | 
			
		|||
     */
 | 
			
		||||
    @GetMapping("/getShopping")
 | 
			
		||||
    public AjaxResult getShopping(ShoppingCartVO shoppingCartVO) {
 | 
			
		||||
        if (shoppingCartVO.getSpecialArea() == null || shoppingCartVO.getPkCountry() == null) {
 | 
			
		||||
            shoppingCartVO.setPkCountry(SecurityUtils.getPkCountry());
 | 
			
		||||
        }
 | 
			
		||||
        String key = CacheConstants.SHOPPIN_GCART + SecurityUtils.getPkCountry() + "_" + SecurityUtils.getUserId();
 | 
			
		||||
        shoppingCartVO.setPkCountry(SecurityUtils.getPkCountry());
 | 
			
		||||
        // 0元会员专区处理
 | 
			
		||||
        shoppingCartVO.setSpecialArea(ESpecialArea.getMemberArea(shoppingCartVO.getSpecialArea()));
 | 
			
		||||
 | 
			
		||||
        String key = CacheConstants.SHOPPIN_GCART + shoppingCartVO.getPkCountry() + "_" + SecurityUtils.getUserId();
 | 
			
		||||
        Map<String, Object> shoppingCartRedisMap = redisService.getCacheMap(key);
 | 
			
		||||
        List<ShoppingCartVO> shoppingCartOld;
 | 
			
		||||
        if (shoppingCartRedisMap.containsKey(key)) {
 | 
			
		||||
| 
						 | 
				
			
			@ -114,10 +117,11 @@ public class ApiShoppingCartController extends BaseController {
 | 
			
		|||
     */
 | 
			
		||||
    @GetMapping("/getShoppingCount")
 | 
			
		||||
    public AjaxResult getShoppingCount(ShoppingCartVO shoppingCartVO) {
 | 
			
		||||
        shoppingCartVO.setPkCountry(SecurityUtils.getPkCountry());
 | 
			
		||||
        // 0元会员专区处理
 | 
			
		||||
        shoppingCartVO.setSpecialArea(ESpecialArea.getMemberArea(shoppingCartVO.getSpecialArea()));
 | 
			
		||||
 | 
			
		||||
        Long userId = SecurityUtils.getUserId();
 | 
			
		||||
        if (null == shoppingCartVO.getPkCountry()) {
 | 
			
		||||
            shoppingCartVO.setPkCountry(SecurityUtils.getPkCountry());
 | 
			
		||||
        }
 | 
			
		||||
        int count = 0;
 | 
			
		||||
        String key = CacheConstants.SHOPPIN_GCART + SecurityUtils.getPkCountry() + "_" + userId;
 | 
			
		||||
        Map<String, Object> shoppingCartRedisMap = redisService.getCacheMap(key);
 | 
			
		||||
| 
						 | 
				
			
			@ -166,11 +170,12 @@ public class ApiShoppingCartController extends BaseController {
 | 
			
		|||
    @GetMapping("/getAreaShoppingCount")
 | 
			
		||||
    public AjaxResult getAreaShoppingCount(ShoppingCartVO shoppingCartVO) {
 | 
			
		||||
        Long userId = SecurityUtils.getUserId();
 | 
			
		||||
        if (null == shoppingCartVO.getPkCountry()) {
 | 
			
		||||
            shoppingCartVO.setPkCountry(SecurityUtils.getPkCountry());
 | 
			
		||||
        }
 | 
			
		||||
        shoppingCartVO.setPkCountry(SecurityUtils.getPkCountry());
 | 
			
		||||
        // 0元会员专区处理
 | 
			
		||||
        shoppingCartVO.setSpecialArea(ESpecialArea.getMemberArea(shoppingCartVO.getSpecialArea()));
 | 
			
		||||
 | 
			
		||||
        int smallCount = 0;
 | 
			
		||||
        String key = CacheConstants.SHOPPIN_GCART + SecurityUtils.getPkCountry() + "_" + userId;
 | 
			
		||||
        String key = CacheConstants.SHOPPIN_GCART + shoppingCartVO.getPkCountry() + "_" + userId;
 | 
			
		||||
        Map<String, Object> shoppingCartRedisMap = redisService.getCacheMap(key);
 | 
			
		||||
        if (shoppingCartRedisMap == null) {
 | 
			
		||||
            shoppingCartRedisMap = new HashMap<>();
 | 
			
		||||
| 
						 | 
				
			
			@ -235,9 +240,6 @@ public class ApiShoppingCartController extends BaseController {
 | 
			
		|||
     */
 | 
			
		||||
    @PostMapping("/plusReduceShopping")
 | 
			
		||||
    public AjaxResult plusReduceShopping(@RequestBody ShoppingCartRedis scr) {
 | 
			
		||||
        if (null == scr.getPkCountry()) {
 | 
			
		||||
            scr.setPkCountry(SecurityUtils.getPkCountry());
 | 
			
		||||
        }
 | 
			
		||||
        String key = CacheConstants.SHOPPIN_GCART + SecurityUtils.getPkCountry() + "_" + SecurityUtils.getUserId();
 | 
			
		||||
        Map<String, Object> shoppingCartRedisMap = redisService.getCacheMap(key);
 | 
			
		||||
        if (shoppingCartRedisMap != null) {
 | 
			
		||||
| 
						 | 
				
			
			@ -268,9 +270,9 @@ public class ApiShoppingCartController extends BaseController {
 | 
			
		|||
     */
 | 
			
		||||
    @PostMapping("/get-shopping-wares-detail")
 | 
			
		||||
    public AjaxResult getShoppingWaresDetail(@RequestBody CarWaresInfoParam scr) {
 | 
			
		||||
        if (null == scr.getPkCountry()) {
 | 
			
		||||
            scr.setPkCountry(SecurityUtils.getPkCountry());
 | 
			
		||||
        }
 | 
			
		||||
        // 0元会员专区处理
 | 
			
		||||
        scr.setSpecialArea(ESpecialArea.getMemberArea(scr.getSpecialArea()));
 | 
			
		||||
 | 
			
		||||
        String key = CacheConstants.SHOPPIN_GCART + SecurityUtils.getPkCountry() + "_" + SecurityUtils.getUserId();
 | 
			
		||||
        Map<String, Object> shoppingCartRedisMap = redisService.getCacheMap(key);
 | 
			
		||||
        CarWaresInfoVo carWaresInfoVo = new CarWaresInfoVo();
 | 
			
		||||
| 
						 | 
				
			
			@ -308,4 +310,5 @@ public class ApiShoppingCartController extends BaseController {
 | 
			
		|||
        carWaresInfoVo.setAssAchieveAmount(assAchieveAmount);
 | 
			
		||||
        return AjaxResult.success(carWaresInfoVo);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,13 +11,10 @@ public class CarWaresInfoParam {
 | 
			
		|||
     * 专区
 | 
			
		||||
     */
 | 
			
		||||
    private Integer specialArea;
 | 
			
		||||
    /**
 | 
			
		||||
     * 国家(用于跨国报单)
 | 
			
		||||
     */
 | 
			
		||||
    private Integer pkCountry;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 购物车项
 | 
			
		||||
     */
 | 
			
		||||
    private List<String> shoppingIds;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,11 +9,7 @@ import java.io.Serializable;
 | 
			
		|||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @Description: 购物车实体类
 | 
			
		||||
 * @Author: zhangjing
 | 
			
		||||
 * @Time: 2022/9/16 11:11
 | 
			
		||||
 * @Classname: ShoppingCartVO
 | 
			
		||||
 * @PackageName: com.hzs.common.domain.sale.ext
 | 
			
		||||
 * 购物车实体类
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@Builder
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
 | 
			
		|||
import cn.hutool.core.codec.Base64Decoder;
 | 
			
		||||
import cn.hutool.core.collection.CollectionUtil;
 | 
			
		||||
import cn.hutool.core.date.DateUtil;
 | 
			
		||||
import cn.hutool.core.util.ObjectUtil;
 | 
			
		||||
import com.alibaba.fastjson.JSONObject;
 | 
			
		||||
import com.alibaba.fastjson2.JSONArray;
 | 
			
		||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 | 
			
		||||
| 
						 | 
				
			
			@ -93,23 +94,22 @@ public class ApiBdWaresController extends BaseController {
 | 
			
		|||
     * @param cuWaresParams 专区、分类
 | 
			
		||||
     */
 | 
			
		||||
    @RequestMapping("/query-spe-wares")
 | 
			
		||||
    public AjaxResult queryWaresBySpecial(@RequestBody CuWaresParams cuWaresParams) {
 | 
			
		||||
    public AjaxResult rqueryWaresBySpecial(@RequestBody CuWaresParams cuWaresParams) {
 | 
			
		||||
        if (null == cuWaresParams.getSpecialArea()) {
 | 
			
		||||
            return AjaxResult.error(SaOrderMsgConstants.SPECIAL_AREA_NOT_EMPTY);
 | 
			
		||||
            return AjaxResult.error("所属专区不能为空");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        Integer pkCountry;
 | 
			
		||||
        if (cuWaresParams.getPkCountry() != null) {
 | 
			
		||||
            pkCountry = cuWaresParams.getPkCountry();
 | 
			
		||||
        } else {
 | 
			
		||||
            pkCountry = SecurityUtils.getPkCountry();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        Integer pkCountry = SecurityUtils.getPkCountry();
 | 
			
		||||
        // 返回数据
 | 
			
		||||
        List<CuWaresParams> waresParamsList = new ArrayList<>();
 | 
			
		||||
 | 
			
		||||
        // 查询商品列表
 | 
			
		||||
        List<BdWaresExt> bdWaresExtList = iBdWaresService.queryWaresByCondition(cuWaresParams.getSpecialArea(), cuWaresParams.getPkAreaClassify(), cuWaresParams.getWaresName(), null, null, pkCountry);
 | 
			
		||||
        List<BdWaresExt> bdWaresExtList;
 | 
			
		||||
        if (ESpecialArea.MEMBER_AREA.getValue() == cuWaresParams.getSpecialArea()) {
 | 
			
		||||
            // 0元注册会员专区,只查询注册专区的188商品
 | 
			
		||||
            bdWaresExtList = iBdWaresService.listWaresShare(ESpecialArea.REGISTER_AREA.getValue(), EWaresType.PRODUCT_188.getValue(), CountryConstants.CHINA_COUNTRY, cuWaresParams.getWaresName());
 | 
			
		||||
        } else {
 | 
			
		||||
            bdWaresExtList = iBdWaresService.queryWaresByCondition(cuWaresParams.getSpecialArea(), cuWaresParams.getPkAreaClassify(), cuWaresParams.getWaresName(), null, null, pkCountry);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (CollectionUtil.isNotEmpty(bdWaresExtList)) {
 | 
			
		||||
            // 当前会员ID
 | 
			
		||||
| 
						 | 
				
			
			@ -118,10 +118,6 @@ public class ApiBdWaresController extends BaseController {
 | 
			
		|||
            // 当前会员编号
 | 
			
		||||
            String memberCode = cuMember.getMemberCode();
 | 
			
		||||
 | 
			
		||||
            // 汇率比例
 | 
			
		||||
            R<CurrencyDTO> currency = iCurrencyServiceApi.getCurrency(SecurityUtils.getPkCountry());
 | 
			
		||||
            BigDecimal inExchangeRate = currency.getData().getInExchangeRate();
 | 
			
		||||
 | 
			
		||||
            // 商品主键列表
 | 
			
		||||
            List<Integer> waresIdList = bdWaresExtList.stream().map(BdWares::getPkId).collect(Collectors.toList());
 | 
			
		||||
            // 检验商品团队信息
 | 
			
		||||
| 
						 | 
				
			
			@ -251,14 +247,6 @@ public class ApiBdWaresController extends BaseController {
 | 
			
		|||
                        // 零售价
 | 
			
		||||
                        retailPrice = retailPrice.add(bdWaresSpecsSkuExt.getRetailPrice().multiply(BigDecimal.valueOf(bdWaresSpecsSkuExt.getQuantity())));
 | 
			
		||||
                    }
 | 
			
		||||
                    if (cuWaresParams.getPkCountry() != null && !pkCountry.equals(SecurityUtils.getPkCountry())) {
 | 
			
		||||
                        // 当登陆人的结算国和前端结算国不一致 即为跨国报单
 | 
			
		||||
                        if (!pkCountry.equals(SecurityUtils.getPkCountry())) {
 | 
			
		||||
                            // 跨国报单 跨国汇率
 | 
			
		||||
                            R<CurrencyDTO> kgCurrency = iCurrencyServiceApi.getCurrency(pkCountry);
 | 
			
		||||
                            waresPrice = waresPrice.multiply(inExchangeRate).divide(kgCurrency.getData().getInExchangeRate(), 2, BigDecimal.ROUND_HALF_UP);
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                // 计算商品列表价格和业绩最小值
 | 
			
		||||
| 
						 | 
				
			
			@ -269,12 +257,8 @@ public class ApiBdWaresController extends BaseController {
 | 
			
		|||
                waresParams.setRetailPrice(retailPrice);
 | 
			
		||||
                // 商品业绩计算汇率
 | 
			
		||||
                if (waresParams.getWaresAchieve() != null) {
 | 
			
		||||
                    if (SecurityUtils.getPkCountry().equals(CountryConstants.CHINA_COUNTRY)) {
 | 
			
		||||
                        waresParams.setWaresAchieve(waresParams.getWaresAchieve().multiply(inExchangeRate));
 | 
			
		||||
                    } else {
 | 
			
		||||
                        waresParams.setWaresAchieve(waresParams.getWaresAchieve());
 | 
			
		||||
                        waresParams.setWaresPrice(waresParams.getWaresPrice());
 | 
			
		||||
                    }
 | 
			
		||||
                    waresParams.setWaresAchieve(waresParams.getWaresAchieve());
 | 
			
		||||
                    waresParams.setWaresPrice(waresParams.getWaresPrice());
 | 
			
		||||
                } else {
 | 
			
		||||
                    waresParams.setWaresAchieve(BigDecimal.ZERO);
 | 
			
		||||
                    waresParams.setWaresPrice(BigDecimal.ZERO);
 | 
			
		||||
| 
						 | 
				
			
			@ -295,11 +279,20 @@ public class ApiBdWaresController extends BaseController {
 | 
			
		|||
                Integer inventory = waresExt.getInventory();
 | 
			
		||||
                Integer inventoryRatio = waresExt.getInventoryRatio();
 | 
			
		||||
                Integer inventoryUse = waresExt.getInventoryUse();
 | 
			
		||||
                if(ObjectUtil.isEmpty(inventory)){
 | 
			
		||||
                    inventory = 0;
 | 
			
		||||
                }
 | 
			
		||||
                if(ObjectUtil.isEmpty(inventoryUse)){
 | 
			
		||||
                    inventoryUse = 0;
 | 
			
		||||
                }
 | 
			
		||||
                if(ObjectUtil.isEmpty(inventoryRatio)){
 | 
			
		||||
                    inventoryRatio = 0;
 | 
			
		||||
                }
 | 
			
		||||
                int ratio = 100 - (int) Math.round(NumberUtil.getRatioNum(inventory, inventoryUse));
 | 
			
		||||
                if(ratio <= inventoryRatio){
 | 
			
		||||
                if (ratio <= inventoryRatio) {
 | 
			
		||||
                    waresParams.setUseRatio(true);
 | 
			
		||||
                    waresParams.setInventory(ratio + "");
 | 
			
		||||
                }else{
 | 
			
		||||
                } else {
 | 
			
		||||
                    waresParams.setUseRatio(false);
 | 
			
		||||
                }
 | 
			
		||||
                waresParams.setProductGroup(jsonArray);
 | 
			
		||||
| 
						 | 
				
			
			@ -371,11 +364,11 @@ public class ApiBdWaresController extends BaseController {
 | 
			
		|||
     * @param pkWares
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    public ShowWaresDTO getShowWares(Integer pkWares, Long loginMember, String loginMemberCode, Map<Integer, List<BdWaresAuthority>> waresAuthorityMap) {
 | 
			
		||||
    public ShowWaresDTO getShowWares(Integer pkWares, Long pkMember, String memberCode, Map<Integer, List<BdWaresAuthority>> waresAuthorityMap) {
 | 
			
		||||
        ShowWaresDTO showWaresDTO = new ShowWaresDTO();
 | 
			
		||||
        showWaresDTO.setPkWares(pkWares);
 | 
			
		||||
        showWaresDTO.setLoginMember(loginMember);
 | 
			
		||||
        showWaresDTO.setLoginMemberCode(loginMemberCode);
 | 
			
		||||
        showWaresDTO.setLoginMember(pkMember);
 | 
			
		||||
        showWaresDTO.setLoginMemberCode(memberCode);
 | 
			
		||||
        showWaresDTO.setWaresAuthorityList(waresAuthorityMap.get(pkWares));
 | 
			
		||||
        return showWaresDTO;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -394,12 +387,8 @@ public class ApiBdWaresController extends BaseController {
 | 
			
		|||
            return AjaxResult.error(WaresMsgConstants.WARES_NUMBER_DOES_NOT_EXIST);
 | 
			
		||||
        }
 | 
			
		||||
        Long loginMemberId = SecurityUtils.getUserId();
 | 
			
		||||
        Integer pkCountry;
 | 
			
		||||
        if (cuWaresParams.getPkCountry() == null) {
 | 
			
		||||
            pkCountry = SecurityUtils.getPkCountry();
 | 
			
		||||
        } else {
 | 
			
		||||
            pkCountry = cuWaresParams.getPkCountry();
 | 
			
		||||
        }
 | 
			
		||||
        Integer pkCountry = SecurityUtils.getPkCountry();
 | 
			
		||||
 | 
			
		||||
        cuWaresParams = iBdWaresSpecsSkuService.queryWaresSpecsSku(cuWaresParams.getSpecialArea(), cuWaresParams.getWaresCode(), loginMemberId, pkCountry);
 | 
			
		||||
 | 
			
		||||
        // 预计发货时间(秒)
 | 
			
		||||
| 
						 | 
				
			
			@ -486,26 +475,6 @@ public class ApiBdWaresController extends BaseController {
 | 
			
		|||
     */
 | 
			
		||||
    @GetMapping("/get-app-index")
 | 
			
		||||
    public AjaxResult getAppIndex() {
 | 
			
		||||
//        Integer pkCountry = SecurityUtils.getPkCountry();
 | 
			
		||||
//        Long userId = SecurityUtils.getUserId();
 | 
			
		||||
//        String memberCode = SecurityUtils.getMemberCode();
 | 
			
		||||
//        // 校验产品团队信息(查询所有推荐商品)
 | 
			
		||||
//        List<BdWaresExt> bdWaresList = iBdWaresService.queryByRecommendList(null, EYesNo.YES.getIntValue(), pkCountry, new HashMap<>());
 | 
			
		||||
//        Map<Integer, Boolean> waresShowMap = new HashMap<>();
 | 
			
		||||
//        if (bdWaresList.size() > 0) {
 | 
			
		||||
//            // 检验商品团队信息
 | 
			
		||||
//            List<Integer> waresIdList = bdWaresList.stream().map(BdWares::getPkId).collect(Collectors.toList());
 | 
			
		||||
//            Map<Integer, List<BdWaresAuthority>> waresAuthorityMap = iBdWaresService.getWaresAuthority(waresIdList);
 | 
			
		||||
//            List<ShowWaresDTO> showWaresList = bdWaresList.stream().map(we -> getShowWares(we.getPkId(), userId, memberCode, waresAuthorityMap)).collect(Collectors.toList());
 | 
			
		||||
//            R<Map<Integer, Boolean>> waresShowMapDto = iMemberServiceApi.checkIsShowWares(showWaresList);
 | 
			
		||||
//            waresShowMap = waresShowMapDto.getData();
 | 
			
		||||
//        }
 | 
			
		||||
//        // 查询app端首页商品展示信息
 | 
			
		||||
//        RecommendWaresInfoVo recommendWaresInfoVo = iBdWaresService.queryRecommendInfo(pkCountry, memberCode, userId, waresShowMap);
 | 
			
		||||
//        if (recommendWaresInfoVo.getWaresVoList() != null) {
 | 
			
		||||
//            List<WaresVo> waresList = new ArrayList<>(recommendWaresInfoVo.getWaresVoList());
 | 
			
		||||
//            recommendWaresInfoVo.setWaresVoList(waresList);
 | 
			
		||||
//        }
 | 
			
		||||
        RecommendWaresInfoVo recommendWaresInfoVo = new RecommendWaresInfoVo();
 | 
			
		||||
        // 查询全部的banner (登录后banner)
 | 
			
		||||
        R<List<AdvertBannerDTO>> advertBannerList = advertBannerServiceApi.findAll(SecurityUtils.getUserId());
 | 
			
		||||
| 
						 | 
				
			
			@ -699,10 +668,10 @@ public class ApiBdWaresController extends BaseController {
 | 
			
		|||
                Integer inventoryRatio = waresExt.getInventoryRatio();
 | 
			
		||||
                Integer inventoryUse = waresExt.getInventoryUse();
 | 
			
		||||
                int ratio = 100 - (int) Math.round(NumberUtil.getRatioNum(inventory, inventoryUse));
 | 
			
		||||
                if(ratio <= inventoryRatio){
 | 
			
		||||
                if (ratio <= inventoryRatio) {
 | 
			
		||||
                    waresParams.setUseRatio(true);
 | 
			
		||||
                    waresParams.setInventory(ratio + "");
 | 
			
		||||
                }else{
 | 
			
		||||
                } else {
 | 
			
		||||
                    waresParams.setUseRatio(false);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
| 
						 | 
				
			
			@ -769,7 +738,7 @@ public class ApiBdWaresController extends BaseController {
 | 
			
		|||
        List<CuWaresParams> waresParamsList = new ArrayList<>();
 | 
			
		||||
 | 
			
		||||
        // 查询商品列表
 | 
			
		||||
        List<BdWaresExt> bdWaresExtList = iBdWaresService.listWaresShare(param.getSpecialArea(), param.getIsMakerGift(), param.getPkCountry());
 | 
			
		||||
        List<BdWaresExt> bdWaresExtList = iBdWaresService.listWaresShare(param.getSpecialArea(), param.getIsMakerGift(), param.getPkCountry(), null);
 | 
			
		||||
 | 
			
		||||
        if (CollectionUtil.isNotEmpty(bdWaresExtList)) {
 | 
			
		||||
            // 商品主键列表
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -49,7 +49,8 @@ public interface BdWaresMapper extends BaseMapper<BdWares> {
 | 
			
		|||
     */
 | 
			
		||||
    List<BdWaresExt> listWaresShare(@Param("specialArea") Integer specialArea,
 | 
			
		||||
                                    @Param("isMakerGift") Integer isMakerGift,
 | 
			
		||||
                                    @Param("pkCountry") Integer pkCountry);
 | 
			
		||||
                                    @Param("pkCountry") Integer pkCountry,
 | 
			
		||||
                                    @Param("waresName") String waresName);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询最末商品编号
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -98,7 +98,7 @@ public interface IBdWaresService extends IService<BdWares> {
 | 
			
		|||
     * @param pkCountry   所属国家
 | 
			
		||||
     * @return: List<BdWaresExt>
 | 
			
		||||
     */
 | 
			
		||||
    List<BdWaresExt> listWaresShare(Integer specialArea, Integer isMakerGift, Integer pkCountry);
 | 
			
		||||
    List<BdWaresExt> listWaresShare(Integer specialArea, Integer isMakerGift, Integer pkCountry, String waresName);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询商品外键
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -841,8 +841,8 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<BdWaresExt> listWaresShare(Integer specialArea, Integer isMakerGift, Integer pkCountry) {
 | 
			
		||||
        return baseMapper.listWaresShare(specialArea, isMakerGift, pkCountry);
 | 
			
		||||
    public List<BdWaresExt> listWaresShare(Integer specialArea, Integer isMakerGift, Integer pkCountry, String waresName) {
 | 
			
		||||
        return baseMapper.listWaresShare(specialArea, isMakerGift, pkCountry, waresName);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
| 
						 | 
				
			
			@ -1213,126 +1213,166 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
 | 
			
		|||
        // 登录用户
 | 
			
		||||
        CuMemberExt loginMember = iMemberServiceApi.getMemberById(userId).getData();
 | 
			
		||||
 | 
			
		||||
        // 续约标记 -- 会员还有3月到期,需要能看到续约专区
 | 
			
		||||
        boolean expireFlag = false;
 | 
			
		||||
        if (null != loginMember.getExpireDate()) {
 | 
			
		||||
            expireFlag = DateUtils.addMonths(new Date(), 3).compareTo(loginMember.getExpireDate()) > 0;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // 结算等级
 | 
			
		||||
        int pkGrade = loginMember.getPkSettleGrade();
 | 
			
		||||
        // 真实奖衔
 | 
			
		||||
        int pkAwards = loginMember.getPkAwards();
 | 
			
		||||
        // 注册权限
 | 
			
		||||
        int authority = loginMember.getRegisterAuthority();
 | 
			
		||||
        // 查询权限配置
 | 
			
		||||
        List<BdMenuDetail> menuDetailList = iMenuDetailServiceApi.showMenuDetail(pkGrade, pkAwards, authority, pkCountry).getData();
 | 
			
		||||
 | 
			
		||||
        // 查询存在推荐的专区
 | 
			
		||||
        List<Integer> saList = baseMapper.queryRecommendWaresSpecial();
 | 
			
		||||
        List<Integer> specialAreaList = new ArrayList<>();
 | 
			
		||||
        //校验菜单权限  如果没有配置则全部显示
 | 
			
		||||
        if (menuDetailList.size() > 0) {
 | 
			
		||||
            for (BdMenuDetail bdMenuDetail : menuDetailList) {
 | 
			
		||||
                for (Integer specialArea : saList) {
 | 
			
		||||
                    ESpecialArea sarea = ESpecialArea.getESpecialAreaEnum(specialArea);
 | 
			
		||||
                    if (bdMenuDetail.getDetailValue().equals(sarea.getMenuDetailValue())) {
 | 
			
		||||
                        specialAreaList.add(specialArea);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        } else {
 | 
			
		||||
            specialAreaList = saList;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // 查询推荐商品
 | 
			
		||||
        List<BdWaresExt> recommendWaresList = this.selectByRecommentList(pkCountry, specialAreaList);
 | 
			
		||||
        // 校验商品奖衔和等级/团队权限
 | 
			
		||||
        List<Integer> waresIdList = recommendWaresList.stream().map(BdWares::getPkId).collect(Collectors.toList());
 | 
			
		||||
        Set<Integer> waresIdSet = new HashSet<>();
 | 
			
		||||
        List<String> authWaresList = new ArrayList<>();
 | 
			
		||||
        if (waresIdList.size() > 0) {
 | 
			
		||||
            // 处理商品权限
 | 
			
		||||
            List<WaresGradeAwards> waresGradeAwardsList = iBdWaresGradeService.queryWaresGradeAwards(waresIdList);
 | 
			
		||||
            // 先处理没有配置等级、奖衔的商品
 | 
			
		||||
            waresGradeAwardsList.forEach(waresGradeAwards -> {
 | 
			
		||||
                waresIdSet.add(waresGradeAwards.getPkWares());
 | 
			
		||||
                String key = waresGradeAwards.getPkWares() + "_" + waresGradeAwards.getRangeType() + "_" + waresGradeAwards.getPkRange().toString();
 | 
			
		||||
                authWaresList.add(key);
 | 
			
		||||
            });
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        RecommendWaresInfoVo recommendWaresInfoVo = new RecommendWaresInfoVo();
 | 
			
		||||
        // 推荐专区
 | 
			
		||||
        List<RecommendSpecialAreaVo> resultList = new ArrayList<>();
 | 
			
		||||
        for (Integer specialArea : specialAreaList) {
 | 
			
		||||
            ESpecialArea sArea = ESpecialArea.getESpecialAreaEnum(specialArea);
 | 
			
		||||
            if (sArea != null) {
 | 
			
		||||
                if (StringUtils.isNotBlank(sArea.getLabel())) {
 | 
			
		||||
                    RecommendSpecialAreaVo recommendSpecialAreaVo = new RecommendSpecialAreaVo();
 | 
			
		||||
                    if (specialArea.equals(ESpecialArea.RENEWAL_AREA.getValue())) {
 | 
			
		||||
                        // 续约专区,只有有效期小于3个月的能看到
 | 
			
		||||
                        if (!expireFlag) {
 | 
			
		||||
                            continue;
 | 
			
		||||
 | 
			
		||||
        if (null == loginMember.getPkPlaceParent()) {
 | 
			
		||||
            // 0元注册会员,没有上树,没有安置关系
 | 
			
		||||
            // 查询商品列表
 | 
			
		||||
            List<BdWaresExt> bdWaresExtList = this.listWaresShare(ESpecialArea.REGISTER_AREA.getValue(), EWaresType.PRODUCT_188.getValue(), CountryConstants.CHINA_COUNTRY, null);
 | 
			
		||||
 | 
			
		||||
            if (CollectionUtil.isNotEmpty(bdWaresExtList)) {
 | 
			
		||||
                RecommendSpecialAreaVo recommendSpecialAreaVo = RecommendSpecialAreaVo.builder()
 | 
			
		||||
                        .specialArea(ESpecialArea.MEMBER_AREA.getValue())
 | 
			
		||||
                        .specialAreaName(ESpecialArea.MEMBER_AREA.getLabel())
 | 
			
		||||
                        .sort(ESpecialArea.MEMBER_AREA.getSort())
 | 
			
		||||
                        .build();
 | 
			
		||||
                resultList.add(recommendSpecialAreaVo);
 | 
			
		||||
 | 
			
		||||
                List<BdWaresExt> filterList = new ArrayList<>();
 | 
			
		||||
                for (BdWaresExt bdWaresExt : bdWaresExtList) {
 | 
			
		||||
                    if (filterList.size() > 2) {
 | 
			
		||||
                        break;
 | 
			
		||||
                    } else {
 | 
			
		||||
                        filterList.add(bdWaresExt);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                List<WaresVo> waresVoList = filterList.stream().map(wl -> {
 | 
			
		||||
                    WaresVo waresVo = new WaresVo();
 | 
			
		||||
                    waresVo.setPkWares(wl.getPkId());
 | 
			
		||||
                    waresVo.setWaresCode(wl.getWaresCode());
 | 
			
		||||
                    waresVo.setWaresName(wl.getWaresName());
 | 
			
		||||
                    waresVo.setWaresPrice(wl.getWaresPrice());
 | 
			
		||||
                    waresVo.setCover(wl.getCover());
 | 
			
		||||
                    waresVo.setCover1(wl.getCover1());
 | 
			
		||||
                    waresVo.setIsSale(wl.getIsSale());
 | 
			
		||||
                    waresVo.setPreSaleStatus(wl.getPreSaleStatus());
 | 
			
		||||
                    waresVo.setSpecialArea(wl.getSpecialArea());
 | 
			
		||||
                    return waresVo;
 | 
			
		||||
                }).collect(Collectors.toList());
 | 
			
		||||
                recommendSpecialAreaVo.setWaresList(waresVoList);
 | 
			
		||||
            }
 | 
			
		||||
        } else {
 | 
			
		||||
            // 续约标记 -- 会员还有3月到期,需要能看到续约专区
 | 
			
		||||
            boolean expireFlag = false;
 | 
			
		||||
            if (null != loginMember.getExpireDate()) {
 | 
			
		||||
                expireFlag = DateUtils.addMonths(new Date(), 3).compareTo(loginMember.getExpireDate()) > 0;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // 结算等级
 | 
			
		||||
            int pkGrade = loginMember.getPkSettleGrade();
 | 
			
		||||
            // 真实奖衔
 | 
			
		||||
            int pkAwards = loginMember.getPkAwards();
 | 
			
		||||
            // 注册权限
 | 
			
		||||
            int authority = loginMember.getRegisterAuthority();
 | 
			
		||||
            // 查询权限配置
 | 
			
		||||
            List<BdMenuDetail> menuDetailList = iMenuDetailServiceApi.showMenuDetail(pkGrade, pkAwards, authority, pkCountry).getData();
 | 
			
		||||
 | 
			
		||||
            // 查询存在推荐的专区
 | 
			
		||||
            List<Integer> saList = baseMapper.queryRecommendWaresSpecial();
 | 
			
		||||
            List<Integer> specialAreaList = new ArrayList<>();
 | 
			
		||||
            //校验菜单权限  如果没有配置则全部显示
 | 
			
		||||
            if (menuDetailList.size() > 0) {
 | 
			
		||||
                for (BdMenuDetail bdMenuDetail : menuDetailList) {
 | 
			
		||||
                    for (Integer specialArea : saList) {
 | 
			
		||||
                        ESpecialArea sarea = ESpecialArea.getESpecialAreaEnum(specialArea);
 | 
			
		||||
                        if (bdMenuDetail.getDetailValue().equals(sarea.getMenuDetailValue())) {
 | 
			
		||||
                            specialAreaList.add(specialArea);
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                    recommendSpecialAreaVo.setSpecialArea(specialArea);
 | 
			
		||||
                    recommendSpecialAreaVo.setSort(sArea.getSort());
 | 
			
		||||
                    recommendSpecialAreaVo.setSpecialAreaName(sArea.getLabel());
 | 
			
		||||
                    resultList.add(recommendSpecialAreaVo);
 | 
			
		||||
                }
 | 
			
		||||
            } else {
 | 
			
		||||
                specialAreaList = saList;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
                    List<BdWaresExt> filterList = new ArrayList<>();
 | 
			
		||||
                    // 推荐商品,TODO 此处查询推荐商品,可以先全查出来在内存进行分专区处理,后续有时间可以优化
 | 
			
		||||
                    List<BdWaresExt> waresList = this.queryByRecommendList(specialArea, EYesNo.YES.getIntValue(), pkCountry, waresShowMap);
 | 
			
		||||
                    if (CollectionUtil.isNotEmpty(waresList)) {
 | 
			
		||||
                        for (BdWaresExt waresExt : waresList) {
 | 
			
		||||
                            if (waresIdSet.contains(waresExt.getPkId())) {
 | 
			
		||||
                                String gradeKey = waresExt.getPkId() + "_" + ERangeType.GRADE.getValue() + "_" + loginMember.getPkSettleGrade();
 | 
			
		||||
                                String awardsKey = waresExt.getPkId() + "_" + ERangeType.AWARDS.getValue() + "_" + loginMember.getPkAwards();
 | 
			
		||||
                                String authorityKey = waresExt.getPkId() + "_" + ERangeType.AUTHORITY.getValue() + "_" + loginMember.getRegisterAuthority();
 | 
			
		||||
                                if (!authWaresList.contains(gradeKey) && !authWaresList.contains(awardsKey) && !authWaresList.contains(authorityKey)) {
 | 
			
		||||
                                    continue;
 | 
			
		||||
            // 查询推荐商品
 | 
			
		||||
            List<BdWaresExt> recommendWaresList = this.selectByRecommentList(pkCountry, specialAreaList);
 | 
			
		||||
            // 校验商品奖衔和等级/团队权限
 | 
			
		||||
            List<Integer> waresIdList = recommendWaresList.stream().map(BdWares::getPkId).collect(Collectors.toList());
 | 
			
		||||
            Set<Integer> waresIdSet = new HashSet<>();
 | 
			
		||||
            List<String> authWaresList = new ArrayList<>();
 | 
			
		||||
            if (waresIdList.size() > 0) {
 | 
			
		||||
                // 处理商品权限
 | 
			
		||||
                List<WaresGradeAwards> waresGradeAwardsList = iBdWaresGradeService.queryWaresGradeAwards(waresIdList);
 | 
			
		||||
                // 先处理没有配置等级、奖衔的商品
 | 
			
		||||
                waresGradeAwardsList.forEach(waresGradeAwards -> {
 | 
			
		||||
                    waresIdSet.add(waresGradeAwards.getPkWares());
 | 
			
		||||
                    String key = waresGradeAwards.getPkWares() + "_" + waresGradeAwards.getRangeType() + "_" + waresGradeAwards.getPkRange().toString();
 | 
			
		||||
                    authWaresList.add(key);
 | 
			
		||||
                });
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            for (Integer specialArea : specialAreaList) {
 | 
			
		||||
                ESpecialArea sArea = ESpecialArea.getESpecialAreaEnum(specialArea);
 | 
			
		||||
                if (sArea != null) {
 | 
			
		||||
                    if (StringUtils.isNotBlank(sArea.getLabel())) {
 | 
			
		||||
                        RecommendSpecialAreaVo recommendSpecialAreaVo = new RecommendSpecialAreaVo();
 | 
			
		||||
                        if (specialArea.equals(ESpecialArea.RENEWAL_AREA.getValue())) {
 | 
			
		||||
                            // 续约专区,只有有效期小于3个月的能看到
 | 
			
		||||
                            if (!expireFlag) {
 | 
			
		||||
                                continue;
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                        recommendSpecialAreaVo.setSpecialArea(specialArea);
 | 
			
		||||
                        recommendSpecialAreaVo.setSort(sArea.getSort());
 | 
			
		||||
                        recommendSpecialAreaVo.setSpecialAreaName(sArea.getLabel());
 | 
			
		||||
                        resultList.add(recommendSpecialAreaVo);
 | 
			
		||||
 | 
			
		||||
                        List<BdWaresExt> filterList = new ArrayList<>();
 | 
			
		||||
                        // 推荐商品,TODO 此处查询推荐商品,可以先全查出来在内存进行分专区处理,后续有时间可以优化
 | 
			
		||||
                        List<BdWaresExt> waresList = this.queryByRecommendList(specialArea, null, pkCountry, waresShowMap);
 | 
			
		||||
                        if (CollectionUtil.isNotEmpty(waresList)) {
 | 
			
		||||
                            for (BdWaresExt waresExt : waresList) {
 | 
			
		||||
                                if (waresIdSet.contains(waresExt.getPkId())) {
 | 
			
		||||
                                    String gradeKey = waresExt.getPkId() + "_" + ERangeType.GRADE.getValue() + "_" + loginMember.getPkSettleGrade();
 | 
			
		||||
                                    String awardsKey = waresExt.getPkId() + "_" + ERangeType.AWARDS.getValue() + "_" + loginMember.getPkAwards();
 | 
			
		||||
                                    String authorityKey = waresExt.getPkId() + "_" + ERangeType.AUTHORITY.getValue() + "_" + loginMember.getRegisterAuthority();
 | 
			
		||||
                                    if (!authWaresList.contains(gradeKey) && !authWaresList.contains(awardsKey) && !authWaresList.contains(authorityKey)) {
 | 
			
		||||
                                        continue;
 | 
			
		||||
                                    }
 | 
			
		||||
                                }
 | 
			
		||||
                                if (filterList.size() > 2) {
 | 
			
		||||
                                    break;
 | 
			
		||||
                                } else {
 | 
			
		||||
                                    filterList.add(waresExt);
 | 
			
		||||
                                }
 | 
			
		||||
                            }
 | 
			
		||||
                            if (filterList.size() > 2) {
 | 
			
		||||
                                break;
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                        List<WaresVo> waresVoList = filterList.stream().map(wl -> {
 | 
			
		||||
                            WaresVo waresVo = new WaresVo();
 | 
			
		||||
                            waresVo.setPkWares(wl.getPkId());
 | 
			
		||||
                            waresVo.setWaresCode(wl.getWaresCode());
 | 
			
		||||
                            waresVo.setWaresName(wl.getWaresName());
 | 
			
		||||
                            waresVo.setWaresPrice(wl.getWaresPrice());
 | 
			
		||||
                            waresVo.setCover(wl.getCover());
 | 
			
		||||
                            waresVo.setCover1(wl.getCover1());
 | 
			
		||||
                            waresVo.setIsSale(wl.getIsSale());
 | 
			
		||||
                            waresVo.setPreSaleStatus(wl.getPreSaleStatus());
 | 
			
		||||
                            waresVo.setSpecialArea(wl.getSpecialArea());
 | 
			
		||||
 | 
			
		||||
                            Integer inventory = wl.getInventory();
 | 
			
		||||
                            Integer inventoryRatio = wl.getInventoryRatio();
 | 
			
		||||
                            Integer inventoryUse = wl.getInventoryUse();
 | 
			
		||||
                            int ratio = 100 - (int) Math.round(NumberUtil.getRatioNum(inventory, inventoryUse));
 | 
			
		||||
                            if (ratio <= inventoryRatio) {
 | 
			
		||||
                                waresVo.setUseRatio(true);
 | 
			
		||||
                                waresVo.setInventory(ratio + "");
 | 
			
		||||
                            } else {
 | 
			
		||||
                                filterList.add(waresExt);
 | 
			
		||||
                                waresVo.setUseRatio(false);
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                            return waresVo;
 | 
			
		||||
                        }).collect(Collectors.toList());
 | 
			
		||||
                        recommendSpecialAreaVo.setWaresList(waresVoList);
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    List<WaresVo> waresVoList = filterList.stream().map(wl -> {
 | 
			
		||||
                        WaresVo waresVo = new WaresVo();
 | 
			
		||||
                        waresVo.setPkWares(wl.getPkId());
 | 
			
		||||
                        waresVo.setWaresCode(wl.getWaresCode());
 | 
			
		||||
                        waresVo.setWaresName(wl.getWaresName());
 | 
			
		||||
                        waresVo.setWaresPrice(wl.getWaresPrice());
 | 
			
		||||
                        waresVo.setCover(wl.getCover());
 | 
			
		||||
                        waresVo.setCover1(wl.getCover1());
 | 
			
		||||
                        waresVo.setIsSale(wl.getIsSale());
 | 
			
		||||
                        waresVo.setPreSaleStatus(wl.getPreSaleStatus());
 | 
			
		||||
                        waresVo.setSpecialArea(wl.getSpecialArea());
 | 
			
		||||
 | 
			
		||||
                        Integer inventory = wl.getInventory();
 | 
			
		||||
                        Integer inventoryRatio = wl.getInventoryRatio();
 | 
			
		||||
                        Integer inventoryUse = wl.getInventoryUse();
 | 
			
		||||
                        int ratio = 100 - (int) Math.round(NumberUtil.getRatioNum(inventory, inventoryUse));
 | 
			
		||||
                        if(ratio <= inventoryRatio){
 | 
			
		||||
                            waresVo.setUseRatio(true);
 | 
			
		||||
                            waresVo.setInventory(ratio + "");
 | 
			
		||||
                        }else{
 | 
			
		||||
                            waresVo.setUseRatio(false);
 | 
			
		||||
                        }
 | 
			
		||||
                        return waresVo;
 | 
			
		||||
                    }).collect(Collectors.toList());
 | 
			
		||||
                    recommendSpecialAreaVo.setWaresList(waresVoList);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            //  根据专区排序(按照指定排序排序: 注冊 升级 复购)
 | 
			
		||||
            resultList.sort(Comparator.comparingInt(RecommendSpecialAreaVo::getSort));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        //  根据专区排序(按照指定排序排序: 注冊 升级 复购 自营 海粉 嗨粉)
 | 
			
		||||
        resultList.sort(Comparator.comparingInt(RecommendSpecialAreaVo::getSort));
 | 
			
		||||
        recommendWaresInfoVo.setRecommendSpecialAreaList(resultList);
 | 
			
		||||
        return recommendWaresInfoVo;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -65,6 +65,10 @@ public class BdWaresSpecsSkuServiceImpl extends ServiceImpl<BdWaresSpecsSkuMappe
 | 
			
		|||
 | 
			
		||||
    @Override
 | 
			
		||||
    public CuWaresParams queryWaresSpecsSku(Integer specialArea, String waresCode, Long loginMemberId, Integer pkCountry) {
 | 
			
		||||
        // 0元会员专区处理
 | 
			
		||||
        final Integer tmpArea = specialArea;
 | 
			
		||||
        specialArea = ESpecialArea.getMemberArea(specialArea);
 | 
			
		||||
 | 
			
		||||
        List<BdWaresSpecsSkuExt> bdWaresSpecsSkuExtList;
 | 
			
		||||
 | 
			
		||||
        R<CuMember> memberDate = iMemberServiceApi.getMember(loginMemberId);
 | 
			
		||||
| 
						 | 
				
			
			@ -169,7 +173,7 @@ public class BdWaresSpecsSkuServiceImpl extends ServiceImpl<BdWaresSpecsSkuMappe
 | 
			
		|||
            productParams.clear();
 | 
			
		||||
            productParams.addAll(productParamsResultList);
 | 
			
		||||
            cuWaresParams.setProductParams(productParams);
 | 
			
		||||
            cuWaresParams.setSpecialArea(specialArea);
 | 
			
		||||
            cuWaresParams.setSpecialArea(tmpArea);
 | 
			
		||||
 | 
			
		||||
            Integer inventory = sku.getInventory();
 | 
			
		||||
            Integer inventoryRatio = sku.getInventoryRatio();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,9 +1,15 @@
 | 
			
		|||
package com.hzs.sale.wares.vo;
 | 
			
		||||
 | 
			
		||||
import lombok.AllArgsConstructor;
 | 
			
		||||
import lombok.Builder;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
@Builder
 | 
			
		||||
@AllArgsConstructor
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
@Data
 | 
			
		||||
public class RecommendSpecialAreaVo {
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,41 +4,37 @@
 | 
			
		|||
 | 
			
		||||
    <!-- 通用查询映射结果 -->
 | 
			
		||||
    <resultMap id="BaseResultMap" type="com.hzs.common.domain.sale.product.BdAreaClassify">
 | 
			
		||||
        <id column="PK_ID" property="pkId" />
 | 
			
		||||
        <id column="PK_ID" property="pkId"/>
 | 
			
		||||
        <result column="CLASSIFY_NAME" property="classifyName"/>
 | 
			
		||||
        <result column="PK_TRANSACTION_KEY" property="pkTransactionKey"/>
 | 
			
		||||
        <result column="SORT" property="sort"/>
 | 
			
		||||
        <result column="ENABLE_STATE" property="enableState"/>
 | 
			
		||||
        <result column="PK_PARENT" property="pkParent"/>
 | 
			
		||||
        <result column="CLASSIFY_IMG" property="classifyImg"/>
 | 
			
		||||
        <result column="PK_CREATOR" property="pkCreator"/>
 | 
			
		||||
        <result column="CREATION_TIME" property="creationTime"/>
 | 
			
		||||
        <result column="PK_MODIFIED" property="pkModified"/>
 | 
			
		||||
        <result column="MODIFIED_TIME" property="modifiedTime"/>
 | 
			
		||||
        <result column="DEL_FLAG" property="delFlag"/>
 | 
			
		||||
        <result column="PK_COUNTRY" property="pkCountry"/>
 | 
			
		||||
        <result column="HIERARCHY" property="hierarchy"/>
 | 
			
		||||
    </resultMap>
 | 
			
		||||
 | 
			
		||||
        <result column="CLASSIFY_NAME" property="classifyName" />
 | 
			
		||||
        <result column="PK_TRANSACTION_KEY" property="pkTransactionKey" />
 | 
			
		||||
        <result column="SORT" property="sort" />
 | 
			
		||||
        <result column="ENABLE_STATE" property="enableState" />
 | 
			
		||||
        <result column="PK_PARENT" property="pkParent" />
 | 
			
		||||
        <result column="CLASSIFY_IMG" property="classifyImg" />
 | 
			
		||||
        <result column="PK_CREATOR" property="pkCreator" />
 | 
			
		||||
        <result column="CREATION_TIME" property="creationTime" />
 | 
			
		||||
        <result column="PK_MODIFIED" property="pkModified" />
 | 
			
		||||
        <result column="MODIFIED_TIME" property="modifiedTime" />
 | 
			
		||||
        <result column="DEL_FLAG" property="delFlag" />
 | 
			
		||||
        <result column="PK_COUNTRY" property="pkCountry" />
 | 
			
		||||
        <result column="HIERARCHY" property="hierarchy" />
 | 
			
		||||
    </resultMap>
 | 
			
		||||
    <resultMap id="SelectResultMap" type="com.hzs.sale.product.vo.AreaClassifyVo">
 | 
			
		||||
        <id column="PK_ID" property="pkId" />
 | 
			
		||||
        <result column="CREATION_TIME" property="creationTime" />
 | 
			
		||||
        <result column="CLASSIFY_NAME" property="classifyName" />
 | 
			
		||||
        <result column="ENABLE_STATE" property="enableState" />
 | 
			
		||||
        <result column="SORT" property="sort" />
 | 
			
		||||
        <result column="PK_PARENT" property="pkParent" />
 | 
			
		||||
        <result column="CLASSIFY_IMG" property="classifyImg" />
 | 
			
		||||
        <result column="HIERARCHY" property="hierarchy" />
 | 
			
		||||
        <result column="parentClassifyName" property="parentClassifyName" />
 | 
			
		||||
        <result column="IS_RECOMMEND" property="isRecommend" />
 | 
			
		||||
        <id column="PK_ID" property="pkId"/>
 | 
			
		||||
        <result column="CREATION_TIME" property="creationTime"/>
 | 
			
		||||
        <result column="CLASSIFY_NAME" property="classifyName"/>
 | 
			
		||||
        <result column="ENABLE_STATE" property="enableState"/>
 | 
			
		||||
        <result column="SORT" property="sort"/>
 | 
			
		||||
        <result column="PK_PARENT" property="pkParent"/>
 | 
			
		||||
        <result column="CLASSIFY_IMG" property="classifyImg"/>
 | 
			
		||||
        <result column="HIERARCHY" property="hierarchy"/>
 | 
			
		||||
        <result column="parentClassifyName" property="parentClassifyName"/>
 | 
			
		||||
        <result column="IS_RECOMMEND" property="isRecommend"/>
 | 
			
		||||
    </resultMap>
 | 
			
		||||
    <!-- 通用查询结果列 -->
 | 
			
		||||
    <sql id="Base_Column_List">
 | 
			
		||||
        PK_ID,  CLASSIFY_NAME, PK_TRANSACTION_KEY, SORT, ENABLE_STATE, PK_PARENT, CLASSIFY_IMG, PK_CREATOR, CREATION_TIME, PK_MODIFIED, MODIFIED_TIME, DEL_FLAG, PK_COUNTRY
 | 
			
		||||
    </sql>
 | 
			
		||||
 | 
			
		||||
    <select id="selectByAreaClassifyList" resultMap="SelectResultMap">
 | 
			
		||||
        select ac.*,pac.CLASSIFY_NAME parentClassifyName from  BD_AREA_CLASSIFY  ac
 | 
			
		||||
        select ac.*,pac.CLASSIFY_NAME parentClassifyName from BD_AREA_CLASSIFY ac
 | 
			
		||||
        left join BD_AREA_CLASSIFY pac on pac.PK_ID = ac.PK_PARENT
 | 
			
		||||
        where ac.DEL_FLAG = 0
 | 
			
		||||
        <if test="pkParent != null">
 | 
			
		||||
| 
						 | 
				
			
			@ -52,16 +48,16 @@
 | 
			
		|||
        </if>
 | 
			
		||||
        <if test="specialArea != null">
 | 
			
		||||
            AND (
 | 
			
		||||
            (select count(csa.PK_ID)  from  BD_AREA_CLASSIFY_SPECIAL_AREA  csa where csa.SPECIAL_AREA = #{specialArea} and csa.PK_AREA_CLASSIFY = ac.PK_ID ) > 0
 | 
			
		||||
            (select count(csa.PK_ID) from BD_AREA_CLASSIFY_SPECIAL_AREA csa where csa.SPECIAL_AREA = #{specialArea} and csa.PK_AREA_CLASSIFY =
 | 
			
		||||
            ac.PK_ID ) > 0
 | 
			
		||||
            or
 | 
			
		||||
 | 
			
		||||
            (
 | 
			
		||||
            select count(t.PK_ID)
 | 
			
		||||
            from BD_AREA_CLASSIFY t
 | 
			
		||||
            where  (select count(csa.PK_ID)  from  BD_AREA_CLASSIFY_SPECIAL_AREA  csa where csa.SPECIAL_AREA = #{specialArea} and csa.PK_AREA_CLASSIFY = t.PK_ID) > 0
 | 
			
		||||
            where (select count(csa.PK_ID) from BD_AREA_CLASSIFY_SPECIAL_AREA csa where csa.SPECIAL_AREA = #{specialArea} and csa.PK_AREA_CLASSIFY =
 | 
			
		||||
            t.PK_ID) > 0
 | 
			
		||||
            start with t.pk_id = ac.PK_ID
 | 
			
		||||
            connect by t.pk_id = prior t.pk_parent
 | 
			
		||||
 | 
			
		||||
            ) > 0
 | 
			
		||||
            )
 | 
			
		||||
        </if>
 | 
			
		||||
| 
						 | 
				
			
			@ -75,6 +71,7 @@
 | 
			
		|||
        <if test="classifyName != null and classifyName !='' ">
 | 
			
		||||
            AND ac.CLASSIFY_NAME like #{classifyName}||'%'
 | 
			
		||||
        </if>
 | 
			
		||||
        order by ac.SORT  desc
 | 
			
		||||
        order by ac.SORT desc
 | 
			
		||||
    </select>
 | 
			
		||||
 | 
			
		||||
</mapper>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -98,7 +98,6 @@
 | 
			
		|||
        S_LABEL, SALES, IS_SALE, ARRIVAL_TIME, WARN_MESSAGE,
 | 
			
		||||
        IS_LAND_TRANS, IS_AIR_TRANS, IS_OCEAN_TRANS,
 | 
			
		||||
        VIDEO_URL, COVER, be.maker_income, be.PK_SPECIAL_CURRENCY,
 | 
			
		||||
 | 
			
		||||
        be.INVENTORY, be.INVENTORY_RATIO, be.MEMBER_LIMIT, be.MEMBER_MONTH_LIMIT, be.INVENTORY_USE
 | 
			
		||||
        from bd_wares bw
 | 
			
		||||
        inner join bd_wares_extend be
 | 
			
		||||
| 
						 | 
				
			
			@ -153,6 +152,7 @@
 | 
			
		|||
        select bw.PK_COUNTRY, bw.PK_ID, be.pk_id PK_WARES_EXTEND,
 | 
			
		||||
        be.IS_MAKER_GIFT, bw.WARES_CODE, bw.WARES_NAME,
 | 
			
		||||
        PK_AREA_CLASSIFY, COVER, COVER1, COVER2,
 | 
			
		||||
        DETAILS_TYPE,
 | 
			
		||||
        bw.WARES_PRICE, bw.WARES_ACHIEVE,
 | 
			
		||||
        SORT, SPECIAL_AREA,
 | 
			
		||||
        IS_PUT_ON, PRE_SALE_STATUS,
 | 
			
		||||
| 
						 | 
				
			
			@ -176,6 +176,9 @@
 | 
			
		|||
        <if test="pkCountry != null">
 | 
			
		||||
            and bw.pk_country = #{pkCountry}
 | 
			
		||||
        </if>
 | 
			
		||||
        <if test="waresName != null and waresName != ''">
 | 
			
		||||
            and bw.WARES_NAME like '%' || #{waresName} || '%'
 | 
			
		||||
        </if>
 | 
			
		||||
        order by bw.SORT_STATUS desc , bw.sort desc, bw.WARES_PRICE ,bw.CREATION_TIME desc
 | 
			
		||||
    </select>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,59 +1,25 @@
 | 
			
		|||
package com.hzs.system.config.controller.api;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 | 
			
		||||
import com.hzs.common.core.constant.SystemFieldConstants;
 | 
			
		||||
import com.hzs.common.core.enums.EYesNo;
 | 
			
		||||
import com.hzs.common.core.web.domain.AjaxResult;
 | 
			
		||||
import com.hzs.common.domain.system.config.BdRegisterPage;
 | 
			
		||||
import com.hzs.common.security.utils.SecurityUtils;
 | 
			
		||||
import com.hzs.system.config.service.IBdRegisterPageService;
 | 
			
		||||
import com.hzs.system.config.vo.RegisterPageVO;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.web.bind.annotation.GetMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.RestController;
 | 
			
		||||
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.Collections;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @Description: 前端注册页面配置控制器
 | 
			
		||||
 * @Author: jiang chao
 | 
			
		||||
 * @Time: 2022/10/19 9:44
 | 
			
		||||
 * @Classname: ApiBdRegisterPageController
 | 
			
		||||
 * @PackageName: com.hzs.system.config.controller.api
 | 
			
		||||
 * 前端注册页面配置控制器
 | 
			
		||||
 */
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping("/api/register-page")
 | 
			
		||||
public class ApiBdRegisterPageController {
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private IBdRegisterPageService iBdRegisterPageService;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取菜单权限列表
 | 
			
		||||
     *
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    @GetMapping("/list")
 | 
			
		||||
    public AjaxResult list(Integer pkCountry) {
 | 
			
		||||
        if (null == pkCountry) {
 | 
			
		||||
            pkCountry = SecurityUtils.getPkCountry();
 | 
			
		||||
        }
 | 
			
		||||
        QueryWrapper<BdRegisterPage> queryWrapper = new QueryWrapper<>();
 | 
			
		||||
        queryWrapper.eq(SystemFieldConstants.PK_COUNTRY, pkCountry);
 | 
			
		||||
        queryWrapper.eq("DISPLAY", EYesNo.YES.getIntValue());
 | 
			
		||||
        queryWrapper.orderByAsc(SystemFieldConstants.PK_ID);
 | 
			
		||||
        List<BdRegisterPage> list = iBdRegisterPageService.list(queryWrapper);
 | 
			
		||||
 | 
			
		||||
        List<RegisterPageVO> resultList = new ArrayList<>();
 | 
			
		||||
        for (BdRegisterPage bdRegisterPage : list) {
 | 
			
		||||
            resultList.add(RegisterPageVO.builder()
 | 
			
		||||
                    .field(bdRegisterPage.getField())
 | 
			
		||||
                    .build());
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return AjaxResult.success(resultList);
 | 
			
		||||
    public AjaxResult list() {
 | 
			
		||||
        return AjaxResult.success(Collections.emptyList());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,9 +5,6 @@ import com.hzs.common.domain.system.config.BdRegisterPage;
 | 
			
		|||
 | 
			
		||||
/**
 | 
			
		||||
 * 注册页面配置 Mapper 接口
 | 
			
		||||
 *
 | 
			
		||||
 * @author hzs
 | 
			
		||||
 * @since 2022-10-18
 | 
			
		||||
 */
 | 
			
		||||
public interface BdRegisterPageMapper extends BaseMapper<BdRegisterPage> {
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,9 +7,6 @@ import java.util.List;
 | 
			
		|||
 | 
			
		||||
/**
 | 
			
		||||
 * 注册页面配置 服务类
 | 
			
		||||
 *
 | 
			
		||||
 * @author hzs
 | 
			
		||||
 * @since 2022-10-18
 | 
			
		||||
 */
 | 
			
		||||
public interface IBdRegisterPageService extends IService<BdRegisterPage> {
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,9 +1,8 @@
 | 
			
		|||
package com.hzs.system.config.service.impl;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 | 
			
		||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 | 
			
		||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 | 
			
		||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 | 
			
		||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
			
		||||
import com.hzs.common.core.constant.SystemFieldConstants;
 | 
			
		||||
import com.hzs.common.core.enums.EDelFlag;
 | 
			
		||||
import com.hzs.common.core.enums.ERegisterPage;
 | 
			
		||||
import com.hzs.common.core.enums.EYesNo;
 | 
			
		||||
| 
						 | 
				
			
			@ -18,18 +17,15 @@ import java.util.List;
 | 
			
		|||
 | 
			
		||||
/**
 | 
			
		||||
 * 注册页面配置 服务实现类
 | 
			
		||||
 *
 | 
			
		||||
 * @author hzs
 | 
			
		||||
 * @since 2022-10-18
 | 
			
		||||
 */
 | 
			
		||||
@Service
 | 
			
		||||
public class BdRegisterPageServiceImpl extends ServiceImpl<BdRegisterPageMapper, BdRegisterPage> implements IBdRegisterPageService {
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<BdRegisterPage> queryList(Integer pkCountry) {
 | 
			
		||||
        QueryWrapper<BdRegisterPage> queryWrapper = new QueryWrapper<>();
 | 
			
		||||
        queryWrapper.eq(SystemFieldConstants.PK_COUNTRY, pkCountry);
 | 
			
		||||
        queryWrapper.orderByAsc("PK_ID");
 | 
			
		||||
        LambdaQueryWrapper<BdRegisterPage> queryWrapper = new LambdaQueryWrapper<>();
 | 
			
		||||
        queryWrapper.eq(BdRegisterPage::getPkCountry, pkCountry);
 | 
			
		||||
        queryWrapper.orderByAsc(BdRegisterPage::getPkId);
 | 
			
		||||
        return baseMapper.selectList(queryWrapper);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -39,11 +35,11 @@ public class BdRegisterPageServiceImpl extends ServiceImpl<BdRegisterPageMapper,
 | 
			
		|||
        Date nowDate = new Date();
 | 
			
		||||
 | 
			
		||||
        // 删除旧数据
 | 
			
		||||
        UpdateWrapper<BdRegisterPage> updateWrapper = new UpdateWrapper<>();
 | 
			
		||||
        updateWrapper.eq(SystemFieldConstants.PK_COUNTRY, pkCountry);
 | 
			
		||||
        updateWrapper.set(SystemFieldConstants.DEL_FLAG, EDelFlag.DELETE.getValue());
 | 
			
		||||
        updateWrapper.set(SystemFieldConstants.PK_MODIFIED, userId);
 | 
			
		||||
        updateWrapper.set(SystemFieldConstants.MODIFIED_TIME, nowDate);
 | 
			
		||||
        LambdaUpdateWrapper<BdRegisterPage> updateWrapper = new LambdaUpdateWrapper<>();
 | 
			
		||||
        updateWrapper.eq(BdRegisterPage::getPkCountry, pkCountry);
 | 
			
		||||
        updateWrapper.set(BdRegisterPage::getDelFlag, EDelFlag.DELETE.getValue());
 | 
			
		||||
        updateWrapper.set(BdRegisterPage::getPkModified, userId);
 | 
			
		||||
        updateWrapper.set(BdRegisterPage::getModifiedTime, nowDate);
 | 
			
		||||
        baseMapper.update(null, updateWrapper);
 | 
			
		||||
 | 
			
		||||
        for (String field : registerPageFieldList) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -13,12 +13,8 @@ import org.springframework.web.bind.annotation.RestController;
 | 
			
		|||
@Slf4j
 | 
			
		||||
public class ApiIdempotentController {
 | 
			
		||||
 | 
			
		||||
    private IIdempotentService idempotentService;
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    public void setIdempotentService(IIdempotentService idempotentService) {
 | 
			
		||||
        this.idempotentService = idempotentService;
 | 
			
		||||
    }
 | 
			
		||||
    private IIdempotentService idempotentService;
 | 
			
		||||
 | 
			
		||||
    @GetMapping("/generate")
 | 
			
		||||
    public AjaxResult generateIdempotentToken() {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,11 +4,6 @@ import com.hzs.common.core.constant.CacheConstants;
 | 
			
		|||
 | 
			
		||||
/**
 | 
			
		||||
 * 解决系统幂等性的公共方法
 | 
			
		||||
 * @author: sui q
 | 
			
		||||
 * @time: 2022/8/27 13:46
 | 
			
		||||
 * @description:
 | 
			
		||||
 * @classname: IIdempotentService
 | 
			
		||||
 * @package_name: com.hzs.system.tools.service
 | 
			
		||||
 */
 | 
			
		||||
public interface IIdempotentService {
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -19,33 +14,16 @@ public interface IIdempotentService {
 | 
			
		|||
 | 
			
		||||
    /**
 | 
			
		||||
     * 生成唯一的token
 | 
			
		||||
    * @Description:
 | 
			
		||||
    * @return: String
 | 
			
		||||
    * @throws
 | 
			
		||||
    * @Author: sui q
 | 
			
		||||
    * @Date: 2022/8/27 13:47
 | 
			
		||||
    */
 | 
			
		||||
     */
 | 
			
		||||
    String generateToken();
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 验证token,是否存在系统中
 | 
			
		||||
    * @Description:
 | 
			
		||||
     * @param token
 | 
			
		||||
    * @return: Boolean
 | 
			
		||||
    * @throws
 | 
			
		||||
    * @Author: sui q
 | 
			
		||||
    * @Date: 2022/8/27 13:48
 | 
			
		||||
    */
 | 
			
		||||
     */
 | 
			
		||||
    Boolean validateToken(String token);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 刷新token
 | 
			
		||||
    * @Description:
 | 
			
		||||
     * @param token
 | 
			
		||||
    * @return: void
 | 
			
		||||
    * @throws
 | 
			
		||||
    * @Author: sui q
 | 
			
		||||
    * @Date: 2022/8/27 13:48
 | 
			
		||||
    */
 | 
			
		||||
     */
 | 
			
		||||
    void refreshToken(String token);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -12,68 +12,30 @@ import java.util.concurrent.TimeUnit;
 | 
			
		|||
 | 
			
		||||
/**
 | 
			
		||||
 * 解决系统幂等性的公共方法的实现类
 | 
			
		||||
 * @author: sui q
 | 
			
		||||
 * @time: 2022/8/27 13:49
 | 
			
		||||
 * @description:
 | 
			
		||||
 * @classname: IdempotentServiceImpl
 | 
			
		||||
 * @package_name: com.hzs.system.tools.service.impl
 | 
			
		||||
 */
 | 
			
		||||
@Service
 | 
			
		||||
public class IdempotentServiceImpl implements IIdempotentService {
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private RedisService redisService;
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    public void setRedisService(RedisService redisService) {
 | 
			
		||||
        this.redisService = redisService;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 生成唯一的token
 | 
			
		||||
     * @Description:
 | 
			
		||||
     * @param
 | 
			
		||||
     * @return: String
 | 
			
		||||
     * @throws
 | 
			
		||||
     * @Author: sui q
 | 
			
		||||
     * @Date: 2022/8/27 13:47
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public String generateToken() {
 | 
			
		||||
        String token = IdUtils.fastSimpleUUID();
 | 
			
		||||
        redisService.setCacheObject(CacheToolsConstants.IDEMPOTENT_TOKEN+token,
 | 
			
		||||
        redisService.setCacheObject(CacheToolsConstants.IDEMPOTENT_TOKEN + token,
 | 
			
		||||
                token, EXPIRE_TIME, TimeUnit.MINUTES);
 | 
			
		||||
        return token;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 验证token,是否存在系统中
 | 
			
		||||
     * @Description:
 | 
			
		||||
     * @param token
 | 
			
		||||
     * @return: Boolean
 | 
			
		||||
     * @throws
 | 
			
		||||
     * @Author: sui q
 | 
			
		||||
     * @Date: 2022/8/27 13:48
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean validateToken(String token) {
 | 
			
		||||
        String redisToken = redisService.getCacheObject(CacheToolsConstants.IDEMPOTENT_TOKEN + token);
 | 
			
		||||
        if(StringUtils.isEmpty(redisToken) || !redisToken.equals(token)){
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
        return true;
 | 
			
		||||
        return !StringUtils.isEmpty(redisToken) && redisToken.equals(token);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 刷新token
 | 
			
		||||
     * @Description:
 | 
			
		||||
     * @param token
 | 
			
		||||
     * @return: void
 | 
			
		||||
     * @throws
 | 
			
		||||
     * @Author: sui q
 | 
			
		||||
     * @Date: 2022/8/27 13:48
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void refreshToken(String token) {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -23,11 +23,7 @@ import javax.servlet.http.HttpServletRequest;
 | 
			
		|||
import java.lang.reflect.Method;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author: sui q
 | 
			
		||||
 * @time: 2022/8/27 14:45
 | 
			
		||||
 * @description:防止重复提交的切面类
 | 
			
		||||
 * @classname: RepeatSubmitAspectAdvice
 | 
			
		||||
 * @package_name: com.hzs.common.core.aspect
 | 
			
		||||
 * 防止重复提交的切面类
 | 
			
		||||
 */
 | 
			
		||||
@Aspect
 | 
			
		||||
@Component
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -57,9 +57,4 @@ public class SystemFieldConstants {
 | 
			
		|||
     */
 | 
			
		||||
    public static final String PK_COUNTRY = "pk_country";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 公司
 | 
			
		||||
     */
 | 
			
		||||
    public static final String PK_CORP = "pk_corp";
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,11 +2,6 @@ package com.hzs.common.core.constant.msg;
 | 
			
		|||
 | 
			
		||||
public class MemberMsgConstants {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 重复提交,或者没有token生成,不是正规流程进入的保存 提交token失效 -- 请求已经失效,请刷新重试!
 | 
			
		||||
     */
 | 
			
		||||
    public static final String TOKEN_REPEAT_SUBMIT = "请求已经失效,请刷新重试!";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 手机号码长度验证 -- 联系方式长度超长
 | 
			
		||||
     * 2024.06.21 兼容新需求,特殊账号联系方式长度不能超过30位
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -93,4 +93,5 @@ public enum EGrade {
 | 
			
		|||
        }
 | 
			
		||||
        return null;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -25,7 +25,7 @@ public enum EOrderTypeExtend {
 | 
			
		|||
    /**
 | 
			
		||||
     * 实际值
 | 
			
		||||
     */
 | 
			
		||||
    private final int value;
 | 
			
		||||
    private final Integer value;
 | 
			
		||||
    /**
 | 
			
		||||
     * 显示标签
 | 
			
		||||
     */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -61,6 +61,12 @@ public enum ESpecialArea {
 | 
			
		|||
     */
 | 
			
		||||
    RENEWAL_AREA(30, "续约专区", 0, EnumsPrefixConstants.SPECIAL_AREA + 30, 30, EMenuDetail.RENEWAL_AREA.getValue()),
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 会员专区 -- 0元注册之后,只能看到会员专区,就是注册专区的188商品
 | 
			
		||||
     * SANGELXIU1 enable = 1->0
 | 
			
		||||
     */
 | 
			
		||||
    MEMBER_AREA(41, "会员专区", 0, EnumsPrefixConstants.SPECIAL_AREA + 41, 41, -1),
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 自助购票
 | 
			
		||||
     */
 | 
			
		||||
| 
						 | 
				
			
			@ -115,4 +121,18 @@ public enum ESpecialArea {
 | 
			
		|||
        }
 | 
			
		||||
        return null;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取会员专区,支持188的会员专区(41)返回为注册专区(1)
 | 
			
		||||
     *
 | 
			
		||||
     * @param value
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    public static Integer getMemberArea(Integer value) {
 | 
			
		||||
        if (null != value && value.equals(ESpecialArea.MEMBER_AREA.getValue())) {
 | 
			
		||||
            return ESpecialArea.REGISTER_AREA.getValue();
 | 
			
		||||
        }
 | 
			
		||||
        return value;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,10 +2,8 @@ package com.hzs.common.domain.sale.product;
 | 
			
		|||
 | 
			
		||||
import com.baomidou.mybatisplus.annotation.KeySequence;
 | 
			
		||||
import com.baomidou.mybatisplus.annotation.TableName;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
import com.baomidou.mybatisplus.annotation.TableId;
 | 
			
		||||
import com.baomidou.mybatisplus.annotation.TableField;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
 | 
			
		||||
import com.hzs.common.core.web.domain.BaseEntity;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
| 
						 | 
				
			
			@ -13,12 +11,7 @@ import lombok.EqualsAndHashCode;
 | 
			
		|||
import lombok.experimental.Accessors;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * 商品分类
 | 
			
		||||
 * </p>
 | 
			
		||||
 *
 | 
			
		||||
 * @author hzs
 | 
			
		||||
 * @since 2022-09-05
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@EqualsAndHashCode(callSuper = false)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,9 +11,6 @@ import lombok.experimental.Accessors;
 | 
			
		|||
 | 
			
		||||
/**
 | 
			
		||||
 * 注册页面配置
 | 
			
		||||
 *
 | 
			
		||||
 * @author hzs
 | 
			
		||||
 * @since 2022-10-18
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@EqualsAndHashCode(callSuper = true)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue