Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/qijisheng
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime lastOrderTime; |
| | | |
| | | |
| | | public String getIdStr(){ |
| | | return String.valueOf(id); |
| | | } |
| | |
| | | if (UserStatus.DISABLE.getCode().equals(user.getStatus())) { |
| | | recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, "用户已停用,请联系管理员"); |
| | | // throw new ServiceException("对不起,您的账号:" + username + " 已停用"); |
| | | throw new ServiceException("您的账号已被禁用,请联系平台"); |
| | | throw new ServiceException("您所属门店已被冻结,请联系平台"); |
| | | } |
| | | passwordService.validate(user, password, request); |
| | | // passwordService.validate(user, password, request); |
| | | recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_SUCCESS_STATUS, "登录成功"); |
| | | return userInfo; |
| | | } |
| | |
| | | throw new ServiceException(errMsg); |
| | | } |
| | | |
| | | |
| | | if (!matches(user,password)){ |
| | | retryCount = retryCount + 1; |
| | | recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, String.format("密码输入错误%s次", retryCount)); |
| | | redisService.setCacheObject(getCacheKey(username), retryCount, lockTime, TimeUnit.MINUTES); |
| | | throw new ServiceException("密码错误"); |
| | | } |
| | | // if (!user.getPassword().equals(password)){ |
| | | // retryCount = retryCount + 1; |
| | | // recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, String.format("密码输入错误%s次", retryCount)); |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int deleteUserByIds(Long[] userIds) { |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | SysUser sysUser = this.getById(userid); |
| | |
| | | user.setTopUser(byId); |
| | | } |
| | | //获取绑定下级列表 |
| | | List<AppUser> list = appUserService.lambdaQuery().eq(AppUser::getInviteUserId, user.getId()).list(); |
| | | List<AppUser> list = appUserService.lambdaQuery() |
| | | .eq(AppUser::getInviteUserId, user.getId()) |
| | | .eq(AppUser::getDelFlag, 0) |
| | | .ne(AppUser::getStatus, 3) |
| | | .list(); |
| | | for (AppUser appUser : list) { |
| | | Long count1 = appUserService.lambdaQuery().eq(AppUser::getVipId, 1).eq(AppUser::getInviteUserId, appUser.getId()).count(); |
| | | Long count2 = appUserService.lambdaQuery().eq(AppUser::getVipId, 2).eq(AppUser::getInviteUserId, appUser.getId()).count(); |
| | | Long count3 = appUserService.lambdaQuery().eq(AppUser::getVipId, 3).eq(AppUser::getInviteUserId, appUser.getId()).count(); |
| | | Long count4 = appUserService.lambdaQuery().eq(AppUser::getVipId, 4).eq(AppUser::getInviteUserId, appUser.getId()).count(); |
| | | Long count5 = appUserService.lambdaQuery().eq(AppUser::getVipId, 5).eq(AppUser::getInviteUserId, appUser.getId()).count(); |
| | | Long count6 = appUserService.lambdaQuery().eq(AppUser::getVipId, 6).eq(AppUser::getInviteUserId, appUser.getId()).count(); |
| | | Long count7 = appUserService.lambdaQuery().eq(AppUser::getVipId, 7).eq(AppUser::getInviteUserId, appUser.getId()).count(); |
| | | Long count1 = appUserService.lambdaQuery() |
| | | .eq(AppUser::getVipId, 1) |
| | | .eq(AppUser::getInviteUserId, appUser.getId()) |
| | | .eq(AppUser::getDelFlag, 0) |
| | | .ne(AppUser::getStatus, 3) |
| | | .count(); |
| | | Long count2 = appUserService.lambdaQuery() |
| | | .eq(AppUser::getVipId, 2) |
| | | .eq(AppUser::getInviteUserId, appUser.getId()) |
| | | .eq(AppUser::getDelFlag, 0) |
| | | .ne(AppUser::getStatus, 3) |
| | | .count(); |
| | | Long count3 = appUserService.lambdaQuery() |
| | | .eq(AppUser::getVipId, 3) |
| | | .eq(AppUser::getInviteUserId, appUser.getId()) |
| | | .eq(AppUser::getDelFlag, 0) |
| | | .ne(AppUser::getStatus, 3) |
| | | .count(); |
| | | Long count4 = appUserService.lambdaQuery() |
| | | .eq(AppUser::getVipId, 4) |
| | | .eq(AppUser::getInviteUserId, appUser.getId()) |
| | | .eq(AppUser::getDelFlag, 0) |
| | | .ne(AppUser::getStatus, 3) |
| | | .count(); |
| | | Long count5 = appUserService.lambdaQuery() |
| | | .eq(AppUser::getVipId, 5) |
| | | .eq(AppUser::getInviteUserId, appUser.getId()) |
| | | .eq(AppUser::getDelFlag, 0) |
| | | .ne(AppUser::getStatus, 3) |
| | | .count(); |
| | | Long count6 = appUserService.lambdaQuery() |
| | | .eq(AppUser::getVipId, 6) |
| | | .eq(AppUser::getInviteUserId, appUser.getId()) |
| | | .eq(AppUser::getDelFlag, 0) |
| | | .ne(AppUser::getStatus, 3) |
| | | .count(); |
| | | Long count7 = appUserService.lambdaQuery() |
| | | .eq(AppUser::getVipId, 7) |
| | | .eq(AppUser::getInviteUserId, appUser.getId()) |
| | | .eq(AppUser::getDelFlag, 0) |
| | | .ne(AppUser::getStatus, 3) |
| | | .count(); |
| | | appUser.setCount1(count1); |
| | | appUser.setCount2(count2); |
| | | appUser.setCount3(count3); |
| | |
| | | user.setCount6(count6); |
| | | user.setCount7(count7); |
| | | |
| | | List<UserSignRecord> list = userSignRecordService.lambdaQuery().eq(UserSignRecord::getSignDay, LocalDate.now()).list(); |
| | | List<UserSignRecord> list = userSignRecordService.lambdaQuery().eq(UserSignRecord::getSignDay, LocalDate.now()) |
| | | .eq(UserSignRecord::getAppUserId,userId).list(); |
| | | if (!list.isEmpty()) { |
| | | user.setIsSign(1); |
| | | } else { |
| | |
| | | */ |
| | | @PostMapping("/delAppUserShop") |
| | | public R delAppUserShop(@RequestBody AppUserShop appUserShop){ |
| | | LambdaUpdateWrapper<AppUserShop> wrapper = new LambdaUpdateWrapper<>(); |
| | | LambdaQueryWrapper<AppUserShop> wrapper = new LambdaQueryWrapper<>(); |
| | | if(null != appUserShop.getAppUserId()){ |
| | | wrapper.eq(AppUserShop::getAppUserId, appUserShop.getAppUserId()); |
| | | } |
| | |
| | | Integer status = jsonObject.getInteger("status"); |
| | | if(0 != status){ |
| | | log.error(jsonObject.getString("message")); |
| | | return null; |
| | | throw new RuntimeException(jsonObject.getString("message")); |
| | | } |
| | | JSONObject result = jsonObject.getJSONObject("result"); |
| | | JSONObject ad_info = result.getJSONObject("ad_info"); |
| | |
| | | and t2.phone like concat('%',#{agentQuery.phone},'%') |
| | | </if> |
| | | <if test="agentQuery.vipId !=null"> |
| | | and t1.applicationVipId = #{agentQuery.vipId} |
| | | and t1.application_vip_id = #{agentQuery.vipId} |
| | | </if> |
| | | <if test="agentQuery.status !=null"> |
| | | and t1.status = #{agentQuery.status} |
| | |
| | | @ApiOperation(value = "查询订单详情", tags = {"管理后台-订单管理"}) |
| | | public R<OrderInfoVo> getOrderInfo(@PathVariable("orderId") Long orderId){ |
| | | OrderInfoVo orderInfo = orderService.getOrderInfo(orderId); |
| | | RefundPass refundPass = refundPassService.lambdaQuery().eq(RefundPass::getOrderId, orderId).one(); |
| | | if (refundPass!=null){ |
| | | orderInfo.setRefundPassId(refundPass.getId().toString()); |
| | | RefundPass one = refundPassService.getOne(new LambdaQueryWrapper<RefundPass>().eq(RefundPass::getOrderId, orderId) |
| | | .eq(RefundPass::getDelFlag, 0).last(" order by create_time desc limit 0,1")); |
| | | if (one!=null){ |
| | | orderInfo.setRefundPassId(one.getId().toString()); |
| | | } |
| | | return R.ok(orderInfo); |
| | | } |
| | |
| | | orderPageListVo.setUserName(appUser.getName()); |
| | | orderPageListVo.setPhone(appUser.getPhone()); |
| | | } |
| | | // RefundPass one = refundPassService.getOne(new LambdaQueryWrapper<RefundPass>().eq(RefundPass::getOrderId, orderPageListVo.getId()).eq(RefundPass::getDelFlag, 0).last(" order by create_time desc limit 0,1")); |
| | | RefundPass one = refundPassService.lambdaQuery().eq(RefundPass::getOrderId, orderPageListVo.getId()).one(); |
| | | RefundPass one = refundPassService.getOne(new LambdaQueryWrapper<RefundPass>().eq(RefundPass::getOrderId, orderPageListVo.getId()).eq(RefundPass::getDelFlag, 0).last(" order by create_time desc limit 0,1")); |
| | | orderPageListVo.setRefundPassId(null != one ? one.getId().toString() : null); |
| | | |
| | | // 平台分佣 |
| | |
| | | info.setVip(appUser.getVipId()); |
| | | GoodsSeckill goodsSeckill = seckillActivityInfoClient.getSeckillActivityInfo(info).getData(); |
| | | //没有秒杀活动或者添加的普通商品则不使用秒杀活动价格 |
| | | if(null == goodsSeckill || type == 1){ |
| | | if((null == goodsSeckill || (null != goodsSeckill.getCashPayment() && null != goodsSeckill.getPointPayment())) || type == 1){ |
| | | //没有秒杀价,则判断门店特价 |
| | | GetGoodsBargainPrice goodsBargainPrice = new GetGoodsBargainPrice(); |
| | | goodsBargainPrice.setGoodsId(goodsId); |
| | |
| | | area.setVip(appUser.getVipId()); |
| | | area.setGoodsId(goodsId); |
| | | GoodsArea goodsArea = goodsAreaClient.getGoodsArea(area).getData(); |
| | | if(null == goodsArea){ |
| | | if(null == goodsArea || (null == goodsArea.getCashPayment() && null == goodsArea.getPointPayment())){ |
| | | //没有地区价格,则使用会员价格 |
| | | GoodsVip goodsVip = goodsVipClient.getGoodsVip(goodsId, appUser.getVipId()).getData(); |
| | | if(null == goodsVip){ |
| | | if(null == goodsVip || (null == goodsVip.getCashPayment() && null == goodsVip.getPointPayment())){ |
| | | //没有配置价格,直接使用原始基础价格 |
| | | return null; |
| | | }else{ |
| | | price.setCash(goodsVip.getSellingPrice()); |
| | | price.setPoint(goodsVip.getIntegral()); |
| | | price.setCashPayment(goodsVip.getCashPayment() == 1); |
| | | price.setPointPayment(goodsVip.getPointPayment() == 1); |
| | | price.setCashPayment(null != goodsVip.getCashPayment() && goodsVip.getCashPayment() == 1); |
| | | price.setPointPayment(null != goodsVip.getPointPayment() && goodsVip.getPointPayment() == 1); |
| | | price.setEarnSpendingPoints(goodsVip.getEarnSpendingPoints()); |
| | | price.setSuperiorSubcommission(goodsVip.getSuperiorSubcommission()); |
| | | price.setSuperiorRebatePoints(goodsVip.getSuperiorRebatePoints()); |
| | |
| | | }else{ |
| | | price.setCash(goodsArea.getSellingPrice()); |
| | | price.setPoint(goodsArea.getIntegral()); |
| | | price.setCashPayment(goodsArea.getCashPayment() == 1); |
| | | price.setPointPayment(goodsArea.getPointPayment() == 1); |
| | | price.setCashPayment(null !=goodsArea.getCashPayment() && goodsArea.getCashPayment() == 1); |
| | | price.setPointPayment(null !=goodsArea.getPointPayment() && goodsArea.getPointPayment() == 1); |
| | | price.setEarnSpendingPoints(goodsArea.getEarnSpendingPoints()); |
| | | price.setSuperiorSubcommission(goodsArea.getSuperiorSubcommission()); |
| | | price.setSuperiorRebatePoints(goodsArea.getSuperiorRebatePoints()); |
| | |
| | | if(goodsSeckill.getCashPayment() == 0 && goodsSeckill.getPointPayment() == 1){ |
| | | price.setPoint(goodsSeckill.getIntegral()); |
| | | } |
| | | price.setCashPayment(goodsSeckill.getCashPayment() == 1); |
| | | price.setPointPayment(goodsSeckill.getPointPayment() == 1); |
| | | price.setCashPayment(null != goodsSeckill.getCashPayment() && goodsSeckill.getCashPayment() == 1); |
| | | price.setPointPayment(null != goodsSeckill.getPointPayment() && goodsSeckill.getPointPayment() == 1); |
| | | price.setEndTime(goodsSeckill.getEndTime()); |
| | | price.setEarnSpendingPoints(goodsSeckill.getEarnSpendingPoints()); |
| | | price.setSuperiorSubcommission(goodsSeckill.getSuperiorSubcommission()); |
| | |
| | | }else{ |
| | | int sum = 0; |
| | | for (MyShoppingCartVo myShoppingCartVo : goodsList) { |
| | | sum += (myShoppingCartVo.getPoint() * myShoppingCartVo.getNumber()); |
| | | myShoppingCartVo.setEarnSpendingPoints(myShoppingCartVo.getEarnSpendingPoints() * myShoppingCartVo.getNumber()); |
| | | sum += ((null != myShoppingCartVo.getPoint() ? myShoppingCartVo.getPoint() : 0) * myShoppingCartVo.getNumber()); |
| | | myShoppingCartVo.setEarnSpendingPoints((null != myShoppingCartVo.getEarnSpendingPoints() ? myShoppingCartVo.getEarnSpendingPoints() : 0) * myShoppingCartVo.getNumber()); |
| | | } |
| | | confirmOrderVo.setOrderPoint(sum); |
| | | } |
| | |
| | | } |
| | | if(3 == shoppingCartPayment.getPaymentType()){ |
| | | Integer availablePoint = appUser.getAvailablePoint(); |
| | | if(availablePoint < orderPoint){ |
| | | if(availablePoint.compareTo(orderPoint) < 0){ |
| | | return R.fail("账户可用积分不足"); |
| | | } |
| | | } |
| | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "订单优惠活动-获取活动列表", tags = {"管理后台-活动管理"}) |
| | | public R<Page<OrderActivityInfo>> list(@ApiParam("页码") @RequestParam Integer pageNum, |
| | | @ApiParam("每一页数据大小") Integer pageSize, |
| | | OrderActivityInfo orderActivityInfo){ |
| | | @ApiParam("每一页数据大小") Integer pageSize, String id, String activityName, Integer status, Integer isShelf){ |
| | | |
| | | Page<OrderActivityInfo> page = orderActivityInfoService.page(Page.of(pageNum, pageSize), new LambdaQueryWrapper<OrderActivityInfo>() |
| | | .like(orderActivityInfo.getId() != null, OrderActivityInfo::getId, orderActivityInfo.getId()) |
| | | .like(StringUtils.isNotEmpty(orderActivityInfo.getActivityName()), OrderActivityInfo::getActivityName, orderActivityInfo.getActivityName()) |
| | | .gt(orderActivityInfo.getStatus() != null && orderActivityInfo.getStatus() == 0, OrderActivityInfo::getStartTime, LocalDateTime.now()) |
| | | .ge(orderActivityInfo.getStatus() != null && orderActivityInfo.getStatus() == 1, OrderActivityInfo::getEndTime, LocalDateTime.now()) |
| | | .lt(orderActivityInfo.getStatus() != null && orderActivityInfo.getStatus() == 1, OrderActivityInfo::getStartTime, LocalDateTime.now()) |
| | | .lt(orderActivityInfo.getStatus() != null && orderActivityInfo.getStatus() == 2, OrderActivityInfo::getEndTime, LocalDateTime.now()) |
| | | .eq(orderActivityInfo.getIsShelf() != null, OrderActivityInfo::getIsShelf, orderActivityInfo.getIsShelf()).orderByDesc(OrderActivityInfo::getCreateTime) |
| | | .like(StringUtils.isNotEmpty(id), OrderActivityInfo::getId, id) |
| | | .like(StringUtils.isNotEmpty(activityName), OrderActivityInfo::getActivityName, activityName) |
| | | .gt(status != null && status == 0, OrderActivityInfo::getStartTime, LocalDateTime.now()) |
| | | .ge(status != null && status == 1, OrderActivityInfo::getEndTime, LocalDateTime.now()) |
| | | .lt(status != null && status == 1, OrderActivityInfo::getStartTime, LocalDateTime.now()) |
| | | .lt(status != null && status == 2, OrderActivityInfo::getEndTime, LocalDateTime.now()) |
| | | .eq(isShelf != null, OrderActivityInfo::getIsShelf, isShelf).orderByDesc(OrderActivityInfo::getCreateTime) |
| | | .orderByDesc(OrderActivityInfo::getCreateTime)) |
| | | ; |
| | | page.getRecords().forEach(item -> { |
| | |
| | | private RedPackegeSetService redPackegeSetService; |
| | | //获取当前生效的红包设置 |
| | | @ResponseBody |
| | | @GetMapping("/get") |
| | | @PostMapping("/get") |
| | | public R<BigDecimal> get(){ |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | RedPackegeSet one = redPackegeSetService.lambdaQuery().le(RedPackegeSet::getStartTime, now).ge(RedPackegeSet::getEndTime, now).one(); |
| | |
| | | //删除用户门店关系数据 |
| | | AppUserShop appUserShop = new AppUserShop(); |
| | | appUserShop.setShopId(shop.getId()); |
| | | appUserShop.setAppUserId(sysUser.getUserId()); |
| | | appUserShop.setAppUserId(appUser.getId()); |
| | | appUserShopClient.delAppUserShop(appUserShop); |
| | | } |
| | | } |
| | |
| | | singlePay.setReceiverAccountNoEnc(shop.getReceiverAccountNoEnc()); |
| | | singlePay.setReceiverNameEnc(shop.getReceiverNameEnc()); |
| | | singlePay.setReceiverAccountType(shop.getReceiverAccountType()); |
| | | singlePay.setReceiverBankChannelNo(shop.getReceiverBankChannelNo()); |
| | | singlePay.setPaidAmount(shopWithdraw1.getMoney().doubleValue()); |
| | | singlePay.setPaidDesc("账户余额提现"); |
| | | singlePay.setPaidUse("208"); |
| | |
| | | Page<Technician> page = technicianService.lambdaQuery().like(name != null, Technician::getName, name) |
| | | .like(phone != null, Technician::getPhone, phone) |
| | | .eq(Technician::getShopId, sysUser.getObjectId()) |
| | | .eq(Technician::getDelFlag, 0) |
| | | .page(Page.of(pageNum, pageSize)); |
| | | return R.ok(page); |
| | | } |
| | |
| | | SysUser sysUser = sysUserClient.getSysUser(userid).getData(); |
| | | if (technician.getId()==null) { |
| | | technician.setSubscribeStatus(2); |
| | | List<Technician> list = technicianService.lambdaQuery().eq(Technician::getPhone, technician.getPhone()).eq(Technician::getShopId, sysUser.getObjectId()).list(); |
| | | List<Technician> list = technicianService.lambdaQuery() |
| | | .eq(Technician::getPhone, technician.getPhone()) |
| | | .eq(Technician::getShopId, sysUser.getObjectId()) |
| | | .eq(Technician::getDelFlag, 0).list(); |
| | | if (!list.isEmpty()) { |
| | | return R.fail("当前号码已经添加"); |
| | | } |
| | |
| | | appUserShopClient.saveAppUserShop(appUserShop); |
| | | |
| | | }else { |
| | | List<Technician> list = technicianService.lambdaQuery().eq(Technician::getPhone, technician.getPhone()).eq(Technician::getShopId, sysUser.getObjectId()) |
| | | .ne(Technician::getId, technician.getId()).list(); |
| | | if(list.size() > 0){ |
| | | Technician byId = technicianService.getById(technician.getId()); |
| | | if (byId.getPhone()!=technician.getPhone()){ |
| | | List<Technician> list = technicianService.lambdaQuery() |
| | | .eq(Technician::getPhone, technician.getPhone()) |
| | | .eq(Technician::getShopId, sysUser.getObjectId()) |
| | | .ne(Technician::getId, byId.getId()) |
| | | .eq(Technician::getDelFlag, 0).list(); |
| | | if (!list.isEmpty()) { |
| | | return R.fail("当前号码已经添加"); |
| | | } |
| | | R<AppUser> appUserByPhone1 = appUserClient.getAppUserByPhone1(technician.getPhone()); |
| | |
| | | return R.fail("当前号码暂无注册用户"); |
| | | } |
| | | } |
| | | } |
| | | technician.setShopId(sysUser.getObjectId()); |
| | | R<AppUser> appUserByPhone1 = appUserClient.getAppUserByPhone1(technician.getPhone()); |
| | | if (appUserByPhone1.getData()!=null){ |
| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public PageInfo<GoodsVO> goodsList(Goods search) { |
| | | Integer vipId = 0; |
| | |
| | | @Override |
| | | public int compare(GoodsVO o1, GoodsVO o2) { |
| | | if(null != o1.getSellingPrice() && null != o2.getSellingPrice()){ |
| | | return o1.getSellingPrice().compareTo(o2.getSellingPrice()) * (StringUtils.isNotEmpty(search.getIsAsc()) ? -1 : 1); |
| | | return o1.getSellingPrice().compareTo(o2.getSellingPrice()) * ("desc".equals(search.getIsAsc()) ? -1 : 1); |
| | | } |
| | | if(null == o1.getSellingPrice() && null != o2.getSellingPrice()){ |
| | | return BigDecimal.ZERO.compareTo(o2.getSellingPrice()) * (StringUtils.isNotEmpty(search.getIsAsc()) ? -1 : 1); |
| | | return BigDecimal.ZERO.compareTo(o2.getSellingPrice()) * ("desc".equals(search.getIsAsc()) ? -1 : 1); |
| | | } |
| | | if(null != o1.getSellingPrice() && null == o2.getSellingPrice()){ |
| | | return o1.getSellingPrice().compareTo(BigDecimal.ZERO) * (StringUtils.isNotEmpty(search.getIsAsc()) ? -1 : 1); |
| | | return o1.getSellingPrice().compareTo(BigDecimal.ZERO) * ("desc".equals(search.getIsAsc()) ? -1 : 1); |
| | | } |
| | | return 0; |
| | | } |
| | |
| | | @Override |
| | | public List<Goods> getGoodsListByShopId(PageInfo<Goods> pageInfo, Integer shopId) { |
| | | Integer vipId = 0; |
| | | String provinceCode = null; |
| | | String cityCode = null; |
| | | String districtCode = null; |
| | | String provinceCode = "0"; |
| | | String cityCode = "0"; |
| | | String districtCode = "0"; |
| | | String token = SecurityUtils.getToken(ServletUtils.getRequest()); |
| | | if(StringUtils.isNotEmpty(token)){ |
| | | Long userid = tokenService.getLoginUserApplet().getUserid(); |
| | |
| | | queryWrapper.eq(GoodsArea::getProvinceCode, provinceCode); |
| | | } |
| | | if(StringUtils.isNotEmpty(cityCode)){ |
| | | queryWrapper.and(i -> i.eq(GoodsArea::getCityCode, cityCode).or().isNull(GoodsArea::getCityCode)); |
| | | queryWrapper.eq(GoodsArea::getCityCode, cityCode); |
| | | } |
| | | if(StringUtils.isNotEmpty(districtCode)){ |
| | | queryWrapper.and(i -> i.eq(GoodsArea::getDistrictsCode, districtCode).or().isNull(GoodsArea::getDistrictsCode)); |
| | | queryWrapper.eq(GoodsArea::getDistrictsCode, districtCode); |
| | | } |
| | | GoodsArea goodsArea = goodsAreaService.getOne(queryWrapper); |
| | | if(null == goodsArea){ |
| | | if(goodsArea == null){ |
| | | queryWrapper = new LambdaQueryWrapper<GoodsArea>().eq(GoodsArea::getGoodsId, goodsId).eq(GoodsArea::getVip, vip); |
| | | if(StringUtils.isNotEmpty(provinceCode)){ |
| | | queryWrapper.eq(GoodsArea::getProvinceCode, provinceCode); |
| | | } |
| | | if(StringUtils.isNotEmpty(cityCode)){ |
| | | queryWrapper.eq(GoodsArea::getCityCode, cityCode); |
| | | } |
| | | goodsArea = goodsAreaService.getOne(queryWrapper); |
| | | } |
| | | if(goodsArea == null){ |
| | | queryWrapper = new LambdaQueryWrapper<GoodsArea>().eq(GoodsArea::getGoodsId, goodsId).eq(GoodsArea::getVip, vip); |
| | | if(StringUtils.isNotEmpty(provinceCode)){ |
| | | queryWrapper.eq(GoodsArea::getProvinceCode, provinceCode); |
| | | } |
| | | goodsArea = goodsAreaService.getOne(queryWrapper); |
| | | } |
| | | if(null == goodsArea || (null == goodsArea.getCashPayment() && null == goodsArea.getPointPayment())){ |
| | | //没有地区价格,则使用会员价格 |
| | | GoodsVip goodsVip = goodsVipService.getOne(new LambdaQueryWrapper<GoodsVip>().eq(GoodsVip::getGoodsId, goodsId).eq(GoodsVip::getVip, vip)); |
| | | if(null == goodsVip){ |
| | | if(null == goodsVip || (null == goodsVip.getCashPayment() && null == goodsVip.getPointPayment())){ |
| | | //没有配置价格,直接使用原始基础价格 |
| | | return null; |
| | | }else{ |