Merge remote-tracking branch 'origin/master'
| | |
| | | return R.fail("根据用户车辆id查询车辆信息失败:"+throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<TAppUserCar> getCarById(String id) { |
| | | return R.fail("根据用户车辆id查询车辆信息失败:"+throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<TAppUserCar> getAppUserCarByLicensePlate(String licensePlate) { |
| | | return R.fail("根据车牌号查询数据失败:" + throwable.getMessage()); |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | |
| | | */ |
| | | @PostMapping(value = "/t-app-user-car/t-app-user-car/getCarByIds") |
| | | public R<List<TAppUserCar>> getCarByIds(@RequestBody List<Long> carIds); |
| | | @PostMapping(value = "/t-app-user-car/t-app-user-car/getCarById/{id}") |
| | | public R<TAppUserCar> getCarById(@PathVariable("id") String id); |
| | | |
| | | |
| | | /** |
| | |
| | | public class ChargingOrderAndUploadRealTimeMonitoringDataDto extends BaseModel { |
| | | |
| | | private String id; |
| | | private Integer index; |
| | | private String transaction_serial_number; // 交易流水号 |
| | | private String charging_pile_code; // 桩编码 |
| | | private String charging_gun_code; // 抢号 |
| | |
| | | @TableField("vip_id") |
| | | private Integer vipId; |
| | | @ApiModelProperty(value = "购买的会员id") |
| | | @TableField("vip_id") |
| | | @TableField("order_amount") |
| | | private BigDecimal orderAmount; |
| | | } |
| | |
| | | * 用户名id |
| | | */ |
| | | private Long userId; |
| | | private String userIdStr; |
| | | |
| | | /** |
| | | * 用户手机号 |
| | |
| | | public R<List<TAppUserCar>> getCarByIds(@RequestBody List<Long> carIds){ |
| | | return R.ok(appUserCarService.list(Wrappers.lambdaQuery(TAppUserCar.class).in(TAppUserCar::getId,carIds))); |
| | | } |
| | | |
| | | @PostMapping(value = "/t-app-user-car/getCarById/{id}") |
| | | public R<TAppUserCar> getCarById(@PathVariable("id")String id){ |
| | | return R.ok(appUserCarService.lambdaQuery().eq(TAppUserCar::getId,id).one()); |
| | | } |
| | | |
| | | /** |
| | | * 根据车牌号查询数据 |
| | |
| | | LoginUserApplet loginUserApplet = new LoginUserApplet(); |
| | | if(ObjectUtils.isNotNull(appUser)){ |
| | | loginUserApplet.setUserId(appUser.getId()); |
| | | loginUserApplet.setUserIdStr(appUser.getId().toString()); |
| | | loginUserApplet.setName(appUser.getName()); |
| | | loginUserApplet.setPhone(appUser.getPhone()); |
| | | loginUserApplet.setAvatar(appUser.getAvatar()); |
| | |
| | | public R<TAccountingStrategyDetail> getDetailByCode(@RequestParam("code") String code){ |
| | | // 查询桩 |
| | | TChargingPile chargingPile = chargingPileService.getOne(Wrappers.lambdaQuery(TChargingPile.class) |
| | | .eq(TChargingPile::getCode,code) |
| | | .eq(TChargingPile::getCode,code).eq(TChargingPile::getDelFlag, 0) |
| | | .last("LIMIT 1")); |
| | | if(Objects.isNull(chargingPile)){ |
| | | return R.fail("未查询到该桩设备"); |
| | | } |
| | | TChargingGun chargingGun = chargingGunService.getOne(Wrappers.lambdaQuery(TChargingGun.class) |
| | | .eq(TChargingGun::getChargingPileId, chargingPile.getId()) |
| | | .eq(TChargingGun::getChargingPileId, chargingPile.getId()).eq(TChargingGun::getDelFlag, 0) |
| | | .last("LIMIT 1")); |
| | | TAccountingStrategy accountingStrategy = accountingStrategyService.getById(chargingGun.getAccountingStrategyId()); |
| | | TAccountingStrategyDetail one; |
| | |
| | | public R<Boolean> checkChargingStrategy(@RequestBody CheckChargingStrategyDTO dto){ |
| | | // 查询桩 |
| | | TChargingPile chargingPile = chargingPileService.getOne(Wrappers.lambdaQuery(TChargingPile.class) |
| | | .eq(TChargingPile::getCode,dto.getCode()) |
| | | .eq(TChargingPile::getCode,dto.getCode()).eq(TChargingPile::getDelFlag, 0) |
| | | .last("LIMIT 1")); |
| | | if(Objects.isNull(chargingPile)){ |
| | | return R.ok(false); |
| | |
| | | public R<List<TAccountingStrategyDetail>> getDetailListByCode(@RequestParam("code") String code){ |
| | | // 查询桩 |
| | | TChargingPile chargingPile = chargingPileService.getOne(Wrappers.lambdaQuery(TChargingPile.class) |
| | | .eq(TChargingPile::getCode,code) |
| | | .eq(TChargingPile::getCode,code).eq(TChargingPile::getDelFlag, 0) |
| | | .last("LIMIT 1")); |
| | | if(Objects.isNull(chargingPile)){ |
| | | return R.fail("未查询到该桩设备"); |
| | | } |
| | | TChargingGun chargingGun = chargingGunService.getOne(Wrappers.lambdaQuery(TChargingGun.class) |
| | | .eq(TChargingGun::getChargingPileId, chargingPile.getId()) |
| | | .eq(TChargingGun::getChargingPileId, chargingPile.getId()).eq(TChargingGun::getDelFlag, 0) |
| | | .last("LIMIT 1")); |
| | | TAccountingStrategy accountingStrategy = accountingStrategyService.getById(chargingGun.getAccountingStrategyId()); |
| | | if(Objects.nonNull(accountingStrategy)){ |
| | |
| | | Site site = this.getById(id); |
| | | site.setAccountingStrategyId(accountingStrategyId); |
| | | this.updateById(site); |
| | | List<TChargingGun> list = chargingGunService.list(new LambdaQueryWrapper<TChargingGun>().in(TChargingGun::getChargingPileId, id).eq(TChargingGun::getDelFlag, 0)); |
| | | List<TChargingGun> list = chargingGunService.list(new LambdaQueryWrapper<TChargingGun>().in(TChargingGun::getSiteId, id).eq(TChargingGun::getDelFlag, 0)); |
| | | for (TChargingGun tChargingGun : list) { |
| | | tChargingGun.setAccountingStrategyId(accountingStrategyId); |
| | | } |
| | |
| | | AND code LIKE concat('%',#{query.code},'%') |
| | | </if> |
| | | <if test="query.licensePlate != null and query.licensePlate != ''"> |
| | | AND licensePlate LIKE concat('%',#{query.licensePlate},'%') |
| | | AND license_plate LIKE concat('%',#{query.licensePlate},'%') |
| | | </if> |
| | | <if test="query.lotIds != null and query.lotIds.size()>0"> |
| | | AND parking_lot_id IN |
| | |
| | | chargingBillRefundExport.setCode(tChargingOrder.getCode()); |
| | | chargingBillRefundExport.setPayTime(tChargingOrder.getCreateTime()!=null?DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",DateUtils.toDate(tChargingOrder.getCreateTime())):""); |
| | | if (tChargingOrder.getRefundTime()!=null){ |
| | | chargingBillRefundExport.setRefundTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",DateUtils.toDate(tChargingOrder.getRefundTime()))); |
| | | chargingBillRefundExport.setRefundTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",DateUtils.toDate(one.getRefundTime()))); |
| | | } |
| | | chargingBillRefundExport.setRefundMoney(one.getRefundAmount().toString()); |
| | | chargingBillRefundExport.setRefundRemark(one.getRefundReason()); |
| | |
| | | chargingOrderInfoVO.setSurplus(byId.getTotalElectricity()!=null?byId.getTotalElectricity().setScale(2, BigDecimal.ROUND_HALF_DOWN)+"":""); |
| | | chargingOrderInfoVO.setTotalPower(byId.getPower()!=null?byId.getPower().setScale(2, BigDecimal.ROUND_HALF_DOWN)+"":""); |
| | | if (byId.getAppUserCarId()!=null){ |
| | | List<TAppUserCar> data = appUserCarClient.getCarByIds(Arrays.asList(byId.getAppUserCarId())).getData(); |
| | | if (!data.isEmpty()){ |
| | | chargingOrderInfoVO.setLicensePlate(data.get(0).getLicensePlate()); |
| | | chargingOrderInfoVO.setVehicleBrand(data.get(0).getVehicleBrand()); |
| | | chargingOrderInfoVO.setVehicleModel(data.get(0).getVehicleModel()); |
| | | chargingOrderInfoVO.setVehicleUse(data.get(0).getVehicleUse()); |
| | | TAppUserCar data = appUserCarClient.getCarById(byId.getAppUserCarId()+"").getData(); |
| | | if (data!=null){ |
| | | chargingOrderInfoVO.setLicensePlate(data.getLicensePlate()); |
| | | chargingOrderInfoVO.setVehicleBrand(data.getVehicleBrand()); |
| | | chargingOrderInfoVO.setVehicleModel(data.getVehicleModel()); |
| | | chargingOrderInfoVO.setVehicleUse(data.getVehicleUse()); |
| | | } |
| | | } |
| | | // 时段总服务费 |
| | |
| | | // } |
| | | // Set<String> strings = map.keySet(); |
| | | |
| | | |
| | | mongoChargingOrderQuery.setPageSize(10); |
| | | List<UploadRealTimeMonitoringData> data1 = uploadRealTimeMonitoringDataClient.getAll(mongoChargingOrderQuery).getData(); |
| | | |
| | | List<ChargingOrderAndUploadRealTimeMonitoringDataDto> dtos = new ArrayList<>(); |
| | | Map<String,ChargingOrderVO> map = new HashMap<>(); |
| | | for (UploadRealTimeMonitoringData uploadRealTimeMonitoringData : data1) { |
| | | ChargingOrderAndUploadRealTimeMonitoringDataDto dataDto = new ChargingOrderAndUploadRealTimeMonitoringDataDto(); |
| | | BeanUtils.copyProperties(uploadRealTimeMonitoringData,dataDto); |
| | | ChargingOrderQuery dto = new ChargingOrderQuery(); |
| | | dto.setCode(uploadRealTimeMonitoringData.getTransaction_serial_number()); |
| | | TCharingOrderVO vo = chargingOrderService.chargingOrder(dto); |
| | |
| | | if (chargingOrderVO != null) { |
| | | BeanUtils.copyProperties(chargingOrderVO, dataDto); |
| | | } |
| | | BeanUtils.copyProperties(uploadRealTimeMonitoringData,dataDto); |
| | | dataDto.setStartTime(uploadRealTimeMonitoringData.getStartTime()); |
| | | dataDto.setEndTime(uploadRealTimeMonitoringData.getEndTime()==null?null:uploadRealTimeMonitoringData.getEndTime()); |
| | | dataDto.setStatus(chargingOrderVO.getStatus()); |
| | | dtos.add(dataDto); |
| | | }else { |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | for (int i = 0; i < dtos.size(); i++) { |
| | | dtos.get(i).setIndex(i); |
| | | } |
| | | |
| | | return R.ok(dtos); |
| | | } |
| | |
| | | BigDecimal vipActivity = new BigDecimal("0"); |
| | | // 赠送会员 |
| | | BigDecimal grantVip = new BigDecimal("0"); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | for (TActivityStatisticslVO tActivityStatisticslVO : list1) { |
| | | TAppUser data = appUserClient.getUserById(tActivityStatisticslVO.getAppUserId()).getData(); |
| | | if (data!=null){ |
| | |
| | | } |
| | | } |
| | | for (TActivityStatisticslVO tActivityStatisticslVO : list) { |
| | | |
| | | // 判断享有了哪些类型 |
| | | switch (tActivityStatisticslVO.getOrderType()){ |
| | | case 1: |
| | |
| | | if (tActivityStatisticslVO.getCouponDiscountAmount()!=null |
| | | && |
| | | (tActivityStatisticslVO.getCouponDiscountAmount().compareTo(BigDecimal.ZERO)>0)){ |
| | | coupon = coupon.add(tActivityStatisticslVO.getCouponDiscountAmount()); |
| | | stringBuilder.append("优惠券抵扣").append("+"); |
| | | } |
| | | if (tActivityStatisticslVO.getVipDiscountAmount()!=null &&(tActivityStatisticslVO.getVipDiscountAmount().compareTo(BigDecimal.ZERO)>0)){ |
| | |
| | | if (tActivityStatisticslVO.getCouponDiscountAmount()!=null |
| | | && |
| | | (tActivityStatisticslVO.getCouponDiscountAmount().compareTo(BigDecimal.ZERO)>0)){ |
| | | coupon = coupon.add(tActivityStatisticslVO.getCouponDiscountAmount()); |
| | | stringBuilder1.append("优惠券抵扣").append("+"); |
| | | } |
| | | if (tActivityStatisticslVO.getVipDiscountAmount()!=null |
| | | && |
| | | (tActivityStatisticslVO.getVipDiscountAmount().compareTo(BigDecimal.ZERO)>0)){ |
| | | discount = discount.add(tActivityStatisticslVO.getVipDiscountAmount()); |
| | | stringBuilder1.append("会员抵扣").append("+"); |
| | | } |
| | | if (stringBuilder1.length()>0){ |
| | |
| | | break; |
| | | case 3: |
| | | // 会员订单 优惠金额大于0 |
| | | if (tActivityStatisticslVO.getVipDiscountAmount()!=null |
| | | && |
| | | (tActivityStatisticslVO.getCouponDiscountAmount().compareTo(BigDecimal.ZERO)>0)){ |
| | | vipActivity = vipActivity.add(tActivityStatisticslVO.getVipDiscountAmount()); |
| | | } |
| | | tActivityStatisticslVO.setType("会员活动"); |
| | | tActivityStatisticslVO.setTime(tActivityStatisticslVO.getCreateTime()); |
| | | break; |
| | | case 4: |
| | | // 赠送会员订单 如果支付金额为0 那么就是后台赠送的会员 |
| | | if (tActivityStatisticslVO.getPaymentAmount().compareTo(BigDecimal.ZERO)==0){ |
| | | grantVip = grantVip.add(tActivityStatisticslVO.getOrderAmount()); |
| | | tActivityStatisticslVO.setType("赠送会员"); |
| | | tActivityStatisticslVO.setTime(tActivityStatisticslVO.getCreateTime()); |
| | | }else{ |
| | | // 赠送 |
| | | grantVip = grantVip.add(tActivityStatisticslVO.getVipDiscountAmount()); |
| | | tActivityStatisticslVO.setType("赠送会员"); |
| | | tActivityStatisticslVO.setTime(tActivityStatisticslVO.getCreateTime()); |
| | | } |
| | |
| | | <!-- 系统模块日志级别控制 --> |
| | | <logger name="com.ruoyi" level="info" /> |
| | | <!-- Spring日志级别控制 --> |
| | | <logger name="org.springframework" level="warn" /> |
| | | <logger name="org.springframework" level="debug" /> |
| | | |
| | | <root level="info"> |
| | | <root level="debug"> |
| | | <appender-ref ref="console" /> |
| | | </root> |
| | | |
| | |
| | | </if> |
| | | and t1.billType = 1 |
| | | and t1.del_flag = 0 |
| | | order by t1.create_time desc |
| | | </select> |
| | | <select id="chargingBillList1" resultType="com.ruoyi.order.api.vo.ChargingBillListVO"> |
| | | select t1.* from t_charging_bill t1 |
| | |
| | | <if test="req.orderType == null or req.orderType == 1"> |
| | | <if test="req.type == null or req.type == 1 or req.type == 2"> |
| | | union all |
| | | select t1.code ,t1.order_amount as orderAmount, |
| | | select |
| | | t1.code , |
| | | t1.order_amount as orderAmount, |
| | | t1.coupon_discount_amount as couponDiscountAmount, |
| | | t1.vip_discount_amount as vipDiscountAmount, |
| | | t1.payment_amount as paymentAmount, |
| | |
| | | AND t1.del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} |
| | | </if> |
| | | </if> |
| | | <if test="req.siteId == null"> |
| | | <if test="req.orderType == null or req.orderType == 2"> |
| | | <if test="req.type == null or req.type == 1 or req.type == 2"> |
| | | union all |
| | |
| | | <if test="req.type == null or req.type == 3"> |
| | | union all |
| | | select t3.code ,t3.order_amount as orderAmount, |
| | | 0 as couponDiscountAmount, |
| | | t3.discount_amount as vipDiscountAmount, |
| | | t3.discount_amount as couponDiscountAmount, |
| | | 0 as vipDiscountAmount, |
| | | t3.payment_amount as paymentAmount, |
| | | t3.create_time as createTime, |
| | | t3.app_user_id as appUserId, |
| | |
| | | <if test="req.orderType == null or req.orderType == 4"> |
| | | <if test="req.type == null or req.type == 4"> |
| | | union all |
| | | select t4.code ,t4.order_amount as orderAmount, |
| | | 0 as couponDiscountAmount, |
| | | t4.discount_amount as vipDiscountAmount, |
| | | t4.payment_amount as paymentAmount, |
| | | t4.create_time as createTime, |
| | | t4.app_user_id as appUserId, |
| | | 4 as orderType |
| | | from t_vip_order t4 |
| | | where 1 = 1 |
| | | and t4.type =2 |
| | | <if test="null != req.code and req.code!=''"> |
| | | and t4.code LIKE CONCAT('%',#{req.code},'%') |
| | | </if> |
| | | <if test="req.type == null "> |
| | | and t4.discount_amount > 0 |
| | | </if> |
| | | <if test="null != req.userIds and req.userIds.size()>0" > |
| | | and t4.app_user_id in |
| | | <foreach collection="req.userIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="req.endTime != null and req.endTime != '' and req.startTime != null and req.startTime != ''"> |
| | | AND (t4.create_time between CONCAT(#{req.startTime},':00') and CONCAT(#{req.endTime},':59')) |
| | | </if> |
| | | and t4.payment_status =2 |
| | | AND t4.del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} |
| | | </if> |
| | | </if> |
| | | <if test="req.orderType == null or req.orderType == 4"> |
| | | <if test="req.type == null or req.type == 4"> |
| | | union all |
| | | select t5.code ,t5.order_amount as orderAmount, |
| | | 0 as couponDiscountAmount, |
| | | 0 as vipDiscountAmount, |
| | |
| | | |
| | | </if> |
| | | </if> |
| | | </if> |
| | | </select> |
| | | |
| | | |