Merge remote-tracking branch 'origin/master'
| | |
| | | @ApiModelProperty("最低会员价格") |
| | | private BigDecimal minPrice; |
| | | @ApiModelProperty("vip结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private LocalDateTime vipExpireTime; |
| | | @ApiModelProperty("当天是否签到") |
| | | private Integer isSign; |
| | |
| | | private Integer points; |
| | | @ApiModelProperty("当前优惠卷数量") |
| | | private Integer couponNum; |
| | | private Long vipCouponNum; |
| | | @ApiModelProperty("是否第一次添加车") |
| | | private Integer firstAdd; |
| | | @ApiModelProperty("当前绑定的车辆") |
| | |
| | | @TableField("coupon_json") |
| | | private String couponJson; |
| | | |
| | | @TableField("detail_id") |
| | | private Long detailId; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | private LocalDateTime createTime; |
| | | @TableField(exist = false) |
| | | private String avatar; |
| | | @TableField(exist = false) |
| | | private String name; |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<List<UploadRealTimeMonitoringData>> getOrderInfoByCodes(String orderId) { |
| | | public R<List<UploadRealTimeMonitoringData>> getOrderInfoByCodes(String ids) { |
| | | return R.fail("根据订单编号s获取所有监测数据失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public R<List<UploadRealTimeMonitoringData>> getDataByOrderCode(String code) { |
| | |
| | | |
| | | @Override |
| | | public R<UploadRealTimeMonitoringPageData> getAll(MongoChargingOrderQuery mongoChargingOrderQuery) { |
| | | return null; |
| | | return R.fail("getAll:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | import com.ruoyi.integration.api.model.UploadRealTimeMonitoringData; |
| | | import com.ruoyi.integration.api.model.UploadRealTimeMonitoringPageData; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | |
| | | |
| | | /** |
| | | * 批量查询 |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/uploadRealTimeMonitoringData/getOrderInfoByCodes") |
| | | public R<List<UploadRealTimeMonitoringData>> getOrderInfoByCodes(@RequestParam("orderId") String orderId); |
| | | @GetMapping(value = "/uploadRealTimeMonitoringData/getOrderInfoByCodes/{ids}") |
| | | public R<List<UploadRealTimeMonitoringData>> getOrderInfoByCodes(@PathVariable("ids") String ids); |
| | | /** |
| | | * 根据订单编号获取所有监测数据 |
| | | * @param code |
| | |
| | | package com.ruoyi.integration.api.model; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | |
| | | */ |
| | | @Data |
| | | public class BaseModel { |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date last_time = new Date(); |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date create_time = new Date(); |
| | | } |
| | |
| | | @ApiModelProperty(value = "充电枪code ") |
| | | private String chargingGunCode; |
| | | @ApiModelProperty(value = "开始时间2020-01-01 00:00:00 - 2021-01-01 23:59:59") |
| | | private String startTime; |
| | | private String createTime; |
| | | @ApiModelProperty(value = "结束时间2020-01-01 00:00:00 - 2021-01-01 23:59:59") |
| | | private String endTime; |
| | | private String lastTime; |
| | | @ApiModelProperty(value = "订单来源 1明星 2快电 3新电途") |
| | | private Integer orderSource; |
| | | @ApiModelProperty(value = "用户ids 前端忽略") |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | return R.ok(); |
| | | |
| | | } |
| | | @Resource |
| | | private TAppUserVipDetailService appUserVipDetailService; |
| | | |
| | | @ApiOperation(value = "个人中心信息", tags = {"小程序-个人中心"}) |
| | | @GetMapping(value = "/user/info") |
| | |
| | | if (byId.getVipEndTime()==null||byId.getVipEndTime().isBefore(LocalDateTime.now())){ |
| | | appUserInfoDto.setIsVip(0); |
| | | }else { |
| | | TAppUserVipDetail one = appUserVipDetailService.getOne(new LambdaQueryWrapper<TAppUserVipDetail>() |
| | | .eq(TAppUserVipDetail::getAppUserId, userId) |
| | | .eq(TAppUserVipDetail::getVipId, byId.getVipId()) |
| | | .last(" and now() between start_time and end_time")); |
| | | Long count = appCouponService.lambdaQuery().eq(TAppCoupon::getDetailId, one.getId()).count(); |
| | | appUserInfoDto.setVipCouponNum(count); |
| | | appUserInfoDto.setIsVip(1); |
| | | appUserInfoDto.setVipExpireTime(byId.getVipEndTime()); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | for (TInviteUser record : page.getRecords()) { |
| | | TAppUser byId = appUserService.getById(record.getBeInvitedAppUserId()); |
| | | record.setAvatar(byId.getAvatar()); |
| | | record.setName(byId.getName()); |
| | | } |
| | | return R.ok(page); |
| | | } |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.feignClient.AppUserVipDetailClient; |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | import com.ruoyi.account.api.model.TAppUserVipDetail; |
| | | import com.ruoyi.account.api.model.TInviteUser; |
| | | import com.ruoyi.account.api.vo.GetAppUserVipDetail; |
| | | import com.ruoyi.account.mapper.TInviteUserMapper; |
| | | import com.ruoyi.account.service.TAppUserService; |
| | | import com.ruoyi.account.service.TInviteUserService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.TIntegralRule; |
| | | import com.ruoyi.other.api.domain.TVip; |
| | | import com.ruoyi.other.api.feignClient.IntegralRuleClient; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @Autowired |
| | | private IntegralRuleClient integralRuleClient; |
| | | @Autowired |
| | | private TAppUserService appUserService; |
| | | @Resource |
| | | private AppUserVipDetailClient vipDetailClient; |
| | | |
| | | /** |
| | | * |
| | | * @param appUserId 被邀请人 |
| | | * @param beInvitedAppUserId 邀请人 |
| | | */ |
| | | @Override |
| | | public void saveInviteUser(Long appUserId, Long beInvitedAppUserId) { |
| | | |
| | | // 查询用户信息 |
| | | TAppUser user = appUserService.getById(beInvitedAppUserId); |
| | | GetAppUserVipDetail getAppUserVipDetail = new GetAppUserVipDetail(); |
| | | getAppUserVipDetail.setAppUserId(beInvitedAppUserId); |
| | | getAppUserVipDetail.setVipId(user.getVipId()); |
| | | R<TAppUserVipDetail> appUserVipDetail = vipDetailClient.getAppUserVipDetail(getAppUserVipDetail); |
| | | TAppUserVipDetail data1 = appUserVipDetail.getData(); |
| | | String vipJson = data1.getVipJson(); |
| | | TVip vip = JSON.parseObject(vipJson, TVip.class); |
| | | |
| | | // 查询邀请用户获得积分配置 |
| | | TIntegralRule integralRule = integralRuleClient.getSet().getData(); |
| | | JSONObject jsonObject = JSONObject.parseObject(integralRule.getInviteUsersToEarnPoints()); |
| | |
| | | inviteUser.setAppUserId(beInvitedAppUserId); |
| | | inviteUser.setBeInvitedAppUserId(appUserId); |
| | | inviteUser.setCreateTime(LocalDateTime.now()); |
| | | inviteUser.setAward(jsonObject.getInteger("num1")); |
| | | if(Objects.nonNull(vip) && vip.getDoubleIntegration() == 1){ |
| | | inviteUser.setAward(jsonObject.getInteger("num1")*2); |
| | | }else { |
| | | inviteUser.setAward(jsonObject.getInteger("num1")); |
| | | } |
| | | this.save(inviteUser); |
| | | } |
| | | } |
| | |
| | | tAppCoupon.setWaysToObtain(4); |
| | | tAppCoupon.setStatus(1); |
| | | tAppCoupon.setCouponJson(JSON.toJSONString(coupon)); |
| | | tAppCoupon.setDetailId(tAppUserVipDetail.getId()); |
| | | appCouponService.save(tAppCoupon); |
| | | } |
| | | } |
| | |
| | | dto.setAuditStatus(1); |
| | | accountingStrategyService.updateById(dto); |
| | | // 添加明细 |
| | | dto.getAccountingStrategyDetails().forEach(detail -> detail.setAccountingStrategyId(dto.getId())); |
| | | dto.getAccountingStrategyDetails().forEach(detail -> { |
| | | detail.setAccountingStrategyId(dto.getId()); |
| | | detail.setId(null); |
| | | }); |
| | | accountingStrategyDetailService.saveBatch(dto.getAccountingStrategyDetails()); |
| | | }else { |
| | | Long userId = SecurityUtils.getLoginUser().getUserid(); |
| | |
| | | .eq(TParkingLot::getSiteId, siteId))); |
| | | } |
| | | |
| | | @PostMapping(value = "/getRecordById") |
| | | @GetMapping(value = "/getRecordById") |
| | | public R<TParkingRecord> getRecordById(@RequestParam("id") Long id){ |
| | | return R.ok(parkingRecordService.getById(id)); |
| | | } |
| | |
| | | package com.ruoyi.chargingPile.service.impl; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.feignClient.AppUserVipDetailClient; |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | import com.ruoyi.account.api.model.TAppUserVipDetail; |
| | | import com.ruoyi.account.api.vo.GetAppUserVipDetail; |
| | | import com.ruoyi.chargingPile.api.dto.GetSiteListDTO; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | |
| | | import com.ruoyi.chargingPile.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.mapper.SiteMapper; |
| | | import com.ruoyi.chargingPile.service.*; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.ServletUtils; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | |
| | | |
| | | @Resource |
| | | private IntegrationClient integrationClient; |
| | | |
| | | @Resource |
| | | private AppUserVipDetailClient vipDetailClient; |
| | | |
| | | |
| | | /** |
| | |
| | | * @param siteList |
| | | * @return |
| | | */ |
| | | |
| | | @Override |
| | | public PageInfo<GetSiteListDTO> getSiteList(GetSiteList siteList) { |
| | | Set<Integer> ids = null; |
| | |
| | | SysUser sysUser = sysUserClient.getSysUser(SecurityUtils.getUserId()).getData(); |
| | | Integer roleType = sysUser.getRoleType(); |
| | | Integer objectId = sysUser.getObjectId(); |
| | | R<Integer> admin = sysUserClient.isAdmin(SecurityUtils.getUserId()); |
| | | //合作商 |
| | | if(roleType == 2){ |
| | | ids = partnerService.authSite(objectId, SiteMenu.SITE_LIST); |
| | | }else{ |
| | | //非管理员需要根据角色和用户配置查询允许的站点数据 |
| | | if(!SecurityUtils.isAdmin(SecurityUtils.getUserId())){ |
| | | //改用roleId=1来判断 |
| | | if(admin.getData()!=1){ |
| | | // if(!SecurityUtils.isAdmin(SecurityUtils.getUserId())){ |
| | | List<Integer> data = userSiteClient.getSiteIds(sysUser.getUserId()).getData(); |
| | | List<SysUserRoleVo> data2 = sysUserRoleClient.getRoleByUserId(sysUser.getUserId()).getData(); |
| | | if(data2.size() > 0){ |
| | |
| | | SysUser sysUser = sysUserClient.getSysUser(userId).getData(); |
| | | Integer roleType = sysUser.getRoleType(); |
| | | Integer objectId = sysUser.getObjectId(); |
| | | R<Integer> admin = sysUserClient.isAdmin(SecurityUtils.getUserId()); |
| | | |
| | | //合作商 |
| | | if(roleType == 2){ |
| | | ids = partnerService.authSite(objectId, SiteMenu.SITE_LIST); |
| | | }else{ |
| | | //非管理员需要根据角色和用户配置查询允许的站点数据 |
| | | if(!SecurityUtils.isAdmin(SecurityUtils.getUserId())){ |
| | | if(admin.getData()!=1){ |
| | | List<Integer> data = userSiteClient.getSiteIds(sysUser.getUserId()).getData(); |
| | | List<SysUserRoleVo> data2 = sysUserRoleClient.getRoleByUserId(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(data2.get(0).getRoleId()).getData(); |
| | |
| | | @Override |
| | | public PageInfo<SiteVO> pageList(SiteQuery query,Integer isLogin) { |
| | | TAppUser appUser = null; |
| | | // 获取当前登录用户id |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | if(isLogin == 1){ |
| | | // 获取当前登录用户id |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | // 根据id查询用户信息 |
| | | appUser = appUserClient.getUserById(userId).getData(); |
| | | } |
| | |
| | | List<SiteVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | if(Objects.nonNull(appUser) && Objects.nonNull(appUser.getVipId())){ |
| | | // 查询会员信息 |
| | | TVip vip = vipClient.getInfo1(appUser.getVipId()).getData(); |
| | | // TVip vip = vipClient.getInfo1(appUser.getVipId()).getData(); |
| | | GetAppUserVipDetail getAppUserVipDetail = new GetAppUserVipDetail(); |
| | | getAppUserVipDetail.setAppUserId(userId); |
| | | getAppUserVipDetail.setVipId(appUser.getVipId()); |
| | | R<TAppUserVipDetail> appUserVipDetail = vipDetailClient.getAppUserVipDetail(getAppUserVipDetail); |
| | | TAppUserVipDetail data1 = appUserVipDetail.getData(); |
| | | String vipJson = data1.getVipJson(); |
| | | TVip vip = JSON.parseObject(vipJson, TVip.class); |
| | | if(Objects.nonNull(vip) && vip.getType() == 2){ |
| | | list.forEach(item -> { |
| | | if(Objects.nonNull(vip.getDiscount())){ |
| | |
| | | List<SiteVO> list = this.baseMapper.getMapSiteList(query); |
| | | if(Objects.nonNull(appUser) && Objects.nonNull(appUser.getVipId())){ |
| | | // 查询会员信息 |
| | | TVip vip = vipClient.getInfo1(appUser.getVipId()).getData(); |
| | | // TVip vip = vipClient.getInfo1(appUser.getVipId()).getData(); |
| | | GetAppUserVipDetail getAppUserVipDetail = new GetAppUserVipDetail(); |
| | | getAppUserVipDetail.setAppUserId(userId); |
| | | getAppUserVipDetail.setVipId(appUser.getVipId()); |
| | | R<TAppUserVipDetail> appUserVipDetail = vipDetailClient.getAppUserVipDetail(getAppUserVipDetail); |
| | | TAppUserVipDetail data1 = appUserVipDetail.getData(); |
| | | String vipJson = data1.getVipJson(); |
| | | TVip vip = JSON.parseObject(vipJson, TVip.class); |
| | | if(Objects.nonNull(vip) && vip.getType() == 2){ |
| | | list.forEach(item -> { |
| | | item.setVipElectrovalence(vip.getDiscount().divide(new BigDecimal(10)).multiply(item.getServiceCharge()).add(item.getElectrovalenceOriginal())); |
| | |
| | | Set<Integer> siteIds = new HashSet<>(); |
| | | if(0 == query.getSiteId()){ |
| | | SysUser sysUser = sysUserClient.getSysUser(SecurityUtils.getUserId()).getData(); |
| | | R<Integer> admin = sysUserClient.isAdmin(SecurityUtils.getUserId()); |
| | | Integer roleType = sysUser.getRoleType(); |
| | | Integer objectId = sysUser.getObjectId(); |
| | | if(2 == roleType){ |
| | | siteIds = partnerService.authSite(objectId, SiteMenu.SITE_LIST); |
| | | }else{ |
| | | //非管理员需要根据角色和用户配置查询允许的站点数据 |
| | | if(!SecurityUtils.isAdmin(SecurityUtils.getUserId())){ |
| | | if(admin.getData()!=1){ |
| | | List<Integer> data = userSiteClient.getSiteIds(sysUser.getUserId()).getData(); |
| | | List<SysUserRoleVo> data2 = sysUserRoleClient.getRoleByUserId(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(data2.get(0).getRoleId()).getData(); |
| | |
| | | chargingGunService.updateById(chargingGun1); |
| | | |
| | | //桩处于正常,桩所属的枪都处于非正常,修改桩状态为异常 |
| | | TChargingPile chargingPile = this.getById(chargingGun1.getChargingPileId()); |
| | | TChargingPile chargingPile = this.getById(chargingGun.getChargingPileId()); |
| | | List<TChargingGun> list1 = chargingGunService.list(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getChargingPileId, chargingPile.getId()).eq(TChargingGun::getDelFlag, 0)); |
| | | int size = list1.stream().filter(s -> s.getStatus() == 1 || s.getStatus() == 7).collect(Collectors.toList()).size(); |
| | | if(chargingPile.getStatus() == 1 && list1.size() == size){ |
| | |
| | | </if> |
| | | AND site_id IS NULL |
| | | AND (parent_id IS NULL OR audit_status = 1 OR audit_status = 2) |
| | | AND del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} |
| | | |
| | | </where> |
| | | ORDER BY create_time DESC |
| | | </select> |
| | |
| | | |
| | | /** |
| | | * 批量查询 |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/getOrderInfoByCodes") |
| | | public R<List<UploadRealTimeMonitoringData>> getOrderInfoByCodes(@RequestParam("orderId") String orderId){ |
| | | @GetMapping(value = "/getOrderInfoByCodes/{ids}") |
| | | public R<List<UploadRealTimeMonitoringData>> getOrderInfoByCodes(@PathVariable("ids") String ids){ |
| | | List<UploadRealTimeMonitoringData> res = new ArrayList<>(); |
| | | for (String s : orderId.split(",")) { |
| | | for (String s : ids.split(",")) { |
| | | List<UploadRealTimeMonitoringData> dataByOrderCode = uploadRealTimeMonitoringDataService.getDataByOrderCode(s); |
| | | if(dataByOrderCode.size() > 0){ |
| | | UploadRealTimeMonitoringData uploadRealTimeMonitoringData = dataByOrderCode.get(0); |
| | |
| | | import com.ruoyi.common.core.dto.MongoChargingOrderQuery; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface UploadRealTimeMonitoringDataService extends BaseService<UploadRealTimeMonitoringData> { |
| | |
| | | UploadRealTimeMonitoringData getLastDataById(String transaction_serial_number); |
| | | |
| | | void delete(String id); |
| | | |
| | | void updateById(String id); |
| | | } |
| | |
| | | import com.ruoyi.integration.mongodb.service.UploadRealTimeMonitoringDataService; |
| | | import com.ruoyi.common.core.dto.MongoChargingOrderQuery; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.data.domain.Pageable; |
| | | import org.springframework.data.domain.Sort; |
| | | 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.data.mongodb.core.query.Update; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.ParseException; |
| | |
| | | // query.addCriteria(Criteria.where("transaction_serial_number").in(values)); |
| | | // } |
| | | if (mongoChargingOrderQuery.getCode() != null && !mongoChargingOrderQuery.getCode().isEmpty()) { |
| | | query.addCriteria(Criteria.where("transaction_serial_number").regex(mongoChargingOrderQuery.getCode(), "i")); // "i" 表示不区分大小写 |
| | | query.addCriteria(Criteria.where("transaction_serial_number").regex(mongoChargingOrderQuery.getCode(),"i")); // "i" 表示不区分大小写 |
| | | } |
| | | if (mongoChargingOrderQuery.getOrderType() !=null){ |
| | | query.addCriteria(Criteria.where("orderType").is(mongoChargingOrderQuery.getOrderType())); |
| | |
| | | |
| | | |
| | | long totalElements = mongoTemplate.count(query, UploadRealTimeMonitoringData.class); |
| | | // 设置分页 |
| | | Pageable pageable = PageRequest.of(mongoChargingOrderQuery.getPageCurr(), mongoChargingOrderQuery.getPageSize()); |
| | | |
| | | // 创建带有排序的 Pageable 对象 |
| | | Pageable pageable = PageRequest.of( |
| | | mongoChargingOrderQuery.getPageCurr()-1, |
| | | mongoChargingOrderQuery.getPageSize(), |
| | | Sort.by(Sort.Direction.DESC, "create_time") |
| | | ); |
| | | |
| | | // 设置分页和排序 |
| | | query.with(pageable); |
| | | query.with(Sort.by(Sort.Direction.DESC,"create_time")); |
| | | |
| | | // 执行查询并获取 Page 对象 |
| | | List<UploadRealTimeMonitoringData> page = mongoTemplate.find(query, UploadRealTimeMonitoringData.class,"upload_real_time_monitoring_data"); |
| | | |
| | | // 设置分页 |
| | | // Pageable pageable = PageRequest.of(mongoChargingOrderQuery.getPageSize()*(mongoChargingOrderQuery.getPageCurr()-1), mongoChargingOrderQuery.getPageSize()); |
| | | // query.with(pageable); |
| | | // query.with(Sort.by(Sort.Direction.DESC,"create_time")); |
| | | List<UploadRealTimeMonitoringData> uploadRealTimeMonitoringData = mongoTemplate.find( |
| | | query |
| | | , UploadRealTimeMonitoringData.class); |
| | | |
| | | UploadRealTimeMonitoringPageData uploadRealTimeMonitoringPageData = new UploadRealTimeMonitoringPageData(); |
| | | uploadRealTimeMonitoringPageData.setCount(totalElements); |
| | | uploadRealTimeMonitoringPageData.setRecords(uploadRealTimeMonitoringData); |
| | | uploadRealTimeMonitoringPageData.setRecords(page); |
| | | return uploadRealTimeMonitoringPageData; |
| | | } |
| | | |
| | |
| | | mongoTemplate.remove(byId); |
| | | } |
| | | |
| | | @Override |
| | | public void updateById(String id) { |
| | | // 创建查询条件 |
| | | Query query = new Query(Criteria.where("_id").is(id)); |
| | | // 创建更新对象 |
| | | Update update = new Update().set("last_time", new Date()); |
| | | // 执行更新操作 |
| | | mongoTemplate.updateFirst(query, update, UploadRealTimeMonitoringData.class); |
| | | } |
| | | |
| | | } |
| | |
| | | uploadRealTimeMonitoringData.setElectrovalence_all(accountingStrategyDetail.getElectrovalence()); |
| | | uploadRealTimeMonitoringData.setService_charge(accountingStrategyDetail.getServiceCharge()); |
| | | if (Objects.nonNull(data)) { |
| | | data.setLast_time(new Date()); |
| | | uploadRealTimeMonitoringDataService.updateById(data.getId()); |
| | | uploadRealTimeMonitoringData.setPeriod_electric_price(uploadRealTimeMonitoringDataMessage.getPaid_amount().subtract(data.getPaid_amount())); |
| | | uploadRealTimeMonitoringData.setPeriod_charging_degree(uploadRealTimeMonitoringDataMessage.getCharging_degree().subtract(data.getCharging_degree())); |
| | | uploadRealTimeMonitoringData.setPeriod_service_price(uploadRealTimeMonitoringDataMessage.getCharging_degree().multiply(accountingStrategyDetail.getServiceCharge()).setScale(4, RoundingMode.HALF_UP)); |
| | |
| | | // 添加实时上传记录结束记录 |
| | | // 查询mogondb上一条数据 |
| | | UploadRealTimeMonitoringData data = uploadRealTimeMonitoringDataService.getLastDataById(transactionRecordMessage.getTransaction_serial_number()); |
| | | if(Objects.nonNull(data)){ |
| | | if(Objects.nonNull(data) && data.getStatus() != 5){ |
| | | UploadRealTimeMonitoringData uploadRealTimeMonitoringData = new UploadRealTimeMonitoringData(); |
| | | BeanUtils.copyProperties(data,uploadRealTimeMonitoringData); |
| | | uploadRealTimeMonitoringData.setStatus(5); |
| | |
| | | payOrderInfoDto.setPayAmount(byId.getPaymentAmount()); |
| | | payOrderInfoDto.setPayTime(byId.getCreateTime()); |
| | | payOrderInfoDto.setRefundAmount(byId.getRefundAmount()); |
| | | payOrderInfoDto.setRechargeAmount(byId.getRechargeAmount()); |
| | | return R.ok(payOrderInfoDto); |
| | | case 2: |
| | | TShoppingOrder byId1 = shoppingOrderService.getById(orderId); |
| | |
| | | payOrderInfoDto1.setPayAmount(byId1.getPaymentAmount()); |
| | | payOrderInfoDto1.setPayTime(byId1.getCreateTime()); |
| | | payOrderInfoDto1.setRefundAmount(byId1.getRefundAmount()); |
| | | payOrderInfoDto1.setRechargeAmount(byId1.getPaymentAmount()); |
| | | return R.ok(payOrderInfoDto1); |
| | | case 3: |
| | | TVipOrder byId2 = vipOrderService.getById(orderId); |
| | |
| | | payOrderInfoDto2.setPayAmount(byId2.getPaymentAmount()); |
| | | payOrderInfoDto2.setPayTime(byId2.getCreateTime()); |
| | | payOrderInfoDto2.setRefundAmount(byId2.getRefundAmount()); |
| | | payOrderInfoDto2.setRechargeAmount(byId2.getPaymentAmount()); |
| | | return R.ok(payOrderInfoDto2); |
| | | //todo luo 停车场订单 |
| | | // case 4: |
| | |
| | | List<TChargingOrderAccountingStrategy> list = chargingOrderAccountingStrategyService.lambdaQuery().eq(TChargingOrderAccountingStrategy::getChargingOrderId, strategyId).orderByDesc(TChargingOrderAccountingStrategy::getStartTime).list(); |
| | | |
| | | for (TChargingOrderAccountingStrategy tChargingOrderAccountingStrategy : list) { |
| | | if (byId.getVipDiscountAmount()!=null){ |
| | | if (byId.getVipDiscountAmount()!=null && byId.getServiceCharge().compareTo(BigDecimal.ZERO) != 0){ |
| | | BigDecimal multiply = byId.getVipDiscountAmount().divide(byId.getServiceCharge(), 2) |
| | | .multiply(tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice()); |
| | | tChargingOrderAccountingStrategy.setVipDiscount(multiply); |
| | | } |
| | | bigDecimal = bigDecimal.add(tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice()); |
| | | |
| | | if (byId.getCouponDiscountAmount()!=null){ |
| | | if (byId.getCouponDiscountAmount()!=null && byId.getServiceCharge().compareTo(BigDecimal.ZERO) != 0){ |
| | | BigDecimal multiply = byId.getCouponDiscountAmount().divide(byId.getServiceCharge(), 2) |
| | | .multiply(tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice()); |
| | | tChargingOrderAccountingStrategy.setCouponDiscount(multiply); |
| | |
| | | LocalDate sixBefore = PreviousSixMonths.get(); |
| | | Map<String,Object> map = chargingOrderService.countAll(sixBefore); |
| | | BigDecimal data = parkingLotClient.getRecordAmount(sixBefore).getData(); |
| | | if (map ==null){ |
| | | map = new HashMap<String,Object>(); |
| | | } |
| | | map.put("parkingAmount",data); |
| | | BigDecimal data1 = shoppingOrderService.getSumAmount(sixBefore); |
| | | map.put("shopAmount",data1); |
| | |
| | | public R watchChargingOrder(@RequestBody MongoChargingOrderQuery mongoChargingOrderQuery) { |
| | | |
| | | mongoChargingOrderQuery.setPageSize(10); |
| | | UploadRealTimeMonitoringPageData data1 = uploadRealTimeMonitoringDataClient.getAll(mongoChargingOrderQuery).getData(); |
| | | R<UploadRealTimeMonitoringPageData> all = uploadRealTimeMonitoringDataClient.getAll(mongoChargingOrderQuery); |
| | | UploadRealTimeMonitoringPageData data1 = all.getData(); |
| | | |
| | | List<ChargingOrderAndUploadRealTimeMonitoringDataDto> dtos = new ArrayList<>(); |
| | | Map<String,ChargingOrderVO> map = new HashMap<>(); |
| | |
| | | |
| | | //车辆用途 |
| | | List<Map<String, Object>> carMap = chargingOrderService.carUserMethod(); |
| | | |
| | | //车辆品牌 |
| | | List<Map<String, Object>> carBrandMap = chargingOrderService.carUserBrand(); |
| | | List<String> brands = new ArrayList<>(); |
| | | for (Map<String, Object> objectMap : carBrandMap) { |
| | | brands.add(objectMap.get("vehicle_brand").toString()); |
| | | } |
| | | |
| | | Long count = chargingOrderService.countCar(brands); |
| | | Map<String, Object> others = new HashMap<>(); |
| | | others.put("vehicle_brand","其他"); |
| | | others.put("counts",count); |
| | | carBrandMap.add(others); |
| | | //本地车数量 |
| | | Map<String,Object> localCarMap = chargingOrderService.countLocalCar(); |
| | | |
| | |
| | | @ApiOperation(value = "电站评价", tags = {"管理后台-数据分析-设备运维分析"}) |
| | | public R<TCharingUserEquimentVO> equipment(@RequestBody ChargingStatisticsQueryDto statisticsQueryDto){ |
| | | List<Integer> siteIds =new ArrayList<>(); |
| | | if (statisticsQueryDto.getSiteId()==null) { |
| | | if (statisticsQueryDto.getSiteId()==null||statisticsQueryDto.getSiteId()==0) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | //获取当前登录的siteIds |
| | | List<GetSiteListDTO> data = siteClient.getSiteListByUserId(userId).getData(); |
| | |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | List<TChargingOrder> list = chargingOrderService.list(Wrappers.lambdaQuery(TChargingOrder.class) |
| | | .eq(TChargingOrder::getAppUserId, userId) |
| | | .eq(TChargingOrder::getStatus, 3)); |
| | | .in(TChargingOrder::getStatus, Arrays.asList(1,2,3,4))); |
| | | List<Integer> gunIds = list.stream().map(TChargingOrder::getChargingGunId).collect(Collectors.toList()); |
| | | return R.ok(gunIds); |
| | | } |
| | |
| | | .like(manageOrderAppealQuery.getPhone() != null, TOrderAppeal::getPhone, manageOrderAppealQuery.getPhone()) |
| | | .eq(manageOrderAppealQuery.getOrderType() != null, TOrderAppeal::getOrderType, manageOrderAppealQuery.getOrderType()) |
| | | .in(TOrderAppeal::getOrderType, 1, 2) |
| | | .orderByDesc(TOrderAppeal::getFeedbackTime) |
| | | .orderByDesc(TOrderAppeal::getCreateTime) |
| | | .page(Page.of(manageOrderAppealQuery.getPageCurr(), manageOrderAppealQuery.getPageSize())); |
| | | |
| | | for (TOrderAppeal record : page.getRecords()) { |
| | |
| | | private LocalDateTime payTime; |
| | | @ApiModelProperty("退款金额") |
| | | private BigDecimal refundAmount; |
| | | private BigDecimal rechargeAmount; |
| | | |
| | | |
| | | } |
| | |
| | | List<Map<String, Object>> needElec1(@Param("siteIds")List<Integer> siteIds,@Param("statisticsQueryDto") ChargingStatisticsQueryDto statisticsQueryDto); |
| | | |
| | | Long countNoTag(); |
| | | |
| | | Long countCar(@Param("brands") List<String> brands); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<TChargingOrder> getChargingOrder(TChargingOrderVo order); |
| | | |
| | | Long countCar(List<String> brands); |
| | | } |
| | |
| | | chargingBillVO.setOrderCount(list1.size()); |
| | | BigDecimal paymentAmountTotal = new BigDecimal("0"); |
| | | BigDecimal orderAmountTotal = new BigDecimal("0"); |
| | | BigDecimal refundAmountTotal = new BigDecimal("0"); |
| | | BigDecimal electrovalenceTotal = new BigDecimal("0"); |
| | | BigDecimal serviceChargeTotal = new BigDecimal("0"); |
| | | BigDecimal commissionAmountTotal = new BigDecimal("0"); |
| | |
| | | }else if (tChargingOrder.getPaymentAmount()!=null){ |
| | | paymentAmountTotal = paymentAmountTotal.add(tChargingOrder.getPaymentAmount()); |
| | | } |
| | | |
| | | // 累加订单金额 |
| | | if (tChargingOrder.getOrderAmount()!=null){ |
| | | orderAmountTotal = orderAmountTotal.add(tChargingOrder.getOrderAmount()); |
| | |
| | | if (tChargingOrder.getElectrovalence()!=null){ |
| | | electrovalenceTotal = electrovalenceTotal.add(tChargingOrder.getElectrovalence()); |
| | | } |
| | | if (tChargingOrder.getRefundAmount()!=null && tChargingOrder.getRefundStatus()!=null&& tChargingOrder.getRefundStatus()==2){ |
| | | refundAmount = refundAmount.add(tChargingOrder.getRefundAmount()); |
| | | List<TChargingOrderRefund> list2 = chargingOrderRefundService.lambdaQuery().eq(TChargingOrderRefund::getChargingOrderId, tChargingOrder.getId()) |
| | | .eq(TChargingOrderRefund::getRefundStatus, 2).list(); |
| | | for (TChargingOrderRefund tChargingOrderRefund : list2) { |
| | | refundAmountTotal =refundAmountTotal.add(tChargingOrder.getRefundAmount()); |
| | | } |
| | | // 累加累计服务费 |
| | | if (tChargingOrder.getServiceCharge()!=null){ |
| | |
| | | chargingBillVO.setCommissionAmount(commissionAmountTotal.setScale(2, RoundingMode.HALF_DOWN)); |
| | | chargingBillVO.setSharingAmount(sharingAmountTotal.setScale(2, RoundingMode.HALF_DOWN)); |
| | | chargingBillVO.setDiscount(discountTotal); |
| | | |
| | | chargingBillVO.setRefundAmount(refundAmountTotal); |
| | | |
| | | pageInfo.setRecords(list); |
| | | chargingBillVO.setList(pageInfo); |
| | |
| | | myChargingOrderInfo.setChargeMode(chargingGun.getChargeMode()); |
| | | String name = chargingGunClient.getAllName(chargingOrder.getChargingGunId()).getData(); |
| | | myChargingOrderInfo.setName(name); |
| | | if(null != chargingOrder.getAppUserCarId()){ |
| | | TAppUserCar tAppUserCar = appUserCarClient.getCarByIds(Arrays.asList(chargingOrder.getAppUserCarId())).getData().get(0); |
| | | myChargingOrderInfo.setLicensePlate(tAppUserCar.getLicensePlate()); |
| | | }else{ |
| | | myChargingOrderInfo.setLicensePlate("无"); |
| | | if(Objects.nonNull(chargingOrder.getAppUserCarId())){ |
| | | TAppUserCar tAppUserCar = appUserCarClient.getCarById(chargingOrder.getAppUserCarId().toString()).getData(); |
| | | if(null != tAppUserCar){ |
| | | myChargingOrderInfo.setLicensePlate(tAppUserCar.getLicensePlate()); |
| | | }else{ |
| | | myChargingOrderInfo.setLicensePlate("无"); |
| | | } |
| | | } |
| | | myChargingOrderInfo.setStartTime(chargingOrder.getStartTime().atZone(ZoneId.systemDefault()).toInstant().getEpochSecond() * 1000); |
| | | myChargingOrderInfo.setEndTime(chargingOrder.getEndTime().atZone(ZoneId.systemDefault()).toInstant().getEpochSecond() * 1000); |
| | |
| | | String key = "AQJC_" + chargingOrder.getChargingGunId(); |
| | | List<PlatformStartChargingReply> data = platformStartChargingReplyClient.getPlatformStartChargingReply(code).getData(); |
| | | log.error(code + ":-------------------开始检查调起充电结果-------------------" + data.toString()); |
| | | if(null == data || data.size() == 0){ |
| | | return false; |
| | | } |
| | | if(data.size() != 0){ |
| | | PlatformStartChargingReply platformStartChargingReply = data.get(1); |
| | | Integer startup_result = platformStartChargingReply.getStartup_result(); |
| | |
| | | counter = (null == counter ? 0 : counter) + 1; |
| | | boot_failed_map.put(code, counter); |
| | | //启动失败 |
| | | preChargeCheck1.setStartupSuccess(3); |
| | | preChargeCheck1.setStartupSuccess(1); |
| | | preChargeCheck1.setFailureCause(0); |
| | | redisService.setCacheObject(key, preChargeCheck1, 24L, TimeUnit.HOURS); |
| | | return false; |
| | |
| | | if (tChargingOrder.getPaymentAmount().compareTo(payOrderQueryDto.getRefundAmount())==-1){ |
| | | return R.fail("退款金额需小于支付金额"); |
| | | } |
| | | if ((tChargingOrder.getRechargeAmount().subtract(payOrderQueryDto.getRefundAmount()).compareTo(tChargingOrder.getPaymentAmount()))==0){ |
| | | tChargingOrder.setStatus(5); |
| | | } |
| | | |
| | | |
| | | TChargingOrderRefund chargingOrderRefund = new TChargingOrderRefund(); |
| | |
| | | if (tChargingOrder.getPaymentAmount().compareTo(payOrderQueryDto.getRefundAmount())==-1){ |
| | | return R.fail("退款金额需小于支付金额"); |
| | | } |
| | | if ((tChargingOrder.getPaymentAmount().subtract(payOrderQueryDto.getRefundAmount()).compareTo(tChargingOrder.getPaymentAmount()))==0){ |
| | | tChargingOrder.setStatus(5); |
| | | } |
| | | |
| | | 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); |
| | |
| | | if (tChargingOrder.getPaymentAmount().compareTo(payOrderQueryDto.getRefundAmount())==-1){ |
| | | return R.fail("退款金额需小于支付金额"); |
| | | } |
| | | |
| | | |
| | | TVipOrderRefund chargingOrderRefund = new TVipOrderRefund(); |
| | | chargingOrderRefund.setVipOrderId(tChargingOrder.getId()); |
| | | chargingOrderRefund.setRefundAmount(payOrderQueryDto.getRefundAmount()); |
| | |
| | | tSettlementConfirm.setRemark(dto.getRemark()); |
| | | tSettlementConfirm.setServicePartner(dto.getServicePartner()); |
| | | tSettlementConfirm.setServiceMoney(dto.getServiceMoney()); |
| | | BigDecimal subtract = new BigDecimal("1").subtract(dto.getProportionPartner()); |
| | | BigDecimal subtract = new BigDecimal("1").subtract(dto.getProportionPartner().multiply(new BigDecimal("0.01"))); |
| | | // 总电损费用 |
| | | BigDecimal divide = tSettlementConfirm.getProportionMoney().divide(subtract, 2, RoundingMode.HALF_DOWN); |
| | | // 平台承担电损 |
| | |
| | | } |
| | | // 充电总时长 |
| | | |
| | | Long temp = 0L; |
| | | Long temp = 1L; |
| | | if (StringUtils.hasLength(stringBuilder.toString())){ |
| | | List<UploadRealTimeMonitoringData> data6 = uploadRealTimeMonitoringDataClient.getOrderInfoByCodes(stringBuilder.substring(0,stringBuilder.length()-1)).getData(); |
| | | temp+=(data6.stream().mapToLong(UploadRealTimeMonitoringData::getCumulative_charging_time).sum()*60); |
| | | String substring = stringBuilder.substring(0, stringBuilder.length() - 1); |
| | | for (String s : substring.split(",")) { |
| | | UploadRealTimeMonitoringData data6 = uploadRealTimeMonitoringDataClient.chargingOrderInfo(s).getData(); |
| | | if (data6!=null){ |
| | | temp+=(data6.getCumulative_charging_time()*60); |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | List<TChargingPile> data = siteClient.getPileListBySiteId(tSettlementConfirm.getSiteId()).getData(); |
| | | // 计算充电桩的功率平均值 |
| | |
| | | if (tSettlementConfirm.getSiteId().equals(settlementConfirm.getSiteId())){ |
| | | // 电站相同比较收入涨幅跌幅 |
| | | if (tSettlementConfirm.getIncome().compareTo(BigDecimal.ZERO)>0){ |
| | | BigDecimal subtract = tSettlementConfirm.getIncome().subtract(settlementConfirm.getIncome()).divide(tSettlementConfirm.getIncome()).setScale(2, RoundingMode.HALF_DOWN).multiply(new BigDecimal("100")); |
| | | BigDecimal subtract = tSettlementConfirm.getIncome().subtract(settlementConfirm.getIncome()).divide(tSettlementConfirm.getIncome(),2, RoundingMode.HALF_DOWN).multiply(new BigDecimal("100")); |
| | | tSettlementConfirm.setIncomePercentage(subtract+"%"); |
| | | }else { |
| | | tSettlementConfirm.setIncomePercentage("100"+"%"); |
| | |
| | | } |
| | | return this.list(queryWrapper.orderByDesc(TChargingOrder::getCreateTime)); |
| | | } |
| | | |
| | | @Override |
| | | public Long countCar(List<String> brands) { |
| | | return this.baseMapper.countCar(brands); |
| | | } |
| | | } |
| | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | List<Long> appUserIds = list.stream().map(TActivityStatisticslVO::getAppUserId).collect(Collectors.toList()); |
| | | List<TAppUser> appUsers = appUserClient.getUserByIds(appUserIds).getData(); |
| | | |
| | | for (TActivityStatisticslVO tActivityStatisticslVO : list) { |
| | | TAppUser appUser = appUsers.stream().filter(user -> user.getId().equals(tActivityStatisticslVO.getAppUserId())).findFirst().orElse(null); |
| | | if(Objects.nonNull(appUser)){ |
| | | tActivityStatisticslVO.setPhone(appUser.getPhone()); |
| | | } |
| | | // 判断享有了哪些类型 |
| | | switch (tActivityStatisticslVO.getOrderType()){ |
| | | case 1: |
| | |
| | | title, |
| | | `status`, |
| | | order_amount, |
| | | order_amount as payment_amount , |
| | | payment_amount as payment_amount , |
| | | create_time, |
| | | end_time, |
| | | pay_time, |
| | | refund_status, |
| | | (order_amount) as final_amount, |
| | | (recharge_amount-refund_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(electrovalence+service_charge) * 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.006, 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> |
| | |
| | | <select id="getDateData" resultType="java.util.Map"> |
| | | SELECT |
| | | DATE_FORMAT( create_time, '%H:00' ) as time, |
| | | CAST(SUM(service_charge-coupon_discount_amount) AS DECIMAL(20, 6)) as servicecharge, |
| | | CAST(SUM(service_charge) AS DECIMAL(20, 6)) as servicecharge, |
| | | CAST(SUM(charging_capacity) AS DECIMAL(20, 6)) as electrovalence, |
| | | CAST(SUM(electrovalence) AS DECIMAL(20, 4)) AS paymentAmount, |
| | | SUM(payment_amount) AS paymoney, |
| | |
| | | <select id="getWeekData" resultType="java.util.Map"> |
| | | SELECT |
| | | DATE_FORMAT( create_time, '%Y-%m-%d' ) as time, |
| | | SUM(service_charge-coupon_discount_amount) as servicecharge, |
| | | SUM(service_charge) as servicecharge, |
| | | SUM(charging_capacity) as electrovalence, |
| | | SUM(electrovalence) AS paymentAmount, |
| | | SUM(payment_amount) AS paymoney, |
| | |
| | | <select id="getMonthData" resultType="java.util.Map"> |
| | | SELECT |
| | | DATE_FORMAT( create_time, '%Y-%m-%d' ) as time, |
| | | SUM(service_charge-coupon_discount_amount) as servicecharge, |
| | | SUM(service_charge) as servicecharge, |
| | | SUM(charging_capacity) as electrovalence, |
| | | SUM(electrovalence) AS paymentAmount, |
| | | SUM(payment_amount) AS paymoney, |
| | |
| | | <select id="getYearData" resultType="java.util.Map"> |
| | | SELECT |
| | | DATE_FORMAT( create_time, '%Y-%m-%d' ) as time, |
| | | SUM(service_charge-coupon_discount_amount) as servicecharge, |
| | | SUM(service_charge) as servicecharge, |
| | | SUM(charging_capacity) as electrovalence, |
| | | SUM(electrovalence) AS paymentAmount, |
| | | SUM(payment_amount) AS paymoney, |
| | |
| | | <select id="getByDate" resultType="java.util.Map"> |
| | | SELECT |
| | | DATE_FORMAT( create_time, '%Y-%m-%d' ) as time, |
| | | SUM(service_charge-coupon_discount_amount) as servicecharge, |
| | | SUM(service_charge) as servicecharge, |
| | | SUM(charging_capacity) as electrovalence, |
| | | SUM(electrovalence) AS paymentAmount, |
| | | SUM(payment_amount) AS paymoney, |
| | |
| | | SELECT |
| | | 'today' AS data_type, |
| | | '1' as type, |
| | | DATE_FORMAT( create_time, '%Y-%m-%d %H' ) AS time, |
| | | DATE_FORMAT( create_time, '%H:00' ) AS time, |
| | | count(DISTINCT app_user_id) AS counts |
| | | FROM |
| | | t_charging_order |
| | | WHERE |
| | | del_flag = 0 |
| | | AND recharge_payment_status = 2 |
| | | AND ISNULL( refund_status ) |
| | | AND DATE ( create_time ) = CURDATE() |
| | | GROUP BY |
| | | time |
| | |
| | | `charging_pile_order`.`t_charging_order` co |
| | | 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 |
| | | WHERE co.del_flag = 0 and |
| | | co.start_time IS NOT NULL AND co.end_time IS NOT NULL and tc.type = 4 |
| | | <if test="siteIds != null and siteIds.size() > 0"> |
| | | and co.site_id IN |
| | |
| | | `charging_pile_order`.`t_charging_order` co |
| | | 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 |
| | | WHERE co.del_flag = 0 and |
| | | co.start_time IS NOT NULL AND co.end_time IS NOT NULL and tc.type in (2,3) |
| | | <if test="siteIds != null and siteIds.size() > 0"> |
| | | and co.site_id IN |
| | |
| | | `charging_pile_service`.`t_fault_message` co |
| | | LEFT JOIN `charging_pile_service`.`t_charging_pile` cp on co.charging_pile_id = cp.id |
| | | WHERE |
| | | co.down_time IS NOT NULL AND co.end_time IS NOT NULL and cp.type = 1 and co.status =1 |
| | | co.down_time IS NOT NULL AND co.end_time IS NOT NULL and cp.type = 2 and co.status =1 |
| | | <if test="siteIds != null and siteIds.size() > 0"> |
| | | and co.site_id IN |
| | | <foreach collection="siteIds" item="siteId" open="(" separator="," close=")"> |
| | |
| | | <if test="statisticsQueryDto.dayType == 1"> |
| | | AND DATE( create_time ) between #{statisticsQueryDto.startTime} and #{statisticsQueryDto.endTime} |
| | | </if> |
| | | |
| | | <if test="siteIds != null and siteIds.size() > 0"> |
| | | and site_id IN |
| | | <foreach collection="siteIds" item="siteId" open="(" separator="," close=")"> |
| | | #{siteId} |
| | | </foreach> |
| | | </if> |
| | | GROUP BY |
| | | time |
| | | ORDER BY |
| | |
| | | ) and au.del_flag = 0 |
| | | |
| | | </select> |
| | | <select id="countCar" resultType="java.lang.Long"> |
| | | select count(1) |
| | | from |
| | | charging_pile_account.t_app_user_car |
| | | where del_flag = 0 and vehicle_brand not in |
| | | <foreach collection="brands" item="brand" open="(" separator="," close=")"> |
| | | #{brand} |
| | | </foreach> |
| | | </select> |
| | | </mapper> |
| | |
| | | </select> |
| | | <select id="getSumAmout" resultType="java.math.BigDecimal"> |
| | | SELECT |
| | | SUM(payment_amount) AS paymentAmount |
| | | SUM(payment_amount-refund_amount) AS paymentAmount |
| | | FROM |
| | | t_vip_order |
| | | WHERE |