Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile
New file |
| | |
| | | package com.ruoyi.account.api.dto; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class TagListQueryDto extends BasePage { |
| | | String tagName; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | 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; |
| | |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_app_coupon") |
| | | @ApiModel(value="TAppCoupon对象", description="") |
| | | public class TAppCoupon implements Serializable { |
| | | public class TAppCoupon extends BasePojo { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "删除(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | 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; |
| | |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_app_user") |
| | | @ApiModel(value="TAppUser对象", description="") |
| | | public class TAppUser implements Serializable { |
| | | public class TAppUser extends BasePojo { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "删除(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "最后一次登录时间") |
| | | @TableField("last_login_time") |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | 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; |
| | |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_app_user_address") |
| | | @ApiModel(value="TAppUserAddress对象", description="") |
| | | public class TAppUserAddress implements Serializable { |
| | | public class TAppUserAddress extends BasePojo { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | @TableField("default_address") |
| | | private Integer defaultAddress; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "删除(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | 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; |
| | |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_app_user_car") |
| | | @ApiModel(value="TAppUserCar对象", description="") |
| | | public class TAppUserCar implements Serializable { |
| | | public class TAppUserCar extends BasePojo { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | @TableField("endurance") |
| | | private String endurance; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "删除(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | |
| | | } |
| | |
| | | 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 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; |
| | |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_app_user_sign") |
| | | @ApiModel(value="TAppUserSign对象", description="") |
| | | public class TAppUserSign implements Serializable { |
| | | public class TAppUserSign extends BasePojo { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | 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; |
| | |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_app_user_tag") |
| | | @ApiModel(value="TAppUserTag对象", description="") |
| | | public class TAppUserTag implements Serializable { |
| | | public class TAppUserTag implements Serializable{ |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | 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 com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | 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; |
| | |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_invoice_information") |
| | | @ApiModel(value="TInvoiceInformation对象", description="") |
| | | public class TInvoiceInformation implements Serializable { |
| | | public class TInvoiceInformation extends BasePojo { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | // @TableField("default") |
| | | // private Integer default; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "删除(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | |
| | | } |
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.account.api.mapper.TAppCouponMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.account.api.model.TAppCoupon"> |
| | | <id column="id" property="id" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="coupon_id" property="couponId" /> |
| | | <result column="end_time" property="endTime" /> |
| | | <result column="ways_to_obtain" property="waysToObtain" /> |
| | | <result column="redeem_points" property="redeemPoints" /> |
| | | <result column="payment_amount" property="paymentAmount" /> |
| | | <result column="payment_type" property="paymentType" /> |
| | | <result column="serial_number" property="serialNumber" /> |
| | | <result column="payment_time" property="paymentTime" /> |
| | | <result column="status" property="status" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, app_user_id, coupon_id, end_time, ways_to_obtain, redeem_points, payment_amount, payment_type, serial_number, payment_time, status, 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.account.api.mapper.TAppUserAddressMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.account.api.model.TAppUserAddress"> |
| | | <id column="id" property="id" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="name" property="name" /> |
| | | <result column="phone" property="phone" /> |
| | | <result column="city" property="city" /> |
| | | <result column="city_code" property="cityCode" /> |
| | | <result column="address" property="address" /> |
| | | <result column="lon" property="lon" /> |
| | | <result column="lat" property="lat" /> |
| | | <result column="default_address" property="defaultAddress" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, app_user_id, name, phone, city, city_code, address, lon, lat, default_address, 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.account.api.mapper.TAppUserCarMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.account.api.model.TAppUserCar"> |
| | | <id column="id" property="id" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="license_plate" property="licensePlate" /> |
| | | <result column="vehicle_brand" property="vehicleBrand" /> |
| | | <result column="vehicle_model" property="vehicleModel" /> |
| | | <result column="vehicle_use" property="vehicleUse" /> |
| | | <result column="endurance" property="endurance" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, app_user_id, license_plate, vehicle_brand, vehicle_model, vehicle_use, endurance, 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.account.api.mapper.TAppUserIntegralChangeMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.account.api.model.TAppUserIntegralChange"> |
| | | <id column="id" property="id" /> |
| | | <result column="code" property="code" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="change_type" property="changeType" /> |
| | | <result column="historical_integral" property="historicalIntegral" /> |
| | | <result column="current_integral" property="currentIntegral" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="extension" property="extension" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, code, app_user_id, change_type, historical_integral, current_integral, create_time, extension |
| | | </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.account.api.mapper.TAppUserMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.account.api.model.TAppUser"> |
| | | <id column="id" property="id" /> |
| | | <result column="name" property="name" /> |
| | | <result column="phone" property="phone" /> |
| | | <result column="avatar" property="avatar" /> |
| | | <result column="vip_id" property="vipId" /> |
| | | <result column="vip_end_time" property="vipEndTime" /> |
| | | <result column="company_id" property="companyId" /> |
| | | <result column="id_card" property="idCard" /> |
| | | <result column="auth_status" property="authStatus" /> |
| | | <result column="wx_openid" property="wxOpenid" /> |
| | | <result column="ali_openid" property="aliOpenid" /> |
| | | <result column="points" property="points" /> |
| | | <result column="province" property="province" /> |
| | | <result column="province_code" property="provinceCode" /> |
| | | <result column="city" property="city" /> |
| | | <result column="city_code" property="cityCode" /> |
| | | <result column="status" property="status" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="last_login_time" property="lastLoginTime" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, name, phone, avatar, vip_id, vip_end_time, company_id, id_card, auth_status, wx_openid, ali_openid, points, province, province_code, city, city_code, status, create_time, del_flag, last_login_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.account.api.mapper.TAppUserSignMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.account.api.model.TAppUserSign"> |
| | | <id column="id" property="id" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="sign_day" property="signDay" /> |
| | | <result column="reward_points" property="rewardPoints" /> |
| | | <result column="create_time" property="createTime" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, app_user_id, sign_day, reward_points, 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.account.api.mapper.TAppUserTagMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.account.api.model.TAppUserTag"> |
| | | <id column="id" property="id" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="user_tag_id" property="userTagId" /> |
| | | <result column="create_time" property="createTime" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, app_user_id, user_tag_id, 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.account.api.mapper.TInviteUserMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.account.api.model.TInviteUser"> |
| | | <id column="id" property="id" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="be_invited_app_user_id" property="beInvitedAppUserId" /> |
| | | <result column="award" property="award" /> |
| | | <result column="create_time" property="createTime" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, app_user_id, be_invited_app_user_id, award, 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.account.api.mapper.TInvoiceInformationMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.account.api.model.TInvoiceInformation"> |
| | | <id column="id" property="id" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="invoice_type" property="invoiceType" /> |
| | | <result column="invoicing_object_type" property="invoicingObjectType" /> |
| | | <result column="name" property="name" /> |
| | | <result column="tax_identification_number" property="taxIdentificationNumber" /> |
| | | <result column="company_address" property="companyAddress" /> |
| | | <result column="company_phone" property="companyPhone" /> |
| | | <result column="deposit_bank" property="depositBank" /> |
| | | <result column="bank_account" property="bankAccount" /> |
| | | <result column="default" property="default" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, app_user_id, invoice_type, invoicing_object_type, name, tax_identification_number, company_address, company_phone, deposit_bank, bank_account, default, create_time, del_flag |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.common.core.web.domain.BasePojo; |
| | | 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) |
| | | private Integer id; |
| | | /** |
| | | * 合作商id |
| | | */ |
| | | @TableField("partner_id") |
| | | private Integer partnerId; |
| | | /** |
| | | * 站点编号 |
| | | */ |
| | | @TableField("code") |
| | | private String code; |
| | | /** |
| | | * 站点名称 |
| | | */ |
| | | @TableField("name") |
| | | private String name; |
| | | /** |
| | | * 站点类型(0=其他,1=公共,2=个人,3=公交(专业),4=环卫(专用),5=物流(专用),6=出租车(专用)) |
| | | */ |
| | | @TableField("site_type") |
| | | private Integer siteType; |
| | | /** |
| | | * 经营类型(1=直营,2=非直营) |
| | | */ |
| | | @TableField("business_category") |
| | | private Integer businessCategory; |
| | | /** |
| | | * 站点状态(1=正常使用,2=维修中,3=关闭下线) |
| | | */ |
| | | @TableField("status") |
| | | private Integer status; |
| | | /** |
| | | * 建设场所(0=其他,1=居民区,2=公共机构,3=企事业单位,4=写字楼,5=工业园区,6=交通枢纽,7=大型文体设施,8=城市绿地,9=大型建筑配建停车场,10=路边停车位,11=城际高速服务区) |
| | | */ |
| | | @TableField("construction_site") |
| | | private Integer constructionSite; |
| | | /** |
| | | * 站点环境图 |
| | | */ |
| | | @TableField("img_url") |
| | | private String imgUrl; |
| | | /** |
| | | * 省名称 |
| | | */ |
| | | @TableField("province") |
| | | private String province; |
| | | /** |
| | | * 省区划代码 |
| | | */ |
| | | @TableField("province_code") |
| | | private String provinceCode; |
| | | /** |
| | | * 市名称 |
| | | */ |
| | | @TableField("city") |
| | | private String city; |
| | | /** |
| | | * 市区划代码 |
| | | */ |
| | | @TableField("city_code") |
| | | private String cityCode; |
| | | /** |
| | | * 区县名称 |
| | | */ |
| | | @TableField("districts") |
| | | private String districts; |
| | | /** |
| | | * 区县区划代码 |
| | | */ |
| | | @TableField("districts_code") |
| | | private String districtsCode; |
| | | /** |
| | | * 经度 |
| | | */ |
| | | @TableField("lon") |
| | | private String lon; |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | @TableField("lat") |
| | | private String lat; |
| | | /** |
| | | * 详细地址 |
| | | */ |
| | | @TableField("address") |
| | | private String address; |
| | | /** |
| | | * 国家代码 |
| | | */ |
| | | @TableField("country_code") |
| | | private String countryCode; |
| | | /** |
| | | * 站点电话 |
| | | */ |
| | | @TableField("phone") |
| | | private String phone; |
| | | /** |
| | | * 服务电话 |
| | | */ |
| | | @TableField("service_phone") |
| | | private String servicePhone; |
| | | /** |
| | | * 站点引导 |
| | | */ |
| | | @TableField("guide") |
| | | private String guide; |
| | | /** |
| | | * 开始服务时间 |
| | | */ |
| | | @TableField("start_service_time") |
| | | private String startServiceTime; |
| | | /** |
| | | * 结束服务时间 |
| | | */ |
| | | @TableField("end_service_time") |
| | | private String endServiceTime; |
| | | /** |
| | | * 站内提供服务 |
| | | */ |
| | | @TableField("service_description") |
| | | private String serviceDescription; |
| | | /** |
| | | * 车型描述 |
| | | */ |
| | | @TableField("vehicle_description") |
| | | private String vehicleDescription; |
| | | /** |
| | | * 车位数 |
| | | */ |
| | | @TableField("parking_space") |
| | | private Integer parkingSpace; |
| | | /** |
| | | * 充电费率描述 |
| | | */ |
| | | @TableField("rate_description") |
| | | private String rateDescription; |
| | | /** |
| | | * 超时占位费说明 |
| | | */ |
| | | @TableField("space_charge_explain") |
| | | private String spaceChargeExplain; |
| | | /** |
| | | * 计费策略id |
| | | */ |
| | | @TableField("accounting_strategy_id") |
| | | private Integer accountingStrategyId; |
| | | /** |
| | | * 建站时间 |
| | | */ |
| | | @TableField("establishment_time") |
| | | private LocalDate establishmentTime; |
| | | /** |
| | | * 排序 |
| | | */ |
| | | @TableField("sort") |
| | | private Integer sort; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @TableField("remark") |
| | | private String remark; |
| | | /** |
| | | * 评分 |
| | | */ |
| | | @TableField("mark") |
| | | private Integer mark; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | 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.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-07 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_apply_charging_pile") |
| | | @ApiModel(value="TApplyChargingPile对象", description="") |
| | | public class TApplyChargingPile 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 = "用电地址") |
| | | @TableField("address") |
| | | private String address; |
| | | |
| | | @ApiModelProperty(value = "申请容量") |
| | | @TableField("capacity") |
| | | private BigDecimal capacity; |
| | | |
| | | @ApiModelProperty(value = "用电时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @TableField("consumption_time") |
| | | private LocalDate consumptionTime; |
| | | |
| | | @ApiModelProperty(value = "户主经办(0=关,1=开)") |
| | | @TableField("landlord_handling") |
| | | private Integer landlordHandling; |
| | | |
| | | @ApiModelProperty(value = "户名") |
| | | @TableField("landlord_name") |
| | | private String landlordName; |
| | | |
| | | @ApiModelProperty(value = "户主身份证号码") |
| | | @TableField("landlord_id_card") |
| | | private String landlordIdCard; |
| | | |
| | | @ApiModelProperty(value = "户主手机号") |
| | | @TableField("landlord_phone") |
| | | private String landlordPhone; |
| | | |
| | | @ApiModelProperty(value = "户主身份证正面") |
| | | @TableField("landlord_front_id_card") |
| | | private String landlordFrontIdCard; |
| | | |
| | | @ApiModelProperty(value = "户主身份证反面") |
| | | @TableField("landlord_back_id_card") |
| | | private String landlordBackIdCard; |
| | | |
| | | @ApiModelProperty(value = "产权证明") |
| | | @TableField("title_certificate") |
| | | private String titleCertificate; |
| | | |
| | | @ApiModelProperty(value = "营业执照") |
| | | @TableField("business_license") |
| | | private String businessLicense; |
| | | |
| | | @ApiModelProperty(value = "充电桩用户(0=关,1=开)") |
| | | @TableField("charging_pile_user") |
| | | private Integer chargingPileUser; |
| | | |
| | | @ApiModelProperty(value = "固定车位产权") |
| | | @TableField("fixed_parking_property_rights") |
| | | private String fixedParkingPropertyRights; |
| | | |
| | | @ApiModelProperty(value = "施工证明") |
| | | @TableField("construction_certificate") |
| | | private String constructionCertificate; |
| | | |
| | | @ApiModelProperty(value = "经办人姓名") |
| | | @TableField("agent_name") |
| | | private String agentName; |
| | | |
| | | @ApiModelProperty(value = "经办人身份证号") |
| | | @TableField("agent_id_card") |
| | | private String agentIdCard; |
| | | |
| | | @ApiModelProperty(value = "经办人手机号") |
| | | @TableField("agent_phone") |
| | | private String agentPhone; |
| | | |
| | | @ApiModelProperty(value = "经办人身份证正面") |
| | | @TableField("agent_front_id_card") |
| | | private String agentFrontIdCard; |
| | | |
| | | @ApiModelProperty(value = "经办人身份证背面") |
| | | @TableField("agent_back_id_card") |
| | | private String agentBackIdCard; |
| | | |
| | | @ApiModelProperty(value = "是否有充电桩(0=否,1=是)") |
| | | @TableField("charging_pile") |
| | | private Integer chargingPile; |
| | | |
| | | @ApiModelProperty(value = "补充资料") |
| | | @TableField("further_information") |
| | | private String furtherInformation; |
| | | |
| | | @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; |
| | | } |
| | |
| | | @TableField("img_url") |
| | | private String imgUrl; |
| | | |
| | | @ApiModelProperty(value = "申诉状态 (1=待处理,2=已处理)") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "申诉反馈") |
| | | @TableField("feedback") |
| | | private String feedback; |
New file |
| | |
| | | package com.ruoyi.order.api.query; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "TOrderAppealQuery对象", description = "订单申诉查询条件") |
| | | public class TOrderAppealQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | private Long appUserId; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.vo; |
| | | |
| | | import com.ruoyi.order.api.model.*; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "TOrderAppealVO对象", description = "订单申诉VO对象") |
| | | public class TOrderAppealVO extends TOrderAppeal { |
| | | |
| | | @ApiModelProperty(value = "充电订单") |
| | | private TChargingOrder chargingOrder; |
| | | |
| | | @ApiModelProperty(value = "购物订单") |
| | | private TShoppingOrder shoppingOrder; |
| | | |
| | | @ApiModelProperty(value = "兑换订单") |
| | | private TExchangeOrder exchangeOrder; |
| | | |
| | | @ApiModelProperty(value = "会员订单") |
| | | private TVipOrder vipOrder; |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "到达人数") |
| | | @TableField(exist = false) |
| | | private Long count; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.ruoyi.other.api.factory; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.api.dto.TagListQueryDto; |
| | | import com.ruoyi.account.api.dto.UnitListQueryDto; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.TCompany; |
| | | import com.ruoyi.other.api.domain.TUserTag; |
| | | import com.ruoyi.other.api.feignClient.GoodsClient; |
| | | import com.ruoyi.other.api.feignClient.OtherClient; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | public R unitDelete(Integer id) { |
| | | return R.fail("删除单位失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Page<TUserTag>> queryTagPage(TagListQueryDto unitListQueryDto) { |
| | | return R.fail("查询标签:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R addorUpdateTag(TUserTag tUserTag) { |
| | | return R.fail("添加标签:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R deleteTag(Integer id) { |
| | | return R.fail("查询标签:" + throwable.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.other.api.feignClient; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.api.dto.TagListQueryDto; |
| | | import com.ruoyi.account.api.dto.UnitListQueryDto; |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.TCompany; |
| | | import com.ruoyi.other.api.domain.TUserTag; |
| | | import com.ruoyi.other.api.factory.GoodsFallbackFactory; |
| | | import com.ruoyi.other.api.factory.OtherFallbackFactory; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | */ |
| | | @FeignClient(contextId = "UnitClient", value = ServiceNameConstants.CONTRACT_SERVICE, fallbackFactory = OtherFallbackFactory.class) |
| | | public interface OtherClient { |
| | | |
| | | //单位分页 |
| | | @PostMapping(value = "/t-company/unit/page") |
| | | R<Page<TCompany>> queryUnitPage(@RequestBody UnitListQueryDto unitListQueryDto); |
| | | |
| | | //单位添加修改 |
| | | @PostMapping(value = "/t-company/unit/addOrUpdate") |
| | | R unitAddorUpadate(@RequestBody TCompany tCompany); |
| | | //单位删除 |
| | | @PostMapping(value = "/t-company/unit/delete") |
| | | R unitDelete(@RequestParam Integer id); |
| | | |
| | | |
| | | //标签分页 |
| | | @PostMapping(value = "/t-user-tag/page") |
| | | R<Page<TUserTag>> queryTagPage(@RequestBody TagListQueryDto unitListQueryDto); |
| | | |
| | | //用户新增标签 |
| | | @PostMapping(value = "/t-user-tag/addorUpdateTag") |
| | | R addorUpdateTag(@RequestBody TUserTag tUserTag); |
| | | @PostMapping(value = "/t-user-tag/delete") |
| | | R deleteTag(@RequestParam Integer id); |
| | | } |
| | |
| | | |
| | | /** 用户头像 */ |
| | | 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"; |
| | | |
| | | } |
| | |
| | | { |
| | | 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)); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "用户列表", tags = {"用户管理-用户管理"}) |
| | | @PostMapping(value = "/user/page") |
| | | public R<Page<TCompany>> userPage(@RequestBody UnitListQueryDto unitListQueryDto) { |
| | | |
| | | //拿到标签tag |
| | | |
| | | //拿到会员map |
| | | |
| | | //列表查询 |
| | | |
| | | |
| | | |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.api.dto.TagListQueryDto; |
| | | import com.ruoyi.account.api.dto.UnitListQueryDto; |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | import com.ruoyi.account.api.model.TAppUserTag; |
| | | import com.ruoyi.account.service.TAppUserTagService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.TCompany; |
| | | import com.ruoyi.other.api.domain.TUserTag; |
| | | import com.ruoyi.other.api.feignClient.OtherClient; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RestController |
| | | @RequestMapping("/t-app-user-tag") |
| | | public class TAppUserTagController { |
| | | @Resource |
| | | private OtherClient otherClient; |
| | | @Resource |
| | | private TAppUserTagService appUserTagService; |
| | | |
| | | @ApiOperation(value = "标签管理列表", tags = {"用户管理-用户标签管理"}) |
| | | @PostMapping(value = "/tags/page") |
| | | public R<Page<TUserTag>> tagPage(@RequestBody TagListQueryDto tagListQueryDto) { |
| | | //拿到单位列表 |
| | | R<Page<TUserTag>> pageR = otherClient.queryTagPage(tagListQueryDto); |
| | | Page<TUserTag> data = pageR.getData(); |
| | | //拿到单位的用户数 |
| | | for (TUserTag record : data.getRecords()) { |
| | | record.setCount(appUserTagService.lambdaQuery().eq(TAppUserTag::getUserTagId, record.getId()).count()); |
| | | } |
| | | return R.ok(data); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "标签添加或修改", tags = {"用户管理-用户标签管理"}) |
| | | @PostMapping(value = "/tags/add") |
| | | public R<Page<TUserTag>> tagAdd(@RequestBody TUserTag tUserTag) { |
| | | //拿到单位列表 |
| | | otherClient.addorUpdateTag(tUserTag); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "标签删除", tags = {"用户管理-用户标签管理"}) |
| | | @PostMapping(value = "/tags/delete/{id}") |
| | | public R delete(@PathVariable Integer id) { |
| | | //拿到单位列表 |
| | | otherClient.deleteTag(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | */ |
| | | 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.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; |
| | | |
| | | /** |
| | | * @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); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.controller; |
| | | |
| | | import com.ruoyi.chargingPile.service.ISiteService; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/7 19:56 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/site") |
| | | public class SiteController { |
| | | |
| | | @Resource |
| | | private ISiteService siteService; |
| | | |
| | | |
| | | |
| | | public AjaxResult<> getSiteList(){ |
| | | |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 查询计费策略列表 |
| | | */ |
| | | @ApiOperation(value = "查询计费策略分页列表") |
| | | @ApiOperation(tags = {"后台-计费策略"},value = "查询计费策略分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public AjaxResult<PageInfo<TAccountingStrategyVO>> pageList(@RequestBody TAccountingStrategyQuery query) { |
| | | return AjaxResult.ok(accountingStrategyService.pageList(query)); |
| | |
| | | /** |
| | | * 查询计费策略明细列表 |
| | | */ |
| | | @ApiOperation(value = "查询计费策略明细列表") |
| | | @ApiOperation(tags = {"后台-计费策略"},value = "查询计费策略明细列表") |
| | | @GetMapping(value = "/queryAccountingStrategyDetailByStrategyId") |
| | | public AjaxResult<List<TAccountingStrategyDetailVO>> queryAccountingStrategyDetailByStrategyId(@RequestParam Integer strategyId) { |
| | | List<TAccountingStrategyDetailVO> list = accountingStrategyDetailService.queryAccountingStrategyDetailByStrategyId(strategyId); |
| | |
| | | /** |
| | | * 添加计费策略管理 |
| | | */ |
| | | @ApiOperation(value = "添加计费策略") |
| | | @ApiOperation(tags = {"后台-计费策略"},value = "添加计费策略") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@RequestBody TAccountingStrategyDTO dto) { |
| | | accountingStrategyService.save(dto); |
| | |
| | | /** |
| | | * 修改计费策略 |
| | | */ |
| | | @ApiOperation(value = "修改计费策略") |
| | | @ApiOperation(tags = {"后台-计费策略"},value = "修改计费策略") |
| | | @PostMapping(value = "/update") |
| | | public AjaxResult<Boolean> update(@RequestBody TAccountingStrategyDTO dto) { |
| | | // 删除计费策略明细信息 |
| | |
| | | /** |
| | | * 查看计费策略详情 |
| | | */ |
| | | @ApiOperation(value = "查看计费策略详情") |
| | | @ApiOperation(tags = {"后台-计费策略"},value = "查看计费策略详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public AjaxResult<TAccountingStrategy> getDetailById(@RequestParam Integer id) { |
| | | return AjaxResult.ok(accountingStrategyService.getById(id)); |
| | |
| | | /** |
| | | * 删除计费策略 |
| | | */ |
| | | @ApiOperation(value = "删除计费策略") |
| | | @ApiOperation(tags = {"后台-计费策略"},value = "删除计费策略") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public AjaxResult<Boolean> deleteById(@RequestParam Integer id) { |
| | | // 刪除计费策略明细信息 |
| | |
| | | /** |
| | | * 批量删除计费策略 |
| | | */ |
| | | @ApiOperation(value = "批量删除计费策略") |
| | | @ApiOperation(tags = {"后台-计费策略"},value = "批量删除计费策略") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public AjaxResult<Boolean> deleteByIds(@RequestBody List<Integer> ids) { |
| | | // 刪除计费策略明细信息 |
New file |
| | |
| | | package com.ruoyi.chargingPile.controller; |
| | | |
| | | |
| | | import com.ruoyi.chargingPile.api.model.TApplyChargingPile; |
| | | import com.ruoyi.chargingPile.api.model.TCarport; |
| | | import com.ruoyi.chargingPile.api.vo.TCarportVO; |
| | | import com.ruoyi.chargingPile.service.TApplyChargingPileService; |
| | | import com.ruoyi.chargingPile.service.TCarportService; |
| | | import com.ruoyi.chargingPile.service.TVehicleRampService; |
| | | 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> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-07 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/t-apply-charging-pile") |
| | | public class TApplyChargingPileController { |
| | | |
| | | private final TApplyChargingPileService applyChargingPileService; |
| | | |
| | | @Autowired |
| | | public TApplyChargingPileController(TApplyChargingPileService applyChargingPileService) { |
| | | this.applyChargingPileService = applyChargingPileService; |
| | | } |
| | | |
| | | /** |
| | | * 建桩申请 |
| | | */ |
| | | @ApiOperation(tags = {"小程序-建桩申请"},value = "建桩申请") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@RequestBody TApplyChargingPile dto) { |
| | | // TODO 用户id |
| | | dto.setAppUserId(null); |
| | | return AjaxResult.ok(applyChargingPileService.save(dto)); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | /** |
| | | * 通过停车场id查询车库及车道信息 |
| | | */ |
| | | @ApiOperation(value = "通过停车场id查询车库及车道信息") |
| | | @ApiOperation(tags = {"后台-车库"},value = "通过停车场id查询车库及车道信息") |
| | | @GetMapping(value = "/queryCarportByParkId") |
| | | public AjaxResult<List<TCarportVO>> queryCarportByParkId(@RequestParam(value = "parkingLotId", required = true) Integer parkingLotId) { |
| | | return AjaxResult.ok(carportService.queryCarportByParkId(parkingLotId)); |
| | |
| | | /** |
| | | * 添加车库管理 |
| | | */ |
| | | @ApiOperation(value = "添加车库") |
| | | @ApiOperation(tags = {"后台-车库"},value = "添加车库") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@RequestBody TCarport dto) { |
| | | return AjaxResult.ok(carportService.save(dto)); |
| | |
| | | /** |
| | | * 修改车库 |
| | | */ |
| | | @ApiOperation(value = "修改车库") |
| | | @ApiOperation(tags = {"后台-车库"},value = "修改车库") |
| | | @PostMapping(value = "/update") |
| | | public AjaxResult<Boolean> update(@RequestBody TCarport dto) { |
| | | return AjaxResult.ok(carportService.updateById(dto)); |
| | |
| | | /** |
| | | * 查看车库详情 |
| | | */ |
| | | @ApiOperation(value = "查看车库详情") |
| | | @ApiOperation(tags = {"后台-车库"},value = "查看车库详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public AjaxResult<TCarport> getDetailById(@RequestParam Integer id) { |
| | | return AjaxResult.ok(carportService.getById(id)); |
| | |
| | | /** |
| | | * 删除车库 |
| | | */ |
| | | @ApiOperation(value = "删除车库") |
| | | @ApiOperation(tags = {"后台-车库"},value = "删除车库") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public AjaxResult<Boolean> deleteById(@RequestParam Integer id) { |
| | | // 刪除车道信息 |
| | |
| | | /** |
| | | * 批量删除车库 |
| | | */ |
| | | @ApiOperation(value = "批量删除车库") |
| | | @ApiOperation(tags = {"后台-车库"},value = "批量删除车库") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public AjaxResult<Boolean> deleteByIds(@RequestBody List<Integer> ids) { |
| | | // 刪除车道信息 |
| | |
| | | /** |
| | | * 查询充电枪列表 |
| | | */ |
| | | @ApiOperation(value = "查询充电枪分页列表") |
| | | @ApiOperation(tags = {"后台-充电枪"},value = "查询充电枪分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public AjaxResult<PageInfo<TChargingGunVO>> pageList(@RequestBody TChargingGunQuery query) { |
| | | return AjaxResult.ok(chargingGunService.pageList(query)); |
| | |
| | | /** |
| | | * 添加充电枪管理 |
| | | */ |
| | | @ApiOperation(value = "添加充电枪") |
| | | @ApiOperation(tags = {"后台-充电枪"},value = "添加充电枪") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@RequestBody TChargingGunDTO dto) { |
| | | return AjaxResult.ok(chargingGunService.save(dto)); |
| | |
| | | /** |
| | | * 修改充电枪 |
| | | */ |
| | | @ApiOperation(value = "修改充电枪") |
| | | @ApiOperation(tags = {"后台-充电枪"},value = "修改充电枪") |
| | | @PostMapping(value = "/update") |
| | | public AjaxResult<Boolean> update(@RequestBody TChargingGunDTO dto) { |
| | | return AjaxResult.ok(chargingGunService.updateById(dto)); |
| | |
| | | /** |
| | | * 查看充电枪详情 |
| | | */ |
| | | @ApiOperation(value = "查看充电枪详情") |
| | | @ApiOperation(tags = {"后台-充电枪"},value = "查看充电枪详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public AjaxResult<TChargingGun> getDetailById(@RequestParam Integer id) { |
| | | return AjaxResult.ok(chargingGunService.getById(id)); |
| | |
| | | /** |
| | | * 删除充电枪 |
| | | */ |
| | | @ApiOperation(value = "删除充电枪") |
| | | @ApiOperation(tags = {"后台-充电枪"},value = "删除充电枪") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public AjaxResult<Boolean> deleteById(@RequestParam Integer id) { |
| | | return AjaxResult.ok(chargingGunService.removeById(id)); |
| | |
| | | /** |
| | | * 批量删除充电枪 |
| | | */ |
| | | @ApiOperation(value = "批量删除充电枪") |
| | | @ApiOperation(tags = {"后台-充电枪"},value = "批量删除充电枪") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public AjaxResult<Boolean> deleteByIds(@RequestBody List<Integer> ids) { |
| | | return AjaxResult.ok(chargingGunService.removeByIds(ids)); |
| | |
| | | /** |
| | | * 结束充电 |
| | | */ |
| | | @ApiOperation(value = "结束充电") |
| | | @ApiOperation(tags = {"后台-充电枪"},value = "结束充电") |
| | | @PostMapping(value = "/stopCharging") |
| | | public AjaxResult<String> stopCharging() { |
| | | // TODO 硬件 结束充电 |
| | |
| | | /** |
| | | * 查询监控列表 |
| | | */ |
| | | @ApiOperation(value = "查询监控分页列表") |
| | | @ApiOperation(tags = {"后台-监控"},value = "查询监控分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public AjaxResult<PageInfo<TMonitoringEquipmentVO>> pageList(@RequestBody TMonitoringEquipmentQuery query) { |
| | | return AjaxResult.ok(monitoringEquipmentService.pageList(query)); |
| | |
| | | /** |
| | | * 添加监控管理 |
| | | */ |
| | | @ApiOperation(value = "添加监控") |
| | | @ApiOperation(tags = {"后台-监控"},value = "添加监控") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@RequestBody TMonitoringEquipmentDTO dto) { |
| | | return AjaxResult.ok(monitoringEquipmentService.save(dto)); |
| | |
| | | /** |
| | | * 修改监控 |
| | | */ |
| | | @ApiOperation(value = "修改监控") |
| | | @ApiOperation(tags = {"后台-监控"},value = "修改监控") |
| | | @PostMapping(value = "/update") |
| | | public AjaxResult<Boolean> update(@RequestBody TMonitoringEquipmentDTO dto) { |
| | | return AjaxResult.ok(monitoringEquipmentService.updateById(dto)); |
| | |
| | | /** |
| | | * 查看监控详情 |
| | | */ |
| | | @ApiOperation(value = "查看监控详情") |
| | | @ApiOperation(tags = {"后台-监控"},value = "查看监控详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public AjaxResult<TMonitoringEquipment> getDetailById(@RequestParam Integer id) { |
| | | return AjaxResult.ok(monitoringEquipmentService.getById(id)); |
| | |
| | | /** |
| | | * 删除监控 |
| | | */ |
| | | @ApiOperation(value = "删除监控") |
| | | @ApiOperation(tags = {"后台-监控"},value = "删除监控") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public AjaxResult<Boolean> deleteById(@RequestParam Integer id) { |
| | | return AjaxResult.ok(monitoringEquipmentService.removeById(id)); |
| | |
| | | /** |
| | | * 批量删除监控 |
| | | */ |
| | | @ApiOperation(value = "批量删除监控") |
| | | @ApiOperation(tags = {"后台-监控"},value = "批量删除监控") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public AjaxResult<Boolean> deleteByIds(@RequestBody List<Integer> ids) { |
| | | return AjaxResult.ok(monitoringEquipmentService.removeByIds(ids)); |
| | |
| | | /** |
| | | * 查询停车场列表 |
| | | */ |
| | | @ApiOperation(value = "查询停车场分页列表") |
| | | @ApiOperation(tags = {"后台-停车场"},value = "查询停车场分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public AjaxResult<PageInfo<TParkingLotVO>> pageList(@RequestBody TParkingLotQuery query) { |
| | | return AjaxResult.ok(parkingLotService.pageList(query)); |
| | |
| | | /** |
| | | * 查询停车场列表 |
| | | */ |
| | | @ApiOperation(value = "查询停车场列表") |
| | | @ApiOperation(tags = {"后台-停车场"},value = "查询停车场列表") |
| | | @PostMapping(value = "/list") |
| | | public AjaxResult<List<TParkingLot>> list(@RequestBody TParkingLotQuery query) { |
| | | return AjaxResult.ok(parkingLotService.list(Wrappers.lambdaQuery(TParkingLot.class) |
| | |
| | | /** |
| | | * 添加停车场管理 |
| | | */ |
| | | @ApiOperation(value = "添加停车场") |
| | | @ApiOperation(tags = {"后台-停车场"},value = "添加停车场") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@RequestBody TParkingLotDTO dto) { |
| | | return AjaxResult.ok(parkingLotService.save(dto)); |
| | |
| | | /** |
| | | * 修改停车场 |
| | | */ |
| | | @ApiOperation(value = "修改停车场") |
| | | @ApiOperation(tags = {"后台-停车场"},value = "修改停车场") |
| | | @PostMapping(value = "/update") |
| | | public AjaxResult<Boolean> update(@RequestBody TParkingLotDTO dto) { |
| | | return AjaxResult.ok(parkingLotService.updateById(dto)); |
| | |
| | | /** |
| | | * 查看停车场详情 |
| | | */ |
| | | @ApiOperation(value = "查看停车场详情") |
| | | @ApiOperation(tags = {"后台-停车场"},value = "查看停车场详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public AjaxResult<TParkingLot> getDetailById(@RequestParam Integer id) { |
| | | return AjaxResult.ok(parkingLotService.getById(id)); |
| | |
| | | /** |
| | | * 删除停车场 |
| | | */ |
| | | @ApiOperation(value = "删除停车场") |
| | | @ApiOperation(tags = {"后台-停车场"},value = "删除停车场") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public AjaxResult<Boolean> deleteById(@RequestParam Integer id) { |
| | | // 刪除车道信息 |
| | |
| | | /** |
| | | * 批量删除停车场 |
| | | */ |
| | | @ApiOperation(value = "批量删除停车场") |
| | | @ApiOperation(tags = {"后台-停车场"},value = "批量删除停车场") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public AjaxResult<Boolean> deleteByIds(@RequestBody List<Integer> ids) { |
| | | // 刪除车道信息 |
| | |
| | | /** |
| | | * 添加车道管理 |
| | | */ |
| | | @ApiOperation(value = "添加车道") |
| | | @ApiOperation(tags = {"后台-车道"},value = "添加车道") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@RequestBody TVehicleRamp dto) { |
| | | return AjaxResult.ok(vehicleRampService.save(dto)); |
| | |
| | | /** |
| | | * 修改车道 |
| | | */ |
| | | @ApiOperation(value = "修改车道") |
| | | @ApiOperation(tags = {"后台-车道"},value = "修改车道") |
| | | @PostMapping(value = "/update") |
| | | public AjaxResult<Boolean> update(@RequestBody TVehicleRamp dto) { |
| | | return AjaxResult.ok(vehicleRampService.updateById(dto)); |
| | |
| | | /** |
| | | * 查看车道详情 |
| | | */ |
| | | @ApiOperation(value = "查看车道详情") |
| | | @ApiOperation(tags = {"后台-车道"},value = "查看车道详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public AjaxResult<TVehicleRamp> getDetailById(@RequestParam Integer id) { |
| | | return AjaxResult.ok(vehicleRampService.getById(id)); |
| | |
| | | /** |
| | | * 删除车道 |
| | | */ |
| | | @ApiOperation(value = "删除车道") |
| | | @ApiOperation(tags = {"后台-车道"},value = "删除车道") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public AjaxResult<Boolean> deleteById(@RequestParam Integer id) { |
| | | return AjaxResult.ok(vehicleRampService.removeById(id)); |
| | |
| | | /** |
| | | * 批量删除车道 |
| | | */ |
| | | @ApiOperation(value = "批量删除车道") |
| | | @ApiOperation(tags = {"后台-车道"},value = "批量删除车道") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public AjaxResult<Boolean> deleteByIds(@RequestBody List<Integer> ids) { |
| | | return AjaxResult.ok(vehicleRampService.removeByIds(ids)); |
| | |
| | | /** |
| | | * 开关闸车道 |
| | | */ |
| | | @ApiOperation(value = "开关闸车道") |
| | | @ApiOperation(tags = {"后台-车道"},value = "开关闸车道") |
| | | @PostMapping(value = "/openOrDown") |
| | | public AjaxResult<String> openOrDown(@RequestBody TVehicleRamp dto) { |
| | | // TODO 硬件 开关闸车道 |
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.model.Site; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/7 19:49 |
| | | */ |
| | | public interface SiteMapper extends BaseMapper<Site> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.chargingPile.api.model.TApplyChargingPile; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-07 |
| | | */ |
| | | public interface TApplyChargingPileMapper extends BaseMapper<TApplyChargingPile> { |
| | | |
| | | } |
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.model.Site; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/7 19:54 |
| | | */ |
| | | public interface ISiteService extends IService<Site> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.chargingPile.api.model.TApplyChargingPile; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-07 |
| | | */ |
| | | public interface TApplyChargingPileService extends IService<TApplyChargingPile> { |
| | | |
| | | } |
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.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.mapper.SiteMapper; |
| | | import com.ruoyi.chargingPile.service.ISiteService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/7 19:54 |
| | | */ |
| | | @Service |
| | | public class SiteServiceImpl extends ServiceImpl<SiteMapper, Site> implements ISiteService { |
| | | } |
New file |
| | |
| | | package com.ruoyi.chargingPile.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.chargingPile.api.model.TApplyChargingPile; |
| | | import com.ruoyi.chargingPile.mapper.TApplyChargingPileMapper; |
| | | import com.ruoyi.chargingPile.service.TApplyChargingPileService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-08-07 |
| | | */ |
| | | @Service |
| | | public class TApplyChargingPileServiceImpl extends ServiceImpl<TApplyChargingPileMapper, TApplyChargingPile> implements TApplyChargingPileService { |
| | | |
| | | } |
| | |
| | | # 共享配置 |
| | | 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> |
| | | |
| | | </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.TApplyChargingPileMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.chargingPile.api.model.TApplyChargingPile"> |
| | | <id column="id" property="id" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="address" property="address" /> |
| | | <result column="capacity" property="capacity" /> |
| | | <result column="consumption_time" property="consumptionTime" /> |
| | | <result column="landlord_handling" property="landlordHandling" /> |
| | | <result column="landlord_name" property="landlordName" /> |
| | | <result column="landlord_id_card" property="landlordIdCard" /> |
| | | <result column="landlord_phone" property="landlordPhone" /> |
| | | <result column="landlord_front_id_card" property="landlordFrontIdCard" /> |
| | | <result column="landlord_back_id_card" property="landlordBackIdCard" /> |
| | | <result column="title_certificate" property="titleCertificate" /> |
| | | <result column="business_license" property="businessLicense" /> |
| | | <result column="charging_pile_user" property="chargingPileUser" /> |
| | | <result column="fixed_parking_property_rights" property="fixedParkingPropertyRights" /> |
| | | <result column="construction_certificate" property="constructionCertificate" /> |
| | | <result column="agent_name" property="agentName" /> |
| | | <result column="agent_id_card" property="agentIdCard" /> |
| | | <result column="agent_phone" property="agentPhone" /> |
| | | <result column="agent_front_id_card" property="agentFrontIdCard" /> |
| | | <result column="agent_back_id_card" property="agentBackIdCard" /> |
| | | <result column="charging_pile" property="chargingPile" /> |
| | | <result column="further_information" property="furtherInformation" /> |
| | | <result column="remark" property="remark" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, app_user_id, address, capacity, consumption_time, landlord_handling, landlord_name, landlord_id_card, landlord_phone, landlord_front_id_card, landlord_back_id_card, title_certificate, business_license, charging_pile_user, fixed_parking_property_rights, construction_certificate, agent_name, agent_id_card, agent_phone, agent_front_id_card, agent_back_id_card, charging_pile, further_information, remark, create_time, del_flag |
| | | </sql> |
| | | |
| | | </mapper> |
| | |
| | | package com.ruoyi.order.controller; |
| | | |
| | | |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.api.query.TOrderAppealQuery; |
| | | import com.ruoyi.order.api.vo.TOrderAppealVO; |
| | | import com.ruoyi.order.service.TOrderAppealService; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2024-08-07 |
| | | */ |
| | | @Api(tags = "订单申诉") |
| | | @RestController |
| | | @RequestMapping("/t-order-appeal") |
| | | public class TOrderAppealController { |
| | | |
| | | private final TOrderAppealService orderAppealService; |
| | | private final TokenService tokenService; |
| | | |
| | | @Autowired |
| | | public TOrderAppealController(TOrderAppealService orderAppealService, TokenService tokenService) { |
| | | this.orderAppealService = orderAppealService; |
| | | this.tokenService = tokenService; |
| | | } |
| | | |
| | | /** |
| | | * 查询订单申诉列表 |
| | | */ |
| | | @ApiOperation(tags = {"小程序-订单申诉"},value = "查询订单申诉分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public AjaxResult<PageInfo<TOrderAppealVO>> pageList(@RequestBody TOrderAppealQuery query) { |
| | | // TODO 用户id 获取小程序当前登录用户id |
| | | Long userId = tokenService.getLoginUser().getUserid(); |
| | | query.setAppUserId(userId); |
| | | return AjaxResult.ok(orderAppealService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 查询订单申诉详情 |
| | | */ |
| | | @ApiOperation(tags = {"小程序-订单申诉"},value = "查询订单申诉详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public AjaxResult<TOrderAppealVO> getDetailById(@RequestParam Integer id) { |
| | | return AjaxResult.ok(orderAppealService.getDetailById(id)); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.order.api.model.TChargingOrderAccountingStrategy; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2024-08-07 |
| | | */ |
| | | @Mapper |
| | | public interface TChargingOrderAccountingStrategyMapper extends BaseMapper<TChargingOrderAccountingStrategy> { |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2024-08-07 |
| | | */ |
| | | @Mapper |
| | | public interface TChargingOrderMapper extends BaseMapper<TChargingOrder> { |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.order.api.model.TExchangeOrder; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2024-08-07 |
| | | */ |
| | | @Mapper |
| | | public interface TExchangeOrderMapper extends BaseMapper<TExchangeOrder> { |
| | | |
| | | } |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.order.api.model.TOrderAppeal; |
| | | import com.ruoyi.order.api.query.TOrderAppealQuery; |
| | | import com.ruoyi.order.api.vo.TOrderAppealVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TOrderAppealMapper extends BaseMapper<TOrderAppeal> { |
| | | |
| | | /** |
| | | * 查询订单申诉分页列表 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TOrderAppealVO> pageList(@Param("query") TOrderAppealQuery query, @Param("pageInfo")PageInfo<TOrderAppealVO> pageInfo); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.order.api.model.TOrderEvaluate; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2024-08-07 |
| | | */ |
| | | @Mapper |
| | | public interface TOrderEvaluateMapper extends BaseMapper<TOrderEvaluate> { |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.order.api.model.TOrderEvaluateTag; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2024-08-07 |
| | | */ |
| | | @Mapper |
| | | public interface TOrderEvaluateTagMapper extends BaseMapper<TOrderEvaluateTag> { |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.order.api.model.TOrderInvoiceDetail; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2024-08-07 |
| | | */ |
| | | @Mapper |
| | | public interface TOrderInvoiceDetailMapper extends BaseMapper<TOrderInvoiceDetail> { |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.order.api.model.TOrderInvoice; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2024-08-07 |
| | | */ |
| | | @Mapper |
| | | public interface TOrderInvoiceMapper extends BaseMapper<TOrderInvoice> { |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.order.api.model.TShoppingOrder; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2024-08-07 |
| | | */ |
| | | @Mapper |
| | | public interface TShoppingOrderMapper extends BaseMapper<TShoppingOrder> { |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.order.api.model.TVipOrder; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2024-08-07 |
| | | */ |
| | | @Mapper |
| | | public interface TVipOrderMapper extends BaseMapper<TVipOrder> { |
| | | |
| | | } |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.order.api.model.TOrderAppeal; |
| | | import com.ruoyi.order.api.query.TOrderAppealQuery; |
| | | import com.ruoyi.order.api.vo.TOrderAppealVO; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TOrderAppealService extends IService<TOrderAppeal> { |
| | | |
| | | /** |
| | | * 查询订单申诉分页列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<TOrderAppealVO> pageList(TOrderAppealQuery query); |
| | | |
| | | /** |
| | | * 查询订单申诉详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | TOrderAppealVO getDetailById(Integer id); |
| | | } |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.order.api.model.TOrderAppeal; |
| | | import com.ruoyi.order.mapper.TOrderAppealMapper; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.order.api.model.*; |
| | | import com.ruoyi.order.api.query.TOrderAppealQuery; |
| | | import com.ruoyi.order.api.vo.TOrderAppealVO; |
| | | import com.ruoyi.order.mapper.*; |
| | | import com.ruoyi.order.service.TChargingOrderService; |
| | | import com.ruoyi.order.service.TOrderAppealService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TOrderAppealServiceImpl extends ServiceImpl<TOrderAppealMapper, TOrderAppeal> implements TOrderAppealService { |
| | | |
| | | @Autowired |
| | | private TChargingOrderMapper chargingOrderMapper; |
| | | @Autowired |
| | | private TExchangeOrderMapper exchangeOrderMapper; |
| | | @Autowired |
| | | private TShoppingOrderMapper shoppingOrderMapper; |
| | | @Autowired |
| | | private TVipOrderMapper vipOrderMapper; |
| | | |
| | | @Override |
| | | public PageInfo<TOrderAppealVO> pageList(TOrderAppealQuery query) { |
| | | PageInfo<TOrderAppealVO> pageInfo = new PageInfo<>(query.getPageCurr(),query.getPageSize()); |
| | | List<TOrderAppealVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | List<Long> orderIds = list.stream().map(TOrderAppealVO::getOrderId).collect(Collectors.toList()); |
| | | // 查询当前页的订单 |
| | | List<TChargingOrder> chargingOrders = chargingOrderMapper.selectList(Wrappers.lambdaQuery(TChargingOrder.class) |
| | | .in(TChargingOrder::getId, orderIds)); |
| | | List<TExchangeOrder> exchangeOrders = exchangeOrderMapper.selectList(Wrappers.lambdaQuery(TExchangeOrder.class) |
| | | .in(TExchangeOrder::getId, orderIds)); |
| | | List<TShoppingOrder> shoppingOrders = shoppingOrderMapper.selectList(Wrappers.lambdaQuery(TShoppingOrder.class) |
| | | .in(TShoppingOrder::getId, orderIds)); |
| | | List<TVipOrder> vipOrders = vipOrderMapper.selectList(Wrappers.lambdaQuery(TVipOrder.class) |
| | | .in(TVipOrder::getId, orderIds)); |
| | | list.forEach(item -> { |
| | | if (item.getOrderType() == 1) { |
| | | item.setChargingOrder(chargingOrders.stream().filter(chargingOrder -> chargingOrder.getId().equals(item.getOrderId())).findFirst().orElse(null)); |
| | | } else if (item.getOrderType() == 2) { |
| | | item.setExchangeOrder(exchangeOrders.stream().filter(exchangeOrder -> exchangeOrder.getId().equals(item.getOrderId())).findFirst().orElse(null)); |
| | | }else if (item.getOrderType() == 3) { |
| | | item.setShoppingOrder(shoppingOrders.stream().filter(shoppingOrder -> shoppingOrder.getId().equals(item.getOrderId())).findFirst().orElse(null)); |
| | | }else if (item.getOrderType() == 4) { |
| | | item.setVipOrder(vipOrders.stream().filter(vipOrder -> vipOrder.getId().equals(item.getOrderId())).findFirst().orElse(null)); |
| | | } |
| | | }); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public TOrderAppealVO getDetailById(Integer id) { |
| | | TOrderAppeal orderAppeal = this.baseMapper.selectById(id); |
| | | TOrderAppealVO orderAppealVO = new TOrderAppealVO(); |
| | | BeanUtils.copyProperties(orderAppeal,orderAppealVO); |
| | | // 查询申诉详情 |
| | | if (orderAppeal.getOrderType() == 1) { |
| | | orderAppealVO.setChargingOrder(chargingOrderMapper.selectById(orderAppeal.getOrderId())); |
| | | } else if (orderAppeal.getOrderType() == 2) { |
| | | orderAppealVO.setExchangeOrder(exchangeOrderMapper.selectById(orderAppeal.getOrderId())); |
| | | }else if (orderAppeal.getOrderType() == 3) { |
| | | orderAppealVO.setShoppingOrder(shoppingOrderMapper.selectById(orderAppeal.getOrderId())); |
| | | }else if (orderAppeal.getOrderType() == 4) { |
| | | orderAppealVO.setVipOrder(vipOrderMapper.selectById(orderAppeal.getOrderId())); |
| | | } |
| | | return orderAppealVO; |
| | | } |
| | | } |
| | |
| | | <result column="reason" property="reason" /> |
| | | <result column="content" property="content" /> |
| | | <result column="img_url" property="imgUrl" /> |
| | | <result column="status" property="status" /> |
| | | <result column="feedback" property="feedback" /> |
| | | <result column="feedback_user_id" property="feedbackUserId" /> |
| | | <result column="feedback_time" property="feedbackTime" /> |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, order_type, order_id, app_user_id, reason, content, img_url, feedback, feedback_user_id, feedback_time, create_time, del_flag |
| | | id, order_type, order_id, app_user_id, reason, content, img_url, status,feedback, feedback_user_id, feedback_time, create_time, del_flag |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.order.api.vo.TOrderAppealVO"> |
| | | SELECT |
| | | <include refid="Base_Column_List"/> |
| | | FROM t_order_appeal |
| | | <where> |
| | | <if test="query.appUserId != null"> |
| | | AND app_user_id = #{query.appUserId} |
| | | </if> |
| | | AND del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY create_time DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.TEnterpriseUserApplication; |
| | | import com.ruoyi.other.service.TEnterpriseUserApplicationService; |
| | | import com.sun.xml.internal.bind.v2.TODO; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | @RequestMapping("/t-enterprise-user-application") |
| | | public class TEnterpriseUserApplicationController { |
| | | |
| | | private final TEnterpriseUserApplicationService enterpriseUserApplicationService; |
| | | |
| | | @Autowired |
| | | public TEnterpriseUserApplicationController(TEnterpriseUserApplicationService enterpriseUserApplicationService) { |
| | | this.enterpriseUserApplicationService = enterpriseUserApplicationService; |
| | | } |
| | | |
| | | /** |
| | | * 添加计费策略管理 |
| | | */ |
| | | @ApiOperation(tags = {"小程序-计费策略"},value = "添加集团用户申请") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@RequestBody TEnterpriseUserApplication dto) { |
| | | // TODO 用户id |
| | | return AjaxResult.ok(enterpriseUserApplicationService.save(dto)); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | 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))); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.api.dto.TagListQueryDto; |
| | | import com.ruoyi.account.api.dto.UnitListQueryDto; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.TCompany; |
| | | import com.ruoyi.other.api.domain.TUserTag; |
| | | import com.ruoyi.other.mapper.TUserTagMapper; |
| | | import com.ruoyi.other.service.TUserTagService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RestController |
| | | @RequestMapping("/t-user-tag") |
| | | public class TUserTagController { |
| | | @Resource |
| | | private TUserTagService tUserTagService; |
| | | |
| | | @PostMapping(value = "/page") |
| | | public R<Page<TUserTag>> page(@RequestBody TagListQueryDto tagListQueryDto) { |
| | | Page<TUserTag> page = tUserTagService.lambdaQuery() |
| | | .orderByDesc(TUserTag::getCreateTime) |
| | | .like(tagListQueryDto.getTagName()!=null&& tagListQueryDto.getTagName().isEmpty(), TUserTag::getName, tagListQueryDto.getTagName()) |
| | | .page(Page.of(tagListQueryDto.getPageCurr(), tagListQueryDto.getPageSize())); |
| | | return R.ok(page); |
| | | |
| | | } |
| | | |
| | | @PostMapping(value = "/addorUpdateTag") |
| | | public R addorUpdateTag(@RequestBody TUserTag tUserTag) { |
| | | tUserTag.setCreateTime(LocalDateTime.now()); |
| | | tUserTagService.saveOrUpdate(tUserTag); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping(value = "/delete") |
| | | public R delete(@RequestParam Integer id) { |
| | | tUserTagService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | } |
| | | |