Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile
# Conflicts:
# ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/UserListQueryDto.java
New file |
| | |
| | | package com.ruoyi.account.api.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class GiveVipDto { |
| | | @ApiModelProperty("vipid") |
| | | private Integer vipId; |
| | | @ApiModelProperty("1月2季3年") |
| | | private Integer type; |
| | | @ApiModelProperty("用户Id") |
| | | private Long userId; |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.api.dto; |
| | | |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class PointsQueryDto extends BasePage { |
| | | private Long userId; |
| | | @ApiModelProperty("1收入0支出") |
| | | private Integer type; |
| | | @ApiModelProperty("1=签到得,2=充电得,3=好评得,4=邀请好友得,5=添加车辆得,6=兑换商品减") |
| | | private Integer changeType; |
| | | } |
| | |
| | | |
| | | @Data |
| | | public class TagListQueryDto extends BasePage { |
| | | String tagName; |
| | | private String tagName; |
| | | } |
| | |
| | | |
| | | @Data |
| | | public class UnitListQueryDto extends BasePage { |
| | | String companyName; |
| | | private String companyName; |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.api.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class UserChangeDto { |
| | | private Long userId; |
| | | @ApiModelProperty("1=正常,2=冻结") |
| | | private Integer status; |
| | | } |
| | |
| | | import java.util.List; |
| | | @Data |
| | | public class UserDetailDto extends TAppUser { |
| | | @ApiModelProperty("累计充电数") |
| | | private Long orderCount; |
| | | |
| | | @ApiModelProperty("单位名称") |
| | | private String unitName; |
| | | |
| | | @ApiModelProperty("车辆列表") |
| | | List<TAppUserCar> carList; |
| | | private List<TAppUserCar> carList; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "vip名称") |
| | | @TableField(exist = false) |
| | | private String vipName; |
| | | @ApiModelProperty("累计充电数") |
| | | @TableField(exist = false) |
| | | private Long orderCount; |
| | | |
| | | |
| | | } |
| | |
| | | @TableField("extension") |
| | | private String extension; |
| | | |
| | | @ApiModelProperty(value = "订单编号") |
| | | @TableField(exist = false) |
| | | private String orderNum; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.dto; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ApplyChargingQuery extends BasePage { |
| | | String name; |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.dto; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ApplyChargingRemarkDto extends BasePage { |
| | | Integer id; |
| | | String remark; |
| | | } |
| | |
| | | private Integer chargingPileNumber; |
| | | @ApiModelProperty(value = "排序") |
| | | private Integer sort; |
| | | @ApiModelProperty("计费策略id") |
| | | private Integer accountingStrategyId; |
| | | @ApiModelProperty("计费策略类型(1=平台添加,2=自定义策略)") |
| | | private Integer accountingStrategyType; |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/8 15:07 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class PageChargingPileListDTO { |
| | | @ApiModelProperty(value = "充电桩id") |
| | | private Integer id; |
| | | @ApiModelProperty(value = "充电桩编号") |
| | | private String code; |
| | | @ApiModelProperty(value = "充电桩名称") |
| | | private String name; |
| | | @ApiModelProperty(value = "桩号") |
| | | private String number; |
| | | @ApiModelProperty(value = "设备类型(0=其他,1=直流设备,2=交流设备,3=交直流一体设备,4=无线设备)") |
| | | private Integer type; |
| | | @ApiModelProperty(value = "归属电站id") |
| | | private Integer siteId; |
| | | @ApiModelProperty(value = "归属电站名称") |
| | | private String siteName; |
| | | @ApiModelProperty(value = "归属合作商id") |
| | | private String partnerId; |
| | | @ApiModelProperty(value = "归属合作商名称") |
| | | private String partnerName; |
| | | @ApiModelProperty(value = "生产商名称") |
| | | private String manufacturer; |
| | | @ApiModelProperty(value = "设备型号") |
| | | private String equipmentType; |
| | | @ApiModelProperty(value = "额定功率") |
| | | private BigDecimal ratedPower; |
| | | |
| | | } |
| | |
| | | |
| | | import com.ruoyi.chargingPile.api.factory.ChargingPileFallbackFactory; |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | /** |
| | | * 充电桩服务 |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | @TableField("discount") |
| | | private BigDecimal discount; |
| | | |
| | | @ApiModelProperty(value = "一级审核用户id") |
| | | @TableField("first_user_id") |
| | | private Long firstUserId; |
| | | |
| | | @ApiModelProperty(value = "二级审核用户id") |
| | | @TableField("two_user_id") |
| | | private Long twoUserId; |
| | | |
| | | @ApiModelProperty(value = "一级审核备注") |
| | | @TableField("first_remark") |
| | | private String firstRemark; |
| | | |
| | | @ApiModelProperty(value = "二级审核备注") |
| | | @TableField("two_remark") |
| | | private String twoRemark; |
| | | |
| | | @ApiModelProperty(value = "审核状态(1=待审核一级,2=待审核二级,3=审核通过,4=驳回)") |
| | | @TableField("audit_status") |
| | | private Integer auditStatus; |
| | | |
| | | @ApiModelProperty(value = "一级审核时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField("first_audit_time") |
| | | private LocalDateTime firstAuditTime; |
| | | |
| | | @ApiModelProperty(value = "二级审核时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField("two_audit_time") |
| | | private LocalDateTime twoAuditTime; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "充电枪编号") |
| | | @ApiModelProperty(value = "充电枪编号", required = true) |
| | | @TableField("code") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "站点id") |
| | | @ApiModelProperty(value = "站点id", required = true) |
| | | @TableField("site_id") |
| | | private Integer siteId; |
| | | |
| | | @ApiModelProperty(value = "合作商id") |
| | | @ApiModelProperty(value = "合作商id", required = true) |
| | | @TableField("partner_id") |
| | | private Integer partnerId; |
| | | |
| | | @ApiModelProperty(value = "充电桩id") |
| | | @ApiModelProperty(value = "充电桩id", required = true) |
| | | @TableField("charging_pile_id") |
| | | private Integer chargingPileId; |
| | | |
| | | @ApiModelProperty(value = "充电枪名称") |
| | | @ApiModelProperty(value = "充电枪名称", required = true) |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "充电枪类型(0=其他,1=家用插座(模式2),2=交流接口插座(模式3,连接方式B),3=交流接口插头(带枪线,模式3,连接方式C)4=直流接口枪头(带枪线,模式4)5=无线充电座)") |
| | | @ApiModelProperty(value = "充电枪类型(0=其他,1=家用插座(模式2),2=交流接口插座(模式3,连接方式B),3=交流接口插头(带枪线,模式3,连接方式C)4=直流接口枪头(带枪线,模式4)5=无线充电座)", required = true) |
| | | @TableField("type") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "充电枪状态(1=离线,2=空闲,3=占用(未充电),4=占用(充电中),5=占用(已充满),6=占用(预约锁定),7=故障)") |
| | | @ApiModelProperty(value = "充电枪状态(1=离线,2=空闲,3=占用(未充电),4=占用(充电中),5=占用(已充满),6=占用(预约锁定),7=故障)", required = true) |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "充电模式(1=超级快充,2=快充,3=慢充)") |
| | | @ApiModelProperty(value = "充电模式(1=超级快充,2=快充,3=慢充)", required = true) |
| | | @TableField("charge_mode") |
| | | private Integer chargeMode; |
| | | |
| | |
| | | @TableField("accounting_strategy_id") |
| | | private Integer accountingStrategyId; |
| | | |
| | | @ApiModelProperty(value = "额定电压上限") |
| | | @ApiModelProperty(value = "额定电压上限", required = true) |
| | | @TableField("upper_rated_voltage") |
| | | private BigDecimal upperRatedVoltage; |
| | | |
| | | @ApiModelProperty(value = "额定电压下限") |
| | | @ApiModelProperty(value = "额定电压下限", required = true) |
| | | @TableField("lower_limit_of_rated_voltage") |
| | | private BigDecimal lowerLimitOfRatedVoltage; |
| | | |
| | | @ApiModelProperty(value = "额定电流") |
| | | @ApiModelProperty(value = "额定电流", required = true) |
| | | @TableField("rated_current") |
| | | private BigDecimal ratedCurrent; |
| | | |
| | | @ApiModelProperty(value = "额定功率") |
| | | @ApiModelProperty(value = "额定功率", required = true) |
| | | @TableField("rated_power") |
| | | private BigDecimal ratedPower; |
| | | |
| | |
| | | @TableField("parking_lock_state") |
| | | private Integer parkingLockState; |
| | | |
| | | @ApiModelProperty(value = "国家标准") |
| | | @ApiModelProperty(value = "国家标准", required = true) |
| | | @TableField("national_standard") |
| | | private String nationalStandard; |
| | | |
| | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "设备编号") |
| | | @ApiModelProperty(value = "设备编号", required = true) |
| | | @TableField("code") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "充电设备名称") |
| | | @ApiModelProperty(value = "充电设备名称", required = true) |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "桩号") |
| | | @ApiModelProperty(value = "桩号", required = true) |
| | | @TableField("number") |
| | | private Integer number; |
| | | |
| | | @ApiModelProperty(value = "设备类型(0=其他,1=直流设备,2=交流设备,3=交直流一体设备,4=无线设备)") |
| | | @ApiModelProperty(value = "设备类型(0=其他,1=直流设备,2=交流设备,3=交直流一体设备,4=无线设备)", required = true) |
| | | @TableField("type") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "站点id") |
| | | @ApiModelProperty(value = "站点id", required = true) |
| | | @TableField("site_id") |
| | | private Integer siteId; |
| | | |
| | | @ApiModelProperty(value = "站点名称") |
| | | @TableField(exist = false) |
| | | private Integer siteName; |
| | | |
| | | @ApiModelProperty(value = "合作商id") |
| | | @ApiModelProperty(value = "合作商id", required = true) |
| | | @TableField("partner_id") |
| | | private Integer partnerId; |
| | | |
| | | @ApiModelProperty(value = "合作商名称") |
| | | @TableField(exist = false) |
| | | private Integer partnerName; |
| | | |
| | | @ApiModelProperty(value = "生产商机构代码") |
| | | @TableField("manufacturer_code") |
| | |
| | | @TableField("production_date") |
| | | private LocalDate productionDate; |
| | | |
| | | @ApiModelProperty(value = "额定功率") |
| | | @ApiModelProperty(value = "额定功率", required = true) |
| | | @TableField("rated_power") |
| | | private BigDecimal ratedPower; |
| | | |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.query; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/8 16:36 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class BatchSetAccountingStrategy { |
| | | @ApiModelProperty(value = "充电桩id", required = true) |
| | | private List<Integer> id; |
| | | @ApiModelProperty(value = "计费策略id", required = true) |
| | | private Integer accountingStrategyId; |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.query; |
| | | |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/8 15:04 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class PageChargingPileList extends BasePage { |
| | | @ApiModelProperty(value = "站点id") |
| | | private Integer siteId; |
| | | @ApiModelProperty("充电设备名称") |
| | | private String name; |
| | | @ApiModelProperty("设备类型(0=其他,1=直流设备,2=交流设备,3=交直流一体设备,4=无线设备)") |
| | | private Integer type; |
| | | } |
| | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.api.feignClient.ChargingOrderClient; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | |
| | | return R.fail("订单计数:" + throwable.getMessage()); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public R<TChargingOrder> orderDetail(Long orderId) { |
| | | return R.fail("订单详情:" + throwable.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.factory; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.api.feignClient.ExchangeOrderClient; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import com.ruoyi.order.api.model.TExchangeOrder; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 充电订单服务降级处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Component |
| | | public class ExchangeOrderFallbackFactory implements FallbackFactory<ExchangeOrderClient> |
| | | { |
| | | private static final Logger log = LoggerFactory.getLogger(ExchangeOrderFallbackFactory.class); |
| | | |
| | | |
| | | @Override |
| | | public ExchangeOrderClient create(Throwable cause) { |
| | | log.error("商品订单调用失败:{}", cause.getMessage()); |
| | | return new ExchangeOrderClient() { |
| | | |
| | | |
| | | @Override |
| | | public R<TExchangeOrder> orderDetail(Long orderId) { |
| | | return null; |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.api.feignClient.ChargingOrderClient; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | |
| | | log.error("商品订单调用失败:{}", cause.getMessage()); |
| | | return new OrderClient() { |
| | | |
| | | |
| | | @Override |
| | | public R<List<Integer>> getSalesCountByGoodsId(String goodsIds) { |
| | | return R.fail("根据商品订单ids查询销量:" + cause.getMessage()); |
| | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.api.factory.ChargingOrderFallbackFactory; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | |
| | | @PostMapping(value = "/t-charging-order/useOrderCount") |
| | | R<Long> useOrderCount(@RequestParam Long userId); |
| | | |
| | | @PostMapping(value = "/t-charging-order/detail") |
| | | R<TChargingOrder> orderDetail(@RequestParam Long orderId); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.feignClient; |
| | | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.api.factory.ChargingOrderFallbackFactory; |
| | | import com.ruoyi.order.api.factory.ExchangeOrderFallbackFactory; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import com.ruoyi.order.api.model.TExchangeOrder; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | /** |
| | | * 充电订单服务 |
| | | * @author ruoyi |
| | | */ |
| | | @FeignClient(contextId = "ChargingOrderClient", value = ServiceNameConstants.CONTRACT_SERVICE, fallbackFactory = ExchangeOrderFallbackFactory.class) |
| | | public interface ExchangeOrderClient { |
| | | |
| | | |
| | | @PostMapping(value = "/t-exchange-order/detail") |
| | | R<TExchangeOrder> orderDetail(@RequestParam Long orderId); |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.api.dto.UnitListQueryDto; |
| | | import com.ruoyi.account.api.dto.UserDetailDto; |
| | | import com.ruoyi.account.api.dto.UserListQueryDto; |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | import com.ruoyi.account.api.model.TAppUserCar; |
| | | import com.ruoyi.account.api.model.TAppUserTag; |
| | | import com.ruoyi.account.api.model.TAppUserVipDetail; |
| | | import com.ruoyi.account.service.TAppUserCarService; |
| | | import com.ruoyi.account.service.TAppUserService; |
| | | import com.ruoyi.account.service.TAppUserTagService; |
| | | import com.ruoyi.account.service.TAppUserVipDetailService; |
| | | import com.ruoyi.account.api.dto.*; |
| | | import com.ruoyi.account.api.model.*; |
| | | import com.ruoyi.account.service.*; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.order.api.feignClient.ChargingOrderClient; |
| | | import com.ruoyi.order.api.feignClient.ExchangeOrderClient; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import com.ruoyi.order.api.model.TExchangeOrder; |
| | | import com.ruoyi.other.api.domain.TCompany; |
| | | import com.ruoyi.other.api.domain.TUserTag; |
| | | import com.ruoyi.other.api.feignClient.OtherClient; |
| | |
| | | @Resource |
| | | private TAppUserCarService appUserCarService; |
| | | |
| | | @Resource |
| | | private TAppUserIntegralChangeService integralChangeService; |
| | | |
| | | @Resource |
| | | private ExchangeOrderClient exchangeOrderClient; |
| | | @ApiOperation(value = "单位管理列表", tags = {"用户管理-单位管理"}) |
| | | @PostMapping(value = "/unit/page") |
| | | public R<Page<TCompany>> unitPage(@RequestBody UnitListQueryDto unitListQueryDto) { |
| | |
| | | .eq(userListQueryDto.getVipTypeId() != null, TAppUser::getVipId, userListQueryDto.getVipTypeId()) |
| | | .in(!userIds.isEmpty(),TAppUser::getId,userIds) |
| | | .page(Page.of(userListQueryDto.getPageCurr(), userListQueryDto.getPageSize())); |
| | | |
| | | if (page.getRecords().isEmpty()){ |
| | | return R.ok(page); |
| | | } |
| | |
| | | } |
| | | //匹配vipMap的值 |
| | | appUser.setVipName(vipMap.getData().get(appUser.getVipId())); |
| | | //累计充电次数 |
| | | R<Long> useOrderCount = chargingOrderClient.useOrderCount(appUser.getId()); |
| | | appUser.setOrderCount(useOrderCount.getData()); |
| | | |
| | | } |
| | | return R.ok(page); |
| | | } |
| | |
| | | userDetailDto.setTagName(tagMap.getData().values().toString()); |
| | | return R.ok(userDetailDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户详情积分明细", tags = {"用户管理-用户列表"}) |
| | | @PostMapping(value = "/user/points/page") |
| | | public R<Page<TAppUserIntegralChange>> pointsDetail(@RequestBody PointsQueryDto pointsQueryDto) { |
| | | List<Integer> types = new ArrayList<>(); |
| | | if (pointsQueryDto.getType()!=null){ |
| | | types.add(1); |
| | | types.add(2); |
| | | types.add(3); |
| | | types.add(4); |
| | | types.add(5); |
| | | } |
| | | Page<TAppUserIntegralChange> page = integralChangeService.lambdaQuery() |
| | | .eq(TAppUserIntegralChange::getAppUserId, pointsQueryDto.getUserId()) |
| | | .orderByDesc(TAppUserIntegralChange::getCreateTime) |
| | | .eq(pointsQueryDto.getChangeType() != null, TAppUserIntegralChange::getChangeType, pointsQueryDto.getChangeType()) |
| | | .in(!types.isEmpty(), TAppUserIntegralChange::getChangeType, types).page(Page.of(pointsQueryDto.getPageCurr(), pointsQueryDto.getPageSize())); |
| | | |
| | | for (TAppUserIntegralChange record : page.getRecords()) { |
| | | if (record.getChangeType()==2){ |
| | | R<TChargingOrder> tChargingOrderR = chargingOrderClient.orderDetail(Long.valueOf(record.getExtension())); |
| | | if (tChargingOrderR.getData()!=null) { |
| | | record.setOrderNum(tChargingOrderR.getData().getCode()); |
| | | } |
| | | } |
| | | if (record.getChangeType()==6){ |
| | | R<TExchangeOrder> tExchangeOrderR = exchangeOrderClient.orderDetail(Long.valueOf(record.getExtension())); |
| | | if (tExchangeOrderR.getData()!=null){ |
| | | record.setOrderNum(tExchangeOrderR.getData().getCode()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return R.ok(page); |
| | | |
| | | } |
| | | |
| | | @ApiOperation(value = "用户详情积分明细", tags = {"用户管理-用户列表"}) |
| | | @PostMapping(value = "/user/status/change") |
| | | public R pointsDetail(@RequestBody UserChangeDto userChangeDto) { |
| | | TAppUser appUser = appUserService.getById(userChangeDto.getUserId()); |
| | | appUser.setStatus(userChangeDto.getStatus()); |
| | | appUserService.updateById(appUser); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "赠送会员", tags = {"用户管理-用户列表"}) |
| | | @PostMapping(value = "/user/give/vip") |
| | | public R giveVip(@RequestBody GiveVipDto giveVipDto) { |
| | | TAppUser nowUser = appUserService.getById(giveVipDto.getUserId()); |
| | | |
| | | |
| | | //如果vipEndTime为空或已过期,直接增加 |
| | | if (nowUser.getVipEndTime()==null||nowUser.getVipEndTime().isBefore(LocalDateTime.now())) { |
| | | if (giveVipDto.getType() == 1) { |
| | | nowUser.setVipEndTime(LocalDateTime.now().plusDays(31)); |
| | | //直接增加vipDetail |
| | | } else if (giveVipDto.getType() == 2) { |
| | | nowUser.setVipEndTime(LocalDateTime.now().plusDays(93)); |
| | | } else if (giveVipDto.getType() == 3) { |
| | | nowUser.setVipEndTime(LocalDateTime.now().plusDays(365)); |
| | | } |
| | | //直接赠送优惠卷 |
| | | }else { |
| | | if (giveVipDto.getType() == 1) { |
| | | nowUser.setVipEndTime(nowUser.getVipEndTime().plusDays(31)); |
| | | //如果有这个类型的vip,累加,没有的话,从entTime新增 |
| | | } else if (giveVipDto.getType() == 2) { |
| | | nowUser.setVipEndTime(nowUser.getVipEndTime().plusDays(93)); |
| | | } else if (giveVipDto.getType() == 3) { |
| | | nowUser.setVipEndTime(nowUser.getVipEndTime().plusDays(365)); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | return R.ok(); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.api.dto.*; |
| | | import com.ruoyi.account.api.model.*; |
| | | import com.ruoyi.account.service.*; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import com.ruoyi.order.api.feignClient.ChargingOrderClient; |
| | | import com.ruoyi.order.api.feignClient.ExchangeOrderClient; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import com.ruoyi.order.api.model.TExchangeOrder; |
| | | import com.ruoyi.other.api.domain.TCompany; |
| | | import com.ruoyi.other.api.domain.TUserTag; |
| | | import com.ruoyi.other.api.feignClient.OtherClient; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.Duration; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-08-06 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/t_apply_charging_pile") |
| | | public class TApplyChargingPileController { |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/getPartner/{id}") |
| | | @ApiOperation(value = "获取合作商详情", tags = {"管理后台-合作商管理"}) |
| | | @ApiOperation(value = "获取合作商详情", tags = {"管理后台-合作商管理", "管理后台-充电桩信息"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "合作商id", name = "id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | |
| | | package com.ruoyi.chargingPile.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.chargingPile.api.dto.GetSiteListDTO; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.query.GetSiteList; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | |
| | | @ResponseBody |
| | | @DeleteMapping("/delSite/{id}") |
| | | @ApiOperation(value = "编辑站点", tags = {"管理后台-站点管理"}) |
| | | @ApiOperation(value = "删除站点", tags = {"管理后台-站点管理"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "站点id", name = "id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/setAccountingStrategy/{id}") |
| | | @ApiOperation(value = "设置站点计费策略", tags = {"管理后台-站点管理"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "站点id", name = "id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(value = "计费策略id", name = "accountingStrategyId", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | public AjaxResult setAccountingStrategy(@PathVariable("id") Integer id, @RequestParam("accountingStrategyId") Integer accountingStrategyId){ |
| | | siteService.setAccountingStrategy(id, accountingStrategyId); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/getAllSiteList") |
| | | @ApiOperation(value = "获取所有站点数据", tags = {"管理后台-充电桩信息"}) |
| | | public AjaxResult<List<Site>> getAllSiteList(){ |
| | | List<Site> list = siteService.list(new LambdaQueryWrapper<Site>().eq(Site::getDelFlag, 0) |
| | | .orderByDesc(Site::getCreateTime)); |
| | | return AjaxResult.success(list); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.chargingPile.api.dto.TAccountingStrategyDTO; |
| | | import com.ruoyi.chargingPile.api.model.TAccountingStrategy; |
| | | import com.ruoyi.chargingPile.api.model.TAccountingStrategyDetail; |
| | |
| | | import com.ruoyi.chargingPile.service.TAccountingStrategyService; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | private final TAccountingStrategyService accountingStrategyService; |
| | | private final TAccountingStrategyDetailService accountingStrategyDetailService; |
| | | |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | @Autowired |
| | | public TAccountingStrategyController(TAccountingStrategyService accountingStrategyService, TAccountingStrategyDetailService accountingStrategyDetailService) { |
| | |
| | | /** |
| | | * 查询计费策略明细列表 |
| | | */ |
| | | @ApiOperation(tags = {"后台-计费策略"},value = "查询计费策略明细列表") |
| | | @ApiOperation(tags = {"后台-计费策略", "管理后台-站点管理", "管理后台-充电桩信息"},value = "查询计费策略明细列表") |
| | | @GetMapping(value = "/queryAccountingStrategyDetailByStrategyId") |
| | | public AjaxResult<List<TAccountingStrategyDetailVO>> queryAccountingStrategyDetailByStrategyId(@RequestParam Integer strategyId) { |
| | | List<TAccountingStrategyDetailVO> list = accountingStrategyDetailService.queryAccountingStrategyDetailByStrategyId(strategyId); |
| | |
| | | /** |
| | | * 添加计费策略管理 |
| | | */ |
| | | @ApiOperation(tags = {"后台-计费策略"},value = "添加计费策略") |
| | | @ApiOperation(tags = {"后台-计费策略", "管理后台-站点管理"},value = "添加计费策略") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@RequestBody TAccountingStrategyDTO dto) { |
| | | public AjaxResult<Integer> add(@RequestBody TAccountingStrategyDTO dto) { |
| | | accountingStrategyService.save(dto); |
| | | // 添加明细 |
| | | dto.getAccountingStrategyDetails().forEach(detail -> detail.setAccountingStrategyId(dto.getId())); |
| | | accountingStrategyDetailService.saveBatch(dto.getAccountingStrategyDetails()); |
| | | // TODO 硬件 同步策略到充电桩 |
| | | return AjaxResult.ok(accountingStrategyDetailService.saveBatch(dto.getAccountingStrategyDetails())); |
| | | return AjaxResult.ok(dto.getId()); |
| | | } |
| | | |
| | | /** |
| | | * 修改计费策略 |
| | | */ |
| | | @ApiOperation(tags = {"后台-计费策略"},value = "修改计费策略") |
| | | @ApiOperation(tags = {"后台-计费策略", "管理后台-站点管理"},value = "修改计费策略") |
| | | @PostMapping(value = "/update") |
| | | public AjaxResult<Boolean> update(@RequestBody TAccountingStrategyDTO dto) { |
| | | // 删除计费策略明细信息 |
| | |
| | | /** |
| | | * 查看计费策略详情 |
| | | */ |
| | | @ApiOperation(tags = {"后台-计费策略"},value = "查看计费策略详情") |
| | | @ApiOperation(tags = {"后台-计费策略", "管理后台-站点管理"},value = "查看计费策略详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public AjaxResult<TAccountingStrategy> getDetailById(@RequestParam Integer id) { |
| | | return AjaxResult.ok(accountingStrategyService.getById(id)); |
| | |
| | | return AjaxResult.ok(accountingStrategyService.removeByIds(ids)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(tags = {"管理后台-站点管理"},value = "获取平台添加的计费策略") |
| | | @DeleteMapping(value = "/getPlatformAccountingStrategy") |
| | | public AjaxResult<List<TAccountingStrategyVO>> getPlatformAccountingStrategy(){ |
| | | List<TAccountingStrategyVO> list = accountingStrategyService.getPlatformAccountingStrategy(); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(tags = {"后台-申请表单-计费模板审核"},value = "查询计费审核分页列表") |
| | | @PostMapping(value = "/auth/pageList") |
| | | public AjaxResult authPageList(@RequestBody TAccountingStrategyQuery query) { |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | Page<TAccountingStrategy> page = accountingStrategyService.lambdaQuery() |
| | | .in(TAccountingStrategy::getFirstUserId, userid) |
| | | .or().in(TAccountingStrategy::getTwoUserId, userid) |
| | | .page(Page.of(query.getPageCurr(), query.getPageSize())); |
| | | |
| | | List<TAccountingStrategy> records = page.getRecords(); |
| | | for (TAccountingStrategy record : records) { |
| | | if (record.getAuditStatus()==2){ |
| | | if (record.getFirstUserId().equals(userid)){ |
| | | record.setAuditStatus(3); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | return AjaxResult.ok(accountingStrategyService.pageList(query)); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | package com.ruoyi.chargingPile.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.chargingPile.api.dto.ApplyChargingQuery; |
| | | import com.ruoyi.chargingPile.api.dto.ApplyChargingRemarkDto; |
| | | import com.ruoyi.chargingPile.api.model.TApplyChargingPile; |
| | | import com.ruoyi.chargingPile.api.model.TCarport; |
| | | import com.ruoyi.chargingPile.api.vo.TCarportVO; |
| | |
| | | /** |
| | | * 建桩申请 |
| | | */ |
| | | @ApiOperation(tags = {"小程序-建桩申请"},value = "建桩申请") |
| | | @ApiOperation(tags = {"小程序-建桩申请","后台-申请表单-申请建桩-添加"},value = "建桩申请") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@RequestBody TApplyChargingPile dto) { |
| | | // TODO 用户id |
| | |
| | | return AjaxResult.ok(applyChargingPileService.save(dto)); |
| | | } |
| | | |
| | | @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "列表") |
| | | @PostMapping(value = "/page") |
| | | public AjaxResult<Page<TApplyChargingPile>> page(ApplyChargingQuery applyChargingQuery) { |
| | | // TODO 用户id |
| | | Page<TApplyChargingPile> page = applyChargingPileService.lambdaQuery() |
| | | .like(applyChargingQuery.getName() != null && !applyChargingQuery.getName().equals(""), TApplyChargingPile::getAgentPhone, applyChargingQuery.getName()) |
| | | .page(Page.of(applyChargingQuery.getPageCurr(), applyChargingQuery.getPageSize())); |
| | | return AjaxResult.ok(page); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "详情") |
| | | @PostMapping(value = "/detail/{id}") |
| | | public AjaxResult<TApplyChargingPile> detail(@PathVariable Integer id) { |
| | | |
| | | return AjaxResult.ok(applyChargingPileService.getById(id)); |
| | | } |
| | | |
| | | @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "修改备注") |
| | | @PostMapping(value = "/remark") |
| | | public AjaxResult<TApplyChargingPile> remark(@RequestBody ApplyChargingRemarkDto applyChargingRemarkDt) { |
| | | TApplyChargingPile byId = applyChargingPileService.getById(applyChargingRemarkDt.getId()); |
| | | byId.setRemark(applyChargingRemarkDt.getRemark()); |
| | | applyChargingPileService.updateById(byId); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 查询充电枪列表 |
| | | */ |
| | | @ApiOperation(tags = {"后台-充电枪"},value = "查询充电枪分页列表") |
| | | @ApiOperation(tags = {"后台-充电枪", "管理后台-充电桩信息"},value = "查询充电枪分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public AjaxResult<PageInfo<TChargingGunVO>> pageList(@RequestBody TChargingGunQuery query) { |
| | | return AjaxResult.ok(chargingGunService.pageList(query)); |
| | |
| | | /** |
| | | * 添加充电枪管理 |
| | | */ |
| | | @ApiOperation(tags = {"后台-充电枪"},value = "添加充电枪") |
| | | @ApiOperation(tags = {"管理后台-充电桩信息"},value = "添加充电枪") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@RequestBody TChargingGunDTO dto) { |
| | | return AjaxResult.ok(chargingGunService.save(dto)); |
| | | public AjaxResult add(@RequestBody TChargingGunDTO dto) { |
| | | return chargingGunService.add(dto); |
| | | } |
| | | |
| | | /** |
| | | * 修改充电枪 |
| | | */ |
| | | @ApiOperation(tags = {"后台-充电枪"},value = "修改充电枪") |
| | | @ApiOperation(tags = {"管理后台-充电桩信息"},value = "修改充电枪") |
| | | @PostMapping(value = "/update") |
| | | public AjaxResult<Boolean> update(@RequestBody TChargingGunDTO dto) { |
| | | return AjaxResult.ok(chargingGunService.updateById(dto)); |
| | | public AjaxResult update(@RequestBody TChargingGunDTO dto) { |
| | | return chargingGunService.update(dto); |
| | | } |
| | | |
| | | /** |
| | | * 查看充电枪详情 |
| | | */ |
| | | @ApiOperation(tags = {"后台-充电枪"},value = "查看充电枪详情") |
| | | @ApiOperation(tags = {"后台-充电枪", "管理后台-充电桩信息"},value = "查看充电枪详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public AjaxResult<TChargingGun> getDetailById(@RequestParam Integer id) { |
| | | return AjaxResult.ok(chargingGunService.getById(id)); |
| | |
| | | /** |
| | | * 删除充电枪 |
| | | */ |
| | | @ApiOperation(tags = {"后台-充电枪"},value = "删除充电枪") |
| | | @ApiOperation(tags = {"管理后台-充电桩信息"},value = "删除充电枪") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public AjaxResult<Boolean> deleteById(@RequestParam Integer id) { |
| | | return AjaxResult.ok(chargingGunService.removeById(id)); |
| | | TChargingGun chargingGun = chargingGunService.getById(id); |
| | | chargingGun.setDelFlag(true); |
| | | chargingGunService.updateById(chargingGun); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(tags = {"管理后台-充电桩信息"},value = "下载二维码") |
| | | @GetMapping(value = "/downloadQRCode/{id}") |
| | | public void downloadQRCode(@PathVariable Integer id, HttpServletResponse response){ |
| | | // todo 待完善 |
| | | } |
| | | } |
| | | |
| | |
| | | import com.ruoyi.chargingPile.service.TChargingPileService; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.chargingPile.api.dto.PageChargingPileListDTO; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.chargingPile.api.query.BatchSetAccountingStrategy; |
| | | import com.ruoyi.chargingPile.service.TChargingPileService; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.chargingPile.api.query.PageChargingPileList; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | return AjaxResult.ok(chargingPileService.list(Wrappers.lambdaQuery(TChargingPile.class) |
| | | .eq(TChargingPile::getSiteId,siteId))); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/pageChargingPileList") |
| | | @ApiOperation(value = "获取充电桩列表数据", tags = {"管理后台-充电桩信息"}) |
| | | public AjaxResult<PageInfo<PageChargingPileListDTO>> pageChargingPileList(@RequestBody PageChargingPileList page){ |
| | | PageInfo<PageChargingPileListDTO> list = chargingPileService.pageChargingPileList(page); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/addChargingPile") |
| | | @ApiOperation(value = "添加充电桩数据", tags = {"管理后台-充电桩信息"}) |
| | | public AjaxResult addChargingPile(@RequestBody TChargingPile chargingPile){ |
| | | return chargingPileService.addChargingPile(chargingPile); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/getChargingPile/{id}") |
| | | @ApiOperation(value = "获取充电桩详情数据", tags = {"管理后台-充电桩信息"}) |
| | | public AjaxResult<TChargingPile> getChargingPile(@PathVariable Integer id){ |
| | | TChargingPile chargingPile = chargingPileService.getChargingPile(id); |
| | | return AjaxResult.success(chargingPile); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/editChargingPile") |
| | | @ApiOperation(value = "编辑充电桩数据", tags = {"管理后台-充电桩信息"}) |
| | | public AjaxResult editChargingPile(@RequestBody TChargingPile chargingPile){ |
| | | return chargingPileService.editChargingPile(chargingPile); |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @DeleteMapping("/delChargingPile/{id}") |
| | | @ApiOperation(value = "删除充电桩", tags = {"管理后台-充电桩信息"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "充电桩id", name = "id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | public AjaxResult delChargingPile(@PathVariable Integer id){ |
| | | return chargingPileService.delChargingPile(id); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/batchSetAccountingStrategy") |
| | | @ApiOperation(value = "批量设置计费策略", tags = {"管理后台-充电桩信息"}) |
| | | public AjaxResult batchSetAccountingStrategy(@RequestBody BatchSetAccountingStrategy setAccountingStrategy){ |
| | | chargingPileService.batchSetAccountingStrategy(setAccountingStrategy); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<TAccountingStrategyVO> pageList(@Param("query") TAccountingStrategyQuery query, @Param("pageInfo")PageInfo<TAccountingStrategyVO> pageInfo); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取平台添加的计费策略 |
| | | * @return |
| | | */ |
| | | List<TAccountingStrategyVO> getPlatformAccountingStrategy(); |
| | | } |
| | |
| | | package com.ruoyi.chargingPile.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.chargingPile.api.dto.PageChargingPileListDTO; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.chargingPile.api.query.PageChargingPileList; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Mapper |
| | | public interface TChargingPileMapper extends BaseMapper<TChargingPile> { |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取充电桩列表数据 |
| | | * @param page |
| | | * @return |
| | | */ |
| | | List<PageChargingPileListDTO> pageChargingPileList(PageInfo<PageChargingPileListDTO> pageInfo, @Param("item") PageChargingPileList page); |
| | | |
| | | |
| | | /** |
| | | * 获取充电桩详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | TChargingPile getChargingPile(Integer id); |
| | | } |
| | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | * @return |
| | | */ |
| | | AjaxResult delSite(Integer id); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取站点分页列表 |
| | | * @param query |
| | | * @return |
| | | * 设置站点计费策略 |
| | | * @param id 站点id |
| | | * @param accountingStrategyId 计费策略id |
| | | */ |
| | | void setAccountingStrategy(Integer id, Integer accountingStrategyId); |
| | | |
| | | |
| | | PageInfo<SiteVO> pageList(SiteQuery query); |
| | | } |
| | |
| | | import com.ruoyi.chargingPile.api.vo.TAccountingStrategyVO; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 计费策略 服务类 |
| | |
| | | * @return |
| | | */ |
| | | PageInfo<TAccountingStrategyVO> pageList(TAccountingStrategyQuery query); |
| | | |
| | | |
| | | /** |
| | | * 获取平台添加的计费策略 |
| | | * @return |
| | | */ |
| | | List<TAccountingStrategyVO> getPlatformAccountingStrategy(); |
| | | } |
| | |
| | | package com.ruoyi.chargingPile.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.chargingPile.api.dto.TChargingGunDTO; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.chargingPile.api.query.TChargingGunQuery; |
| | | import com.ruoyi.chargingPile.api.vo.TChargingGunVO; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @return |
| | | */ |
| | | PageInfo<TChargingGunVO> pageList(TChargingGunQuery query); |
| | | |
| | | |
| | | /** |
| | | * 添加充电枪 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | AjaxResult add(TChargingGunDTO dto); |
| | | |
| | | |
| | | /** |
| | | * 编辑充电枪 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | AjaxResult update(TChargingGunDTO dto); |
| | | } |
| | |
| | | package com.ruoyi.chargingPile.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.chargingPile.api.dto.PageChargingPileListDTO; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.chargingPile.api.query.BatchSetAccountingStrategy; |
| | | import com.ruoyi.chargingPile.api.query.PageChargingPileList; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2024-08-06 |
| | | */ |
| | | public interface TChargingPileService extends IService<TChargingPile> { |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取充电桩列表 |
| | | * @param page |
| | | * @return |
| | | */ |
| | | PageInfo<PageChargingPileListDTO> pageChargingPileList(PageChargingPileList page); |
| | | |
| | | |
| | | /** |
| | | * 添加充电桩 |
| | | * @param chargingPile |
| | | * @return |
| | | */ |
| | | AjaxResult addChargingPile(TChargingPile chargingPile); |
| | | |
| | | |
| | | /** |
| | | * 获取充电桩详情 |
| | | * @param id 充电桩id |
| | | * @return |
| | | */ |
| | | TChargingPile getChargingPile(Integer id); |
| | | |
| | | |
| | | /** |
| | | * 编辑充电桩 |
| | | * @param chargingPile |
| | | * @return |
| | | */ |
| | | AjaxResult editChargingPile(TChargingPile chargingPile); |
| | | |
| | | |
| | | /** |
| | | * 删除充电桩 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | AjaxResult delChargingPile(Integer id); |
| | | |
| | | |
| | | /** |
| | | * 批量设置计费策略 |
| | | * @param setAccountingStrategy |
| | | */ |
| | | void batchSetAccountingStrategy(BatchSetAccountingStrategy setAccountingStrategy); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.chargingPile.api.dto.PartnerListDTO; |
| | | import com.ruoyi.chargingPile.api.model.Partner; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.query.GetPartnerList; |
| | | import com.ruoyi.chargingPile.dto.ResetPassword; |
| | | import com.ruoyi.chargingPile.mapper.PartnerMapper; |
| | | import com.ruoyi.chargingPile.service.IPartnerService; |
| | | import com.ruoyi.chargingPile.service.ISiteService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | |
| | | |
| | | @Resource |
| | | private SysUserClient sysUserClient; |
| | | |
| | | @Resource |
| | | private ISiteService siteService; |
| | | |
| | | |
| | | |
| | |
| | | user.setStatus("0"); |
| | | user.setDelFlag("0"); |
| | | user.setRoleId(partner.getRoleId().longValue()); |
| | | user.setRoleType(2); |
| | | user.setObjectId(partner.getId()); |
| | | R r = sysUserClient.addSysUser(user); |
| | | if(200 != r.getCode()){ |
| | | throw new RuntimeException(r.getMsg()); |
| | |
| | | user.setAvatar(partner.getLogoUrl()); |
| | | user.setPassword(partner.getPassword()); |
| | | user.setRoleId(partner.getRoleId().longValue()); |
| | | user.setRoleType(2); |
| | | user.setObjectId(partner.getId()); |
| | | R r = sysUserClient.addSysUser(user); |
| | | if(200 != r.getCode()){ |
| | | throw new RuntimeException(r.getMsg()); |
| | |
| | | public AjaxResult delPartner(Integer id) { |
| | | //查询有无关联数据 |
| | | //站点 |
| | | long count = siteService.count(new LambdaQueryWrapper<Site>().eq(Site::getPartnerId, id).eq(Site::getDelFlag, 0)); |
| | | if(count > 0){ |
| | | return AjaxResult.error("当前合作商有关联得站点,删除失败!"); |
| | | } |
| | | // todo 代码完善 |
| | | //充电桩 |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.chargingPile.api.dto.GetSiteListDTO; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.chargingPile.api.query.GetSiteList; |
| | | import com.ruoyi.chargingPile.api.query.SiteQuery; |
| | | import com.ruoyi.chargingPile.api.vo.SiteVO; |
| | | import com.ruoyi.chargingPile.api.vo.TAccountingStrategyVO; |
| | | import com.ruoyi.chargingPile.mapper.SiteMapper; |
| | | import com.ruoyi.chargingPile.service.ISiteService; |
| | | import com.ruoyi.chargingPile.service.TChargingGunService; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Service |
| | | public class SiteServiceImpl extends ServiceImpl<SiteMapper, Site> implements ISiteService { |
| | | |
| | | @Resource |
| | | private TChargingGunService chargingGunService; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 设置站点计费策略 |
| | | * @param id 站点id |
| | | * @param accountingStrategyId 计费策略id |
| | | */ |
| | | @Override |
| | | @Transactional(propagation = Propagation.REQUIRES_NEW) |
| | | public void setAccountingStrategy(Integer id, Integer accountingStrategyId) { |
| | | Site site = this.getById(id); |
| | | site.setAccountingStrategyId(accountingStrategyId); |
| | | this.updateById(site); |
| | | List<TChargingGun> list = chargingGunService.list(new LambdaQueryWrapper<TChargingGun>().in(TChargingGun::getChargingPileId, id).eq(TChargingGun::getDelFlag, 0)); |
| | | for (TChargingGun tChargingGun : list) { |
| | | tChargingGun.setChargingPileId(accountingStrategyId); |
| | | } |
| | | chargingGunService.updateBatchById(list); |
| | | } |
| | | } |
| | |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取平台添加的计费策略 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<TAccountingStrategyVO> getPlatformAccountingStrategy() { |
| | | return this.baseMapper.getPlatformAccountingStrategy(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.chargingPile.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.chargingPile.api.dto.TChargingGunDTO; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.chargingPile.api.query.TChargingGunQuery; |
| | | import com.ruoyi.chargingPile.api.vo.TChargingGunVO; |
| | | import com.ruoyi.chargingPile.api.vo.TMonitoringEquipmentVO; |
| | | import com.ruoyi.chargingPile.mapper.TChargingGunMapper; |
| | | import com.ruoyi.chargingPile.service.TChargingGunService; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | /** |
| | | * 添加充电枪 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AjaxResult add(TChargingGunDTO dto) { |
| | | AjaxResult ajaxResult = addVerify(dto); |
| | | if(ajaxResult.isError()){ |
| | | return ajaxResult; |
| | | } |
| | | long count = this.count(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getCode, dto.getCode()).eq(TChargingGun::getDelFlag, 0)); |
| | | if(count > 0){ |
| | | return AjaxResult.error("接口编码已存在"); |
| | | } |
| | | this.save(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 编辑充电枪 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AjaxResult update(TChargingGunDTO dto) { |
| | | AjaxResult ajaxResult = addVerify(dto); |
| | | if(ajaxResult.isError()){ |
| | | return ajaxResult; |
| | | } |
| | | TChargingGun one = this.getOne(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getCode, dto.getCode()).eq(TChargingGun::getDelFlag, 0)); |
| | | if(null != one && !dto.getId().equals(one.getId())){ |
| | | return AjaxResult.error("接口编码已存在"); |
| | | } |
| | | this.updateById(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 校验必填项 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | AjaxResult addVerify(TChargingGunDTO dto){ |
| | | if(StringUtils.isEmpty(dto.getCode())){ |
| | | return AjaxResult.error("接口编码不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(dto.getName())){ |
| | | return AjaxResult.error("接口名称不能为空"); |
| | | } |
| | | if(null == dto.getType()){ |
| | | return AjaxResult.error("接口类型不能为空"); |
| | | } |
| | | if(null == dto.getStatus()){ |
| | | return AjaxResult.error("接口状态不能为空"); |
| | | } |
| | | if(null == dto.getChargeMode()){ |
| | | return AjaxResult.error("充电方式不能为空"); |
| | | } |
| | | if(null == dto.getUpperRatedVoltage()){ |
| | | return AjaxResult.error("额定电压上限不能为空"); |
| | | } |
| | | if(null == dto.getLowerLimitOfRatedVoltage()){ |
| | | return AjaxResult.error("额定电压下限不能为空"); |
| | | } |
| | | if(null == dto.getRatedCurrent()){ |
| | | return AjaxResult.error("额定电流不能为空"); |
| | | } |
| | | if(null == dto.getRatedPower()){ |
| | | return AjaxResult.error("额定功率不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(dto.getNationalStandard())){ |
| | | return AjaxResult.error("国家标准不能为空"); |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.chargingPile.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.chargingPile.api.dto.PageChargingPileListDTO; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.chargingPile.api.query.BatchSetAccountingStrategy; |
| | | import com.ruoyi.chargingPile.api.query.PageChargingPileList; |
| | | import com.ruoyi.chargingPile.mapper.TChargingPileMapper; |
| | | import com.ruoyi.chargingPile.service.TChargingGunService; |
| | | import com.ruoyi.chargingPile.service.TChargingPileService; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Service |
| | | public class TChargingPileServiceImpl extends ServiceImpl<TChargingPileMapper, TChargingPile> implements TChargingPileService { |
| | | |
| | | |
| | | @Resource |
| | | private TChargingGunService chargingGunService; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取充电桩列表数据 |
| | | * @param page |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageInfo<PageChargingPileListDTO> pageChargingPileList(PageChargingPileList page) { |
| | | PageInfo<PageChargingPileListDTO> pageInfo = new PageInfo<>(page.getPageCurr(), page.getPageSize()); |
| | | List<PageChargingPileListDTO> list = this.baseMapper.pageChargingPileList(pageInfo, page); |
| | | return pageInfo.setRecords(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加充电桩 |
| | | * @param chargingPile |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AjaxResult addChargingPile(TChargingPile chargingPile) { |
| | | AjaxResult ajaxResult = addChargingPileVerify(chargingPile); |
| | | if(ajaxResult.isError()){ |
| | | return ajaxResult; |
| | | } |
| | | long count = this.count(new LambdaQueryWrapper<TChargingPile>().eq(TChargingPile::getCode, chargingPile.getCode()) |
| | | .eq(TChargingPile::getDelFlag, 0)); |
| | | if(count > 0){ |
| | | return AjaxResult.error("设备编号已存在"); |
| | | } |
| | | this.save(chargingPile); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 校验必填项 |
| | | * @param chargingPile |
| | | * @return |
| | | */ |
| | | AjaxResult addChargingPileVerify(TChargingPile chargingPile){ |
| | | if(StringUtils.isEmpty(chargingPile.getCode())){ |
| | | return AjaxResult.error("设备编号不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(chargingPile.getName())){ |
| | | return AjaxResult.error("充电设备名称不能为空"); |
| | | } |
| | | if(null == chargingPile.getNumber()){ |
| | | return AjaxResult.error("桩号不能为空"); |
| | | } |
| | | if(null == chargingPile.getType()){ |
| | | return AjaxResult.error("设备类型不能为空"); |
| | | } |
| | | if(null == chargingPile.getSiteId()){ |
| | | return AjaxResult.error("归属电站不能为空"); |
| | | } |
| | | if(null == chargingPile.getPartnerId()){ |
| | | return AjaxResult.error("归属合作商不能为空"); |
| | | } |
| | | if(null == chargingPile.getRatedPower()){ |
| | | return AjaxResult.error("额定功率不能为空"); |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取充电桩详情 |
| | | * @param id 充电桩id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public TChargingPile getChargingPile(Integer id) { |
| | | return this.baseMapper.getChargingPile(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 编辑充电桩 |
| | | * @param chargingPile |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AjaxResult editChargingPile(TChargingPile chargingPile) { |
| | | AjaxResult ajaxResult = addChargingPileVerify(chargingPile); |
| | | if(ajaxResult.isError()){ |
| | | return ajaxResult; |
| | | } |
| | | TChargingPile one = this.getOne(new LambdaQueryWrapper<TChargingPile>().eq(TChargingPile::getCode, chargingPile.getCode()) |
| | | .eq(TChargingPile::getDelFlag, 0)); |
| | | if(null != one && !one.getId().equals(chargingPile.getId())){ |
| | | return AjaxResult.error("设备编号已存在"); |
| | | } |
| | | this.updateById(chargingPile); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除充电桩 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AjaxResult delChargingPile(Integer id) { |
| | | //检查是否有关联数据 |
| | | //接口 |
| | | long count = chargingGunService.count(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getChargingPileId, id).eq(TChargingGun::getDelFlag, 0)); |
| | | if(count > 0){ |
| | | return AjaxResult.error("该充电桩有关联的接口数据,删除失败!"); |
| | | } |
| | | TChargingPile chargingPile = this.getById(id); |
| | | chargingPile.setDelFlag(true); |
| | | this.updateById(chargingPile); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 批量设置计费策略 |
| | | * @param setAccountingStrategy |
| | | */ |
| | | @Override |
| | | public void batchSetAccountingStrategy(BatchSetAccountingStrategy setAccountingStrategy) { |
| | | List<Integer> id = setAccountingStrategy.getId(); |
| | | List<TChargingGun> list = chargingGunService.list(new LambdaQueryWrapper<TChargingGun>().in(TChargingGun::getChargingPileId, id).eq(TChargingGun::getDelFlag, 0)); |
| | | for (TChargingGun tChargingGun : list) { |
| | | tChargingGun.setChargingPileId(setAccountingStrategy.getAccountingStrategyId()); |
| | | } |
| | | chargingGunService.updateBatchById(list); |
| | | } |
| | | } |
| | |
| | | a.parking_space as parkingSpace, |
| | | DATE_FORMAT('%Y-%m-%d %H:%i:%s', a.establishment_time) as establishmentTime, |
| | | c.num as chargingPileNumber, |
| | | a.sort |
| | | a.sort, |
| | | a.accounting_strategy_id as accountingStrategyId, |
| | | if(a.accounting_strategy_id is null, 1, if(d.site_id is null, 1, 2)) as accountingStrategyType |
| | | from t_site a |
| | | left join t_partner b on (a.partner_id = b.id) |
| | | left join (select site_id, count(1) as num from t_charging_pile where del_flag = 0 group by site_id) c on (a.id = c.site_id) |
| | | left join t_accounting_strategy d on (a.accounting_strategy_id = d.id) |
| | | WHERE a.del_flag = 0 |
| | | <if test="null != item.name and '' != item.name"> |
| | | and a.name like CONCAT('%', #{item.name}, '%') |
| | |
| | | <result column="`name`" property="name" /> |
| | | <result column="description" property="description" /> |
| | | <result column="discount" property="discount" /> |
| | | <result column="first_user_id" property="firstUserId" /> |
| | | <result column="two_user_id" property="twoUserId" /> |
| | | <result column="first_remark" property="firstRemark" /> |
| | | <result column="two_remark" property="twoRemark" /> |
| | | <result column="audit_status" property="auditStatus" /> |
| | | <result column="first_audit_time" property="firstAuditTime" /> |
| | | <result column="two_audit_time" property="twoAuditTime" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, site_id, `name`, description, discount, create_time, del_flag |
| | | id, site_id, `name`, description, discount,first_user_id,two_user_id,first_remark,two_remark,audit_status,first_audit_time,two_audit_time, create_time, del_flag |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.chargingPile.api.vo.TAccountingStrategyVO"> |
| | | SELECT |
| | | id, site_id, `name`, description, discount, create_time, del_flag |
| | | id, site_id, `name`, description, discount,first_user_id,two_user_id,first_remark,two_remark,audit_status,first_audit_time,two_audit_time, create_time, del_flag |
| | | FROM t_accounting_strategy |
| | | <where> |
| | | <if test="query.name != null and query.name != ''"> |
| | |
| | | ORDER BY create_time DESC |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="getPlatformAccountingStrategy" resultType="com.ruoyi.chargingPile.api.vo.TAccountingStrategyVO"> |
| | | SELECT |
| | | id, site_id, `name`, description, discount,first_user_id,two_user_id,first_remark,two_remark,audit_status,first_audit_time,two_audit_time, create_time, del_flag |
| | | FROM t_accounting_strategy where del_flag = 0 and site_id is not null order by create_time desc |
| | | </select> |
| | | </mapper> |
| | |
| | | id, code, `name`, `number`, `type`, site_id, partner_id, manufacturer_code, manufacturer, equipment_type, production_date, rated_power, charging_station_number, status, create_time, del_flag |
| | | </sql> |
| | | |
| | | |
| | | |
| | | <select id="pageChargingPileList" resultType="com.ruoyi.chargingPile.api.dto.PageChargingPileListDTO"> |
| | | select |
| | | id, |
| | | code, |
| | | name, |
| | | number, |
| | | type, |
| | | a.site_id as siteId, |
| | | b.name as siteName, |
| | | a.partner_id as partnerId, |
| | | c.name as partnerName, |
| | | a.manufacturer, |
| | | a.equipment_type as equipmentType, |
| | | a.ratedPower |
| | | from t_charging_pile a |
| | | left join t_site b on (a.site_id = b.id) |
| | | left join t_partner c on (a.partner_id = c.id) |
| | | where del_flag = 0 |
| | | <if test="null != item.siteId"> |
| | | and a.site_id = #{item.siteId} |
| | | </if> |
| | | <if test="null != item.name and '' != item.name"> |
| | | and a.name like CONCAT('%', #{item.name}, '%') |
| | | </if> |
| | | <if test="null != item.type"> |
| | | and a.type = #{item.type} |
| | | </if> |
| | | order by a.create_time desc limit #{item.pageCurr}, #{item.pageSize} |
| | | </select> |
| | | |
| | | |
| | | <select id="getChargingPile" resultMap="BaseResultMap"> |
| | | select |
| | | a.*, |
| | | b.name as siteName, |
| | | c.name as partnerName |
| | | from t_charging_pile a |
| | | left join t_site b on (a.site_id = b.id) |
| | | left join t_partner c on (a.partner_id = c.id) |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | @Resource |
| | | private TChargingOrderService chargingOrderService; |
| | | |
| | | //用户订单数量 |
| | | @PostMapping(value = "/useOrderCount") |
| | | public R<Long> useOrderCount(@RequestParam Long userId) { |
| | | Long count = chargingOrderService.lambdaQuery().eq(TChargingOrder::getAppUserId, userId).count(); |
| | | |
| | | return R.ok(count); |
| | | } |
| | | //订单详情 |
| | | @PostMapping(value = "/detail") |
| | | public R<TChargingOrder> detail(@RequestParam Long orderId) { |
| | | return R.ok(chargingOrderService.getById(orderId)); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import com.ruoyi.order.api.model.TExchangeOrder; |
| | | import com.ruoyi.order.api.model.TShoppingOrder; |
| | | import com.ruoyi.order.service.TExchangeOrderService; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | private TShoppingOrderService tShoppingOrderService; |
| | | @Autowired |
| | | private TExchangeOrderService exchangeOrderService; |
| | | |
| | | //订单详情 |
| | | @PostMapping(value = "/detail") |
| | | public R<TExchangeOrder> detail(@RequestParam Long orderId) { |
| | | return R.ok(exchangeOrderService.getById(orderId)); |
| | | } |
| | | |
| | | /** |
| | | * 管理后台 根据商品ids 查询对应的销量 |
| | | * @param goodsIds 订单号-商品类型 |
| | |
| | | /** |
| | | * 添加计费策略管理 |
| | | */ |
| | | @ApiOperation(tags = {"小程序-计费策略"},value = "添加集团用户申请") |
| | | @ApiOperation(tags = {"小程序-计费策略","后台-申请表单-集团用户"},value = "添加集团用户申请") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@RequestBody TEnterpriseUserApplication dto) { |
| | | // TODO 用户id |
| | | return AjaxResult.ok(enterpriseUserApplicationService.save(dto)); |
| | | } |
| | | |
| | | @ApiOperation(tags = {"后台-申请表单-集团用户"},value = "集团用户列表") |
| | | @PostMapping(value = "/page") |
| | | public AjaxResult<Boolean> page(@RequestBody TEnterpriseUserApplication dto) { |
| | | // TODO 用户id |
| | | return AjaxResult.ok(enterpriseUserApplicationService.save(dto)); |
| | | } |
| | | |
| | | } |
| | | |