Merge remote-tracking branch 'origin/master'
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime lastOrderTime; |
| | | |
| | | |
| | | public String getIdStr(){ |
| | | return String.valueOf(id); |
| | | } |
| | |
| | | @ApiModelProperty(value = "第三方快递结果") |
| | | @TableField("express_result") |
| | | private String expressResult; |
| | | |
| | | @ApiModelProperty("最新快递信息") |
| | | private String express; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("核销码BASE64") |
| | | private String writeOffCode; |
| | | |
| | | @ApiModelProperty("最新快递信息") |
| | | private String express; |
| | | |
| | | } |
| | |
| | | // throw new ServiceException("对不起,您的账号:" + username + " 已停用"); |
| | | 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()); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.api.model.BalanceChangeRecord; |
| | | import com.ruoyi.account.api.model.UserPoint; |
| | | import com.ruoyi.account.api.model.UserSignRecord; |
| | | import com.ruoyi.account.dto.SignBackRDto; |
| | | import com.ruoyi.account.service.AppUserService; |
| | | import com.ruoyi.account.service.BalanceChangeRecordService; |
| | | import com.ruoyi.account.service.UserPointService; |
| | | import com.ruoyi.account.service.UserSignRecordService; |
| | | import com.ruoyi.common.core.domain.R; |
| | |
| | | |
| | | @Resource |
| | | private UserPointService userPointService; |
| | | @Resource |
| | | private BalanceChangeRecordService balanceChangeRecordService; |
| | | |
| | | |
| | | |
| | |
| | | BigDecimal sum2 = appUser.getBalance().add(bigDecimalR.getData()); |
| | | appUser.setBalance(sum2); |
| | | appUserService.updateById(appUser); |
| | | // 增加一条余额明细 |
| | | BalanceChangeRecord balanceChangeRecord = new BalanceChangeRecord(); |
| | | balanceChangeRecord.setAppUserId(appUser.getId()); |
| | | balanceChangeRecord.setVipId(appUser.getVipId()); |
| | | balanceChangeRecord.setChangeType(3); |
| | | balanceChangeRecord.setBeforeAmount(appUser.getBalance()); |
| | | balanceChangeRecord.setChangeAmount(bigDecimalR.getData()); |
| | | balanceChangeRecord.setAfterAmount(appUser.getBalance().add(bigDecimalR.getData())); |
| | | balanceChangeRecord.setDelFlag(0); |
| | | balanceChangeRecord.setCreateTime(LocalDateTime.now()); |
| | | balanceChangeRecordService.save(balanceChangeRecord); |
| | | SignBackRDto signBackRDto = new SignBackRDto(); |
| | | signBackRDto.setPoint(userSignRecord.getPoint()); |
| | | signBackRDto.setRedAmount(userSignRecord.getRedAmount()); |
| | |
| | | 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"); |
| | |
| | | @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); |
| | | } |
| | |
| | | import com.ruoyi.order.service.RefundPassService; |
| | | import com.ruoyi.order.util.ExpressDeliveryUtil; |
| | | import com.ruoyi.order.util.vo.MapTrackKD100Vo; |
| | | import com.ruoyi.order.util.vo.QueryKD100ListVo; |
| | | import com.ruoyi.order.vo.*; |
| | | import com.ruoyi.other.api.domain.SystemConfig; |
| | | import com.ruoyi.other.api.feignClient.SystemConfigClient; |
| | |
| | | } |
| | | one.setIdStr(one.getId().toString()); |
| | | one.setAddressJson(order.getAddressJson()); |
| | | if(StringUtils.isNotEmpty(one.getExpressResult())){ |
| | | MapTrackKD100Vo mapTrackKD100Vo = JSON.parseObject(one.getExpressResult(), MapTrackKD100Vo.class); |
| | | List<QueryKD100ListVo> data = mapTrackKD100Vo.getData(); |
| | | one.setExpress(data.size() > 0 ? data.get(0).getContext() : ""); |
| | | } |
| | | return R.ok(one); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.order.util.payment.model.RefundCallbackResult; |
| | | import com.ruoyi.order.util.payment.model.RefundResult; |
| | | import com.ruoyi.order.util.vo.MapTrackKD100Vo; |
| | | import com.ruoyi.order.util.vo.QueryKD100ListVo; |
| | | import com.ruoyi.order.util.vo.QueryKD100Vo; |
| | | import com.ruoyi.order.vo.*; |
| | | import com.ruoyi.other.api.domain.*; |
| | |
| | | orderDetailVO.setLongitude(shop.getLongitude()); |
| | | orderDetailVO.setLatitude(shop.getLatitude()); |
| | | orderDetailVO.setShopId(shop.getId()); |
| | | if(StringUtils.isNotEmpty(order.getExpressResult())){ |
| | | MapTrackKD100Vo mapTrackKD100Vo = JSON.parseObject(order.getExpressResult(), MapTrackKD100Vo.class); |
| | | List<QueryKD100ListVo> data = mapTrackKD100Vo.getData(); |
| | | orderDetailVO.setExpress(data.size() > 0 ? data.get(0).getContext() : ""); |
| | | } |
| | | |
| | | if(order.getOrderType() == 1){ |
| | | List<TechnicianSubscribe> data = technicianSubscribeClient.getTechnicianSubscribeList(order.getId()).getData(); |
| | | if(data.size() > 0){ |
| | |
| | | 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); |
| | | |
| | | // 平台分佣 |
| | |
| | | if(Arrays.asList(5, 6, 7).contains(order.getOrderStatus())){ |
| | | return R.fail("无效的操作"); |
| | | } |
| | | if(LocalDateTime.now().isAfter(order.getAfterSaleTime())){ |
| | | if(null != order.getAfterSaleTime() && LocalDateTime.now().isAfter(order.getAfterSaleTime())){ |
| | | return R.fail("订单取消失败"); |
| | | } |
| | | order.setOrderStatus(5); |
| | |
| | | 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"); |
| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @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 int compare(GoodsVO o1, GoodsVO o2) { |
| | | if(null != o1.getIntegral() && null != o2.getIntegral()){ |
| | | return o1.getIntegral().compareTo(o2.getIntegral()) * (StringUtils.isNotEmpty(search.getIsAsc()) ? -1 : 1); |
| | | return o1.getIntegral().compareTo(o2.getIntegral()) * ("desc".equals(search.getIsAsc()) ? -1 : 1); |
| | | } |
| | | if(null == o1.getIntegral() && null != o2.getIntegral()){ |
| | | return Integer.valueOf(0).compareTo(o2.getIntegral()) * (StringUtils.isNotEmpty(search.getIsAsc()) ? -1 : 1); |
| | | return Integer.valueOf(0).compareTo(o2.getIntegral()) * ("desc".equals(search.getIsAsc()) ? -1 : 1); |
| | | } |
| | | if(null != o1.getIntegral() && null == o2.getIntegral()){ |
| | | return o1.getIntegral().compareTo(Integer.valueOf(0)) * (StringUtils.isNotEmpty(search.getIsAsc()) ? -1 : 1); |
| | | return o1.getIntegral().compareTo(Integer.valueOf(0)) * ("desc".equals(search.getIsAsc()) ? -1 : 1); |
| | | } |
| | | return 0; |
| | | } |
| | |
| | | list.sort(new Comparator<GoodsVO>() { |
| | | @Override |
| | | public int compare(GoodsVO o1, GoodsVO o2) { |
| | | return o1.getSaleNum().compareTo(o2.getSaleNum()) * (StringUtils.isNotEmpty(search.getIsAsc()) ? -1 : 1); |
| | | return o1.getSaleNum().compareTo(o2.getSaleNum()) * ("desc".equals(search.getIsAsc()) ? -1 : 1); |
| | | } |
| | | }); |
| | | } |
| | |
| | | @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{ |