Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile
| | |
| | | public R<List<TChargingOrder>> getChargingOrder(TChargingOrderVo order) { |
| | | return R.fail("获取充电订单数据失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public R<List<TChargingOrder>> getCarChargingOrder(Long carId, String startTime, String endTime) { |
| | | return R.fail("根据车辆id获取指定时间范围内的数据失败:" + throwable.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | @GetMapping(value = "/financial/settlement/downloadSettlement/{uid}") |
| | | public R<TSettlementConfirm> downloadSettlement(@PathVariable("uid") String uid); |
| | | |
| | | @GetMapping(value = "/financial/settlement/settlementTotalR") |
| | | public R<SettlementTotalVO> settlementTotalR(String time); |
| | | @GetMapping(value = "/financial/settlement/settlementTotalR/{time}") |
| | | public R<SettlementTotalVO> settlementTotalR(@PathVariable("time")String time); |
| | | |
| | | /** |
| | | * 修改充电订单 |
| | |
| | | */ |
| | | @PostMapping("/t-charging-order/getChargingOrder") |
| | | R<List<TChargingOrder>> getChargingOrder(@RequestBody TChargingOrderVo order); |
| | | |
| | | |
| | | /** |
| | | * 根据车辆id获取指定时间范围内的数据 |
| | | * @param carId |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | @PostMapping("/t-charging-order/getCarChargingOrder") |
| | | R<List<TChargingOrder>> getCarChargingOrder(@RequestParam("carId") Long carId, @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime); |
| | | } |
| | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | @ApiModelProperty(value = "累计退款金额 前端忽略") |
| | | @TableField(exist = false) |
| | | |
| | | private BigDecimal refundAmount1; |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | |
| | | @ApiOperation(value = "下载-已出账", tags = {"管理后台-充电算账单"}) |
| | | @PutMapping("/downloadBill") |
| | | @Log(title = "【充电算账单】下载算账单", businessType = BusinessType.EXPORT) |
| | | public R downloadBill(@RequestBody String uid, HttpServletResponse response) |
| | | public R downloadBill(@RequestBody ExportUidDto uid, HttpServletResponse response) |
| | | { |
| | | ChargingListQuery chargingListQuery = new ChargingListQuery(); |
| | | chargingListQuery.setUid(uid); |
| | | chargingListQuery.setUid(uid.getUid()); |
| | | chargingListQuery.setPageCurr(1); |
| | | chargingListQuery.setPageSize(99999); |
| | | ChargingBillVO data = chargingOrderClient.chargingBillListR(chargingListQuery).getData(); |
| | |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setHeader("Access-Control-Expose-Headers", "Content-disposition"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + |
| | | URLEncoder.encode("月账单-"+data.getCategory()+"-"+data.getBillWeek()+"-"+data.getSiteName(), CharEncoding.UTF_8) + ".xlsx"); |
| | | // URLEncoder.encode("月账单-"+data.getCategory()+"-"+data.getBillWeek()+"-"+data.getSiteName(), CharEncoding.UTF_8) + ".xlsx"); |
| | | URLEncoder.encode("月账单", CharEncoding.UTF_8) + ".xlsx"); |
| | | } catch (UnsupportedEncodingException e) { |
| | | return R.fail("excel导出失败!"); |
| | | } |
| | |
| | | @ApiOperation(value = "下载-未出账", tags = {"管理后台-充电算账单"}) |
| | | @PutMapping("/download") |
| | | @Log(title = "【充电算账单】下载算账单", businessType = BusinessType.EXPORT) |
| | | public R download(String uid,HttpServletResponse response) |
| | | public R download(@RequestBody ExportUidDto uid,HttpServletResponse response) |
| | | { |
| | | ChargingListQuery chargingListQuery = new ChargingListQuery(); |
| | | chargingListQuery.setUid(uid); |
| | | chargingListQuery.setUid(uid.getUid()); |
| | | chargingListQuery.setPageCurr(1); |
| | | chargingListQuery.setPageSize(99999); |
| | | ChargingBillVO data = chargingOrderClient.chargingBillListR(chargingListQuery).getData(); |
| | |
| | | @ApiOperation(tags = {"后台-订单管理-停车记录"},value = "列表") |
| | | @PostMapping(value = "/page") |
| | | public R<Page<TParkingRecord>> page(@RequestBody ParkingRecordPageQuery query) { |
| | | String s1 = ""; |
| | | String s2 = ""; |
| | | if (query.getTimePeriod()!=null){ |
| | | s1 = query.getTimePeriod().split(" - ")[0]; |
| | | s2 = query.getTimePeriod().split(" - ")[1]; |
| | | } |
| | | Page<TParkingRecord> page = parkingRecordService.lambdaQuery() |
| | | .like(query.getLicensePlate() != null, TParkingRecord::getLicensePlate, query.getLicensePlate()) |
| | | .eq(query.getStatus() != null, TParkingRecord::getStatus, query.getStatus()) |
| | | .eq(query.getOutParkingType() != null, TParkingRecord::getOutParkingType, query.getOutParkingType()) |
| | | .between(query.getTimePeriod()!=null,TParkingRecord::getInParkingTime,s1,s2) |
| | | .or() |
| | | .between(query.getTimePeriod()!=null,TParkingRecord::getOutParkingTime,s1,s2) |
| | | .orderByDesc(TParkingRecord::getCreateTime) |
| | | .page(Page.of(query.getPageCurr(), query.getPageSize())); |
| | | |
| | |
| | | <if test="null != item.districtsCode and '' != item.districtsCode"> |
| | | and a.districts_code = #{item.districtsCode} |
| | | </if> |
| | | <if test="null != ids"> |
| | | <if test="null != ids and ids.size() > 0"> |
| | | and a.id in |
| | | <foreach collection="ids" item="itemm" index="index" open="(" separator="," close=")"> |
| | | #{itemm} |
| | |
| | | <if test="query.chargeMode != null"> |
| | | AND tcg.charge_mode = #{query.chargeMode} |
| | | </if> |
| | | <if test="null != siteIds"> |
| | | <if test="null != siteIds and siteIds.size() > 0"> |
| | | and tcg.site_id in |
| | | <foreach collection="siteIds" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | |
| | | <if test="null != item.type"> |
| | | and a.type = #{item.type} |
| | | </if> |
| | | <if test="null != siteIds"> |
| | | <if test="null != siteIds and siteIds.size() > 0"> |
| | | and a.site_id in |
| | | <foreach collection="siteIds" item="itemm" index="index" open="(" separator="," close=")"> |
| | | #{itemm} |
| | |
| | | from t_charging_pile_notification a |
| | | left join t_site b on (a.site_id = b.id) |
| | | where a.del_flag = 0 |
| | | <if test="null != siteIds"> |
| | | <if test="null != siteIds and siteIds.size() > 0"> |
| | | and a.site_id in |
| | | <foreach collection="siteIds" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | |
| | | package com.ruoyi.integration.barrierGate.server; |
| | | |
| | | import com.ruoyi.account.api.feignClient.AppUserCarClient; |
| | | import com.ruoyi.account.api.model.TAppUserCar; |
| | | import com.ruoyi.chargingPile.api.feignClient.ParkingLotClient; |
| | | import com.ruoyi.chargingPile.api.feignClient.ParkingRecordClient; |
| | | import com.ruoyi.chargingPile.api.model.TParkingLot; |
| | |
| | | import com.ruoyi.integration.barrierGate.model.CloudParkingSpace; |
| | | import com.ruoyi.integration.barrierGate.model.OfflineParkingOrder; |
| | | import com.ruoyi.integration.barrierGate.model.OfflineParkingSpace; |
| | | import com.ruoyi.order.api.feignClient.ChargingOrderClient; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | |
| | | @Resource |
| | | private ParkingLotClient parkingLotClient; |
| | | |
| | | @Resource |
| | | private ChargingOrderClient chargingOrderClient; |
| | | |
| | | |
| | | |
| | |
| | | parkingRecord.setStatus(BigDecimal.ZERO.compareTo(payment) == 0 ? 2 : 3); |
| | | parkingRecord.setOutParkingType(BigDecimal.ZERO.compareTo(payment) == 0 ? 2 : 1); |
| | | parkingRecord.setTitle("【停车缴费】" + payment + "元"); |
| | | TAppUserCar appUserCar = appUserCarClient.getAppUserCarByLicensePlate(parkingRecord.getLicensePlate()).getData(); |
| | | if(null != appUserCar){ |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | List<TChargingOrder> data = chargingOrderClient.getCarChargingOrder(appUserCar.getId(), parkingRecord.getInParkingTime().format(formatter), LocalDateTime.now().format(formatter)).getData(); |
| | | if(null != data && data.size() > 0){ |
| | | TChargingOrder chargingOrder = data.get(0); |
| | | parkingRecord.setAppUserId(chargingOrder.getAppUserId()); |
| | | parkingRecord.setChargingOrderId(chargingOrder.getId()); |
| | | } |
| | | } |
| | | parkingRecordClient.updateParkingRecord(parkingRecord); |
| | | } |
| | | |
| | |
| | | parkingRecord.setStatus(BigDecimal.ZERO.compareTo(payment) == 0 ? 2 : 3); |
| | | parkingRecord.setOutParkingType(BigDecimal.ZERO.compareTo(payment) == 0 ? 2 : 1); |
| | | parkingRecord.setTitle("【停车缴费】" + payment + "元"); |
| | | TAppUserCar appUserCar = appUserCarClient.getAppUserCarByLicensePlate(parkingRecord.getLicensePlate()).getData(); |
| | | if(null != appUserCar){ |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | List<TChargingOrder> data = chargingOrderClient.getCarChargingOrder(appUserCar.getId(), parkingRecord.getInParkingTime().format(formatter), LocalDateTime.now().format(formatter)).getData(); |
| | | if(null != data && data.size() > 0){ |
| | | TChargingOrder chargingOrder = data.get(0); |
| | | parkingRecord.setAppUserId(chargingOrder.getAppUserId()); |
| | | parkingRecord.setChargingOrderId(chargingOrder.getId()); |
| | | } |
| | | } |
| | | parkingRecordClient.updateParkingRecord(parkingRecord); |
| | | } |
| | | |
| | |
| | | String service_id = content.getString("service_id"); |
| | | log.info("服务id:{}",service_id); |
| | | // 写入文件 |
| | | FileWriter writer = new FileWriter("D:/sample.txt",true); |
| | | writer.write("接收到消息中转:"+jsonObject+"\n"); |
| | | writer.write("服务id:"+service_id+"\n"); |
| | | writer.close(); |
| | | // FileWriter writer = new FileWriter("D:/sample.txt",true); |
| | | // writer.write("接收到消息中转:"+jsonObject+"\n"); |
| | | // writer.write("服务id:"+service_id+"\n"); |
| | | // writer.close(); |
| | | SendResult sendResult; |
| | | ChargingMessage chargingMessage = new ChargingMessage(); |
| | | chargingMessage.setServiceId(service_id); |
| | |
| | | SettlementTotalVO res = chargingOrderService.settlementTotal(time); |
| | | return AjaxResult.success(res); |
| | | } |
| | | @GetMapping(value = "/settlementTotalR") |
| | | public R<SettlementTotalVO> settlementTotalR(String time) { |
| | | @GetMapping(value = "/settlementTotalR/{time}") |
| | | public R<SettlementTotalVO> settlementTotalR(@PathVariable("time")String time) { |
| | | time = time+"-01 00:00:00"; |
| | | SettlementTotalVO res = chargingOrderService.settlementTotal(time); |
| | | return R.ok(res); |
| | |
| | | List<TChargingOrder> chargingOrder = chargingOrderService.getChargingOrder(order); |
| | | return R.ok(chargingOrder); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据车辆id获取指定时间范围内的数据 |
| | | * @param carId |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | @PostMapping("/getCarChargingOrder") |
| | | public R<List<TChargingOrder>> getCarChargingOrder(@RequestParam("carId") Long carId, @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime){ |
| | | List<TChargingOrder> list = chargingOrderService.list(new LambdaQueryWrapper<TChargingOrder>().eq(TChargingOrder::getAppUserCarId, carId).eq(TChargingOrder::getDelFlag, 0) |
| | | .in(TChargingOrder::getStatus, Arrays.asList(4, 5)).between(TChargingOrder::getStartTime, startTime, endTime)); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | @ApiOperation(tags = {"小程序-订单评价"},value = "充电订单评价标签及数量查询") |
| | | @GetMapping(value = "/getTagCount") |
| | | public AjaxResult<List<TEvaluationTagVO>> getTagCount(@RequestParam(value = "siteId")@ApiParam(value = "站点id")Integer siteId) { |
| | | public AjaxResult<List<TEvaluationTagVO>> getTagCount(@ApiParam(value = "站点id")Integer siteId) { |
| | | return AjaxResult.ok(orderEvaluateService.getTagCount(siteId)); |
| | | } |
| | | |
| | |
| | | LEFT JOIN `charging_pile_other`.`t_evaluation_tag` tt on ot.evaluation_tag_id = tt.id |
| | | WHERE ot.evaluation_tag_id in ( |
| | | SELECT id from `charging_pile_other`.`t_evaluation_tag` WHERE type = 1 |
| | | ) <if test="null != siteIds"> |
| | | ) <if test="null != siteIds and siteIds.size() > 0"> |
| | | and co.site_id in |
| | | <foreach collection="siteIds" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | |
| | | LEFT JOIN `charging_pile_other`.`t_evaluation_tag` tt on ot.evaluation_tag_id = tt.id |
| | | WHERE ot.evaluation_tag_id in ( |
| | | SELECT id from `charging_pile_other`.`t_evaluation_tag` WHERE type = 3 |
| | | ) <if test="null != siteIds"> |
| | | ) <if test="null != siteIds and siteIds.size() > 0"> |
| | | and co.site_id in |
| | | <foreach collection="siteIds" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |