Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile
| | |
| | | @ApiModelProperty(value = "总费用") |
| | | @TableField("order_amount") |
| | | private BigDecimal orderAmount; |
| | | |
| | | @ApiModelProperty(value = "支付金额") |
| | | @TableField("payment") |
| | | private BigDecimal payment; |
| | | |
| | | @ApiModelProperty(value = "支付方式") |
| | | @TableField("payType") |
| | | private String payType; |
| | | |
| | | @ApiModelProperty(value = "状态(1=已进场,2=已出场,3=已缴费出场)") |
| | | @TableField("status") |
| | |
| | | public class QrCodeDelivery { |
| | | |
| | | private String charging_pile_code; // 桩编码 |
| | | private String charging_gun_code; // 枪编码 |
| | | private Integer code_format; // "0:第一种前缀+桩编号 1:第二种前缀+桩编号+枪编号" |
| | | private Integer prefix_length; // 二维码前缀长度长度最大不超过200 字节 |
| | | private String code_prefix; // 如:“www.baidu.com?No=” |
| | |
| | | @Data |
| | | public class TCharingUserEvaluateVO { |
| | | @ApiModelProperty("评价分") |
| | | Long aver; |
| | | Double aver; |
| | | @ApiModelProperty("各个评分数量") |
| | | List<Map<String,Object>> evaluate; |
| | | @ApiModelProperty("差评数量") |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/t-evaluation-tag/getTagList") |
| | | R<List<TEvaluationTagVO>> getTagList(Integer type); |
| | | R<List<TEvaluationTagVO>> getTagList(@RequestParam("type") Integer type); |
| | | /** |
| | | * 获取标签列表 |
| | | * @return |
| | |
| | | roleSiteClient.delRoleSite(dto.getRoleId()); |
| | | //添加站点权限 |
| | | List<TRoleSite> roleSites = new ArrayList<>(); |
| | | for (Integer siteId : dto.getSiteIds()) { |
| | | TRoleSite roleSite = new TRoleSite(); |
| | | roleSite.setRoleId(role.getRoleId().intValue()); |
| | | roleSite.setSiteId(siteId); |
| | | roleSites.add(roleSite); |
| | | if(null != dto.getSiteIds()){ |
| | | for (Integer siteId : dto.getSiteIds()) { |
| | | TRoleSite roleSite = new TRoleSite(); |
| | | roleSite.setRoleId(role.getRoleId().intValue()); |
| | | roleSite.setSiteId(siteId); |
| | | roleSites.add(roleSite); |
| | | } |
| | | } |
| | | roleSiteClient.addRoleSite(roleSites); |
| | | return AjaxResult.success(); |
| | |
| | | siteList.setPageSize(99999); |
| | | PageInfo<GetSiteListDTO> list = siteService.getSiteList(siteList); |
| | | for (GetSiteListDTO record : list.getRecords()) { |
| | | Long count = chargingGunService.lambdaQuery().eq(TChargingGun::getChargingPileId, record.getId()).eq(TChargingGun::getChargeMode, 1).eq(TChargingGun::getStatus, new int[]{3, 4, 5, 6}).count(); |
| | | Long count = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 1).eq(TChargingGun::getStatus, new int[]{3, 4, 5, 6}).count(); |
| | | record.setC1(count); |
| | | Long count1 = chargingGunService.lambdaQuery().eq(TChargingGun::getChargingPileId, record.getId()).eq(TChargingGun::getChargeMode, 1).eq(TChargingGun::getStatus, 2).count(); |
| | | Long count1 = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 1).eq(TChargingGun::getStatus, 2).count(); |
| | | record.setC2(count1); |
| | | Long count2 = chargingGunService.lambdaQuery().eq(TChargingGun::getChargingPileId, record.getId()).eq(TChargingGun::getChargeMode, 2).eq(TChargingGun::getStatus, new int[]{3, 4, 5, 6}).count(); |
| | | Long count2 = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 2).eq(TChargingGun::getStatus, new int[]{3, 4, 5, 6}).count(); |
| | | record.setK1(count2); |
| | | Long count3 = chargingGunService.lambdaQuery().eq(TChargingGun::getChargingPileId, record.getId()).eq(TChargingGun::getChargeMode, 2).eq(TChargingGun::getStatus, 2).count(); |
| | | Long count3 = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 2).eq(TChargingGun::getStatus, 2).count(); |
| | | record.setK2(count3); |
| | | Long count4 = chargingGunService.lambdaQuery().eq(TChargingGun::getChargingPileId, record.getId()).eq(TChargingGun::getChargeMode, 3).eq(TChargingGun::getStatus, new int[]{3, 4, 5, 6}).count(); |
| | | Long count4 = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 3).eq(TChargingGun::getStatus, new int[]{3, 4, 5, 6}).count(); |
| | | record.setM1(count4); |
| | | Long count5 = chargingGunService.lambdaQuery().eq(TChargingGun::getChargingPileId, record.getId()).eq(TChargingGun::getChargeMode, 3).eq(TChargingGun::getStatus, 2).count(); |
| | | Long count5 = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 3).eq(TChargingGun::getStatus, 2).count(); |
| | | record.setM2(count5); |
| | | |
| | | //利用率 |
| | |
| | | |
| | | }else if (byId.getAuditStatus()==2){ |
| | | byId.setTwoRemark(steategyPassDto.getRemark()); |
| | | byId.setTwoAuditTime(LocalDateTime.now()); |
| | | } |
| | | |
| | | byId.setAuditStatus(4); |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.chargingPile.api.dto.CheckChargingStrategyDTO; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.model.TAccountingStrategy; |
| | | import com.ruoyi.chargingPile.api.model.TAccountingStrategyDetail; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.chargingPile.api.model.*; |
| | | import com.ruoyi.chargingPile.api.vo.StrategyPriceVO; |
| | | import com.ruoyi.chargingPile.api.vo.TAccountingStrategyDetailVO; |
| | | import com.ruoyi.chargingPile.service.ISiteService; |
| | | import com.ruoyi.chargingPile.service.TAccountingStrategyDetailService; |
| | | import com.ruoyi.chargingPile.service.TAccountingStrategyService; |
| | | import com.ruoyi.chargingPile.service.TChargingPileService; |
| | | import com.ruoyi.chargingPile.service.*; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | |
| | | |
| | | private final ISiteService siteService; |
| | | private final TChargingPileService chargingPileService; |
| | | private final TChargingGunService chargingGunService; |
| | | private final TAccountingStrategyService accountingStrategyService; |
| | | private final TAccountingStrategyDetailService accountingStrategyDetailService; |
| | | |
| | | @Autowired |
| | | public TAccountingStrategyDetailController(ISiteService siteService, TChargingPileService chargingPileService, TAccountingStrategyService accountingStrategyService, TAccountingStrategyDetailService accountingStrategyDetailService) { |
| | | public TAccountingStrategyDetailController(ISiteService siteService, TChargingPileService chargingPileService, TChargingGunService chargingGunService, TAccountingStrategyService accountingStrategyService, TAccountingStrategyDetailService accountingStrategyDetailService) { |
| | | this.siteService = siteService; |
| | | this.chargingPileService = chargingPileService; |
| | | this.chargingGunService = chargingGunService; |
| | | this.accountingStrategyService = accountingStrategyService; |
| | | this.accountingStrategyDetailService = accountingStrategyDetailService; |
| | | } |
| | |
| | | if(Objects.isNull(chargingPile)){ |
| | | return R.fail("未查询到该桩设备"); |
| | | } |
| | | Site site = siteService.getById(chargingPile.getSiteId()); |
| | | TAccountingStrategy accountingStrategy = accountingStrategyService.getById(site.getAccountingStrategyId()); |
| | | TAccountingStrategyDetail one = accountingStrategyDetailService.getOne(Wrappers.<TAccountingStrategyDetail>lambdaQuery() |
| | | .eq(TAccountingStrategyDetail::getAccountingStrategyId, accountingStrategy.getId()) |
| | | .last(" and DATE_FORMAT(now(), '%H:%i') between start_time and end_time")); |
| | | TChargingGun chargingGun = chargingGunService.getOne(Wrappers.lambdaQuery(TChargingGun.class) |
| | | .eq(TChargingGun::getChargingPileId, chargingPile.getId()) |
| | | .last("LIMIT 1")); |
| | | TAccountingStrategy accountingStrategy = accountingStrategyService.getById(chargingGun.getAccountingStrategyId()); |
| | | TAccountingStrategyDetail one; |
| | | if(Objects.nonNull(accountingStrategy)){ |
| | | one = accountingStrategyDetailService.getOne(Wrappers.<TAccountingStrategyDetail>lambdaQuery() |
| | | .eq(TAccountingStrategyDetail::getAccountingStrategyId, accountingStrategy.getId()) |
| | | .last(" and DATE_FORMAT(now(), '%H:%i') between start_time and end_time")); |
| | | }else { |
| | | Site site = siteService.getById(chargingPile.getSiteId()); |
| | | accountingStrategy = accountingStrategyService.getById(site.getAccountingStrategyId()); |
| | | one = accountingStrategyDetailService.getOne(Wrappers.<TAccountingStrategyDetail>lambdaQuery() |
| | | .eq(TAccountingStrategyDetail::getAccountingStrategyId, accountingStrategy.getId()) |
| | | .last(" and DATE_FORMAT(now(), '%H:%i') between start_time and end_time")); |
| | | } |
| | | return R.ok(one); |
| | | } |
| | | /** |
| | |
| | | if(Objects.isNull(chargingPile)){ |
| | | return R.fail("未查询到该桩设备"); |
| | | } |
| | | Site site = siteService.getById(chargingPile.getSiteId()); |
| | | TAccountingStrategy accountingStrategy = accountingStrategyService.getById(site.getAccountingStrategyId()); |
| | | List<TAccountingStrategyDetail> accountingStrategyDetails = accountingStrategyDetailService.list(Wrappers.<TAccountingStrategyDetail>lambdaQuery() |
| | | .eq(TAccountingStrategyDetail::getAccountingStrategyId, accountingStrategy.getId())); |
| | | return R.ok(accountingStrategyDetails); |
| | | TChargingGun chargingGun = chargingGunService.getOne(Wrappers.lambdaQuery(TChargingGun.class) |
| | | .eq(TChargingGun::getChargingPileId, chargingPile.getId()) |
| | | .last("LIMIT 1")); |
| | | TAccountingStrategy accountingStrategy = accountingStrategyService.getById(chargingGun.getAccountingStrategyId()); |
| | | if(Objects.nonNull(accountingStrategy)){ |
| | | List<TAccountingStrategyDetail> accountingStrategyDetails = accountingStrategyDetailService.list(Wrappers.<TAccountingStrategyDetail>lambdaQuery() |
| | | .eq(TAccountingStrategyDetail::getAccountingStrategyId, accountingStrategy.getId())); |
| | | return R.ok(accountingStrategyDetails); |
| | | }else { |
| | | Site site = siteService.getById(chargingPile.getSiteId()); |
| | | accountingStrategy = accountingStrategyService.getById(site.getAccountingStrategyId()); |
| | | List<TAccountingStrategyDetail> accountingStrategyDetails = accountingStrategyDetailService.list(Wrappers.<TAccountingStrategyDetail>lambdaQuery() |
| | | .eq(TAccountingStrategyDetail::getAccountingStrategyId, accountingStrategy.getId())); |
| | | return R.ok(accountingStrategyDetails); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | private final TChargingPileService chargingPileService; |
| | | private final TChargingGunService chargingGunService; |
| | | |
| | | |
| | | @Resource |
| | | private RedisService redisService; |
| | | |
| | | |
| | | @Resource |
| | | private TFaultMessageService faultMessageService; |
| | | |
| | |
| | | return R.ok(chargingPileService.list(Wrappers.lambdaQuery(TChargingPile.class) |
| | | .in(!siteIds.isEmpty(),TChargingPile::getSiteId,siteIds))); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/pageChargingPileList") |
| | | @ApiOperation(value = "获取充电桩列表数据", tags = {"管理后台-充电桩信息"}) |
| | |
| | | PageInfo<PageChargingPileListDTO> list = chargingPileService.pageChargingPileList(page); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @Log(title = "【充电桩信息】添加充电桩数据", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | @PostMapping("/addChargingPile") |
| | |
| | | public AjaxResult addChargingPile(@RequestBody TChargingPile chargingPile){ |
| | | return chargingPileService.addChargingPile(chargingPile); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/getChargingPile/{id}") |
| | | @ApiOperation(value = "获取充电桩详情数据", tags = {"管理后台-充电桩信息"}) |
| | |
| | | TChargingPile chargingPile = chargingPileService.getChargingPile(id); |
| | | return AjaxResult.success(chargingPile); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @Log(title = "【充电桩信息】编辑充电桩数据", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @PostMapping("/editChargingPile") |
| | |
| | | public AjaxResult editChargingPile(@RequestBody TChargingPile chargingPile){ |
| | | return chargingPileService.editChargingPile(chargingPile); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @DeleteMapping("/delChargingPile") |
| | | @Log(title = "【充电桩信息】删除充电桩", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | |
| | | public AjaxResult delChargingPile(@RequestParam("id") Integer[] id){ |
| | | return chargingPileService.delChargingPile(id); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @Log(title = "【充电桩信息】批量设置计费策略", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @PostMapping("/batchSetAccountingStrategy") |
| | |
| | | chargingPileService.batchSetAccountingStrategy(setAccountingStrategy); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/chargeMonitoring/{siteId}") |
| | | @ApiOperation(value = "获取充电设施监控数据", tags = {"管理后台-充电设备监控"}) |
| | |
| | | ChargingGunCountMonitoring chargingGunCountMonitoring = chargingPileService.getChargingGunCountMonitoring(siteId); |
| | | return AjaxResult.success(chargingGunCountMonitoring); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/getChargingGunMonitoring") |
| | | @ApiOperation(value = "获取充电枪监控数据", tags = {"管理后台-充电设备监控"}) |
| | |
| | | PageInfo<ChargingGunMonitoring> chargingGunMonitoring = chargingPileService.getChargingGunMonitoring(query); |
| | | return AjaxResult.success(chargingGunMonitoring); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据id获取充电桩信息 |
| | | * @param id |
| | |
| | | TChargingPile chargingPile = chargingPileService.getById(id); |
| | | return R.ok(chargingPile); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 更新充电桩状态 |
| | | * @param code |
| | |
| | | TChargingPile chargingPile = chargingPileService.getOne(new LambdaQueryWrapper<TChargingPile>() |
| | | .eq(TChargingPile::getCode, code).eq(TChargingPile::getDelFlag, 0)); |
| | | if(null != chargingPile){ |
| | | if(chargingPile.getStatus() == 1){ |
| | | TFaultMessage faultMessage = new TFaultMessage(); |
| | | faultMessage.setSiteId(chargingPile.getSiteId()); |
| | | faultMessage.setChargingPileId(chargingPile.getId()); |
| | | faultMessage.setStatus(1); |
| | | faultMessage.setDownTime(LocalDateTime.now()); |
| | | faultMessage.setCreateTime(LocalDateTime.now()); |
| | | faultMessage.setDelFlag(false); |
| | | faultMessage.setContent("设备离线"); |
| | | faultMessageService.save(faultMessage); |
| | | |
| | | chargingPile.setStatus(0 == status ? 1 : 3); |
| | | chargingPileService.updateById(chargingPile); |
| | | //充电桩正常,返回异常,处理充电桩状态和添加故障记录 |
| | | if(chargingPile.getStatus() == 1 && 1 == status){ |
| | | TFaultMessage faultMessage = faultMessageService.getOne(new LambdaQueryWrapper<TFaultMessage>().eq(TFaultMessage::getChargingPileId, chargingPile.getId()) |
| | | .eq(TFaultMessage::getStatus, 2).eq(TFaultMessage::getDelFlag, 0).isNull(TFaultMessage::getEndTime)); |
| | | if(null == faultMessage){ |
| | | faultMessage = new TFaultMessage(); |
| | | faultMessage.setSiteId(chargingPile.getSiteId()); |
| | | faultMessage.setChargingPileId(chargingPile.getId()); |
| | | faultMessage.setStatus(2); |
| | | faultMessage.setDownTime(LocalDateTime.now()); |
| | | faultMessage.setCreateTime(LocalDateTime.now()); |
| | | faultMessage.setDelFlag(false); |
| | | faultMessage.setContent("设备故障"); |
| | | faultMessageService.save(faultMessage); |
| | | |
| | | chargingPile.setStatus(0 == status ? 1 : 3); |
| | | chargingPileService.updateById(chargingPile); |
| | | } |
| | | } |
| | | if(chargingPile.getStatus() != 1 && 0 == status){ |
| | | TFaultMessage one = faultMessageService.getOne(new LambdaQueryWrapper<TFaultMessage>().eq(TFaultMessage::getChargingPileId, chargingPile.getId()).isNull(TFaultMessage::getEndTime)); |
| | | TFaultMessage one = faultMessageService.getOne(new LambdaQueryWrapper<TFaultMessage>().eq(TFaultMessage::getChargingPileId, chargingPile.getId()) |
| | | .isNull(TFaultMessage::getEndTime)); |
| | | if(null != one){ |
| | | one.setEndTime(LocalDateTime.now()); |
| | | faultMessageService.updateById(one); |
| | | } |
| | | |
| | | chargingPile.setStatus(0 == status ? 1 : 3); |
| | | chargingPileService.updateById(chargingPile); |
| | | } |
| | | if(0 == status){ |
| | | redisService.getCacheMap("charging_pile_online").put(code, System.currentTimeMillis()); |
| | | Map<String, Object> charging_pile_online = redisService.getCacheMap("charging_pile_online"); |
| | | charging_pile_online.put(code, System.currentTimeMillis()); |
| | | redisService.setCacheMap("charging_pile_online", charging_pile_online); |
| | | } |
| | | } |
| | | } |
| | |
| | | @PostMapping(value = "/getRecordAmount") |
| | | public R<BigDecimal> getRecordAmount(@RequestParam("sixBefore") LocalDate sixBefore){ |
| | | BigDecimal sum = parkingRecordService.getSum(sixBefore); |
| | | return R.ok(); |
| | | return R.ok(sum); |
| | | } |
| | | |
| | | |
| | |
| | | @ApiOperation(tags = {"后台-订单管理-停车记录"},value = "列表") |
| | | @PostMapping(value = "/page") |
| | | public R<Page<TParkingRecord>> page(@RequestBody ParkingRecordPageQuery query) { |
| | | Page<TParkingRecord> page = parkingRecordService.lambdaQuery().ge(query.getStart() != null, TParkingRecord::getCreateTime, query.getStart()) |
| | | .le(query.getEnd() != null, TParkingRecord::getCreateTime, query.getEnd()) |
| | | 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()) |
| | |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import lombok.Data; |
| | | import org.stringtemplate.v4.ST; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | |
| | | public class ParkingRecordPageQuery extends BasePage { |
| | | LocalDate start; |
| | | LocalDate end; |
| | | String timePeriod; |
| | | String licensePlate; |
| | | Integer status; |
| | | Integer outParkingType; |
| | |
| | | String code_prefix = "https://mxcd.zhinenganguan.com?No="; |
| | | QrCodeDelivery qrCodeDelivery = new QrCodeDelivery(); |
| | | qrCodeDelivery.setCharging_pile_code(chargingPile.getCode()); |
| | | qrCodeDelivery.setCharging_gun_code(dto.getCode()); |
| | | qrCodeDelivery.setCode_format(1); |
| | | qrCodeDelivery.setPrefix_length(code_prefix.length()); |
| | | qrCodeDelivery.setCode_prefix(code_prefix); |
| | |
| | | String code_prefix = "https://mxcd.zhinenganguan.com?No="; |
| | | QrCodeDelivery qrCodeDelivery = new QrCodeDelivery(); |
| | | qrCodeDelivery.setCharging_pile_code(chargingPile.getCode()); |
| | | qrCodeDelivery.setCharging_gun_code(dto.getCode()); |
| | | qrCodeDelivery.setCode_format(1); |
| | | qrCodeDelivery.setPrefix_length(code_prefix.length()); |
| | | qrCodeDelivery.setCode_prefix(code_prefix); |
| | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | 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.UploadRealTimeMonitoringDataClient; |
| | | import com.ruoyi.integration.api.model.UploadRealTimeMonitoringData; |
| | |
| | | |
| | | @Resource |
| | | private TFaultMessageService faultMessageService; |
| | | |
| | | @Resource |
| | | private IntegrationClient integrationClient; |
| | | |
| | | |
| | | |
| | |
| | | tChargingGun.setAccountingStrategyId(setAccountingStrategy.getAccountingStrategyId()); |
| | | } |
| | | chargingGunService.updateBatchById(list); |
| | | //下发硬件更新计费模板 |
| | | for (TChargingPile chargingPile : this.listByIds(id)) { |
| | | integrationClient.setupBillingModel1(chargingPile.getCode()); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | if(datas.size() > 0){ |
| | | for (TChargingPile data : datas) { |
| | | if(data.getStatus() == 1){ |
| | | TFaultMessage faultMessage = new TFaultMessage(); |
| | | TFaultMessage faultMessage = faultMessageService.getOne(new LambdaQueryWrapper<TFaultMessage>().eq(TFaultMessage::getChargingPileId, data.getId()) |
| | | .eq(TFaultMessage::getStatus, 1).eq(TFaultMessage::getDelFlag, 0).isNull(TFaultMessage::getEndTime)); |
| | | if(null == faultMessage){ |
| | | faultMessage = new TFaultMessage(); |
| | | faultMessage.setSiteId(data.getSiteId()); |
| | | faultMessage.setChargingPileId(data.getId()); |
| | | faultMessage.setStatus(1); |
| | |
| | | </if> |
| | | AND status = 3 |
| | | </where> |
| | | group by create_time |
| | | ORDER BY create_time DESC |
| | | |
| | | </select> |
| | | <select id="parkingData" resultType="java.util.Map"> |
| | | SELECT |
| | |
| | | parkingRecord.setOutParkingTime(LocalDateTime.parse(order.getLeaveDateTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | parkingRecord.setParkingDuration(Integer.valueOf(order.getLongTime())); |
| | | parkingRecord.setOrderAmount(new BigDecimal(order.getReceivable())); |
| | | parkingRecord.setPayment(new BigDecimal(order.getPayment())); |
| | | parkingRecord.setPayType(order.getPayType()); |
| | | BigDecimal payment = new BigDecimal(order.getPayment()); |
| | | parkingRecord.setStatus(BigDecimal.ZERO.compareTo(payment) == 0 ? 2 : 3); |
| | | parkingRecordClient.updateParkingRecord(parkingRecord); |
| | |
| | | parkingRecord.setOutParkingTime(LocalDateTime.parse(order.getLeavetime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | parkingRecord.setParkingDuration(Integer.valueOf(order.getLongTime())); |
| | | parkingRecord.setOrderAmount(new BigDecimal(order.getMoney())); |
| | | parkingRecord.setPayment(new BigDecimal(order.getMoney())); |
| | | parkingRecordClient.updateParkingRecord(parkingRecord); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/getDataByOrderCode") |
| | | public R<ChargingHandshake> getDataByOrderCode(@RequestParam("code") String code){ |
| | | ChargingHandshake chargingHandshake = chargingHandshakeService.findById(code); |
| | | ChargingHandshake chargingHandshake = chargingHandshakeService.getDataByOrderCode(code); |
| | | return R.ok(chargingHandshake); |
| | | } |
| | | } |
| | |
| | | public JSONObject getMessageJsonString(Object object, String serviceId){ |
| | | JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(object)); |
| | | jsonObject.put("service_id", serviceId); |
| | | log.info("发送数据service_id:{},发送内容:{}",serviceId,jsonObject); |
| | | return jsonObject; |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | |
| | | public interface ChargingHandshakeService extends BaseService<ChargingHandshake> { |
| | | |
| | | |
| | | |
| | | ChargingHandshake getDataByOrderCode(String code); |
| | | |
| | | } |
| | |
| | | import com.ruoyi.integration.mongodb.service.ChargingHandshakeService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneId; |
| | | import java.time.ZonedDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | |
| | | public List<ChargingHandshake> findAll() { |
| | | return mongoTemplate.findAll(ChargingHandshake.class); |
| | | } |
| | | |
| | | @Override |
| | | public ChargingHandshake getDataByOrderCode(String code) { |
| | | List<ChargingHandshake> charging_gun_code = mongoTemplate.find(new Query().addCriteria(Criteria.where("transaction_serial_number").is(code)), ChargingHandshake.class); |
| | | return charging_gun_code.size() > 0 ? charging_gun_code.get(0) : null; |
| | | } |
| | | } |
| | |
| | | public class QrCodeDeliveryMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; // 桩编码 |
| | | private String charging_gun_code; // 枪编码 |
| | | private Integer code_format; // "0:第一种前缀+桩编号 1:第二种前缀+桩编号+枪编号" |
| | | private Integer prefix_length; // 二维码前缀长度长度最大不超过200 字节 |
| | | private String code_prefix; // 如:“www.baidu.com?No=” |
| | |
| | | chargingBillPayExport.setPlatformPay("支付宝小程序支付"); |
| | | |
| | | } |
| | | TChargingOrderRefund one = tChargingOrderRefundService.lambdaQuery().eq(TChargingOrderRefund::getChargingOrderId, tChargingOrder.getId()).one(); |
| | | if (one!=null){ |
| | | chargingBillRefundExport.setRechargeSerialNumber(one.getSerailNumber()); |
| | | chargingBillRefundExport.setCode(one.getCode()); |
| | | chargingBillRefundExport.setPayTime(tChargingOrder.getPayTime()!=null?DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",DateUtils.toDate(tChargingOrder.getPayTime())):""); |
| | | List<TChargingOrderRefund> one1 = tChargingOrderRefundService.lambdaQuery().eq(TChargingOrderRefund::getChargingOrderId, tChargingOrder.getId()).list(); |
| | | for (TChargingOrderRefund one : one1) { |
| | | chargingBillRefundExport.setRechargeSerialNumber(tChargingOrder.getRechargeSerialNumber()); |
| | | 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.setRefundSerialNumber(one.getRefundSerialNumber()); |
| | | chargingBillRefundExports.add(chargingBillRefundExport); |
| | | } |
| | | |
| | | // 支付信息 |
| | | chargingBillPayExport.setId(i+""); |
| | | chargingBillPayExport.setRechargeSerialNumber(tChargingOrder.getRechargeSerialNumber()); |
| | |
| | | @ApiOperation(value = "充电明细", tags = {"管理后台-支付订单-订单信息"}) |
| | | public R<List<TChargingOrderAccountingStrategy>> chargingDetail(Long 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); |
| | | tChargingOrderAccountingStrategy.setStartTime(format+" "+tChargingOrderAccountingStrategy.getStartTime()); |
| | | tChargingOrderAccountingStrategy.setEndTime(format+" "+tChargingOrderAccountingStrategy.getEndTime()); |
| | | } |
| | | |
| | | |
| | | return R.ok(list); |
| | | } |
| | | |
| | |
| | | start = statisticsQueryDto.getStartTime(); |
| | | end = statisticsQueryDto.getEndTime(); |
| | | } |
| | | List<TChargingOrder> list = chargingOrderService.lambdaQuery().ge(TChargingOrder::getStartTime, start).le(TChargingOrder::getEndTime, end).in(TChargingOrder::getSiteId, siteIds).list(); |
| | | List<TChargingOrder> list = chargingOrderService.lambdaQuery().ge(TChargingOrder::getCreateTime, start).le(TChargingOrder::getCreateTime, end).in(TChargingOrder::getSiteId, siteIds).list(); |
| | | List<Long> chargingOrderIds = list.stream().map(TChargingOrder::getId).collect(Collectors.toList()); |
| | | chargingOrderIds.add(-1L); |
| | | //上方饼图 |
| | |
| | | |
| | | //用户标签 |
| | | List<Map<String,Object>> maps = chargingOrderService.getUserTagCount(); |
| | | Map<String,Object> stringObjectMap = new HashMap<>(); |
| | | Long noTagCount = chargingOrderService.countNoTag(); |
| | | stringObjectMap.put("count",noTagCount); |
| | | maps.add(stringObjectMap); |
| | | |
| | | //会员标签 |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getVipCount(); |
| | | |
| | |
| | | siteIds.add(statisticsQueryDto.getSiteId()); |
| | | } |
| | | //查询评价分 |
| | | Long aver = chargingOrderService.getAver(siteIds); |
| | | Double aver = chargingOrderService.getAver(siteIds); |
| | | //查询各个分数 |
| | | List<Map<String,Object>> evaluate = chargingOrderService.getLevelEvaluate(siteIds); |
| | | //查询差评回复数 |
| | | Long count = orderEvaluateService.lambdaQuery().isNotNull(TOrderEvaluate::getResponseTime).count(); |
| | | List<Integer> mark = new ArrayList<>(); |
| | | mark.add(1); |
| | | mark.add(2); |
| | | Long count = orderEvaluateService.lambdaQuery().in(TOrderEvaluate::getMark, mark).isNotNull(TOrderEvaluate::getResponseTime).count(); |
| | | TCharingUserEvaluateVO tCharingUserEvaluateVO = new TCharingUserEvaluateVO(); |
| | | tCharingUserEvaluateVO.setAver(aver); |
| | | tCharingUserEvaluateVO.setEvaluate(evaluate); |
| | |
| | | //将capMap的chargingCapacity除以totalRatedPower保留两位数 |
| | | capMap.forEach(map -> { |
| | | BigDecimal chargingCapacity = (BigDecimal) map.get("chargingCapacity"); |
| | | BigDecimal result = chargingCapacity.divide(totalRatedPower, 2, RoundingMode.HALF_UP); |
| | | map.put("chargingCapacity", result); |
| | | BigDecimal result = chargingCapacity.divide(totalRatedPower, 4, RoundingMode.HALF_UP); |
| | | BigDecimal multiply = result.multiply(new BigDecimal(100)); |
| | | map.put("chargingCapacity", multiply); |
| | | }); |
| | | |
| | | |
| | |
| | | |
| | | Map<String, Object> countLocalCar(); |
| | | |
| | | Long getAver(@Param("siteIds") List<Integer> siteIds); |
| | | Double getAver(@Param("siteIds") List<Integer> siteIds); |
| | | |
| | | List<Map<String, Object>> getLevelEvaluate(@Param("siteIds")List<Integer> siteIds); |
| | | |
| | |
| | | List<Map<String, Object>> countAllUserData(); |
| | | |
| | | List<Map<String, Object>> needElec1(@Param("siteIds")List<Integer> siteIds,@Param("statisticsQueryDto") ChargingStatisticsQueryDto statisticsQueryDto); |
| | | |
| | | Long countNoTag(); |
| | | } |
| | |
| | | |
| | | Map<String, Object> countLocalCar(); |
| | | |
| | | Long getAver(List<Integer> siteIds); |
| | | Double getAver(List<Integer> siteIds); |
| | | |
| | | List<Map<String, Object>> getLevelEvaluate(List<Integer> siteIds); |
| | | |
| | |
| | | * @return |
| | | */ |
| | | EndOfChargePageInfo getEndOfChargePageInfo(String id); |
| | | |
| | | Long countNoTag(); |
| | | } |
| | |
| | | chargingOrder.setRechargePaymentStatus(2); |
| | | chargingOrder.setRechargeSerialNumber(transaction_id); |
| | | chargingOrder.setStatus(2); |
| | | chargingOrder.setPayTime(LocalDateTime.now()); |
| | | |
| | | //添加安全检测数据到缓存中,每步安全检测完成后需要更新缓存数据 |
| | | PreChargeCheck preChargeCheck = new PreChargeCheck(); |
| | |
| | | if(times > m){ |
| | | //充电时间跨度两个计费策略,需要继续对下一个策略进行计算 |
| | | serviceCharge = s_server_amount.multiply(new BigDecimal(m)); |
| | | discountAmount = discountAmount.add(serviceCharge.multiply(new BigDecimal(1).subtract(discount))); |
| | | rechargeAmount1 = rechargeAmount1.subtract(s_total_amount.multiply(new BigDecimal(m))); |
| | | if(null != discount){ |
| | | discountAmount = discountAmount.add(serviceCharge.multiply(new BigDecimal(1).subtract(discount))); |
| | | } |
| | | nowTimeMillis = null; |
| | | }else{ |
| | | serviceCharge = s_server_amount.multiply(new BigDecimal(times)); |
| | | discountAmount = discountAmount.add(serviceCharge.multiply(new BigDecimal(1).subtract(discount))); |
| | | if(null != discount){ |
| | | discountAmount = discountAmount.add(serviceCharge.multiply(new BigDecimal(1).subtract(discount))); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | |
| | | one.setRefundStatus(2); |
| | | one.setRefundTime(LocalDateTime.now()); |
| | | chargingOrderRefundService.updateById(one); |
| | | |
| | | TChargingOrder chargingOrder = this.getById(one.getChargingOrderId()); |
| | | chargingOrder.setRefundStatus(2); |
| | | chargingOrder.setRefundSerialNumber(refund_id); |
| | | chargingOrder.setRefundTime(LocalDateTime.now()); |
| | | this.updateById(chargingOrder); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | |
| | | Integer m = Integer.valueOf(data.getCumulative_charging_time() % 60); |
| | | chargingDetails.setChargedTime(String.format("%02d", h) + ":" + String.format("%02d", m)); |
| | | } |
| | | //转换成UTC时间 |
| | | ChargingHandshake chargingHandshake = chargingHandshakeClient.getDataByOrderCode(one.getCode()).getData(); |
| | | if(null != chargingHandshake && null != data && null != one.getAppUserCarId()){ |
| | | BigDecimal bms_battery_capacity = chargingHandshake.getBms_battery_capacity(); |
| | |
| | | chargingOrderRefund.setRefundTitle("充电完成退款"); |
| | | chargingOrderRefund.setRefundContent("充电完成退款"); |
| | | chargingOrderRefund.setRefundReason("充电完成退款"); |
| | | chargingOrderRefund.setRefundRemark("充电完成退款"); |
| | | chargingOrderRefund.setRefundRemark("实际充电消费金额:" + refundAmount); |
| | | chargingOrderRefund.setRefundTotalAmount(refundAmount); |
| | | chargingOrderRefund.setPayAmount(rechargeAmount); |
| | | if(1 == rechargePaymentType){ |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Long getAver(List<Integer> siteIds) { |
| | | public Double getAver(List<Integer> siteIds) { |
| | | return this.baseMapper.getAver(siteIds); |
| | | } |
| | | |
| | |
| | | public R payRefund(PayOrderRefundDto payOrderQueryDto) { |
| | | if (payOrderQueryDto.getType()==1){ |
| | | TChargingOrder tChargingOrder = this.baseMapper.selectById(payOrderQueryDto.getOrderId()); |
| | | if (tChargingOrder.getPaymentAmount().compareTo(payOrderQueryDto.getRefundAmount())==-1){ |
| | | return R.fail("退款金额需小于支付金额"); |
| | | } |
| | | |
| | | |
| | | TChargingOrderRefund chargingOrderRefund = new TChargingOrderRefund(); |
| | | chargingOrderRefund.setChargingOrderId(tChargingOrder.getId()); |
| | | chargingOrderRefund.setRefundAmount(payOrderQueryDto.getRefundAmount()); |
| | |
| | | } |
| | | if (payOrderQueryDto.getType()==2){ |
| | | TShoppingOrder tChargingOrder = shoppingOrderService.getById(payOrderQueryDto.getOrderId()); |
| | | if (tChargingOrder.getPaymentAmount().compareTo(payOrderQueryDto.getRefundAmount())==-1){ |
| | | return R.fail("退款金额需小于支付金额"); |
| | | } |
| | | TShoppingOrderRefund chargingOrderRefund = new TShoppingOrderRefund(); |
| | | chargingOrderRefund.setShoppingOrderId(tChargingOrder.getId()); |
| | | chargingOrderRefund.setRefundAmount(payOrderQueryDto.getRefundAmount()); |
| | |
| | | |
| | | tChargingOrder.setRefundStatus(2); |
| | | tChargingOrder.setRefundAmount((tChargingOrder.getRefundAmount()==null? BigDecimal.valueOf(0) :tChargingOrder.getRefundAmount()).add(payOrderQueryDto.getRefundAmount())); |
| | | |
| | | if (payOrderQueryDto.getRefundAmount().compareTo(tChargingOrder.getPaymentAmount())==0){ |
| | | tChargingOrder.setStatus(5); |
| | | } |
| | | shoppingOrderService.updateById(tChargingOrder); |
| | | |
| | | shoppingOrderRefundService.save(chargingOrderRefund); |
| | |
| | | tSettlementConfirm.setIncomePercentage(0+"%"); |
| | | tSettlementConfirm.setIncomePercentage(0+"%"); |
| | | }else{ |
| | | BigDecimal subtract = income.subtract(beforeIncome).divide(beforeIncome).setScale(2, RoundingMode.HALF_DOWN).multiply(new BigDecimal("100")); |
| | | BigDecimal subtract = income.subtract(beforeIncome).divide(beforeIncome,2,RoundingMode.HALF_DOWN).multiply(new BigDecimal("100")); |
| | | tSettlementConfirm.setIncomePercentage(subtract+"%"); |
| | | tSettlementConfirm.setIncomePercentage(subtract+"%"); |
| | | |
| | |
| | | info.setDuration(0 == hour ? String.format("%s分钟", second) : String.format("%s小时%s分钟", hour, second)); |
| | | return info; |
| | | } |
| | | |
| | | @Override |
| | | public Long countNoTag() { |
| | | return this.baseMapper.countNoTag(); |
| | | } |
| | | } |
| | |
| | | TChargingOrder tChargingOrder = chargingOrderMapper.selectById(orderAppeal.getOrderId()); |
| | | orderAppealVO.setChargingOrder(tChargingOrder); |
| | | if(Objects.nonNull(tChargingOrder)){ |
| | | SiteNameVO siteNameVO = chargingGunClient.getAllInfoById(tChargingOrder.getChargingGunId()).getData(); |
| | | if(Objects.nonNull(siteNameVO)){ |
| | | orderAppealVO.setGunName(siteNameVO.getGunName()); |
| | | orderAppealVO.setGunNumber(siteNameVO.getGunNumber()); |
| | | orderAppealVO.setPileName(siteNameVO.getPileName()); |
| | | orderAppealVO.setPileNumber(siteNameVO.getPileNumber()); |
| | | orderAppealVO.setSiteName(siteNameVO.getSiteName()); |
| | | } |
| | | orderAppealVO.setEndMode(tChargingOrder.getEndMode()); |
| | | } |
| | | }else if (orderAppeal.getOrderType() == 2) { |
| | |
| | | title, |
| | | `status`, |
| | | order_amount, |
| | | payment_amount , |
| | | order_amount as payment_amount , |
| | | create_time, |
| | | end_time, |
| | | pay_time, |
| | | refund_status, |
| | | (payment_amount-refund_amount) as final_amount, |
| | | (order_amount) as final_amount, |
| | | del_flag, |
| | | app_user_id |
| | | FROM |
| | |
| | | |
| | | </select> |
| | | <select id="countAll" resultType="java.util.Map"> |
| | | select sum(electrovalence) as electrovalence,sum(service_charge) as service_charge,ROUND(sum(order_amount) * 0.0006, 2) as commission_amount,sum(sharing_amount) as sharing_amount |
| | | select sum(electrovalence) as electrovalence,sum(service_charge) as service_charge,ROUND(sum(electrovalence+service_charge) * 0.0006, 2) as commission_amount,sum(sharing_amount) as sharing_amount |
| | | from t_charging_order |
| | | where create_time >= #{sixBefore} and del_flag = 0 and recharge_payment_status = 2 |
| | | </select> |
| | |
| | | SUM(service_charge-coupon_discount_amount) as servicecharge, |
| | | SUM(charging_capacity) as electrovalence, |
| | | SUM(electrovalence) AS paymentAmount, |
| | | SUM(payment_amount) AS paymoney, |
| | | count(1) as orderCount |
| | | FROM |
| | | t_charging_order |
| | |
| | | SUM(service_charge-coupon_discount_amount) as servicecharge, |
| | | SUM(charging_capacity) as electrovalence, |
| | | SUM(electrovalence) AS paymentAmount, |
| | | SUM(payment_amount) AS paymoney, |
| | | count(1) as orderCount |
| | | FROM |
| | | t_charging_order |
| | |
| | | SUM(service_charge-coupon_discount_amount) as servicecharge, |
| | | SUM(charging_capacity) as electrovalence, |
| | | SUM(electrovalence) AS paymentAmount, |
| | | SUM(payment_amount) AS paymoney, |
| | | |
| | | count(1) as orderCount |
| | | FROM |
| | |
| | | DATE_FORMAT( create_time, '%Y-%m-%d' ) as time, |
| | | SUM(service_charge-coupon_discount_amount) as servicecharge, |
| | | SUM(charging_capacity) as electrovalence, |
| | | SUM(electrovalence) AS paymentAmount, |
| | | SUM(payment_amount) AS paymoney, |
| | | |
| | | count(1) as orderCount |
| | | FROM |
| | | t_charging_order |
| | |
| | | charging_pile_account.t_app_user_tag a |
| | | JOIN ( SELECT app_user_id, MAX( create_time ) AS max_create_time FROM charging_pile_account.t_app_user_tag GROUP BY app_user_id ) b ON a.app_user_id = b.app_user_id |
| | | AND a.create_time = b.max_create_time |
| | | LEFT JOIN `charging_pile_other`.`t_user_tag` ct on a.user_tag_id = ct.id |
| | | WHERE ct.del_flag = 0 |
| | | ) o |
| | | LEFT JOIN `charging_pile_other`.`t_user_tag` tt on o.user_tag_id = tt.id |
| | | GROUP BY |
| | |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType == 5"> |
| | | <if test="statisticsQueryDto.startTime != null"> |
| | | AND co.create_time >= #{statisticsQueryDto.startTime} |
| | | and DATE(co.create_time) >= #{statisticsQueryDto.startTime} |
| | | </if> |
| | | <if test="statisticsQueryDto.endTime != null"> |
| | | AND co.create_time <= #{statisticsQueryDto.endTime} |
| | | and DATE(co.create_time) <= #{statisticsQueryDto.endTime} |
| | | </if> |
| | | </if> |
| | | </where> |
| | |
| | | GROUP BY vehicle_use |
| | | </select> |
| | | <select id="carUserBrand" resultType="java.util.Map"> |
| | | |
| | | SELECT |
| | | count(1) as counts,vehicle_brand |
| | | from charging_pile_account.t_app_user_car |
| | | where del_flag = 0 |
| | | where del_flag = 0 |
| | | |
| | | GROUP BY vehicle_brand |
| | | ORDER BY counts DESC |
| | | limit 5 |
| | | </select> |
| | | <select id="countLocalCar" resultType="java.util.Map"> |
| | | SELECT |
| | |
| | | WHERE |
| | | del_flag = 0 |
| | | </select> |
| | | <select id="getAver" resultType="java.lang.Long"> |
| | | <select id="getAver" resultType="java.lang.Double"> |
| | | SELECT |
| | | ROUND(AVG(te.mark), 2) AS average_mark |
| | | FROM |
| | |
| | | SELECT |
| | | FORMAT(SUM(TIME_TO_SEC(TIMEDIFF(co.end_time, co.start_time)) / |
| | | <if test="statisticsQueryDto.dayType == 1"> |
| | | 86400 |
| | | 864 |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType == 2"> |
| | | 604800 |
| | | 6048 |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType == 3"> |
| | | 2592000 |
| | | 25920 |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType == 4"> |
| | | 31536000 |
| | | 315360 |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType == 5"> |
| | | (86400*(SELECT TIMESTAMPDIFF(DAY, statisticsQueryDto.startTime, statisticsQueryDto.endTime) AS days_difference |
| | | (86400*(SELECT TIMESTAMPDIFF(DAY, #{statisticsQueryDto.startTime}, #{statisticsQueryDto.endTime}) +1 AS days_difference |
| | | )) |
| | | </if> |
| | | |
| | |
| | | AND YEAR( co.create_time ) = YEAR(CURDATE() ) |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType == 5"> |
| | | <if test="statisticsQueryDto.startTime != null"> |
| | | AND co.create_time >= #{statisticsQueryDto.startTime} |
| | | </if> |
| | | <if test="statisticsQueryDto.endTime != null"> |
| | | AND co.create_time <= #{statisticsQueryDto.endTime} |
| | | </if> |
| | | |
| | | and DATE(co.create_time) >= #{statisticsQueryDto.startTime} |
| | | |
| | | |
| | | and DATE(co.create_time) <= #{statisticsQueryDto.endTime} |
| | | |
| | | </if> |
| | | GROUP BY tc.name,cp.name,co.charging_gun_id |
| | | |
| | |
| | | 31536000 |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType == 5"> |
| | | (86400*(SELECT TIMESTAMPDIFF(DAY, statisticsQueryDto.startTime, statisticsQueryDto.endTime) AS days_difference |
| | | (86400*(SELECT TIMESTAMPDIFF(DAY, #{statisticsQueryDto.startTime}, #{statisticsQueryDto.endTime}) +1 AS days_difference |
| | | )) |
| | | </if> |
| | | |
| | |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType == 5"> |
| | | <if test="statisticsQueryDto.startTime != null"> |
| | | AND co.create_time >= #{statisticsQueryDto.startTime} |
| | | and DATE(co.create_time) >= #{statisticsQueryDto.startTime} |
| | | </if> |
| | | <if test="statisticsQueryDto.endTime != null"> |
| | | AND co.create_time <= #{statisticsQueryDto.endTime} |
| | | and DATE(co.create_time) <= #{statisticsQueryDto.endTime} |
| | | </if> |
| | | </if> |
| | | GROUP BY tc.name,cp.name,co.charging_gun_id |
| | |
| | | 31536000 |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType == 5"> |
| | | (86400*(SELECT TIMESTAMPDIFF(DAY, statisticsQueryDto.startTime, statisticsQueryDto.endTime) AS days_difference |
| | | (86400*(SELECT TIMESTAMPDIFF(DAY, #{statisticsQueryDto.startTime}, #{statisticsQueryDto.endTime}) +1 AS days_difference |
| | | )) |
| | | </if> |
| | | |
| | |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType == 5"> |
| | | <if test="statisticsQueryDto.startTime != null"> |
| | | AND co.create_time >= #{statisticsQueryDto.startTime} |
| | | and DATE(co.create_time) >= #{statisticsQueryDto.startTime} |
| | | </if> |
| | | <if test="statisticsQueryDto.endTime != null"> |
| | | AND co.create_time <= #{statisticsQueryDto.endTime} |
| | | and DATE(co.create_time) <= #{statisticsQueryDto.endTime} |
| | | </if> |
| | | </if> |
| | | GROUP BY tc.name,cp.name,co.charging_gun_id |
| | |
| | | 31536000 |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType == 5"> |
| | | (86400*(SELECT TIMESTAMPDIFF(DAY, statisticsQueryDto.startTime, statisticsQueryDto.endTime) AS days_difference |
| | | (86400*(SELECT TIMESTAMPDIFF(DAY, #{statisticsQueryDto.startTime}, #{statisticsQueryDto.endTime}) +1 AS days_difference |
| | | )) |
| | | </if> |
| | | |
| | |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType == 5"> |
| | | <if test="statisticsQueryDto.startTime != null"> |
| | | AND co.create_time >= #{statisticsQueryDto.startTime} |
| | | and DATE(co.create_time) >= #{statisticsQueryDto.startTime} |
| | | </if> |
| | | <if test="statisticsQueryDto.endTime != null"> |
| | | AND co.create_time <= #{statisticsQueryDto.endTime} |
| | | and DATE(co.create_time) <= #{statisticsQueryDto.endTime} |
| | | </if> |
| | | </if> |
| | | GROUP BY tc.name,cp.name,co.charging_gun_id |
| | |
| | | 31536000 |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType == 5"> |
| | | (86400*(SELECT TIMESTAMPDIFF(DAY, statisticsQueryDto.startTime, statisticsQueryDto.endTime) AS days_difference |
| | | (86400*(SELECT TIMESTAMPDIFF(DAY, #{statisticsQueryDto.startTime}, #{statisticsQueryDto.endTime}) +1 AS days_difference |
| | | )) |
| | | </if> |
| | | |
| | |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType == 5"> |
| | | <if test="statisticsQueryDto.startTime != null"> |
| | | AND co.create_time >= #{statisticsQueryDto.startTime} |
| | | and DATE(co.create_time) >= #{statisticsQueryDto.startTime} |
| | | </if> |
| | | <if test="statisticsQueryDto.endTime != null"> |
| | | AND co.create_time <= #{statisticsQueryDto.endTime} |
| | | and DATE(co.create_time) <= #{statisticsQueryDto.endTime} |
| | | </if> |
| | | </if> |
| | | GROUP BY tc.name,cp.name,co.charging_gun_id |
| | |
| | | 31536000 |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType == 5"> |
| | | (86400*(SELECT TIMESTAMPDIFF(DAY, statisticsQueryDto.startTime, statisticsQueryDto.endTime) AS days_difference |
| | | (86400*(SELECT TIMESTAMPDIFF(DAY, #{statisticsQueryDto.startTime}, #{statisticsQueryDto.endTime}) +1 AS days_difference |
| | | )) |
| | | </if> |
| | | |
| | |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType == 5"> |
| | | <if test="statisticsQueryDto.startTime != null"> |
| | | AND co.create_time >= #{statisticsQueryDto.startTime} |
| | | and DATE(co.create_time) >= #{statisticsQueryDto.startTime} |
| | | </if> |
| | | <if test="statisticsQueryDto.endTime != null"> |
| | | AND co.create_time <= #{statisticsQueryDto.endTime} |
| | | and DATE(co.create_time) <= #{statisticsQueryDto.endTime} |
| | | </if> |
| | | </if> |
| | | GROUP BY tc.name,cp.name,co.charging_gun_id |
| | |
| | | LEFT JOIN `charging_pile_service`.`t_charging_gun` tc ON co.charging_gun_id = tc.id |
| | | LEFT JOIN `charging_pile_service`.`t_charging_pile` cp ON tc.charging_pile_id = cp.id |
| | | <where> |
| | | cp.type = 1 |
| | | cp.type = 1 and co.need_elec != 0 |
| | | <if test="siteIds != null and siteIds.size() > 0"> |
| | | and co.site_id IN |
| | | <foreach collection="siteIds" item="siteId" open="(" separator="," close=")"> |
| | |
| | | AND YEAR( co.create_time ) = YEAR(CURDATE() ) |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType == 5"> |
| | | <if test="statisticsQueryDto.startTime != null"> |
| | | AND co.create_time >= #{statisticsQueryDto.startTime} |
| | | </if> |
| | | <if test="statisticsQueryDto.endTime != null"> |
| | | AND co.create_time <= #{statisticsQueryDto.endTime} |
| | | </if> |
| | | |
| | | and DATE(co.create_time) >= #{statisticsQueryDto.startTime} |
| | | |
| | | and DATE(co.create_time) <= #{statisticsQueryDto.endTime} |
| | | |
| | | </if> |
| | | </where> |
| | | GROUP BY |
| | |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType == 5"> |
| | | <if test="statisticsQueryDto.startTime != null"> |
| | | AND co.create_time >= #{statisticsQueryDto.startTime} |
| | | and DATE(co.create_time) >= #{statisticsQueryDto.startTime} |
| | | </if> |
| | | <if test="statisticsQueryDto.endTime != null"> |
| | | AND co.create_time <= #{statisticsQueryDto.endTime} |
| | | and DATE(co.create_time) <= #{statisticsQueryDto.endTime} |
| | | </if> |
| | | </if> |
| | | </where> |
| | |
| | | cp.name, |
| | | co.charging_gun_id; |
| | | </select> |
| | | <select id="countNoTag" resultType="java.lang.Long"> |
| | | SELECT count(1) |
| | | from `charging_pile_account`.`t_app_user` au |
| | | WHERE au.id not IN ( |
| | | SELECT app_user_id |
| | | from `charging_pile_account`.`t_app_user_tag` |
| | | GROUP BY app_user_id |
| | | |
| | | ) and au.del_flag = 0 |
| | | |
| | | </select> |
| | | </mapper> |
| | |
| | | <select id="sixBefore" resultType="com.ruoyi.order.dto.SixShopDto"> |
| | | SELECT |
| | | DATE_FORMAT( subquery.create_time, '%m' ) AS MONTH, |
| | | count(1) AS orderNum, |
| | | count(1) AS count, |
| | | SUM(payment_amount) AS paymentAmount |
| | | FROM |
| | | ( |
| | |
| | | SELECT |
| | | vip_id, |
| | | create_time, |
| | | payment_amount |
| | | (payment_amount - refund_amount) as payment_amount |
| | | FROM |
| | | t_vip_order |
| | | <where> |
| | |
| | | GROUP BY |
| | | DATE_FORMAT(subquery.create_time, '%Y-%m'), |
| | | tp.`name` |
| | | |
| | | ORDER BY MONTH asc |
| | | |
| | | </select> |
| | | <select id="getSumAmout" resultType="java.math.BigDecimal"> |
| | |
| | | t_vip_order |
| | | WHERE |
| | | del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} AND |
| | | payment_status = 2 AND |
| | | refund_amount IS NULL |
| | | payment_status = 2 |
| | | <if test="sixBefore != null"> |
| | | AND create_time > #{sixBefore} |
| | | </if> |