Merge remote-tracking branch 'origin/master'
New file |
| | |
| | | package com.ruoyi.chargingPile.api.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/8 9:29 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class GetSiteListDTO { |
| | | @ApiModelProperty(value = "站点id") |
| | | private Integer id; |
| | | @ApiModelProperty(value = "站点编号") |
| | | private String code; |
| | | @ApiModelProperty(value = "站点名称") |
| | | private String name; |
| | | @ApiModelProperty(value = "合作商名称") |
| | | private String partnerName; |
| | | @ApiModelProperty(value = "站点类型(0=其他,1=公共,2=个人,3=公交(专业),4=环卫(专用),5=物流(专用),6=出租车(专用))") |
| | | private Integer siteType; |
| | | @ApiModelProperty(value = "经营类型(1=直营,2=非直营)") |
| | | private Integer businessCategory; |
| | | @ApiModelProperty(value = "站点状态(1=正常使用,2=维修中,3=关闭下线)") |
| | | private Integer status; |
| | | @ApiModelProperty(value = "详细地址") |
| | | private String address; |
| | | @ApiModelProperty(value = "站点电话") |
| | | private String phone; |
| | | @ApiModelProperty(value = "服务电话") |
| | | private String servicePhone; |
| | | @ApiModelProperty(value = "车位数") |
| | | private Integer parkingSpace; |
| | | @ApiModelProperty(value = "建站时间") |
| | | private String establishmentTime; |
| | | @ApiModelProperty(value = "充电桩数量") |
| | | private Integer chargingPileNumber; |
| | | @ApiModelProperty(value = "排序") |
| | | private Integer sort; |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/7 14:03 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class PartnerListDTO { |
| | | @ApiModelProperty(value = "数据id") |
| | | private Integer id; |
| | | @ApiModelProperty(value = "合作商名称") |
| | | private String name; |
| | | private Integer roleId; |
| | | @ApiModelProperty(value = "角色名") |
| | | private String roleName; |
| | | @ApiModelProperty(value = "合作商电话1") |
| | | private String phoneOne; |
| | | @ApiModelProperty(value = "注册地址") |
| | | private String address; |
| | | @ApiModelProperty(value = "登录账号") |
| | | private String account; |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/7 13:37 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | @TableName("t_partner") |
| | | public class Partner extends BasePojo { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 合作商ID |
| | | */ |
| | | @TableField("code") |
| | | @ApiModelProperty(value = "合作商ID", required = true) |
| | | private String code; |
| | | /** |
| | | * 合作商名称 |
| | | */ |
| | | @TableField("name") |
| | | @ApiModelProperty(value = "合作商名称", required = true) |
| | | private String name; |
| | | /** |
| | | * 角色id |
| | | */ |
| | | @TableField("role_id") |
| | | @ApiModelProperty(value = "角色id", required = true) |
| | | private Integer roleId; |
| | | /** |
| | | * 角色名称 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "角色名称") |
| | | private String roleName; |
| | | /** |
| | | * logo地址 |
| | | */ |
| | | @TableField("logo_url") |
| | | @ApiModelProperty(value = "logo地址") |
| | | private String logoUrl; |
| | | /** |
| | | * 费率 |
| | | */ |
| | | @TableField("rate") |
| | | @ApiModelProperty(value = "费率") |
| | | private BigDecimal rate; |
| | | /** |
| | | * 注册地址 |
| | | */ |
| | | @TableField("address") |
| | | @ApiModelProperty(value = "address") |
| | | private String address; |
| | | /** |
| | | * 合作商电话1 |
| | | */ |
| | | @TableField("phone_one") |
| | | @ApiModelProperty(value = "合作商电话1", required = true) |
| | | private String phoneOne; |
| | | /** |
| | | * 合作商电话2 |
| | | */ |
| | | @TableField("phone_two") |
| | | @ApiModelProperty(value = "合作商电话2") |
| | | private String phoneTwo; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @TableField("remark") |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | /** |
| | | * 登录账号 |
| | | */ |
| | | @TableField("account") |
| | | @ApiModelProperty(value = "登录账号", required = true) |
| | | private String account; |
| | | /** |
| | | * 登录密码 |
| | | */ |
| | | @TableField("password") |
| | | @ApiModelProperty(value = "登录密码", required = true) |
| | | private String password; |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | 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.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/7 19:31 |
| | | */ |
| | | @Data |
| | | @TableName("t_site") |
| | | public class Site extends BasePojo { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @ApiModelProperty(value = "站点id") |
| | | private Integer id; |
| | | /** |
| | | * 合作商id |
| | | */ |
| | | @TableField("partner_id") |
| | | @ApiModelProperty(value = "合作商id", required = true) |
| | | private Integer partnerId; |
| | | /** |
| | | * 站点编号 |
| | | */ |
| | | @TableField("code") |
| | | @ApiModelProperty(value = "站点编号", required = true) |
| | | private String code; |
| | | /** |
| | | * 站点名称 |
| | | */ |
| | | @TableField("name") |
| | | @ApiModelProperty(value = "站点名称", required = true) |
| | | private String name; |
| | | /** |
| | | * 站点类型(0=其他,1=公共,2=个人,3=公交(专业),4=环卫(专用),5=物流(专用),6=出租车(专用)) |
| | | */ |
| | | @TableField("site_type") |
| | | @ApiModelProperty(value = "站点类型(0=其他,1=公共,2=个人,3=公交(专业),4=环卫(专用),5=物流(专用),6=出租车(专用))", required = true) |
| | | private Integer siteType; |
| | | /** |
| | | * 经营类型(1=直营,2=非直营) |
| | | */ |
| | | @TableField("business_category") |
| | | @ApiModelProperty(value = "经营类型(1=直营,2=非直营)", required = true) |
| | | private Integer businessCategory; |
| | | /** |
| | | * 站点状态(1=正常使用,2=维修中,3=关闭下线) |
| | | */ |
| | | @TableField("status") |
| | | @ApiModelProperty(value = "站点状态(1=正常使用,2=维修中,3=关闭下线)", required = true) |
| | | private Integer status; |
| | | /** |
| | | * 建设场所(0=其他,1=居民区,2=公共机构,3=企事业单位,4=写字楼,5=工业园区,6=交通枢纽,7=大型文体设施,8=城市绿地,9=大型建筑配建停车场,10=路边停车位,11=城际高速服务区) |
| | | */ |
| | | @TableField("construction_site") |
| | | @ApiModelProperty(value = "建设场所(0=其他,1=居民区,2=公共机构,3=企事业单位,4=写字楼,5=工业园区,6=交通枢纽,7=大型文体设施,8=城市绿地,9=大型建筑配建停车场,10=路边停车位,11=城际高速服务区)", required = true) |
| | | private Integer constructionSite; |
| | | /** |
| | | * 站点环境图 |
| | | */ |
| | | @TableField("img_url") |
| | | @ApiModelProperty(value = "站点环境图", required = true) |
| | | private String imgUrl; |
| | | /** |
| | | * 省名称 |
| | | */ |
| | | @TableField("province") |
| | | @ApiModelProperty(value = "省名称", required = true) |
| | | private String province; |
| | | /** |
| | | * 省区划代码 |
| | | */ |
| | | @TableField("province_code") |
| | | @ApiModelProperty(value = "省区划代码", required = true) |
| | | private String provinceCode; |
| | | /** |
| | | * 市名称 |
| | | */ |
| | | @TableField("city") |
| | | @ApiModelProperty(value = "市名称", required = true) |
| | | private String city; |
| | | /** |
| | | * 市区划代码 |
| | | */ |
| | | @TableField("city_code") |
| | | @ApiModelProperty(value = "市区划代码", required = true) |
| | | private String cityCode; |
| | | /** |
| | | * 区县名称 |
| | | */ |
| | | @TableField("districts") |
| | | @ApiModelProperty(value = "区县名称", required = true) |
| | | private String districts; |
| | | /** |
| | | * 区县区划代码 |
| | | */ |
| | | @TableField("districts_code") |
| | | @ApiModelProperty(value = "区县区划代码", required = true) |
| | | private String districtsCode; |
| | | /** |
| | | * 经度 |
| | | */ |
| | | @TableField("lon") |
| | | @ApiModelProperty(value = "经度", required = true) |
| | | private String lon; |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | @TableField("lat") |
| | | @ApiModelProperty(value = "纬度", required = true) |
| | | private String lat; |
| | | /** |
| | | * 详细地址 |
| | | */ |
| | | @TableField("address") |
| | | @ApiModelProperty(value = "详细地址", required = true) |
| | | private String address; |
| | | /** |
| | | * 国家代码 |
| | | */ |
| | | @TableField("country_code") |
| | | @ApiModelProperty(value = "国家代码") |
| | | private String countryCode; |
| | | /** |
| | | * 站点电话 |
| | | */ |
| | | @TableField("phone") |
| | | @ApiModelProperty(value = "站点电话", required = true) |
| | | private String phone; |
| | | /** |
| | | * 服务电话 |
| | | */ |
| | | @TableField("service_phone") |
| | | @ApiModelProperty(value = "服务电话", required = true) |
| | | private String servicePhone; |
| | | /** |
| | | * 站点引导 |
| | | */ |
| | | @TableField("guide") |
| | | @ApiModelProperty(value = "站点引导") |
| | | private String guide; |
| | | /** |
| | | * 开始服务时间 |
| | | */ |
| | | @TableField("start_service_time") |
| | | @ApiModelProperty(value = "开始服务时间") |
| | | private String startServiceTime; |
| | | /** |
| | | * 结束服务时间 |
| | | */ |
| | | @TableField("end_service_time") |
| | | @ApiModelProperty(value = "结束服务时间") |
| | | private String endServiceTime; |
| | | /** |
| | | * 站内提供服务 |
| | | */ |
| | | @TableField("service_description") |
| | | @ApiModelProperty(value = "站内提供服务") |
| | | private String serviceDescription; |
| | | /** |
| | | * 车型描述 |
| | | */ |
| | | @TableField("vehicle_description") |
| | | @ApiModelProperty(value = "车型描述") |
| | | private String vehicleDescription; |
| | | /** |
| | | * 车位数 |
| | | */ |
| | | @TableField("parking_space") |
| | | @ApiModelProperty(value = "车位数", required = true) |
| | | private Integer parkingSpace; |
| | | /** |
| | | * 充电费率描述 |
| | | */ |
| | | @TableField("rate_description") |
| | | @ApiModelProperty(value = "充电费率描述") |
| | | private String rateDescription; |
| | | /** |
| | | * 超时占位费说明 |
| | | */ |
| | | @TableField("space_charge_explain") |
| | | @ApiModelProperty(value = "超时占位费说明") |
| | | private String spaceChargeExplain; |
| | | /** |
| | | * 计费策略id |
| | | */ |
| | | @TableField("accounting_strategy_id") |
| | | @ApiModelProperty(value = "计费策略id") |
| | | private Integer accountingStrategyId; |
| | | /** |
| | | * 建站时间 |
| | | */ |
| | | @TableField("establishment_time") |
| | | @ApiModelProperty(value = "建站时间", notes = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDate establishmentTime; |
| | | /** |
| | | * 排序 |
| | | */ |
| | | @TableField("sort") |
| | | @ApiModelProperty(value = "排序", required = true) |
| | | private Integer sort; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @TableField("remark") |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | /** |
| | | * 评分 |
| | | */ |
| | | @TableField("mark") |
| | | private Integer mark; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_charging_pile_notification") |
| | | @ApiModel(value="TChargingPileNotification对象", description="") |
| | | public class TChargingPileNotification implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId("id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "站点id") |
| | | @TableField("site_id") |
| | | private Integer siteId; |
| | | |
| | | @ApiModelProperty(value = "充电桩id") |
| | | @TableField("charging_pile_id") |
| | | private Integer chargingPileId; |
| | | |
| | | @ApiModelProperty(value = "通知内容") |
| | | @TableField("content") |
| | | private String content; |
| | | |
| | | @ApiModelProperty(value = "发送时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "删除状态(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_fault_message") |
| | | @ApiModel(value="TFaultMessage对象", description="") |
| | | public class TFaultMessage extends BasePojo { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("app_user_id") |
| | | private Long appUserId; |
| | | |
| | | @ApiModelProperty(value = "站点id") |
| | | @TableField("site_id") |
| | | private Integer siteId; |
| | | |
| | | @ApiModelProperty(value = "充电桩id") |
| | | @TableField("charging_pile_id") |
| | | private Integer chargingPileId; |
| | | |
| | | @ApiModelProperty(value = "状态(1=离线,2=故障)") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "故障时间") |
| | | @TableField("down_time") |
| | | private LocalDateTime downTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_parking_record") |
| | | @ApiModel(value="TParkingRecord对象", description="") |
| | | public class TParkingRecord implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "订单id") |
| | | @TableId("id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("app_user_id") |
| | | private Long appUserId; |
| | | |
| | | @ApiModelProperty(value = "车牌号") |
| | | @TableField("license_plate") |
| | | private String licensePlate; |
| | | |
| | | @ApiModelProperty(value = "车辆颜色") |
| | | @TableField("vehicle_color") |
| | | private String vehicleColor; |
| | | |
| | | @ApiModelProperty(value = "充电订单id") |
| | | @TableField("charging_order_id") |
| | | private Long chargingOrderId; |
| | | |
| | | @ApiModelProperty(value = "停车场id") |
| | | @TableField("parking_lot_id") |
| | | private Integer parkingLotId; |
| | | |
| | | @ApiModelProperty(value = "入场时间") |
| | | @TableField("in_parking_time") |
| | | private LocalDateTime inParkingTime; |
| | | |
| | | @ApiModelProperty(value = "出场时间") |
| | | @TableField("out_parking_time") |
| | | private LocalDateTime outParkingTime; |
| | | |
| | | @ApiModelProperty(value = "停车时长(分钟)") |
| | | @TableField("parking_duration") |
| | | private Integer parkingDuration; |
| | | |
| | | @ApiModelProperty(value = "总费用") |
| | | @TableField("order_amount") |
| | | private BigDecimal orderAmount; |
| | | |
| | | @ApiModelProperty(value = "状态(1=已进场,2=已出场,3=已缴费出场)") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "出场方式(1=缴费出场,2=免费时长内放行)") |
| | | @TableField("out_parking_type") |
| | | private Integer outParkingType; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_partner_site") |
| | | @ApiModel(value="TPartnerSite对象", description="") |
| | | public class TPartnerSite implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "站点id") |
| | | @TableField("site_id") |
| | | private Integer siteId; |
| | | |
| | | @ApiModelProperty(value = "合作商id") |
| | | @TableField("partner_id") |
| | | private Integer partnerId; |
| | | |
| | | @ApiModelProperty(value = "菜单id") |
| | | @TableField("site_menu_id") |
| | | private Integer siteMenuId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_repair") |
| | | @ApiModel(value="TRepair对象", description="") |
| | | public class TRepair extends BasePojo { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "报修人") |
| | | @TableField("repairman") |
| | | private String repairman; |
| | | |
| | | @ApiModelProperty(value = "站点id") |
| | | @TableField("site_id") |
| | | private Integer siteId; |
| | | |
| | | @ApiModelProperty(value = "充电桩id") |
| | | @TableField("charging_pile_id") |
| | | private Integer chargingPileId; |
| | | |
| | | @ApiModelProperty(value = "报修内容") |
| | | @TableField("content") |
| | | private String content; |
| | | |
| | | @ApiModelProperty(value = "报修时间") |
| | | @TableField("repair_time") |
| | | private LocalDateTime repairTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_site") |
| | | @ApiModel(value="TSite对象", description="") |
| | | public class TSite extends BasePojo { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "合作商id") |
| | | @TableField("partner_id") |
| | | private Integer partnerId; |
| | | |
| | | @ApiModelProperty(value = "站点编号") |
| | | @TableField("code") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "站点名称") |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "站点类型(0=其他,1=公共,2=个人,3=公交(专业),4=环卫(专用),5=物流(专用),6=出租车(专用))") |
| | | @TableField("site_type") |
| | | private Integer siteType; |
| | | |
| | | @ApiModelProperty(value = "经营类型(1=直营,2=非直营)") |
| | | @TableField("business_category") |
| | | private Integer businessCategory; |
| | | |
| | | @ApiModelProperty(value = "站点状态(1=正常使用,2=维修中,3=关闭下线)") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "建设场所(0=其他,1=居民区,2=公共机构,3=企事业单位,4=写字楼,5=工业园区,6=交通枢纽,7=大型文体设施,8=城市绿地,9=大型建筑配建停车场,10=路边停车位,11=城际高速服务区)") |
| | | @TableField("construction_site") |
| | | private Integer constructionSite; |
| | | |
| | | @ApiModelProperty(value = "站点环境图") |
| | | @TableField("img_url") |
| | | private String imgUrl; |
| | | |
| | | @ApiModelProperty(value = "省名称") |
| | | @TableField("province") |
| | | private String province; |
| | | |
| | | @ApiModelProperty(value = "省区划代码") |
| | | @TableField("province_code") |
| | | private String provinceCode; |
| | | |
| | | @ApiModelProperty(value = "市名称") |
| | | @TableField("city") |
| | | private String city; |
| | | |
| | | @ApiModelProperty(value = "市区划代码") |
| | | @TableField("city_code") |
| | | private String cityCode; |
| | | |
| | | @ApiModelProperty(value = "区县名称") |
| | | @TableField("districts") |
| | | private String districts; |
| | | |
| | | @ApiModelProperty(value = "区县区划代码") |
| | | @TableField("districts_code") |
| | | private String districtsCode; |
| | | |
| | | @ApiModelProperty(value = "经度") |
| | | @TableField("lon") |
| | | private String lon; |
| | | |
| | | @ApiModelProperty(value = "纬度") |
| | | @TableField("lat") |
| | | private String lat; |
| | | |
| | | @ApiModelProperty(value = "详细地址") |
| | | @TableField("address") |
| | | private String address; |
| | | |
| | | @ApiModelProperty(value = "国家代码") |
| | | @TableField("country_code") |
| | | private String countryCode; |
| | | |
| | | @ApiModelProperty(value = "站点电话") |
| | | @TableField("phone") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "服务电话") |
| | | @TableField("service_phone") |
| | | private String servicePhone; |
| | | |
| | | @ApiModelProperty(value = "站点引导") |
| | | @TableField("guide") |
| | | private String guide; |
| | | |
| | | @ApiModelProperty(value = "开始服务时间") |
| | | @TableField("start_service_time") |
| | | private String startServiceTime; |
| | | |
| | | @ApiModelProperty(value = "结束服务时间") |
| | | @TableField("end_service_time") |
| | | private String endServiceTime; |
| | | |
| | | @ApiModelProperty(value = "站内提供服务") |
| | | @TableField("service_description") |
| | | private String serviceDescription; |
| | | |
| | | @ApiModelProperty(value = "车型描述") |
| | | @TableField("vehicle_description") |
| | | private String vehicleDescription; |
| | | |
| | | @ApiModelProperty(value = "车位数") |
| | | @TableField("parking_space") |
| | | private Integer parkingSpace; |
| | | |
| | | @ApiModelProperty(value = "充电费率描述") |
| | | @TableField("rate_description") |
| | | private String rateDescription; |
| | | |
| | | @ApiModelProperty(value = "超时占位费说明") |
| | | @TableField("space_charge_explain") |
| | | private String spaceChargeExplain; |
| | | |
| | | @ApiModelProperty(value = "计费策略id") |
| | | @TableField("accounting_strategy_id") |
| | | private Integer accountingStrategyId; |
| | | |
| | | @ApiModelProperty(value = "建站时间") |
| | | @TableField("establishment_time") |
| | | private LocalDateTime establishmentTime; |
| | | |
| | | @ApiModelProperty(value = "排序") |
| | | @TableField("sort") |
| | | private Integer sort; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "评分") |
| | | @TableField("mark") |
| | | private Integer mark; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_site_menu") |
| | | @ApiModel(value="TSiteMenu对象", description="") |
| | | public class TSiteMenu implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "菜单ID") |
| | | @TableId(value = "menu_id", type = IdType.AUTO) |
| | | private Integer menuId; |
| | | |
| | | @ApiModelProperty(value = "菜单名称") |
| | | @TableField("menu_name") |
| | | private String menuName; |
| | | |
| | | @ApiModelProperty(value = "父菜单ID") |
| | | @TableField("parent_id") |
| | | private Long parentId; |
| | | |
| | | @ApiModelProperty(value = "显示顺序") |
| | | @TableField("order_num") |
| | | private Integer orderNum; |
| | | |
| | | @ApiModelProperty(value = "路由地址") |
| | | @TableField("path") |
| | | private String path; |
| | | |
| | | @ApiModelProperty(value = "组件路径") |
| | | @TableField("component") |
| | | private String component; |
| | | |
| | | @ApiModelProperty(value = "路由参数") |
| | | @TableField("query") |
| | | private String query; |
| | | |
| | | @ApiModelProperty(value = "是否为外链(0是 1否)") |
| | | @TableField("is_frame") |
| | | private Integer isFrame; |
| | | |
| | | @ApiModelProperty(value = "是否缓存(0缓存 1不缓存)") |
| | | @TableField("is_cache") |
| | | private Integer isCache; |
| | | |
| | | @ApiModelProperty(value = "菜单类型(M目录 C菜单 F按钮)") |
| | | @TableField("menu_type") |
| | | private String menuType; |
| | | |
| | | @ApiModelProperty(value = "菜单状态(0显示 1隐藏)") |
| | | @TableField("visible") |
| | | private String visible; |
| | | |
| | | @ApiModelProperty(value = "菜单状态(0正常 1停用)") |
| | | @TableField("status") |
| | | private Boolean status; |
| | | |
| | | @ApiModelProperty(value = "权限标识") |
| | | @TableField("perms") |
| | | private String perms; |
| | | |
| | | @ApiModelProperty(value = "菜单图标") |
| | | @TableField("icon") |
| | | private String icon; |
| | | |
| | | @ApiModelProperty(value = "创建者") |
| | | @TableField("create_by") |
| | | private String createBy; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "更新者") |
| | | @TableField("update_by") |
| | | private String updateBy; |
| | | |
| | | @ApiModelProperty(value = "更新时间") |
| | | @TableField("update_time") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.query; |
| | | |
| | | 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/7 13:54 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class GetPartnerList extends BasePage { |
| | | @ApiModelProperty(value = "合作商名称") |
| | | private String name; |
| | | @ApiModelProperty(value = "角色id") |
| | | private Integer roleId; |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.query; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.Value; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/8 9:24 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class GetSiteList extends BasePage { |
| | | @ApiModelProperty(value = "站点名称") |
| | | private String name; |
| | | @ApiModelProperty(value = "合作商名称") |
| | | private String partnerName; |
| | | @ApiModelProperty(value = "站点类型(0=其他,1=公共,2=个人,3=公交(专业),4=环卫(专用),5=物流(专用),6=出租车(专用))") |
| | | private Integer siteType; |
| | | @ApiModelProperty(value = "经营类型(1=直营,2=非直营)") |
| | | private Integer businessCategory; |
| | | @ApiModelProperty(value = "站点状态(1=正常使用,2=维修中,3=关闭下线)") |
| | | private Integer status; |
| | | @ApiModelProperty(value = "站点省代码") |
| | | private String provinceCode; |
| | | @ApiModelProperty(value = "站点市代码") |
| | | private String cityCode; |
| | | @ApiModelProperty(value = "站点区代码") |
| | | private String districtsCode; |
| | | } |
New file |
| | |
| | | package com.ruoyi.other.api.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/8 11:55 |
| | | */ |
| | | @Data |
| | | @TableName("t_region") |
| | | public class Region { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 城市名称 |
| | | */ |
| | | @TableField("name") |
| | | private String name; |
| | | /** |
| | | * 行政区划代码 |
| | | */ |
| | | @TableField("code") |
| | | private String code; |
| | | /** |
| | | * 城市code |
| | | */ |
| | | @TableField("citycode") |
| | | private String citycode; |
| | | /** |
| | | * 父级ID |
| | | */ |
| | | @TableField("parent_id") |
| | | private Integer parentId; |
| | | /** |
| | | * 英文名称 |
| | | */ |
| | | @TableField("english") |
| | | private String english; |
| | | } |
| | |
| | | |
| | | /** 用户头像 */ |
| | | private String avatar; |
| | | /** |
| | | * 登录账号 |
| | | */ |
| | | @TableField("account") |
| | | private String account; |
| | | |
| | | /** 密码 */ |
| | | @NotBlank(message = "密码不能为空") |
| | |
| | | { |
| | | this.avatar = avatar; |
| | | } |
| | | |
| | | |
| | | public String getAccount() { |
| | | return account; |
| | | } |
| | | |
| | | public void setAccount(String account) { |
| | | this.account = account; |
| | | } |
| | | |
| | | public String getPassword() |
| | | { |
| | | return password; |
New file |
| | |
| | | package com.ruoyi.system.api.factory; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.api.domain.SysRole; |
| | | import com.ruoyi.system.api.feignClient.SysRoleClient; |
| | | import com.ruoyi.system.api.model.GetSysRoleByIds; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Pu Zhibing |
| | | */ |
| | | @Component |
| | | public class SysRoleFallbackFactory implements FallbackFactory<SysRoleClient> { |
| | | |
| | | @Override |
| | | public SysRoleClient create(Throwable cause) { |
| | | return new SysRoleClient(){ |
| | | @Override |
| | | public R<List<SysRole>> getSysRoleByIds(GetSysRoleByIds ids) { |
| | | return R.fail("获取角色失败:" + cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | public R<SysUser> queryUserByUserName(String userName) { |
| | | return R.fail("通过账号查询用户失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R addSysUser(SysUser user) { |
| | | return R.fail("添加用户失败:" + cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.feignClient; |
| | | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.api.domain.SysRole; |
| | | import com.ruoyi.system.api.factory.SysRoleFallbackFactory; |
| | | import com.ruoyi.system.api.model.GetSysRoleByIds; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/7 15:14 |
| | | */ |
| | | @FeignClient(contextId = "SysRoleClient", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = SysRoleFallbackFactory.class) |
| | | public interface SysRoleClient { |
| | | |
| | | @GetMapping("/role/getSysRoleByIds") |
| | | public R<List<SysRole>> getSysRoleByIds(GetSysRoleByIds ids); |
| | | |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/user/queryUserByPhone") |
| | | R<SysUser> queryUserByPhone(@RequestBody String phone); |
| | | |
| | | |
| | | /** |
| | | * 根据账号获取用户数据 |
| | | * @param account |
| | | * @return |
| | | */ |
| | | @PostMapping("/user/queryUserByAccount") |
| | | R<SysUser> queryUserByAccount(@RequestBody String account); |
| | | |
| | | /** |
| | | * 通过账号查询用户 |
| | |
| | | */ |
| | | @PostMapping("/user/queryUserByUserName") |
| | | R<SysUser> queryUserByUserName(@RequestBody String userName); |
| | | |
| | | |
| | | /** |
| | | * 新增加用户信息 |
| | | * @param user |
| | | */ |
| | | @PostMapping("/user/addSysUser") |
| | | R addSysUser(SysUser user); |
| | | |
| | | |
| | | /** |
| | | * 重置密码 |
| | | * @param user |
| | | * @return |
| | | */ |
| | | @PostMapping("/user/resetPassword") |
| | | R resetPassword(SysUser user); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/7 15:06 |
| | | */ |
| | | @Data |
| | | public class GetSysRoleByIds { |
| | | /** |
| | | * ids |
| | | */ |
| | | private List<Integer> ids; |
| | | } |
| | |
| | | com.ruoyi.system.api.factory.RemoteLogFallbackFactory |
| | | com.ruoyi.system.api.factory.RemoteFileFallbackFactory |
| | | com.ruoyi.system.api.factory.SysUserFallbackFactory |
| | | com.ruoyi.system.api.factory.SysRoleFallbackFactory |
| | |
| | | * 令牌秘钥 |
| | | */ |
| | | public final static String SECRET = "abcdefghijklmnopqrstuvwxyz"; |
| | | |
| | | /** |
| | | * 参数签名 |
| | | */ |
| | | public static final String SING = "sing"; |
| | | |
| | | /** |
| | | * 参数随机字符串 |
| | | */ |
| | | public static final String NONCE_STR = "nonce_str"; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.enums.status; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author xiaochen |
| | | * @Date 2023/6/8 16:42 |
| | | */ |
| | | public enum AdvertisingStatusEnum { |
| | | |
| | | |
| | | NO(0, "否"), |
| | | YES(1, "是"); |
| | | |
| | | @Getter |
| | | private String desc; |
| | | |
| | | |
| | | @Getter |
| | | private int code; |
| | | |
| | | |
| | | AdvertisingStatusEnum(int code, String desc) { |
| | | this.code = code; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | /** |
| | | * 通过code获取枚举 |
| | | * |
| | | * @param code |
| | | * @return |
| | | */ |
| | | public static AdvertisingStatusEnum fromCode(Integer code) { |
| | | AdvertisingStatusEnum[] resultTypes = AdvertisingStatusEnum.values(); |
| | | for (AdvertisingStatusEnum resultType : resultTypes) { |
| | | if (code.equals(resultType.getCode())) { |
| | | return resultType; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | { |
| | | super.put(CODE_TAG, code); |
| | | super.put(MSG_TAG, msg); |
| | | if (StringUtils.isNotNull(data)) |
| | | { |
| | | if (StringUtils.isNotNull(data)) { |
| | | super.put(DATA_TAG, data); |
| | | } |
| | | } |
| | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.cloud.gateway.filter.GatewayFilterChain; |
| | | import org.springframework.cloud.gateway.filter.GlobalFilter; |
| | | import org.springframework.core.Ordered; |
| | |
| | | * @author ruoyi |
| | | */ |
| | | @Component |
| | | public class AuthFilter implements GlobalFilter, Ordered |
| | | { |
| | | public class AuthFilter implements GlobalFilter, Ordered { |
| | | private static final Logger log = LoggerFactory.getLogger(AuthFilter.class); |
| | | |
| | | // 排除过滤的 uri 地址,nacos自行添加 |
| | |
| | | |
| | | @Autowired |
| | | private RedisService redisService; |
| | | |
| | | @Value("${security.sign}") |
| | | private boolean parameter_signature; |
| | | |
| | | |
| | | @Override |
| | | public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) |
| | | { |
| | | public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) { |
| | | ServerHttpRequest request = exchange.getRequest(); |
| | | ServerHttpRequest.Builder mutate = request.mutate(); |
| | | |
| | | String url = request.getURI().getPath(); |
| | | // 跳过不需要验证的路径 |
| | | if (StringUtils.matches(url, ignoreWhite.getWhites())) |
| | | { |
| | | if (StringUtils.matches(url, ignoreWhite.getWhites())) { |
| | | return chain.filter(exchange); |
| | | } |
| | | String token = getToken(request); |
| | | if (StringUtils.isEmpty(token)) |
| | | { |
| | | if (StringUtils.isEmpty(token)) { |
| | | return unauthorizedResponse(exchange, "令牌不能为空"); |
| | | } |
| | | Claims claims = JwtUtils.parseToken(token); |
| | | if (claims == null) |
| | | { |
| | | if (claims == null) { |
| | | return unauthorizedResponse(exchange, "令牌已过期或验证不正确!"); |
| | | } |
| | | String userkey = JwtUtils.getUserKey(claims); |
| | | boolean islogin = redisService.hasKey(getTokenKey(userkey)); |
| | | if (!islogin) |
| | | { |
| | | if (!islogin) { |
| | | return unauthorizedResponse(exchange, "登录状态已过期"); |
| | | } |
| | | String userid = JwtUtils.getUserId(claims); |
| | | String username = JwtUtils.getUserName(claims); |
| | | if (StringUtils.isEmpty(userid) || StringUtils.isEmpty(username)) |
| | | { |
| | | if (StringUtils.isEmpty(userid) || StringUtils.isEmpty(username)) { |
| | | return unauthorizedResponse(exchange, "令牌验证失败"); |
| | | } |
| | | |
| | | if(parameter_signature){ |
| | | String sign = request.getHeaders().getFirst(TokenConstants.SING); |
| | | String nonce_str = request.getHeaders().getFirst(TokenConstants.NONCE_STR); |
| | | if(StringUtils.isEmpty(sign) || StringUtils.isEmpty(nonce_str)){ |
| | | log.error("[鉴权签名异常处理]请求路径:{}", exchange.getRequest().getPath()); |
| | | return ServletUtils.webFluxResponseWriter(exchange.getResponse(), "签名校验失败", HttpStatus.BAD_REQUEST); |
| | | } |
| | | } |
| | | |
| | | // 设置用户信息到请求 |
| | | addHeader(mutate, SecurityConstants.USER_KEY, userkey); |
| | | addHeader(mutate, SecurityConstants.DETAILS_USER_ID, userid); |
| | |
| | | return chain.filter(exchange.mutate().request(mutate.build()).build()); |
| | | } |
| | | |
| | | private void addHeader(ServerHttpRequest.Builder mutate, String name, Object value) |
| | | { |
| | | if (value == null) |
| | | { |
| | | private void addHeader(ServerHttpRequest.Builder mutate, String name, Object value) { |
| | | if (value == null) { |
| | | return; |
| | | } |
| | | String valueStr = value.toString(); |
| | |
| | | mutate.header(name, valueEncode); |
| | | } |
| | | |
| | | private void removeHeader(ServerHttpRequest.Builder mutate, String name) |
| | | { |
| | | private void removeHeader(ServerHttpRequest.Builder mutate, String name) { |
| | | mutate.headers(httpHeaders -> httpHeaders.remove(name)).build(); |
| | | } |
| | | |
| | | private Mono<Void> unauthorizedResponse(ServerWebExchange exchange, String msg) |
| | | { |
| | | private Mono<Void> unauthorizedResponse(ServerWebExchange exchange, String msg) { |
| | | log.error("[鉴权异常处理]请求路径:{}", exchange.getRequest().getPath()); |
| | | return ServletUtils.webFluxResponseWriter(exchange.getResponse(), msg, HttpStatus.UNAUTHORIZED); |
| | | } |
| | |
| | | /** |
| | | * 获取请求token |
| | | */ |
| | | private String getToken(ServerHttpRequest request) |
| | | { |
| | | private String getToken(ServerHttpRequest request) { |
| | | String token = request.getHeaders().getFirst(TokenConstants.AUTHENTICATION); |
| | | // 如果前端设置了令牌前缀,则裁剪掉前缀 |
| | | if (StringUtils.isNotEmpty(token) && token.startsWith(TokenConstants.PREFIX)) |
New file |
| | |
| | | package com.ruoyi.gateway.filter; |
| | | |
| | | |
| | | import javax.crypto.Mac; |
| | | import javax.crypto.SecretKey; |
| | | import javax.crypto.spec.SecretKeySpec; |
| | | |
| | | public class HMACSHA1 { |
| | | |
| | | private static final String MAC_NAME = "HmacSHA1"; |
| | | private static final String ENCODING = "UTF-8"; |
| | | |
| | | /** |
| | | * 使用 HMAC-SHA1 签名方法对对encryptText进行签名 |
| | | * |
| | | * @param encryptText |
| | | * 被签名的字符串 |
| | | * @param encryptKey |
| | | * 密钥 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static byte[] HmacSHA1Encrypt(String encryptText, String encryptKey) throws Exception { |
| | | byte[] data = encryptKey.getBytes(ENCODING); |
| | | // 根据给定的字节数组构造一个密钥,第二参数指定一个密钥算法的名称 |
| | | Mac mac = Mac.getInstance(MAC_NAME); |
| | | SecretKey secretKey = new SecretKeySpec(data, MAC_NAME); |
| | | // 生成一个指定 Mac 算法 的 Mac 对象 |
| | | // 用给定密钥初始化 Mac 对象 |
| | | mac.init(secretKey); |
| | | |
| | | byte[] text = encryptText.getBytes(ENCODING); |
| | | // 完成 Mac 操作 |
| | | return mac.doFinal(text); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.gateway.filter; |
| | | |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.*; |
| | | import java.util.concurrent.atomic.AtomicReference; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.ruoyi.common.core.constant.HttpStatus; |
| | | import com.ruoyi.common.core.constant.TokenConstants; |
| | | import com.ruoyi.common.core.utils.ServletUtils; |
| | | import org.apache.commons.codec.binary.Base64; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.cloud.gateway.filter.GatewayFilterChain; |
| | | import org.springframework.cloud.gateway.filter.GlobalFilter; |
| | |
| | | @ConditionalOnProperty(value = "security.xss.enabled", havingValue = "true") |
| | | public class XssFilter implements GlobalFilter, Ordered |
| | | { |
| | | private static final Logger log = LoggerFactory.getLogger(XssFilter.class); |
| | | // 跨站脚本的 xss 配置,nacos自行添加 |
| | | @Autowired |
| | | private XssProperties xss; |
| | | |
| | | @Value("${security.sign}") |
| | | private boolean parameter_signature; |
| | | |
| | | @Override |
| | | public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) |
| | |
| | | return chain.filter(exchange); |
| | | } |
| | | ServerHttpRequestDecorator httpRequestDecorator = requestDecorator(exchange); |
| | | if(parameter_signature && !authSign(httpRequestDecorator)){ |
| | | log.error("[鉴权签名异常处理]请求路径:{}", exchange.getRequest().getPath()); |
| | | return ServletUtils.webFluxResponseWriter(exchange.getResponse(), "签名校验失败", HttpStatus.BAD_REQUEST); |
| | | } |
| | | return chain.filter(exchange.mutate().request(httpRequestDecorator).build()); |
| | | |
| | | } |
| | |
| | | String header = exchange.getRequest().getHeaders().getFirst(HttpHeaders.CONTENT_TYPE); |
| | | return StringUtils.startsWithIgnoreCase(header, MediaType.APPLICATION_JSON_VALUE); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 签名校验 |
| | | * @param httpRequestDecorator |
| | | * @return |
| | | */ |
| | | private boolean authSign(ServerHttpRequestDecorator httpRequestDecorator) { |
| | | HttpHeaders headers = httpRequestDecorator.getHeaders(); |
| | | AtomicReference<JSONObject> jsonObject = new AtomicReference<>(new JSONObject()); |
| | | httpRequestDecorator.getBody().buffer().map(dataBuffers -> { |
| | | DataBufferFactory dataBufferFactory = new DefaultDataBufferFactory(); |
| | | DataBuffer join = dataBufferFactory.join(dataBuffers); |
| | | byte[] content = new byte[join.readableByteCount()]; |
| | | join.read(content); |
| | | DataBufferUtils.release(join); |
| | | String bodyStr = new String(content, StandardCharsets.UTF_8); |
| | | jsonObject.set(JSON.parseObject(bodyStr)); |
| | | |
| | | // 防xss攻击过滤 |
| | | bodyStr = EscapeUtil.clean(bodyStr); |
| | | // 转成字节 |
| | | byte[] bytes = bodyStr.getBytes(); |
| | | NettyDataBufferFactory nettyDataBufferFactory = new NettyDataBufferFactory(ByteBufAllocator.DEFAULT); |
| | | DataBuffer buffer = nettyDataBufferFactory.allocateBuffer(bytes.length); |
| | | buffer.write(bytes); |
| | | return buffer; |
| | | }); |
| | | JSONObject params = jsonObject.get(); |
| | | String sign = headers.getFirst(TokenConstants.SING); |
| | | if(StringUtils.isEmpty(sign)){ |
| | | return false; |
| | | } |
| | | String nonce_str = headers.getFirst(TokenConstants.NONCE_STR); |
| | | if(StringUtils.isEmpty(nonce_str)){ |
| | | return false; |
| | | } |
| | | |
| | | String signUrlEncode = localSignUrl(params, nonce_str); |
| | | signUrlEncode = signUrlEncode.replaceAll("& #40;", "\\(") |
| | | .replaceAll("& #41;", "\\)") |
| | | .replaceAll("\\+", " "); |
| | | if(sign.equals(signUrlEncode)){ |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 组装签名路径 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | public static String localSignUrl(JSONObject params, String key) { |
| | | List<String> keySet = new ArrayList<>(params.keySet()); |
| | | // 对所有传入参数按照字段名的 ASCII 码从小到大排序(字典序) |
| | | Collections.sort(keySet, new Comparator<String>() { |
| | | @Override |
| | | public int compare(String o1, String o2) { |
| | | return o1.compareTo(o2); |
| | | } |
| | | }); |
| | | // 构造签名键值对的格式 |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (String k : keySet) { |
| | | String v = params.getString(k); |
| | | if(StringUtils.isNotEmpty(v)){ |
| | | sb.append(k + "=" + v + "&"); |
| | | } |
| | | } |
| | | String signUrl = sb.substring(0, sb.length() - 1); |
| | | return signUrlEncode(signUrl, key); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 签名字符串加密 |
| | | * @param signUrl |
| | | * @param encryptKey |
| | | * @return |
| | | */ |
| | | public static String signUrlEncode(String signUrl, String encryptKey) { |
| | | byte[] signByte = new byte[0]; |
| | | try { |
| | | signByte = HMACSHA1.HmacSHA1Encrypt(signUrl, encryptKey); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | String localSign = Base64.encodeBase64String(signByte); |
| | | return localSign; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int getOrder() |
| | | { |
| | |
| | | eager: true |
| | | transport: |
| | | # 控制台地址 |
| | | dashboard: 192.168.110.34:8718 |
| | | dashboard: 192.168.110.169:8718 |
| | | # nacos配置持久化 |
| | | datasource: |
| | | ds1: |
| | | nacos: |
| | | server-addr: 127.0.0.1:8848 |
| | | server-addr: 192.168.110.169:8848 |
| | | dataId: sentinel-ruoyi-gateway |
| | | groupId: DEFAULT_GROUP |
| | | data-type: json |
| | |
| | | import com.ruoyi.common.security.annotation.EnableCustomConfig; |
| | | import com.ruoyi.common.security.annotation.EnableRyFeignClients; |
| | | import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2; |
| | | import org.springframework.transaction.annotation.EnableTransactionManagement; |
| | | |
| | | /** |
| | | * 系统模块 |
| | |
| | | @EnableCustomSwagger2 |
| | | @EnableRyFeignClients |
| | | @SpringBootApplication |
| | | @EnableTransactionManagement |
| | | public class RuoYiSystemApplication |
| | | { |
| | | public static void main(String[] args) |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.system.api.model.GetSysRoleByIds; |
| | | import com.ruoyi.system.domain.SysMenus; |
| | | import com.ruoyi.system.domain.SysRoleMenu; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | |
| | | ajax.put("depts", deptService.selectDeptTreeList(new SysDept())); |
| | | return ajax; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据id集合获取数据 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping(value = "/getSysRoleByIds") |
| | | public R<List<SysRole>> getSysRoleByIds(@RequestBody GetSysRoleByIds ids){ |
| | | List<SysRole> sysRoleByIds = roleService.getSysRoleByIds(ids.getIds()); |
| | | return R.ok(sysRoleByIds); |
| | | } |
| | | } |
| | |
| | | user.setRoleType(1); |
| | | int i = userService.insertUser(user); |
| | | SysUserRole sysUserRole = new SysUserRole(); |
| | | sysUserRole.setRoleId(1l); |
| | | sysUserRole.setRoleId(user.getRoleId()); |
| | | sysUserRole.setUserId(user.getUserId()); |
| | | int i1 = userRoleService.insertSysUserRole(sysUserRole); |
| | | return AjaxResult.success(i1); |
| | |
| | | } |
| | | |
| | | @PostMapping("/updateSysUser") |
| | | @Transactional(propagation = Propagation.REQUIRES_NEW) |
| | | public R<Boolean> updateSysUser(@RequestBody SysUser sysUser) { |
| | | try { |
| | | sysUser.setUpdateBy(SecurityUtils.getUsername()); |
| | | sysUser.setUpdateTime(new Date()); |
| | | userService.updateUser(sysUser); |
| | | userRoleService.deleteSysUserRoleByUserId(sysUser.getUserId()); |
| | | SysUserRole sysUserRole = new SysUserRole(); |
| | | sysUserRole.setRoleId(sysUser.getRoleId()); |
| | | sysUserRole.setUserId(sysUser.getUserId()); |
| | | userRoleService.insertSysUserRole(sysUserRole); |
| | | return R.ok(true); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return R.ok(); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | |
| | | .last("LIMIT 1")); |
| | | return R.ok(user); |
| | | } |
| | | |
| | | /** |
| | | * 根据账号获取用户数据 |
| | | * @param account |
| | | * @return |
| | | */ |
| | | @PostMapping("/queryUserByAccount") |
| | | public R<SysUser> queryUserByAccount(@RequestBody String account){ |
| | | SysUser user = userService.getOne(Wrappers.lambdaQuery(SysUser.class) |
| | | .eq(SysUser::getAccount, account) |
| | | .eq(SysUser::getDelFlag, "0")); |
| | | return R.ok(user); |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | * @param userName |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/queryUserByUserName") |
| | | public R<SysUser> queryUserByUserName(@RequestBody String userName){ |
| | | SysUser user = userService.getOne(Wrappers.lambdaQuery(SysUser.class) |
| | |
| | | .last("LIMIT 1")); |
| | | return R.ok(user); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 添加管理员 |
| | | * @param user |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/addSysUser") |
| | | @Transactional(propagation = Propagation.REQUIRES_NEW) |
| | | public R addSysUser(@RequestBody SysUser user){ |
| | | user.setUserName(user.getPhonenumber()); |
| | | if(!org.springframework.util.StringUtils.hasLength(user.getNickName())){ |
| | | user.setNickName(user.getPhonenumber()); |
| | | } |
| | | if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { |
| | | throw new RuntimeException("手机号已开通账号"); |
| | | } |
| | | if (StringUtils.isNotEmpty(user.getAccount()) && !userService.checkAccountUnique(user)) { |
| | | throw new RuntimeException("登录账号已存在"); |
| | | } |
| | | user.setCreateBy(SecurityUtils.getUsername()); |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | user.setRoleType(1); |
| | | userService.insertUser(user); |
| | | SysUserRole sysUserRole = new SysUserRole(); |
| | | sysUserRole.setRoleId(user.getRoleId()); |
| | | sysUserRole.setUserId(user.getUserId()); |
| | | userRoleService.insertSysUserRole(sysUserRole); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/resetPassword") |
| | | public R resetPassword(@RequestBody SysUser user) { |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | user.setUpdateBy(SecurityUtils.getUsername()); |
| | | userService.resetPwd(user); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | public int deleteRoleByIds(Long[] roleIds); |
| | | |
| | | List<SysRole> isExitUpdate(@Param("roleName") String roleName, @Param("roleId") Long roleId, @Param("companyId") Integer companyId); |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据id获取数据 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | List<SysRole> getSysRoleByIds(@Param("ids") List<Integer> ids); |
| | | } |
| | |
| | | * @return 结果 |
| | | */ |
| | | public SysUser checkPhoneUnique(String phonenumber); |
| | | |
| | | /** |
| | | * 校验登录账号是否唯一 |
| | | * @param account 登录账号 |
| | | * @return |
| | | */ |
| | | SysUser checkAccountUnique(String account); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 校验email是否唯一 |
| | |
| | | public int insertAuthUsers(Long roleId, Long[] userIds); |
| | | |
| | | List<SysRole> isExitUpdate(String roleName, Long roleId,Integer companyId); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据id获取数据 |
| | | * @param ids 数据id集合 |
| | | * @return |
| | | */ |
| | | List<SysRole> getSysRoleByIds(List<Integer> ids); |
| | | } |
| | |
| | | * @return 结果 |
| | | */ |
| | | public boolean checkPhoneUnique(SysUser user); |
| | | |
| | | boolean checkAccountUnique(SysUser user); |
| | | |
| | | /** |
| | | * 校验email是否唯一 |
| | |
| | | public List<SysRole> isExitUpdate(String roleName, Long roleId,Integer companyId) { |
| | | return roleMapper.isExitUpdate(roleName,roleId,companyId); |
| | | } |
| | | |
| | | /** |
| | | * 根据id获取数据 |
| | | * @param ids 数据id集合 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<SysRole> getSysRoleByIds(List<Integer> ids) { |
| | | return this.baseMapper.getSysRoleByIds(ids); |
| | | } |
| | | } |
| | |
| | | } |
| | | return UserConstants.UNIQUE; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public boolean checkAccountUnique(SysUser user) { |
| | | SysUser info = userMapper.checkAccountUnique(user.getAccount()); |
| | | if (StringUtils.isNotNull(info) ) |
| | | { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | | return UserConstants.UNIQUE; |
| | | } |
| | | |
| | | /** |
| | | * 校验email是否唯一 |
| | | * |
| | |
| | | </foreach> |
| | | </delete> |
| | | |
| | | |
| | | |
| | | <select id="getSysRoleByIds" resultMap="SysRoleResult"> |
| | | <include refid="selectRoleVo"/> |
| | | where id in |
| | | <foreach collection="ids" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </select> |
| | | </mapper> |
| | |
| | | <result property="phonenumber" column="phonenumber" /> |
| | | <result property="sex" column="sex" /> |
| | | <result property="avatar" column="avatar" /> |
| | | <result property="account" column="account" /> |
| | | <result property="password" column="password" /> |
| | | <result property="status" column="status" /> |
| | | <result property="delFlag" column="del_flag" /> |
| | |
| | | select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and del_flag = '0' limit 1 |
| | | </select> |
| | | |
| | | |
| | | <select id="checkAccountUnique" resultMap="SysUserResult"> |
| | | select user_id, account from sys_user where account = #{account} and del_flag = '0' limit 1 |
| | | </select> |
| | | |
| | | <select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult"> |
| | | select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1 |
| | | </select> |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.account.api.model.TAppUserAddress; |
| | | import com.ruoyi.account.service.TAppUserAddressService; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RequestMapping("/t-app-user-address") |
| | | public class TAppUserAddressController { |
| | | |
| | | private final TAppUserAddressService appUserAddressService; |
| | | |
| | | @Autowired |
| | | public TAppUserAddressController(TAppUserAddressService appUserAddressService) { |
| | | this.appUserAddressService = appUserAddressService; |
| | | } |
| | | |
| | | /** |
| | | * 查询用户地址列表 |
| | | */ |
| | | @ApiOperation(tags = {"小程序-用户地址"},value = "查询用户地址列表") |
| | | @GetMapping(value = "/queryAddress") |
| | | public AjaxResult<List<TAppUserAddress>> queryAddress() { |
| | | // TODO 用户id |
| | | return AjaxResult.ok(appUserAddressService.list(Wrappers.<TAppUserAddress>lambdaQuery().eq(TAppUserAddress::getAppUserId, null))); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加用户地址管理 |
| | | */ |
| | | @ApiOperation(tags = {"小程序-用户地址"},value = "添加用户地址") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@RequestBody TAppUserAddress dto) { |
| | | // TODO 用户id |
| | | // 修改用户默认地址 |
| | | appUserAddressService.updateDefaultAddress(dto.getDefaultAddress(),dto.getAppUserId()); |
| | | return AjaxResult.ok(appUserAddressService.save(dto)); |
| | | } |
| | | |
| | | /** |
| | | * 修改用户地址 |
| | | */ |
| | | @ApiOperation(tags = {"小程序-用户地址"},value = "修改用户地址") |
| | | @PostMapping(value = "/update") |
| | | public AjaxResult<Boolean> update(@RequestBody TAppUserAddress dto) { |
| | | // 修改用户默认地址 |
| | | appUserAddressService.updateDefaultAddress(dto.getDefaultAddress(),dto.getAppUserId()); |
| | | return AjaxResult.ok(appUserAddressService.updateById(dto)); |
| | | } |
| | | |
| | | /** |
| | | * 删除用户地址 |
| | | */ |
| | | @ApiOperation(tags = {"小程序-用户地址"},value = "删除用户地址") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public AjaxResult<Boolean> deleteById(@RequestParam Integer id) { |
| | | return AjaxResult.ok(appUserAddressService.removeById(id)); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | */ |
| | | public interface TAppUserAddressService extends IService<TAppUserAddress> { |
| | | |
| | | /** |
| | | * 修改用户默认地址 |
| | | * @param defaultAddress |
| | | */ |
| | | void updateDefaultAddress(Integer defaultAddress,Long appUserId); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.model.TAppUserAddress; |
| | | import com.ruoyi.account.mapper.TAppUserAddressMapper; |
| | |
| | | @Service |
| | | public class TAppUserAddressServiceImpl extends ServiceImpl<TAppUserAddressMapper, TAppUserAddress> implements TAppUserAddressService { |
| | | |
| | | @Override |
| | | public void updateDefaultAddress(Integer defaultAddress,Long appUserId) { |
| | | if (defaultAddress == 1) { |
| | | this.update(Wrappers.<TAppUserAddress>lambdaUpdate().set(TAppUserAddress::getDefaultAddress, 0).eq(TAppUserAddress::getAppUserId, appUserId)); |
| | | } |
| | | } |
| | | } |
| | |
| | | <groupId>com.alibaba.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.alibaba.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-alibaba-seata</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- SpringBoot Actuator --> |
| | | <dependency> |
| | |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import org.springframework.transaction.annotation.EnableTransactionManagement; |
| | | |
| | | /** |
| | | * 账户模块 |
| | |
| | | @EnableRyFeignClients |
| | | @SpringBootApplication |
| | | @EnableScheduling//开启定时任务 |
| | | @EnableTransactionManagement//开启事务 |
| | | public class RuoYiChargingPileApplication { |
| | | public static void main(String[] args) { |
| | | SpringApplication.run(RuoYiChargingPileApplication.class, args); |
New file |
| | |
| | | package com.ruoyi.chargingPile.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.ruoyi.chargingPile.api.dto.PartnerListDTO; |
| | | import com.ruoyi.chargingPile.api.model.Partner; |
| | | import com.ruoyi.chargingPile.api.query.GetPartnerList; |
| | | import com.ruoyi.chargingPile.dto.ResetPassword; |
| | | import com.ruoyi.chargingPile.service.IPartnerService; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | 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 java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/7 13:49 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/partner") |
| | | public class PartnerController { |
| | | |
| | | @Resource |
| | | private IPartnerService partnerService; |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/getPartnerList") |
| | | @ApiOperation(value = "获取合作商列表", tags = {"管理后台-合作商管理"}) |
| | | public AjaxResult<PageInfo<PartnerListDTO>> getPartnerList(@RequestBody GetPartnerList partnerList){ |
| | | PageInfo<PartnerListDTO> list = partnerService.getPartnerList(partnerList); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/addPartner") |
| | | @ApiOperation(value = "添加合作商", tags = {"管理后台-合作商管理"}) |
| | | public AjaxResult addPartner(@RequestBody Partner partner){ |
| | | return partnerService.addPartner(partner); |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/getPartner/{id}") |
| | | @ApiOperation(value = "获取合作商详情", tags = {"管理后台-合作商管理"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "合作商id", name = "id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | public AjaxResult<Partner> getPartner(@PathVariable Integer id){ |
| | | Partner partner = partnerService.getPartner(id); |
| | | return AjaxResult.success(partner); |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/editPartner") |
| | | @ApiOperation(value = "编辑合作商", tags = {"管理后台-合作商管理"}) |
| | | public AjaxResult editPartner(@RequestBody Partner partner){ |
| | | return partnerService.editPartner(partner); |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @DeleteMapping("/delPartner/{id}") |
| | | @ApiOperation(value = "删除合作商", tags = {"管理后台-合作商管理"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "合作商id", name = "id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | public AjaxResult delPartner(@PathVariable("id") Integer id){ |
| | | return partnerService.delPartner(id); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/resetPassword") |
| | | @ApiOperation(value = "合作商重置密码", tags = {"管理后台-合作商管理"}) |
| | | public AjaxResult resetPassword(@RequestBody ResetPassword resetPassword){ |
| | | return partnerService.resetPassword(resetPassword); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/getPartner") |
| | | @ApiOperation(value = "获取所有合作商", tags = {"管理后台-站点管理"}) |
| | | public AjaxResult<List<Partner>> getPartner(){ |
| | | List<Partner> list = partnerService.list(new LambdaQueryWrapper<Partner>().eq(Partner::getDelFlag, 0)); |
| | | return AjaxResult.success(list); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.controller; |
| | | |
| | | import com.ruoyi.chargingPile.api.dto.GetSiteListDTO; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.query.GetSiteList; |
| | | import com.ruoyi.chargingPile.service.ISiteService; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | 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; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/7 19:56 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/site") |
| | | public class SiteController { |
| | | |
| | | @Resource |
| | | private ISiteService siteService; |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/getSiteList") |
| | | @ApiOperation(value = "获取站点列表", tags = {"管理后台-站点管理"}) |
| | | public AjaxResult<PageInfo<GetSiteListDTO>> getSiteList(@RequestBody GetSiteList siteList){ |
| | | PageInfo<GetSiteListDTO> list = siteService.getSiteList(siteList); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/getSiteList") |
| | | @ApiOperation(value = "添加站点", tags = {"管理后台-站点管理"}) |
| | | public AjaxResult addSite(@RequestBody Site site){ |
| | | return siteService.addSite(site); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/editSite") |
| | | @ApiOperation(value = "编辑站点", tags = {"管理后台-站点管理"}) |
| | | public AjaxResult editSite(@RequestBody Site site){ |
| | | return siteService.editSite(site); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @DeleteMapping("/delSite/{id}") |
| | | @ApiOperation(value = "编辑站点", tags = {"管理后台-站点管理"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "站点id", name = "id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | public AjaxResult delSite(@PathVariable Integer id){ |
| | | return siteService.delSite(id); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/t-charging-pile-notification") |
| | | public class TChargingPileNotificationController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.chargingPile.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/t-fault-message") |
| | | public class TFaultMessageController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.chargingPile.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/t-parking-record") |
| | | public class TParkingRecordController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.chargingPile.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/t-partner-site") |
| | | public class TPartnerSiteController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.chargingPile.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/t-repair") |
| | | public class TRepairController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.chargingPile.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/t-site-menu") |
| | | public class TSiteMenuController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.chargingPile.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/7 15:56 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class ResetPassword { |
| | | @ApiModelProperty(value = "合作商id", required = true) |
| | | private Integer id; |
| | | @ApiModelProperty(value = "新密码", required = true) |
| | | private String password; |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.chargingPile.api.dto.PartnerListDTO; |
| | | import com.ruoyi.chargingPile.api.model.Partner; |
| | | import com.ruoyi.chargingPile.api.query.GetPartnerList; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/7 13:44 |
| | | */ |
| | | public interface PartnerMapper extends BaseMapper<Partner> { |
| | | |
| | | /** |
| | | * 获取合作商列表 |
| | | * @param pageInfo |
| | | * @param partnerList |
| | | * @return |
| | | */ |
| | | List<PartnerListDTO> getPartnerList(PageInfo<PartnerListDTO> pageInfo, @Param("item") GetPartnerList partnerList); |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.chargingPile.api.dto.GetSiteListDTO; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.query.GetSiteList; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/7 19:49 |
| | | */ |
| | | public interface SiteMapper extends BaseMapper<Site> { |
| | | |
| | | |
| | | /** |
| | | * 获取站点列表 |
| | | * @param pageInfo |
| | | * @param siteList |
| | | * @return |
| | | */ |
| | | List<GetSiteListDTO> getSiteList(PageInfo<GetSiteListDTO> pageInfo, @Param("item") GetSiteList siteList); |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPileNotification; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | public interface TChargingPileNotificationMapper extends BaseMapper<TChargingPileNotification> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.chargingPile.api.model.TFaultMessage; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | public interface TFaultMessageMapper extends BaseMapper<TFaultMessage> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.chargingPile.api.model.TParkingRecord; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | public interface TParkingRecordMapper extends BaseMapper<TParkingRecord> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.chargingPile.api.model.TPartnerSite; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | public interface TPartnerSiteMapper extends BaseMapper<TPartnerSite> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.chargingPile.api.model.TRepair; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | public interface TRepairMapper extends BaseMapper<TRepair> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.chargingPile.api.model.TSiteMenu; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | public interface TSiteMenuMapper extends BaseMapper<TSiteMenu> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.chargingPile.api.dto.PartnerListDTO; |
| | | import com.ruoyi.chargingPile.api.model.Partner; |
| | | import com.ruoyi.chargingPile.api.query.GetPartnerList; |
| | | import com.ruoyi.chargingPile.dto.ResetPassword; |
| | | 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; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/7 13:48 |
| | | */ |
| | | public interface IPartnerService extends IService<Partner> { |
| | | |
| | | |
| | | /** |
| | | * 获取合作商列表数据 |
| | | * @param partnerList |
| | | * @return |
| | | */ |
| | | PageInfo<PartnerListDTO> getPartnerList(GetPartnerList partnerList); |
| | | |
| | | |
| | | /** |
| | | * 添加合作商 |
| | | * @param partner |
| | | * @return |
| | | */ |
| | | AjaxResult addPartner(Partner partner); |
| | | |
| | | |
| | | /** |
| | | * 获取合作商详情 |
| | | * @param id 合作商id |
| | | * @return |
| | | */ |
| | | Partner getPartner(Integer id); |
| | | |
| | | /** |
| | | * 编辑合作商数据 |
| | | * @param partner |
| | | * @return |
| | | */ |
| | | AjaxResult editPartner(Partner partner); |
| | | |
| | | /** |
| | | * 删除合作商 |
| | | * @param id |
| | | */ |
| | | AjaxResult delPartner(Integer id); |
| | | |
| | | /** |
| | | * 重置密码 |
| | | * @param resetPassword |
| | | */ |
| | | AjaxResult resetPassword(ResetPassword resetPassword); |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.chargingPile.api.dto.GetSiteListDTO; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.query.GetSiteList; |
| | | 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; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/7 19:54 |
| | | */ |
| | | public interface ISiteService extends IService<Site> { |
| | | |
| | | |
| | | /** |
| | | * 获取站点管理列表 |
| | | * @param siteList |
| | | * @return |
| | | */ |
| | | PageInfo<GetSiteListDTO> getSiteList(GetSiteList siteList); |
| | | |
| | | |
| | | /** |
| | | * 添加站点信息 |
| | | * @param site |
| | | * @return |
| | | */ |
| | | AjaxResult addSite(Site site); |
| | | |
| | | |
| | | /** |
| | | * 编辑站点 |
| | | * @param site |
| | | * @return |
| | | */ |
| | | AjaxResult editSite(Site site); |
| | | |
| | | |
| | | /** |
| | | * 删除站点 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | AjaxResult delSite(Integer id); |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPileNotification; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | public interface TChargingPileNotificationService extends IService<TChargingPileNotification> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.chargingPile.api.model.TFaultMessage; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | public interface TFaultMessageService extends IService<TFaultMessage> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.chargingPile.api.model.TParkingRecord; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | public interface TParkingRecordService extends IService<TParkingRecord> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.chargingPile.api.model.TPartnerSite; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | public interface TPartnerSiteService extends IService<TPartnerSite> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.chargingPile.api.model.TRepair; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | public interface TRepairService extends IService<TRepair> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.chargingPile.api.model.TSiteMenu; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | public interface TSiteMenuService extends IService<TSiteMenu> { |
| | | |
| | | } |
New file |
| | |
| | | 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.PartnerListDTO; |
| | | import com.ruoyi.chargingPile.api.model.Partner; |
| | | 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.common.core.domain.R; |
| | | 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.system.api.domain.SysRole; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysRoleClient; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import com.ruoyi.system.api.model.GetSysRoleByIds; |
| | | import io.seata.spring.annotation.GlobalTransactional; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/7 13:49 |
| | | */ |
| | | @Service |
| | | public class PartnerServiceImpl extends ServiceImpl<PartnerMapper, Partner> implements IPartnerService { |
| | | |
| | | @Resource |
| | | private SysRoleClient sysRoleClient; |
| | | |
| | | @Resource |
| | | private SysUserClient sysUserClient; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取合作商列表数据 |
| | | * @param partnerList |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageInfo<PartnerListDTO> getPartnerList(GetPartnerList partnerList) { |
| | | PageInfo<PartnerListDTO> pageInfo = new PageInfo(partnerList.getPageCurr(), partnerList.getPageSize()); |
| | | List<PartnerListDTO> list = this.baseMapper.getPartnerList(pageInfo, partnerList); |
| | | List<Integer> roleIds = list.stream().map(PartnerListDTO::getRoleId).collect(Collectors.toList()); |
| | | GetSysRoleByIds ids = new GetSysRoleByIds(); |
| | | ids.setIds(roleIds); |
| | | //获取相关的角色id |
| | | R<List<SysRole>> r = sysRoleClient.getSysRoleByIds(ids); |
| | | if(r.getCode() != 200){ |
| | | throw new RuntimeException(r.getMsg()); |
| | | } |
| | | List<SysRole> data = r.getData(); |
| | | for (PartnerListDTO partnerListDTO : list) { |
| | | Integer roleId = partnerListDTO.getRoleId(); |
| | | if(null != roleId){ |
| | | continue; |
| | | } |
| | | SysRole sysRole = data.stream().filter(s -> roleId.equals(s.getRoleId())).findFirst().get(); |
| | | if(null != sysRole){ |
| | | partnerListDTO.setRoleName(sysRole.getRoleName()); |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加合作商 |
| | | * @param partner |
| | | * @return |
| | | */ |
| | | @Override |
| | | @GlobalTransactional//分布式事务 |
| | | public AjaxResult addPartner(Partner partner) { |
| | | //校验参数和重复数据 |
| | | AjaxResult ajaxResult = addPartnerParameterCheck(partner); |
| | | if(ajaxResult.isError()){ |
| | | return ajaxResult; |
| | | } |
| | | Partner one = this.getOne(new LambdaQueryWrapper<Partner>() |
| | | .eq(Partner::getCode, partner.getCode()) |
| | | .eq(Partner::getDelFlag, 0) |
| | | ); |
| | | if(null != one){ |
| | | return AjaxResult.error("合作商ID已存在"); |
| | | } |
| | | one = this.getOne(new LambdaQueryWrapper<Partner>() |
| | | .eq(Partner::getAccount, partner.getAccount()) |
| | | .eq(Partner::getDelFlag, 0) |
| | | ); |
| | | if(null != one){ |
| | | return AjaxResult.error("登录账号不能重复"); |
| | | } |
| | | //添加新数据 |
| | | this.save(partner); |
| | | //添加登录账户 |
| | | SysUser user = new SysUser(); |
| | | user.setAccount(partner.getAccount()); |
| | | user.setPhonenumber(partner.getPhoneOne()); |
| | | user.setUserName(partner.getName()); |
| | | user.setNickName(partner.getName()); |
| | | user.setAvatar(partner.getLogoUrl()); |
| | | user.setPassword(partner.getPassword()); |
| | | user.setStatus("0"); |
| | | user.setDelFlag("0"); |
| | | user.setRoleId(partner.getRoleId().longValue()); |
| | | R r = sysUserClient.addSysUser(user); |
| | | if(200 != r.getCode()){ |
| | | throw new RuntimeException(r.getMsg()); |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 校验参数是否为空 |
| | | * @param partner |
| | | * @return |
| | | */ |
| | | AjaxResult addPartnerParameterCheck(Partner partner){ |
| | | if(StringUtils.isEmpty(partner.getCode())){ |
| | | return AjaxResult.error("合作商ID不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(partner.getName())){ |
| | | return AjaxResult.error("合作商名称不能为空"); |
| | | } |
| | | if(null == partner.getRoleId()){ |
| | | return AjaxResult.error("合作商角色不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(partner.getPhoneOne())){ |
| | | return AjaxResult.error("合作商电话1不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(partner.getAccount())){ |
| | | return AjaxResult.error("登录账号不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(partner.getPassword())){ |
| | | return AjaxResult.error("登录密码不能为空"); |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取合作商详情 |
| | | * @param id 合作商id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Partner getPartner(Integer id) { |
| | | Partner partner = this.getById(id); |
| | | if(null == partner){ |
| | | return partner; |
| | | } |
| | | GetSysRoleByIds ids = new GetSysRoleByIds(); |
| | | ids.setIds(Arrays.asList(partner.getRoleId())); |
| | | //获取相关的角色id |
| | | R<List<SysRole>> r = sysRoleClient.getSysRoleByIds(ids); |
| | | if(r.getCode() != 200){ |
| | | throw new RuntimeException(r.getMsg()); |
| | | } |
| | | List<SysRole> data = r.getData(); |
| | | if(data.size() > 0){ |
| | | partner.setRoleName(data.get(0).getRoleName()); |
| | | } |
| | | return partner; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 编辑合作商 |
| | | * @param partner |
| | | * @return |
| | | */ |
| | | @Override |
| | | @GlobalTransactional//分布式事务 |
| | | public AjaxResult editPartner(Partner partner) { |
| | | //校验参数和重复数据 |
| | | AjaxResult ajaxResult = addPartnerParameterCheck(partner); |
| | | if(ajaxResult.isError()){ |
| | | return ajaxResult; |
| | | } |
| | | Partner one = this.getOne(new LambdaQueryWrapper<Partner>() |
| | | .eq(Partner::getCode, partner.getCode()) |
| | | .eq(Partner::getDelFlag, 0) |
| | | ); |
| | | if(null != one && !one.getId().equals(partner.getId())){ |
| | | return AjaxResult.error("合作商ID已存在"); |
| | | } |
| | | one = this.getOne(new LambdaQueryWrapper<Partner>() |
| | | .eq(Partner::getAccount, partner.getAccount()) |
| | | .eq(Partner::getDelFlag, 0) |
| | | ); |
| | | if(null != one && !one.getId().equals(partner.getId())){ |
| | | return AjaxResult.error("登录账号不能重复"); |
| | | } |
| | | Partner oldPartner = this.getById(partner.getId()); |
| | | SysUser user = sysUserClient.queryUserByAccount(oldPartner.getAccount()).getData(); |
| | | |
| | | //修改数据 |
| | | this.updateById(partner); |
| | | //修改登录账户 |
| | | if(null == user){ |
| | | user = new SysUser(); |
| | | user.setStatus("0"); |
| | | user.setDelFlag("0"); |
| | | user.setAccount(partner.getAccount()); |
| | | user.setPhonenumber(partner.getPhoneOne()); |
| | | user.setUserName(partner.getName()); |
| | | user.setNickName(partner.getName()); |
| | | user.setAvatar(partner.getLogoUrl()); |
| | | user.setPassword(partner.getPassword()); |
| | | user.setRoleId(partner.getRoleId().longValue()); |
| | | R r = sysUserClient.addSysUser(user); |
| | | if(200 != r.getCode()){ |
| | | throw new RuntimeException(r.getMsg()); |
| | | } |
| | | }else{ |
| | | user.setAccount(partner.getAccount()); |
| | | user.setPhonenumber(partner.getPhoneOne()); |
| | | user.setUserName(partner.getName()); |
| | | user.setNickName(partner.getName()); |
| | | user.setAvatar(partner.getLogoUrl()); |
| | | user.setPassword(partner.getPassword()); |
| | | user.setRoleId(partner.getRoleId().longValue()); |
| | | R r = sysUserClient.updateSysUser(user); |
| | | if(200 != r.getCode()){ |
| | | throw new RuntimeException(r.getMsg()); |
| | | } |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除合作商 |
| | | * @param id 合作商id |
| | | */ |
| | | @Override |
| | | @GlobalTransactional//分布式事务 |
| | | public AjaxResult delPartner(Integer id) { |
| | | //查询有无关联数据 |
| | | //站点 |
| | | // todo 代码完善 |
| | | //充电桩 |
| | | |
| | | Partner partner = this.getById(id); |
| | | if(null == partner){ |
| | | return AjaxResult.error("删除失败"); |
| | | } |
| | | partner.setDelFlag(true); |
| | | this.updateById(partner); |
| | | SysUser user = sysUserClient.queryUserByAccount(partner.getAccount()).getData(); |
| | | user.setDelFlag("2"); |
| | | sysUserClient.updateUser(user); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 重置密码 |
| | | * @param resetPassword |
| | | */ |
| | | @Override |
| | | @GlobalTransactional//分布式事务 |
| | | public AjaxResult resetPassword(ResetPassword resetPassword) { |
| | | if(null == resetPassword.getId()){ |
| | | return AjaxResult.error("合作商id不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(resetPassword.getPassword())){ |
| | | return AjaxResult.error("密码不能为空"); |
| | | } |
| | | Partner partner = this.getById(resetPassword.getId()); |
| | | partner.setPassword(resetPassword.getPassword()); |
| | | this.updateById(partner); |
| | | //修改登录账号的密码 |
| | | SysUser user = sysUserClient.queryUserByAccount(partner.getAccount()).getData(); |
| | | user.setPassword(partner.getPassword()); |
| | | sysUserClient.resetPassword(user); |
| | | return AjaxResult.success(); |
| | | } |
| | | } |
New file |
| | |
| | | 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.GetSiteListDTO; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.query.GetSiteList; |
| | | import com.ruoyi.chargingPile.mapper.SiteMapper; |
| | | import com.ruoyi.chargingPile.service.ISiteService; |
| | | 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 java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/7 19:54 |
| | | */ |
| | | @Service |
| | | public class SiteServiceImpl extends ServiceImpl<SiteMapper, Site> implements ISiteService { |
| | | |
| | | |
| | | /** |
| | | * 获取站点管理列表数据 |
| | | * @param siteList |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageInfo<GetSiteListDTO> getSiteList(GetSiteList siteList) { |
| | | PageInfo<GetSiteListDTO> pageInfo = new PageInfo<>(siteList.getPageCurr(), siteList.getPageSize()); |
| | | List<GetSiteListDTO> list = this.baseMapper.getSiteList(pageInfo, siteList); |
| | | return pageInfo.setRecords(list); |
| | | } |
| | | |
| | | /** |
| | | * 添加站点信息 |
| | | * @param site |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AjaxResult addSite(Site site) { |
| | | AjaxResult ajaxResult = addSiteVerify(site); |
| | | if(ajaxResult.isError()){ |
| | | return ajaxResult; |
| | | } |
| | | Site one = this.getOne(new LambdaQueryWrapper<Site>().eq(Site::getCode, site.getCode()).eq(Site::getDelFlag, 0)); |
| | | if(null != one){ |
| | | return AjaxResult.error("站点编号重复"); |
| | | } |
| | | site.setMark(0); |
| | | this.save(site); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 编辑站点 |
| | | * @param site |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AjaxResult editSite(Site site) { |
| | | AjaxResult ajaxResult = addSiteVerify(site); |
| | | if(ajaxResult.isError()){ |
| | | return ajaxResult; |
| | | } |
| | | Site one = this.getOne(new LambdaQueryWrapper<Site>().eq(Site::getCode, site.getCode()).eq(Site::getDelFlag, 0)); |
| | | if(null != one && !one.getCode().equals(site.getCode())){ |
| | | return AjaxResult.error("站点编号重复"); |
| | | } |
| | | this.updateById(site); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 校验必填项 |
| | | * @param site |
| | | * @return |
| | | */ |
| | | AjaxResult addSiteVerify(Site site){ |
| | | if(null == site.getPartnerId()){ |
| | | return AjaxResult.error("合作商不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(site.getCode())){ |
| | | return AjaxResult.error("站点编号不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(site.getName())){ |
| | | return AjaxResult.error("站点名称不能为空"); |
| | | } |
| | | if(null == site.getSiteType()){ |
| | | return AjaxResult.error("站点类型不能为空"); |
| | | } |
| | | if(null == site.getBusinessCategory()){ |
| | | return AjaxResult.error("经营类别不能为空"); |
| | | } |
| | | if(null == site.getStatus()){ |
| | | return AjaxResult.error("站点状态不能为空"); |
| | | } |
| | | if(null == site.getConstructionSite()){ |
| | | return AjaxResult.error("建设场所不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(site.getProvince()) || StringUtils.isEmpty(site.getProvinceCode()) || |
| | | StringUtils.isEmpty(site.getCity()) || StringUtils.isEmpty(site.getCityCode()) || |
| | | StringUtils.isEmpty(site.getDistricts()) || StringUtils.isEmpty(site.getDistrictsCode())){ |
| | | return AjaxResult.error("所在区域不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(site.getAddress())){ |
| | | return AjaxResult.error("详细地址不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(site.getLon()) || StringUtils.isEmpty(site.getLat())){ |
| | | return AjaxResult.error("地图位置不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(site.getPhone())){ |
| | | return AjaxResult.error("站点电话不能为空"); |
| | | } |
| | | if(StringUtils.isEmpty(site.getServicePhone())){ |
| | | return AjaxResult.error("服务电话不能为空"); |
| | | } |
| | | if(null == site.getParkingSpace()){ |
| | | return AjaxResult.error("车位数量不能为空"); |
| | | } |
| | | if(null == site.getSort()){ |
| | | return AjaxResult.error("排序不能为空"); |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 删除站点 |
| | | * @param id 站点id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AjaxResult delSite(Integer id) { |
| | | //查询是否有关联数据 |
| | | //充电桩 |
| | | // todo 待完善 |
| | | Site site = this.getById(id); |
| | | site.setDelFlag(true); |
| | | this.updateById(site); |
| | | return AjaxResult.success(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPileNotification; |
| | | import com.ruoyi.chargingPile.mapper.TChargingPileNotificationMapper; |
| | | import com.ruoyi.chargingPile.service.TChargingPileNotificationService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | @Service |
| | | public class TChargingPileNotificationServiceImpl extends ServiceImpl<TChargingPileNotificationMapper, TChargingPileNotification> implements TChargingPileNotificationService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.chargingPile.api.model.TFaultMessage; |
| | | import com.ruoyi.chargingPile.mapper.TFaultMessageMapper; |
| | | import com.ruoyi.chargingPile.service.TFaultMessageService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | @Service |
| | | public class TFaultMessageServiceImpl extends ServiceImpl<TFaultMessageMapper, TFaultMessage> implements TFaultMessageService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.chargingPile.api.model.TParkingRecord; |
| | | import com.ruoyi.chargingPile.mapper.TParkingRecordMapper; |
| | | import com.ruoyi.chargingPile.service.TParkingRecordService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | @Service |
| | | public class TParkingRecordServiceImpl extends ServiceImpl<TParkingRecordMapper, TParkingRecord> implements TParkingRecordService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.chargingPile.api.model.TPartnerSite; |
| | | import com.ruoyi.chargingPile.mapper.TPartnerSiteMapper; |
| | | import com.ruoyi.chargingPile.service.TPartnerSiteService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | @Service |
| | | public class TPartnerSiteServiceImpl extends ServiceImpl<TPartnerSiteMapper, TPartnerSite> implements TPartnerSiteService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.chargingPile.api.model.TRepair; |
| | | import com.ruoyi.chargingPile.mapper.TRepairMapper; |
| | | import com.ruoyi.chargingPile.service.TRepairService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | @Service |
| | | public class TRepairServiceImpl extends ServiceImpl<TRepairMapper, TRepair> implements TRepairService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.chargingPile.api.model.TSiteMenu; |
| | | import com.ruoyi.chargingPile.mapper.TSiteMenuMapper; |
| | | import com.ruoyi.chargingPile.service.TSiteMenuService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-08 |
| | | */ |
| | | @Service |
| | | public class TSiteMenuServiceImpl extends ServiceImpl<TSiteMenuMapper, TSiteMenu> implements TSiteMenuService { |
| | | |
| | | } |
| | |
| | | # 共享配置 |
| | | shared-configs: |
| | | - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} |
| | | |
| | | --- |
| | | seata: |
| | | application-id: seata-chargingPile |
| | | registry: |
| | | type: nacos |
| | | nacos: |
| | | server-addr: 192.168.110.169:8848 |
| | | namespace: b5290bc2-e3aa-4988-8a7d-9c07e4e073cb |
| | | group: DEFAULT_GROUP |
| | | application: seata-server #Nacos 中 Seata 名称 |
| | | username: nacos |
| | | password: nacos |
| | | tx-service-group: seata_tx_group #事务组(被一个集群管理) |
| | | service: |
| | | vgroup-mapping: |
| | | seata_tx_group: default |
| | | data-source-proxy-mode: AT |
| | | --- |
| | | spring: |
| | | config: |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.chargingPile.mapper.PartnerMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.chargingPile.api.model.Partner"> |
| | | <id column="id" property="id" /> |
| | | <result column="code" property="code" /> |
| | | <result column="`name`" property="name" /> |
| | | <result column="role_id" property="roleId" /> |
| | | <result column="logo_url" property="logoUrl" /> |
| | | <result column="rate" property="rate" /> |
| | | <result column="address" property="address" /> |
| | | <result column="phone_one" property="phoneOne" /> |
| | | <result column="phone_two" property="phoneTwo" /> |
| | | <result column="remark" property="remark" /> |
| | | <result column="account" property="account" /> |
| | | <result column="password" property="password" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="getPartnerList" resultType="com.ruoyi.chargingPile.api.dto.PartnerListDTO"> |
| | | select |
| | | id, |
| | | name, |
| | | role_id as roleId, |
| | | phone_one as phoneOne, |
| | | address, |
| | | account, |
| | | remark |
| | | from t_partner where del_flag = 0 |
| | | <if test="null != item.name and '' != item.name"> |
| | | and `name` like CONCAT('%', #{item.name}, '%') |
| | | </if> |
| | | <if test="null != item.roleId and '' != item.name"> |
| | | and role_id = #{item.roleId} |
| | | </if> |
| | | order by create_time desc limit #{item.pageCurr}, #{item.pageSize} |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.chargingPile.mapper.SiteMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.chargingPile.api.model.Site"> |
| | | <id column="id" property="id" /> |
| | | <result column="partner_id" property="partnerId" /> |
| | | <result column="`code`" property="code" /> |
| | | <result column="name" property="name" /> |
| | | <result column="site_type" property="siteType" /> |
| | | <result column="business_category" property="businessCategory" /> |
| | | <result column="status" property="status" /> |
| | | <result column="construction_site" property="constructionSite" /> |
| | | <result column="img_url" property="imgUrl" /> |
| | | <result column="province" property="province" /> |
| | | <result column="province_code" property="provinceCode" /> |
| | | <result column="city" property="city" /> |
| | | <result column="city_code" property="cityCode" /> |
| | | <result column="districts" property="districts" /> |
| | | <result column="districts_code" property="districtsCode" /> |
| | | <result column="lon" property="lon" /> |
| | | <result column="lat" property="lat" /> |
| | | <result column="address" property="address" /> |
| | | <result column="country_code" property="countryCode" /> |
| | | <result column="phone" property="phone" /> |
| | | <result column="service_phone" property="servicePhone" /> |
| | | <result column="guide" property="guide" /> |
| | | <result column="start_service_time" property="startServiceTime" /> |
| | | <result column="end_service_time" property="endServiceTime" /> |
| | | <result column="service_description" property="serviceDescription" /> |
| | | <result column="vehicle_description" property="vehicleDescription" /> |
| | | <result column="parking_space" property="parkingSpace" /> |
| | | <result column="rate_description" property="rateDescription" /> |
| | | <result column="space_charge_explain" property="spaceChargeExplain" /> |
| | | <result column="accounting_strategy_id" property="accountingStrategyId" /> |
| | | <result column="establishment_time" property="establishmentTime" /> |
| | | <result column="sort" property="sort" /> |
| | | <result column="remark" property="remark" /> |
| | | <result column="mark" property="mark" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="getSiteList" resultType="com.ruoyi.chargingPile.api.dto.GetSiteListDTO"> |
| | | select |
| | | a.id, |
| | | a.code, |
| | | a.name, |
| | | b.name as partnerName, |
| | | a.site_type as siteType, |
| | | a.business_category as businessCategory, |
| | | a.status, |
| | | CONCAT(a.province, a.city, a.districts, a.address) as address, |
| | | a.phone, |
| | | a.service_phone as servicePhone, |
| | | a.parking_space as parkingSpace, |
| | | DATE_FORMAT('%Y-%m-%d %H:%i:%s', a.establishment_time) as establishmentTime, |
| | | c.num as chargingPileNumber, |
| | | a.sort |
| | | 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) |
| | | WHERE a.del_flag = 0 |
| | | <if test="null != item.name and '' != item.name"> |
| | | and a.name like CONCAT('%', #{item.name}, '%') |
| | | </if> |
| | | <if test="null != item.partnerName and '' != item.partnerName"> |
| | | and b.name like CONCAT('%', #{item.partnerName}, '%') |
| | | </if> |
| | | <if test="null != item.siteType"> |
| | | and a.site_type = #{item.siteType} |
| | | </if> |
| | | <if test="null != item.businessCategory"> |
| | | and a.business_category = #{item.businessCategory} |
| | | </if> |
| | | <if test="null != item.status"> |
| | | and a.status = #{item.status} |
| | | </if> |
| | | <if test="null != item.provinceCode and '' != item.provinceCode"> |
| | | and a.province_code = #{item.provinceCode} |
| | | </if> |
| | | <if test="null != item.cityCode and '' != item.cityCode"> |
| | | and a.city_code = #{item.cityCode} |
| | | </if> |
| | | <if test="null != item.districtsCode and '' != item.districtsCode"> |
| | | and a.districts_code = #{item.districtsCode} |
| | | </if> |
| | | order by a.sort desc, a.create_time desc limit #{item.pageCurr}, #{item.pageSize} |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.chargingPile.mapper.TChargingPileNotificationMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.chargingPile.api.model.TChargingPileNotification"> |
| | | <id column="id" property="id" /> |
| | | <result column="site_id" property="siteId" /> |
| | | <result column="charging_pile_id" property="chargingPileId" /> |
| | | <result column="content" property="content" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, site_id, charging_pile_id, content, create_time, del_flag |
| | | </sql> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.chargingPile.mapper.TFaultMessageMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.chargingPile.api.model.TFaultMessage"> |
| | | <id column="id" property="id" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="site_id" property="siteId" /> |
| | | <result column="charging_pile_id" property="chargingPileId" /> |
| | | <result column="status" property="status" /> |
| | | <result column="down_time" property="downTime" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, app_user_id, site_id, charging_pile_id, status, down_time, create_time, del_flag |
| | | </sql> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.chargingPile.mapper.TParkingRecordMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.chargingPile.api.model.TParkingRecord"> |
| | | <id column="id" property="id" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="license_plate" property="licensePlate" /> |
| | | <result column="vehicle_color" property="vehicleColor" /> |
| | | <result column="charging_order_id" property="chargingOrderId" /> |
| | | <result column="parking_lot_id" property="parkingLotId" /> |
| | | <result column="in_parking_time" property="inParkingTime" /> |
| | | <result column="out_parking_time" property="outParkingTime" /> |
| | | <result column="parking_duration" property="parkingDuration" /> |
| | | <result column="order_amount" property="orderAmount" /> |
| | | <result column="status" property="status" /> |
| | | <result column="out_parking_type" property="outParkingType" /> |
| | | <result column="create_time" property="createTime" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <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 |
| | | </sql> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.chargingPile.mapper.TPartnerSiteMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.chargingPile.api.model.TPartnerSite"> |
| | | <id column="id" property="id" /> |
| | | <result column="site_id" property="siteId" /> |
| | | <result column="partner_id" property="partnerId" /> |
| | | <result column="site_menu_id" property="siteMenuId" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, site_id, partner_id, site_menu_id |
| | | </sql> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.chargingPile.mapper.TRepairMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.chargingPile.api.model.TRepair"> |
| | | <id column="id" property="id" /> |
| | | <result column="repairman" property="repairman" /> |
| | | <result column="site_id" property="siteId" /> |
| | | <result column="charging_pile_id" property="chargingPileId" /> |
| | | <result column="content" property="content" /> |
| | | <result column="repair_time" property="repairTime" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, repairman, site_id, charging_pile_id, content, repair_time, create_time, del_flag |
| | | </sql> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.chargingPile.mapper.TSiteMenuMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.chargingPile.api.model.TSiteMenu"> |
| | | <id column="menu_id" property="menuId" /> |
| | | <result column="menu_name" property="menuName" /> |
| | | <result column="parent_id" property="parentId" /> |
| | | <result column="order_num" property="orderNum" /> |
| | | <result column="path" property="path" /> |
| | | <result column="component" property="component" /> |
| | | <result column="query" property="query" /> |
| | | <result column="is_frame" property="isFrame" /> |
| | | <result column="is_cache" property="isCache" /> |
| | | <result column="menu_type" property="menuType" /> |
| | | <result column="visible" property="visible" /> |
| | | <result column="status" property="status" /> |
| | | <result column="perms" property="perms" /> |
| | | <result column="icon" property="icon" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="remark" property="remark" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | menu_id, menu_name, parent_id, order_num, `path`, component, query, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark |
| | | </sql> |
| | | |
| | | </mapper> |
| | |
| | | package com.ruoyi.order.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.api.model.TExchangeOrder; |
| | | import com.ruoyi.order.api.model.TShoppingOrder; |
| | | import com.ruoyi.order.service.TExchangeOrderService; |
| | | import com.ruoyi.order.service.TShoppingOrderService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.models.auth.In; |
| | | 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.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RestController |
| | | @RequestMapping("/t-exchange-order") |
| | | public class TExchangeOrderController { |
| | | @Autowired |
| | | private TShoppingOrderService tShoppingOrderService; |
| | | @Autowired |
| | | private TExchangeOrderService exchangeOrderService; |
| | | /** |
| | | * 管理后台 根据商品ids 查询对应的销量 |
| | | * @param goodsIds |
| | | * @return |
| | | */ |
| | | @PostMapping("/t-exchange-order/getSalesCountByGoodsIds") |
| | | public R<List<Integer>> getSalesCountByGoodsId(String goodsIds){ |
| | | String[] split = goodsIds.split("-"); |
| | | // 取出最后一位字符 类型1查询现金购买 类型2查询积分兑换 |
| | | String s = split[split.length - 1]; |
| | | List<Integer> res = new ArrayList<>(); |
| | | switch (Integer.parseInt(s)){ |
| | | case 1: |
| | | for (int i = 0; i < split.length-1; i++) { |
| | | |
| | | Integer reduce = tShoppingOrderService.list(new QueryWrapper<TShoppingOrder>() |
| | | .eq("goods_id", split[i]) |
| | | .eq("payment_status", 2) |
| | | .ne("refund_status", 2)) |
| | | .stream().map(TShoppingOrder::getPurchaseQuantity).reduce(0, Integer::sum); |
| | | |
| | | res.add(reduce); |
| | | } |
| | | break; |
| | | case 2: |
| | | for (int i = 0; i < split.length-1; i++) { |
| | | Integer reduce = exchangeOrderService.list(new QueryWrapper<TExchangeOrder>() |
| | | .eq("goods_id", split[i]) |
| | | ) |
| | | .stream().map(TExchangeOrder::getPurchaseQuantity).reduce(0, Integer::sum); |
| | | |
| | | res.add(reduce); |
| | | } |
| | | break; |
| | | } |
| | | |
| | | |
| | | return R.ok(res); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.other.api.domain.Region; |
| | | import com.ruoyi.other.service.IRegionService; |
| | | 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 java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/8 12:00 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/region") |
| | | public class RegionController { |
| | | |
| | | @Resource |
| | | private IRegionService regionService; |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/getRegion/{pid}") |
| | | @ApiOperation(value = "获取省市区数据", tags = {"管理后台-站点管理"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "父级id,没有传0", name = "pid", required = true) |
| | | }) |
| | | public AjaxResult<List<Region>> getRegion(@PathVariable Integer pid){ |
| | | List<Region> list = regionService.list(new LambdaQueryWrapper<Region>().eq(Region::getParentId, pid)); |
| | | return AjaxResult.success(list); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.core.enums.status.AdvertisingStatusEnum; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.other.api.domain.TAdvertising; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public AjaxResult<PageInfo<TAdvertising>> pageList(@RequestBody AdvertisingDTO dto) { |
| | | return AjaxResult.ok(advertisingService.pageList(dto)); |
| | | } |
| | | |
| | | @ApiOperation(tags = {"小程序-广告管理"},value = "广告列表查询") |
| | | @PostMapping(value = "/list") |
| | | public AjaxResult<List<TAdvertising>> list() { |
| | | return AjaxResult.ok(advertisingService.list(Wrappers.lambdaQuery(TAdvertising.class) |
| | | .eq(TAdvertising::getStatus, AdvertisingStatusEnum.YES.getCode()))); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.other.api.domain.TSystemConfiguration; |
| | | import com.ruoyi.other.service.TSystemConfigurationService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | |
| | | @RequestMapping("/t-system-configuration") |
| | | public class TSystemConfigurationController { |
| | | |
| | | private final TSystemConfigurationService systemConfigurationService; |
| | | |
| | | @Autowired |
| | | public TSystemConfigurationController(TSystemConfigurationService systemConfigurationService) { |
| | | this.systemConfigurationService = systemConfigurationService; |
| | | } |
| | | |
| | | /** |
| | | * 查看系统设置 |
| | | */ |
| | | @ApiOperation(tags = {"小程序-系统设置"},value = "联系客服") |
| | | @GetMapping(value = "/getDetailById") |
| | | public AjaxResult<TSystemConfiguration> getDetailById(@RequestParam(name = "type",value = "1=客服信息,2=系统设置") Integer type) { |
| | | return AjaxResult.ok(systemConfigurationService.getOne(Wrappers.lambdaQuery(TSystemConfiguration.class) |
| | | .eq(TSystemConfiguration::getType, type))); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.other.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.other.api.domain.Region; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/8 11:59 |
| | | */ |
| | | public interface RegionMapper extends BaseMapper<Region> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.other.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.other.api.domain.Region; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/8 11:59 |
| | | */ |
| | | public interface IRegionService extends IService<Region> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.other.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.other.api.domain.Region; |
| | | import com.ruoyi.other.mapper.RegionMapper; |
| | | import com.ruoyi.other.service.IRegionService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/8 11:59 |
| | | */ |
| | | @Service |
| | | public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> implements IRegionService { |
| | | } |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | // 去除最后一个字符 |
| | | stringBuilder.deleteCharAt(stringBuilder.length()-1); |
| | | } |
| | | if (list.isEmpty()) { |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | String string = stringBuilder.toString(); |
| | | List<Integer> data = orderClient.getSalesCountByGoodsId(string).getData(); |
| | | String res = string+"-"+dto.getType(); |
| | | |
| | | // goodsClient |
| | | // 远程调用cha'xun |
| | | List<Integer> data = orderClient.getSalesCountByGoodsId(res).getData(); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | list.get(i).setSalesCount(data.get(i)); |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |