Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile
| | |
| | | |
| | | @GetMapping("/site/getSiteList/byUserId") |
| | | R<List<GetSiteListDTO>> getSiteListByUserId(@RequestParam("userId") Long userId); |
| | | @GetMapping("/getPartnerR/{id}") |
| | | @GetMapping("/partner/getPartnerR/{id}") |
| | | R<Partner> getPartnerR(@PathVariable("id") Integer id); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<List<UploadRealTimeMonitoringData>> getAll(MongoChargingOrderQuery mongoChargingOrderQuery) { |
| | | public R<UploadRealTimeMonitoringPageData> getAll(MongoChargingOrderQuery mongoChargingOrderQuery) { |
| | | return null; |
| | | } |
| | | }; |
| | |
| | | import com.ruoyi.common.core.dto.MongoChargingOrderQuery; |
| | | import com.ruoyi.integration.api.factory.UploadRealTimeMonitoringDataFallbackFactory; |
| | | 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; |
| | |
| | | R<List<UploadRealTimeMonitoringData>> getDataByOrderCode(@RequestParam("code") String code); |
| | | |
| | | @PostMapping("/uploadRealTimeMonitoringData/getAll") |
| | | R<List<UploadRealTimeMonitoringData>> getAll(@RequestBody MongoChargingOrderQuery mongoChargingOrderQuery); |
| | | R<UploadRealTimeMonitoringPageData> getAll(@RequestBody MongoChargingOrderQuery mongoChargingOrderQuery); |
| | | } |
| | |
| | | public class ChargingOrderAndUploadRealTimeMonitoringDataDto extends BaseModel { |
| | | |
| | | private String id; |
| | | private Integer index; |
| | | private String transaction_serial_number; // 交易流水号 |
| | | private String charging_pile_code; // 桩编码 |
| | | private String charging_gun_code; // 抢号 |
New file |
| | |
| | | package com.ruoyi.integration.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 上传实时监测数据 |
| | | **/ |
| | | |
| | | @Data |
| | | public class PageChargingOrderAndUploadRealTimeMonitoringDataDto extends BaseModel { |
| | | |
| | | private List<ChargingOrderAndUploadRealTimeMonitoringDataDto> records; |
| | | private Long total; |
| | | |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.integration.api.model; |
| | | |
| | | import jdk.internal.dynalink.linker.LinkerServices; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 上传实时监测数据 |
| | | **/ |
| | | |
| | | @Data |
| | | @Document(collection = "upload_real_time_monitoring_data") //指定要对应的文档名(表名) |
| | | @Accessors(chain = true) |
| | | public class UploadRealTimeMonitoringPageData extends BaseModel { |
| | | Long count; |
| | | List<UploadRealTimeMonitoringData> records; |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | @TableId(value = "id", type = IdType.NONE) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "地址json") |
| | | @TableField("address_json") |
| | | private String addressJson; |
| | | @ApiModelProperty(value = "订单编号") |
| | | @TableField("code") |
| | | private String code; |
| | |
| | | @TableField("vip_id") |
| | | private Integer vipId; |
| | | @ApiModelProperty(value = "购买的会员id") |
| | | @TableField("vip_id") |
| | | @TableField("order_amount") |
| | | private BigDecimal orderAmount; |
| | | } |
| | |
| | | @TableField("refund_serial_number") |
| | | private String refundSerialNumber; |
| | | |
| | | @ApiModelProperty(value = "地址json") |
| | | @TableField("address_json") |
| | | private String addressJson; |
| | | |
| | | @ApiModelProperty(value = "退款成功时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField("refund_time") |
| | |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | @ApiModelProperty(value = "退款状态(1=退款中,2=退款成功)") |
| | | @TableField("refund_status") |
| | | private Integer refundStatus; |
| | | |
| | | @ApiModelProperty(value = "订单编号") |
| | | @TableField("code") |
| | |
| | | @ApiModelProperty(value = "类型(1=开始,2=结束)") |
| | | private Integer type; |
| | | @ApiModelProperty(value = "站点ids 选择全部 不传") |
| | | private List<Integer> siteIds; |
| | | private Integer siteIds; |
| | | @ApiModelProperty(value = "合作商id ") |
| | | private Integer partnerId; |
| | | @ApiModelProperty(value = "开始时间2020-01-01 00:00:00") |
| | |
| | | @ApiModelProperty(value = "结束时间2021-01-01 23:59:59") |
| | | private String endTime; |
| | | |
| | | |
| | | } |
| | |
| | | private List<Map<String,Object>> maps; |
| | | @ApiModelProperty("下方折线图") |
| | | private List<Map<String,Object>> maps1; |
| | | private BigDecimal allMoney; |
| | | private BigDecimal commissionAmount; |
| | | } |
| | |
| | | * 用户名id |
| | | */ |
| | | private Long userId; |
| | | private String userIdStr; |
| | | |
| | | /** |
| | | * 用户手机号 |
| | |
| | | // 计算预付金额能充多少度普通电 |
| | | BigDecimal divide1 = money.divide(electrovalence, 2, BigDecimal.ROUND_HALF_UP); |
| | | // 计算冲会员电能充多少度会员电 |
| | | BigDecimal divide = vipElectrovalence.divide(electrovalence, 2, BigDecimal.ROUND_HALF_UP); |
| | | BigDecimal divide = money.divide(vipElectrovalence, 2, BigDecimal.ROUND_HALF_UP); |
| | | BigDecimal subtract = divide.subtract(divide1); |
| | | // 优惠金额 |
| | | data.setMoney(subtract.multiply(vipElectrovalence).setScale(2, BigDecimal.ROUND_HALF_UP)); |
| | | data.setMoney(subtract.multiply(electrovalence.subtract(vipElectrovalence)).setScale(2, BigDecimal.ROUND_HALF_UP)); |
| | | return AjaxResult.ok(data); |
| | | } |
| | | /** |
| | |
| | | public R getModel(String id) throws Exception { |
| | | String modelById = CarBrandUtil.getModelById(id); |
| | | JSONObject jsonObject = JSON.parseObject(modelById); |
| | | Integer code = jsonObject.getInteger("code"); |
| | | if (code==701){ |
| | | return R.fail("当前品牌暂无分类"); |
| | | } |
| | | JSONArray data = jsonObject.getJSONArray("data"); |
| | | JSONArray backList = new JSONArray(); |
| | | for (Object datum : data) { |
| | |
| | | import com.ruoyi.account.mapper.TAppUserMapper; |
| | | import com.ruoyi.account.service.TAppUserService; |
| | | import com.ruoyi.account.service.TInviteUserService; |
| | | import com.ruoyi.account.util.RptUtils; |
| | | import com.ruoyi.account.wx.model.WeixinProperties; |
| | | import com.ruoyi.account.wx.pojo.AppletUserDecodeData; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | |
| | | import com.ruoyi.system.api.model.LoginUserApplet; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.util.HashMap; |
| | |
| | | break; |
| | | } |
| | | } |
| | | appUser.setAvatar(appletUserDecodeData.getAvatarUrl()); |
| | | |
| | | appUser.setAvatar(StringUtils.hasLength(appletUserDecodeData.getAvatarUrl())?appletUserDecodeData.getAvatarUrl():"http://221.182.45.100:8090/2024-10-26/logo.png"); |
| | | appUser.setName(StringUtils.hasLength(appletUserDecodeData.getNickName())?appletUserDecodeData.getNickName():RptUtils.around(appletUserDecodeData.getPhoneNumber(),3,4)); |
| | | appUser.setCity(appletUserDecodeData.getCity()); |
| | | appUser.setName(appletUserDecodeData.getNickName()); |
| | | appUser.setProvince(appletUserDecodeData.getProvince()); |
| | | appUser.setWxOpenid(appletUserDecodeData.getOpenId()); |
| | | this.saveOrUpdate(appUser); |
| | |
| | | } |
| | | } |
| | | appUser.setAliOpenid(response.getOpenId()); |
| | | appUser.setAvatar("http://221.182.45.100:8090/2024-10-26/logo.png"); |
| | | appUser.setName(RptUtils.around(phone,3,4)); |
| | | this.saveOrUpdate(appUser); |
| | | if(Objects.nonNull(inviteUserId)){ |
| | | inviteUserService.saveInviteUser(appUser.getId(), inviteUserId); |
| | |
| | | LoginUserApplet loginUserApplet = new LoginUserApplet(); |
| | | if(ObjectUtils.isNotNull(appUser)){ |
| | | loginUserApplet.setUserId(appUser.getId()); |
| | | loginUserApplet.setUserIdStr(appUser.getId().toString()); |
| | | loginUserApplet.setName(appUser.getName()); |
| | | loginUserApplet.setPhone(appUser.getPhone()); |
| | | loginUserApplet.setAvatar(appUser.getAvatar()); |
| | |
| | | " \"city\": \"北京\",\n" + |
| | | " \"province\": \"北京\",\n" + |
| | | " \"Pcode\": \"BJ\",\n" + |
| | | " \"AreaCode\": \"110000\"\n" + |
| | | " \"AreaCode\": \"110100\"\n" + |
| | | " },\n" + |
| | | " {\n" + |
| | | " \"Hp\": \"京B\",\n" + |
| | | " \"city\": \"北京\",\n" + |
| | | " \"province\": \"北京\",\n" + |
| | | " \"Pcode\": \"BJ\",\n" + |
| | | " \"AreaCode\": \"110000\"\n" + |
| | | " \"AreaCode\": \"110100\"\n" + |
| | | " },\n" + |
| | | " {\n" + |
| | | " \"Hp\": \"京C\",\n" + |
| | | " \"city\": \"北京\",\n" + |
| | | " \"province\": \"北京\",\n" + |
| | | " \"Pcode\": \"BJ\",\n" + |
| | | " \"AreaCode\": \"110000\"\n" + |
| | | " \"AreaCode\": \"110100\"\n" + |
| | | " },\n" + |
| | | " {\n" + |
| | | " \"Hp\": \"京D\",\n" + |
| | | " \"city\": \"北京\",\n" + |
| | | " \"province\": \"北京\",\n" + |
| | | " \"Pcode\": \"BJ\",\n" + |
| | | " \"AreaCode\": \"110000\"\n" + |
| | | " \"AreaCode\": \"110100\"\n" + |
| | | " },\n" + |
| | | " {\n" + |
| | | " \"Hp\": \"京E\",\n" + |
| | | " \"city\": \"北京\",\n" + |
| | | " \"province\": \"北京\",\n" + |
| | | " \"Pcode\": \"BJ\",\n" + |
| | | " \"AreaCode\": \"110000\"\n" + |
| | | " \"AreaCode\": \"110100\"\n" + |
| | | " },\n" + |
| | | " {\n" + |
| | | " \"Hp\": \"京F\",\n" + |
| | | " \"city\": \"北京\",\n" + |
| | | " \"province\": \"北京\",\n" + |
| | | " \"Pcode\": \"BJ\",\n" + |
| | | " \"AreaCode\": \"110000\"\n" + |
| | | " \"AreaCode\": \"110100\"\n" + |
| | | " },\n" + |
| | | " {\n" + |
| | | " \"Hp\": \"京G\",\n" + |
| | | " \"city\": \"北京\",\n" + |
| | | " \"province\": \"北京\",\n" + |
| | | " \"Pcode\": \"BJ\",\n" + |
| | | " \"AreaCode\": \"110000\"\n" + |
| | | " \"AreaCode\": \"110100\"\n" + |
| | | " },\n" + |
| | | " {\n" + |
| | | " \"Hp\": \"京H\",\n" + |
| | | " \"city\": \"北京\",\n" + |
| | | " \"province\": \"北京\",\n" + |
| | | " \"Pcode\": \"BJ\",\n" + |
| | | " \"AreaCode\": \"110000\"\n" + |
| | | " \"AreaCode\": \"110100\"\n" + |
| | | " },\n" + |
| | | " {\n" + |
| | | " \"Hp\": \"京J\",\n" + |
| | | " \"city\": \"北京\",\n" + |
| | | " \"province\": \"北京\",\n" + |
| | | " \"Pcode\": \"BJ\",\n" + |
| | | " \"AreaCode\": \"110000\"\n" + |
| | | " \"AreaCode\": \"110100\"\n" + |
| | | " },\n" + |
| | | " {\n" + |
| | | " \"Hp\": \"京K\",\n" + |
| | | " \"city\": \"北京\",\n" + |
| | | " \"province\": \"北京\",\n" + |
| | | " \"Pcode\": \"BJ\",\n" + |
| | | " \"AreaCode\": \"110000\"\n" + |
| | | " \"AreaCode\": \"110100\"\n" + |
| | | " },\n" + |
| | | " {\n" + |
| | | " \"Hp\": \"京L\",\n" + |
| | | " \"city\": \"北京\",\n" + |
| | | " \"province\": \"北京\",\n" + |
| | | " \"Pcode\": \"BJ\",\n" + |
| | | " \"AreaCode\": \"110000\"\n" + |
| | | " \"AreaCode\": \"110100\"\n" + |
| | | " },\n" + |
| | | " {\n" + |
| | | " \"Hp\": \"京M\",\n" + |
| | | " \"city\": \"北京\",\n" + |
| | | " \"province\": \"北京\",\n" + |
| | | " \"Pcode\": \"BJ\",\n" + |
| | | " \"AreaCode\": \"110000\"\n" + |
| | | " \"AreaCode\": \"110100\"\n" + |
| | | " },\n" + |
| | | " {\n" + |
| | | " \"Hp\": \"京Y\",\n" + |
| | | " \"city\": \"北京\",\n" + |
| | | " \"province\": \"北京\",\n" + |
| | | " \"Pcode\": \"BJ\",\n" + |
| | | " \"AreaCode\": \"110000\"\n" + |
| | | " \"AreaCode\": \"110100\"\n" + |
| | | " },\n" + |
| | | " {\n" + |
| | | " \"Hp\": \"豫A\",\n" + |
New file |
| | |
| | | package com.ruoyi.account.util; |
| | | |
| | | /** |
| | | * 脱敏工具类 |
| | | */ |
| | | public class RptUtils { |
| | | private static final String SYMBOL = "*"; |
| | | |
| | | /** |
| | | * 脱敏 |
| | | * @param str 待脱敏字符串 |
| | | * @param left 左边保留多少位 |
| | | * @param right 右边保留多少位 |
| | | * @return 脱敏结果,除左右外,其余字符将被替换为* |
| | | */ |
| | | public static String around(String str, int left, int right){ |
| | | if (str == null || (str.length() < left + right +1)){ |
| | | return str; |
| | | } |
| | | String regex = String.format("(?<=\\w{%d})\\w(?=\\w{%d})", left, right); |
| | | return str.replaceAll(regex, SYMBOL); |
| | | } |
| | | |
| | | /** |
| | | * 正则表达式实现金额数据脱敏 |
| | | * @param money |
| | | * @return |
| | | */ |
| | | public static String getMoney(String money){ |
| | | //保留0个数到0个结束 |
| | | return around(money,0,0); |
| | | } |
| | | } |
| | |
| | | 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.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | import com.ruoyi.chargingPile.api.dto.GetSiteListDTO; |
| | | import com.ruoyi.chargingPile.api.feignClient.ParkingLotClient; |
| | | import com.ruoyi.chargingPile.api.model.*; |
| | |
| | | import com.ruoyi.common.core.dto.ChargingPercentProvinceDto; |
| | | import com.ruoyi.chargingPile.service.*; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.DateUtils; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.order.api.feignClient.ChargingOrderClient; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import com.ruoyi.other.api.domain.TVip; |
| | | import com.ruoyi.other.api.feignClient.RoleSiteClient; |
| | | import com.ruoyi.other.api.feignClient.UserSiteClient; |
| | | import com.ruoyi.other.api.feignClient.VipClient; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import com.ruoyi.system.api.feignClient.SysUserRoleClient; |
| | |
| | | |
| | | @Resource |
| | | private SysUserRoleClient userRoleClient; |
| | | |
| | | @Resource |
| | | private VipClient vipClient; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | |
| | | /** |
| | |
| | | Site byId = siteService.getById(one.getSiteId()); |
| | | TAccountingStrategy byId1 = accountingStrategyService.getById(byId.getAccountingStrategyId()); |
| | | List<TAccountingStrategyDetail> list = accountingStrategyDetailService.lambdaQuery().eq(TAccountingStrategyDetail::getAccountingStrategyId, byId1.getId()).list(); |
| | | list.stream().filter(item -> "00:00".equals(item.getEndTime())).forEach(item -> item.setEndTime("23:59:59")); |
| | | for (TAccountingStrategyDetail tAccountingStrategyDetail : list) { |
| | | // 当前时间属于那个阶段 取哪个阶段的电价 |
| | | if(LocalTime.now().isAfter(LocalTime.parse(tAccountingStrategyDetail.getStartTime())) && LocalTime.now().isBefore(LocalTime.parse(tAccountingStrategyDetail.getEndTime()))){ |
| | | siteInfoVO.setElectrovalence(tAccountingStrategyDetail.getElectrovalence()); |
| | | if(DateUtils.string2LocalTime(tAccountingStrategyDetail.getStartTime() + ":00").compareTo(LocalTime.now()) <= 0 |
| | | && DateUtils.string2LocalTime(tAccountingStrategyDetail.getEndTime() + ("23:59:59".equals(tAccountingStrategyDetail.getEndTime())?"":":00")).compareTo(LocalTime.now()) > 0){ |
| | | siteInfoVO.setElectrovalence(tAccountingStrategyDetail.getElectrovalence().add(tAccountingStrategyDetail.getServiceCharge()).setScale(4, BigDecimal.ROUND_HALF_UP)); |
| | | if(null != byId1.getDiscount()){ |
| | | siteInfoVO.setVipElectrovalence(tAccountingStrategyDetail.getElectrovalence().multiply(byId1.getDiscount()).setScale(4, BigDecimal.ROUND_HALF_UP)); |
| | | siteInfoVO.setVipElectrovalence((tAccountingStrategyDetail.getServiceCharge().multiply(byId1.getDiscount()).add(tAccountingStrategyDetail.getElectrovalence())).setScale(4, BigDecimal.ROUND_HALF_UP)); |
| | | }else{ |
| | | siteInfoVO.setVipElectrovalence(tAccountingStrategyDetail.getElectrovalence()); |
| | | // 获取当前登录用户id |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | // 根据id查询用户信息 |
| | | TAppUser appUser = appUserClient.getUserById(userId).getData(); |
| | | if(Objects.nonNull(appUser)){ |
| | | TVip vip = vipClient.getInfo1(appUser.getVipId()).getData(); |
| | | if(Objects.nonNull(vip) && vip.getType() == 2){ |
| | | siteInfoVO.setVipElectrovalence(vip.getDiscount().divide(new BigDecimal(10)).multiply(tAccountingStrategyDetail.getServiceCharge()).add(tAccountingStrategyDetail.getElectrovalence())); |
| | | }else { |
| | | siteInfoVO.setVipElectrovalence(tAccountingStrategyDetail.getElectrovalence()); |
| | | } |
| | | }else { |
| | | siteInfoVO.setVipElectrovalence(tAccountingStrategyDetail.getElectrovalence()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | Site byId = siteService.getById(one.getSiteId()); |
| | | TAccountingStrategy byId1 = accountingStrategyService.getById(byId.getAccountingStrategyId()); |
| | | List<TAccountingStrategyDetail> list = accountingStrategyDetailService.lambdaQuery().eq(TAccountingStrategyDetail::getAccountingStrategyId, byId1.getId()).list(); |
| | | list.stream().filter(item -> "00:00".equals(item.getEndTime())).forEach(item -> item.setEndTime("23:59:59")); |
| | | for (TAccountingStrategyDetail tAccountingStrategyDetail : list) { |
| | | // 当前时间属于那个阶段 取哪个阶段的电价 |
| | | if(LocalTime.now().isAfter(LocalTime.parse(tAccountingStrategyDetail.getStartTime())) && LocalTime.now().isBefore(LocalTime.parse(tAccountingStrategyDetail.getEndTime()))){ |
| | | siteInfoVO.setElectrovalence(tAccountingStrategyDetail.getElectrovalence()); |
| | | if(DateUtils.string2LocalTime(tAccountingStrategyDetail.getStartTime() + ":00").compareTo(LocalTime.now()) <= 0 |
| | | && DateUtils.string2LocalTime(tAccountingStrategyDetail.getEndTime() + ("23:59:59".equals(tAccountingStrategyDetail.getEndTime())?"":":00")).compareTo(LocalTime.now()) > 0){ |
| | | siteInfoVO.setElectrovalence(tAccountingStrategyDetail.getElectrovalence().add(tAccountingStrategyDetail.getServiceCharge()).setScale(4, BigDecimal.ROUND_HALF_UP)); |
| | | if(null != byId1.getDiscount()){ |
| | | siteInfoVO.setVipElectrovalence(tAccountingStrategyDetail.getElectrovalence().multiply(byId1.getDiscount()).setScale(4, BigDecimal.ROUND_HALF_UP)); |
| | | siteInfoVO.setVipElectrovalence((tAccountingStrategyDetail.getServiceCharge().multiply(byId1.getDiscount()).add(tAccountingStrategyDetail.getElectrovalence())).setScale(4, BigDecimal.ROUND_HALF_UP)); |
| | | }else{ |
| | | siteInfoVO.setVipElectrovalence(tAccountingStrategyDetail.getElectrovalence()); |
| | | // 获取当前登录用户id |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | // 根据id查询用户信息 |
| | | TAppUser appUser = appUserClient.getUserById(userId).getData(); |
| | | if(Objects.nonNull(appUser)){ |
| | | TVip vip = vipClient.getInfo1(appUser.getVipId()).getData(); |
| | | if(Objects.nonNull(vip) && vip.getType() == 2){ |
| | | siteInfoVO.setVipElectrovalence(vip.getDiscount().divide(new BigDecimal(10)).multiply(tAccountingStrategyDetail.getServiceCharge()).add(tAccountingStrategyDetail.getElectrovalence())); |
| | | }else { |
| | | siteInfoVO.setVipElectrovalence(tAccountingStrategyDetail.getElectrovalence()); |
| | | } |
| | | }else { |
| | | siteInfoVO.setVipElectrovalence(tAccountingStrategyDetail.getElectrovalence()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.chargingPile.service.*; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.DateUtils; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalTime; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | |
| | | public R<TAccountingStrategyDetail> getDetailBySiteId(@RequestParam("siteId") Integer siteId){ |
| | | Site site = siteService.getById(siteId); |
| | | 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")); |
| | | return R.ok(one); |
| | | List<TAccountingStrategyDetail> list = accountingStrategyDetailService.list(Wrappers.<TAccountingStrategyDetail>lambdaQuery() |
| | | .eq(TAccountingStrategyDetail::getAccountingStrategyId, accountingStrategy.getId())); |
| | | list.stream().filter(item -> "00:00".equals(item.getEndTime())).forEach(item -> item.setEndTime("23:59:59")); |
| | | for (TAccountingStrategyDetail accountingStrategyDetail : list) { |
| | | if(DateUtils.string2LocalTime(accountingStrategyDetail.getStartTime() + ":00").compareTo(LocalTime.now()) <= 0 |
| | | && DateUtils.string2LocalTime(accountingStrategyDetail.getEndTime() + ("23:59:59".equals(accountingStrategyDetail.getEndTime())?"":":00")).compareTo(LocalTime.now()) > 0){ |
| | | return R.ok(accountingStrategyDetail); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | /** |
| | | * 通过桩id查询当前时段使用的策略明细 |
| | |
| | | .eq(TChargingGun::getChargingPileId, chargingPile.getId()).eq(TChargingGun::getDelFlag, 0) |
| | | .last("LIMIT 1")); |
| | | TAccountingStrategy accountingStrategy = accountingStrategyService.getById(chargingGun.getAccountingStrategyId()); |
| | | TAccountingStrategyDetail one; |
| | | TAccountingStrategyDetail one = null; |
| | | 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")); |
| | | List<TAccountingStrategyDetail> list = accountingStrategyDetailService.list(Wrappers.<TAccountingStrategyDetail>lambdaQuery() |
| | | .eq(TAccountingStrategyDetail::getAccountingStrategyId, accountingStrategy.getId())); |
| | | list.stream().filter(item -> "00:00".equals(item.getEndTime())).forEach(item -> item.setEndTime("23:59:59")); |
| | | for (TAccountingStrategyDetail accountingStrategyDetail : list) { |
| | | if(DateUtils.string2LocalTime(accountingStrategyDetail.getStartTime() + ":00").compareTo(LocalTime.now()) <= 0 |
| | | && DateUtils.string2LocalTime(accountingStrategyDetail.getEndTime() + ("23:59:59".equals(accountingStrategyDetail.getEndTime())?"":":00")).compareTo(LocalTime.now()) > 0){ |
| | | return R.ok(accountingStrategyDetail); |
| | | } |
| | | } |
| | | }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")); |
| | | List<TAccountingStrategyDetail> list = accountingStrategyDetailService.list(Wrappers.<TAccountingStrategyDetail>lambdaQuery() |
| | | .eq(TAccountingStrategyDetail::getAccountingStrategyId, accountingStrategy.getId())); |
| | | list.stream().filter(item -> "00:00".equals(item.getEndTime())).forEach(item -> item.setEndTime("23:59:59")); |
| | | for (TAccountingStrategyDetail accountingStrategyDetail : list) { |
| | | if(DateUtils.string2LocalTime(accountingStrategyDetail.getStartTime() + ":00").compareTo(LocalTime.now()) <= 0 |
| | | && DateUtils.string2LocalTime(accountingStrategyDetail.getEndTime() + ("23:59:59".equals(accountingStrategyDetail.getEndTime())?"":":00")).compareTo(LocalTime.now()) > 0){ |
| | | return R.ok(accountingStrategyDetail); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(one); |
| | | return R.ok(); |
| | | } |
| | | /** |
| | | * 校验充电桩计费模版是否准确 |
| | |
| | | List<TParkingRecord> list = parkingRecordService.lambdaQuery().eq(parkingRecordQueryDto.getParkingLotId() != null, TParkingRecord::getParkingLotId, parkingRecordQueryDto.getParkingLotId()).list(); |
| | | int count1 = list.size(); |
| | | //统计出list中chargingOrderId为null的数据个数 |
| | | int count2 = list.stream().filter(item -> item.getChargingOrderId() == null).collect(Collectors.toList()).size(); |
| | | int count3 = count1-count2; |
| | | int count2 = list.stream().filter(item -> item.getChargingOrderId() != null).collect(Collectors.toList()).size(); |
| | | int count3 = list.stream().filter(item -> item.getOutParkingType() == 2).collect(Collectors.toList()).size(); |
| | | //计算出list中parkingDuration的总和 |
| | | int count4 = 0; |
| | | for (TParkingRecord tParkingRecord : list) { |
| | |
| | | } |
| | | // 查询所有的停车场的站点id |
| | | List<TParkingLot> list = parkingLotService.list(); |
| | | List<Integer> siteIds = list.stream().map(TParkingLot::getSiteId).collect(Collectors.toList()); |
| | | List<Integer> siteIds = list.stream().map(TParkingLot::getSiteId).distinct().collect(Collectors.toList()); |
| | | if(!CollectionUtils.isEmpty(ids) && !CollectionUtils.isEmpty(siteIds)){ |
| | | ids.addAll(siteIds); |
| | | Iterator<Integer> iterator = ids.iterator(); |
| | | while (iterator.hasNext()){ |
| | | Integer next = iterator.next(); |
| | | if(siteIds.contains(next)){ |
| | | iterator.remove(); |
| | | } |
| | | } |
| | | } |
| | | return this.baseMapper.getSiteListParkLot(ids); |
| | | } |
| | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | |
| | | |
| | | @Override |
| | | public TParkingRecordPageInfoVO pageList(ParkingRecordQuery query) { |
| | | PageInfo<TParkingRecordVO> pageInfo = new PageInfo<>(query.getPageCurr(),query.getPageSize()); |
| | | // 查询站点的停车场id |
| | | if(Objects.nonNull(query.getSiteId())){ |
| | | Site site = siteMapper.selectById(query.getSiteId()); |
| | |
| | | List<TParkingLot> tParkingLots = parkingLotMapper.selectList(Wrappers.lambdaQuery(TParkingLot.class) |
| | | .eq(TParkingLot::getSiteId, site.getId())); |
| | | List<Integer> lotIds = tParkingLots.stream().map(TParkingLot::getId).collect(Collectors.toList()); |
| | | if(CollectionUtils.isEmpty(lotIds)){ |
| | | TParkingRecordPageInfoVO tParkingRecordPageInfoVO = new TParkingRecordPageInfoVO(); |
| | | tParkingRecordPageInfoVO.setParkingRecordVOS(new PageInfo<TParkingRecordVO>()); |
| | | return tParkingRecordPageInfoVO; |
| | | } |
| | | query.setLotIds(lotIds); |
| | | } |
| | | |
| | | } |
| | | PageInfo<TParkingRecordVO> pageInfo = new PageInfo<>(query.getPageCurr(),query.getPageSize()); |
| | | List<TParkingRecordVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | // 查询总数 |
| | |
| | | </appender> |
| | | |
| | | <!-- 系统模块日志级别控制 --> |
| | | <logger name="com.ruoyi" level="debug" /> |
| | | <logger name="com.ruoyi" level="info" /> |
| | | <!-- Spring日志级别控制 --> |
| | | <logger name="org.springframework" level="debug" /> |
| | | |
| | | <root level="debug"> |
| | | <root level="info"> |
| | | <appender-ref ref="console" /> |
| | | </root> |
| | | |
| | |
| | | and ts.`name` like CONCAT('%', #{query.name}, '%') |
| | | </if> |
| | | <if test="null != query.cityCode and '' != query.cityCode"> |
| | | and ts.cityCode = #{query.cityCode} |
| | | and ts.city_code = #{query.cityCode} |
| | | </if> |
| | | AND ts.del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} |
| | | AND ts.status = ${@com.ruoyi.common.core.enums.status.SiteStatusEnum@NORMAL_USE.getCode()} |
| | |
| | | <select id="getStatusModeStatistics" resultType="com.ruoyi.chargingPile.api.vo.StatusModeStatisticsVO"> |
| | | SELECT |
| | | charge_mode, |
| | | IFNULL((SELECT COUNT(*) FROM t_charging_gun WHERE status = 2 AND charge_mode = #{chargeMode}),0) AS freeCount, |
| | | IFNULL((SELECT COUNT(*) FROM t_charging_gun WHERE status = 5 AND charge_mode = #{chargeMode}),0) AS filledCount, |
| | | IFNULL((SELECT COUNT(*) FROM t_charging_gun WHERE status = 3 AND charge_mode = #{chargeMode}),0) AS insertCount, |
| | | IFNULL((SELECT COUNT(*) FROM t_charging_gun WHERE status = 4 AND charge_mode = #{chargeMode}),0) AS chargingCount |
| | | IFNULL((SELECT COUNT(*) FROM t_charging_gun WHERE status = 2 AND charge_mode = #{chargeMode} and del_flag = 0),0) AS freeCount, |
| | | IFNULL((SELECT COUNT(*) FROM t_charging_gun WHERE status = 5 AND charge_mode = #{chargeMode} and del_flag = 0),0) AS filledCount, |
| | | IFNULL((SELECT COUNT(*) FROM t_charging_gun WHERE status = 3 AND charge_mode = #{chargeMode} and del_flag = 0),0) AS insertCount, |
| | | IFNULL((SELECT COUNT(*) FROM t_charging_gun WHERE status = 4 AND charge_mode = #{chargeMode} and del_flag = 0),0) AS chargingCount |
| | | FROM t_charging_gun |
| | | WHERE del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} AND charge_mode = #{chargeMode} |
| | | AND charging_pile_id in ( |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, app_user_id, license_plate, vehicle_color, charging_order_id, parking_lot_id, in_parking_time, out_parking_time, parking_duration, order_amount, status, out_parking_type, create_time |
| | | id, code,app_user_id, license_plate, vehicle_color, charging_order_id, parking_lot_id, in_parking_time, out_parking_time, parking_duration, order_amount, status, out_parking_type, create_time |
| | | </sql> |
| | | <select id="getSum" resultType="java.math.BigDecimal"> |
| | | select sum(timeout_amount) from t_parking_record where in_parking_time >= #{sixBefore} |
| | | </select> |
| | | <select id="pageList" resultType="com.ruoyi.chargingPile.api.vo.TParkingRecordVO"> |
| | | select |
| | | tpr.id, tpr.app_user_id, tpr.license_plate, tpr.vehicle_color, tpr.charging_order_id, tpr.parking_lot_id, tpr.in_parking_time, tpr.out_parking_time, |
| | | tpr.parking_duration, tpr.order_amount, tpr.status, tpr.out_parking_type, tpr.create_time,(tpr.order_amount - tpr.timeout_amount) as parkingFee, |
| | | (tpr.parking_duration - tpr.free_duration) as feeDuration,ts.name as siteName |
| | | tpr.id, tpr.code,tpr.app_user_id, tpr.license_plate, tpr.vehicle_color, tpr.charging_order_id, tpr.parking_lot_id, tpr.in_parking_time, tpr.out_parking_time, |
| | | tpr.parking_duration, tpr.order_amount, tpr.status, tpr.out_parking_type, tpr.create_time,(tpr.order_amount - tpr.timeout_amount) as parkingFee,tpr.timeout_amount, |
| | | tpr.free_duration,(tpr.parking_duration - tpr.free_duration) as feeDuration,ts.name as siteName |
| | | from t_parking_record tpr |
| | | left join t_parking_lot tpl on tpr.parking_lot_id = tpl.id |
| | | left join t_site ts on tpl.site_id = ts.id |
| | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.integration.api.model.UploadRealTimeMonitoringData; |
| | | import com.ruoyi.integration.api.model.UploadRealTimeMonitoringPageData; |
| | | import com.ruoyi.integration.mongodb.service.UploadRealTimeMonitoringDataService; |
| | | import com.ruoyi.common.core.dto.MongoChargingOrderQuery; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | |
| | | @PostMapping(value = "/getAll") |
| | | public R<List<UploadRealTimeMonitoringData>> getAll(@RequestBody MongoChargingOrderQuery mongoChargingOrderQuery) throws ParseException { |
| | | List<UploadRealTimeMonitoringData> list = uploadRealTimeMonitoringDataService.getDataAll(mongoChargingOrderQuery); |
| | | public R<UploadRealTimeMonitoringPageData> getAll(@RequestBody MongoChargingOrderQuery mongoChargingOrderQuery) throws ParseException { |
| | | UploadRealTimeMonitoringPageData list = uploadRealTimeMonitoringDataService.getDataAll(mongoChargingOrderQuery); |
| | | return R.ok(list); |
| | | } |
| | | |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.api.model.UploadRealTimeMonitoringData; |
| | | import com.ruoyi.integration.api.model.UploadRealTimeMonitoringPageData; |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.common.core.dto.MongoChargingOrderQuery; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<UploadRealTimeMonitoringData> getDataByOrderCode(String code); |
| | | List<UploadRealTimeMonitoringData> getDataAll(MongoChargingOrderQuery mongoChargingOrderQuery) throws ParseException; |
| | | UploadRealTimeMonitoringPageData getDataAll(MongoChargingOrderQuery mongoChargingOrderQuery) throws ParseException; |
| | | |
| | | /** |
| | | * 查询订单最新一条数据 |
| | |
| | | import cn.hutool.db.sql.Direction; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.integration.api.model.UploadRealTimeMonitoringData; |
| | | import com.ruoyi.integration.api.model.UploadRealTimeMonitoringPageData; |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.service.UploadRealTimeMonitoringDataService; |
| | | import com.ruoyi.common.core.dto.MongoChargingOrderQuery; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<UploadRealTimeMonitoringData> getDataAll(MongoChargingOrderQuery mongoChargingOrderQuery) throws ParseException { |
| | | public UploadRealTimeMonitoringPageData getDataAll(MongoChargingOrderQuery mongoChargingOrderQuery) throws ParseException { |
| | | Query query = new Query(); |
| | | // if (!values.isEmpty()){ |
| | | // query.addCriteria(Criteria.where("transaction_serial_number").in(values)); |
| | |
| | | query.addCriteria(Criteria.where("transaction_serial_number").regex(mongoChargingOrderQuery.getCode(), "i")); // "i" 表示不区分大小写 |
| | | } |
| | | if (mongoChargingOrderQuery.getOrderType() !=null){ |
| | | query.addCriteria(Criteria.where("order_type").is(mongoChargingOrderQuery.getOrderType())); |
| | | query.addCriteria(Criteria.where("orderType").is(mongoChargingOrderQuery.getOrderType())); |
| | | } |
| | | if (mongoChargingOrderQuery.getSiteId() != null){ |
| | | query.addCriteria(Criteria.where("site_id").is(mongoChargingOrderQuery.getSiteId())); |
| | | query.addCriteria(Criteria.where("siteId").is(mongoChargingOrderQuery.getSiteId())); |
| | | } |
| | | if (mongoChargingOrderQuery.getChargingPileCode() != null && !mongoChargingOrderQuery.getChargingPileCode().isEmpty()) { |
| | | query.addCriteria(Criteria.where("charging_pile_code").is(mongoChargingOrderQuery.getChargingPileCode())); |
| | |
| | | // 设置分页 |
| | | Pageable pageable = PageRequest.of(mongoChargingOrderQuery.getPageCurr(), mongoChargingOrderQuery.getPageSize()); |
| | | query.with(pageable); |
| | | |
| | | query.with(Sort.by(Sort.Direction.DESC,"create_time")); |
| | | List<UploadRealTimeMonitoringData> uploadRealTimeMonitoringData = mongoTemplate.find( |
| | | query.with(Sort.by("create_time")) |
| | | query |
| | | , UploadRealTimeMonitoringData.class); |
| | | return uploadRealTimeMonitoringData; |
| | | |
| | | |
| | | long totalElements = mongoTemplate.count(query, UploadRealTimeMonitoringData.class); |
| | | |
| | | UploadRealTimeMonitoringPageData uploadRealTimeMonitoringPageData = new UploadRealTimeMonitoringPageData(); |
| | | uploadRealTimeMonitoringPageData.setCount(totalElements); |
| | | uploadRealTimeMonitoringPageData.setRecords(uploadRealTimeMonitoringData); |
| | | return uploadRealTimeMonitoringPageData; |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.DecimalFormat; |
| | | import java.time.*; |
| | | |
| | | |
| | |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.integration.api.model.PageChargingOrderAndUploadRealTimeMonitoringDataDto; |
| | | import com.ruoyi.integration.api.model.UploadRealTimeMonitoringData; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.integration.api.feignClient.UploadRealTimeMonitoringDataClient; |
| | | import com.ruoyi.integration.api.model.ChargingOrderAndUploadRealTimeMonitoringDataDto; |
| | | import com.ruoyi.integration.api.model.UploadRealTimeMonitoringPageData; |
| | | import com.ruoyi.order.api.model.*; |
| | | import com.ruoyi.order.api.query.ChargingOrderQuery; |
| | | import com.ruoyi.common.core.dto.MongoChargingOrderQuery; |
| | |
| | | @PostMapping(value = "/watch/chargingOrder") |
| | | @ApiOperation(value = "监控订单", tags = {"管理后台-订单管理"}) |
| | | public R watchChargingOrder(@RequestBody MongoChargingOrderQuery mongoChargingOrderQuery) { |
| | | // Integer page = dto.getPageCurr(); |
| | | // Integer pageSize = dto.getPageSize(); |
| | | // List<Long> data = appUserClient.getUserIdsByPhone(dto.getPhone()).getData(); |
| | | // dto.setUserIds(data); |
| | | // dto.setPageCurr(1); |
| | | // dto.setPageSize(99999); |
| | | |
| | | // Map<String,TChargingOrder> map = new HashMap<>(); |
| | | // //吧list放入map中 |
| | | // for (ChargingOrderVO record : res.getList().getRecords()) { |
| | | // map.put(record.getCode(),record); |
| | | // } |
| | | // Set<String> strings = map.keySet(); |
| | | |
| | | |
| | | List<UploadRealTimeMonitoringData> data1 = uploadRealTimeMonitoringDataClient.getAll(mongoChargingOrderQuery).getData(); |
| | | mongoChargingOrderQuery.setPageSize(10); |
| | | UploadRealTimeMonitoringPageData data1 = uploadRealTimeMonitoringDataClient.getAll(mongoChargingOrderQuery).getData(); |
| | | |
| | | List<ChargingOrderAndUploadRealTimeMonitoringDataDto> dtos = new ArrayList<>(); |
| | | Map<String,ChargingOrderVO> map = new HashMap<>(); |
| | | for (UploadRealTimeMonitoringData uploadRealTimeMonitoringData : data1) { |
| | | for (UploadRealTimeMonitoringData uploadRealTimeMonitoringData : data1.getRecords()) { |
| | | ChargingOrderAndUploadRealTimeMonitoringDataDto dataDto = new ChargingOrderAndUploadRealTimeMonitoringDataDto(); |
| | | ChargingOrderQuery dto = new ChargingOrderQuery(); |
| | | dto.setCode(uploadRealTimeMonitoringData.getTransaction_serial_number()); |
| | | TCharingOrderVO vo = chargingOrderService.chargingOrder(dto); |
| | | if (!vo.getList().getRecords().isEmpty()) { |
| | | ChargingOrderVO chargingOrderVO = vo.getList().getRecords().get(0); |
| | | if (chargingOrderVO != null) { |
| | | BeanUtils.copyProperties(chargingOrderVO, dataDto); |
| | | } |
| | | BeanUtils.copyProperties(uploadRealTimeMonitoringData,dataDto); |
| | | |
| | | dtos.add(dataDto); |
| | | if (map.get(uploadRealTimeMonitoringData.getTransaction_serial_number())==null) { |
| | | TCharingOrderVO vo = chargingOrderService.chargingOrder(dto); |
| | | map.put(uploadRealTimeMonitoringData.getTransaction_serial_number(),vo.getList().getRecords().get(0)); |
| | | if (!vo.getList().getRecords().isEmpty()) { |
| | | ChargingOrderVO chargingOrderVO = vo.getList().getRecords().get(0); |
| | | if (chargingOrderVO != null) { |
| | | BeanUtils.copyProperties(chargingOrderVO, dataDto); |
| | | } |
| | | BeanUtils.copyProperties(uploadRealTimeMonitoringData, dataDto); |
| | | dataDto.setStartTime(uploadRealTimeMonitoringData.getStartTime()); |
| | | dataDto.setEndTime(uploadRealTimeMonitoringData.getEndTime() == null ? null : uploadRealTimeMonitoringData.getEndTime()); |
| | | dataDto.setStatus(uploadRealTimeMonitoringData.getStatus()); |
| | | dtos.add(dataDto); |
| | | } |
| | | }else { |
| | | continue; |
| | | ChargingOrderVO vo = map.get(uploadRealTimeMonitoringData.getTransaction_serial_number()); |
| | | BeanUtils.copyProperties(vo, dataDto); |
| | | BeanUtils.copyProperties(uploadRealTimeMonitoringData, dataDto); |
| | | dataDto.setStartTime(uploadRealTimeMonitoringData.getStartTime()); |
| | | dataDto.setEndTime(uploadRealTimeMonitoringData.getEndTime() == null ? null : uploadRealTimeMonitoringData.getEndTime()); |
| | | dataDto.setStatus(uploadRealTimeMonitoringData.getStatus()); |
| | | dtos.add(dataDto); |
| | | } |
| | | } |
| | | for (int i = 0; i < dtos.size(); i++) { |
| | | dtos.get(i).setIndex(i); |
| | | } |
| | | |
| | | PageChargingOrderAndUploadRealTimeMonitoringDataDto page = new PageChargingOrderAndUploadRealTimeMonitoringDataDto(); |
| | | page.setTotal(data1.getCount()); |
| | | page.setRecords(dtos); |
| | | |
| | | return R.ok(dtos); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | if (statisticsQueryDto.getDayType()==1){ |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getDateData(chargingOrderIds); |
| | | tCharingOrderMapVO.setMaps1(maps1); |
| | | |
| | | List<Map<String, Object>> charMap = new ArrayList<>(); |
| | | // 生成从 "00:00" 到 "23:00" 的时间数据 |
| | | for (int hour = 0; hour < 24; hour++) { |
| | | String time = String.format("%02d:00", hour); |
| | | Map<String, Object> mapWithTimeValue = findMapWithTimeValue(maps1, time); |
| | | if (mapWithTimeValue!=null){ |
| | | charMap.add(mapWithTimeValue); |
| | | }else { |
| | | Map<String, Object> timeMap = new HashMap<>(); |
| | | timeMap.put("time", time); // 初始化值为 null |
| | | timeMap.put("electrovalence", 0); |
| | | timeMap.put("orderCount", 0); |
| | | timeMap.put("paymentAmount", 0); |
| | | timeMap.put("paymoney", 0); |
| | | timeMap.put("servicecharge", 0); |
| | | |
| | | charMap.add(timeMap); |
| | | } |
| | | } |
| | | |
| | | tCharingOrderMapVO.setMaps1(charMap); |
| | | }else if (statisticsQueryDto.getDayType()==2){ |
| | | |
| | | |
| | | |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getWeekData(chargingOrderIds); |
| | | tCharingOrderMapVO.setMaps1(maps1); |
| | | |
| | | LocalDate startDate = statisticsQueryDto.getStartTime(); |
| | | LocalDate endDate = statisticsQueryDto.getEndTime(); |
| | | |
| | | List<Map<String, Object>> dateRangeStatistics = new ArrayList<>(); |
| | | |
| | | // 遍历日期范围 |
| | | while (!startDate.isAfter(endDate)) { |
| | | String formattedDate = startDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
| | | Map<String, Object> dailyStats = findMapWithDateValue(maps1, formattedDate); |
| | | |
| | | if (dailyStats != null) { |
| | | dateRangeStatistics.add(dailyStats); |
| | | } else { |
| | | Map<String, Object> dateMap = new HashMap<>(); |
| | | dateMap.put("time", formattedDate); |
| | | dateMap.put("electrovalence", 0); |
| | | dateMap.put("orderCount", 0); |
| | | dateMap.put("paymentAmount", 0); |
| | | dateMap.put("paymoney", 0); |
| | | dateMap.put("servicecharge", 0); |
| | | dateRangeStatistics.add(dateMap); |
| | | } |
| | | |
| | | // 移动到下一天 |
| | | startDate = startDate.plusDays(1); |
| | | } |
| | | tCharingOrderMapVO.setMaps1(dateRangeStatistics); |
| | | }else if (statisticsQueryDto.getDayType()==3){ |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getMonthData(chargingOrderIds); |
| | | tCharingOrderMapVO.setMaps1(maps1); |
| | | |
| | | LocalDate startDate = statisticsQueryDto.getStartTime(); |
| | | LocalDate endDate = statisticsQueryDto.getEndTime(); |
| | | |
| | | List<Map<String, Object>> dateRangeStatistics = new ArrayList<>(); |
| | | |
| | | // 遍历日期范围 |
| | | while (!startDate.isAfter(endDate)) { |
| | | String formattedDate = startDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
| | | Map<String, Object> dailyStats = findMapWithDateValue(maps1, formattedDate); |
| | | |
| | | if (dailyStats != null) { |
| | | dateRangeStatistics.add(dailyStats); |
| | | } else { |
| | | Map<String, Object> dateMap = new HashMap<>(); |
| | | dateMap.put("time", formattedDate); |
| | | dateMap.put("electrovalence", 0); |
| | | dateMap.put("orderCount", 0); |
| | | dateMap.put("paymentAmount", 0); |
| | | dateMap.put("paymoney", 0); |
| | | dateMap.put("servicecharge", 0); |
| | | dateRangeStatistics.add(dateMap); |
| | | } |
| | | |
| | | // 移动到下一天 |
| | | startDate = startDate.plusDays(1); |
| | | } |
| | | tCharingOrderMapVO.setMaps1(dateRangeStatistics); |
| | | }else if (statisticsQueryDto.getDayType()==4){ |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getYearData(chargingOrderIds); |
| | | tCharingOrderMapVO.setMaps1(maps1); |
| | | |
| | | LocalDate startDate = statisticsQueryDto.getStartTime(); |
| | | LocalDate endDate = statisticsQueryDto.getEndTime(); |
| | | |
| | | List<Map<String, Object>> dateRangeStatistics = new ArrayList<>(); |
| | | |
| | | // 遍历日期范围 |
| | | while (!startDate.isAfter(endDate)) { |
| | | String formattedDate = startDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
| | | Map<String, Object> dailyStats = findMapWithDateValue(maps1, formattedDate); |
| | | |
| | | if (dailyStats != null) { |
| | | dateRangeStatistics.add(dailyStats); |
| | | } else { |
| | | Map<String, Object> dateMap = new HashMap<>(); |
| | | dateMap.put("time", formattedDate); |
| | | dateMap.put("electrovalence", 0); |
| | | dateMap.put("orderCount", 0); |
| | | dateMap.put("paymentAmount", 0); |
| | | dateMap.put("paymoney", 0); |
| | | dateMap.put("servicecharge", 0); |
| | | dateRangeStatistics.add(dateMap); |
| | | } |
| | | |
| | | // 移动到下一天 |
| | | startDate = startDate.plusDays(1); |
| | | } |
| | | tCharingOrderMapVO.setMaps1(dateRangeStatistics); |
| | | }else if (statisticsQueryDto.getDayType()==5){ |
| | | List<Map<String,Object>> maps1 = chargingOrderService.getByDate(chargingOrderIds); |
| | | tCharingOrderMapVO.setMaps1(maps1); |
| | | |
| | | LocalDate startDate = statisticsQueryDto.getStartTime(); |
| | | LocalDate endDate = statisticsQueryDto.getEndTime(); |
| | | |
| | | List<Map<String, Object>> dateRangeStatistics = new ArrayList<>(); |
| | | |
| | | // 遍历日期范围 |
| | | while (!startDate.isAfter(endDate)) { |
| | | String formattedDate = startDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
| | | Map<String, Object> dailyStats = findMapWithDateValue(maps1, formattedDate); |
| | | |
| | | if (dailyStats != null) { |
| | | dateRangeStatistics.add(dailyStats); |
| | | } else { |
| | | Map<String, Object> dateMap = new HashMap<>(); |
| | | dateMap.put("time", formattedDate); |
| | | dateMap.put("electrovalence", 0); |
| | | dateMap.put("orderCount", 0); |
| | | dateMap.put("paymentAmount", 0); |
| | | dateMap.put("paymoney", 0); |
| | | dateMap.put("servicecharge", 0); |
| | | dateRangeStatistics.add(dateMap); |
| | | } |
| | | |
| | | // 移动到下一天 |
| | | startDate = startDate.plusDays(1); |
| | | } |
| | | tCharingOrderMapVO.setMaps1(dateRangeStatistics); |
| | | } |
| | | |
| | | |
| | | tCharingOrderMapVO.setMaps(maps); |
| | | BigDecimal allMoney = new BigDecimal(0); |
| | | for (Map<String, Object> map : maps) { |
| | | BigDecimal periodElectricPrice = (BigDecimal) map.get("period_electric_price"); |
| | | allMoney = allMoney.add(periodElectricPrice); |
| | | BigDecimal total_amount = (BigDecimal) map.get("total_amount"); |
| | | allMoney = allMoney.add(total_amount); |
| | | } |
| | | allMoney = allMoney.multiply(new BigDecimal("0.006")); |
| | | |
| | | |
| | | tCharingOrderMapVO.setAllMoney(allMoney); |
| | | return R.ok(tCharingOrderMapVO); |
| | | |
| | | } |
| | |
| | | return R.ok(tCharingUserEquimentVO); |
| | | } |
| | | |
| | | |
| | | private static double calculateAveragePercent(List<Map<String, Object>> mapList1, List<Map<String, Object>> mapList2) { |
| | | private static final DecimalFormat DF = new DecimalFormat("#.00"); |
| | | public static double calculateAveragePercent(List<Map<String, Object>> mapList1, List<Map<String, Object>> mapList2) { |
| | | int totalElements = mapList1.size() + mapList2.size(); |
| | | double sum = 0.0; |
| | | |
| | |
| | | } |
| | | |
| | | // 计算平均值 |
| | | return sum / totalElements; |
| | | double average = sum / totalElements; |
| | | |
| | | // 格式化为两位小数 |
| | | return Double.parseDouble(DF.format(average)); |
| | | } |
| | | |
| | | @ResponseBody |
| | |
| | | //当日的订单总数 |
| | | int size = list.size(); |
| | | //计算list中paymentAmount的总和 |
| | | BigDecimal totalPaymentAmount = list.stream().map(TChargingOrder::getOrderAmount).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal totalPaymentAmount = list.stream().map(TChargingOrder::getPaymentAmount).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | //计算list中electrovalence的总和 |
| | | BigDecimal totalElectrovalence = list.stream().map(TChargingOrder::getElectrovalence).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | //计算list中serviceCharge的总和 |
| | |
| | | import java.time.LocalDateTime; |
| | | |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.ruoyi.account.api.feignClient.AppUserAddressClient; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.TAppUserAddress; |
| | | import com.ruoyi.chargingPile.api.feignClient.ChargingPileClient; |
| | |
| | | return R.ok(exchangeOrderService.lambdaQuery().eq(TExchangeOrder::getCouponId,goodId).eq(TExchangeOrder::getAppUserId,userId).ne(TExchangeOrder::getStatus,4).count()); |
| | | } |
| | | } |
| | | @Resource |
| | | private AppUserAddressClient appUserAddressClient; |
| | | |
| | | @PostMapping("/create") |
| | | public R<ExchangeBackDto> exchangeCreate(@RequestBody ExchangeDto exchangeDto){ |
| | |
| | | } |
| | | tExchangeOrder.setCreateTime(LocalDateTime.now()); |
| | | tExchangeOrder.setDelFlag(false); |
| | | |
| | | TAppUserAddress data = appUserAddressClient.getAppUserAddressById(exchangeDto.getAddressId()).getData(); |
| | | tExchangeOrder.setAddressJson(JSON.toJSONString(data)); |
| | | |
| | | exchangeOrderService.save(tExchangeOrder); |
| | | ExchangeBackDto exchangeBackDto = new ExchangeBackDto(); |
| | | exchangeBackDto.setId(tExchangeOrder.getId()); |
| | | exchangeBackDto.setCode(tExchangeOrder.getCode()); |
| | | |
| | | return R.ok(exchangeBackDto); |
| | | |
| | | } |
| | |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true), |
| | | @ApiImplicitParam(value = "订单类型(1=充电订单,2=购物订单,3=兑换订单,4=会员订单)", name = "orderType", required = true), |
| | | }) |
| | | public AjaxResult<OrderEvaluateVo> getOrderEvaluate(Integer orderId, Integer orderType){ |
| | | public AjaxResult<OrderEvaluateVo> getOrderEvaluate(String orderId, Integer orderType){ |
| | | OrderEvaluateVo orderEvaluate = orderEvaluateService.getOrderEvaluate(orderId, orderType); |
| | | return AjaxResult.success(orderEvaluate); |
| | | } |
| | |
| | | import java.time.LocalDateTime; |
| | | |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.ruoyi.account.api.feignClient.AppCouponClient; |
| | | import com.ruoyi.account.api.feignClient.AppUserAddressClient; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.TAppUserAddress; |
| | | import com.ruoyi.common.core.domain.R; |
| | |
| | | List<MyShoppingOrderList> list = shoppingOrderService.getNoInvoicedOrder(query); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | |
| | | @Resource |
| | | private AppUserAddressClient appUserAddressClient; |
| | | @PostMapping("/create") |
| | | public R<TShoppingOrder> shopCreate(@RequestBody ExchangeDto exchangeDto) { |
| | | TShoppingOrder shoppingOrder = new TShoppingOrder(); |
| | |
| | | shoppingOrder.setPhone(exchangeDto.getPhone()); |
| | | shoppingOrder.setCreateTime(LocalDateTime.now()); |
| | | shoppingOrder.setDelFlag(false); |
| | | |
| | | |
| | | TAppUserAddress data = appUserAddressClient.getAppUserAddressById(exchangeDto.getAddressId()).getData(); |
| | | shoppingOrder.setAddressJson(JSON.toJSONString(data)); |
| | | shoppingOrderService.save(shoppingOrder); |
| | | |
| | | return R.ok(shoppingOrder); |
| | |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | OrderEvaluateVo getOrderEvaluate(Integer orderId, Integer orderType); |
| | | OrderEvaluateVo getOrderEvaluate(String orderId, Integer orderType); |
| | | |
| | | List<Map<String, Object>> goodTop(List<Integer> siteIds); |
| | | |
| | |
| | | if (data5.getTime_remaining()!=null){ |
| | | chargingSecond+=data5.getTime_remaining()*60; |
| | | } |
| | | Integer cumulativeChargingTime = data5.getCumulative_charging_time(); |
| | | // 将其转化为xx小时xx分钟xx秒显示 如果是0小时则不展示小时 如果是0分钟则不展示分钟 |
| | | if (cumulativeChargingTime!=null){ |
| | | // 计算小时、分钟和秒 |
| | | int hours = cumulativeChargingTime / 60; |
| | | int minutes = cumulativeChargingTime % 60; |
| | | int seconds = 0; // 如果没有秒数,则默认是0 |
| | | StringBuilder result = new StringBuilder(); |
| | | if (hours > 0) { |
| | | result.append(hours).append("小时"); |
| | | } |
| | | if (minutes > 0) { |
| | | result.append(minutes).append("分钟"); |
| | | } |
| | | if (seconds > 0 || result.length() == 0) { // 如果秒数大于0,或者小时和分钟都为0,则显示秒数 |
| | | result.append(seconds).append("秒"); |
| | | } |
| | | tChargingOrder.setChargingTime(result.toString()); |
| | | } |
| | | tChargingOrder.setEndSoc(data5.getSoc().toString()); |
| | | } |
| | | Integer cumulativeChargingTime = data5.getCumulative_charging_time(); |
| | | // 将其转化为xx小时xx分钟xx秒显示 如果是0小时则不展示小时 如果是0分钟则不展示分钟 |
| | | if (cumulativeChargingTime!=null){ |
| | | // 计算小时、分钟和秒 |
| | | int hours = cumulativeChargingTime / 60; |
| | | int minutes = cumulativeChargingTime % 60; |
| | | int seconds = 0; // 如果没有秒数,则默认是0 |
| | | StringBuilder result = new StringBuilder(); |
| | | if (hours > 0) { |
| | | result.append(hours).append("小时"); |
| | | } |
| | | if (minutes > 0) { |
| | | result.append(minutes).append("分钟"); |
| | | } |
| | | if (seconds > 0 || result.length() == 0) { // 如果秒数大于0,或者小时和分钟都为0,则显示秒数 |
| | | result.append(seconds).append("秒"); |
| | | } |
| | | tChargingOrder.setChargingTime(result.toString()); |
| | | } |
| | | tChargingOrder.setEndSoc(data5.getSoc().toString()); |
| | | |
| | | TAppUser data3 = appUserClient.getUserById(tChargingOrder.getAppUserId()).getData(); |
| | | if (tChargingOrder.getAppUserCarId()!=null){ |
| | | List<TAppUserCar> data4 = appUserCarClient.getCarByIds(Arrays.asList(tChargingOrder.getAppUserCarId())).getData(); |
| | |
| | | private TShoppingOrderService shoppingOrderService; |
| | | @Resource |
| | | private TShoppingOrderRefundService shoppingOrderRefundService; |
| | | @Resource |
| | | private TVipOrderService vipOrderService; |
| | | @Resource |
| | | private TVipOrderRefundService vipOrderRefundService; |
| | | @Override |
| | | public R payRefund(PayOrderRefundDto payOrderQueryDto) { |
| | | if (payOrderQueryDto.getType()==1){ |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | if (payOrderQueryDto.getType()==3){ |
| | | TVipOrder tChargingOrder = vipOrderService.getById(payOrderQueryDto.getOrderId()); |
| | | if (tChargingOrder.getPaymentAmount().compareTo(payOrderQueryDto.getRefundAmount())==-1){ |
| | | return R.fail("退款金额需小于支付金额"); |
| | | } |
| | | TVipOrderRefund chargingOrderRefund = new TVipOrderRefund(); |
| | | chargingOrderRefund.setVipOrderId(tChargingOrder.getId()); |
| | | chargingOrderRefund.setRefundAmount(payOrderQueryDto.getRefundAmount()); |
| | | chargingOrderRefund.setRefundStatus(1); |
| | | chargingOrderRefund.setPayType(tChargingOrder.getPaymentType()); |
| | | chargingOrderRefund.setRefundTime(LocalDateTime.now()); |
| | | chargingOrderRefund.setCode(tChargingOrder.getCode()); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | chargingOrderRefund.setRefundCode("GDF" + sdf.format(new Date()) + (Double.valueOf(Math.random() * 1000).intValue())); |
| | | chargingOrderRefund.setRefundTitle("后台退款"); |
| | | chargingOrderRefund.setRefundContent("后台退款"); |
| | | chargingOrderRefund.setRefundReason("后台退款"); |
| | | chargingOrderRefund.setRefundRemark(payOrderQueryDto.getRemark()); |
| | | chargingOrderRefund.setRefundTotalAmount(tChargingOrder.getRefundAmount().add(payOrderQueryDto.getRefundAmount())); |
| | | chargingOrderRefund.setPayAmount(tChargingOrder.getPaymentAmount()); |
| | | |
| | | if(1 == tChargingOrder.getPaymentType()){ |
| | | WxPaymentRefundModel model = new WxPaymentRefundModel(); |
| | | model.setOut_trade_no(tChargingOrder.getCode()); |
| | | model.setOut_refund_no(chargingOrderRefund.getRefundCode()); |
| | | model.setTransaction_id(tChargingOrder.getSerialNumber()); |
| | | model.setReason("取消订单"); |
| | | model.setNotify_url("/order/t-shopping-order/cancelShoppingOrderWxRefund"); |
| | | WxPaymentRefundModel.RefundAmount amount = new WxPaymentRefundModel.RefundAmount(); |
| | | amount.setRefund(payOrderQueryDto.getRefundAmount().multiply(new BigDecimal(100)).intValue()); |
| | | amount.setTotal(tChargingOrder.getPaymentAmount().multiply(new BigDecimal(100)).intValue()); |
| | | amount.setCurrency("CNY"); |
| | | model.setAmount(amount); |
| | | R<String> orderR = wxPaymentClient.refundOrderR(model); |
| | | if(200 == orderR.getCode()){ |
| | | tChargingOrder.setRefundStatus(2); |
| | | tChargingOrder.setRefundAmount((tChargingOrder.getRefundAmount()==null? BigDecimal.valueOf(0) :tChargingOrder.getRefundAmount()).add(payOrderQueryDto.getRefundAmount())); |
| | | vipOrderService.updateById(tChargingOrder); |
| | | vipOrderRefundService.save(chargingOrderRefund); |
| | | } |
| | | } |
| | | |
| | | if(2 == tChargingOrder.getPaymentType()){ |
| | | RefundReq dto = new RefundReq(); |
| | | dto.setOutTradeNo(tChargingOrder.getCode()); |
| | | dto.setOutRequestNo(tChargingOrder.getCode()); |
| | | dto.setRefundAmount(payOrderQueryDto.getRefundAmount().toString()); |
| | | dto.setRefundReason("取消订单"); |
| | | RefundResp resp = aliPaymentClient.refund(dto).getData(); |
| | | if(null != resp){ |
| | | SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-DDTHH:mm:ss+TIMEZONE"); |
| | | |
| | | tChargingOrder.setRefundStatus(2); |
| | | tChargingOrder.setRefundAmount((tChargingOrder.getRefundAmount()==null? BigDecimal.valueOf(0) :tChargingOrder.getRefundAmount()).add(payOrderQueryDto.getRefundAmount())); |
| | | |
| | | |
| | | vipOrderService.updateById(tChargingOrder); |
| | | |
| | | vipOrderRefundService.save(chargingOrderRefund); |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | |
| | | @Override |
| | | public PageInfo<TSettlementConfirm> settlementList(SettlementListQuery dto) { |
| | | if (StringUtils.hasLength(dto.getStartTime())){ |
| | | dto.setType(1); |
| | | String[] split = dto.getStartTime().split(" - "); |
| | | dto.setStartTime(split[0]); |
| | | dto.setEndTime(split[1]); |
| | | } |
| | | if (StringUtils.hasLength(dto.getEndTime())){ |
| | | dto.setType(2); |
| | | String[] split = dto.getStartTime().split(" - "); |
| | | dto.setStartTime(split[0]); |
| | | dto.setEndTime(split[1]); |
| | | } |
| | | PageInfo<TSettlementConfirm> pageInfo = new PageInfo<>(dto.getPageCurr(),dto.getPageSize()); |
| | | List<TSettlementConfirm> list = tSettlementConfirmMapper.settlementList(pageInfo,dto); |
| | | for (TSettlementConfirm tSettlementConfirm : list) { |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public OrderEvaluateVo getOrderEvaluate(Integer orderId, Integer orderType) { |
| | | public OrderEvaluateVo getOrderEvaluate(String orderId, Integer orderType) { |
| | | TOrderEvaluate orderEvaluate = this.getOne(new LambdaQueryWrapper<TOrderEvaluate>().eq(TOrderEvaluate::getOrderId, orderId).eq(TOrderEvaluate::getOrderType, orderType)); |
| | | if(null != orderEvaluate){ |
| | | OrderEvaluateVo orderEvaluateVo = new OrderEvaluateVo(); |
| | |
| | | } |
| | | e.setElectricityTariff(orderInvoiceDetailList.get(0).getElectricityTariff()); |
| | | e.setAddedServiceTariff(orderInvoiceDetailList.get(0).getAddedServiceTariff()); |
| | | e.setAddedService(orderInvoiceDetailList.stream().filter(t->t.getAddedService()!=null).map(TOrderInvoiceDetail::getAddedService).reduce(BigDecimal::add).get()); |
| | | e.setElectrovalence(orderInvoiceDetailList.stream().filter(t->t.getElectrovalence()!=null).map(TOrderInvoiceDetail::getElectrovalence).reduce(BigDecimal::add).get()); |
| | | e.setServiceCharge(orderInvoiceDetailList.stream().filter(t->t.getServiceCharge()!=null).map(TOrderInvoiceDetail::getServiceCharge).reduce(BigDecimal::add).get()); |
| | | e.setAddedService(orderInvoiceDetailList.stream().filter(t->t.getOrderInvoiceId().equals(e.getId()) &&t.getAddedService()!=null).map(TOrderInvoiceDetail::getAddedService).reduce(BigDecimal::add).get()); |
| | | e.setElectrovalence(orderInvoiceDetailList.stream().filter(t->t.getOrderInvoiceId().equals(e.getId()) &&t.getElectrovalence()!=null).map(TOrderInvoiceDetail::getElectrovalence).reduce(BigDecimal::add).get()); |
| | | e.setServiceCharge(orderInvoiceDetailList.stream().filter(t->t.getOrderInvoiceId().equals(e.getId()) && t.getServiceCharge()!=null).map(TOrderInvoiceDetail::getServiceCharge).reduce(BigDecimal::add).get()); |
| | | }); |
| | | } |
| | | |
| | |
| | | List<TActivityStatisticslVO> list = this.baseMapper.activityStatistics(pageInfo,dto); |
| | | List<TActivityStatisticslVO> list1 = this.baseMapper.activityStatistics(pageInfo1,dto); |
| | | |
| | | list.sort((o1, o2) -> o2.getCreateTime().compareTo(o1.getCreateTime())); |
| | | // 优惠券金额 |
| | | BigDecimal coupon = new BigDecimal("0"); |
| | | // 会员抵扣金额 |
| | |
| | | BigDecimal vipActivity = new BigDecimal("0"); |
| | | // 赠送会员 |
| | | BigDecimal grantVip = new BigDecimal("0"); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | for (TActivityStatisticslVO tActivityStatisticslVO : list1) { |
| | | TAppUser data = appUserClient.getUserById(tActivityStatisticslVO.getAppUserId()).getData(); |
| | | if (data!=null){ |
| | |
| | | break; |
| | | case 3: |
| | | // 会员订单 优惠金额大于0 |
| | | if (tActivityStatisticslVO.getVipDiscountAmount()!=null |
| | | && |
| | | (tActivityStatisticslVO.getCouponDiscountAmount().compareTo(BigDecimal.ZERO)>0)){ |
| | | if (tActivityStatisticslVO.getVipDiscountAmount()!=null){ |
| | | vipActivity = vipActivity.add(tActivityStatisticslVO.getVipDiscountAmount()); |
| | | } |
| | | tActivityStatisticslVO.setType("会员活动"); |
| | |
| | | } |
| | | } |
| | | for (TActivityStatisticslVO tActivityStatisticslVO : list) { |
| | | |
| | | // 判断享有了哪些类型 |
| | | switch (tActivityStatisticslVO.getOrderType()){ |
| | | case 1: |
| | |
| | | // 充电订单 优惠券金额大于0 |
| | | if (tActivityStatisticslVO.getCouponDiscountAmount()!=null |
| | | && |
| | | (tActivityStatisticslVO.getCouponDiscountAmount().compareTo(BigDecimal.ZERO)>0)){ |
| | | coupon = coupon.add(tActivityStatisticslVO.getCouponDiscountAmount()); |
| | | stringBuilder.append("优惠券抵扣").append("+"); |
| | | } |
| | | (tActivityStatisticslVO.getCouponDiscountAmount().compareTo(BigDecimal.ZERO)>0)){ |
| | | stringBuilder.append("优惠券抵扣").append("+"); |
| | | } |
| | | if (tActivityStatisticslVO.getVipDiscountAmount()!=null &&(tActivityStatisticslVO.getVipDiscountAmount().compareTo(BigDecimal.ZERO)>0)){ |
| | | discount = discount.add(tActivityStatisticslVO.getVipDiscountAmount()); |
| | | stringBuilder.append("会员抵扣").append("+"); |
| | | } |
| | | if (stringBuilder.length()>0){ |
| | |
| | | if (tActivityStatisticslVO.getCouponDiscountAmount()!=null |
| | | && |
| | | (tActivityStatisticslVO.getCouponDiscountAmount().compareTo(BigDecimal.ZERO)>0)){ |
| | | coupon = coupon.add(tActivityStatisticslVO.getCouponDiscountAmount()); |
| | | stringBuilder1.append("优惠券抵扣").append("+"); |
| | | } |
| | | if (tActivityStatisticslVO.getVipDiscountAmount()!=null |
| | | && |
| | | (tActivityStatisticslVO.getVipDiscountAmount().compareTo(BigDecimal.ZERO)>0)){ |
| | | discount = discount.add(tActivityStatisticslVO.getVipDiscountAmount()); |
| | | stringBuilder1.append("会员抵扣").append("+"); |
| | | } |
| | | if (stringBuilder1.length()>0){ |
| | |
| | | break; |
| | | case 3: |
| | | // 会员订单 优惠金额大于0 |
| | | if (tActivityStatisticslVO.getVipDiscountAmount()!=null |
| | | && |
| | | (tActivityStatisticslVO.getCouponDiscountAmount().compareTo(BigDecimal.ZERO)>0)){ |
| | | vipActivity = vipActivity.add(tActivityStatisticslVO.getVipDiscountAmount()); |
| | | } |
| | | tActivityStatisticslVO.setType("会员活动"); |
| | | tActivityStatisticslVO.setTime(tActivityStatisticslVO.getCreateTime()); |
| | | break; |
| | | case 4: |
| | | // 赠送会员订单 如果支付金额为0 那么就是后台赠送的会员 |
| | | if (tActivityStatisticslVO.getPaymentAmount().compareTo(BigDecimal.ZERO)==0){ |
| | | grantVip = grantVip.add(tActivityStatisticslVO.getOrderAmount()); |
| | | tActivityStatisticslVO.setType("赠送会员"); |
| | | tActivityStatisticslVO.setTime(tActivityStatisticslVO.getCreateTime()); |
| | | }else{ |
| | | // 赠送 |
| | | grantVip = grantVip.add(tActivityStatisticslVO.getVipDiscountAmount()); |
| | | tActivityStatisticslVO.setType("赠送会员"); |
| | | tActivityStatisticslVO.setTime(tActivityStatisticslVO.getCreateTime()); |
| | | } |
| | |
| | | </select> |
| | | <select id="getDateData" resultType="java.util.Map"> |
| | | SELECT |
| | | DATE_FORMAT( create_time, '%Y-%m-%d %H' ) as time, |
| | | DATE_FORMAT( create_time, '%H:00' ) as time, |
| | | CAST(SUM(service_charge-coupon_discount_amount) 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, |
| | |
| | | 315360 |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType == 5"> |
| | | (86400*(SELECT TIMESTAMPDIFF(DAY, #{statisticsQueryDto.startTime}, #{statisticsQueryDto.endTime}) +1 AS days_difference |
| | | (864*(SELECT TIMESTAMPDIFF(DAY, #{statisticsQueryDto.startTime}, #{statisticsQueryDto.endTime}) +1 AS days_difference |
| | | )) |
| | | </if> |
| | | |
| | |
| | | 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}) +1 AS days_difference |
| | | (864*(SELECT TIMESTAMPDIFF(DAY, #{statisticsQueryDto.startTime}, #{statisticsQueryDto.endTime}) +1 AS days_difference |
| | | )) |
| | | </if> |
| | | |
| | |
| | | SELECT |
| | | FORMAT(SUM(TIME_TO_SEC(TIMEDIFF(co.end_time, co.down_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}) +1 AS days_difference |
| | | (864*(SELECT TIMESTAMPDIFF(DAY, #{statisticsQueryDto.startTime}, #{statisticsQueryDto.endTime}) +1 AS days_difference |
| | | )) |
| | | </if> |
| | | |
| | | ), 2) AS percent,co.charging_gun_id,tc.name,cp.name as name1 |
| | | ), 2) AS percent,cp.name |
| | | FROM |
| | | `charging_pile_service`.`t_fault_message` 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 |
| | | `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 =2 |
| | | co.down_time IS NOT NULL AND co.end_time IS NOT NULL and cp.type = 1 and co.status =2 |
| | | <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 DATE(co.create_time) >= #{statisticsQueryDto.startTime} |
| | | </if> |
| | | <if test="statisticsQueryDto.endTime != null"> |
| | | |
| | | |
| | | and DATE(co.create_time) <= #{statisticsQueryDto.endTime} |
| | | </if> |
| | | |
| | | </if> |
| | | GROUP BY tc.name,cp.name,co.charging_gun_id |
| | | GROUP BY cp.name |
| | | |
| | | |
| | | </select> |
| | |
| | | SELECT |
| | | FORMAT(SUM(TIME_TO_SEC(TIMEDIFF(co.end_time, co.down_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}) +1 AS days_difference |
| | | (864*(SELECT TIMESTAMPDIFF(DAY, #{statisticsQueryDto.startTime}, #{statisticsQueryDto.endTime}) +1 AS days_difference |
| | | )) |
| | | </if> |
| | | |
| | | ), 2) AS percent,co.charging_gun_id,tc.name,cp.name as name1 |
| | | ), 2) AS percent,cp.name |
| | | FROM |
| | | `charging_pile_service`.`t_fault_message` 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 |
| | | 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 = 2 and co.status =2 |
| | | co.down_time IS NOT NULL AND co.end_time IS NOT NULL and cp.type in (2,3) and co.status =2 |
| | | <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 DATE(co.create_time) >= #{statisticsQueryDto.startTime} |
| | | </if> |
| | | <if test="statisticsQueryDto.endTime != null"> |
| | | |
| | | and DATE(co.create_time) <= #{statisticsQueryDto.endTime} |
| | | </if> |
| | | |
| | | </if> |
| | | GROUP BY tc.name,cp.name,co.charging_gun_id |
| | | GROUP BY cp.name |
| | | |
| | | |
| | | </select> |
| | |
| | | SELECT |
| | | FORMAT(SUM(TIME_TO_SEC(TIMEDIFF(co.end_time, co.down_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}) +1 AS days_difference |
| | | (864*(SELECT TIMESTAMPDIFF(DAY, #{statisticsQueryDto.startTime}, #{statisticsQueryDto.endTime}) +1 AS days_difference |
| | | )) |
| | | </if> |
| | | |
| | | ), 2) AS percent,co.charging_gun_id,tc.name,cp.name as name1 |
| | | ), 2) AS percent,cp.name |
| | | FROM |
| | | `charging_pile_service`.`t_fault_message` 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 |
| | | 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 |
| | | <if test="siteIds != null and siteIds.size() > 0"> |
| | |
| | | and DATE(co.create_time) <= #{statisticsQueryDto.endTime} |
| | | </if> |
| | | </if> |
| | | GROUP BY tc.name,cp.name,co.charging_gun_id |
| | | GROUP BY cp.name |
| | | </select> |
| | | <select id="equipmentMapOut2" resultType="java.util.Map"> |
| | | SELECT |
| | | FORMAT(SUM(TIME_TO_SEC(TIMEDIFF(co.end_time, co.down_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}) +1 AS days_difference |
| | | (864*(SELECT TIMESTAMPDIFF(DAY, #{statisticsQueryDto.startTime}, #{statisticsQueryDto.endTime}) +1 AS days_difference |
| | | )) |
| | | </if> |
| | | |
| | | ), 2) AS percent,co.charging_gun_id,tc.name,cp.name as name1 |
| | | ), 2) AS percent,cp.name |
| | | FROM |
| | | `charging_pile_service`.`t_fault_message` 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 |
| | | 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 = 2 and co.status =1 |
| | | co.down_time IS NOT NULL AND co.end_time IS NOT NULL and cp.type = 1 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=")"> |
| | |
| | | and DATE(co.create_time) <= #{statisticsQueryDto.endTime} |
| | | </if> |
| | | </if> |
| | | GROUP BY tc.name,cp.name,co.charging_gun_id |
| | | GROUP BY cp.name |
| | | |
| | | </select> |
| | | <select id="needElec" resultType="java.util.Map"> |
| | | SELECT |
| | | FORMAT((SUM(co.current) / SUM(co.need_elec)), 2) AS percent, |
| | | FORMAT((SUM(co.current)*100 / SUM(co.need_elec)), 2) AS percent, |
| | | co.charging_gun_id, |
| | | tc.name as name, |
| | | cp.name AS siteName |
| | |
| | | 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 and co.need_elec != 0 |
| | | tc.type = 4 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=")"> |
| | |
| | | </select> |
| | | <select id="needElec1" resultType="java.util.Map"> |
| | | SELECT |
| | | FORMAT((SUM(co.current) / SUM(co.need_elec)), 2) AS percent, |
| | | FORMAT((SUM(co.current)*100 / SUM(co.need_elec)), 2) AS percent, |
| | | co.charging_gun_id, |
| | | tc.name as name, |
| | | cp.name AS siteName |
| | |
| | | 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 = 2 |
| | | tc.type in (2,3) |
| | | <if test="siteIds != null and siteIds.size() > 0"> |
| | | and co.site_id IN |
| | | <foreach collection="siteIds" item="siteId" open="(" separator="," close=")"> |
| | |
| | | select t1.* from |
| | | t_settlement_confirm t1 |
| | | where 1=1 |
| | | <if test="req.type != null "> |
| | | and t1.type = #{req.type} |
| | | </if> |
| | | <if test="req.partnerId != null "> |
| | | and t1.partnerId = #{req.partnerId} |
| | | and t1.partner_id = #{req.partnerId} |
| | | </if> |
| | | <if test="req.siteIds != null "> |
| | | and t1.site_id = #{req.siteIds} |
| | | </if> |
| | | <if test="req.type == 1 "> |
| | | <if test="req.startTime != null and req.startTime!=''"> |
| | | and (t1.start_time between #{req.startTime} and #{req.endTime} |
| | | </if> |
| | | </if> |
| | | <if test="req.siteIds != null and req.siteIds.size() > 0"> |
| | | AND t1.site_id IN |
| | | <foreach collection="req.siteIds" item="siteId" open="(" separator="," close=")"> |
| | | #{siteId} |
| | | </foreach> |
| | | </if> |
| | | <if test="req.type == 2 "> |
| | | <if test="req.startTime != null and req.startTime!=''"> |
| | | and (t1.end_time between #{req.startTime} and #{req.endTime} |
| | | </if> |
| | | </if> |
| | | and t1.del_flag = 0 |
| | | and t1.del_flag = 0 |
| | | </select> |
| | | </mapper> |
| | |
| | | id, code, app_user_id, order_type, goods_id, coupon_id, purchase_quantity, app_user_address_id, order_amount, app_coupon_id, coupon_discount_amount, vip_discount, vip_discount_amount, payment_amount, payment_status, payment_type, serial_number, remark, status, express_company, express_number, consigner_id, consigner_time, receiving_time, cancellation_time, cancellation_id, refund_code, refund_amount, refund_status, refund_serial_number, refund_time, create_time, del_flag |
| | | </sql> |
| | | <select id="activityStatistics" resultType="com.ruoyi.order.api.vo.TActivityStatisticslVO"> |
| | | select * from ( |
| | | select t9.code ,t9.order_amount as orderAmount, |
| | | t9.coupon_discount_amount as couponDiscountAmount, |
| | | t9.vip_discount_amount as vipDiscountAmount, |
| | |
| | | t9.app_user_id as appUserId, |
| | | 1 as orderType |
| | | from t_charging_order t9 |
| | | where t9.id = 0 limit 1 |
| | | where t9.id = 0 |
| | | <if test="req.orderType == null or req.orderType == 1"> |
| | | <if test="req.type == null or req.type == 1 or req.type == 2"> |
| | | union all |
| | | select t1.code ,t1.order_amount as orderAmount, |
| | | t1.coupon_discount_amount as couponDiscountAmount, |
| | | t1.vip_discount_amount as vipDiscountAmount, |
| | | t1.payment_amount as paymentAmount, |
| | | t1.create_time as createTime, |
| | | select |
| | | t1.code , |
| | | t1.order_amount as orderAmount, |
| | | t1.coupon_discount_amount as couponDiscountAmount, |
| | | t1.vip_discount_amount as vipDiscountAmount, |
| | | t1.payment_amount as paymentAmount, |
| | | t1.create_time as createTime, |
| | | t1.app_user_id as appUserId, |
| | | 1 as orderType |
| | | 1 as orderType |
| | | from t_charging_order t1 |
| | | where 1 = 1 |
| | | <if test="null != req.code and req.code!=''"> |
| | | and t1.code LIKE CONCAT('%',#{req.code},'%') |
| | | </if> |
| | | <if test="req.type != null and req.type != '' and req.type == 1"> |
| | | <if test="req.type != null and req.type == 1"> |
| | | and t1.coupon_discount_amount > 0 |
| | | </if> |
| | | <if test="req.type != null and req.type != '' and req.type == 2"> |
| | | <if test="req.type != null and req.type == 2"> |
| | | and t1.vip_discount_amount > 0 |
| | | </if> |
| | | <if test="req.type == null "> |
| | | and (t1.vip_discount_amount > 0 or t1.coupon_discount_amount > 0) |
| | | </if> |
| | | <if test="null != req.userIds and req.userIds.size()>0" > |
| | | and t1.app_user_id in |
| | |
| | | <if test="req.endTime != null and req.endTime != '' and req.startTime != null and req.startTime != ''"> |
| | | AND (t1.create_time between CONCAT(#{req.startTime},':00') and CONCAT(#{req.endTime},':59')) |
| | | </if> |
| | | and t1.recharge_payment_status =2 |
| | | and t1.refund_status !=2 |
| | | and (t1.vip_discount_amount > 0 or t1.coupon_discount_amount > 0) |
| | | and t1.recharge_payment_status =2 |
| | | and t1.refund_status !=2 |
| | | AND t1.del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} |
| | | </if> |
| | | </if> |
| | |
| | | AND (t5.create_time between CONCAT(#{req.startTime},':00') and CONCAT(#{req.endTime},':59')) |
| | | </if> |
| | | AND t5.del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} |
| | | |
| | | </if> |
| | | </if> |
| | | </if> |
| | | ) |
| | | order by createTime DESC |
| | | </select> |
| | | |
| | | |
| | |
| | | nacos: |
| | | discovery: |
| | | # 服务注册地址 |
| | | server-addr: 127.0.0.1:8848 |
| | | server-addr: 192.168.110.169:8848 |
| | | service: ${spring.application.name} |
| | | group: DEFAULT_GROUP |
| | | namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb |
| | |
| | | password: nacos |
| | | config: |
| | | # 配置中心地址 |
| | | server-addr: 127.0.0.1:8848 |
| | | server-addr: 192.168.110.169:8848 |
| | | namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb |
| | | group: DEFAULT_GROUP |
| | | name: ${spring.application.name} |
| | |
| | | type: nacos |
| | | nacos: |
| | | # 开发环境 |
| | | server-addr: 127.0.0.1:8848 |
| | | server-addr: 192.168.110.169:8848 |
| | | namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb |
| | | group: DEFAULT_GROUP |
| | | data-id: seata-server.properties |
| | |
| | | nacos: |
| | | application: seata-server |
| | | # 开发环境 |
| | | server-addr: 127.0.0.1:8848 |
| | | server-addr: 192.168.110.169:8848 |
| | | namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb |
| | | group: DEFAULT_GROUP |
| | | username: nacos |
| | |
| | | nacos: |
| | | discovery: |
| | | # 开发环境 |
| | | server-addr: 127.0.0.1:8848 # nacos注册中心地址 |
| | | server-addr: 192.168.110.169:8848 # nacos注册中心地址 |
| | | namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb # 命名空间 |
| | | group: DEFAULT_GROUP |
| | | application: seata-server #Nacos 中 Seata 名称 |