| | |
| | | homeResponse.setIsStopServe(this.checkTemporaryStop()?1:0); |
| | | homeResponse.setIsBusiness(this.checkBusiness()?0:1); |
| | | homeResponse.setUnBusinessTips("营业时间为"+ systemDictDataBiz.queryByCode(Constants.MINI_PROGRAMME,Constants.BUSINESS_STARTTIME).getCode() +" ~ "+systemDictDataBiz.queryByCode(Constants.MINI_PROGRAMME,Constants.BUSINESS_ENDTIME).getCode()+",请在营业时间内使用本系统"); |
| | | homeResponse.setEleBusinessArea(systemDictDataBiz.queryByCode(Constants.MINI_PROGRAMME,Constants.PARK_LAT_LNG_LIST).getCode()); |
| | | |
| | | homeResponse.setAdList(adMapper.selectList(new QueryWrapper<Ad>() |
| | | .eq("isdeleted",Constants.ZERO) |
| | |
| | | Goodsorder goodsorder = this.goodsorderMapper.selectOne(new QueryWrapper<Goodsorder>() |
| | | .eq("member_id",memberId) |
| | | .eq("status",Constants.goodsorderStatus.pay) |
| | | .eq("type",0) |
| | | .last(" limit 1 ")); |
| | | homeResponse.setDepositStatus(Constants.ZERO); |
| | | if(goodsorder!=null){ |
| | |
| | | update.setCloseDate(new Date()); |
| | | update.setCloseInfo(Constants.REFUND_TYPE.get(type).getInfo()); |
| | | update.setCloseUserId(goodsorder.getEditor()); |
| | | update.setType(Constants.ZERO); |
| | | if(Constants.REFUND_TYPE.PLAT_FORCE.getKey() == type){ |
| | | //如果是强制结算 |
| | | update.setCloseType(Constants.ONE); |
| | |
| | | if(discountMember.getSurplusTime() >= durationSum){ |
| | | discountLog.setRideTime(durationSum); |
| | | discountLog.setRidePrice(closeMoney); |
| | | discountLogMapper.insert(discountLog); |
| | | topRides.setActualPrice(BigDecimal.ZERO); |
| | | closeMoney = BigDecimal.ZERO; |
| | | }else{ |
| | |
| | | qry.setStatus(Constants.goodsorderStatus.pay); |
| | | qry.setMemberId(memberId); |
| | | qry.setIsdeleted(Constants.ZERO); |
| | | qry.setType(Constants.ZERO); |
| | | if(goodsorderMapper.selectCount(new QueryWrapper<>(qry))>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"已支付过定金,无法重复该操作"); |
| | | } |
| | |
| | | * 获取当前可使用的套餐 |
| | | * @param memberId |
| | | */ |
| | | @Override |
| | | public DiscountMember getUseDiscount(String memberId,Integer driveTime){ |
| | | String today = DateUtil.getToday(); |
| | | //判断今天是否为节假日 |
| | |
| | | Integer holiday = holidaysMapper.selectCount(new QueryWrapper<>(holidays))>0?1:0; |
| | | List<DiscountMember> discountMemberList = discountMemberMapper.selectJoinList(DiscountMember.class,new MPJLambdaWrapper<DiscountMember>() |
| | | .selectAll(DiscountMember.class) |
| | | .select(" select sum(d.ride_time) from discount_log d where and d.discount_member_id = discount_member.id " + |
| | | "and d.isdeleted = 0 and d.type = 0 and EXTRACT(DAY FROM d.create_date) = EXTRACT(DAY FROM CURRENT_DATE) " , DiscountMember::getUseTime)//查询今日已使用时间 |
| | | .select(" ( select sum(d.ride_time) from discount_log d where d.discount_member_id = t.id " + |
| | | "and d.isdeleted = 0 and d.type = 0 and EXTRACT(DAY FROM d.create_date) = EXTRACT(DAY FROM CURRENT_DATE) ) " , DiscountMember::getUseTime)//查询今日已使用时间 |
| | | .eq(DiscountMember::getStatus,Constants.ZERO) |
| | | .eq(DiscountMember::getMemberId,memberId) |
| | | .ge(DiscountMember::getUseStartDate, Utils.Date.getStart(DateUtil.stringToDate(today,"yyyy-MM-dd"))) |
| | | .le(DiscountMember::getUseEndDate, Utils.Date.getEnd(DateUtil.stringToDate(today,"yyyy-MM-dd"))) |
| | | .le(DiscountMember::getUseStartDate, Utils.Date.getStart(DateUtil.stringToDate(today,"yyyy-MM-dd"))) |
| | | .ge(DiscountMember::getUseEndDate, Utils.Date.getEnd(DateUtil.stringToDate(today,"yyyy-MM-dd"))) |
| | | .eq(Constants.equalsInteger(holiday,Constants.ONE),DiscountMember::getUseHoliday,Constants.ONE) |
| | | .orderByDesc(DiscountMember::getLimitType) |
| | | .orderByDesc(DiscountMember::getLimitTime) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | public void autCancel(){ |
| | | goodsorderMapper.update(null,new UpdateWrapper<Goodsorder>().lambda() |
| | | .set(Goodsorder::getStatus,Constants.GOODSORDER_STATUS.CANCEL.getKey()) |
| | | .set(Goodsorder::getEditDate,DateUtil.getCurrDateTime()) |
| | | .eq(Goodsorder::getStatus,Constants.GOODSORDER_STATUS.UN_PAY.getKey()) |
| | | .apply(" NOW() >= create_date + INTERVAL '30 min' ") |
| | | ); |
| | | } |
| | | |
| | | } |