Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<BigDecimal> getRecordAmount(LocalDate sixBefore) { |
| | | public R<BigDecimal> getRecordAmount(String sixBefore) { |
| | | return null; |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public R<List<GetSiteListDTO>> getSiteListByUserId(Long userId) { |
| | | return null; |
| | | return R.fail("获取数据失败"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | R<TParkingRecord> getRecordById(@RequestParam("id") Long siteId); |
| | | |
| | | @PostMapping(value = "/t-parking-lot/getRecordAmount") |
| | | R<BigDecimal> getRecordAmount(@RequestParam("sixBefore") LocalDate sixBefore); |
| | | R<BigDecimal> getRecordAmount(@RequestParam("sixBefore") String sixBefore); |
| | | |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/getSiteListPaging") |
| | | public PageInfo<Site> getSiteListPaging(@RequestParam("PageNo") Integer PageNo, @RequestParam("PageSize") Integer PageSize, @RequestParam("ids") List<String> ids){ |
| | | public PageInfo<Site> getSiteListPaging(@RequestParam("PageNo") Integer PageNo, @RequestParam("PageSize") Integer PageSize, |
| | | @RequestParam("ids") List<String> ids){ |
| | | PageInfo<Site> pageInfo = new PageInfo<>(PageNo, PageSize); |
| | | PageInfo<Site> page = siteService.lambdaQuery().eq(Site::getStatus, 1).in(ids.size() > 0, Site::getId, ids).page(pageInfo); |
| | | return page; |
| | |
| | | TChargingGun tChargingGun1 = new TChargingGun(); |
| | | if(Arrays.asList(1, 2, 5).contains(chargingOrder.getStatus())){ |
| | | tChargingGun1.setStatus(3); |
| | | tChargingGun1.setId(tChargingGun.getId()); |
| | | chargingGunService.updateById(tChargingGun1); |
| | | } |
| | | if(Arrays.asList(3).contains(chargingOrder.getStatus())){ |
| | | tChargingGun1.setStatus(4); |
| | | tChargingGun1.setId(tChargingGun.getId()); |
| | | chargingGunService.updateById(tChargingGun1); |
| | | } |
| | | if(Arrays.asList(4).contains(chargingOrder.getStatus()) && chargingOrder.getEndMode() == 2){ |
| | | tChargingGun1.setStatus(5); |
| | | } |
| | | tChargingGun1.setId(tChargingGun.getId()); |
| | | chargingGunService.updateById(tChargingGun1); |
| | | |
| | | } |
| | | //推送状态给三方平台 |
| | | tcecClient.pushChargingGunStatus(tChargingGun.getFullNumber(), tChargingGun1.getStatus()); |
| | | }else{ |
| | |
| | | |
| | | |
| | | @PostMapping(value = "/getRecordAmount") |
| | | public R<BigDecimal> getRecordAmount(@RequestParam("sixBefore") LocalDate sixBefore){ |
| | | public R<BigDecimal> getRecordAmount(@RequestParam("sixBefore") String sixBefore){ |
| | | BigDecimal sum = parkingRecordService.getSum(sixBefore); |
| | | return R.ok(sum); |
| | | } |
| | |
| | | */ |
| | | public interface TParkingRecordMapper extends BaseMapper<TParkingRecord> { |
| | | |
| | | BigDecimal getSum(@Param("sixBefore") LocalDate sixBefore); |
| | | BigDecimal getSum(@Param("sixBefore") String sixBefore); |
| | | |
| | | /** |
| | | * 停车缴费订单列表 |
| | |
| | | */ |
| | | public interface TParkingRecordService extends IService<TParkingRecord> { |
| | | |
| | | BigDecimal getSum(LocalDate sixBefore); |
| | | BigDecimal getSum(String sixBefore); |
| | | |
| | | /** |
| | | * 停车缴费订单列表 |
| | |
| | | private SiteClient siteClient; |
| | | |
| | | @Override |
| | | public BigDecimal getSum(LocalDate sixBefore) { |
| | | public BigDecimal getSum(String sixBefore) { |
| | | return this.baseMapper.getSum(sixBefore); |
| | | } |
| | | |
| | |
| | | @GetMapping(value = "/pay/order/charging/details") |
| | | @ApiOperation(value = "充电明细", tags = {"管理后台-支付订单-订单信息"}) |
| | | public R<List<TChargingOrderAccountingStrategy>> chargingDetail(Long orderId) { |
| | | List<TChargingOrderAccountingStrategy> list = chargingOrderAccountingStrategyService.lambdaQuery().eq(TChargingOrderAccountingStrategy::getChargingOrderId, orderId).orderByDesc(TChargingOrderAccountingStrategy::getStartTime).list(); |
| | | TChargingOrder chargingOrder = chargingOrderService.getById(orderId); |
| | | List<TChargingOrderAccountingStrategy> list = chargingOrderAccountingStrategyService.lambdaQuery().eq(TChargingOrderAccountingStrategy::getChargingOrderId, orderId) |
| | | .orderByDesc(TChargingOrderAccountingStrategy::getStartTime).list(); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | for (TChargingOrderAccountingStrategy tChargingOrderAccountingStrategy : list) { |
| | | String format = tChargingOrderAccountingStrategy.getCreateTime().format(formatter); |
| | | LocalDateTime createTime = chargingOrder.getStartTime(); |
| | | String format = createTime.format(formatter); |
| | | String startTime = tChargingOrderAccountingStrategy.getStartTime(); |
| | | if("00:00".equals(startTime)){ |
| | | createTime = createTime.plusDays(1); |
| | | format = createTime.format(formatter); |
| | | } |
| | | tChargingOrderAccountingStrategy.setStartTime(format+" "+tChargingOrderAccountingStrategy.getStartTime()); |
| | | tChargingOrderAccountingStrategy.setEndTime(format+" "+tChargingOrderAccountingStrategy.getEndTime()); |
| | | } |
| | | |
| | | |
| | | //从新排序 |
| | | list.sort(new Comparator<TChargingOrderAccountingStrategy>() { |
| | | @Override |
| | | public int compare(TChargingOrderAccountingStrategy o1, TChargingOrderAccountingStrategy o2) { |
| | | String startTime = o1.getStartTime(); |
| | | String startTime1 = o2.getStartTime(); |
| | | LocalDateTime localDateTime = LocalDateTime.parse(startTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")); |
| | | LocalDateTime localDateTime1 = LocalDateTime.parse(startTime1, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")); |
| | | if(localDateTime.isBefore(localDateTime1)){ |
| | | return -1; |
| | | } |
| | | if(localDateTime.isAfter(localDateTime1)){ |
| | | return 1; |
| | | } |
| | | return 0; |
| | | } |
| | | }); |
| | | return R.ok(list); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | ; |
| | | System.err.println(Integer.parseInt("01")); |
| | | System.err.println(Integer.valueOf("01")); |
| | | ; |
| | | } |
| | | @RequiresPermissions(value = {"/chargingPileOrder/monitoring_record"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping(value = "/chargingOrderInfo") |
| | |
| | | List<TChargingOrderAccountingStrategy> list = chargingOrderAccountingStrategyService.lambdaQuery().eq(TChargingOrderAccountingStrategy::getChargingOrderId, strategyId).orderByDesc(TChargingOrderAccountingStrategy::getStartTime).list(); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | for (TChargingOrderAccountingStrategy tChargingOrderAccountingStrategy : list) { |
| | | String format = ""; |
| | | String format1 = ""; |
| | | // String temp1=list.get(0).getStartTime().split(":")[0]; |
| | | System.err.println("订单详情时间第一条"+list.get(0).getStartTime()); |
| | | System.err.println("订单详情时间开始"+tChargingOrderAccountingStrategy.getStartTime()); |
| | | System.err.println("订单详情时间结束"+tChargingOrderAccountingStrategy.getEndTime()); |
| | | String temp1=list.get(0).getStartTime().split(" ")[1].split(":")[0]; |
| | | String[] split = tChargingOrderAccountingStrategy.getStartTime().split(" ")[1].split(":"); |
| | | if (Integer.parseInt(split[0])>=Integer.parseInt(temp1)){ |
| | | format = byId.getCreateTime().format(formatter); |
| | | }else { |
| | | format = byId.getEndTime().format(formatter); |
| | | } |
| | | String[] split1 = tChargingOrderAccountingStrategy.getEndTime().split(" ")[1].split(":"); |
| | | if (Integer.parseInt(split1[0])<Integer.parseInt(temp1)){ |
| | | format1 = byId.getCreateTime().format(formatter); |
| | | }else { |
| | | format1 = byId.getEndTime().format(formatter); |
| | | LocalDateTime createTime = byId.getStartTime(); |
| | | String format = createTime.format(formatter); |
| | | String startTime = tChargingOrderAccountingStrategy.getStartTime(); |
| | | if("00:00".equals(startTime)){ |
| | | createTime = createTime.plusDays(1); |
| | | format = createTime.format(formatter); |
| | | } |
| | | tChargingOrderAccountingStrategy.setStartTime(format+" "+tChargingOrderAccountingStrategy.getStartTime()); |
| | | tChargingOrderAccountingStrategy.setEndTime(format1+" "+tChargingOrderAccountingStrategy.getEndTime()); |
| | | tChargingOrderAccountingStrategy.setEndTime(format+" "+tChargingOrderAccountingStrategy.getEndTime()); |
| | | if (byId.getVipDiscountAmount()!=null && byId.getServiceCharge().compareTo(BigDecimal.ZERO) != 0){ |
| | | BigDecimal multiply = byId.getVipDiscountAmount().divide(byId.getServiceCharge(), 2) |
| | | .multiply(tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice()); |
| | |
| | | tChargingOrderAccountingStrategy.setCouponDiscount(multiply); |
| | | } |
| | | } |
| | | //从新排序 |
| | | list.sort(new Comparator<TChargingOrderAccountingStrategy>() { |
| | | @Override |
| | | public int compare(TChargingOrderAccountingStrategy o1, TChargingOrderAccountingStrategy o2) { |
| | | String startTime = o1.getStartTime(); |
| | | String startTime1 = o2.getStartTime(); |
| | | LocalDateTime localDateTime = LocalDateTime.parse(startTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")); |
| | | LocalDateTime localDateTime1 = LocalDateTime.parse(startTime1, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")); |
| | | if(localDateTime.isBefore(localDateTime1)){ |
| | | return -1; |
| | | } |
| | | if(localDateTime.isAfter(localDateTime1)){ |
| | | return 1; |
| | | } |
| | | return 0; |
| | | } |
| | | }); |
| | | chargingOrderInfoVO.setList(list); |
| | | return AjaxResult.success(chargingOrderInfoVO); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/platformRevenueAnalysis"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping(value = "/six/total") |
| | |
| | | siteIds.add(-1); |
| | | } |
| | | Map<String,Object> map = chargingOrderService.countAll(sixBefore,siteIds); |
| | | BigDecimal data = parkingLotClient.getRecordAmount(sixBefore).getData(); |
| | | BigDecimal data = parkingLotClient.getRecordAmount(sixBefore.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))).getData(); |
| | | if (map ==null){ |
| | | map = new HashMap<String,Object>(); |
| | | } |
| | |
| | | </select> |
| | | <select id="payOrderQuery" resultType="com.ruoyi.order.dto.PayOrderDto"> |
| | | SELECT o.*,i.phone FROM (SELECT |
| | | id, |
| | | `code`, |
| | | a.id, |
| | | a.`code`, |
| | | 1 as type, |
| | | title, |
| | | `status`, |
| | | recharge_amount as order_amount, |
| | | recharge_amount as payment_amount , |
| | | create_time, |
| | | end_time, |
| | | pay_time, |
| | | refund_status, |
| | | (recharge_amount-refund_amount) as final_amount, |
| | | del_flag, |
| | | app_user_id |
| | | a.title, |
| | | a.`status`, |
| | | a.recharge_amount as order_amount, |
| | | a.recharge_amount as payment_amount , |
| | | a.create_time, |
| | | a.end_time, |
| | | a.pay_time, |
| | | b.refund_status as refund_status, |
| | | (a.recharge_amount-a.refund_amount) as final_amount, |
| | | a.del_flag, |
| | | a.app_user_id |
| | | FROM |
| | | charging_pile_order.t_charging_order |
| | | where recharge_payment_status = 2 |
| | | charging_pile_order.t_charging_order a |
| | | left join charging_pile_order.t_charging_order_refund b on (b.charging_order_id = a.id) |
| | | where a.recharge_payment_status = 2 |
| | | UNION ALL |
| | | SELECT |
| | | id, |
| | | `code`, |
| | | a.id, |
| | | a.`code`, |
| | | 2 as type, |
| | | title, |
| | | `status`, |
| | | order_amount, |
| | | payment_amount , |
| | | create_time, |
| | | receiving_time as end_time, |
| | | pay_time, |
| | | refund_status, |
| | | (payment_amount-refund_amount) as final_amount, |
| | | del_flag, |
| | | app_user_id |
| | | a.title, |
| | | a.`status`, |
| | | a.order_amount, |
| | | a.payment_amount , |
| | | a.create_time, |
| | | a.receiving_time as end_time, |
| | | a.pay_time, |
| | | b.refund_status as refund_status, |
| | | (a.payment_amount-a.refund_amount) as final_amount, |
| | | a.del_flag, |
| | | a.app_user_id |
| | | FROM |
| | | charging_pile_order.t_shopping_order |
| | | where payment_status = 2 |
| | | charging_pile_order.t_shopping_order a |
| | | left join charging_pile_order.t_shopping_order_refund b on (b.shopping_order_id = a.id) |
| | | where a.payment_status = 2 |
| | | UNION ALL |
| | | SELECT |
| | | id, |
| | | `code`, |
| | | a.id, |
| | | a.`code`, |
| | | 3 as type, |
| | | title, |
| | | payment_status AS `status`, |
| | | order_amount, |
| | | payment_amount , |
| | | create_time, |
| | | create_time as end_time, |
| | | pay_time, |
| | | refund_status, |
| | | (payment_amount-refund_amount) as final_amount, |
| | | del_flag, |
| | | app_user_id |
| | | |
| | | a.title, |
| | | a.payment_status AS `status`, |
| | | a.order_amount, |
| | | a.payment_amount , |
| | | a.create_time, |
| | | a.create_time as end_time, |
| | | a.pay_time, |
| | | b.refund_status as refund_status, |
| | | (a.payment_amount-a.refund_amount) as final_amount, |
| | | a.del_flag, |
| | | a.app_user_id |
| | | FROM |
| | | charging_pile_order.t_vip_order |
| | | where payment_status = 2 |
| | | charging_pile_order.t_vip_order a |
| | | left join charging_pile_order.t_vip_order_refund b on (a.id = b.vip_order_id) |
| | | where a.payment_status = 2 |
| | | UNION ALL |
| | | SELECT |
| | | id, |
| | |
| | | <select id="circle" resultType="com.ruoyi.order.dto.SixCircleDto"> |
| | | SELECT |
| | | site_id as siteId, |
| | | |
| | | SUM( |
| | | CASE |
| | | WHEN order_source = 0 THEN payment_amount |
| | |
| | | AND create_time >= #{sixBefore} |
| | | </if> |
| | | </where> |
| | | GROUP BY |
| | | site_id |
| | | GROUP BY site_id |
| | | |
| | | |
| | | </select> |
| | |
| | | //import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | //import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | //import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | //import com.ruoyi.common.core.web.page.PageInfo; |
| | | //import com.ruoyi.common.redis.service.RedisService; |
| | | //import com.ruoyi.common.security.service.TokenService; |
| | | //import com.ruoyi.integration.api.feignClient.*; |
| | |
| | | //import com.ruoyi.order.api.vo.TransactionRecordMessageVO; |
| | | //import com.ruoyi.order.dto.ChargingDetails; |
| | | //import com.ruoyi.order.dto.MyChargingOrderInfo; |
| | | //import com.ruoyi.order.dto.PayOrderDto; |
| | | //import com.ruoyi.order.dto.PayOrderQueryDto; |
| | | //import com.ruoyi.order.mapper.TSettlementConfirmMapper; |
| | | //import com.ruoyi.order.service.*; |
| | | //import com.ruoyi.order.vo.EndOfChargePageInfo; |
| | |
| | | // |
| | | // @Test |
| | | // public void test(){ |
| | | // TransactionRecordMessageVO vo = JSON.parseObject("{\n" + |
| | | // "\t\"charging_gun_code\": \"01\",\n" + |
| | | // "\t\"charging_pile_code\": \"2024123100001005\",\n" + |
| | | // "\t\"end_time\": \"2025-03-04 00:00:43.00\",\n" + |
| | | // "\t\"flat_amount2\": 0.000000,\n" + |
| | | // "\t\"flat_amount4\": 0.000000,\n" + |
| | | // "\t\"flat_amount6\": 2.350000,\n" + |
| | | // "\t\"flat_charge2\": 0.000000,\n" + |
| | | // "\t\"flat_charge4\": 0.000000,\n" + |
| | | // "\t\"flat_charge6\": 1.989000,\n" + |
| | | // "\t\"loss_peak_charge3\": 0,\n" + |
| | | // "\t\"loss_peak_charge5\": 0,\n" + |
| | | // "\t\"loss_total_electricity\": 0,\n" + |
| | | // "\t\"loss_valley_charge1\": 0,\n" + |
| | | // "\t\"loss_valley_charge7\": 0,\n" + |
| | | // "\t\"payment_amount\": 27.320000,\n" + |
| | | // "\t\"peak_amount3\": 0.000000,\n" + |
| | | // "\t\"peak_amount5\": 0.000000,\n" + |
| | | // "\t\"peak_charge3\": 0.000000,\n" + |
| | | // "\t\"peak_charge5\": 0.000000,\n" + |
| | | // "\t\"physical_card_number\": \"1234567812345678\",\n" + |
| | | // "\t\"result\": \"{\\\"service_id\\\":\\\"transaction_record\\\",\\\"transaction_serial_number\\\":\\\"CD38820250303225620557\\\",\\\"charging_pile_code\\\":\\\"2024123100001005\\\",\\\"charging_gun_code\\\":\\\"01\\\",\\\"start_time\\\":\\\"2025-03-03 22:56:18.00\\\",\\\"end_time\\\":\\\"2025-03-04 00:00:43.00\\\",\\\"valley_charge1\\\":\\\"0.066000\\\",\\\"loss_valley_charge1\\\":\\\"0\\\",\\\"valley_amount1\\\":\\\"0.040000\\\",\\\"flat_charge2\\\":\\\"0.000000\\\",\\\"loss_flat_charg2\\\":\\\"0\\\",\\\"flat_amount2\\\":\\\"0.000000\\\",\\\"peak_charge3\\\":\\\"0.000000\\\",\\\"loss_peak_charge3\\\":\\\"0\\\",\\\"peak_amount3\\\":\\\"0.000000\\\",\\\"flat_charge4\\\":\\\"0.000000\\\",\\\"loss_flat_charg4\\\":\\\"0\\\",\\\"flat_amount4\\\":\\\"0.000000\\\",\\\"peak_charge5\\\":\\\"0.000000\\\",\\\"loss_peak_charge5\\\":\\\"0\\\",\\\"peak_amount5\\\":\\\"0.000000\\\",\\\"flat_charge6\\\":\\\"1.989000\\\",\\\"loss_flat_charg6\\\":\\\"0\\\",\\\"flat_amount6\\\":\\\"2.350000\\\",\\\"valley_charge7\\\":\\\"33.103000\\\",\\\"loss_valley_charge7\\\":\\\"0\\\",\\\"valley_amount7\\\":\\\"24.910000\\\",\\\"total_electricity\\\":\\\"35.158001\\\",\\\"loss_total_electricity\\\":\\\"0\\\",\\\"payment_amount\\\":\\\"27.320000\\\",\\\"trade_date\\\":\\\"0\\\",\\\"stop_reason\\\":\\\"1\\\",\\\"physical_card_number\\\":\\\"1234567812345678\\\"}\",\n" + |
| | | // "\t\"retryTimes\": 0,\n" + |
| | | // "\t\"sendTime\": 1741017648977,\n" + |
| | | // "\t\"serviceId\": \"transaction_record\",\n" + |
| | | // "\t\"source\": \"\",\n" + |
| | | // "\t\"start_time\": \"2025-03-03 22:56:18.00\",\n" + |
| | | // "\t\"stop_reason\": 1,\n" + |
| | | // "\t\"total_electricity\": 35.158001,\n" + |
| | | // "\t\"trade_date\": \"0\",\n" + |
| | | // "\t\"transaction_serial_number\": \"CD38820250303225620557\",\n" + |
| | | // "\t\"valley_amount1\": 0.040000,\n" + |
| | | // "\t\"valley_amount7\": 24.910000,\n" + |
| | | // "\t\"valley_charge1\": 0.066000,\n" + |
| | | // "\t\"valley_charge7\": 33.103000\n" + |
| | | // "}", TransactionRecordMessageVO.class); |
| | | // chargingOrderService.endChargeBillingCharge(vo); |
| | | // PayOrderQueryDto payOrderQueryDto = new PayOrderQueryDto(); |
| | | // payOrderQueryDto.setPageCurr(1); |
| | | // payOrderQueryDto.setPageSize(10000999); |
| | | // PageInfo<PayOrderDto> data = chargingOrderService.payOrderQuery(payOrderQueryDto).getData(); |
| | | // } |
| | | //} |