ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/vo/ExchangeRecordVO.java
@@ -37,5 +37,7 @@ @ApiModelProperty(value = "优惠券id") private Integer couponId; @ApiModelProperty(value = " 是否删除0否1是 前端忽略") private Integer delFlag; private Boolean delFlag; @ApiModelProperty(value = " 是否删除0否1是 前端忽略") private Long id; } ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/dto/SettlementConfirmAdd.java
@@ -1,11 +1,18 @@ package com.ruoyi.order.api.dto; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.core.web.page.BasePage; import com.ruoyi.order.api.model.TChargingOrder; import com.ruoyi.order.api.model.TSettlementConfirm; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; @Data @@ -21,6 +28,106 @@ private String endTime; @ApiModelProperty(value = "点击去生成 传1 填完表格数据点击保存 传2") private Integer state; @ApiModelProperty(value = "保存的数据") private TSettlementConfirm data; @ApiModelProperty(value = "主键") @TableId(value = "id", type = IdType.AUTO) private Long id; @ApiModelProperty(value = "合作商id") private Integer partnerId; @ApiModelProperty(value = "结算电费备注") private String remark; @ApiModelProperty(value = "结算服务费备注") private String serviceRemark; @ApiModelProperty(value = "计量电量(电量合计)") private BigDecimal meteringElectronic; @ApiModelProperty(value = "充电电量") private BigDecimal chargingElectronic; @ApiModelProperty(value = "电损电量") private BigDecimal lossElectronic; @ApiModelProperty(value = "收入合计") private BigDecimal income; @ApiModelProperty(value = "场地费") private BigDecimal venue; @ApiModelProperty(value = "计量电费") private BigDecimal metering; @ApiModelProperty(value = "清洁费") private BigDecimal clean; @ApiModelProperty(value = "日常维护费") private BigDecimal maintain; @ApiModelProperty(value = "成本") private BigDecimal cost; @ApiModelProperty(value = "合计可分配金额") private BigDecimal distribution; @ApiModelProperty(value = "利润") private BigDecimal profitMoney; @ApiModelProperty(value = "新能源利润") private BigDecimal newMoney; @ApiModelProperty(value = "新能源结算金额") private BigDecimal newSettlement; @ApiModelProperty(value = "供电局结算电费") private BigDecimal supplyElectronic; @ApiModelProperty(value = "合作商承担电损占比") private BigDecimal proportionPartner; @ApiModelProperty(value = "承担金额") private BigDecimal proportionMoney; @ApiModelProperty(value = "本期结算电费总金额 (实际电费转账)") private BigDecimal totalElectronic; @ApiModelProperty(value = "本期结算服务费总金额(实际服务费转账)") private BigDecimal totalService; @ApiModelProperty(value = "合作商充电服务费根据合同约定分成比例") private BigDecimal servicePartner; @ApiModelProperty(value = "合作商充电服务费根据合同约定分成金额") private BigDecimal serviceMoney; @ApiModelProperty(value = "三方收费(合计三方平台收费)") private BigDecimal sharingAmount; @ApiModelProperty(value = " 交易手续费 三方收费*0.06%") private BigDecimal commissionAmount; @ApiModelProperty(value = "充电电费计费(平台合计电费)") private BigDecimal electrovalence; @ApiModelProperty(value = "充电服务费计费(实收服务费)") private BigDecimal serviceCharge; @ApiModelProperty(value = "交易手续费计费") private BigDecimal orderCommission; @ApiModelProperty(value = "会员抵扣") private BigDecimal vipDiscount; @ApiModelProperty(value = "优惠券抵扣") private BigDecimal couponDiscount; // @ApiModelProperty(value = "类型(1=开始,2=结束)") // @TableField("type") // private Integer type; // @ApiModelProperty(value = "开始时间") // @TableField("start_time") // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") // private LocalDateTime startTime; // @ApiModelProperty(value = "结束时间") // @TableField("end_time") // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") // private LocalDateTime endTime; @ApiModelProperty(value = "站点名称") private String siteName; @ApiModelProperty(value = "合作商名称") private String partnerName; @ApiModelProperty(value = "uid") private String uid; @ApiModelProperty(value = "结账日期 2024年09月06日17:10:06至2024年09月06日17:10:06") private String time; @ApiModelProperty(value = "充电记录明细") private List<TChargingOrder> list; @ApiModelProperty(value = "收入合计涨幅/跌幅 正数为涨幅负数为跌幅 字段为空 说明没有上月记录 不展示涨幅跌幅") private String incomePercentage; @ApiModelProperty(value = "总利润涨幅/跌幅 正数为涨幅负数为跌幅 字段为空 说明没有上月记录 不展示涨幅跌幅") private String totalPercentage; @ApiModelProperty(value = "利用率") private String rate; @ApiModelProperty(value = "参与电力市场交易退补电费") private Integer electronicRefund; } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/TAppCouponServiceImpl.java
@@ -1,6 +1,7 @@ package com.ruoyi.account.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.account.api.dto.CouponListDto; import com.ruoyi.account.api.model.TAppCoupon; @@ -28,6 +29,7 @@ import com.ruoyi.other.api.feignClient.VipClient; import io.swagger.models.auth.In; import org.apache.poi.ss.formula.functions.T; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.StringUtils; @@ -36,6 +38,7 @@ import java.math.BigInteger; import java.text.SimpleDateFormat; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Comparator; import java.util.Date; import java.util.List; @@ -71,23 +74,32 @@ @Override public List<ExchangeRecordVO> pagelist(ExchangeRecordGoodsQuery dto) { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); List<ExchangeRecordVO> list = this.baseMapper.pageList(dto); QueryWrapper<TAppCoupon> wrapper = new QueryWrapper<>(); wrapper.eq("coupon_id",dto.getCouponId()); List<TAppCoupon> tAppCoupons = this.baseMapper.selectList(wrapper); List<ExchangeRecordVO> list = new ArrayList<>(); // 订单ids StringBuilder stringBuilder = new StringBuilder(); for (TAppCoupon tAppCoupon : tAppCoupons) { ExchangeRecordVO exchangeRecordVO = new ExchangeRecordVO(); BeanUtils.copyProperties(tAppCoupon,exchangeRecordVO); list.add(exchangeRecordVO); } for (ExchangeRecordVO exchangeRecordVO : list) { switch (exchangeRecordVO.getWaysToObtain()){ case 1: if (exchangeRecordVO.getOrderId()!=null){ stringBuilder.append(exchangeRecordVO.getOrderId()).append(","); if (exchangeRecordVO.getId()!=null){ stringBuilder.append("-").append(exchangeRecordVO.getId()).append(","); }else{ stringBuilder.append("0").append(","); } break; case 2: if (exchangeRecordVO.getOrderId()!=null){ stringBuilder.append("-").append(exchangeRecordVO.getOrderId()).append(","); if (exchangeRecordVO.getId()!=null){ stringBuilder.append(exchangeRecordVO.getId()).append(","); }else{ stringBuilder.append("-").append("0").append(","); stringBuilder.append("0").append(","); } break; } @@ -96,7 +108,7 @@ exchangeRecordVO.setEndTime1(format.format(date)); exchangeRecordVO.setCreateTime1(format.format(date1)); if (exchangeRecordVO.getStatus()==1){ if (exchangeRecordVO.getDelFlag() == 1){ if (exchangeRecordVO.getDelFlag()){ // 删除了 就是已取消状态 exchangeRecordVO.setStatus(4); }else{ @@ -111,7 +123,7 @@ } } if (exchangeRecordVO.getStatus()==2){ if (exchangeRecordVO.getDelFlag() == 1){ if (exchangeRecordVO.getDelFlag()){ // 删除了 就是已取消状态 exchangeRecordVO.setStatus(4); }else{ ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TExchangeOrderController.java
@@ -223,7 +223,7 @@ */ @GetMapping("/getCodeByOrderId/{goodsIds}") public R<List<String>> getCodeByOrderId(@PathVariable("goodsIds") String goodsIds){ String[] split = goodsIds.split("-"); String[] split = goodsIds.split(","); List<String> strings = new ArrayList<>(); for (String s : split) { if (s.contains("-")){ ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java
@@ -1805,7 +1805,7 @@ String endTime = dto.getEndTime(); // 将这两个时间转化为localDateTime // 创建 DateTimeFormatter 对象,指定格式 DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm:ss"); // 将字符串解析为 LocalDateTime 对象 LocalDateTime localDateTime = LocalDateTime.parse(startTime, formatter); @@ -1819,10 +1819,10 @@ .eq("recharge_payment_status",2); switch (dto.getType()){ case 1: eq.between("start_time", startTime, endTime); eq.between("start_time", localDateTime, localDateTime1); break; case 2: eq.between("end_time", startTime, endTime); eq.between("end_time", localDateTime, localDateTime1); break; } List<TChargingOrder> tChargingOrders = this.baseMapper.selectList(eq); @@ -1903,26 +1903,26 @@ tSettlementConfirm.setType(dto.getType()); if (dto.getState() == 2){ tSettlementConfirm.setSupplyElectronic(dto.getData().getSupplyElectronic()); tSettlementConfirm.setVenue(dto.getData().getVenue()); tSettlementConfirm.setMetering(dto.getData().getMetering()); tSettlementConfirm.setClean(dto.getData().getClean()); tSettlementConfirm.setLossElectronic(dto.getData().getLossElectronic()); tSettlementConfirm.setMaintain(dto.getData().getMaintain()); tSettlementConfirm.setSupplyElectronic(dto.getSupplyElectronic()); tSettlementConfirm.setVenue(dto.getVenue()); tSettlementConfirm.setMetering(dto.getMetering()); tSettlementConfirm.setClean(dto.getClean()); tSettlementConfirm.setLossElectronic(dto.getLossElectronic()); tSettlementConfirm.setMaintain(dto.getMaintain()); tSettlementConfirm.setMeteringElectronic(dto.getData().getMeteringElectronic()); tSettlementConfirm.setProportionPartner(dto.getData().getProportionPartner()); tSettlementConfirm.setProportionMoney(dto.getData().getProportionMoney()); tSettlementConfirm.setTotalElectronic(dto.getData().getTotalElectronic()); tSettlementConfirm.setTotalService(dto.getData().getTotalService()); tSettlementConfirm.setRemark(dto.getData().getRemark()); tSettlementConfirm.setServicePartner(dto.getData().getServicePartner()); tSettlementConfirm.setServiceMoney(dto.getData().getServiceMoney()); tSettlementConfirm.setTotalService(dto.getData().getTotalService()); tSettlementConfirm.setServiceRemark(dto.getData().getServiceRemark()); tSettlementConfirm.setDistribution(dto.getData().getDistribution()); tSettlementConfirm.setIncome(dto.getData().getElectrovalence().add(dto.getData().getServiceCharge())); tSettlementConfirm.setCost(dto.getData().getVenue().add(dto.getData().getClean()).add(dto.getData().getMaintain())); tSettlementConfirm.setMeteringElectronic(dto.getMeteringElectronic()); tSettlementConfirm.setProportionPartner(dto.getProportionPartner()); tSettlementConfirm.setProportionMoney(dto.getProportionMoney()); tSettlementConfirm.setTotalElectronic(dto.getTotalElectronic()); tSettlementConfirm.setTotalService(dto.getTotalService()); tSettlementConfirm.setRemark(dto.getRemark()); tSettlementConfirm.setServicePartner(dto.getServicePartner()); tSettlementConfirm.setServiceMoney(dto.getServiceMoney()); tSettlementConfirm.setTotalService(dto.getTotalService()); tSettlementConfirm.setServiceRemark(dto.getServiceRemark()); tSettlementConfirm.setDistribution(dto.getDistribution()); tSettlementConfirm.setIncome(dto.getElectrovalence().add(dto.getServiceCharge())); tSettlementConfirm.setCost(dto.getVenue().add(dto.getClean()).add(dto.getMaintain())); tSettlementConfirmMapper.insert(tSettlementConfirm); } return tSettlementConfirm; @@ -1949,7 +1949,7 @@ } pageInfo.setRecords(list); return null; return pageInfo; } @Override