Merge remote-tracking branch 'origin/master'
| | |
| | | import com.ruoyi.chargingPile.api.feignClient.ChargingPileClient; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.chargingPile.api.vo.SiteInfoVO; |
| | | import com.ruoyi.chargingPile.api.vo.UpdateChargingPileStatusVo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void updateChargingPileStatus(String pile_code, String gun_code, Integer status) { |
| | | public void updateChargingPileStatus(UpdateChargingPileStatusVo vo) { |
| | | log.error("修改充电桩状态失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.chargingPile.api.factory.ChargingPileFallbackFactory; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.chargingPile.api.vo.SiteInfoVO; |
| | | import com.ruoyi.chargingPile.api.vo.UpdateChargingPileStatusVo; |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | |
| | | |
| | | /** |
| | | * 修改充电桩状态 |
| | | * @param code |
| | | * @param status |
| | | */ |
| | | @PostMapping("/t-charging-pile/updateChargingPileStatus") |
| | | void updateChargingPileStatus(@RequestParam("pile_code") String pile_code, @RequestParam("gun_code") String gun_code, @RequestParam("status") Integer status); |
| | | void updateChargingPileStatus(@RequestBody UpdateChargingPileStatusVo vo); |
| | | } |
| | |
| | | @PostMapping(value = "/t-parking-lot/getLotBySiteId") |
| | | public R<TParkingLot> getLotBySiteId(@RequestParam("siteId") Integer siteId); |
| | | |
| | | @PostMapping(value = "/t-parking-lot/getRecordById") |
| | | @GetMapping(value = "/t-parking-lot/getRecordById") |
| | | public R<TParkingRecord> getRecordById(@RequestParam("id") Long siteId); |
| | | |
| | | @PostMapping(value = "/t-parking-lot/getRecordAmount") |
| | |
| | | * @since 2024-08-08 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_parking_record") |
| | | @ApiModel(value="TParkingRecord对象", description="") |
| | | public class TParkingRecord implements Serializable { |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.vo; |
| | | |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/11/4 11:37 |
| | | */ |
| | | @Data |
| | | public class UpdateChargingPileStatusVo { |
| | | private String pile_code; |
| | | private String gun_code; |
| | | private Integer status; |
| | | } |
| | |
| | | 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()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | R<String> queryOrderByGunId(@PathVariable("id") String id); |
| | | @PostMapping(value = "/t-charging-order/useOrderCount") |
| | | R<Long> useOrderCount(@RequestParam("userId") Long userId); |
| | | @PostMapping(value = "/t-charging-order/chargingBillListR") |
| | | @PostMapping(value = "/chargingBill/chargingBillListR") |
| | | R<ChargingBillVO> chargingBillListR(@RequestBody ChargingListQuery dto); |
| | | @PostMapping(value = "/t-charging-order/detail") |
| | | R<TChargingOrder> orderDetail(@RequestParam("orderId") Long orderId); |
| | |
| | | @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); |
| | | } |
| | |
| | | public class TChargingOrder extends BasePojo { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | @ApiModelProperty(value = "累计退款金额 前端忽略") |
| | | @TableField(exist = false) |
| | | |
| | | private BigDecimal refundAmount1; |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId(value = "id", type = IdType.NONE) |
| | |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId(value = "id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "序号") |
| | | @TableField(exist = false) |
| | | private Integer xuhao; |
| | | @ApiModelProperty(value = "月份") |
| | | @TableField(exist = false) |
| | | private Integer month; |
| | | @ApiModelProperty(value = "站点id") |
| | | @TableField("site_id") |
| | | private Integer siteId; |
| | |
| | | private PageInfo<ChargingBillListVO> list; |
| | | @ApiModelProperty(value = "导出Excel数据 前端忽略") |
| | | private List<TChargingOrder> exportList; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "签到得积分{\"num1\":1,\"num2\":[\"1(多少天),2(多少分)\"]}") |
| | | @TableField("sign_in_for_points") |
| | | private String signInForPoints; |
| | | @ApiModelProperty(value = "是否双倍") |
| | | @TableField(exist = false) |
| | | private Integer isDouble; |
| | | |
| | | |
| | | } |
| | |
| | | @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导出失败!"); |
| | | } |
| | |
| | | BigDecimal bigDecimal = new BigDecimal("0"); |
| | | |
| | | for (TChargingOrder chargingOrder : collect) { |
| | | bigDecimal = bigDecimal.add(chargingOrder.getPaymentAmount()); |
| | | bigDecimal = bigDecimal.add(chargingOrder.getRefundAmount()); |
| | | if (chargingOrder.getRechargePaymentType()!=null){ |
| | | switch (chargingOrder.getRechargePaymentType()){ |
| | | case 1: |
| | |
| | | @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(); |
| | |
| | | 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导出失败!"); |
| | | } |
| | |
| | | import com.ruoyi.chargingPile.api.model.TFaultMessage; |
| | | import com.ruoyi.chargingPile.api.query.TChargingGunQuery; |
| | | import com.ruoyi.chargingPile.api.vo.TChargingGunVO; |
| | | import com.ruoyi.chargingPile.api.vo.UpdateChargingPileStatusVo; |
| | | import com.ruoyi.chargingPile.dto.ChargeMonitoring; |
| | | import com.ruoyi.chargingPile.dto.ChargingGunCountMonitoring; |
| | | import com.ruoyi.chargingPile.dto.ChargingGunMonitoring; |
| | |
| | | |
| | | /** |
| | | * 更新充电桩状态 |
| | | * @param status |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/updateChargingPileStatus") |
| | | public void updateChargingPileStatus(@RequestParam("pile_code") String pile_code, @RequestParam("gun_code") String gun_code, @RequestParam("status") Integer status){ |
| | | public void updateChargingPileStatus(@RequestBody UpdateChargingPileStatusVo vo){ |
| | | String pile_code = vo.getPile_code(); |
| | | String gun_code = vo.getGun_code(); |
| | | Integer status = vo.getStatus(); |
| | | Map<String, Object> charging_pile_online = redisService.getCacheMap("charging_gun_online"); |
| | | Long time = (Long) charging_pile_online.get(pile_code + gun_code); |
| | | //小于30秒才处理数据,防止频繁查询数据 |
| | |
| | | import java.math.BigDecimal; |
| | | import java.net.URLEncoder; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | |
| | | @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())); |
| | | |
| | |
| | | public R out(Long id) { |
| | | TParkingRecord byId = parkingRecordService.getById(id); |
| | | byId.setStatus(2); |
| | | byId.setOutParkingTime(LocalDateTime.now()); |
| | | parkingRecordService.updateById(byId); |
| | | return R.ok(); |
| | | |
| | |
| | | @PostMapping(value = "/parking/work") |
| | | @ApiOperation(value = "停车订单统计", tags = {"管理后台-工作台"}) |
| | | public R<TParkLotRecordCountVo> work(@RequestBody ParkingRecordQueryDto parkingRecordQueryDto){ |
| | | List<TParkingRecord> list = parkingRecordService.lambdaQuery().eq(parkingRecordQueryDto.getParkingLotId() != null, TParkingRecord::getParkingLotId, parkingRecordQueryDto.getParkingLotId()) |
| | | List<TParkingRecord> list = parkingRecordService.lambdaQuery().isNotNull(TParkingRecord::getOutParkingType).eq(parkingRecordQueryDto.getParkingLotId() != null, TParkingRecord::getParkingLotId, parkingRecordQueryDto.getParkingLotId()) |
| | | .ge(parkingRecordQueryDto.getStartTime()!=null,TParkingRecord::getCreateTime, parkingRecordQueryDto.getStartTime()) |
| | | .le(parkingRecordQueryDto.getEndTime()!=null,TParkingRecord::getCreateTime, parkingRecordQueryDto.getEndTime().plusDays(1)).list(); |
| | | int count1 = list.size(); |
| | |
| | | @PostMapping(value = "/parking/work1") |
| | | @ApiOperation(value = "停车订单统计", tags = {"管理后台-工作台"}) |
| | | public R<TParkLotRecordCountVo> work1(@RequestBody ParkingRecordQueryDto parkingRecordQueryDto){ |
| | | List<TParkingRecord> list = parkingRecordService.lambdaQuery().eq(parkingRecordQueryDto.getParkingLotId() != null, TParkingRecord::getParkingLotId, parkingRecordQueryDto.getParkingLotId()).list(); |
| | | List<TParkingRecord> list = parkingRecordService.lambdaQuery().isNotNull(TParkingRecord::getOutParkingType).eq(parkingRecordQueryDto.getParkingLotId() != null, TParkingRecord::getParkingLotId, parkingRecordQueryDto.getParkingLotId()).list(); |
| | | int count1 = list.size(); |
| | | //统计出list中chargingOrderId为null的数据个数 |
| | | int count2 = list.stream().filter(item -> item.getChargingOrderId() != null).collect(Collectors.toList()).size(); |
| | |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.integration.api.feignClient.IntegrationClient; |
| | | import com.ruoyi.integration.api.feignClient.IotInterfaceClient; |
| | | import com.ruoyi.integration.api.feignClient.SendMessageClient; |
| | | import com.ruoyi.integration.api.feignClient.UploadRealTimeMonitoringDataClient; |
| | | import com.ruoyi.integration.api.model.QrCodeDelivery; |
| | | import com.ruoyi.integration.api.model.UploadRealTimeMonitoringData; |
| | | import com.ruoyi.integration.api.vo.AddDevice; |
| | | import com.ruoyi.integration.api.vo.AddDeviceResp; |
| | |
| | | |
| | | @Resource |
| | | private TAccountingStrategyDetailService accountingStrategyDetailService; |
| | | |
| | | @Resource |
| | | private SendMessageClient sendMessageClient; |
| | | |
| | | |
| | | |
| | |
| | | return AjaxResult.error("设备编号已存在"); |
| | | } |
| | | this.updateById(chargingPile); |
| | | |
| | | List<TChargingGun> list = chargingGunService.list(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getChargingPileId, chargingPile.getId()).eq(TChargingGun::getDelFlag, 0)); |
| | | for (TChargingGun chargingGun : list) { |
| | | TChargingGun chargingGun1 = new TChargingGun(); |
| | | chargingGun1.setId(chargingGun.getId()); |
| | | chargingGun1.setFullNumber(chargingPile.getCode() + chargingGun.getCode()); |
| | | chargingGunService.updateById(chargingGun1); |
| | | |
| | | //下发硬件充电二维码 |
| | | String code_prefix = "https://mxcd.zhinenganguan.com?No="; |
| | | QrCodeDelivery qrCodeDelivery = new QrCodeDelivery(); |
| | | qrCodeDelivery.setCharging_pile_code(chargingPile.getCode()); |
| | | qrCodeDelivery.setCharging_gun_code(chargingGun.getCode()); |
| | | qrCodeDelivery.setCode_format(1); |
| | | qrCodeDelivery.setPrefix_length(code_prefix.length()); |
| | | qrCodeDelivery.setCode_prefix(code_prefix); |
| | | qrCodeDelivery.setQr_code(code_prefix + chargingPile.getCode() + chargingGun.getCode()); |
| | | sendMessageClient.qrCodeDelivery(qrCodeDelivery); |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | |
| | | <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} |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 线下停车场入场 |
| | | * @param order |
| | |
| | | package com.ruoyi.integration.barrierGate.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/9/5 11:29 |
| | | */ |
| | | @Data |
| | | public class BaseResponse<T> { |
| | | |
| | | private Integer code; |
| | |
| | | |
| | | private T data; |
| | | |
| | | public Integer getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(Integer code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getMsg() { |
| | | return msg; |
| | | } |
| | | |
| | | public void setMsg(String msg) { |
| | | this.msg = msg; |
| | | } |
| | | |
| | | public T getData() { |
| | | return data; |
| | | } |
| | | |
| | | public void setData(T data) { |
| | | this.data = data; |
| | | } |
| | | |
| | | public BaseResponse() { |
| | | } |
| | | |
| | | public BaseResponse(Integer code, String msg, T data) { |
| | | this.code = code; |
| | | this.msg = msg; |
| | | this.data = data; |
| | | } |
| | | |
| | | public static BaseResponse ok(){ |
| | | return ok(new Object()); |
| | | return ok(null); |
| | | } |
| | | |
| | | |
| | | public static <T> BaseResponse<T> ok(T data){ |
| | | BaseResponse baseResponse = new BaseResponse(); |
| | | baseResponse.setCode(0); |
| | | baseResponse.setData(data); |
| | | baseResponse.setMsg("成功"); |
| | | BaseResponse baseResponse = new BaseResponse(0, "成功", data); |
| | | return baseResponse; |
| | | } |
| | | } |
| | |
| | | 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); |
| | |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.chargingPile.api.model.TFaultMessage; |
| | | import com.ruoyi.chargingPile.api.vo.GetChargingGunByCode; |
| | | import com.ruoyi.chargingPile.api.vo.UpdateChargingPileStatusVo; |
| | | import com.ruoyi.integration.api.model.*; |
| | | import com.ruoyi.integration.iotda.constant.SendTagConstant; |
| | | import com.ruoyi.integration.iotda.enums.ServiceIdMenu; |
| | |
| | | Ping ping = new Ping(); |
| | | BeanUtils.copyProperties(pingMessage,ping); |
| | | pingService.create(ping); |
| | | |
| | | chargingPileClient.updateChargingPileStatus(pingMessage.getCharging_pile_code(), pingMessage.getCharging_gun_code(), pingMessage.getCharging_gun_status()); |
| | | |
| | | UpdateChargingPileStatusVo vo1 = new UpdateChargingPileStatusVo(); |
| | | vo1.setGun_code(pingMessage.getCharging_gun_code()); |
| | | vo1.setPile_code(pingMessage.getCharging_pile_code()); |
| | | vo1.setStatus(pingMessage.getCharging_gun_status()); |
| | | chargingPileClient.updateChargingPileStatus(vo1); |
| | | break; |
| | | case SendTagConstant.END_CHARGE: |
| | | EndChargeMessage endChargeMessage = message.getEndChargeMessage(); |
| | |
| | | } |
| | | BigDecimal paymentAmount = new BigDecimal("0"); |
| | | BigDecimal refundAmount = new BigDecimal("0"); |
| | | BigDecimal commissionAmount = new BigDecimal("0"); |
| | | |
| | | List<TChargingOrder> tChargingOrders = chargingOrderService.list(eq); |
| | | // 累加支付金额 |
| | | BigDecimal bigDecimal = new BigDecimal("0"); |
| | | BigDecimal bigDecimal1 = new BigDecimal("0.006"); |
| | | |
| | | int i =1; |
| | | for (TChargingOrder tChargingOrder : tChargingOrders) { |
| | | // 账单信息 |
| | | paymentAmount = paymentAmount.add(tChargingOrder.getPaymentAmount()); |
| | | |
| | | paymentAmount = paymentAmount.add(tChargingOrder.getChargeAmount()); |
| | | commissionAmount = commissionAmount.add(tChargingOrder.getPaymentAmount().multiply(bigDecimal1)); |
| | | // 退款信息 |
| | | ChargingBillRefundExport chargingBillRefundExport = new ChargingBillRefundExport(); |
| | | ChargingBillPayExport chargingBillPayExport = new ChargingBillPayExport(); |
| | |
| | | chargingBillPayExport.setTotal(""); |
| | | chargingBillPayExports.add(chargingBillPayExport); |
| | | i++; |
| | | bigDecimal = bigDecimal.add(tChargingOrder.getOrderAmount()); |
| | | bigDecimal = bigDecimal.add(tChargingOrder.getChargeAmount()); |
| | | } |
| | | if (!chargingBillPayExports.isEmpty()){ |
| | | chargingBillPayExports.get(0).setTotal(bigDecimal+""); |
| | |
| | | } |
| | | chargingBillExport.setPaymentAmount(paymentAmount); |
| | | chargingBillExport.setRefundAmount(refundAmount); |
| | | chargingBillExport.setIncome(paymentAmount.subtract(refundAmount)); |
| | | chargingBillExport.setIncome(paymentAmount.subtract(refundAmount).subtract(commissionAmount).setScale(2, BigDecimal.ROUND_DOWN)); |
| | | chargingBillExports.add(chargingBillExport); |
| | | // 导出 |
| | | List<Map<String, Object>> sheetsList = new ArrayList<>(); |
| | |
| | | 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); |
| | |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.chargingPile.api.model.TParkingRecord; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.dto.ChargingOrderGroup; |
| | | import com.ruoyi.common.core.dto.ChargingPercentProvinceDto; |
| | |
| | | payOrderInfoDto2.setFinalAmount(byId2.getPaymentAmount().subtract(byId2.getRefundAmount())); |
| | | return R.ok(payOrderInfoDto2); |
| | | //todo luo 停车场订单 |
| | | // case 4: |
| | | // TParkingRecord byId3 = parkingLotClient.getRecordById(orderId).getData(); |
| | | // PayOrderInfoDto payOrderInfoDto3 = new PayOrderInfoDto(); |
| | | // payOrderInfoDto3.setOrderId(byId3.getId().toString()); |
| | | // payOrderInfoDto3.setCode(byId3.getCode()); |
| | | // payOrderInfoDto3.setTradeNo(byId3); |
| | | // payOrderInfoDto3.setPayType(0); |
| | | // payOrderInfoDto3.setPayAmount(new BigDecimal("0")); |
| | | // payOrderInfoDto3.setPayTime(LocalDateTime.now()); |
| | | // payOrderInfoDto3.setRefundAmount(new BigDecimal("0")); |
| | | |
| | | case 4: |
| | | R<TParkingRecord> recordById = parkingLotClient.getRecordById(orderId); |
| | | TParkingRecord byId3 =recordById.getData(); |
| | | PayOrderInfoDto payOrderInfoDto3 = new PayOrderInfoDto(); |
| | | payOrderInfoDto3.setOrderId(byId3.getId().toString()); |
| | | payOrderInfoDto3.setCode(byId3.getCode()); |
| | | payOrderInfoDto3.setPayTime(byId3.getCreateTime()); |
| | | payOrderInfoDto3.setRechargeAmount(byId3.getPayment()); |
| | | return R.ok(payOrderInfoDto3); |
| | | |
| | | |
| | | |
| | |
| | | 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)); |
| | | } |
| | | |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | // 充电时间秒 |
| | | chargingBillListVO.setChargingSecond(chargingSecond); |
| | | } |
| | | BigDecimal bigDecimal = new BigDecimal("0"); |
| | | |
| | | for (ChargingBillListVO chargingBillListVO : list1) { |
| | | if (chargingBillListVO.getType()==2){ |
| | | continue; |
| | |
| | | tChargingOrder.setRefundContent(tChargingOrderRefund.getRefundReason()); |
| | | tChargingOrder.setRefundCode(tChargingOrderRefund.getRefundCode()); |
| | | tChargingOrder.setRefundTime1(DateUtils.localDateTimeToString(tChargingOrderRefund.getRefundTime())); |
| | | bigDecimal = bigDecimal.add(tChargingOrderRefund.getRefundAmount()); |
| | | } |
| | | // 累加累计服务费 |
| | | if (tChargingOrder.getServiceCharge()!=null){ |
| | |
| | | chargingBillVO.setSharingAmount(sharingAmountTotal); |
| | | chargingBillVO.setDiscount(discountTotal); |
| | | chargingBillVO.setRefundAmount(refundAmountTotal); |
| | | chargingBillVO.setExportList(tChargingOrders1); |
| | | List<TChargingOrder> collect = tChargingOrders1.stream().distinct().collect(Collectors.toList()); |
| | | if (!collect.isEmpty()){ |
| | | collect.get(0).setRefundAmount1(bigDecimal); |
| | | } |
| | | chargingBillVO.setExportList(collect); |
| | | pageInfo.setRecords(list); |
| | | chargingBillVO.setList(pageInfo); |
| | | return chargingBillVO; |
| | |
| | | electronicMoney = electronicMoney.add(chargingOrderVO.getElectrovalence()); |
| | | serviceMoney = serviceMoney.add(chargingOrderVO.getServiceCharge()); |
| | | |
| | | income = income.add(chargingOrderVO.getOrderAmount()); |
| | | income = income.add(chargingOrderVO.getPaymentAmount()); |
| | | |
| | | |
| | | |
| | |
| | | return null; |
| | | } |
| | | TChargingOrder one = this.getOne(new LambdaQueryWrapper<TChargingOrder>().eq(TChargingOrder::getAppUserCarId, appUserCar.getId()) |
| | | .eq(TChargingOrder::getDelFlag, 0).gt(TChargingOrder::getStartTime, query.getStartTime()) |
| | | .eq(TChargingOrder::getRechargePaymentStatus, 2).ne(TChargingOrder::getStatus, 5)); |
| | | .eq(TChargingOrder::getDelFlag, 0).between(TChargingOrder::getStartTime, query.getStartTime(), LocalDateTime.now()) |
| | | .eq(TChargingOrder::getRechargePaymentStatus, 2).in(TChargingOrder::getStatus, Arrays.asList(4, 5))); |
| | | return one; |
| | | } |
| | | |
| | |
| | | couponDiscount = couponDiscount.add(tChargingOrder.getCouponDiscountAmount()); |
| | | } |
| | | if (tChargingOrder.getPaymentAmount()!=null){ |
| | | paymentAmount = paymentAmount.add(tChargingOrder.getOrderAmount()); |
| | | paymentAmount = paymentAmount.add(tChargingOrder.getPaymentAmount()); |
| | | } |
| | | |
| | | } |
| | |
| | | // 三方交易手续费 三方收费*0.6% |
| | | commissionAmount = sharingAmount.multiply(new BigDecimal("0.006")); |
| | | // 订单手续费 订单支付金额 - 退款金额*0.6% |
| | | orderCommission = paymentAmount.multiply(new BigDecimal("0.006").setScale(2,RoundingMode.HALF_DOWN)); |
| | | orderCommission = paymentAmount.multiply(new BigDecimal("0.006")); |
| | | tSettlementConfirm.setSharingAmount(sharingAmount.setScale(2, RoundingMode.HALF_DOWN)); |
| | | tSettlementConfirm.setCommissionAmount(commissionAmount.setScale(2, RoundingMode.HALF_DOWN)); |
| | | tSettlementConfirm.setElectrovalence(electrovalence.setScale(2, RoundingMode.HALF_DOWN)); |
| | | tSettlementConfirm.setServiceCharge(serviceCharge.subtract(orderCommission).setScale(2, RoundingMode.HALF_DOWN)); |
| | | tSettlementConfirm.setOrderCommission(orderCommission); |
| | | tSettlementConfirm.setOrderCommission(orderCommission.setScale(2,BigDecimal.ROUND_DOWN)); |
| | | tSettlementConfirm.setVipDiscount(vipDiscount); |
| | | tSettlementConfirm.setCouponDiscount(couponDiscount); |
| | | tSettlementConfirm.setSiteId(dto.getSiteId()); |
| | |
| | | BigDecimal beforeCost= new BigDecimal("0"); |
| | | // 上月利润合计 |
| | | BigDecimal beforeIncome= new BigDecimal("0"); |
| | | int i = 1; |
| | | for (TSettlementConfirm tSettlementConfirm : list1) { |
| | | tSettlementConfirm.setXuhao(i); |
| | | tSettlementConfirm.setMetering(tSettlementConfirm.getSupplyElectronic()); |
| | | List<Site> data1 = siteClient.getSiteByIds(Arrays.asList(tSettlementConfirm.getSiteId())).getData(); |
| | | if (!data1.isEmpty()){ |
| | |
| | | |
| | | |
| | | for (TSettlementConfirm settlementConfirm : list2) { |
| | | int value = parse.getMonth().getValue(); |
| | | settlementConfirm.setMonth(value); |
| | | settlementConfirm.setIncome(settlementConfirm.getElectrovalence().add(settlementConfirm.getServiceCharge())); |
| | | tSettlementConfirm.setMetering(tSettlementConfirm.getSupplyElectronic()); |
| | | if (tSettlementConfirm.getSiteId().equals(settlementConfirm.getSiteId())){ |
| | |
| | | tSettlementConfirm.setTotalPercentage(bigDecimal1+"%"); } |
| | | beforeCost = beforeCost.add(settlementConfirm.getCost()); |
| | | beforeIncome = beforeIncome.add(settlementConfirm.getIncome()); |
| | | |
| | | |
| | | } |
| | | i++; |
| | | } |
| | | TSettlementConfirm tSettlementConfirm = new TSettlementConfirm(); |
| | | tSettlementConfirm.setMonth(parse.getMonthValue()); |
| | | tSettlementConfirm.setMeteringElectronic(meteringElectronic); |
| | | tSettlementConfirm.setChargingElectronic(chargingElectronic); |
| | | tSettlementConfirm.setLossElectronic(lossElectronic); |
| | |
| | | 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} |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.ruoyi.account.api.feignClient.AppUserCarClient; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.THtml; |
| | | import com.ruoyi.other.api.domain.TIntegralRule; |
| | | import com.ruoyi.other.api.domain.TVip; |
| | | import com.ruoyi.other.api.dto.SaveHtml; |
| | | import com.ruoyi.other.service.THtmlService; |
| | | import com.ruoyi.other.service.TIntegralRuleService; |
| | | import com.ruoyi.other.service.TVipService; |
| | | import com.ruoyi.system.api.model.LoginUserApplet; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | private THtmlService htmlService; |
| | | @Autowired |
| | | private TIntegralRuleService integralRuleService; |
| | | @Autowired |
| | | private AppUserClient appUserClient; |
| | | |
| | | |
| | | /** |
| | |
| | | point += jsonObject.getInteger("num4"); |
| | | return R.ok(point); |
| | | } |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | @Autowired |
| | | private TVipService vipService; |
| | | @GetMapping("/getSet") |
| | | @ApiOperation(tags = {"管理后台-积分管理","小程序-个人中心-签到"},value = "获取积分设置") |
| | | public R<TIntegralRule> getSet() { |
| | | TIntegralRule res = integralRuleService.getOne(new QueryWrapper<>()); |
| | | return R.ok(res); |
| | | } |
| | | @GetMapping("/getSet1") |
| | | @ApiOperation(tags = {"小程序-个人中心-签到"},value = "获取积分设置") |
| | | public R<TIntegralRule> getSet1() { |
| | | TIntegralRule res = integralRuleService.getOne(new QueryWrapper<>()); |
| | | LoginUserApplet loginUserApplet = tokenService.getLoginUserApplet(); |
| | | res.setIsDouble(0); |
| | | if (loginUserApplet!=null){ |
| | | TAppUser data = appUserClient.getUserById(loginUserApplet.getUserId()).getData(); |
| | | if (data.getVipEndTime()!=null && data.getVipEndTime().isAfter(LocalDateTime.now())){ |
| | | TVip byId = vipService.getById(data.getVipId()); |
| | | Integer doubleIntegration = byId.getDoubleIntegration(); |
| | | if (doubleIntegration!=null&&doubleIntegration==1){ |
| | | res.setIsDouble(1); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(res); |
| | | } |
| | | |
| | | @PostMapping("/saveSet") |
| | | @ApiOperation(tags = {"管理后台-积分管理"},value = "保存积分设置") |