Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile
# Conflicts:
# ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysMenuController.java
# ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java
# ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/PartnerController.java
# ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingGunController.java
# ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TFaultMessageServiceImpl.java
# ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TRepairServiceImpl.java
# ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderEvaluateServiceImpl.java
New file |
| | |
| | | package com.ruoyi.chargingPile.api.domain; |
| | | |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/9 15:28 |
| | | */ |
| | | public enum SiteMenu { |
| | | //站点管理 |
| | | SITE_LIST("/data/site"), |
| | | //站点计费策略 |
| | | SITE_ACCOUNTING_STRATEGY("/data/site/accounting_strategy"), |
| | | //站点编辑 |
| | | SITE_UPDATE("/data/site/update"), |
| | | //站点删除 |
| | | SITE_DELETE("/data/site/delete"), |
| | | //充电桩信息 |
| | | CHARGING_PILE("/data/charging_pile"), |
| | | //充电桩查看 |
| | | CHARGING_PILE_QUERY_INFO("/data/charging_pile/query_info"), |
| | | //充电桩编辑 |
| | | CHARGING_PILE_UPDATE("/data/charging_pile/update"), |
| | | //充电桩删除 |
| | | CHARGING_PILE_DELETE("/data/charging_pile/delete"), |
| | | //充电桩新增接口 |
| | | CHARGING_PILE_ADD_CHARGING_GUN("/data/charging_pile/add_charging_gun"), |
| | | //接口信息 |
| | | CHARGING_GUN("/data/charging_gun"), |
| | | //接口编辑 |
| | | CHARGING_GUN_UPDATE("/data/charging_gun/update"), |
| | | //接口删除 |
| | | CHARGING_GUN_DELETE("/data/charging_gun/delete"), |
| | | //接口查看费率 |
| | | CHARGING_GUN_VIEW_RATES("/data/charging_gun/view_rates"), |
| | | //接口下载二维码 |
| | | CHARGING_GUN_DOWNLOAD_QR_CODE("/data/charging_gun/download_qr_code"), |
| | | //接口查看详情 |
| | | CHARGING_GUN_QUERY_INFO("/data/charging_gun/query_info"), |
| | | //接口结束充电 |
| | | CHARGING_GUN_END_CHARGE("/data/charging_gun/end_charge"), |
| | | //停车场配置 |
| | | PARKING_LOT("/data/parking_lot"), |
| | | //停车场查看 |
| | | PARKING_LOT_QUERY_INFO("/data/parking_lot/query_info"), |
| | | //停车场编辑 |
| | | PARKING_LOT_UPDATE("/data/parking_lot/update"), |
| | | //停车场删除 |
| | | PARKING_LOT_DELETE("/data/parking_lot/delete"), |
| | | //停车场监控 |
| | | PARKING_LOT_MONITOR("/data/parking_lot/monitor"), |
| | | //停车场新增车库 |
| | | PARKING_LOT_ADD_GARAGE("/data/parking_lot/add_garage"), |
| | | //监控管理 |
| | | MONITOR("/data/monitor"), |
| | | //监控查看 |
| | | MONITOR_QUERY_INFO("/data/monitor/query_info"), |
| | | //充电桩订单 |
| | | CHARGING_PILE_ORDER("/data/charging_pile_order"), |
| | | //记录 |
| | | CHARGING_PILE_ORDER_RECORD("/data/charging_pile_order/record"), |
| | | //充电订单监控记录 |
| | | CHARGING_PILE_ORDER_MONITORING_RECORD("/data/charging_pile_order/monitoring_record"), |
| | | //详情 |
| | | CHARGING_PILE_ORDER_MONITORING_RECORD_INFO("/data/charging_pile_order/monitoring_record/info"), |
| | | //删除 |
| | | CHARGING_PILE_ORDER_MONITORING_RECORD_DEL("/data/charging_pile_order/monitoring_record/del"), |
| | | //订单申诉 |
| | | ORDER_APPEAL("/data/order_appeal"), |
| | | //查看 |
| | | ORDER_APPEAL_VIEW("/data/order_appeal/view"), |
| | | //处理 |
| | | ORDER_APPEAL_HANDLE("/data/order_appeal/handle"), |
| | | //停车记录 |
| | | PARKING_RECORD("/data/parking_record"), |
| | | //查看 |
| | | PARKING_RECORD_VIEW("/data/parking_record/view"), |
| | | //已出场 |
| | | PARKING_RECORD_EXIT_PARKING_LOT("/data/parking_record/exit_parking_lot"), |
| | | //充电评价 |
| | | CHARGE_EVALUATION("/data/charge_evaluation"), |
| | | //回复 |
| | | CHARGE_EVALUATION_ANSWER("/data/charge_evaluation/answer"), |
| | | //删除 |
| | | CHARGE_EVALUATION_DEL("/data/charge_evaluation/del"), |
| | | //充电时段统计 |
| | | CHARGING_PERIOD_STATISTICS("/data/charging_period_statistics"), |
| | | //订单详情 |
| | | CHARGING_PERIOD_STATISTICS_ORDER_INFO("/data/charging_period_statistics/order_info"), |
| | | //充电曲线 |
| | | CHARGING_PERIOD_STATISTICS_CHARGING_CURVE("/data/charging_period_statistics/charging_curve"), |
| | | //充电算账单 |
| | | CHARGE_BILL_ORDER("/data/charge_bill_order"), |
| | | //下载 |
| | | CHARGE_BILL_ORDER_DOWNLOAD("/data/charge_bill_order/download"), |
| | | //停车缴费订单 |
| | | PARKING_PAYMENT_ORDER("/data/parking_payment_order"), |
| | | //账户结算账单 |
| | | ACCOUNT_SETTLEMENT("/data/account_settlement"), |
| | | //下载 |
| | | ACCOUNT_SETTLEMENT_DOWNLOAD("/data/account_settlement/download"), |
| | | //结算汇总表 |
| | | SETTLEMENT_SUMMARY("/data/settlement_summary"), |
| | | //结算表记录 |
| | | BALANCE_SHEET_RECORD("/data/balance_sheet_record"), |
| | | //下载 |
| | | BALANCE_SHEET_RECORD_DOWNLOAD("/data/balance_sheet_record/download"), |
| | | //删除 |
| | | BALANCE_SHEET_RECORD_DEL("/data/balance_sheet_record/del"), |
| | | //生成结算表 |
| | | GENERATE_STATEMENT("/data/generate_statement"), |
| | | //充电设施监控 |
| | | CHARGING_FACILITY_MONITORING("/data/charging_facility_monitoring"), |
| | | //故障信息列表 |
| | | FAULT_INFORMATION_LIST("/data/fault_information_list"), |
| | | //删除 |
| | | FAULT_INFORMATION_LIST_DEL("/data/fault_information_list/del"), |
| | | //报修记录 |
| | | REPAIR_RECORD("/data/repair_record"), |
| | | //删除 |
| | | REPAIR_RECORD_DEL("/data/repair_record/del"), |
| | | //电站分布 |
| | | POWER_STATION_DISTRIBUTION("/data/power_station_distribution"), |
| | | //充电运营分析 |
| | | CHARGING_OPERATION_ANALYSIS("/data/charging_operation_analysis"), |
| | | //充电用户分析 |
| | | CHARGING_USER_ANALYSIS("/data/charging_user_analysis"), |
| | | //设备运营分析 |
| | | PLANT_OPERATION_ANALYSIS("/data/plant_operation_analysis"), |
| | | //车场运营分析 |
| | | PARKING_OPERATION_ANALYSIS("/data/parking_operation_analysis") |
| | | ; |
| | | private String value; |
| | | |
| | | |
| | | SiteMenu(String value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | public String getValue() { |
| | | return value; |
| | | } |
| | | |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | public static SiteMenu getSiteMenu(String v){ |
| | | SiteMenu siteMenu = Arrays.stream(SiteMenu.values()).filter(s -> s.getValue().equals(v)).findFirst().get(); |
| | | return siteMenu; |
| | | } |
| | | } |
| | |
| | | public R<Set<Integer>> authSite(Integer partnerId, String siteMenu) { |
| | | return R.fail("获取合作商授权的站点数据失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean authMenu(Integer partnerId, Integer siteId, String siteMenu) { |
| | | return false; |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/partner/authSite/{partnerId}") |
| | | R<Set<Integer>> authSite(@PathVariable("partnerId") Integer partnerId, @RequestParam("siteMenu") String siteMenu); |
| | | |
| | | /** |
| | | * 判断合作商权限 |
| | | * @param partnerId |
| | | * @param siteId |
| | | * @param siteMenu |
| | | * @return |
| | | */ |
| | | @PostMapping("/partner/authMenu/{partnerId}") |
| | | Boolean authMenu(@PathVariable("partnerId") Integer partnerId, @RequestParam("siteId") Integer siteId, @RequestParam("siteMenu") String siteMenu); |
| | | } |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField("end_time") |
| | | private LocalDateTime endTime; |
| | | @ApiModelProperty(value = "删除权限") |
| | | @TableField(exist = false) |
| | | private boolean authDelete = true; |
| | | |
| | | } |
| | |
| | | @DateTimeFormat(pattern = "yyyy-MM-ddTHH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime repairTime; |
| | | @ApiModelProperty(value = "删除权限") |
| | | @TableField(exist = false) |
| | | private boolean authDelete = true; |
| | | |
| | | |
| | | } |
| | |
| | | * 用户信息 |
| | | */ |
| | | private SysUser sysUser; |
| | | /** |
| | | * 用户类型(系统用户,小程序用户) |
| | | */ |
| | | private String userType; |
| | | |
| | | public String getToken() |
| | | { |
| | |
| | | { |
| | | this.sysUser = sysUser; |
| | | } |
| | | |
| | | public String getUserType() { |
| | | return userType; |
| | | } |
| | | |
| | | public void setUserType(String userType) { |
| | | this.userType = userType; |
| | | } |
| | | } |
| | |
| | | * 缓存有效期,默认720(分钟) |
| | | */ |
| | | public final static long EXPIRATION = 720; |
| | | public final static long EXPIRATION_APPLET = 7*24*60*60; |
| | | public final static long EXPIRATION_APPLET = 7 * 24 * 60; |
| | | |
| | | /** |
| | | * 缓存刷新时间,默认120(分钟) |
| | |
| | | import java.util.Collection; |
| | | import java.util.HashSet; |
| | | import java.util.Set; |
| | | |
| | | import com.ruoyi.common.core.utils.JwtUtils; |
| | | import com.ruoyi.common.security.handler.GlobalExceptionHandler; |
| | | import io.jsonwebtoken.Claims; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.util.PatternMatchUtils; |
| | | import com.ruoyi.common.core.context.SecurityContextHolder; |
| | | import com.ruoyi.common.core.exception.auth.NotLoginException; |
| | |
| | | */ |
| | | public class AuthLogic |
| | | { |
| | | private static final Logger log = LoggerFactory.getLogger(AuthLogic.class); |
| | | /** 所有权限标识 */ |
| | | private static final String ALL_PERMISSION = "*:*:*"; |
| | | |
| | |
| | | { |
| | | throw new NotLoginException("未提供token"); |
| | | } |
| | | Claims claims = JwtUtils.parseToken(token); |
| | | String userType = JwtUtils.getUserType(claims); |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | if (loginUser == null) |
| | | if (loginUser == null && "system".equals(userType)) |
| | | { |
| | | throw new NotLoginException("无效的token"); |
| | | } |
| | | if(loginUser == null && "applet".equals(userType)){ |
| | | loginUser = new LoginUser(); |
| | | } |
| | | loginUser.setUserType(userType); |
| | | return loginUser; |
| | | } |
| | | |
| | |
| | | public void checkPermiAnd(String... permissions) |
| | | { |
| | | Set<String> permissionList = getPermiList(); |
| | | if(null == permissionList || permissionList.size() == 0){ |
| | | return; |
| | | } |
| | | for (String permission : permissions) |
| | | { |
| | | if (!hasPermi(permissionList, permission)) |
| | |
| | | public void checkPermiOr(String... permissions) |
| | | { |
| | | Set<String> permissionList = getPermiList(); |
| | | if(null == permissionList){ |
| | | return; |
| | | } |
| | | for (String permission : permissions) |
| | | { |
| | | if (hasPermi(permissionList, permission)) |
| | |
| | | try |
| | | { |
| | | LoginUser loginUser = getLoginUser(); |
| | | String userType = loginUser.getUserType(); |
| | | if(null != userType && "applet".equals(userType)){ |
| | | return null; |
| | | } |
| | | return loginUser.getPermissions(); |
| | | } |
| | | catch (Exception e) |
| | |
| | | </dependency> |
| | | |
| | | <!-- Swagger --> |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-swagger-ui</artifactId> |
| | | <version>${swagger.fox.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-swagger2</artifactId> |
| | | <version>${swagger.fox.version}</version> |
| | | </dependency> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>io.springfox</groupId>--> |
| | | <!-- <artifactId>springfox-swagger-ui</artifactId>--> |
| | | <!-- <version>${swagger.fox.version}</version>--> |
| | | <!-- </dependency>--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>io.springfox</groupId>--> |
| | | <!-- <artifactId>springfox-swagger2</artifactId>--> |
| | | <!-- <version>${swagger.fox.version}</version>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <dependency> |
| | | <groupId>com.github.xiaoymin</groupId> |
| | | <artifactId>knife4j-micro-spring-boot-starter</artifactId> |
| | | <version>2.0.8</version> |
| | | </dependency> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.github.xiaoymin</groupId>--> |
| | | <!-- <artifactId>knife4j-micro-spring-boot-starter</artifactId>--> |
| | | <!-- <version>2.0.8</version>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <!-- 引入Druid依赖,阿里巴巴所提供的数据源 --> |
| | | <dependency> |
| | |
| | | package com.ruoyi.gateway.config; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.cloud.gateway.config.GatewayProperties; |
| | | import org.springframework.cloud.gateway.route.RouteLocator; |
| | | import org.springframework.cloud.gateway.support.NameUtils; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.reactive.config.ResourceHandlerRegistry; |
| | | import org.springframework.web.reactive.config.WebFluxConfigurer; |
| | | import springfox.documentation.swagger.web.SwaggerResource; |
| | | import springfox.documentation.swagger.web.SwaggerResourcesProvider; |
| | | |
| | | /** |
| | | * 聚合系统接口 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Component |
| | | public class SwaggerProvider implements SwaggerResourcesProvider, WebFluxConfigurer { |
| | | /** |
| | | * Swagger2默认的url后缀 |
| | | */ |
| | | public static final String SWAGGER2URL = "/v2/api-docs"; |
| | | |
| | | /** |
| | | * 网关路由 |
| | | */ |
| | | @Lazy |
| | | @Autowired |
| | | private RouteLocator routeLocator; |
| | | |
| | | @Autowired |
| | | private GatewayProperties gatewayProperties; |
| | | |
| | | /** |
| | | * 聚合其他服务接口 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<SwaggerResource> get() { |
| | | List<SwaggerResource> resourceList = new ArrayList<>(); |
| | | List<String> routes = new ArrayList<>(); |
| | | // 获取网关中配置的route |
| | | routeLocator.getRoutes().subscribe(route -> routes.add(route.getId())); |
| | | gatewayProperties.getRoutes().stream() |
| | | .filter(routeDefinition -> routes |
| | | .contains(routeDefinition.getId())) |
| | | .forEach(routeDefinition -> routeDefinition.getPredicates().stream() |
| | | .filter(predicateDefinition -> "Path".equalsIgnoreCase(predicateDefinition.getName())) |
| | | .filter(predicateDefinition -> !"ruoyi-auth".equalsIgnoreCase(routeDefinition.getId())) |
| | | .forEach(predicateDefinition -> resourceList |
| | | .add(swaggerResource(routeDefinition.getId(), predicateDefinition.getArgs() |
| | | .get(NameUtils.GENERATED_NAME_PREFIX + "0").replace("/**", SWAGGER2URL))))); |
| | | return resourceList; |
| | | } |
| | | |
| | | private SwaggerResource swaggerResource(String name, String location) { |
| | | SwaggerResource swaggerResource = new SwaggerResource(); |
| | | swaggerResource.setName(name); |
| | | swaggerResource.setLocation(location); |
| | | swaggerResource.setSwaggerVersion("2.0"); |
| | | return swaggerResource; |
| | | } |
| | | |
| | | @Override |
| | | public void addResourceHandlers(ResourceHandlerRegistry registry) { |
| | | /** swagger-ui 地址 */ |
| | | registry.addResourceHandler("/swagger-ui/**", "*/doc.html") |
| | | .addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/"); |
| | | } |
| | | } |
| | | //package com.ruoyi.gateway.config; |
| | | // |
| | | //import java.util.ArrayList; |
| | | //import java.util.List; |
| | | // |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.cloud.gateway.config.GatewayProperties; |
| | | //import org.springframework.cloud.gateway.route.RouteLocator; |
| | | //import org.springframework.cloud.gateway.support.NameUtils; |
| | | //import org.springframework.context.annotation.Lazy; |
| | | //import org.springframework.stereotype.Component; |
| | | //import org.springframework.web.reactive.config.ResourceHandlerRegistry; |
| | | //import org.springframework.web.reactive.config.WebFluxConfigurer; |
| | | //import springfox.documentation.swagger.web.SwaggerResource; |
| | | //import springfox.documentation.swagger.web.SwaggerResourcesProvider; |
| | | // |
| | | ///** |
| | | // * 聚合系统接口 |
| | | // * |
| | | // * @author ruoyi |
| | | // */ |
| | | //@Component |
| | | //public class SwaggerProvider implements SwaggerResourcesProvider, WebFluxConfigurer { |
| | | // /** |
| | | // * Swagger2默认的url后缀 |
| | | // */ |
| | | // public static final String SWAGGER2URL = "/v2/api-docs"; |
| | | // |
| | | // /** |
| | | // * 网关路由 |
| | | // */ |
| | | // @Lazy |
| | | // @Autowired |
| | | // private RouteLocator routeLocator; |
| | | // |
| | | // @Autowired |
| | | // private GatewayProperties gatewayProperties; |
| | | // |
| | | // /** |
| | | // * 聚合其他服务接口 |
| | | // * |
| | | // * @return |
| | | // */ |
| | | // @Override |
| | | // public List<SwaggerResource> get() { |
| | | // List<SwaggerResource> resourceList = new ArrayList<>(); |
| | | // List<String> routes = new ArrayList<>(); |
| | | // // 获取网关中配置的route |
| | | // routeLocator.getRoutes().subscribe(route -> routes.add(route.getId())); |
| | | // gatewayProperties.getRoutes().stream() |
| | | // .filter(routeDefinition -> routes |
| | | // .contains(routeDefinition.getId())) |
| | | // .forEach(routeDefinition -> routeDefinition.getPredicates().stream() |
| | | // .filter(predicateDefinition -> "Path".equalsIgnoreCase(predicateDefinition.getName())) |
| | | // .filter(predicateDefinition -> !"ruoyi-auth".equalsIgnoreCase(routeDefinition.getId())) |
| | | // .forEach(predicateDefinition -> resourceList |
| | | // .add(swaggerResource(routeDefinition.getId(), predicateDefinition.getArgs() |
| | | // .get(NameUtils.GENERATED_NAME_PREFIX + "0").replace("/**", SWAGGER2URL))))); |
| | | // return resourceList; |
| | | // } |
| | | // |
| | | // private SwaggerResource swaggerResource(String name, String location) { |
| | | // SwaggerResource swaggerResource = new SwaggerResource(); |
| | | // swaggerResource.setName(name); |
| | | // swaggerResource.setLocation(location); |
| | | // swaggerResource.setSwaggerVersion("2.0"); |
| | | // return swaggerResource; |
| | | // } |
| | | // |
| | | // @Override |
| | | // public void addResourceHandlers(ResourceHandlerRegistry registry) { |
| | | // /** swagger-ui 地址 */ |
| | | // registry.addResourceHandler("/swagger-ui/**", "*/doc.html") |
| | | // .addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/"); |
| | | // } |
| | | //} |
| | |
| | | package com.ruoyi.gateway.handler; |
| | | |
| | | import java.util.Optional; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import reactor.core.publisher.Mono; |
| | | import springfox.documentation.swagger.web.SecurityConfiguration; |
| | | import springfox.documentation.swagger.web.SecurityConfigurationBuilder; |
| | | import springfox.documentation.swagger.web.SwaggerResourcesProvider; |
| | | import springfox.documentation.swagger.web.UiConfiguration; |
| | | import springfox.documentation.swagger.web.UiConfigurationBuilder; |
| | | |
| | | @RestController |
| | | @RequestMapping("/swagger-resources") |
| | | public class SwaggerHandler { |
| | | private final SwaggerResourcesProvider swaggerResources; |
| | | @Autowired(required = false) |
| | | private SecurityConfiguration securityConfiguration; |
| | | @Autowired(required = false) |
| | | private UiConfiguration uiConfiguration; |
| | | |
| | | @Autowired |
| | | public SwaggerHandler(SwaggerResourcesProvider swaggerResources) { |
| | | this.swaggerResources = swaggerResources; |
| | | } |
| | | |
| | | @GetMapping("/configuration/security") |
| | | public Mono<ResponseEntity<SecurityConfiguration>> securityConfiguration() { |
| | | return Mono.just(new ResponseEntity<>( |
| | | Optional.ofNullable(securityConfiguration).orElse(SecurityConfigurationBuilder.builder().build()), |
| | | HttpStatus.OK)); |
| | | } |
| | | |
| | | @GetMapping("/configuration/ui") |
| | | public Mono<ResponseEntity<UiConfiguration>> uiConfiguration() { |
| | | return Mono.just(new ResponseEntity<>( |
| | | Optional.ofNullable(uiConfiguration).orElse(UiConfigurationBuilder.builder().build()), HttpStatus.OK)); |
| | | } |
| | | |
| | | @SuppressWarnings("rawtypes") |
| | | @GetMapping("") |
| | | public Mono<ResponseEntity> swaggerResources() { |
| | | return Mono.just((new ResponseEntity<>(swaggerResources.get(), HttpStatus.OK))); |
| | | } |
| | | } |
| | | //package com.ruoyi.gateway.handler; |
| | | // |
| | | //import java.util.Optional; |
| | | // |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.http.HttpStatus; |
| | | //import org.springframework.http.ResponseEntity; |
| | | //import org.springframework.web.bind.annotation.GetMapping; |
| | | //import org.springframework.web.bind.annotation.RequestMapping; |
| | | //import org.springframework.web.bind.annotation.RestController; |
| | | //import reactor.core.publisher.Mono; |
| | | //import springfox.documentation.swagger.web.SecurityConfiguration; |
| | | //import springfox.documentation.swagger.web.SecurityConfigurationBuilder; |
| | | //import springfox.documentation.swagger.web.SwaggerResourcesProvider; |
| | | //import springfox.documentation.swagger.web.UiConfiguration; |
| | | //import springfox.documentation.swagger.web.UiConfigurationBuilder; |
| | | // |
| | | //@RestController |
| | | //@RequestMapping("/swagger-resources") |
| | | //public class SwaggerHandler { |
| | | // private final SwaggerResourcesProvider swaggerResources; |
| | | // @Autowired(required = false) |
| | | // private SecurityConfiguration securityConfiguration; |
| | | // @Autowired(required = false) |
| | | // private UiConfiguration uiConfiguration; |
| | | // |
| | | // @Autowired |
| | | // public SwaggerHandler(SwaggerResourcesProvider swaggerResources) { |
| | | // this.swaggerResources = swaggerResources; |
| | | // } |
| | | // |
| | | // @GetMapping("/configuration/security") |
| | | // public Mono<ResponseEntity<SecurityConfiguration>> securityConfiguration() { |
| | | // return Mono.just(new ResponseEntity<>( |
| | | // Optional.ofNullable(securityConfiguration).orElse(SecurityConfigurationBuilder.builder().build()), |
| | | // HttpStatus.OK)); |
| | | // } |
| | | // |
| | | // @GetMapping("/configuration/ui") |
| | | // public Mono<ResponseEntity<UiConfiguration>> uiConfiguration() { |
| | | // return Mono.just(new ResponseEntity<>( |
| | | // Optional.ofNullable(uiConfiguration).orElse(UiConfigurationBuilder.builder().build()), HttpStatus.OK)); |
| | | // } |
| | | // |
| | | // @SuppressWarnings("rawtypes") |
| | | // @GetMapping("") |
| | | // public Mono<ResponseEntity> swaggerResources() { |
| | | // return Mono.just((new ResponseEntity<>(swaggerResources.get(), HttpStatus.OK))); |
| | | // } |
| | | //} |
| | |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.system.api.domain.SysLoginLog; |
| | | import com.ruoyi.system.service.ISysLoginLogService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/entryLog"}, logical = Logical.OR) |
| | | @GetMapping("/pageList") |
| | | @ApiOperation(value = "获取登录日志列表", tags = {"管理后台-登录日志"}) |
| | | public AjaxResult<PageInfo<SysLoginLog>> pageList(String name, BasePage basePage){ |
| | |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/entryLog/add"}, logical = Logical.OR) |
| | | @PostMapping("/addLoginLog") |
| | | @ApiOperation(value = "添加登录日志", tags = {"管理后台-登录日志"}) |
| | | public AjaxResult addLoginLog(@RequestBody SysLoginLog loginLog){ |
| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.system.domain.SysMenu; |
| | | import com.ruoyi.system.domain.SysMenus; |
| | |
| | | /** |
| | | * 获取菜单列表 |
| | | */ |
| | | @RequiresPermissions(value = {"/roleManagement"}, logical = Logical.OR) |
| | | @GetMapping("/list") |
| | | @ApiOperation("所有菜单列表") |
| | | public AjaxResult list() |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.system.query.SysOperLogQuery; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private ISysOperLogService operLogService; |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/operationLog/list"}, logical = Logical.OR) |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "获取操作日志列表", tags = {"管理后台-操作日志"}) |
| | | public AjaxResult<PageInfo<SysOperLog>> list(SysOperLogQuery query) { |
| | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.other.api.domain.TRoleSite; |
| | | import com.ruoyi.other.api.feignClient.RoleSiteClient; |
| | | import com.ruoyi.system.api.model.GetSysRoleByIds; |
| | |
| | | private SiteClient siteClient; |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/systemUserManagement", "/systemUserManagement/add", "/systemUserManagement/update", "/roleManagement", "/partners", |
| | | "/partners/add", "/partners/seleete", "/partners/update"}, logical = Logical.OR) |
| | | @ApiOperation(value = "获取角色列表", tags = {"管理后台-系统用户管理"}) |
| | | @GetMapping("/list") |
| | | public AjaxResult list() { |
| | |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/roleManagement"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping("/listPage") |
| | | @ApiOperation(value = "获取角色列表", tags = {"管理后台-角色管理"}) |
| | |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/roleManagement/add"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping("/roleAdd") |
| | | @ApiOperation(value = "添加角色", tags = {"管理后台-角色管理"}) |
| | |
| | | role.setCreateBy(SecurityUtils.getUsername()); |
| | | role.setCreateTime(new Date()); |
| | | roleService.insertRole(role); |
| | | |
| | | //添加站点权限 |
| | | List<TRoleSite> roleSites = new ArrayList<>(); |
| | | for (Integer siteId : dto.getSiteIds()) { |
| | | TRoleSite roleSite = new TRoleSite(); |
| | | roleSite.setRoleId(role.getRoleId().intValue()); |
| | | roleSite.setSiteId(siteId); |
| | | roleSites.add(roleSite); |
| | | if(null != dto.getSiteIds()){ |
| | | List<TRoleSite> roleSites = new ArrayList<>(); |
| | | for (Integer siteId : dto.getSiteIds()) { |
| | | TRoleSite roleSite = new TRoleSite(); |
| | | roleSite.setRoleId(role.getRoleId().intValue()); |
| | | roleSite.setSiteId(siteId); |
| | | roleSites.add(roleSite); |
| | | } |
| | | roleSiteClient.addRoleSite(roleSites); |
| | | } |
| | | roleSiteClient.addRoleSite(roleSites); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/roleManagement/info", "/roleManagement/update"}, logical = Logical.OR) |
| | | @GetMapping("/roleInfo") |
| | | @ApiOperation(value = "角色详情", tags = {"管理后台-角色管理"}) |
| | | public AjaxResult roleInfo(@RequestParam Long id) { |
| | |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/roleManagement/update"}, logical = Logical.OR) |
| | | @PostMapping("/roleUpdate") |
| | | @ApiOperation(value = "编辑角色", tags = {"管理后台-角色管理"}) |
| | | @GlobalTransactional(rollbackFor = Exception.class)//分布式事务 |
| | |
| | | /** |
| | | * 删除角色 |
| | | */ |
| | | @RequiresPermissions(value = {"/roleManagement/del"}, logical = Logical.OR) |
| | | @Log(title = "角色管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{roleIds}") |
| | | @ApiOperation(value = "删除角色", tags = {"管理后台-角色管理"}) |
| | |
| | | /** |
| | | * 查询已分配用户角色列表 |
| | | */ |
| | | @RequiresPermissions("/roleManagement") |
| | | @GetMapping("/authUser/allocatedList") |
| | | public TableDataInfo allocatedList(SysUser user) { |
| | | startPage(); |
| | |
| | | /** |
| | | * 查询未分配用户角色列表 |
| | | */ |
| | | @RequiresPermissions("/roleManagement") |
| | | @GetMapping("/authUser/unallocatedList") |
| | | public TableDataInfo unallocatedList(SysUser user) { |
| | | startPage(); |
| | |
| | | /** |
| | | * 获取对应角色部门树列表 |
| | | */ |
| | | @RequiresPermissions("") |
| | | @GetMapping(value = "/deptTree/{roleId}") |
| | | public AjaxResult deptTree(@PathVariable("roleId") Long roleId) { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.other.api.domain.TUserSite; |
| | | import com.ruoyi.other.api.feignClient.RoleSiteClient; |
| | | import com.ruoyi.other.api.feignClient.UserSiteClient; |
| | |
| | | /** |
| | | * 获取用户列表 |
| | | */ |
| | | @RequiresPermissions(value = {"/systemUserManagement", "/roleManagement/info"}, logical = Logical.OR) |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "获取系统用户列表", tags = {"管理后台-系统用户管理", "管理后台-角色管理"}) |
| | | public AjaxResult list(GetSysUserList getSysUserList) { |
| | |
| | | /** |
| | | * 新增用户 |
| | | */ |
| | | @RequiresPermissions(value = {"/systemUserManagement/add"}, logical = Logical.OR) |
| | | @Log(title = "用户管理", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @ApiOperation(value = "添加系统用户", tags = {"管理后台-系统用户管理"}) |
| | |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/systemUserManagement/add", "/systemUserManagement/update"}, logical = Logical.OR) |
| | | @GetMapping("/verifyUserNameRepeat/{username}") |
| | | @ApiOperation(value = "校验账号是否重复", tags = {"管理后台-系统用户管理"}) |
| | | public AjaxResult verifyUserNameRepeat(@PathVariable String username){ |
| | |
| | | return success(); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/systemUserManagement/update"}, logical = Logical.OR) |
| | | @GetMapping("/getRoleSiteName/{roleId}") |
| | | @ApiOperation(value = "获取角色对应的站点名称", tags = {"管理后台-系统用户管理"}) |
| | | public AjaxResult<List<String>> getRoleSiteName(@PathVariable Integer roleId){ |
| | |
| | | /** |
| | | * 修改用户 |
| | | */ |
| | | @RequiresPermissions(value = {"/systemUserManagement/update"}, logical = Logical.OR) |
| | | @Log(title = "用户管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/update") |
| | | @ApiOperation(value = "编辑系统用户", tags = {"管理后台-系统用户管理"}) |
| | |
| | | /** |
| | | * 删除用户 |
| | | */ |
| | | @RequiresPermissions(value = {"/systemUserManagement/del"}, logical = Logical.OR) |
| | | @Log(title = "用户管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{userIds}") |
| | | @ApiOperation(value = "删除系统用户", tags = {"管理后台-系统用户管理"}) |
| | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/systemUserManagement/forbidden"}, logical = Logical.OR) |
| | | @PostMapping("/shopUserStart") |
| | | @ApiOperation(value = "账号管理--禁用/启用", tags = {"管理后台-系统用户管理"}) |
| | | public AjaxResult shopUserStart(@RequestBody ShopUserStart shopUserStart) { |
| | |
| | | /** |
| | | * 重置密码 |
| | | */ |
| | | @RequiresPermissions(value = {"/systemUserManagement/reset_passwords"}, logical = Logical.OR) |
| | | @Log(title = "用户管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/resetPwd") |
| | | @ApiOperation(value = "重置密码", tags = {"管理后台-系统用户管理"}) |
| | |
| | | @ApiOperation(tags = {"小程序-用户地址"},value = "设置默认地址") |
| | | @GetMapping(value = "/setDefaultAddress") |
| | | public AjaxResult<String> setDefaultAddress(@RequestParam(value = "id") Long id) { |
| | | TAppUserAddress appUserAddress = appUserAddressService.getById(id); |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | if(!appUserAddress.getAppUserId().equals(userId)){ |
| | | return AjaxResult.error("权限不足"); |
| | | } |
| | | // 修改用户默认地址 |
| | | appUserAddressService.updateDefaultAddress(1,tokenService.getLoginUserApplet().getUserId()); |
| | | TAppUserAddress appUserAddress = appUserAddressService.getById(id); |
| | | appUserAddress.setDefaultAddress(1); |
| | | appUserAddressService.updateById(appUserAddress); |
| | | return AjaxResult.success(); |
| | |
| | | @ApiOperation(tags = {"小程序-用户地址"},value = "修改用户地址") |
| | | @PostMapping(value = "/update") |
| | | public AjaxResult<Boolean> update(@RequestBody TAppUserAddress dto) { |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | TAppUserAddress userAddress = appUserAddressService.getById(dto.getId()); |
| | | if(!userAddress.getAppUserId().equals(userId)){ |
| | | return AjaxResult.error("权限不足"); |
| | | } |
| | | // 用户id |
| | | dto.setAppUserId(tokenService.getLoginUserApplet().getUserId()); |
| | | dto.setAppUserId(userId); |
| | | // 修改用户默认地址 |
| | | appUserAddressService.updateDefaultAddress(dto.getDefaultAddress(),dto.getAppUserId()); |
| | | return AjaxResult.ok(appUserAddressService.updateById(dto)); |
| | |
| | | @GetMapping(value = "/getDetailById") |
| | | public R<TAppUserAddress> getDetailById(@RequestParam(value = "id")Long id) { |
| | | TAppUserAddress appUserAddress = appUserAddressService.getById(id); |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | if(!appUserAddress.getAppUserId().equals(userId)){ |
| | | return R.fail("权限不足"); |
| | | } |
| | | appUserAddress.setUid(appUserAddress.getId().toString()); |
| | | return R.ok(appUserAddress); |
| | | } |
| | |
| | | @ApiOperation(tags = {"小程序-用户地址"},value = "删除用户地址") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public AjaxResult<Boolean> deleteById(@RequestParam("id") Long id) { |
| | | TAppUserAddress appUserAddress = appUserAddressService.getById(id); |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | if(!appUserAddress.getAppUserId().equals(userId)){ |
| | | return AjaxResult.error("权限不足"); |
| | | } |
| | | return AjaxResult.ok(appUserAddressService.removeById(id)); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.auth.AuthUtil; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | |
| | | import com.ruoyi.other.api.feignClient.IntegralRuleClient; |
| | | import com.ruoyi.other.api.feignClient.OtherClient; |
| | | import com.ruoyi.other.api.feignClient.VipClient; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import com.ruoyi.system.api.model.LoginUserApplet; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/company"}, logical = Logical.OR) |
| | | @ApiOperation(value = "单位管理列表", tags = {"用户管理-单位管理"}) |
| | | @PostMapping(value = "/unit/page") |
| | | public R<Page<TCompany>> unitPage(@RequestBody UnitListQueryDto unitListQueryDto) { |
| | |
| | | } |
| | | return R.ok(data); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/appUser/list", "/appUser/add", "/appUser/update", "/appUser/updateCompany"}, logical = Logical.OR) |
| | | @ApiOperation(value = "单位下拉框", tags = {"用户管理-单位管理"}) |
| | | @GetMapping(value = "/unit/select") |
| | | public R<List<TCompany>> unitSelect() { |
| | |
| | | |
| | | return R.ok(pageR.getData().getRecords()); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/company/add", "/company/update"}, logical = Logical.OR) |
| | | @ApiOperation(value = "单位管理添加或编辑", tags = {"用户管理-单位管理"}) |
| | | @PostMapping(value = "/unit/addOrUpdate") |
| | | @Log(title = "【单位管理】添加或编辑单位", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | |
| | | otherClient.unitAddorUpadate(tCompany); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/company/del"}, logical = Logical.OR) |
| | | @ApiOperation(value = "单位管理删除", tags = {"用户管理-单位管理"}) |
| | | @DeleteMapping(value = "/unit/delete") |
| | | @Log(title = "【单位管理】删除单位", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | |
| | | return R.ok(); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/appUser/list"}, logical = Logical.OR) |
| | | @ApiOperation(value = "用户列表", tags = {"用户管理-用户列表"}) |
| | | @PostMapping(value = "/user/page") |
| | | public R<Page<TAppUser>> userPage(@RequestBody UserListQueryDto userListQueryDto) { |
| | |
| | | } |
| | | return R.ok(page); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/vipList"}, logical = Logical.OR) |
| | | @ApiOperation(value = "会员列表", tags = {"用户管理-会员列表"}) |
| | | @PostMapping(value = "/user/vip/page") |
| | | public R<Page<TAppUser>> vipPage(@RequestBody UserListQueryDto userListQueryDto) { |
| | |
| | | } |
| | | return R.ok(page); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/coupon/send"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"管理后台-优惠券管理"},value = "优惠券发放-选择人员") |
| | | @PostMapping("/choiceUser") |
| | | public R<Page<TAppUser>> choiceUser(@RequestBody ChoiceUserListQueryDto userListQueryDto) { |
| | |
| | | } |
| | | return R.ok(page); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/appUser/add", "/appUser/update"}, logical = Logical.OR) |
| | | @ApiOperation(value = "用户添加编辑", tags = {"用户管理-用户列表"}) |
| | | @PostMapping(value = "/user/addOrUpdate") |
| | | @Log(title = "【用户列表】添加编辑用户", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | |
| | | appUserService.saveOrUpdate(tAppUser); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/appUser/select", "/vipList/select"}, logical = Logical.OR) |
| | | @ApiOperation(value = "用户详情", tags = {"用户管理-用户列表"}) |
| | | @GetMapping(value = "/user/detail/{id}") |
| | | public R<UserDetailDto> userDetail(@PathVariable Long id) { |
| | |
| | | |
| | | return R.ok(userDetailDto); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/appUser/select", "/vipList/select"}, logical = Logical.OR) |
| | | @ApiOperation(value = "用户详情积分明细", tags = {"后台-用户管理-用户列表","小程序-个人中心"}) |
| | | @PostMapping(value = "/user/points/page") |
| | | public R<Page<TAppUserIntegralChange>> pointsDetail(@RequestBody PointsQueryDto pointsQueryDto) { |
| | |
| | | @GetMapping(value = "/user/points/detail") |
| | | public R<TAppUserIntegralChange> pointsDetail(String id) { |
| | | TAppUserIntegralChange byId = integralChangeService.getById(id); |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | if(!byId.getAppUserId().equals(userId)){ |
| | | return R.fail("权限不足"); |
| | | } |
| | | if (byId.getChangeType()==6) { |
| | | TExchangeOrder data = exchangeOrderClient.orderDetail(Long.valueOf(byId.getExtension())).getData(); |
| | | if (data != null) { |
| | |
| | | } |
| | | return R.ok(byId); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/appUser/freeze"}, logical = Logical.OR) |
| | | @ApiOperation(value = "冻结解冻用户", tags = {"后台-用户管理-用户列表"}) |
| | | @PostMapping(value = "/user/status/change") |
| | | @Log(title = "【用户列表】冻结解冻用户", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | |
| | | appUserService.updateById(appUser); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/appUser/updateCompany"}, logical = Logical.OR) |
| | | @ApiOperation(value = "修改单位", tags = {"后台-用户管理-用户列表"}) |
| | | @PostMapping(value = "/user/unit/change") |
| | | @Log(title = "【用户列表】修改用户单位", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/appUser/del"}, logical = Logical.OR) |
| | | @ApiOperation(value = "删除用户", tags = {"后台-用户管理-用户列表"}) |
| | | @DeleteMapping(value = "/user/delete") |
| | | @Log(title = "【用户列表】删除用户", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | |
| | | appUserInfoDto.setVipCouponNum(count); |
| | | appUserInfoDto.setIsVip(1); |
| | | appUserInfoDto.setVipExpireTime(byId.getVipEndTime()); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | //判断当天是否签到 |
| | | Long count = signService.lambdaQuery().eq(TAppUserSign::getAppUserId,userId).eq(TAppUserSign::getSignDay, LocalDate.now()).count(); |
| | |
| | | appUserInfoDto.setUserCars(list); |
| | | appUserInfoDto.setFirstAdd(byId.getFirstAdd()!=null?byId.getFirstAdd():0); |
| | | appUserInfoDto.setPoints(byId.getPoints()==null?0:byId.getPoints()); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | return R.ok(appUserInfoDto); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | TAppUser byId = appUserService.getById(userId); |
| | | byId.setAvatar(url); |
| | | appUserService.updateById(byId); |
| | | |
| | | return R.ok(); |
| | | |
| | | } |
| | | |
| | | @ApiOperation(value = "优惠卷列表不分页(1可使用2不可用)", tags = {"小程序-个人中心"}) |
| | |
| | | @PostMapping(value = "/user/coupon/getById") |
| | | public R<TAppCoupon> couponGetById(@RequestParam("id")Long id) { |
| | | TAppCoupon appCoupon = appCouponService.getById(id); |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | if(!appCoupon.getAppUserId().equals(userId)){ |
| | | return R.fail("权限不足"); |
| | | } |
| | | appCoupon.setUid(id.toString()); |
| | | return R.ok(appCoupon); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/appUser/giftVip", "/appUser/gift_vip"}, logical = Logical.OR) |
| | | @ApiOperation(value = "赠送会员", tags = {"用户管理-用户列表"}) |
| | | @PostMapping(value = "/user/give/vip") |
| | | @Log(title = "【用户列表】赠送会员", businessType = BusinessType.OTHER,operatorType = OperatorType.MANAGE) |
| | |
| | | } |
| | | // 获取当前用户信息 |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | TAppUser appUser = appUserService.getById(userId); |
| | | appUser.setPhone(dto.getPhone()); |
| | | appUserService.updateById(appUser); |
| | | TAppUser appUser = appUserService.getOne(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getPhone, dto.getPhone()).eq(TAppUser::getDelFlag, 0).eq(TAppUser::getStatus, 3)); |
| | | if (Objects.nonNull(appUser)){ |
| | | return AjaxResult.error("手机号已使用,请更换其他手机号"); |
| | | } |
| | | TAppUser appUser1 = appUserService.getById(userId); |
| | | appUser1.setPhone(dto.getPhone()); |
| | | appUserService.updateById(appUser1); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "添加编辑车辆", tags = {"小程序-个人中心-车辆"}) |
| | | @PostMapping(value = "/user/car/addOrUpdate") |
| | | public R carAdd(@RequestBody TAppUserCar appUserCar) { |
| | | |
| | | if(null != appUserCar.getId()){ |
| | | TAppUserCar userCar = appUserCarService.getById(appUserCar.getId()); |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | if(!userCar.getAppUserId().equals(userId)){ |
| | | return R.fail("权限不足"); |
| | | } |
| | | } |
| | | LoginUserApplet loginUserApplet = tokenService.getLoginUserApplet(); |
| | | Long userId = loginUserApplet.getUserId(); |
| | | TAppUser byId = appUserService.getById(userId); |
| | |
| | | @ApiOperation(value = "添加编辑车辆", tags = {"小程序-个人中心-车辆"}) |
| | | @GetMapping(value = "/user/car/delete") |
| | | public R carDelete(String id) { |
| | | TAppUserCar appUserCar = appUserCarService.getById(id); |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | if(!appUserCar.getAppUserId().equals(userId)){ |
| | | return R.fail("权限不足"); |
| | | } |
| | | boolean b = appUserCarService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | |
| | | @GetMapping(value = "/user/car/detail") |
| | | public R<TAppUserCar> carDetail(String id) { |
| | | TAppUserCar byId = appUserCarService.getById(id); |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | if(!byId.getAppUserId().equals(userId)){ |
| | | return R.fail("权限不足"); |
| | | } |
| | | return R.ok(byId); |
| | | } |
| | | |
| | |
| | | return R.ok(result3); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping(value = "/user/logOut") |
| | | @ApiOperation(value = "退出登录", tags = {"小程序-个人中心"}) |
| | | public AjaxResult logOut(){ |
| | | String token = tokenService.getLoginUserApplet().getToken(); |
| | | redisService.deleteObject("login_tokens:" + token); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/refresh") |
| | | @ApiOperation(value = "刷新token过期时间", tags = {"小程序-个人中心"}) |
| | | public R<?> refresh(HttpServletRequest request) { |
| | | LoginUserApplet loginUser = tokenService.getLoginUserAppletToken(request); |
| | | if (StringUtils.isNotNull(loginUser)) { |
| | | // 刷新令牌有效期 |
| | | tokenService.refreshToken1(loginUser); |
| | | return R.ok(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.other.api.dto.TagListQueryDto; |
| | | import com.ruoyi.account.api.model.TAppUserTag; |
| | | import com.ruoyi.account.service.TAppUserTagService; |
| | |
| | | private OtherClient otherClient; |
| | | @Resource |
| | | private TAppUserTagService appUserTagService; |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/coupon", "/userTag"}, logical = Logical.OR) |
| | | @ApiOperation(value = "标签管理列表", tags = {"用户管理-用户标签管理"}) |
| | | @PostMapping(value = "/tags/page") |
| | | public R<Page<TUserTag>> tagPage(@RequestBody TagListQueryDto tagListQueryDto) { |
| | |
| | | } |
| | | return R.ok(data); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/appUser/list"}, logical = Logical.OR) |
| | | @ApiOperation(value = "标签管理列表", tags = {"用户管理-用户标签管理"}) |
| | | @GetMapping(value = "/tags/select") |
| | | public R<List<TUserTag>> select() { |
| | |
| | | R<Page<TUserTag>> pageR = otherClient.queryTagPage(tagListQueryDto); |
| | | return R.ok(pageR.getData().getRecords()); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/userTag/add", "/userTag/update"}, logical = Logical.OR) |
| | | @ApiOperation(value = "标签添加或修改", tags = {"用户管理-用户标签管理"}) |
| | | @PostMapping(value = "/tags/add") |
| | | @Log(title = "【用户标签管理】标签添加或修改", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | |
| | | otherClient.addorUpdateTag(tUserTag); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/userTag/del"}, logical = Logical.OR) |
| | | @ApiOperation(value = "标签删除", tags = {"用户管理-用户标签管理"}) |
| | | @DeleteMapping(value = "/tags/delete") |
| | | @Log(title = "【用户标签管理】删除标签", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | |
| | | @ApiOperation(value = "获取开票抬头详情数据", tags = {"小程序-充电发票"}) |
| | | public AjaxResult<TInvoiceInformation> getInvoiceInformationInfo(@PathVariable String id){ |
| | | TInvoiceInformation information = invoiceInformationService.getById(id); |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | if(!information.getAppUserId().equals(userId)){ |
| | | return AjaxResult.error("权限不足"); |
| | | } |
| | | return AjaxResult.success(information); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "编辑开票抬头数据", tags = {"小程序-充电发票"}) |
| | | public AjaxResult editInvoiceInformation(@RequestBody TInvoiceInformation invoiceInformation){ |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | TInvoiceInformation information = invoiceInformationService.getById(invoiceInformation.getId()); |
| | | if(!information.getAppUserId().equals(userId)){ |
| | | return AjaxResult.error("权限不足"); |
| | | } |
| | | |
| | | //如果当前是默认抬头,则需要去除其他的默认配置 |
| | | if(null != invoiceInformation.getIsDefault() && 1 == invoiceInformation.getIsDefault()){ |
| | | TInvoiceInformation one = invoiceInformationService.getOne(new LambdaQueryWrapper<TInvoiceInformation>().eq(TInvoiceInformation::getDelFlag, 0) |
| | |
| | | package com.ruoyi.account; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.system.api.model.LoginUserApplet; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = RuoYiAccountApplication.class) |
| | | public class RuoYiAccountApplicationTests { |
| | | |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | @Test |
| | | public void test(){ |
| | | LoginUserApplet loginUserApplet = new LoginUserApplet(); |
| | | loginUserApplet.setUserId(1839480334642704385L); |
| | | loginUserApplet.setUserIdStr("1839480334642704385"); |
| | | loginUserApplet.setName("158****3127"); |
| | | loginUserApplet.setPhone("15828353127"); |
| | | loginUserApplet.setAvatar(""); |
| | | loginUserApplet.setAddress(""); |
| | | Map<String, Object> tokenInfos = new HashMap<>(); |
| | | System.err.println(tokenService.createTokenApplet(loginUserApplet)); |
| | | } |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private RedisService redisService; |
| | | @Autowired |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | @Autowired |
| | | private TChargingPileNotificationService chargingPileNotificationService; |
| | |
| | | */ |
| | | @ApiOperation(value = "获取验证码",notes = "获取验证码",tags = {"更换手机号获取验证码"}) |
| | | @GetMapping("/getCode") |
| | | public AjaxResult getCode(@RequestParam("phone") String phone) |
| | | { |
| | | public AjaxResult getCode(@RequestParam("phone") String phone) { |
| | | String regex = "^1[3-9]\\d{9}$"; |
| | | if(!phone.matches(regex)){ |
| | | return AjaxResult.error("无效的手机号"); |
| | | } |
| | | Map<String, Object> cacheMap = redisService.getCacheMap("sms_code_" + phone); |
| | | if(null == cacheMap || cacheMap.size() == 0){ |
| | | cacheMap = new HashMap<>(); |
| | | cacheMap.put("timestamp", System.currentTimeMillis()); |
| | | cacheMap.put("time", 1); |
| | | redisService.setCacheMap("sms_code_" + phone, cacheMap, 300); |
| | | }else{ |
| | | Integer time = (Integer) cacheMap.get("time"); |
| | | Long timestamp = (Long) cacheMap.get("timestamp"); |
| | | if(System.currentTimeMillis() - timestamp > 60000){ |
| | | cacheMap.put("timestamp", System.currentTimeMillis()); |
| | | cacheMap.put("time", 1); |
| | | redisService.setCacheMap("sms_code_" + phone, cacheMap, 300); |
| | | } else if(System.currentTimeMillis() - timestamp <= 60000 && time < 3){ |
| | | time++; |
| | | cacheMap.put("time", time); |
| | | redisService.setCacheMap("sms_code_" + phone, cacheMap, 300); |
| | | }else if(System.currentTimeMillis() - timestamp < 60000 && time >= 3){ |
| | | return AjaxResult.error("请求太频繁,请稍后再试!"); |
| | | } |
| | | } |
| | | |
| | | TAppUser appUser = appUserClient.selectByPhone(phone).getData(); |
| | | if (Objects.nonNull(appUser)){ |
| | | return AjaxResult.error("该手机号已绑定账号"); |
| | | return AjaxResult.error(); |
| | | } |
| | | String code = MsgUtil.createCode(); |
| | | redisService.setCacheObject(phone+ Constants.UPDATE_PHONE,code,5L, TimeUnit.MINUTES); |
| | |
| | | */ |
| | | @ApiOperation(value = "获取验证码",notes = "获取验证码",tags = {"申请建桩获取验证码"}) |
| | | @GetMapping("/getApplyCode") |
| | | public AjaxResult getApplyCode(@RequestParam("phone") String phone) |
| | | { |
| | | public AjaxResult getApplyCode(@RequestParam("phone") String phone) { |
| | | String regex = "^1[3-9]\\d{9}$"; |
| | | if(!phone.matches(regex)){ |
| | | return AjaxResult.error("无效的手机号"); |
| | | } |
| | | Map<String, Object> cacheMap = redisService.getCacheMap("sms_code_" + phone); |
| | | if(null == cacheMap || cacheMap.size() == 0){ |
| | | cacheMap = new HashMap<>(); |
| | | cacheMap.put("timestamp", System.currentTimeMillis()); |
| | | cacheMap.put("time", 1); |
| | | redisService.setCacheMap("sms_code_" + phone, cacheMap, 300); |
| | | }else{ |
| | | Integer time = (Integer) cacheMap.get("time"); |
| | | Long timestamp = (Long) cacheMap.get("timestamp"); |
| | | if(System.currentTimeMillis() - timestamp > 60000){ |
| | | cacheMap.put("timestamp", System.currentTimeMillis()); |
| | | cacheMap.put("time", 1); |
| | | redisService.setCacheMap("sms_code_" + phone, cacheMap, 300); |
| | | } else if(System.currentTimeMillis() - timestamp <= 60000 && time < 3){ |
| | | time++; |
| | | cacheMap.put("time", time); |
| | | redisService.setCacheMap("sms_code_" + phone, cacheMap, 300); |
| | | }else if(System.currentTimeMillis() - timestamp < 60000 && time >= 3){ |
| | | return AjaxResult.error("请求太频繁,请稍后再试!"); |
| | | } |
| | | } |
| | | |
| | | String code = MsgUtil.createCode(); |
| | | redisService.setCacheObject(phone+ Constants.APPLY_CHARGING,code,5L, TimeUnit.MINUTES); |
| | | SendMessageDTO sendMessageDTO = new SendMessageDTO(); |
| | |
| | | package com.ruoyi.chargingPile.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.ruoyi.chargingPile.api.dto.GetPermissionConfigurationDTO; |
| | | 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.api.query.SetPermissionConfiguration; |
| | | import com.ruoyi.chargingPile.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.api.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.dto.ResetPassword; |
| | | import com.ruoyi.chargingPile.service.IPartnerService; |
| | | import com.ruoyi.common.core.domain.R; |
| | |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/balanceSheetRecord", "/partners", "/chargingPile/add", "/chargingPile/select", "/chargingPile/update"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping("/getPartnerList") |
| | | @ApiOperation(value = "获取合作商列表", tags = {"管理后台-合作商管理"}) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/partners/add"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping("/addPartner") |
| | | @ApiOperation(value = "添加合作商", tags = {"管理后台-合作商管理"}) |
| | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/partners/seleete", "/partners/update"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping("/getPartner/{id}") |
| | | @ApiOperation(value = "获取合作商详情", tags = {"管理后台-合作商管理", "管理后台-充电桩信息"}) |
| | |
| | | Partner partner = partnerService.getPartner(id); |
| | | return AjaxResult.success(partner); |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/getPartnerR/{id}") |
| | | public R<Partner> getPartnerR(@PathVariable("id") Integer id){ |
| | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/partners/update"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping("/editPartner") |
| | | @ApiOperation(value = "编辑合作商", tags = {"管理后台-合作商管理"}) |
| | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/partners/del"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @DeleteMapping("/delPartner") |
| | | @ApiOperation(value = "删除合作商", tags = {"管理后台-合作商管理"}) |
| | |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/partners/resetPassword"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping("/resetPassword") |
| | | @ApiOperation(value = "合作商重置密码", tags = {"管理后台-合作商管理"}) |
| | |
| | | |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/site/add", "/site/update"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping("/getPartner") |
| | | @ApiOperation(value = "获取所有合作商", tags = {"管理后台-站点管理"}) |
| | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/site/partner_authority"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping("/getPermissionConfiguration/{siteId}") |
| | | @ApiOperation(value = "获取合作商权限设置", tags = {"管理后台-站点管理"}) |
| | |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/site/partner_authority"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping("/setPermissionConfiguration/{siteId}") |
| | | @ApiOperation(value = "设置合作商权限", tags = {"管理后台-站点管理"}) |
| | |
| | | */ |
| | | @PostMapping("/authSite/{partnerId}") |
| | | public R<Set<Integer>> authSite(@PathVariable("partnerId") Integer partnerId, @RequestParam("siteMenu") String siteMenu){ |
| | | Set<Integer> integers = partnerService.authSite(partnerId, SiteMenu.valueOf(siteMenu)); |
| | | Set<Integer> integers = partnerService.authSite(partnerId, SiteMenu.getSiteMenu(siteMenu)); |
| | | return R.ok(integers); |
| | | } |
| | | |
| | | /** |
| | | * 判断合作商权限 |
| | | * @param partnerId |
| | | * @param siteId |
| | | * @param siteMenu |
| | | * @return |
| | | */ |
| | | @PostMapping("/authMenu/{partnerId}") |
| | | public Boolean authMenu(@PathVariable("partnerId") Integer partnerId, @RequestParam("siteId") Integer siteId, @RequestParam("siteMenu") String siteMenu){ |
| | | return partnerService.authMenu(partnerId, siteId, SiteMenu.getSiteMenu(siteMenu)); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.chargingPile.api.query.SiteDetailQuery; |
| | | import com.ruoyi.chargingPile.api.query.SiteQuery; |
| | | import com.ruoyi.chargingPile.api.vo.*; |
| | | import com.ruoyi.chargingPile.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.api.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.dto.ChargingPercentBack; |
| | | import com.ruoyi.common.core.dto.ChargingOrderGroup; |
| | | import com.ruoyi.common.core.dto.ChargingPercentProvinceDto; |
| | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.order.api.feignClient.ChargingOrderClient; |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalTime; |
| | | import java.time.temporal.ChronoUnit; |
| | | import java.util.*; |
| | |
| | | return R.ok(siteInfoVO); |
| | | } |
| | | |
| | | @RequiresPermissions(value = {"/systemUserManagement/update", "/site", "/platformRevenueAnalysis", "/chargingOperationAnalysis", |
| | | "/chargingUserAnalysis", "/operationMaintenanceAnalysis", "/chargingEquipmentMonitoring", "/activityExpense", "/chargeEvaluation/list", |
| | | "/parkingLot", "/workbench"}, logical = Logical.OR) |
| | | @GetMapping("/getSiteList") |
| | | @ApiOperation(value = "获取站点列表", tags = {"管理后台-站点管理"}) |
| | | public AjaxResult<PageInfo<GetSiteListDTO>> getSiteList(GetSiteList siteList){ |
| | |
| | | PageInfo<GetSiteListDTO> list = siteService.getSiteList1(userId); |
| | | return R.ok(list.getRecords()); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargeDistribution"}, logical = Logical.OR) |
| | | @GetMapping("/map/getSiteList") |
| | | @ApiOperation(value = "获取站点", tags = {"管理后台-数据分析-电站分析"}) |
| | | public R<List<GetSiteListDTO>> getMapSiteList(GetSiteList siteList){ |
| | |
| | | } |
| | | return R.ok(list.getRecords()); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargeDistribution"}, logical = Logical.OR) |
| | | @GetMapping("/map/getPercent") |
| | | @ApiOperation(value = "获取该充电站的利用率", tags = {"管理后台-数据分析-电站分析"}) |
| | | public R getPercent(Integer siteId){ |
| | |
| | | private SiteClient siteClient; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargeDistribution"}, logical = Logical.OR) |
| | | @PostMapping("/map/getPercentByprovinceCode") |
| | | @ApiOperation(value = "获取该充电站的利用率", tags = {"管理后台-数据分析-电站分析"}) |
| | | public R getPercentByCityCode(@RequestBody ChargingPercentProvinceDto chargingPercentProvinceDto){ |
| | |
| | | public AjaxResult<List<Site>> getSiteList1(){ |
| | | return AjaxResult.success(siteService.list(new QueryWrapper<>())); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/systemUserManagement", "/site", "/faultInformationList", "/repairRecord", "/balanceSheetRecord", "/chargingPileOrder", |
| | | "/chargeOrderMonitoring", "/chargingPile", "/chargingGun"}, logical = Logical.OR) |
| | | @GetMapping("/getSiteListGun") |
| | | @ApiOperation(value = "获取站点列表 不分页", tags = {"管理后台-接口信息使用"}) |
| | | public AjaxResult<List<Site>> getSiteListGun(){ |
| | | return AjaxResult.success(siteService.getSiteListGun()); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/parkingLot/add", "/parkingLot/select", "/parkingLot/update"}, logical = Logical.OR) |
| | | @GetMapping("/getSiteListParkLot") |
| | | @ApiOperation(value = "获取站点列表不分页", tags = {"管理后台-停车场绑定"}) |
| | | public AjaxResult<List<Site>> getSiteListParkLot(){ |
| | | return AjaxResult.success(siteService.getSiteListParkLot()); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "获取站点分页列表", tags = {"小程序-站点管理-首页"}) |
| | | @PostMapping("/pageList") |
| | | public AjaxResult<PageInfo<SiteVO>> pageList(@Validated @RequestBody SiteQuery query, HttpServletRequest request){ |
| | |
| | | return AjaxResult.success(siteService.pageList(query,isLogin)); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "获取站点列表", tags = {"小程序-站点管理-地图导航站点"}) |
| | | @PostMapping("/getMapSiteList") |
| | | public AjaxResult<List<SiteVO>> getMapSiteList(@Validated @RequestBody SiteQuery query, HttpServletRequest request){ |
| | |
| | | public AjaxResult<Map<String,ChargingGunCountVO>> getChargingGunCount(@RequestParam(value = "siteId")@ApiParam(value = "站点id", required = true)Integer siteId){ |
| | | return AjaxResult.success(chargingGunService.getChargingGunCount(siteId)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/site/add"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping("/addSite") |
| | | @ApiOperation(value = "添加站点", tags = {"管理后台-站点管理"}) |
| | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/site/update"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping("/getSiteInfo/{id}") |
| | | @ApiOperation(value = "获取站点详情", tags = {"管理后台-站点管理"}) |
| | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/site/update"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping("/editSite") |
| | | @ApiOperation(value = "编辑站点", tags = {"管理后台-站点管理"}) |
| | |
| | | return siteService.editSite(site); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/site/del", "/site/batch_del"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @DeleteMapping("/delSite") |
| | | @ApiOperation(value = "删除站点", tags = {"管理后台-站点管理"}) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/site/accounting_strategy"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping("/setAccountingStrategy/{id}") |
| | | @ApiOperation(value = "设置站点计费策略", tags = {"管理后台-站点管理"}) |
| | |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/roleManagement/add", "/roleManagement/info", "/roleManagement/update", "/systemNotification", "/chargingPeriodStatistics", |
| | | "/parkingPaymentOrder", "/generateStatement", "/chargingPile/add", "/chargingPile/select", "/chargingPile/update"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping("/getAllSiteList") |
| | | @ApiOperation(value = "获取所有站点数据", tags = {"管理后台-充电桩信息", "管理后台-系统用户管理", "管理后台-角色管理", "管理后台-系统通知", "管理后台-充电评价"}) |
| | |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.integration.api.feignClient.IntegrationClient; |
| | |
| | | /** |
| | | * 查询计费策略列表 |
| | | */ |
| | | @RequiresPermissions(value = {"/site/add", "/site/update", "/site/accounting_strategy", "/chargingPile/add_charging_gun", "/chargingPile/accountingStrategy", |
| | | "/chargingGun/update", "/accountingStrategy"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-计费策略"},value = "查询计费策略分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public AjaxResult<PageInfo<TAccountingStrategyVO>> pageList(@RequestBody TAccountingStrategyQuery query) { |
| | |
| | | /** |
| | | * 查询计费策略明细列表 |
| | | */ |
| | | @RequiresPermissions(value = {"/billingTemplateAudit/info", "/site/accounting_strategy", "/chargingGun/select_rate", "/accountingStrategy", |
| | | "/accountingStrategy/select", "/accountingStrategy/update"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-计费策略", "管理后台-站点管理", "管理后台-充电桩信息"},value = "查询计费策略明细列表") |
| | | @GetMapping(value = "/queryAccountingStrategyDetailByStrategyId") |
| | | public AjaxResult<List<TAccountingStrategyDetailVO>> queryAccountingStrategyDetailByStrategyId(@RequestParam("strategyId") Integer strategyId) { |
| | |
| | | /** |
| | | * 修改计费策略 |
| | | */ |
| | | @RequiresPermissions(value = {"/accountingStrategy/update"}, logical = Logical.OR) |
| | | @Log(title = "【计费策略】修改计费策略", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-计费策略", "管理后台-站点管理"},value = "修改计费策略") |
| | | @PostMapping(value = "/update") |
| | |
| | | /** |
| | | * 查看计费策略详情 |
| | | */ |
| | | @RequiresPermissions(value = {"/site/accounting_strategy", "/accountingStrategy/select", "/accountingStrategy/update"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-计费策略", "管理后台-站点管理"},value = "查看计费策略详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public AjaxResult<TAccountingStrategyVO> getDetailById(@RequestParam("id") Integer id) { |
| | |
| | | /** |
| | | * 删除计费策略 |
| | | */ |
| | | @RequiresPermissions(value = {"/accountingStrategy/del"}, logical = Logical.OR) |
| | | @Log(title = "【计费策略】删除计费策略", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-计费策略"},value = "删除计费策略") |
| | | @DeleteMapping(value = "/deleteById") |
| | |
| | | /** |
| | | * 批量删除计费策略 |
| | | */ |
| | | @RequiresPermissions(value = {"/accountingStrategy/del"}, logical = Logical.OR) |
| | | @Log(title = "【计费策略】批量删除计费策略", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-计费策略"},value = "批量删除计费策略") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | |
| | | List<TAccountingStrategyVO> list = accountingStrategyService.getPlatformAccountingStrategy(); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/billingTemplateAudit"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-申请表单-计费模板审核"},value = "查询计费审核分页列表") |
| | | @PostMapping(value = "/auth/pageList") |
| | | public AjaxResult<PageInfo<TAccountingStrategyVO>> authPageList(@RequestBody TAccountingStrategyQuery query) { |
| | |
| | | return AjaxResult.ok(accountingStrategyService.pageList1(query)); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/billingTemplateAudit/audit"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-申请表单-计费模板审核"},value = "审核") |
| | | @PostMapping(value = "/auth/pass") |
| | | @Log(title = "【计费模板审核】审核计费模板", businessType = BusinessType.OTHER,operatorType = OperatorType.MANAGE) |
| | |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.integration.api.feignClient.UploadRealTimeMonitoringDataClient; |
| | | import com.ruoyi.integration.api.model.UploadRealTimeMonitoringData; |
| | | import com.ruoyi.order.api.model.ExportUidDto; |
| | |
| | | dto.setAppUserId(userId); |
| | | return AjaxResult.ok(applyChargingPileService.save(dto)); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/pileApplication/add"}, logical = Logical.OR) |
| | | @Log(title = "【申请建桩】添加建桩申请", businessType = BusinessType.INSERT) |
| | | @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "建桩申请") |
| | | @PostMapping(value = "/manage/add") |
| | |
| | | |
| | | return AjaxResult.ok(applyChargingPileService.save(dto)); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/pileApplication"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "列表") |
| | | @PostMapping(value = "/page") |
| | | public AjaxResult<Page<TApplyChargingPile>> page(@RequestBody ApplyChargingQuery applyChargingQuery) { |
| | |
| | | .page(Page.of(applyChargingQuery.getPageCurr(), applyChargingQuery.getPageSize())); |
| | | return AjaxResult.ok(page); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/pileApplication/export"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "导出") |
| | | @PutMapping(value = "/export") |
| | | @Log(title = "【申请建桩】导出建桩申请列表", businessType = BusinessType.EXPORT) |
| | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargeBill/download"}, logical = Logical.OR) |
| | | @ApiOperation(value = "下载-已出账", tags = {"管理后台-充电算账单"}) |
| | | @PutMapping("/downloadBill") |
| | | @Log(title = "【充电算账单】下载算账单", businessType = BusinessType.EXPORT) |
| | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/accountSettlementStatement/download"}, logical = Logical.OR) |
| | | @ApiOperation(value = "下载", tags = {"管理后台-账户结算账单"}) |
| | | @PutMapping("/downloadAccount") |
| | | @Log(title = "【账户结算账单】下载账单", businessType = BusinessType.EXPORT) |
| | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/summarySettlement/export", "/balanceSheetRecord/download"}, logical = Logical.OR) |
| | | @ApiOperation(value = "导出", tags = {"管理后台-结算汇总表"}) |
| | | @PutMapping("/downloadSettlementTotal") |
| | | @Log(title = "【结算汇总表】下载汇总表", businessType = BusinessType.EXPORT) |
| | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private OtherClient otherClient; |
| | | @Resource |
| | |
| | | ); |
| | | return pattern.matcher(url).matches(); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/pileApplication/select"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "详情") |
| | | @PostMapping(value = "/detail/{id}") |
| | | public AjaxResult<TApplyChargingPile> detail(@PathVariable Integer id) { |
| | | |
| | | return AjaxResult.ok(applyChargingPileService.getById(id)); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/pileApplication/remark"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "修改备注") |
| | | @PostMapping(value = "/remark") |
| | | @Log(title = "【申请建桩】修改备注", businessType = BusinessType.UPDATE) |
| | |
| | | applyChargingPileService.updateById(byId); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @RequiresPermissions(value = {"/pileApplication/del"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "删除") |
| | | @DeleteMapping(value = "/remark") |
| | | @Log(title = "【申请建桩】删除建桩申请", businessType = BusinessType.DELETE) |
| | |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | /** |
| | | * 通过停车场id查询车库及车道信息 |
| | | */ |
| | | @RequiresPermissions(value = {"/parkingLot"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-车库"},value = "通过停车场id查询车库及车道信息") |
| | | @GetMapping(value = "/queryCarportByParkId") |
| | | public AjaxResult<List<TCarportVO>> queryCarportByParkId(@RequestParam(value = "parkingLotId", required = true) Integer parkingLotId) { |
| | |
| | | /** |
| | | * 添加车库管理 |
| | | */ |
| | | @RequiresPermissions(value = {"/parkingLot/add_garage"}, logical = Logical.OR) |
| | | @Log(title = "【车库】添加车库", businessType = BusinessType.INSERT) |
| | | @ApiOperation(tags = {"后台-车库"},value = "添加车库") |
| | | @PostMapping(value = "/add") |
| | |
| | | /** |
| | | * 修改车库 |
| | | */ |
| | | @RequiresPermissions(value = {"/parkingLot/update_garage"}, logical = Logical.OR) |
| | | @Log(title = "【车库】修改车库", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-车库"},value = "修改车库") |
| | | @PostMapping(value = "/update") |
| | |
| | | /** |
| | | * 查看车库详情 |
| | | */ |
| | | @RequiresPermissions(value = {"/parkingLot/update_garage"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-车库"},value = "查看车库详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public AjaxResult<TCarport> getDetailById(@RequestParam("id") Integer id) { |
| | |
| | | /** |
| | | * 删除车库 |
| | | */ |
| | | @RequiresPermissions(value = {"/parkingLot/del_garage"}, logical = Logical.OR) |
| | | @Log(title = "【车库】删除车库", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-车库"},value = "删除车库") |
| | | @DeleteMapping(value = "/deleteById") |
| | |
| | | /** |
| | | * 批量删除车库 |
| | | */ |
| | | @RequiresPermissions(value = {"/parkingLot/del_garage"}, logical = Logical.OR) |
| | | @Log(title = "【车库】批量删除车库", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-车库"},value = "批量删除车库") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.order.api.feignClient.ChargingOrderClient; |
| | |
| | | /** |
| | | * 查询充电枪列表 |
| | | */ |
| | | @RequiresPermissions(value = {"/chargingPile", "/chargingGun"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-充电枪", "管理后台-充电桩信息"},value = "查询充电枪分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public AjaxResult<PageInfo<TChargingGunVO>> pageList(@RequestBody TChargingGunQuery query) { |
| | |
| | | /** |
| | | * 添加充电枪管理 |
| | | */ |
| | | @RequiresPermissions(value = {"/chargingPile/add_charging_gun"}, logical = Logical.OR) |
| | | @Log(title = "【充电桩信息】添加充电枪", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"管理后台-充电桩信息"},value = "添加充电枪") |
| | | @PostMapping(value = "/add") |
| | |
| | | /** |
| | | * 修改充电枪 |
| | | */ |
| | | @RequiresPermissions(value = {"/chargingGun/update"}, logical = Logical.OR) |
| | | @Log(title = "【充电桩信息】修改充电枪", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"管理后台-充电桩信息"},value = "修改充电枪") |
| | | @PostMapping(value = "/update") |
| | |
| | | /** |
| | | * 查看充电枪详情 |
| | | */ |
| | | @RequiresPermissions(value = {"/chargingGun/update", "/chargingGun/select"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-充电枪", "管理后台-充电桩信息"},value = "查看充电枪详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public AjaxResult<TChargingGun> getDetailById(@RequestParam("id") Integer id) { |
| | |
| | | /** |
| | | * 删除充电枪 |
| | | */ |
| | | @RequiresPermissions(value = {"/chargingGun/del"}, logical = Logical.OR) |
| | | @Log(title = "【充电桩信息】删除充电枪", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"管理后台-充电桩信息"},value = "删除充电枪") |
| | | @DeleteMapping(value = "/deleteById") |
| | |
| | | /** |
| | | * 批量删除充电枪 |
| | | */ |
| | | @RequiresPermissions(value = {"/chargingGun/del"}, logical = Logical.OR) |
| | | @Log(title = "【充电桩信息】批量删除充电枪", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-充电枪"},value = "批量删除充电枪") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | |
| | | /** |
| | | * 结束充电 |
| | | */ |
| | | @RequiresPermissions(value = {"/chargingGun/end_charging"}, logical = Logical.OR) |
| | | @Log(title = "【充电桩信息】结束充电", businessType = BusinessType.OTHER,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-充电枪"},value = "结束充电") |
| | | @PutMapping(value = "/stopCharging") |
| | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargingGun/download_qr_code"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"管理后台-充电桩信息"},value = "下载二维码") |
| | | @GetMapping(value = "/downloadQRCode/{id}") |
| | | @Log(title = "【充电桩信息】下载二维码", businessType = BusinessType.OTHER,operatorType = OperatorType.MANAGE) |
| | |
| | | /** |
| | | * 设备状态统计 |
| | | */ |
| | | @RequiresPermissions(value = {"/workbench"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-工作台"},value = "设备状态统计") |
| | | @PutMapping(value = "/gunStatusStatistics") |
| | | public R<GunStatusStatisticsVO> gunStatusStatistics() { |
| | |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.order.api.feignClient.ChargingOrderClient; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import com.ruoyi.order.api.vo.TChargingOrderVo; |
| | |
| | | return R.ok(chargingPileService.list(Wrappers.lambdaQuery(TChargingPile.class) |
| | | .in(!siteIds.isEmpty(),TChargingPile::getSiteId,siteIds))); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargingPile", "/chargingGun"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping("/pageChargingPileList") |
| | | @ApiOperation(value = "获取充电桩列表数据", tags = {"管理后台-充电桩信息"}) |
| | |
| | | PageInfo<PageChargingPileListDTO> list = chargingPileService.pageChargingPileList(page); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargingPile/add"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @Log(title = "【充电桩信息】添加充电桩数据", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | @PostMapping("/addChargingPile") |
| | |
| | | public AjaxResult addChargingPile(@RequestBody TChargingPile chargingPile){ |
| | | return chargingPileService.addChargingPile(chargingPile); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargingPile/select", "/chargingPile/update"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping("/getChargingPile/{id}") |
| | | @ApiOperation(value = "获取充电桩详情数据", tags = {"管理后台-充电桩信息"}) |
| | |
| | | TChargingPile chargingPile = chargingPileService.getChargingPile(id); |
| | | return AjaxResult.success(chargingPile); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargingPile/update"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @Log(title = "【充电桩信息】编辑充电桩数据", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @PostMapping("/editChargingPile") |
| | |
| | | public AjaxResult editChargingPile(@RequestBody TChargingPile chargingPile){ |
| | | return chargingPileService.editChargingPile(chargingPile); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargingPile/del", "/chargingPile/batch_del"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @DeleteMapping("/delChargingPile") |
| | | @Log(title = "【充电桩信息】删除充电桩", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | |
| | | public AjaxResult delChargingPile(@RequestParam("id") Integer[] id){ |
| | | return chargingPileService.delChargingPile(id); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargingPile/accountingStrategy"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @Log(title = "【充电桩信息】批量设置计费策略", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @PostMapping("/batchSetAccountingStrategy") |
| | |
| | | chargingPileService.batchSetAccountingStrategy(setAccountingStrategy); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargingEquipmentMonitoring"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping("/chargeMonitoring/{siteId}") |
| | | @ApiOperation(value = "获取充电设施监控数据", tags = {"管理后台-充电设备监控"}) |
| | |
| | | ChargeMonitoring chargeMonitoring = chargingPileService.chargeMonitoring(siteId); |
| | | return AjaxResult.success(chargeMonitoring); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargingEquipmentMonitoring"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping("/getChargingGunCountMonitoring/{siteId}") |
| | | @ApiOperation(value = "获取充电枪各种状态汇总监控数据", tags = {"管理后台-充电设备监控"}) |
| | |
| | | ChargingGunCountMonitoring chargingGunCountMonitoring = chargingPileService.getChargingGunCountMonitoring(siteId); |
| | | return AjaxResult.success(chargingGunCountMonitoring); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/operationMaintenanceAnalysis", "/chargingEquipmentMonitoring"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping("/getChargingGunMonitoring") |
| | | @ApiOperation(value = "获取充电枪监控数据", tags = {"管理后台-充电设备监控"}) |
| | |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/systemNotification"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping("/chargingPileNotificationPageList") |
| | | @ApiOperation(value = "获取系统通知列表数据", tags = {"管理后台-系统通知"}) |
| | |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/systemNotification/del"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @DeleteMapping("/delChargingPileNotification") |
| | | @ApiOperation(value = "删除系统通知", tags = {"管理后台-系统通知"}) |
| | |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | * @param basePage |
| | | * @return |
| | | */ |
| | | @RequiresPermissions(value = {"/faultInformationList"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping("/getFaultMessageList") |
| | | @ApiOperation(value = "获取故障信息列表数据", tags = {"管理后台-设备监控"}) |
| | |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/faultInformationList/add"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping("/addFaultMessage") |
| | | @ApiOperation(value = "添加故障信息", tags = {"管理后台-设备监控"}) |
| | |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/faultInformationList/del"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @DeleteMapping("/delFaultMessage/{id}") |
| | | @ApiOperation(value = "删除故障信息", tags = {"管理后台-设备监控"}) |
| | |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | /** |
| | | * 查询停车场列表 |
| | | */ |
| | | @RequiresPermissions(value = {"/parkingLot"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-停车场"},value = "查询停车场分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public AjaxResult<PageInfo<TParkingLotVO>> pageList(@RequestBody TParkingLotQuery query) { |
| | |
| | | /** |
| | | * 查询停车场列表 |
| | | */ |
| | | @RequiresPermissions(value = {"/parkingOperationAnalysis", "/workbench"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-停车场"},value = "查询停车场列表") |
| | | @PostMapping(value = "/list") |
| | | public AjaxResult<List<TParkingLotVO>> list(@RequestBody TParkingLotQuery query) { |
| | |
| | | /** |
| | | * 添加停车场管理 |
| | | */ |
| | | @RequiresPermissions(value = {"/parkingLot/add"}, logical = Logical.OR) |
| | | @Log(title = "【停车场】添加停车场", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-停车场"},value = "添加停车场") |
| | | @PostMapping(value = "/add") |
| | |
| | | /** |
| | | * 修改停车场 |
| | | */ |
| | | @RequiresPermissions(value = {"/parkingLot/update"}, logical = Logical.OR) |
| | | @Log(title = "【停车场】修改停车场", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-停车场"},value = "修改停车场") |
| | | @PostMapping(value = "/update") |
| | |
| | | /** |
| | | * 查看停车场详情 |
| | | */ |
| | | @RequiresPermissions(value = {"/parkingLot/select", "/parkingLot/update"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-停车场"},value = "查看停车场详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public AjaxResult<TParkingLot> getDetailById(@RequestParam("id") Integer id) { |
| | |
| | | /** |
| | | * 删除停车场 |
| | | */ |
| | | @RequiresPermissions(value = {"/parkingLot/del"}, logical = Logical.OR) |
| | | @Log(title = "【停车场】删除停车场", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-停车场"},value = "删除停车场") |
| | | @DeleteMapping(value = "/deleteById") |
| | |
| | | /** |
| | | * 批量删除停车场 |
| | | */ |
| | | @RequiresPermissions(value = {"/parkingLot/batch_del"}, logical = Logical.OR) |
| | | @Log(title = "【停车场】批量删除停车场", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-停车场"},value = "批量删除停车场") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | |
| | | return R.ok(parkingLotService.getOne(Wrappers.lambdaQuery(TParkingLot.class) |
| | | .eq(TParkingLot::getSiteId, siteId))); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/paymentOrder/order"}, logical = Logical.OR) |
| | | @GetMapping(value = "/getRecordById") |
| | | public R<TParkingRecord> getRecordById(@RequestParam("id") Long id){ |
| | | return R.ok(parkingRecordService.getById(id)); |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping(value = "/getRecordAmount") |
| | | public R<BigDecimal> getRecordAmount(@RequestParam("sixBefore") LocalDate sixBefore){ |
| | | BigDecimal sum = parkingRecordService.getSum(sixBefore); |
| | |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.order.api.query.TOrderInvoiceQuery; |
| | | import com.ruoyi.order.api.vo.TCharingUserEquimentVO; |
| | | import com.ruoyi.order.api.vo.TOrderInvoiceVO; |
| | |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/parkingRecord"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-订单管理-停车记录"},value = "列表") |
| | | @PostMapping(value = "/page") |
| | | public R<Page<TParkingRecord>> page(@RequestBody ParkingRecordPageQuery query) { |
| | |
| | | } |
| | | return R.ok(page); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/parkingPaymentOrder"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-订单管理-停车记录"},value = "停车缴费订单列表") |
| | | @PostMapping(value = "/pageList") |
| | | public R<TParkingRecordPageInfoVO> pageList(@RequestBody ParkingRecordQuery query) { |
| | | return R.ok(parkingRecordService.pageList(query)); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/parkingPaymentOrder/export"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-订单管理-停车记录"},value = "导出") |
| | | @PutMapping("/export") |
| | | @Log(title = "【停车记录】导出停车记录", businessType = BusinessType.EXPORT,operatorType = OperatorType.MANAGE) |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation(tags = {"后台-订单管理-停车记录"},value = "详情") |
| | | @GetMapping(value = "/detail") |
| | | public R<TParkingRecord> detail(Long id) { |
| | | return R.ok(parkingRecordService.getById(id)); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/parkingRecord/already_appeared"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-订单管理-停车记录"},value = "出场") |
| | | @GetMapping(value = "/out") |
| | | @Log(title = "【停车记录】修改出场状态", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | |
| | | public void addParkingRecord(@RequestBody TParkingRecord parkingRecord){ |
| | | parkingRecordService.save(parkingRecord); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/parkingOperationAnalysis"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping(value = "/parking/data") |
| | | @ApiOperation(value = "统计", tags = {"管理后台-数据分析-车场运营分析"}) |
| | |
| | | return R.ok(tParkLotRecordVO); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | private static Map<String, Object> findMapWithTimeValue(List<Map<String, Object>> charMap1,String timeValue) { |
| | | for (Map<String, Object> map : charMap1) { |
| | | if (map.containsKey("time") && map.get("time").equals(timeValue)) { |
| | |
| | | } |
| | | return null; // 如果没有找到,返回 null |
| | | } |
| | | |
| | | |
| | | |
| | | private Map<String, Object> findMapWithDateValue(List<Map<String, Object>> list, String date) { |
| | | for (Map<String, Object> map : list) { |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/workbench"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping(value = "/parking/work") |
| | | @ApiOperation(value = "停车订单统计", tags = {"管理后台-工作台"}) |
| | |
| | | return R.ok(tParkLotRecordCountVo); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/workbench"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping(value = "/parking/work1") |
| | | @ApiOperation(value = "停车订单统计", tags = {"管理后台-工作台"}) |
| | |
| | | return R.ok(tParkLotRecordCountVo); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/workbench"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping(value = "/parking/income") |
| | | @ApiOperation(value = "停车收入统计", tags = {"管理后台-工作台"}) |
| | |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/repairRecord"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping("/getRepairList") |
| | | @ApiOperation(value = "获取报修记录列表数据", tags = {"管理后台-设备监控"}) |
| | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/repairRecord/add"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping("/addRepair") |
| | | @ApiOperation(value = "添加报修记录", tags = {"管理后台-设备监控"}) |
| | |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/repairRecord/del"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @DeleteMapping("/delRepair/{id}") |
| | | @ApiOperation(value = "删除报修记录", tags = {"管理后台-设备监控"}) |
| | |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.integration.api.feignClient.SwitchwayGateClient; |
| | | import com.ruoyi.integration.api.vo.SwitchwayGateReq; |
| | | import io.swagger.annotations.Api; |
| | |
| | | /** |
| | | * 添加车道管理 |
| | | */ |
| | | @RequiresPermissions(value = {"/parkingLot/add_lane"}, logical = Logical.OR) |
| | | @Log(title = "【停车场配置】添加车道", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-车道"},value = "添加车道") |
| | | @PostMapping(value = "/add") |
| | |
| | | /** |
| | | * 修改车道 |
| | | */ |
| | | @RequiresPermissions(value = {"/parkingLot/update_lane"}, logical = Logical.OR) |
| | | @Log(title = "【停车场配置】修改车道", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-车道"},value = "修改车道") |
| | | @PostMapping(value = "/update") |
| | |
| | | /** |
| | | * 查看车道详情 |
| | | */ |
| | | @RequiresPermissions(value = {"/parkingLot/update_lane"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-车道"},value = "查看车道详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public AjaxResult<TVehicleRamp> getDetailById(@RequestParam("id") Integer id) { |
| | |
| | | /** |
| | | * 删除车道 |
| | | */ |
| | | @RequiresPermissions(value = {"/parkingLot/del_lane"}, logical = Logical.OR) |
| | | @Log(title = "【停车场配置】删除车道", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-车道"},value = "删除车道") |
| | | @DeleteMapping(value = "/deleteById") |
| | |
| | | /** |
| | | * 批量删除车道 |
| | | */ |
| | | @RequiresPermissions(value = {"/parkingLot/del_lane"}, logical = Logical.OR) |
| | | @Log(title = "【停车场配置】批量删除车道", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-车道"},value = "批量删除车道") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | |
| | | /** |
| | | * 开关闸车道 |
| | | */ |
| | | @RequiresPermissions(value = {"/parkingLot/open_gate", "/parkingLot/close_gate"}, logical = Logical.OR) |
| | | @Log(title = "【停车场配置】开关闸车道", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(tags = {"后台-车道"},value = "开关闸车道") |
| | | @PostMapping(value = "/openOrDown") |
| | |
| | | import com.ruoyi.chargingPile.api.model.Partner; |
| | | import com.ruoyi.chargingPile.api.query.GetPartnerList; |
| | | import com.ruoyi.chargingPile.api.query.SetPermissionConfiguration; |
| | | import com.ruoyi.chargingPile.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.api.domain.SiteMenu; |
| | | 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; |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | |
| | | import com.ruoyi.chargingPile.api.model.*; |
| | | import com.ruoyi.chargingPile.api.query.GetPartnerList; |
| | | import com.ruoyi.chargingPile.api.query.SetPermissionConfiguration; |
| | | import com.ruoyi.chargingPile.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.api.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.dto.ResetPassword; |
| | | import com.ruoyi.chargingPile.mapper.PartnerMapper; |
| | | import com.ruoyi.chargingPile.service.*; |
| | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.other.api.feignClient.RoleSiteClient; |
| | | import com.ruoyi.other.api.feignClient.UserSiteClient; |
| | | import com.ruoyi.system.api.domain.SysRole; |
| | |
| | | import com.ruoyi.system.api.feignClient.SysUserRoleClient; |
| | | import com.ruoyi.system.api.model.GetSysRoleByIds; |
| | | import com.ruoyi.system.api.model.SysUserRoleVo; |
| | | import io.seata.core.context.RootContext; |
| | | import io.seata.core.exception.TransactionException; |
| | | import io.seata.spring.annotation.GlobalTransactional; |
| | | import io.seata.tm.api.GlobalTransaction; |
| | | import io.seata.tm.api.GlobalTransactionContext; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | import com.ruoyi.chargingPile.api.query.SiteQuery; |
| | | import com.ruoyi.chargingPile.api.vo.SiteDetailVO; |
| | | import com.ruoyi.chargingPile.api.vo.SiteVO; |
| | | import com.ruoyi.chargingPile.api.vo.TAccountingStrategyVO; |
| | | import com.ruoyi.chargingPile.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.api.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.mapper.SiteMapper; |
| | | import com.ruoyi.chargingPile.service.*; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.ServletUtils; |
| | | 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.model.SysUserRoleVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private TAccountingStrategyDetailService accountingStrategyDetailService; |
| | | |
| | | @Resource |
| | | private TPartnerSiteService partnerSiteService; |
| | | |
| | | |
| | | /** |
| | |
| | | if(null != one && !one.getCode().equals(site.getCode())){ |
| | | return AjaxResult.error("站点编号重复"); |
| | | } |
| | | |
| | | Site site1 = this.getById(site.getId()); |
| | | if(!site1.getPartnerId().equals(site.getPartnerId())){ |
| | | List<TPartnerSite> list = partnerSiteService.list(new LambdaQueryWrapper<TPartnerSite>().eq(TPartnerSite::getPartnerId, site1.getPartnerId()).eq(TPartnerSite::getSiteId, site.getId())); |
| | | for (TPartnerSite partnerSite : list) { |
| | | partnerSite.setPartnerId(site.getPartnerId()); |
| | | partnerSiteService.updateById(partnerSite); |
| | | } |
| | | } |
| | | |
| | | this.updateById(site); |
| | | return AjaxResult.success(); |
| | | } |
| | |
| | | import com.ruoyi.chargingPile.api.dto.TChargingGunDTO; |
| | | import com.ruoyi.chargingPile.api.feignClient.SiteClient; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.model.TAccountingStrategy; |
| | | import com.ruoyi.chargingPile.api.feignClient.SiteClient; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.chargingPile.api.query.TChargingGunQuery; |
| | | import com.ruoyi.chargingPile.api.vo.*; |
| | | import com.ruoyi.chargingPile.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.api.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.mapper.TChargingGunMapper; |
| | | import com.ruoyi.chargingPile.service.IPartnerService; |
| | | import com.ruoyi.chargingPile.service.TAccountingStrategyService; |
| | | import com.ruoyi.chargingPile.service.TChargingGunService; |
| | | import com.ruoyi.chargingPile.service.TChargingPileService; |
| | | import com.ruoyi.common.core.enums.status.ChargingGunModeEnum; |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPileNotification; |
| | | import com.ruoyi.chargingPile.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.api.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.mapper.TChargingPileNotificationMapper; |
| | | import com.ruoyi.chargingPile.service.IPartnerService; |
| | | import com.ruoyi.chargingPile.service.TChargingPileNotificationService; |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.feignClient.AppUserCarClient; |
| | | import com.ruoyi.account.api.model.TAppUserCar; |
| | |
| | | import com.ruoyi.chargingPile.api.model.*; |
| | | import com.ruoyi.chargingPile.api.query.BatchSetAccountingStrategy; |
| | | import com.ruoyi.chargingPile.api.query.PageChargingPileList; |
| | | import com.ruoyi.chargingPile.api.vo.TChargingGunVO; |
| | | import com.ruoyi.chargingPile.api.vo.TChargingPileVO; |
| | | import com.ruoyi.chargingPile.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.api.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.dto.ChargeMonitoring; |
| | | import com.ruoyi.chargingPile.dto.ChargingGunCountMonitoring; |
| | | import com.ruoyi.chargingPile.dto.ChargingGunMonitoring; |
| | |
| | | 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.domain.BasePojo; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | |
| | | import com.ruoyi.integration.api.feignClient.UploadRealTimeMonitoringDataClient; |
| | | import com.ruoyi.integration.api.model.QrCodeDelivery; |
| | | import com.ruoyi.integration.api.model.UploadRealTimeMonitoringData; |
| | | import com.ruoyi.integration.api.vo.AddDevice; |
| | | import com.ruoyi.integration.api.vo.AddDeviceResp; |
| | | import com.ruoyi.integration.api.vo.DeleteDeviceResp; |
| | | import com.ruoyi.order.api.feignClient.ChargingOrderAccountingStrategyClient; |
| | | import com.ruoyi.order.api.feignClient.ChargingOrderClient; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | Integer roleType = sysUser.getRoleType(); |
| | | Integer objectId = sysUser.getObjectId(); |
| | | if(2 == roleType){ |
| | | siteIds = partnerService.authSite(objectId, SiteMenu.SITE_LIST); |
| | | siteIds = partnerService.authSite(objectId, SiteMenu.CHARGING_FACILITY_MONITORING); |
| | | }else{ |
| | | //非管理员需要根据角色和用户配置查询允许的站点数据 |
| | | if(!SecurityUtils.isAdmin(tokenService.getLoginUser().getUserid())){ |
| | |
| | | Integer roleType = sysUser.getRoleType(); |
| | | Integer objectId = sysUser.getObjectId(); |
| | | if(2 == roleType){ |
| | | siteIds = partnerService.authSite(objectId, SiteMenu.SITE_LIST); |
| | | siteIds = partnerService.authSite(objectId, SiteMenu.CHARGING_FACILITY_MONITORING); |
| | | }else{ |
| | | //非管理员需要根据角色和用户配置查询允许的站点数据 |
| | | if(!SecurityUtils.isAdmin(tokenService.getLoginUser().getUserid())){ |
| | |
| | | Integer roleType = sysUser.getRoleType(); |
| | | Integer objectId = sysUser.getObjectId(); |
| | | if(2 == roleType){ |
| | | siteIds = partnerService.authSite(objectId, SiteMenu.SITE_LIST); |
| | | siteIds = partnerService.authSite(objectId, SiteMenu.CHARGING_FACILITY_MONITORING); |
| | | }else{ |
| | | //非管理员需要根据角色和用户配置查询允许的站点数据 |
| | | if(admin.getData()!=1){ |
| | |
| | | package com.ruoyi.chargingPile.service.impl; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.dto.SendMessageDTO; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.chargingPile.api.feignClient.PartnerClient; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.chargingPile.api.model.TFaultMessage; |
| | | import com.ruoyi.chargingPile.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.api.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.mapper.TFaultMessageMapper; |
| | | import com.ruoyi.chargingPile.service.*; |
| | | import com.ruoyi.common.core.constant.MsgConstants; |
| | | import com.ruoyi.common.core.utils.HttpUtils; |
| | | import com.ruoyi.common.core.utils.MsgUtil; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | |
| | | @Override |
| | | public List<TFaultMessage> getFaultMessageList(PageInfo<TFaultMessage> pageInfo, Integer siteId) { |
| | | //校验合作商权限 |
| | | SysUser sysUser = sysUserClient.getSysUser(SecurityUtils.getUserId()).getData(); |
| | | Integer roleType = sysUser.getRoleType(); |
| | | Integer objectId = sysUser.getObjectId(); |
| | | List<Integer> siteIds = new ArrayList<>(); |
| | | if(null == siteId || 0 == siteId){ |
| | | SysUser sysUser = sysUserClient.getSysUser(tokenService.getLoginUser().getUserid()).getData(); |
| | | Integer roleType = sysUser.getRoleType(); |
| | | Integer objectId = sysUser.getObjectId(); |
| | | //合作商 |
| | | if(roleType == 2){ |
| | | Set<Integer> data = partnerService.authSite(objectId, SiteMenu.SITE_LIST); |
| | | Set<Integer> data = partnerService.authSite(objectId, SiteMenu.FAULT_INFORMATION_LIST); |
| | | siteIds = new ArrayList<>(data); |
| | | }else{ |
| | | //非管理员需要根据角色和用户配置查询允许的站点数据 |
| | |
| | | }else{ |
| | | siteIds.add(siteId); |
| | | } |
| | | return this.baseMapper.getFaultMessageList(pageInfo, siteIds); |
| | | List<TFaultMessage> faultMessageList = this.baseMapper.getFaultMessageList(pageInfo, siteIds); |
| | | for (TFaultMessage faultMessage : faultMessageList) { |
| | | faultMessage.setAuthDelete(roleType == 1 ? true : partnerService.authMenu(objectId, faultMessage.getSiteId(), SiteMenu.FAULT_INFORMATION_LIST_DEL)); |
| | | } |
| | | return faultMessageList; |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.chargingPile.api.query.TMonitoringEquipmentQuery; |
| | | import com.ruoyi.chargingPile.api.vo.TMonitoringEquipmentVO; |
| | | import com.ruoyi.chargingPile.api.vo.TParkingLotVO; |
| | | import com.ruoyi.chargingPile.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.api.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.mapper.TMonitoringEquipmentMapper; |
| | | import com.ruoyi.chargingPile.service.IPartnerService; |
| | | import com.ruoyi.chargingPile.service.TMonitoringEquipmentService; |
| | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.other.api.feignClient.RoleSiteClient; |
| | | import com.ruoyi.other.api.feignClient.UserSiteClient; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | package com.ruoyi.chargingPile.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.chargingPile.api.dto.PageChargingPileListDTO; |
| | | import com.ruoyi.chargingPile.api.model.TParkingLot; |
| | | import com.ruoyi.chargingPile.api.query.TParkingLotQuery; |
| | | import com.ruoyi.chargingPile.api.vo.TParkingLotVO; |
| | | import com.ruoyi.chargingPile.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.api.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.mapper.TParkingLotMapper; |
| | | import com.ruoyi.chargingPile.service.IPartnerService; |
| | | import com.ruoyi.chargingPile.service.TParkingLotService; |
| | |
| | | import com.ruoyi.chargingPile.api.model.TParkingLot; |
| | | import com.ruoyi.chargingPile.api.model.TParkingRecord; |
| | | import com.ruoyi.chargingPile.api.query.ParkingRecordQuery; |
| | | import com.ruoyi.chargingPile.api.vo.TParkingLotVO; |
| | | import com.ruoyi.chargingPile.api.vo.TParkingRecordPageInfoVO; |
| | | import com.ruoyi.chargingPile.api.vo.TParkingRecordVO; |
| | | import com.ruoyi.chargingPile.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.dto.ParkingRecordQueryDto; |
| | | import com.ruoyi.chargingPile.mapper.SiteMapper; |
| | | import com.ruoyi.chargingPile.mapper.TParkingLotMapper; |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.dto.SendMessageDTO; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.chargingPile.api.feignClient.SiteClient; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.chargingPile.api.model.TRepair; |
| | | import com.ruoyi.chargingPile.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.api.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.mapper.TRepairMapper; |
| | | import com.ruoyi.chargingPile.service.*; |
| | | import com.ruoyi.common.core.constant.MsgConstants; |
| | | import com.ruoyi.common.core.utils.HttpUtils; |
| | | import com.ruoyi.common.core.utils.MsgUtil; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | |
| | | public List<TRepair> getRepairList(PageInfo<TRepair> pageInfo, String name, Integer siteId) { |
| | | //校验合作商权限 |
| | | List<Integer> siteIds = new ArrayList<>(); |
| | | SysUser sysUser = sysUserClient.getSysUser(SecurityUtils.getUserId()).getData(); |
| | | Integer roleType = sysUser.getRoleType(); |
| | | Integer objectId = sysUser.getObjectId(); |
| | | if(null == siteId || 0 == siteId){ |
| | | |
| | | SysUser sysUser = sysUserClient.getSysUser(tokenService.getLoginUser().getUserid()).getData(); |
| | | Integer roleType = sysUser.getRoleType(); |
| | | Integer objectId = sysUser.getObjectId(); |
| | | //合作商 |
| | | if(roleType == 2){ |
| | | Set<Integer> data = partnerService.authSite(objectId, SiteMenu.SITE_LIST); |
| | | Set<Integer> data = partnerService.authSite(objectId, SiteMenu.REPAIR_RECORD); |
| | | siteIds = new ArrayList<>(data); |
| | | }else{ |
| | | //非管理员需要根据角色和用户配置查询允许的站点数据 |
| | |
| | | }else{ |
| | | siteIds.add(siteId); |
| | | } |
| | | return this.baseMapper.getRepairList(pageInfo, name, siteIds); |
| | | List<TRepair> repairList = this.baseMapper.getRepairList(pageInfo, name, siteIds); |
| | | for (TRepair repair : repairList) { |
| | | repair.setAuthDelete(roleType == 1 ? true : partnerService.authMenu(objectId, repair.getSiteId(), SiteMenu.REPAIR_RECORD_DEL)); |
| | | } |
| | | return repairList; |
| | | } |
| | | |
| | | @Override |
| | |
| | | package com.ruoyi.chargingPile; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.ruoyi.chargingPile.api.dto.GetPermissionConfigurationDTO; |
| | | import com.ruoyi.chargingPile.service.IPartnerService; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = RuoYiChargingPileApplicationTests.class) |
| | | public class RuoYiChargingPileApplicationTests { |
| | | import javax.annotation.Resource; |
| | | |
| | | @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = RuoYiChargingPileApplication.class) |
| | | public class RuoYiChargingPileApplicationTests { |
| | | @Resource |
| | | private IPartnerService partnerService; |
| | | |
| | | @Test |
| | | public void test(){ |
| | | GetPermissionConfigurationDTO permissionConfiguration = partnerService.getPermissionConfiguration(9, 15); |
| | | System.err.println(JSON.toJSONString(permissionConfiguration)); |
| | | } |
| | | } |
| | |
| | | * Instance-Id配置 d21a37d3-c578-43aa-a1ab-be3854e7c337 |
| | | */ |
| | | private String instanceId; |
| | | /** |
| | | * 设备ID |
| | | */ |
| | | private String deviceId; |
| | | /** |
| | | * 是否开启测试 |
| | | */ |
| | | private Boolean test; |
| | | /** |
| | | * 测试设备ID |
| | | */ |
| | | private String testDeviceId; |
| | | /** |
| | | * 测试充电桩号 |
| | | */ |
| | | private String testDriverCode; |
| | | |
| | | } |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.File; |
| | | import java.io.FileOutputStream; |
| | | import java.io.FileWriter; |
| | |
| | | private MessageUtil messageUtil; |
| | | @Autowired |
| | | private IotMessageProduce iotMessageProduce; |
| | | @Autowired |
| | | @Resource |
| | | private AccountingStrategyDetailClient accountingStrategyDetailClient; |
| | | /** |
| | | * 设备消息监听 |
| | |
| | | OnlineReply onlineReply = new OnlineReply(); |
| | | onlineReply.setCharging_pile_code(onlineMessage.getCharging_pile_code()); |
| | | onlineReply.setOnline_result(0); |
| | | result = iotMessageProduce.sendMessage(deviceId, ServiceIdMenu.ONLINE_REPLY.getKey(), messageUtil.onlineReply(onlineReply)); |
| | | result = iotMessageProduce.sendMessage(onlineReply.getCharging_pile_code(), ServiceIdMenu.ONLINE_REPLY.getKey(), messageUtil.onlineReply(onlineReply)); |
| | | log.info("充电桩登录认证-返回结果:{}",result); |
| | | // 响应硬件 对时设置应答 |
| | | TimingSettingReply timingSettingReplyOnline = new TimingSettingReply(); |
| | | timingSettingReplyOnline.setCharging_pile_code(onlineMessage.getCharging_pile_code()); |
| | | timingSettingReplyOnline.setCurrent_time(CP56Time2aConverter.convertToCP56Time2a(new Date())); |
| | | iotMessageProduce.sendMessage(deviceId, ServiceIdMenu.TIMING_SETTING_REPLY.getKey(),messageUtil.timingSettingReply(timingSettingReplyOnline)); |
| | | iotMessageProduce.sendMessage(timingSettingReplyOnline.getCharging_pile_code(), ServiceIdMenu.TIMING_SETTING_REPLY.getKey(),messageUtil.timingSettingReply(timingSettingReplyOnline)); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | break; |
| | | case SendTagConstant.PING: |
| | |
| | | pong.setCharging_pile_code(pingMessage.getCharging_pile_code()); |
| | | pong.setCharging_gun_code(pingMessage.getCharging_gun_code()); |
| | | pong.setCharging_gun_status(0); |
| | | result = iotMessageProduce.sendMessage(deviceId, ServiceIdMenu.PONG.getKey(), messageUtil.pong(pong)); |
| | | result = iotMessageProduce.sendMessage(pong.getCharging_pile_code(), ServiceIdMenu.PONG.getKey(), messageUtil.pong(pong)); |
| | | log.info("充电桩心跳包-返回结果:{}",result); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | break; |
| | |
| | | billingModeVerifyReply.setBilling_model_result(1); |
| | | } |
| | | } |
| | | iotMessageProduce.sendMessage(deviceId, ServiceIdMenu.BILLING_MODE_VERIFY_REPLY.getKey(),messageUtil.billingModeVerifyReply(billingModeVerifyReply)); |
| | | iotMessageProduce.sendMessage(billingModeVerifyReply.getCharging_pile_code(), ServiceIdMenu.BILLING_MODE_VERIFY_REPLY.getKey(),messageUtil.billingModeVerifyReply(billingModeVerifyReply)); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | break; |
| | | case SendTagConstant.ACQUISITION_BILLING_MODE: |
| | |
| | | acquisitionBillingModeReply.setBilling_model_code(accountingStrategyDetail.getId().toString()); |
| | | acquisitionBillingModeReply.setCharging_pile_code(acquisitionBillingModeMessage.getCharging_pile_code()); |
| | | acquisitionBillingModeReply.setLoss_ratio(BigDecimal.ZERO); |
| | | iotMessageProduce.sendMessage(deviceId, ServiceIdMenu.ACQUISITION_BILLING_MODE_REPLY.getKey(),messageUtil.acquisitionBillingModeReply(acquisitionBillingModeReply)); |
| | | iotMessageProduce.sendMessage(acquisitionBillingModeReply.getCharging_pile_code(), ServiceIdMenu.ACQUISITION_BILLING_MODE_REPLY.getKey(),messageUtil.acquisitionBillingModeReply(acquisitionBillingModeReply)); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | break; |
| | | case SendTagConstant.UPLOAD_REAL_TIME_MONITORING_DATA: |
| | |
| | | platformConfirmationCharging.setAccount_balance(BigDecimal.ZERO); |
| | | platformConfirmationCharging.setAuthentication(1); |
| | | // TODO 若是失败,给出失败原因 |
| | | iotMessageProduce.sendMessage(deviceId, ServiceIdMenu.PLATFORM_CONFIRMATION_CHARGING.getKey(),messageUtil.platformConfirmationCharging(platformConfirmationCharging)); |
| | | iotMessageProduce.sendMessage(platformConfirmationCharging.getCharging_pile_code(), ServiceIdMenu.PLATFORM_CONFIRMATION_CHARGING.getKey(),messageUtil.platformConfirmationCharging(platformConfirmationCharging)); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | break; |
| | | case SendTagConstant.PLATFORM_START_CHARGING_REPLY: |
| | |
| | | ConfirmTransactionRecord confirmTransactionRecord = new ConfirmTransactionRecord(); |
| | | confirmTransactionRecord.setTransaction_serial_number(transactionRecordMessage.getTransaction_serial_number()); |
| | | confirmTransactionRecord.setConfirm_result(0); |
| | | iotMessageProduce.sendMessage(deviceId, ServiceIdMenu.CONFIRM_TRANSACTION_RECORD.getKey(),messageUtil.confirmTransactionRecord(confirmTransactionRecord)); |
| | | iotMessageProduce.sendMessage(confirmTransactionRecord.getTransaction_serial_number(), ServiceIdMenu.CONFIRM_TRANSACTION_RECORD.getKey(),messageUtil.confirmTransactionRecord(confirmTransactionRecord)); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | break; |
| | | case SendTagConstant.UPDATE_BALANCE_REPLY: |
| | |
| | | TimingSettingReply timingSettingReply = new TimingSettingReply(); |
| | | timingSettingReply.setCharging_pile_code(timingSettingMessage.getCharging_pile_code()); |
| | | timingSettingReply.setCurrent_time(CP56Time2aConverter.convertToCP56Time2a(new Date())); |
| | | iotMessageProduce.sendMessage(deviceId, ServiceIdMenu.TIMING_SETTING_REPLY.getKey(),messageUtil.timingSettingReply(timingSettingReply)); |
| | | iotMessageProduce.sendMessage(timingSettingReply.getCharging_pile_code(), ServiceIdMenu.TIMING_SETTING_REPLY.getKey(),messageUtil.timingSettingReply(timingSettingReply)); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | break; |
| | | case SendTagConstant.SETUP_BILLING_MODEL_REPLY: |
| | |
| | | |
| | | @Autowired |
| | | private IotBuilder iotBuilder; |
| | | |
| | | @Autowired |
| | | private IotDAConfig config; |
| | | |
| | | |
| | | /** |
| | | * 设备消息下发 |
| | | * @param deviceId 设备id |
| | | * @param name 消息名称 |
| | | * @param message 消息内容 |
| | | * @return |
| | | */ |
| | | @PostMapping("/sendMessage") |
| | | public String sendMessage(String deviceId, String name, JSONObject message){ |
| | | public String sendMessage(String code, String name, JSONObject message){ |
| | | CreateMessageRequest request = new CreateMessageRequest(); |
| | | request.withDeviceId(deviceId); |
| | | System.err.println(code); |
| | | System.err.println(JSONObject.toJSONString(config)); |
| | | if(config.getTest() && code.equals(config.getTestDriverCode())){ |
| | | request.withDeviceId(config.getTestDeviceId()); |
| | | }else{ |
| | | request.withDeviceId(config.getDeviceId()); |
| | | } |
| | | DeviceMessageRequest body = new DeviceMessageRequest(); |
| | | body.withMessageId(UUID.randomUUID().toString()); |
| | | body.withName(name); |
| | |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.ruoyi.integration.api.model.UploadRealTimeMonitoringData; |
| | | import com.ruoyi.integration.barrierGate.model.CloudParkingOrder; |
| | | import com.ruoyi.integration.barrierGate.server.ParkingOrderService; |
| | | import com.ruoyi.integration.mongodb.service.UploadRealTimeMonitoringDataService; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | |
| | | public class RuoYiIntegrationApplicationTests { |
| | | @Resource |
| | | private UploadRealTimeMonitoringDataService uploadRealTimeMonitoringDataService; |
| | | |
| | | @Resource |
| | | private ParkingOrderService parkingOrderService; |
| | | @Test |
| | | public void test(){ |
| | | List<UploadRealTimeMonitoringData> list = uploadRealTimeMonitoringDataService.getDataByOrderCode("CD93220241022154810850"); |
| | | System.err.println(JSON.toJSONString(list)); |
| | | String json = "{\"appkey\":\"842ae0c027e64b3590af9eea6\",\"enterChannel\":\"001\",\"enterChannelName\":\"进口\",\"enterDateTime\":\"2024-11-01T11:25:15.677Z\",\"id\":\"17B51DA0983C11EFA99CA979A8A8386B\",\"kind\":\"临时卡\",\"name\":\"临时识别\",\"plate\":\"川JD34056\",\"plateColor\":\"绿色\",\"sign\":\"29A902820C2657C51FBE90235152534F\"}"; |
| | | CloudParkingOrder order = JSON.parseObject(json, CloudParkingOrder.class); |
| | | parkingOrderService.cloudParkingInOrder(order); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.order.api.model.*; |
| | | import com.ruoyi.order.api.query.TOrderInvoiceQuery; |
| | | import com.ruoyi.order.api.vo.AccountListVO; |
| | |
| | | // chargingBillService.save(tChargingBill14); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/accountSettlementStatement"}, logical = Logical.OR) |
| | | @PostMapping(value = "/accountBillList") |
| | | @ApiOperation(value = "列表查询", tags = {"管理后台-账户结算账单"}) |
| | | public R<AccountListVO> accountBillList(@RequestBody ChargingListQuery dto) { |
| | |
| | | accountListVO.setOrderList(res.getExportList()); |
| | | return R.ok(accountListVO); |
| | | } |
| | | |
| | | @RequiresPermissions(value = {"/chargeBill"}, logical = Logical.OR) |
| | | @PostMapping(value = "/chargingBillList") |
| | | @ApiOperation(value = "充电算帐单列表查询", tags = {"管理后台-充电算账单"}) |
| | | public AjaxResult<ChargingBillVO> chargingBillList(@RequestBody ChargingListQuery dto) { |
| | |
| | | public R<ChargingBillVO> chargingBillListExport(String uid) { |
| | | return R.ok(null); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargeBill/export"}, logical = Logical.OR) |
| | | @ApiOperation(value = "导出", tags = {"管理后台-充电算账单"}) |
| | | @PutMapping("/export") |
| | | public void export(@RequestBody ChargingListQuery dto) |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/accountSettlementStatement/export"}, logical = Logical.OR) |
| | | @ApiOperation(value = "导出", tags = {"管理后台-账户结算账单"}) |
| | | @PutMapping("/exportAccount") |
| | | public void exportAccount(@RequestBody ChargingListQuery dto) |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "下载-未出账", tags = {"管理后台-充电算账单"}) |
| | | @PutMapping("/download") |
| | | public void download(@RequestBody ExportUidDto uid) |
| | |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.integration.api.feignClient.UploadRealTimeMonitoringDataClient; |
| | | import com.ruoyi.integration.api.model.UploadRealTimeMonitoringData; |
| | |
| | | private TSettlementConfirmService tSettlementConfirmService; |
| | | @Resource |
| | | private VipClient vipClient; |
| | | @PostMapping(value = "/chargingList") |
| | | @ApiOperation(value = "充电时段统计列表", tags = {"管理后台-财务结算"}) |
| | | public AjaxResult<ChargingOrderTimeVO> chargingList(@RequestBody ChargingListQuery dto) { |
| | | ChargingOrderTimeVO res = chargingOrderService.chargingList(dto); |
| | | return AjaxResult.success(res); |
| | | } |
| | | @GetMapping(value = "/chargingInfo") |
| | | @ApiOperation(value = "充电时段统计列表-查看详情", tags = {"管理后台-财务结算"}) |
| | | public AjaxResult<ChargingOrderListInfoVO> chargingInfo(String uid) { |
| | | ChargingOrderListInfoVO res = chargingOrderService.chargingInfo(uid); |
| | | return AjaxResult.success(res); |
| | | } |
| | | @Autowired |
| | | private SiteClient siteClient; |
| | | @Autowired |
| | |
| | | private TChargingOrderAccountingStrategyService tChargingOrderAccountingStrategyService; |
| | | @Resource |
| | | private UploadRealTimeMonitoringDataClient uploadRealTimeMonitoringDataClient; |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargingPeriodStatistics"}, logical = Logical.OR) |
| | | @PostMapping(value = "/chargingList") |
| | | @ApiOperation(value = "充电时段统计列表", tags = {"管理后台-财务结算"}) |
| | | public AjaxResult<ChargingOrderTimeVO> chargingList(@RequestBody ChargingListQuery dto) { |
| | | ChargingOrderTimeVO res = chargingOrderService.chargingList(dto); |
| | | return AjaxResult.success(res); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargingPeriodStatistics/order_info", "/chargingPeriodStatistics/charging_curve"}, logical = Logical.OR) |
| | | @GetMapping(value = "/chargingInfo") |
| | | @ApiOperation(value = "充电时段统计列表-查看详情", tags = {"管理后台-财务结算"}) |
| | | public AjaxResult<ChargingOrderListInfoVO> chargingInfo(String uid) { |
| | | ChargingOrderListInfoVO res = chargingOrderService.chargingInfo(uid); |
| | | return AjaxResult.success(res); |
| | | } |
| | | |
| | | @RequiresPermissions(value = {"/chargingPeriodStatistics/export"}, logical = Logical.OR) |
| | | @ApiOperation(value = "充电时段统计-导出", tags = {"管理后台-财务结算"}) |
| | | @PutMapping("/export") |
| | | public void export(@RequestBody ChargingListQuery dto) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/summarySettlement"}, logical = Logical.OR) |
| | | @GetMapping(value = "/settlementTotal") |
| | | @ApiOperation(value = "结算汇总-列表查询", tags = {"管理后台-财务结算"}) |
| | | @ApiParam(name = "time", value = "汇报时间2024-01") |
| | |
| | | SettlementTotalVO res = chargingOrderService.settlementTotal(time); |
| | | return AjaxResult.success(res); |
| | | } |
| | | |
| | | |
| | | |
| | | @GetMapping(value = "/settlementTotalR/{time}/{userId}") |
| | | public R<SettlementTotalVO> settlementTotalR(@PathVariable("time")String time,@PathVariable("userId")Long userId) { |
| | | time = time+"-01 00:00:00"; |
| | | SettlementTotalVO res = chargingOrderService.settlementTotalR(time,userId); |
| | | return R.ok(res); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/generateStatement"}, logical = Logical.OR) |
| | | @PostMapping(value = "/settlementAdd") |
| | | @ApiOperation(value = "结算确认表-生成/保存结算确认表", tags = {"管理后台-财务结算"}) |
| | | public R<TSettlementConfirm> settlementAdd(@RequestBody SettlementConfirmAdd dto) { |
| | | TSettlementConfirm res = chargingOrderService.settlementAdd(dto); |
| | | return R.ok(res); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/balanceSheetRecord"}, logical = Logical.OR) |
| | | @PostMapping(value = "/settlementList") |
| | | @ApiOperation(value = "结算表记录-列表查询", tags = {"管理后台-财务结算"}) |
| | | public R<PageInfo<TSettlementConfirm>> settlementList(@RequestBody SettlementListQuery dto) { |
| | | PageInfo<TSettlementConfirm> res = chargingOrderService.settlementList(dto); |
| | | return R.ok(res); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/balanceSheetRecord/del"}, logical = Logical.OR) |
| | | @GetMapping(value = "/deleteSettlement") |
| | | @ApiOperation(value = "结算表记录-删除", tags = {"管理后台-财务结算"}) |
| | | public R deleteSettlement(String uid) { |
| | | tSettlementConfirmService.removeById(uid); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | @GetMapping(value = "/downloadSettlement/{uid}") |
| | | public R<TSettlementConfirm> downloadSettlement(@PathVariable("uid") String uid) { |
| | | TSettlementConfirm byId = tSettlementConfirmService.getById(uid); |
| | |
| | | import com.ruoyi.common.core.dto.ChargingPercentProvinceDto; |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | |
| | | |
| | | @Resource |
| | | private TOrderInvoiceService invoiceService; |
| | | @Resource |
| | | private UploadRealTimeMonitoringDataClient uploadRealTimeMonitoringDataClient; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 远程调用 增加管理后台赠送会员记录 |
| | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/invoiceManagement/select_order", "/paymentOrder/order"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping(value = "/pay/order/list") |
| | | @ApiOperation(value = "列表", tags = {"管理后台-支付订单-订单信息"}) |
| | |
| | | public R refund(@RequestBody PayOrderRefundDto payOrderQueryDto) { |
| | | return chargingOrderService.payRefund(payOrderQueryDto); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/paymentOrder/order"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping(value = "/pay/order/pay/detail") |
| | | @ApiOperation(value = "支付信息", tags = {"管理后台-支付订单-订单信息"}) |
| | |
| | | |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/paymentOrder/refund"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping(value = "/pay/order/refund/list") |
| | | @ApiOperation(value = "列表", tags = {"管理后台-支付订单-退款订单"}) |
| | |
| | | return chargingOrderService.getRefundList(chargingRefundDto); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargingPileOrder"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping(value = "/chargingOrder") |
| | | @ApiOperation(value = "充电桩订单列表", tags = {"管理后台-订单管理"}) |
| | |
| | | TCharingOrderVO res = chargingOrderService.chargingOrder(dto); |
| | | return AjaxResult.success(res); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargingPileOrder/monitoring_record"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping(value = "/chargingOrderInfo") |
| | | @ApiOperation(value = "充电桩订单列表查看详情", tags = {"管理后台-订单管理"}) |
| | |
| | | @GetMapping(value = "/getMyChargingOrderInfo") |
| | | @ApiOperation(value = "获取充电记订单明细", tags = {"小程序-充电记录"}) |
| | | public AjaxResult<MyChargingOrderInfo> getMyChargingOrderInfo(String id) { |
| | | TChargingOrder tChargingOrder = chargingOrderService.getById(id); |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | if(!tChargingOrder.getAppUserId().equals(userId)){ |
| | | return AjaxResult.error("权限不足"); |
| | | } |
| | | MyChargingOrderInfo myChargingOrderInfo = chargingOrderService.getMyChargingOrderInfo(id); |
| | | return AjaxResult.success(myChargingOrderInfo); |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/platformRevenueAnalysis"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping(value = "/six/charge") |
| | | @ApiOperation(value = "电站收入分析", tags = {"后台-数据分析-平台收入分析"}) |
| | |
| | | |
| | | return months; |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/platformRevenueAnalysis"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping(value = "/six/circle") |
| | | @ApiOperation(value = "电站收入占比", tags = {"后台-数据分析-平台收入分析"}) |
| | |
| | | return R.ok(sixCircleDtos); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/platformRevenueAnalysis"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping(value = "/six/shop") |
| | | @ApiOperation(value = "购物收入", tags = {"后台-数据分析-平台收入分析"}) |
| | |
| | | |
| | | return months; |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/workbench"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping(value = "/work/shop") |
| | | @ApiOperation(value = "购物收入", tags = {"后台-工作台"}) |
| | |
| | | List<Map<String,Object >> shopData = shoppingOrderService.getData(statisticsQueryDto); |
| | | return R.ok(shopData); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/platformRevenueAnalysis"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping(value = "/six/vip") |
| | | @ApiOperation(value = "vip收入", tags = {"后台-数据分析-平台收入分析"}) |
| | |
| | | List<SixVipDto> vipDtos = vipOrderService.sixBefore(sixBefore); |
| | | return R.ok(vipDtos); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/platformRevenueAnalysis"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping(value = "/six/total") |
| | | @ApiOperation(value = "底部数据分类", tags = {"后台-数据分析-平台收入分析"}) |
| | |
| | | |
| | | return R.ok(map); |
| | | } |
| | | |
| | | @Resource |
| | | private UploadRealTimeMonitoringDataClient uploadRealTimeMonitoringDataClient; |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargeOrderMonitoring"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping(value = "/watch/chargingOrder") |
| | | @ApiOperation(value = "监控订单", tags = {"管理后台-订单管理"}) |
| | |
| | | |
| | | return R.ok(page); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargeOrderMonitoring/del"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping(value = "/watch/deletes") |
| | | @ApiOperation(value = "监控订单-删除", tags = {"管理后台-订单管理"}) |
| | |
| | | return R.ok(chargingOrderService.getOne(Wrappers.lambdaQuery(TChargingOrder.class) |
| | | .eq(TChargingOrder::getCode,code))); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargingOperationAnalysis"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping(value = "/charging/statistics") |
| | | @ApiOperation(value = "统计,充电订单分析", tags = {"管理后台-数据分析-充电运营分析"}) |
| | |
| | | return R.ok(tCharingOrderPowerMapVO); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargingUserAnalysis"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping(value = "/charging/users") |
| | | @ApiOperation(value = "除电站流量外", tags = {"管理后台-数据分析-充电用户分析"}) |
| | |
| | | return R.ok(tCharingUserMapVO); |
| | | |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargingUserAnalysis"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping(value = "/charging/sites") |
| | | @ApiOperation(value = "电站评价", tags = {"管理后台-数据分析-充电用户分析"}) |
| | |
| | | //流量 |
| | | return R.ok(tCharingUserEvaluateVO); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/operationMaintenanceAnalysis"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping(value = "/charging/equipment") |
| | | @ApiOperation(value = "电站评价", tags = {"管理后台-数据分析-设备运维分析"}) |
| | |
| | | // 格式化为两位小数 |
| | | return Double.parseDouble(DF.format(average)); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/workbench"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping(value = "/work/charge") |
| | | @ApiOperation(value = "上方充电数据统计", tags = {"管理后台-工作台"}) |
| | |
| | | tCharingWorkVO.setTotalChargingCapacity(totalChargingCapacity); |
| | | return R.ok(tCharingWorkVO); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/workbench"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping(value = "/work/chargeDetail") |
| | | @ApiOperation(value = "运营情况", tags = {"管理后台-工作台"}) |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/workbench"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping(value = "/work/use") |
| | | @ApiOperation(value = "利用率", tags = {"管理后台-工作台"}) |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/workbench"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping(value = "/work/shopOrder") |
| | | @ApiOperation(value = "购物订单统计", tags = {"管理后台-工作台"}) |
| | |
| | | counts.add(count1); |
| | | return R.ok(counts); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/workbench"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping(value = "/work/invoice") |
| | | @ApiOperation(value = "开票统计", tags = {"管理后台-工作台"}) |
| | |
| | | counts.add(count1); |
| | | return R.ok(counts); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/workbench"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping(value = "/work/users/count") |
| | | @ApiOperation(value = "用户数量", tags = {"管理后台-工作台"}) |
| | |
| | | import com.ruoyi.common.core.dto.ExchangeBackDto; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.api.model.TExchangeOrder; |
| | | import com.ruoyi.order.api.model.TShoppingOrder; |
| | |
| | | private GoodsClient goodsClient; |
| | | @Resource |
| | | private CouponClient couponClient; |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private SysUserClient sysUserClient; |
| | | |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/exchangeOrder"}, logical = Logical.OR) |
| | | @PostMapping("/getExchangeOrderList") |
| | | @ApiOperation(value = "列表查询", tags = {"管理后台-兑换订单"}) |
| | | public AjaxResult<PageInfo<TExchangeOrder>> getExchangeOrderList(@RequestBody ShoppingOrderQuery query) { |
| | |
| | | PageInfo<TExchangeOrder> res = exchangeOrderService.pageList(query); |
| | | return AjaxResult.success(res); |
| | | } |
| | | @Resource |
| | | private SysUserClient sysUserClient; |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/exchangeOrder/deliver_goods"}, logical = Logical.OR) |
| | | @GetMapping("/getShoppingOrderInfoById") |
| | | @ApiOperation(value = "根据订单id查看订单详情", tags = {"管理后台-兑换订单"}) |
| | | public AjaxResult<TExchangeOrder> getShoppingOrderList(String id) { |
| | |
| | | } |
| | | return AjaxResult.success(byId); |
| | | } |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/exchangeOrder/del"}, logical = Logical.OR) |
| | | @GetMapping("/deleteShoppingOrder") |
| | | @ApiOperation(value = "批量删除订单", tags = {"管理后台-兑换订单"}) |
| | | public AjaxResult<TExchangeOrder> deleteShoppingOrder(String ids) { |
| | | exchangeOrderService.removeBatchByIds(Arrays.asList(ids.split(","))); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/exchangeOrder/cancel"}, logical = Logical.OR) |
| | | @GetMapping("/cancelShoppingOrder") |
| | | @ApiOperation(value = "取消订单", tags = {"管理后台-兑换订单"}) |
| | | public AjaxResult cancelShoppingOrder(String id) { |
| | |
| | | appUserClient.refundPoints(byId.getAppUserId()+"-"+points); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/exchangeOrder/deliver_goods"}, logical = Logical.OR) |
| | | @GetMapping("/consignerShoppingOrder") |
| | | @ApiOperation(value = "发货", tags = {"管理后台-兑换订单"}) |
| | | public AjaxResult consignerShoppingOrder(String id,String companyName,String code) { |
| | |
| | | @ApiOperation(value = "获取兑换订单详情", tags = {"小程序-兑换记录"}) |
| | | public AjaxResult<ExchangeOrderGoodsInfo> getGoodsExchangeOrder(@PathVariable String id){ |
| | | ExchangeOrderGoodsInfo goodsExchangeOrder = exchangeOrderService.getGoodsExchangeOrder(id); |
| | | |
| | | TExchangeOrder exchangeOrder = exchangeOrderService.getById(id); |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | if(!exchangeOrder.getAppUserId().equals(userId)){ |
| | | return AjaxResult.error("权限不足"); |
| | | } |
| | | return AjaxResult.success(goodsExchangeOrder); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "确认收货操作", tags = {"小程序-兑换记录"}) |
| | | public AjaxResult confirmReceipt(@PathVariable String id){ |
| | | TExchangeOrder tExchangeOrder = exchangeOrderService.getById(id); |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | if(!tExchangeOrder.getAppUserId().equals(userId)){ |
| | | return AjaxResult.error("权限不足"); |
| | | } |
| | | if(tExchangeOrder.getStatus() == 3){ |
| | | return AjaxResult.error("不能重复确认收货"); |
| | | } |
| | |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.order.api.model.*; |
| | |
| | | this.orderAppealService = orderAppealService; |
| | | this.tokenService = tokenService; |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/appealOrder"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-订单管理-订单申诉"},value = "列表") |
| | | @PostMapping(value = "/manage/pageList") |
| | | public R<Page<TOrderAppeal>> managePageList(@RequestBody ManageOrderAppealQuery manageOrderAppealQuery) { |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/appealOrder/del"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-订单管理-订单申诉"},value = "删除") |
| | | @DeleteMapping (value = "/manage/delete") |
| | | public R<Page<TOrderAppeal>> delete(String ids) { |
| | | orderAppealService.removeBatchByIds(Arrays.asList(ids.split(","))); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/appealOrder/select", "/appealOrder/handle"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-订单管理-订单申诉"},value = "后台-订单管理-订单申诉") |
| | | @PostMapping(value = "/manage/feedback") |
| | | public R manageFeedback(@RequestBody ManageFeedbackDto manageFeedbackDto) { |
| | |
| | | @GetMapping(value = "/getDetailById") |
| | | @ApiOperation(tags = {"小程序-订单申诉"},value = "查询订单申诉详情") |
| | | public AjaxResult<TOrderAppealVO> getDetailById(String id) { |
| | | TOrderAppeal orderAppeal = orderAppealService.getById(id); |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | if(!orderAppeal.getAppUserId().equals(userId)){ |
| | | return AjaxResult.error("权限不足"); |
| | | } |
| | | return AjaxResult.ok(orderAppealService.getDetailById(id)); |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.api.model.TOrderEvaluate; |
| | | import com.ruoyi.order.api.model.TOrderEvaluateTag; |
| | | import com.ruoyi.order.api.query.TOrderEvaluateQuery; |
| | |
| | | @Resource |
| | | private TOrderEvaluateTagService orderEvaluateTagService; |
| | | |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargeEvaluation/list"}, logical = Logical.OR) |
| | | @PostMapping(value = "/getPageList") |
| | | @ApiOperation(value = "获取充电评价列表", tags = {"管理后台-充电评价"}) |
| | | public AjaxResult<PageInfo<GetOrderEvaluatePageListDTO>> getPageList(@RequestBody GetOrderEvaluatePageList pageList){ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargeEvaluation/del"}, logical = Logical.OR) |
| | | @DeleteMapping(value = "/delOrderEvaluate/{id}") |
| | | @ApiOperation(value = "删除充电评价", tags = {"管理后台-充电评价"}) |
| | | public AjaxResult delOrderEvaluate(@PathVariable("id") Long id){ |
| | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargeEvaluation/reply"}, logical = Logical.OR) |
| | | @PostMapping(value = "/replyEvaluation") |
| | | @ApiOperation(value = "充电评价回复", tags = {"管理后台-充电评价"}) |
| | | public AjaxResult replyEvaluation(@RequestBody ReplyEvaluationVO vo){ |
| | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargeEvaluation/del"}, logical = Logical.OR) |
| | | @DeleteMapping(value = "/delOrderEvaluateReply/{id}") |
| | | @ApiOperation(value = "删除充电评价回复", tags = {"管理后台-充电评价"}) |
| | | public AjaxResult delOrderEvaluateReply(@PathVariable("id") Long id){ |
| | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.api.model.TOrderInvoice; |
| | | import com.ruoyi.order.api.query.TOrderInvoiceQuery; |
| | | import com.ruoyi.order.api.vo.TOrderInvoiceVO; |
| | |
| | | @Resource |
| | | private TOrderInvoiceService orderInvoiceService; |
| | | |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | public AjaxResult addOrderInvoice(@RequestBody AddOrderInvoice addOrderInvoice){ |
| | | return orderInvoiceService.addOrderInvoice(addOrderInvoice); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/invoiceManagement"}, logical = Logical.OR) |
| | | @PostMapping("/pageList") |
| | | @ApiOperation(value = "查询开票分页列表", tags = {"管理后台-发票管理"}) |
| | | public AjaxResult<PageInfo<TOrderInvoiceVO>> pageList(@RequestBody TOrderInvoiceQuery query){ |
| | | return AjaxResult.success(orderInvoiceService.pageList(query)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/invoiceManagement/accept_hear_case"}, logical = Logical.OR) |
| | | @GetMapping("/uploadPdf") |
| | | @ApiOperation(value = "上传发票", tags = {"管理后台-发票管理"}) |
| | | public AjaxResult<String> uploadPdf(@RequestParam("id") Long id, |
| | |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/invoiceManagement"}, logical = Logical.OR) |
| | | @PostMapping("/statusCount") |
| | | @ApiOperation(value = "查询开票状态数量", tags = {"管理后台-发票管理"}) |
| | | public AjaxResult<Map<String,Integer>> statusCount(@RequestBody TOrderInvoiceQuery query){ |
| | |
| | | /** |
| | | * 发票管理导出 |
| | | */ |
| | | @RequiresPermissions(value = {"/invoiceManagement/export"}, logical = Logical.OR) |
| | | @ApiOperation(value = "发票管理导出", tags = {"管理后台-发票管理"}) |
| | | @Log(title = "发票管理导出", businessType = BusinessType.EXPORT) |
| | | @PutMapping("/export") |
| | |
| | | @GetMapping("/getMyOrderInvoiceInfo/{id}") |
| | | @ApiOperation(value = "获取开票记录详情", tags = {"小程序-充电发票"}) |
| | | public AjaxResult<MyOrderInvoiceInfo> getMyOrderInvoiceInfo(@PathVariable String id){ |
| | | TOrderInvoice orderInvoice = orderInvoiceService.getById(id); |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | if(!orderInvoice.getAppUserId().equals(userId)){ |
| | | return AjaxResult.error("权限不足"); |
| | | } |
| | | MyOrderInvoiceInfo myOrderInvoiceInfo = orderInvoiceService.getMyOrderInvoiceInfo(id); |
| | | return AjaxResult.success(myOrderInvoiceInfo); |
| | | } |
| | |
| | | import com.ruoyi.common.core.utils.OrderCodeUtil; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.api.model.TChargingOrderRefund; |
| | | import com.ruoyi.order.api.model.TExchangeOrder; |
| | |
| | | } |
| | | } |
| | | |
| | | @RequiresPermissions(value = {"/shoppingOrder"}, logical = Logical.OR) |
| | | @PostMapping("/getShoppingOrderList") |
| | | @ApiOperation(value = "列表查询", tags = {"管理后台-购物订单"}) |
| | | public AjaxResult<PageInfo<TShoppingOrder>> getShoppingOrderList(@RequestBody ShoppingOrderQuery query) { |
| | |
| | | return AjaxResult.success(res); |
| | | } |
| | | |
| | | @RequiresPermissions(value = {"/shoppingOrder/deliver_goods"}, logical = Logical.OR) |
| | | @GetMapping("/getShoppingOrderInfoById") |
| | | @ApiOperation(value = "根据订单id查看订单详情", tags = {"管理后台-购物订单"}) |
| | | public AjaxResult<TShoppingOrder> getShoppingOrderList(String id) { |
| | |
| | | return AjaxResult.success(byId); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/shoppingOrder/del"}, logical = Logical.OR) |
| | | @GetMapping("/deleteShoppingOrder") |
| | | @ApiOperation(value = "批量删除订单", tags = {"管理后台-购物订单"}) |
| | | public AjaxResult<TShoppingOrder> deleteShoppingOrder(String ids) { |
| | | shoppingOrderService.removeBatchByIds(Arrays.asList(ids.split(","))); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/shoppingOrder/cancel"}, logical = Logical.OR) |
| | | @GetMapping("/cancelShoppingOrder") |
| | | @ApiOperation(value = "取消订单", tags = {"管理后台-购物订单"}) |
| | | public AjaxResult cancelShoppingOrder(String id) { |
| | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/shoppingOrder/deliver_goods"}, logical = Logical.OR) |
| | | @GetMapping("/consignerShoppingOrder") |
| | | @ApiOperation(value = "发货", tags = {"管理后台-购物订单"}) |
| | | public AjaxResult consignerShoppingOrder(String id, String companyName, String code) { |
| | |
| | | @GetMapping("/getMyShoppingOrderInfo/{id}") |
| | | @ApiOperation(value = "获取购买订单详情", tags = {"小程序-商城购买订单", "管理后台-支付订单-订单信息"}) |
| | | public AjaxResult<MyShoppingOrderInfo> getMyShoppingOrderInfo(@PathVariable String id) { |
| | | TShoppingOrder shoppingOrder = shoppingOrderService.getById(id); |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | if(!shoppingOrder.getAppUserId().equals(userId)){ |
| | | return AjaxResult.error("权限不足"); |
| | | } |
| | | MyShoppingOrderInfo info = shoppingOrderService.getMyShoppingOrderInfo(id); |
| | | return AjaxResult.success(info); |
| | | } |
| | |
| | | @ApiOperation(value = "确认收货操作", tags = {"小程序-商城购买订单"}) |
| | | public AjaxResult confirmReceipt(@PathVariable String id) { |
| | | TShoppingOrder shoppingOrder = shoppingOrderService.getById(id); |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | if(!shoppingOrder.getAppUserId().equals(userId)){ |
| | | return AjaxResult.error("权限不足"); |
| | | } |
| | | if (shoppingOrder.getStatus() == 3) { |
| | | return AjaxResult.error("不能重复确认收货"); |
| | | } |
| | |
| | | @PutMapping("/cancelOrder/{id}") |
| | | @ApiOperation(value = "取消订单操作", tags = {"小程序-商城购买订单"}) |
| | | public AjaxResult cancelOrder(@PathVariable String id) { |
| | | TShoppingOrder shoppingOrder = shoppingOrderService.getById(id); |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | if(!shoppingOrder.getAppUserId().equals(userId)){ |
| | | return AjaxResult.error("权限不足"); |
| | | } |
| | | return shoppingOrderService.cancelOrder(id); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.order.api.model.TExchangeOrder; |
| | | import com.ruoyi.order.api.model.TShoppingOrder; |
| | | import com.ruoyi.order.api.model.TVipOrder; |
| | |
| | | private TVipOrderService vipOrderService; |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | @Resource |
| | | private OtherClient otherClient; |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/vipOrder"}, logical = Logical.OR) |
| | | @PostMapping("/getVipOrderList") |
| | | @ApiOperation(value = "列表查询", tags = {"管理后台-会员订单"}) |
| | | public AjaxResult<PageInfo<TVipOrder>> getVipOrderList(@RequestBody VipShoppingOrderQuery query) { |
| | |
| | | PageInfo<TVipOrder> res = vipOrderService.pageList(query); |
| | | return AjaxResult.success(res); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/vipOrder/add"}, logical = Logical.OR) |
| | | @PostMapping("/addVipOrder") |
| | | @ApiOperation(value = "添加会员订单", tags = {"管理后台-会员订单"}) |
| | | public R<Long> addVipOrder(@RequestBody TVipOrder dto) { |
| | |
| | | vipOrderService.saveOrUpdate(dto); |
| | | return R.ok(dto.getId()); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/vipOrder/del"}, logical = Logical.OR) |
| | | @GetMapping("/deleteVipOrder") |
| | | @ApiOperation(value = "批量删除会员订单", tags = {"管理后台-会员订单"}) |
| | | public AjaxResult deleteVipOrder(String id) { |
| | | vipOrderService.removeBatchByIds(Arrays.asList(id.split(","))); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/callBack") |
| | | public R callBack(@RequestParam("code")String code,@RequestParam("outTradeNo")String outTradeNo){ |
| | |
| | | } |
| | | |
| | | |
| | | @Resource |
| | | private OtherClient otherClient; |
| | | |
| | | |
| | | @ApiOperation(tags = {"后台-申请表单-集团用户"},value = "导出") |
| | | @PutMapping(value = "/export") |
| | |
| | | private List<String> tags; |
| | | @ApiModelProperty("回复内容") |
| | | private String recover; |
| | | @ApiModelProperty("回复按钮权限") |
| | | private Boolean authReply; |
| | | @ApiModelProperty("删除按钮权限") |
| | | private Boolean authDelete; |
| | | } |
| | |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | TChargingOrder one = this.getOne(new LambdaQueryWrapper<TChargingOrder>().eq(TChargingOrder::getAppUserId, userId).eq(TChargingOrder::getChargingGunId, id) |
| | | .eq(TChargingOrder::getRechargePaymentStatus, 2).eq(TChargingOrder::getDelFlag, 0).orderByDesc(TChargingOrder::getStartTime).last(" limit 0, 1")); |
| | | if(null == one){ |
| | | if(null == one || !one.getAppUserId().equals(userId)){ |
| | | return null; |
| | | } |
| | | ChargingDetails chargingDetails = new ChargingDetails(); |
| | |
| | | } |
| | | if(status == 4 || status == 5){ |
| | | return AjaxResult.error("不能重复操作"); |
| | | } |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | if(!order.getAppUserId().equals(userId)){ |
| | | return AjaxResult.error("权限不足"); |
| | | } |
| | | TChargingOrder chargingOrder = new TChargingOrder(); |
| | | chargingOrder.setId(Long.valueOf(id)); |
| | |
| | | public EndOfChargePageInfo getEndOfChargePageInfo(String id) { |
| | | EndOfChargePageInfo info = new EndOfChargePageInfo(); |
| | | TChargingOrder chargingOrder = this.getById(id); |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | if(!chargingOrder.getAppUserId().equals(userId)){ |
| | | throw new RuntimeException("权限不足"); |
| | | } |
| | | info.setId(id); |
| | | info.setCode(chargingOrder.getCode()); |
| | | info.setPaymentAmount(chargingOrder.getPaymentAmount()); |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import cn.hutool.db.DaoTemplate; |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import com.ruoyi.account.api.feignClient.AppUserIntegralChangeClient; |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | import com.ruoyi.account.api.model.TAppUserCar; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | import com.ruoyi.account.api.model.TAppUserIntegralChange; |
| | | import com.ruoyi.chargingPile.api.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.api.feignClient.PartnerClient; |
| | | import com.ruoyi.chargingPile.api.feignClient.SiteClient; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.vo.TAccountingStrategyVO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.HttpUtils; |
| | | 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.model.SysUserRoleVo; |
| | | import io.seata.spring.annotation.GlobalTransactional; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | |
| | | |
| | | //校验合作商权限 |
| | | List<Integer> siteIds = new ArrayList<>(); |
| | | SysUser sysUser = sysUserClient.getSysUser(SecurityUtils.getUserId()).getData(); |
| | | Integer roleType = sysUser.getRoleType(); |
| | | Integer objectId = sysUser.getObjectId(); |
| | | if(null == pageList.getSiteId() || 0 == pageList.getSiteId()){ |
| | | SysUser sysUser = sysUserClient.getSysUser(tokenService.getLoginUser().getUserid()).getData(); |
| | | Integer roleType = sysUser.getRoleType(); |
| | | Integer objectId = sysUser.getObjectId(); |
| | | //合作商 |
| | | if(roleType == 2){ |
| | | Set<Integer> data = partnerService.authSite(objectId, "/data/site").getData(); |
| | | Set<Integer> data = partnerService.authSite(objectId, SiteMenu.CHARGE_EVALUATION.getValue()).getData(); |
| | | siteIds = new ArrayList<>(data); |
| | | }else{ |
| | | //非管理员需要根据角色和用户配置查询允许的站点数据 |
| | |
| | | List<String> collect = data.stream().map(TEvaluationTag::getName).collect(Collectors.toList()); |
| | | dto.setTags(collect); |
| | | } |
| | | dto.setAuthReply(roleType == 1 ? true : partnerService.authMenu(objectId, dto.getSiteId(), SiteMenu.CHARGE_EVALUATION_ANSWER.getValue())); |
| | | dto.setAuthDelete(roleType == 1 ? true : partnerService.authMenu(objectId, dto.getSiteId(), SiteMenu.CHARGE_EVALUATION_DEL.getValue())); |
| | | } |
| | | return pageInfo.setRecords(list); |
| | | } |
| | |
| | | public OrderEvaluateVo getOrderEvaluate(String orderId, Integer orderType) { |
| | | TOrderEvaluate orderEvaluate = this.getOne(new LambdaQueryWrapper<TOrderEvaluate>().eq(TOrderEvaluate::getOrderId, orderId).eq(TOrderEvaluate::getOrderType, orderType)); |
| | | if(null != orderEvaluate){ |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | if(!orderEvaluate.getAppUserId().equals(userId)){ |
| | | throw new RuntimeException("权限不足"); |
| | | } |
| | | OrderEvaluateVo orderEvaluateVo = new OrderEvaluateVo(); |
| | | BeanUtils.copyProperties(orderEvaluate, orderEvaluateVo); |
| | | List<TOrderEvaluateTag> tOrderEvaluateTags = orderEvaluateTagMapper.selectList(new LambdaQueryWrapper<TOrderEvaluateTag>().eq(TOrderEvaluateTag::getOrderEvaluateId, orderEvaluate.getId())); |
| | |
| | | import com.ruoyi.integration.api.model.UploadRealTimeMonitoringData; |
| | | import com.ruoyi.order.api.feignClient.AccountingStrategyDetailOrderClient; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import com.ruoyi.order.api.model.TChargingOrderAccountingStrategy; |
| | | import com.ruoyi.order.api.vo.AccountingStrategyDetailOrderVo; |
| | | import com.ruoyi.order.api.vo.ChargingOrderInfoVO; |
| | | import com.ruoyi.order.api.vo.TransactionRecordMessageVO; |
| | | import com.ruoyi.order.dto.ChargingDetails; |
| | | import com.ruoyi.order.dto.MyChargingOrderInfo; |
| | | import com.ruoyi.order.mapper.TSettlementConfirmMapper; |
| | | import com.ruoyi.order.service.*; |
| | | import com.ruoyi.order.vo.EndOfChargePageInfo; |
| | | import com.ruoyi.other.api.feignClient.IntegralRuleClient; |
| | | import com.ruoyi.other.api.feignClient.UserTagClient; |
| | | import com.ruoyi.other.api.feignClient.VipClient; |
| | |
| | | import javax.annotation.Resource; |
| | | import java.io.PrintWriter; |
| | | import java.math.BigDecimal; |
| | | import java.util.Arrays; |
| | | import java.util.*; |
| | | |
| | | @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = RuoYiOrderApplication.class) |
| | | public class RuoYiOrderApplicationTests { |
| | |
| | | |
| | | @Test |
| | | public void test(){ |
| | | Integer id = 75; |
| | | TChargingOrder one = chargingOrderService.getOne(new LambdaQueryWrapper<TChargingOrder>().eq(TChargingOrder::getAppUserId, 1839480334642704385L).eq(TChargingOrder::getChargingGunId, id) |
| | | .eq(TChargingOrder::getRechargePaymentStatus, 2).eq(TChargingOrder::getDelFlag, 0).orderByDesc(TChargingOrder::getStartTime).last(" limit 0, 1")); |
| | | ChargingDetails chargingDetails = new ChargingDetails(); |
| | | chargingDetails.setId(one.getId().toString()); |
| | | TChargingGun chargingGun = chargingGunClient.getChargingGunById(id).getData(); |
| | | TChargingPile chargingPile = chargingPileClient.getChargingPileById(chargingGun.getChargingPileId()).getData(); |
| | | Site site = siteClient.getSiteByIds(Arrays.asList(chargingPile.getSiteId())).getData().get(0); |
| | | chargingDetails.setName(site.getName() + "-" + chargingPile.getName()); |
| | | chargingDetails.setCode(one.getCode()); |
| | | chargingDetails.setStatus(one.getStatus()); |
| | | chargingDetails.setChargingCost(one.getResidualAmount()); |
| | | UploadRealTimeMonitoringData data = uploadRealTimeMonitoringDataClient.chargingOrderInfo(one.getCode()).getData(); |
| | | if(null != data){ |
| | | chargingDetails.setChargeCurrent(data.getOutput_current()); |
| | | chargingDetails.setChargeVoltage(data.getOutput_voltage()); |
| | | BigDecimal power = data.getOutput_current().multiply(data.getOutput_voltage()).divide(new BigDecimal(1000)); |
| | | chargingDetails.setChargePower(power); |
| | | chargingDetails.setCompletionRatio(data.getSoc()); |
| | | chargingDetails.setRemainingChargeTime(data.getTime_remaining()); |
| | | chargingDetails.setChargedDegrees(data.getCharging_degree()); |
| | | Integer h = Integer.valueOf(data.getCumulative_charging_time() / 60); |
| | | Integer m = Integer.valueOf(data.getCumulative_charging_time() % 60); |
| | | chargingDetails.setChargedTime(String.format("%02d", h) + ":" + String.format("%02d", m)); |
| | | } |
| | | ChargingHandshake chargingHandshake = chargingHandshakeClient.getDataByOrderCode(one.getCode()).getData(); |
| | | if(null != chargingHandshake && null != data && null != one.getAppUserCarId()){ |
| | | BigDecimal bms_battery_capacity = chargingHandshake.getBms_battery_capacity(); |
| | | TAppUserCar appUserCar = appUserCarClient.getCarByIds(Arrays.asList(one.getAppUserCarId())).getData().get(0); |
| | | // 续航 = 电池容量 / 续航里程 * soc |
| | | BigDecimal divide = bms_battery_capacity.divide(new BigDecimal(appUserCar.getEndurance())); |
| | | BigDecimal multiply = new BigDecimal(data.getSoc() / 100).multiply(divide); |
| | | chargingDetails.setEndurance(multiply); |
| | | } |
| | | System.err.println(JSON.toJSONString(chargingDetails)); |
| | | MyChargingOrderInfo myChargingOrderInfo = chargingOrderService.getMyChargingOrderInfo("1852288949187297282"); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.other.api.domain.Region; |
| | | import com.ruoyi.other.service.IRegionService; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | private IRegionService regionService; |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/coupon", "/appUser/list", "/vipList", "/coupon/send"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping("/getRegion/{pid}") |
| | | @ApiOperation(value = "获取省市区数据", tags = {"管理后台-站点管理"}) |
| | |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.other.api.domain.TActivity; |
| | | import com.ruoyi.other.api.domain.TAdvertising; |
| | | import com.ruoyi.other.api.dto.AdvertisingDTO; |
| | |
| | | |
| | | @Autowired |
| | | private TActivityService activityService; |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/activity/add"}, logical = Logical.OR) |
| | | @PostMapping("/saveActivity") |
| | | @ApiOperation(tags = {"管理后台-活动管理"},value = "活动添加") |
| | | @Log(title = "【活动管理】添加活动", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | |
| | | activityService.save(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/activity/del"}, logical = Logical.OR) |
| | | @GetMapping("/delete") |
| | | @ApiOperation(tags = {"管理后台-活动管理"},value = "活动删除") |
| | | @Log(title = "【活动管理】删除活动", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | |
| | | activityService.removeBatchByIds(Arrays.asList(ids.split(","))); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/activity/update"}, logical = Logical.OR) |
| | | @PostMapping("/updateVip") |
| | | @ApiOperation(tags = {"管理后台-活动管理"},value = "活动修改") |
| | | @Log(title = "【活动管理】修改活动", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | |
| | | activityService.updateById(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/activity/select"}, logical = Logical.OR) |
| | | @GetMapping("/getInfo") |
| | | @ApiOperation(tags = {"管理后台-活动管理","小程序-个人中心-活动列表"},value = "活动查看详情") |
| | | public AjaxResult<TActivity> getInfo(Integer id) { |
| | | return AjaxResult.ok(activityService.getById(id)); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(tags = {"管理后台-活动管理","小程序-个人中心-活动列表"},value = "活动列表分页查询") |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/activity/list"}, logical = Logical.OR) |
| | | @PostMapping(value = "/pageList") |
| | | public AjaxResult<PageInfo<TActivity>> pageList(@RequestBody AdvertisingDTO dto) { |
| | | return AjaxResult.ok(activityService.pageList(dto)); |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import com.ruoyi.order.api.query.TActivityStatisticsQuery; |
| | | import com.ruoyi.order.api.vo.TActivityStatisticslVO; |
| | |
| | | public class TActivityStatisticsController { |
| | | @Autowired |
| | | private OrderClient orderClient; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/activityExpense"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"管理后台-活动费用统计"},value = "管理后台活动费用统计") |
| | | @PostMapping(value = "/pageList") |
| | | public AjaxResult<TActivityVO> pageList(@RequestBody TActivityStatisticsQuery query) { |
| | |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.other.api.domain.TAdvertising; |
| | | import com.ruoyi.other.api.domain.TVip; |
| | | import com.ruoyi.other.api.dto.AdvertisingDTO; |
| | |
| | | |
| | | @Autowired |
| | | private TAdvertisingService advertisingService; |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/advertisement/add"}, logical = Logical.OR) |
| | | @PostMapping("/saveAdvertising") |
| | | @ApiOperation(tags = {"管理后台-广告管理"},value = "广告添加") |
| | | @Log(title = "【广告管理】添加广告", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | |
| | | advertisingService.save(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/advertisement/del"}, logical = Logical.OR) |
| | | @GetMapping("/delete") |
| | | @ApiOperation(tags = {"管理后台-广告管理"},value = "广告删除") |
| | | @Log(title = "【广告管理】删除广告", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | |
| | | advertisingService.removeBatchByIds(Arrays.asList(ids.split(","))); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/advertisement/update"}, logical = Logical.OR) |
| | | @PostMapping("/updateVip") |
| | | @ApiOperation(tags = {"管理后台-广告管理"},value = "广告修改") |
| | | @Log(title = "【广告管理】修改广告", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/advertisement/select"}, logical = Logical.OR) |
| | | @GetMapping("/getInfo") |
| | | @ApiOperation(tags = {"管理后台-广告管理"},value = "广告查看详情") |
| | | public AjaxResult<TAdvertising> getInfo(Integer id) { |
| | | return AjaxResult.ok(advertisingService.getById(id)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/advertisement"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"管理后台-广告管理"},value = "广告列表分页查询") |
| | | @PostMapping(value = "/pageList") |
| | | public AjaxResult<PageInfo<TAdvertising>> pageList(@RequestBody AdvertisingDTO dto) { |
| | |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.other.api.domain.Region; |
| | | import com.ruoyi.other.api.domain.TCoupon; |
| | | import com.ruoyi.other.api.domain.TGoods; |
| | |
| | | |
| | | @Autowired |
| | | private AppCouponClient appCouponClient; |
| | | |
| | | @Autowired |
| | | private IRegionService regionService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 远程调用 根据名称 查询优惠券ids |
| | |
| | | .eq("name", name)).stream().map(TCoupon::getId).collect(Collectors.toList()); |
| | | return R.ok(collect); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/coupon/add"}, logical = Logical.OR) |
| | | @PostMapping("/saveGoods") |
| | | @ApiOperation(tags = {"管理后台-优惠券管理"},value = "优惠券添加") |
| | | @Log(title = "【优惠券管理】添加优惠券", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | |
| | | tCouponService.save(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/coupon/del"}, logical = Logical.OR) |
| | | @GetMapping("/delete") |
| | | @ApiOperation(tags = {"管理后台-优惠券管理"},value = "优惠券删除") |
| | | @Log(title = "【优惠券管理】删除优惠券", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | |
| | | tCouponService.removeBatchByIds(Arrays.asList(ids.split(","))); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/coupon/update"}, logical = Logical.OR) |
| | | @PostMapping("/updateVip") |
| | | @ApiOperation(tags = {"管理后台-优惠券管理"},value = "优惠券修改") |
| | | @Log(title = "【优惠券管理】修改优惠券", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | |
| | | tCouponService.updateById(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/coupon/select"}, logical = Logical.OR) |
| | | @GetMapping("/getInfo") |
| | | @ApiOperation(tags = {"管理后台-优惠券管理"},value = "优惠券查看详情") |
| | | public AjaxResult<TCoupon> getInfo(Integer id) { |
| | |
| | | byId.setUseCount(appCouponClient.getUseCountByCouponId(id).getData()); |
| | | return AjaxResult.ok(byId); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/coupon/select"}, logical = Logical.OR) |
| | | @PostMapping("/exchangeRecord") |
| | | @ApiOperation(tags = {"管理后台-优惠券管理"},value = "优惠券查看详情-兑换记录") |
| | | public AjaxResult<PageInfo<ExchangeRecordVO>> exchangeRecord(@RequestBody ExchangeRecordGoodsQuery dto) { |
| | |
| | | exchangeRecordVOPageInfo.setRecords(data); |
| | | return AjaxResult.ok(exchangeRecordVOPageInfo); |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private IRegionService regionService; |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/coupon/send"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"管理后台-优惠券管理"},value = "发放优惠券") |
| | | @PostMapping(value = "/grantCoupon") |
| | | @Log(title = "【优惠券管理】发放优惠券", businessType = BusinessType.OTHER,operatorType = OperatorType.MANAGE) |
| | |
| | | appCouponClient.grantCoupon(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/coupon"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"管理后台-优惠券管理"},value = "优惠券列表分页查询") |
| | | @PostMapping(value = "/pageList") |
| | | public AjaxResult<PageInfo<TCoupon>> pageList(@RequestBody CouponQuery dto) { |
| | | return AjaxResult.ok(tCouponService.pageList(dto)); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/vipSetting/list"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"管理后台-优惠券管理"},value = "优惠券列表分页查询") |
| | | @PostMapping(value = "/pageList3") |
| | | public AjaxResult<List<TCoupon>> pageList() { |
| | |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.TEnterpriseUserApplication; |
| | | import com.ruoyi.other.query.PassDto; |
| | |
| | | dto.setAppUserId(tokenService.getLoginUserApplet().getUserId()); |
| | | return AjaxResult.ok(enterpriseUserApplicationService.save(dto)); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/groupUserApplication/add"}, logical = Logical.OR) |
| | | @Log(title = "【集团用户申请】添加集团用户申请", businessType = BusinessType.INSERT) |
| | | @ApiOperation(tags = {"后台-申请表单-集团用户"},value = "后台添加集团用户申请") |
| | | @PostMapping(value = "/back/add") |
| | |
| | | // 用户id |
| | | return AjaxResult.ok(enterpriseUserApplicationService.save(dto)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/groupUserApplication"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-申请表单-集团用户"},value = "集团用户列表") |
| | | @PostMapping(value = "/page") |
| | | public R<Page<TEnterpriseUserApplication>> page(@RequestBody EnterpriseQuery enterpriseQuery) { |
| | |
| | | return R.ok(page); |
| | | // } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/groupUserApplication/export"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-申请表单-集团用户"},value = "导出") |
| | | @PutMapping(value = "/export") |
| | | @Log(title = "【申请建桩】导出建桩申请列表", businessType = BusinessType.EXPORT) |
| | |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/groupUserApplication/remark"}, logical = Logical.OR) |
| | | @Log(title = "【集团用户申请】填写备注", businessType = BusinessType.INSERT) |
| | | @ApiOperation(tags = {"后台-申请表单-集团用户"},value = "备注") |
| | | @PostMapping(value = "/remark") |
| | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/groupUserApplication/del"}, logical = Logical.OR) |
| | | @Log(title = "【集团用户申请】删除申请数据", businessType = BusinessType.DELETE) |
| | | @ApiOperation(tags = {"后台-申请表单-集团用户"},value = "删除") |
| | | @DeleteMapping(value = "/delete") |
| | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.other.api.domain.TEvaluationTag; |
| | | import com.ruoyi.other.api.domain.TInvoiceType; |
| | | import com.ruoyi.other.api.vo.TEvaluationTagVO; |
| | |
| | | public R<List<TEvaluationTagVO>> getList() { |
| | | return R.ok(evaluationTagService.getList()); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/evaluationTag"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping("/pageList") |
| | | @ApiOperation(value = "获取评价标签列表", tags = {"管理后台-评价标签设置"}) |
| | |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/evaluationTag/add"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping("/addEvaluationTag") |
| | | @ApiOperation(value = "添加评价标签", tags = {"管理后台-评价标签设置"}) |
| | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @RequiresPermissions(value = {"/evaluationTag/update"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping("/getEvaluationTagInfo/{id}") |
| | | @ApiOperation(value = "获取评价标签详情", tags = {"管理后台-评价标签设置"}) |
| | |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/evaluationTag/update"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping("/editEvaluationTag") |
| | | @ApiOperation(value = "编辑评价标签", tags = {"管理后台-评价标签设置"}) |
| | |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/evaluationTag/del"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @DeleteMapping("/delEvaluationTag") |
| | | @ApiOperation(value = "删除评价标签", tags = {"管理后台-评价标签设置"}) |
| | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import com.ruoyi.order.api.model.TShoppingOrder; |
| | |
| | | import com.ruoyi.other.service.TActivityService; |
| | | import com.ruoyi.other.service.TCouponService; |
| | | import com.ruoyi.other.service.TGoodsService; |
| | | import com.ruoyi.other.util.RedisLock; |
| | | import com.ruoyi.payment.api.feignClient.AliPaymentClient; |
| | | import com.ruoyi.payment.api.feignClient.WxPaymentClient; |
| | | import com.ruoyi.payment.api.vo.AliPaymentReq; |
| | |
| | | import com.ruoyi.payment.api.vo.PaymentOrder; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.UUID; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | private TGoodsService goodsService; |
| | | @Autowired |
| | | private TActivityService activityService; |
| | | |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | |
| | | private TCouponService couponService; |
| | | @Resource |
| | | private WxPaymentClient wxPaymentClient; |
| | | @Resource |
| | | private RedisService redisService; |
| | | |
| | | @Autowired |
| | | public RedisTemplate redisTemplate; |
| | | |
| | | |
| | | /** |
| | |
| | | .like("name", name)).stream().map(TGoods::getId).collect(Collectors.toList()); |
| | | return R.ok(collect); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/goods/add"}, logical = Logical.OR) |
| | | @PostMapping("/saveGoods") |
| | | @ApiOperation(tags = {"管理后台-商品管理"},value = "商品添加") |
| | | @Log(title = "【商品管理】添加商品", businessType = BusinessType.INSERT) |
| | |
| | | goodsService.save(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/goods/del"}, logical = Logical.OR) |
| | | @GetMapping("/delete") |
| | | @ApiOperation(tags = {"管理后台-商品管理"},value = "商品删除") |
| | | @Log(title = "【商品管理】删除商品", businessType = BusinessType.DELETE) |
| | |
| | | goodsService.removeBatchByIds(Arrays.asList(ids.split(","))); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/goods/update"}, logical = Logical.OR) |
| | | @PostMapping("/updateVip") |
| | | @ApiOperation(tags = {"管理后台-商品管理"},value = "商品修改") |
| | | @Log(title = "【商品管理】修改商品", businessType = BusinessType.UPDATE) |
| | |
| | | goodsService.updateById(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/goods/select"}, logical = Logical.OR) |
| | | @GetMapping("/getInfo") |
| | | @ApiOperation(tags = {"管理后台-商品管理"},value = "商品查看详情") |
| | | public AjaxResult<TGoods> getInfo(Integer id) { |
| | |
| | | return R.ok(byId); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/goods"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"管理后台-商品管理"},value = "商品列表分页查询") |
| | | @PostMapping(value = "/pageList") |
| | | public AjaxResult<PageInfo<TGoods>> pageList(@RequestBody GoodsDTO dto) { |
| | |
| | | //检查当前用户积分是否够 |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | Integer point = 0; |
| | | |
| | | if (exchangeDto.getGoodType()==1) { |
| | | //查询当前商品信息 |
| | | TGoods good = goodsService.getById(exchangeDto.getGoodId()); |
| | |
| | | return R.ok(); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(tags = {"小程序-兑换商城"},value = "积分兑换商品") |
| | | @PostMapping(value = "/app/shop") |
| | | public AjaxResult<PageInfo<TGoods>> shop(@RequestBody ExchangeDto exchangeDto) { |
| | | //检查当前用户积分是否够 |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | Integer point = 0; |
| | | TAppUser user = appUserClient.getUserById(userId).getData(); |
| | | |
| | | if (exchangeDto.getGoodType()==1) { |
| | | //查询当前商品信息 |
| | | TGoods good = goodsService.getById(exchangeDto.getGoodId()); |
| | | point = good.getRedeemPoints(); |
| | | //检查当前用户是否到达兑换上限 |
| | | Long count = orderClient.getExchangeById(exchangeDto.getGoodId(), userId,exchangeDto.getGoodType()).getData(); |
| | | if (good.getLimitExchangeTimes() != -1 && count >= good.getLimitExchangeTimes()) { |
| | | return AjaxResult.error("当前用户已兑换"+count+"张"); |
| | | //redis锁 和支付使用同一个锁 |
| | | RedisLock redisLock = new RedisLock(redisTemplate, "POINT_EXCHANGE_LOCK", 5, 30000); |
| | | try { |
| | | redisLock.lock(); |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | Integer point = 0; |
| | | TAppUser user = appUserClient.getUserById(userId).getData(); |
| | | if (exchangeDto.getGoodType()==1) { |
| | | //查询当前商品信息 |
| | | TGoods good = goodsService.getById(exchangeDto.getGoodId()); |
| | | point = good.getRedeemPoints(); |
| | | if (user.getPoints().compareTo(good.getRedeemPoints()) < 0){ |
| | | return AjaxResult.error("当前用户积分不足"); |
| | | } |
| | | //检查当前用户是否到达兑换上限 |
| | | Long count = orderClient.getExchangeById(exchangeDto.getGoodId(), userId,exchangeDto.getGoodType()).getData(); |
| | | if (good.getLimitExchangeTimes() != -1 && count >= good.getLimitExchangeTimes()) { |
| | | return AjaxResult.error("当前用户已兑换"+count+"张"); |
| | | }else { |
| | | //减少库存 |
| | | if (good.getInventory()!=-1) { |
| | | good.setInventory(good.getInventory() - exchangeDto.getNum()); |
| | | goodsService.updateById(good); |
| | | } |
| | | } |
| | | }else { |
| | | //减少库存 |
| | | if (good.getInventory()!=-1) { |
| | | good.setInventory(good.getInventory() - exchangeDto.getNum()); |
| | | goodsService.updateById(good); |
| | | TCoupon coupon = couponService.getById(exchangeDto.getGoodId()); |
| | | point = coupon.getRedeemPoints(); |
| | | if (user.getPoints().compareTo(coupon.getRedeemPoints()) < 0){ |
| | | return AjaxResult.error("当前用户积分不足"); |
| | | } |
| | | Long count = orderClient.getExchangeById(exchangeDto.getGoodId(), userId,exchangeDto.getGoodType()).getData(); |
| | | if (coupon.getInventoryQuantity() != -1 && count >= coupon.getInventoryQuantity()) { |
| | | return AjaxResult.error("当前用户已到达兑换"+coupon+"次"); |
| | | }else { |
| | | if (coupon.getInventoryQuantity()!=-1) { |
| | | coupon.setInventoryQuantity(coupon.getInventoryQuantity() - 1); |
| | | couponService.updateById(coupon); |
| | | } |
| | | } |
| | | } |
| | | if (user.getPoints()<good.getRedeemPoints()){ |
| | | return AjaxResult.error("当前用户积分不足"); |
| | | } |
| | | }else { |
| | | TCoupon coupon = couponService.getById(exchangeDto.getGoodId()); |
| | | point = coupon.getRedeemPoints(); |
| | | |
| | | Long count = orderClient.getExchangeById(exchangeDto.getGoodId(), userId,exchangeDto.getGoodType()).getData(); |
| | | if (user.getPoints()<point){ |
| | | return AjaxResult.error("当前用户积分不足"); |
| | | } |
| | | if (coupon.getInventoryQuantity() != -1 && count >= coupon.getInventoryQuantity()) { |
| | | return AjaxResult.error("当前用户已到达兑换"+coupon+"次"); |
| | | }else { |
| | | if (coupon.getInventoryQuantity()!=-1) { |
| | | coupon.setInventoryQuantity(coupon.getInventoryQuantity() - 1); |
| | | couponService.updateById(coupon); |
| | | exchangeDto.setPoint(point); |
| | | exchangeDto.setUserId(userId); |
| | | //生成积分兑换成功的订单 |
| | | R<ExchangeBackDto> longR = orderClient.exchangeCreate(exchangeDto); |
| | | if (exchangeDto.getGoodType()==2) { |
| | | TCoupon coupon = couponService.getById(exchangeDto.getGoodId()); |
| | | |
| | | //如果是优惠卷,赠送优惠卷给用户 |
| | | GrantCouponDto grantCouponDto = new GrantCouponDto(); |
| | | grantCouponDto.setUserIds(userId.toString()); |
| | | grantCouponDto.setCouponId(exchangeDto.getGoodId()); |
| | | grantCouponDto.setWaysToObtain(1); |
| | | grantCouponDto.setEndTime(LocalDateTime.now()); |
| | | grantCouponDto.setType(3); |
| | | switch (coupon.getValidityPeriodMode()){ |
| | | case 1: |
| | | grantCouponDto.setEndTime(coupon.getEndTime()); |
| | | break; |
| | | case 2: |
| | | grantCouponDto.setEndTime(LocalDateTime.now().plusDays(coupon.getDays())); |
| | | break; |
| | | } |
| | | appCouponClient.grantCoupon(grantCouponDto); |
| | | } |
| | | |
| | | |
| | | //生成消耗积分的记录 |
| | | PointChangeDto pointChangeDto = new PointChangeDto(); |
| | | pointChangeDto.setUserId(userId); |
| | | pointChangeDto.setPoints(point); |
| | | pointChangeDto.setRemark(String.valueOf(longR.getData().getId())); |
| | | pointChangeDto.setType(6); |
| | | pointChangeDto.setCode(longR.getData().getCode()); |
| | | appUserClient.changeDown(pointChangeDto); |
| | | return AjaxResult.success(longR.getData().getId()); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | }finally { |
| | | //解锁 |
| | | redisLock.unlock(); |
| | | } |
| | | exchangeDto.setPoint(point); |
| | | exchangeDto.setUserId(userId); |
| | | //生成积分兑换成功的订单 |
| | | R<ExchangeBackDto> longR = orderClient.exchangeCreate(exchangeDto); |
| | | if (exchangeDto.getGoodType()==2) { |
| | | TCoupon coupon = couponService.getById(exchangeDto.getGoodId()); |
| | | |
| | | //如果是优惠卷,赠送优惠卷给用户 |
| | | GrantCouponDto grantCouponDto = new GrantCouponDto(); |
| | | grantCouponDto.setUserIds(userId.toString()); |
| | | grantCouponDto.setCouponId(exchangeDto.getGoodId()); |
| | | grantCouponDto.setWaysToObtain(1); |
| | | grantCouponDto.setEndTime(LocalDateTime.now()); |
| | | grantCouponDto.setType(3); |
| | | switch (coupon.getValidityPeriodMode()){ |
| | | case 1: |
| | | grantCouponDto.setEndTime(coupon.getEndTime()); |
| | | break; |
| | | case 2: |
| | | grantCouponDto.setEndTime(LocalDateTime.now().plusDays(coupon.getDays())); |
| | | break; |
| | | } |
| | | appCouponClient.grantCoupon(grantCouponDto); |
| | | } |
| | | //生成消耗积分的记录 |
| | | PointChangeDto pointChangeDto = new PointChangeDto(); |
| | | pointChangeDto.setUserId(userId); |
| | | pointChangeDto.setPoints(point); |
| | | pointChangeDto.setRemark(String.valueOf(longR.getData().getId())); |
| | | pointChangeDto.setType(6); |
| | | pointChangeDto.setCode(longR.getData().getCode()); |
| | | appUserClient.changeDown(pointChangeDto); |
| | | return AjaxResult.success(longR.getData().getId()); |
| | | |
| | | return AjaxResult.success(); |
| | | |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.other.api.domain.THtml; |
| | | import com.ruoyi.other.api.domain.TNotice; |
| | | import com.ruoyi.other.service.THtmlService; |
| | |
| | | public class THtmlController { |
| | | @Resource |
| | | private THtmlService htmlService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/protocolServerDescription"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-内容设置-协议服务"},value = "新增修改") |
| | | @PostMapping(value = "/saveOrUpdate") |
| | | @Log(title = "【协议服务】新增修改协议", businessType = BusinessType.INSERT) |
| | |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/protocolServerDescription"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-内容设置-协议服务"},value = "查询") |
| | | @GetMapping(value = "/selectByType/{type}") |
| | | public AjaxResult selectByType(@PathVariable Integer type) { |
| | |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.THtml; |
| | | import com.ruoyi.other.api.domain.TIntegralRule; |
| | |
| | | private TokenService tokenService; |
| | | @Autowired |
| | | private TVipService vipService; |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/IntegralSetting"}, logical = Logical.OR) |
| | | @GetMapping("/getSet") |
| | | @ApiOperation(tags = {"管理后台-积分管理","小程序-个人中心-签到"},value = "获取积分设置") |
| | | public R<TIntegralRule> getSet() { |
| | |
| | | return R.ok(res); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/IntegralSetting"}, logical = Logical.OR) |
| | | @PostMapping("/saveSet") |
| | | @ApiOperation(tags = {"管理后台-积分管理"},value = "保存积分设置") |
| | | @Log(title = "【积分管理】保存积分设置", businessType = BusinessType.INSERT) |
| | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/vipSetting/html"}, logical = Logical.OR) |
| | | @GetMapping("/getInfo") |
| | | @ApiOperation(tags = {"管理后台-积分管理"},value = "type 1=积分规则说明," + |
| | | "2=会员折扣说明," + |
| | |
| | | } |
| | | return R.ok(g.getContent()); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/vipSetting/html"}, logical = Logical.OR) |
| | | @PostMapping("/saveInfo") |
| | | @ApiOperation(tags = {"管理后台-积分管理"},value = "保存积分说明") |
| | | @Log(title = "【积分管理】保存积分说明", businessType = BusinessType.INSERT) |
| | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.other.api.domain.TInvoiceType; |
| | | import com.ruoyi.other.query.InvoiceTypePageList; |
| | | import com.ruoyi.other.service.TInvoiceTypeService; |
| | |
| | | private TInvoiceTypeService invoiceTypeService; |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/invoiceType"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping("/pageList") |
| | | @ApiOperation(value = "获取发票类型列表", tags = {"管理后台-发票类型管理"}) |
| | |
| | | PageInfo<TInvoiceType> pageInfo = invoiceTypeService.pageList(pageList); |
| | | return AjaxResult.success(pageInfo); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/invoiceManagement"}, logical = Logical.OR) |
| | | @GetMapping("/pageListR") |
| | | @ApiOperation(value = "获取开票公司和类型列表", tags = {"管理后台-发票管理"}) |
| | | public R<List<TInvoiceType>> pageListR(String invoicingCompany ){ |
| | |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/invoiceType/add"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping("/addInvoiceType") |
| | | @ApiOperation(value = "添加发票类型", tags = {"管理后台-发票类型管理"}) |
| | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/invoiceType/select", "/invoiceType/update"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping("/getInvoiceTypeInfo/{id}") |
| | | @ApiOperation(value = "获取发票类型详情", tags = {"管理后台-发票类型管理"}) |
| | |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/invoiceType/update"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping("/editInvoiceType") |
| | | @ApiOperation(value = "编辑发票类型", tags = {"管理后台-发票类型管理"}) |
| | |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/invoiceType/del"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @DeleteMapping("/delInvoiceType") |
| | | @ApiOperation(value = "删除发票类型", tags = {"管理后台-发票类型管理"}) |
| | |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.other.api.domain.TNotice; |
| | | import com.ruoyi.other.api.dto.NoticeQueryDto; |
| | | import com.ruoyi.other.mapper.SysNoticeMapper; |
| | |
| | | public class TNoticeController { |
| | | @Resource |
| | | private TNoticeService noticeService; |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/publicAnnouncementManagement/add", "/publicAnnouncementManagement/update"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-内容设置-公告管理"},value = "新增修改") |
| | | @PostMapping(value = "/saveOrUpdate") |
| | | @Log(title = "【公告管理】新增修改公告", businessType = BusinessType.INSERT) |
| | |
| | | noticeService.saveOrUpdate(notice); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/publicAnnouncementManagement/del"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-内容设置-公告管理"},value = "删除") |
| | | @DeleteMapping(value = "/deleteById") |
| | | @Log(title = "【公告管理】删除公告", businessType = BusinessType.DELETE) |
| | |
| | | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/publicAnnouncementManagement"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-内容设置-公告管理"},value = "查询") |
| | | @PostMapping(value = "/pageList") |
| | | public AjaxResult<Page<TNotice>> authPageList(@RequestBody NoticeQueryDto query) { |
| | |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.other.api.domain.TSystemConfiguration; |
| | | import com.ruoyi.other.service.TSystemConfigurationService; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | /** |
| | | * 查看系统设置 |
| | | */ |
| | | @RequiresPermissions(value = {"/customerServiceInformation", "/systemContentSetting"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"小程序-系统设置","后台-内容设置"},value = "联系客服,查询设置") |
| | | @GetMapping(value = "/getDetailById") |
| | | public AjaxResult<TSystemConfiguration> getDetailById(@RequestParam("type")@ApiParam(value = "1=客服信息,2=系统设置") Integer type) { |
| | | return AjaxResult.ok(systemConfigurationService.getOne(Wrappers.lambdaQuery(TSystemConfiguration.class) |
| | | .eq(TSystemConfiguration::getType, type))); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/customerServiceInformation", "/systemContentSetting"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-内容设置"},value = "客户信息,系统内容设置") |
| | | @PostMapping(value = "/save") |
| | | @Log(title = "【系统内容设置】保存系统内容设置", businessType = BusinessType.INSERT) |
| | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.TCoupon; |
| | | import com.ruoyi.other.api.domain.TIntegralRule; |
| | |
| | | private TCouponService couponService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/vipSetting/addOrdinaryMember", "/vipSetting/addInternalMember"}, logical = Logical.OR) |
| | | @PostMapping("/saveVip") |
| | | @ApiOperation(tags = {"管理后台-会员管理"},value = "会员添加") |
| | | @Log(title = "【会员管理】添加会员", businessType = BusinessType.INSERT) |
| | |
| | | vipService.save(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/vipSetting/del"}, logical = Logical.OR) |
| | | @GetMapping("/delete") |
| | | @ApiOperation(tags = {"管理后台-会员管理"},value = "会员删除") |
| | | @Log(title = "【会员管理】删除会员", businessType = BusinessType.DELETE) |
| | |
| | | vipService.removeBatchByIds(Arrays.asList(ids.split(","))); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/vipSetting/update"}, logical = Logical.OR) |
| | | @PostMapping("/updateVip") |
| | | @ApiOperation(tags = {"管理后台-会员管理"},value = "会员修改") |
| | | @Log(title = "【会员管理】修改会员", businessType = BusinessType.UPDATE) |
| | |
| | | vipService.updateById(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/vipSetting/select"}, logical = Logical.OR) |
| | | @GetMapping("/getInfo") |
| | | @ApiOperation(tags = {"管理后台-会员管理"},value = "会员查看详情") |
| | | public AjaxResult<TVip> getInfo(Integer id) { |
| | |
| | | public R<TVip> getInfo1(@RequestParam("id")Integer id) { |
| | | return R.ok(vipService.getById(id)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/vipSetting/list", "/vipOrder"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"管理后台-会员管理"},value = "会员列表分页查询") |
| | | @PostMapping(value = "/pageList") |
| | | public AjaxResult<PageInfo<TVip>> pageList(@RequestBody BasePage basePage) { |
| | | return AjaxResult.ok(vipService.pageList(basePage.getPageCurr(), basePage.getPageSize())); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/appUser/list", "/appUser/giftVip", "/appUser/gift_vip", "/vipList"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"会员下拉框"},value = "会员列表分页查询") |
| | | @GetMapping(value = "/select") |
| | | public AjaxResult<List<TVip>> select() { |
New file |
| | |
| | | package com.ruoyi.other.util; |
| | | |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | |
| | | import java.util.UUID; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/9/26 18:43 |
| | | */ |
| | | public class RedisLock { |
| | | private RedisTemplate<String, String> redisTemplate; |
| | | private String lockKey; |
| | | private int expireTime; // 锁的超时时间 |
| | | private int timeout; // 获取锁的超时时间 |
| | | |
| | | |
| | | public RedisLock(RedisTemplate<String, String> redisTemplate, String lockKey, int expireTime, int timeout) { |
| | | this.redisTemplate = redisTemplate; |
| | | this.lockKey = lockKey; |
| | | this.expireTime = expireTime; |
| | | this.timeout = timeout; |
| | | } |
| | | |
| | | public boolean lock() { |
| | | String identifier = UUID.randomUUID().toString(); |
| | | long end = System.currentTimeMillis() + timeout; |
| | | while (System.currentTimeMillis() < end) { |
| | | if (redisTemplate.opsForValue().setIfAbsent(lockKey, identifier, expireTime, TimeUnit.SECONDS)) { |
| | | return true; |
| | | } |
| | | // 可以使用延时来减少CPU占用 |
| | | try { |
| | | Thread.sleep(100); |
| | | } catch (InterruptedException e) { |
| | | Thread.currentThread().interrupt(); |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | public boolean unlock() { |
| | | redisTemplate.delete(lockKey); |
| | | return true; |
| | | } |
| | | } |