Merge remote-tracking branch 'origin/master'
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | import com.ruoyi.chargingPile.api.dto.GetSiteListDTO; |
| | | import com.ruoyi.chargingPile.api.feignClient.ParkingLotClient; |
| | | import com.ruoyi.chargingPile.api.model.*; |
| | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.order.api.feignClient.ChargingOrderClient; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import com.ruoyi.other.api.domain.TVip; |
| | | import com.ruoyi.other.api.feignClient.RoleSiteClient; |
| | | import com.ruoyi.other.api.feignClient.UserSiteClient; |
| | | import com.ruoyi.other.api.feignClient.VipClient; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import com.ruoyi.system.api.feignClient.SysUserRoleClient; |
| | |
| | | |
| | | @Resource |
| | | private SysUserRoleClient userRoleClient; |
| | | |
| | | @Resource |
| | | private VipClient vipClient; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | |
| | | /** |
| | |
| | | for (TAccountingStrategyDetail tAccountingStrategyDetail : list) { |
| | | // 当前时间属于那个阶段 取哪个阶段的电价 |
| | | if(LocalTime.now().isAfter(LocalTime.parse(tAccountingStrategyDetail.getStartTime())) && LocalTime.now().isBefore(LocalTime.parse(tAccountingStrategyDetail.getEndTime()))){ |
| | | siteInfoVO.setElectrovalence(tAccountingStrategyDetail.getElectrovalence()); |
| | | siteInfoVO.setElectrovalence(tAccountingStrategyDetail.getElectrovalence().add(tAccountingStrategyDetail.getServiceCharge()).setScale(4, BigDecimal.ROUND_HALF_UP)); |
| | | if(null != byId1.getDiscount()){ |
| | | siteInfoVO.setVipElectrovalence(tAccountingStrategyDetail.getElectrovalence().multiply(byId1.getDiscount()).setScale(4, BigDecimal.ROUND_HALF_UP)); |
| | | siteInfoVO.setVipElectrovalence((tAccountingStrategyDetail.getServiceCharge().multiply(byId1.getDiscount()).add(tAccountingStrategyDetail.getElectrovalence())).setScale(4, BigDecimal.ROUND_HALF_UP)); |
| | | }else{ |
| | | // 获取当前登录用户id |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | // 根据id查询用户信息 |
| | | TAppUser appUser = appUserClient.getUserById(userId).getData(); |
| | | if(Objects.nonNull(appUser)){ |
| | | TVip vip = vipClient.getInfo1(appUser.getVipId()).getData(); |
| | | if(Objects.nonNull(vip) && vip.getType() == 2){ |
| | | siteInfoVO.setVipElectrovalence(vip.getDiscount().divide(new BigDecimal(10)).multiply(tAccountingStrategyDetail.getServiceCharge()).add(tAccountingStrategyDetail.getElectrovalence())); |
| | | }else{ |
| | | siteInfoVO.setVipElectrovalence(tAccountingStrategyDetail.getElectrovalence()); |
| | | } |
| | | }else { |
| | | siteInfoVO.setVipElectrovalence(tAccountingStrategyDetail.getElectrovalence()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | siteInfoVO.setChargingGunId(chargingGun.getId()); |
| | |
| | | and ts.`name` like CONCAT('%', #{query.name}, '%') |
| | | </if> |
| | | <if test="null != query.cityCode and '' != query.cityCode"> |
| | | and ts.cityCode = #{query.cityCode} |
| | | and ts.city_code = #{query.cityCode} |
| | | </if> |
| | | AND ts.del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} |
| | | AND ts.status = ${@com.ruoyi.common.core.enums.status.SiteStatusEnum@NORMAL_USE.getCode()} |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, app_user_id, license_plate, vehicle_color, charging_order_id, parking_lot_id, in_parking_time, out_parking_time, parking_duration, order_amount, status, out_parking_type, create_time |
| | | id, code,app_user_id, license_plate, vehicle_color, charging_order_id, parking_lot_id, in_parking_time, out_parking_time, parking_duration, order_amount, status, out_parking_type, create_time |
| | | </sql> |
| | | <select id="getSum" resultType="java.math.BigDecimal"> |
| | | select sum(timeout_amount) from t_parking_record where in_parking_time >= #{sixBefore} |
| | | </select> |
| | | <select id="pageList" resultType="com.ruoyi.chargingPile.api.vo.TParkingRecordVO"> |
| | | select |
| | | tpr.id, tpr.app_user_id, tpr.license_plate, tpr.vehicle_color, tpr.charging_order_id, tpr.parking_lot_id, tpr.in_parking_time, tpr.out_parking_time, |
| | | tpr.parking_duration, tpr.order_amount, tpr.status, tpr.out_parking_type, tpr.create_time,(tpr.order_amount - tpr.timeout_amount) as parkingFee, |
| | | (tpr.parking_duration - tpr.free_duration) as feeDuration,ts.name as siteName |
| | | tpr.id, tpr.code,tpr.app_user_id, tpr.license_plate, tpr.vehicle_color, tpr.charging_order_id, tpr.parking_lot_id, tpr.in_parking_time, tpr.out_parking_time, |
| | | tpr.parking_duration, tpr.order_amount, tpr.status, tpr.out_parking_type, tpr.create_time,(tpr.order_amount - tpr.timeout_amount) as parkingFee,tpr.timeout_amount, |
| | | tpr.free_duration,(tpr.parking_duration - tpr.free_duration) as feeDuration,ts.name as siteName |
| | | from t_parking_record tpr |
| | | left join t_parking_lot tpl on tpr.parking_lot_id = tpl.id |
| | | left join t_site ts on tpl.site_id = ts.id |
| | |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true), |
| | | @ApiImplicitParam(value = "订单类型(1=充电订单,2=购物订单,3=兑换订单,4=会员订单)", name = "orderType", required = true), |
| | | }) |
| | | public AjaxResult<OrderEvaluateVo> getOrderEvaluate(Integer orderId, Integer orderType){ |
| | | public AjaxResult<OrderEvaluateVo> getOrderEvaluate(String orderId, Integer orderType){ |
| | | OrderEvaluateVo orderEvaluate = orderEvaluateService.getOrderEvaluate(orderId, orderType); |
| | | return AjaxResult.success(orderEvaluate); |
| | | } |
| | |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | OrderEvaluateVo getOrderEvaluate(Integer orderId, Integer orderType); |
| | | OrderEvaluateVo getOrderEvaluate(String orderId, Integer orderType); |
| | | |
| | | List<Map<String, Object>> goodTop(List<Integer> siteIds); |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public OrderEvaluateVo getOrderEvaluate(Integer orderId, Integer orderType) { |
| | | public OrderEvaluateVo getOrderEvaluate(String orderId, Integer orderType) { |
| | | TOrderEvaluate orderEvaluate = this.getOne(new LambdaQueryWrapper<TOrderEvaluate>().eq(TOrderEvaluate::getOrderId, orderId).eq(TOrderEvaluate::getOrderType, orderType)); |
| | | if(null != orderEvaluate){ |
| | | OrderEvaluateVo orderEvaluateVo = new OrderEvaluateVo(); |
| | |
| | | } |
| | | e.setElectricityTariff(orderInvoiceDetailList.get(0).getElectricityTariff()); |
| | | e.setAddedServiceTariff(orderInvoiceDetailList.get(0).getAddedServiceTariff()); |
| | | e.setAddedService(orderInvoiceDetailList.stream().filter(t->t.getAddedService()!=null).map(TOrderInvoiceDetail::getAddedService).reduce(BigDecimal::add).get()); |
| | | e.setElectrovalence(orderInvoiceDetailList.stream().filter(t->t.getElectrovalence()!=null).map(TOrderInvoiceDetail::getElectrovalence).reduce(BigDecimal::add).get()); |
| | | e.setServiceCharge(orderInvoiceDetailList.stream().filter(t->t.getServiceCharge()!=null).map(TOrderInvoiceDetail::getServiceCharge).reduce(BigDecimal::add).get()); |
| | | e.setAddedService(orderInvoiceDetailList.stream().filter(t->t.getOrderInvoiceId().equals(e.getId()) &&t.getAddedService()!=null).map(TOrderInvoiceDetail::getAddedService).reduce(BigDecimal::add).get()); |
| | | e.setElectrovalence(orderInvoiceDetailList.stream().filter(t->t.getOrderInvoiceId().equals(e.getId()) &&t.getElectrovalence()!=null).map(TOrderInvoiceDetail::getElectrovalence).reduce(BigDecimal::add).get()); |
| | | e.setServiceCharge(orderInvoiceDetailList.stream().filter(t->t.getOrderInvoiceId().equals(e.getId()) && t.getServiceCharge()!=null).map(TOrderInvoiceDetail::getServiceCharge).reduce(BigDecimal::add).get()); |
| | | }); |
| | | } |
| | | |