| | |
| | | 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.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.feignClient.BalanceChangeRecordClient; |
| | | import com.ruoyi.account.api.feignClient.UserCouponClient; |
| | | import com.ruoyi.account.api.feignClient.UserPointClient; |
| | | import com.ruoyi.account.api.feignClient.*; |
| | | import com.ruoyi.account.api.model.*; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | |
| | | private UserPointClient userPointClient; |
| | | |
| | | @Resource |
| | | private PointSettingClient pointSettingClient; |
| | | |
| | | @Resource |
| | | private OrderBalancePaymentService orderBalancePaymentService; |
| | | |
| | | @Resource |
| | |
| | | |
| | | @Resource |
| | | private UserCouponClient userCouponClient; |
| | | |
| | | @Resource |
| | | private UserChangeLogClient userChangeLogClient; |
| | | |
| | | |
| | | |
| | |
| | | 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() : ""); |
| | | orderDetailVO.setExpress(null != data && data.size() > 0 ? data.get(0).getContext() : ""); |
| | | } |
| | | |
| | | if(order.getOrderType() == 1){ |
| | |
| | | if(StringUtils.isNotEmpty(technicianId) && !"null".equals(technicianId)){ |
| | | order.setTechnicianId(Integer.valueOf(technicianId)); |
| | | } |
| | | // TODO |
| | | orderMapper.updateById(order); |
| | | } |
| | | |
| | |
| | | } |
| | | appUser.setTotalPoint(appUser.getTotalPoint() - shopPoint); |
| | | |
| | | boolean vipDemotion = vipDemotion(appUser.getShopPoint(), appUser.getVipId()); |
| | | if(vipDemotion){ |
| | | appUser.setVipId(appUser.getVipId() - 1); |
| | | } |
| | | |
| | | //构建积分流水明细 |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(1); |
| | |
| | | userPoint.setObjectId(order.getId()); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | appUserClient.editAppUserById(appUser); |
| | | |
| | | //降级检测 |
| | | boolean vipDemotion = vipDemotion(appUser.getShopPoint(), appUser.getVipId()); |
| | | if(vipDemotion){ |
| | | appUserClient.vipDemotion(appUser.getId()); |
| | | } |
| | | //回退优惠券状态 |
| | | if(null != order.getUserCouponId()){ |
| | | UserCoupon userCoupon = userCouponClient.getUserCoupon(order.getUserCouponId()).getData(); |
| | |
| | | } |
| | | appUser.setTotalPoint(appUser.getTotalPoint() - shopPoint); |
| | | |
| | | boolean vipDemotion = vipDemotion(appUser.getShopPoint(), appUser.getVipId()); |
| | | if(vipDemotion){ |
| | | appUser.setVipId(appUser.getVipId() - 1); |
| | | } |
| | | |
| | | //构建积分流水明细 |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(1); |
| | |
| | | userPoint.setObjectId(order.getId()); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | appUserClient.editAppUserById(appUser); |
| | | |
| | | //降级检测 |
| | | boolean vipDemotion = vipDemotion(appUser.getShopPoint(), appUser.getVipId()); |
| | | if(vipDemotion){ |
| | | appUserClient.vipDemotion(appUser.getId()); |
| | | } |
| | | |
| | | //回退优惠券状态 |
| | | if(null != order.getUserCouponId()){ |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Integer getGoodsSaleNum(Integer goodsId, Integer type) { |
| | | return this.baseMapper.getGoodsSaleNum(goodsId, type); |
| | | public Integer getGoodsSaleNum(Integer goodsId, Integer type, Long userId) { |
| | | return this.baseMapper.getGoodsSaleNum(goodsId, type, userId); |
| | | } |
| | | |
| | | |