| | |
| | | import cc.mrbird.febs.mall.entity.*; |
| | | import cc.mrbird.febs.mall.mapper.*; |
| | | import cc.mrbird.febs.mall.service.*; |
| | | import cc.mrbird.febs.mall.vo.ApiShopApplyVo; |
| | | import cc.mrbird.febs.mall.vo.OrderDetailVo; |
| | | import cc.mrbird.febs.mall.vo.OrderListVo; |
| | | import cc.mrbird.febs.mall.vo.OrderRefundVo; |
| | | import cc.mrbird.febs.mall.vo.*; |
| | | import cc.mrbird.febs.pay.model.AgreementPayDto; |
| | | import cc.mrbird.febs.pay.model.AgreementSignDto; |
| | | import cc.mrbird.febs.pay.model.UnipayDto; |
| | |
| | | throw new FebsException(goods.getGoodsName() + "已下架"); |
| | | } |
| | | /** |
| | | * 存在未支付的订单无法下单 |
| | | */ |
| | | Integer orderIng = this.baseMapper.selectOrderInfoByStatusAndMemberId(OrderStatusEnum.FINISH.getValue(), mallMember.getId()); |
| | | if(1 <= orderIng){ |
| | | throw new FebsException("请先完成未完成的订单"); |
| | | } |
| | | |
| | | /** |
| | | * 会员一天最多下单次数 |
| | | */ |
| | | DataDictionaryCustom buyTimesDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | |
| | | orderItem.setOrderId(orderInfo.getId()); |
| | | orderItem.setPrice(sku.getPresentPrice()); |
| | | orderItem.setGoodsId(sku.getGoodsId()); |
| | | orderItem.setGoodsName(sku.getGoodsName()); |
| | | orderItem.setGoodsName(goods.getGoodsName()); |
| | | orderItem.setSkuId(sku.getId()); |
| | | orderItem.setStyleName(sku.getStyleName()); |
| | | orderItem.setSkuName(sku.getSkuName()); |
| | |
| | | sku.setSkuVolume(sku.getSkuVolume() + 1); |
| | | mallGoodsSkuMapper.updateById(sku); |
| | | |
| | | if (addOrderDto.getType() == 1) { |
| | | if (1 == addOrderDto.getType() ) { |
| | | mallShoppingCartMapper.delBySkuId(sku.getId(), member.getId()); |
| | | } |
| | | mallOrderItemMapper.insert(orderItem); |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse subsidyAmountInfo() { |
| | | MallMember member = LoginUserUtil.getLoginUser(); |
| | | ApiMallSubsidyAmountInfoVo apiMallSubsidyAmountInfoVo = new ApiMallSubsidyAmountInfoVo(); |
| | | DateTime today = DateUtil.date(); |
| | | DateTime yesterday = DateUtil.yesterday(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String yyyyMMddToday = sdf.format(today); |
| | | String yyyyMMddYesterday = sdf.format(yesterday); |
| | | //今日补贴 |
| | | BigDecimal todayAmount = this.baseMapper.selectTodayAmountByCreateTimeAndMemberId(yyyyMMddToday,member.getId()); |
| | | apiMallSubsidyAmountInfoVo.setTodayAmount(todayAmount); |
| | | //今日累计接单 |
| | | Integer todayTotalCnt = this.baseMapper.selectCountByCreateTimeAndMemberId(yyyyMMddToday,member.getId()); |
| | | apiMallSubsidyAmountInfoVo.setTodayTotalCnt(todayTotalCnt); |
| | | //昨日补贴 |
| | | BigDecimal yesterdayAmount = this.baseMapper.selectTodayAmountByCreateTimeAndMemberId(yyyyMMddYesterday,member.getId()); |
| | | apiMallSubsidyAmountInfoVo.setYesterdayAmount(yesterdayAmount); |
| | | //昨日累计接单 |
| | | Integer totalYesterdayCnt = this.baseMapper.selectCountByCreateTimeAndMemberId(yyyyMMddYesterday,member.getId()); |
| | | apiMallSubsidyAmountInfoVo.setTotalYesterdayCnt(totalYesterdayCnt); |
| | | //获得总额 |
| | | BigDecimal totalAmount = this.baseMapper.selectTodayAmountByCreateTimeAndMemberId(null,member.getId()); |
| | | apiMallSubsidyAmountInfoVo.setTotalAmount(totalAmount); |
| | | return new FebsResponse().success().data(apiMallSubsidyAmountInfoVo); |
| | | } |
| | | |
| | | } |