From 5a5b01fa9824a42e3eb033088a20e24c32b30dda Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期六, 17 八月 2024 16:17:26 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/AppUserInfoDto.java | 25 +
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/SendCouponDto.java | 9
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java | 2
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/IPartnerService.java | 2
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java | 2
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TInvoiceTypeController.java | 7
ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/feignClient/ChargingPileClient.java | 11
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppCoupon.java | 7
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/OtherFallbackFactory.java | 6
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysRoleController.java | 6
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TEvaluationTagMapper.java | 2
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/RoleSiteClient.java | 15
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/VipClient.java | 5
ruoyi-service/ruoyi-other/src/main/resources/bootstrap.yml | 4
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ChargingOrderClient.java | 7
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/CouponClient.java | 5
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/OrderClient.java | 2
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TNoticeController.java | 55 ++
bin/run-modules-system.bat | 14
ruoyi-service/ruoyi-order/src/main/resources/bootstrap.yml | 2
ruoyi-service/ruoyi-account/src/main/resources/bootstrap.yml | 2
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/config/DataSourceProxyConfig.java | 21
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserIntegralChangeClient.java | 3
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java | 2
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileServiceImpl.java | 3
bin/run-modules-file.bat | 14
ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/ChargingPileFallbackFactory.java | 6
ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/feignClient/ChargingGunClient.java | 9
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingPileController.java | 4
ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml | 2
ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/vo/SiteInfoVO.java | 9
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderAppealController.java | 2
ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java | 4
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/OtherClient.java | 5
bin/run-gateway.bat | 14
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingGunController.java | 3
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/THtmlController.java | 24
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TExchangeOrderServiceImpl.java | 2
bin/clean.bat | 12
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserAddressClient.java | 6
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java | 2
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java | 171 ++++++-
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/VipFallbackFactory.java | 5
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java | 13
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java | 2
ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feignClient/SysUserClient.java | 4
ruoyi-auth/src/main/resources/bootstrap.yml | 2
bin/run-auth.bat | 14
ruoyi-service/ruoyi-integration/src/main/resources/bootstrap.yml | 2
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/VipInfoDto.java | 35 +
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TIntegralRuleController.java | 7
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/TAppCouponServiceImpl.java | 4
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TCouponController.java | 5
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java | 15
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/InfoCouponDto.java | 35 +
ruoyi-service/ruoyi-chargingPile/pom.xml | 7
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppUserVipDetail.java | 20
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TEvaluationTagServiceImpl.java | 4
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java | 70 +++
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderEvaluateServiceImpl.java | 2
bin/package.bat | 12
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/PartnerServiceImpl.java | 9
ruoyi-modules/ruoyi-system/pom.xml | 8
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/GiveVipUtil.java | 96 ++++
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderEvaluateController.java | 3
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/TEvaluationTagClient.java | 3
ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml | 2
ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/SignFilter.java | 2
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingPileNotificationController.java | 4
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/ChargingOrderFallbackFactory.java | 5
ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysRole.java | 46 --
bin/run-monitor.bat | 14
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ChargingOrderAccountingStrategyClient.java | 9
bin/run-modules-gen.bat | 14
bin/run-modules-job.bat | 14
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TEvaluationTagMapper.xml | 6
ruoyi-service/ruoyi-chargingPile/src/main/resources/bootstrap.yml | 2
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/PartnerController.java | 4
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/THtml.java | 2
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/VipCouponDto.java | 10
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/SiteController.java | 50 +
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppCouponController.java | 53 +
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/TAppUserVipDetailService.java | 1
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/task/TaskUtil.java | 54 ++
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TEvaluationTagService.java | 2
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/NoticeQueryDto.java | 12
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java | 54 --
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/UserSiteClient.java | 17
ruoyi-service/ruoyi-payment/src/main/resources/bootstrap.yml | 2
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java | 8
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/GoodsClient.java | 5
ruoyi-service/ruoyi-other/pom.xml | 5
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/SiteServiceImpl.java | 3
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/config/DataUpdateHandlerConfig.java | 7
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TEvaluationTagController.java | 11
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TSystemConfigurationController.java | 15
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/TAppUserVipDetailServiceImpl.java | 60 ++
97 files changed, 1,092 insertions(+), 286 deletions(-)
diff --git a/bin/clean.bat b/bin/clean.bat
new file mode 100644
index 0000000..24c0974
--- /dev/null
+++ b/bin/clean.bat
@@ -0,0 +1,12 @@
+@echo off
+echo.
+echo [��Ϣ] ������target����·����
+echo.
+
+%~d0
+cd %~dp0
+
+cd ..
+call mvn clean
+
+pause
\ No newline at end of file
diff --git a/bin/package.bat b/bin/package.bat
new file mode 100644
index 0000000..c693ec0
--- /dev/null
+++ b/bin/package.bat
@@ -0,0 +1,12 @@
+@echo off
+echo.
+echo [��Ϣ] ���Web���̣�����war/jar���ļ���
+echo.
+
+%~d0
+cd %~dp0
+
+cd ..
+call mvn clean package -Dmaven.test.skip=true
+
+pause
\ No newline at end of file
diff --git a/bin/run-auth.bat b/bin/run-auth.bat
new file mode 100644
index 0000000..0d0952a
--- /dev/null
+++ b/bin/run-auth.bat
@@ -0,0 +1,14 @@
+@echo off
+echo.
+echo [��Ϣ] ʹ��Jar��������Auth���̡�
+echo.
+
+cd %~dp0
+cd ../ruoyi-auth/target
+
+set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
+
+java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-auth.jar
+
+cd bin
+pause
\ No newline at end of file
diff --git a/bin/run-gateway.bat b/bin/run-gateway.bat
new file mode 100644
index 0000000..e43d60b
--- /dev/null
+++ b/bin/run-gateway.bat
@@ -0,0 +1,14 @@
+@echo off
+echo.
+echo [��Ϣ] ʹ��Jar��������Gateway���̡�
+echo.
+
+cd %~dp0
+cd ../ruoyi-gateway/target
+
+set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
+
+java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-gateway.jar
+
+cd bin
+pause
\ No newline at end of file
diff --git a/bin/run-modules-file.bat b/bin/run-modules-file.bat
new file mode 100644
index 0000000..6d89c90
--- /dev/null
+++ b/bin/run-modules-file.bat
@@ -0,0 +1,14 @@
+@echo off
+echo.
+echo [��Ϣ] ʹ��Jar��������Modules-File���̡�
+echo.
+
+cd %~dp0
+cd ../ruoyi-modules/ruoyi-file/target
+
+set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
+
+java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-modules-file.jar
+
+cd bin
+pause
\ No newline at end of file
diff --git a/bin/run-modules-gen.bat b/bin/run-modules-gen.bat
new file mode 100644
index 0000000..0a4c390
--- /dev/null
+++ b/bin/run-modules-gen.bat
@@ -0,0 +1,14 @@
+@echo off
+echo.
+echo [��Ϣ] ʹ��Jar��������Modules-Gen���̡�
+echo.
+
+cd %~dp0
+cd ../ruoyi-modules/ruoyi-gen/target
+
+set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
+
+java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-modules-gen.jar
+
+cd bin
+pause
\ No newline at end of file
diff --git a/bin/run-modules-job.bat b/bin/run-modules-job.bat
new file mode 100644
index 0000000..443e59d
--- /dev/null
+++ b/bin/run-modules-job.bat
@@ -0,0 +1,14 @@
+@echo off
+echo.
+echo [��Ϣ] ʹ��Jar��������Modules-Job���̡�
+echo.
+
+cd %~dp0
+cd ../ruoyi-modules/ruoyi-job/target
+
+set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
+
+java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-modules-job.jar
+
+cd bin
+pause
\ No newline at end of file
diff --git a/bin/run-modules-system.bat b/bin/run-modules-system.bat
new file mode 100644
index 0000000..26db55e
--- /dev/null
+++ b/bin/run-modules-system.bat
@@ -0,0 +1,14 @@
+@echo off
+echo.
+echo [��Ϣ] ʹ��Jar��������Modules-System���̡�
+echo.
+
+cd %~dp0
+cd ../ruoyi-modules/ruoyi-system/target
+
+set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
+
+java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-modules-system.jar
+
+cd bin
+pause
\ No newline at end of file
diff --git a/bin/run-monitor.bat b/bin/run-monitor.bat
new file mode 100644
index 0000000..3e8e322
--- /dev/null
+++ b/bin/run-monitor.bat
@@ -0,0 +1,14 @@
+@echo off
+echo.
+echo [��Ϣ] ʹ��Jar��������Monitor���̡�
+echo.
+
+cd %~dp0
+cd ../ruoyi-visual/ruoyi-monitor/target
+
+set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
+
+java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-visual-monitor.jar
+
+cd bin
+pause
\ No newline at end of file
diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/AppUserInfoDto.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/AppUserInfoDto.java
new file mode 100644
index 0000000..28613f6
--- /dev/null
+++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/AppUserInfoDto.java
@@ -0,0 +1,25 @@
+package com.ruoyi.account.api.dto;
+
+import com.ruoyi.account.api.model.TAppUserCar;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+import java.util.List;
+
+@Data
+public class AppUserInfoDto {
+ @ApiModelProperty("1是0否")
+ private Integer isVip;
+ @ApiModelProperty("vip结束时间")
+ private LocalDateTime vipExpireTime;
+ @ApiModelProperty("当天是否签到")
+ private Integer isSign;
+ @ApiModelProperty("当前积分")
+ private Integer points;
+ @ApiModelProperty("当前优惠卷数量")
+ private Integer couponNum;
+ @ApiModelProperty("当前绑定的车辆")
+ private List<TAppUserCar> userCars;
+}
diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/InfoCouponDto.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/InfoCouponDto.java
new file mode 100644
index 0000000..1af4b89
--- /dev/null
+++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/InfoCouponDto.java
@@ -0,0 +1,35 @@
+package com.ruoyi.account.api.dto;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+@Data
+public class InfoCouponDto {
+ @ApiModelProperty(value = "优惠券名称")
+ @TableField("name")
+ private String name;
+ @ApiModelProperty(value = "优惠方式(1=满减,2=抵扣)")
+ @TableField("preferential_mode")
+ private Integer preferentialMode;
+
+ @ApiModelProperty(value = "优惠金额")
+ @TableField("discount_amount")
+ private BigDecimal discountAmount;
+ @ApiModelProperty(value = "满减条件为0时无条件")
+ @TableField("meet_the_conditions")
+ private BigDecimal meetTheConditions;
+
+ @ApiModelProperty(value = "折扣")
+ @TableField("discount")
+ private BigDecimal discount;
+ @ApiModelProperty(value = "结束时间")
+ @TableField("end_time")
+ private LocalDateTime endTime;
+ @ApiModelProperty(value = "开始时间")
+ @TableField("start_time")
+ private LocalDateTime startTime;
+}
diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/SendCouponDto.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/SendCouponDto.java
new file mode 100644
index 0000000..0489150
--- /dev/null
+++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/dto/SendCouponDto.java
@@ -0,0 +1,9 @@
+package com.ruoyi.account.api.dto;
+
+import lombok.Data;
+
+@Data
+public class SendCouponDto {
+ private Integer id;
+ private Integer number;
+}
diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserAddressClient.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserAddressClient.java
index b284de8..a500ccb 100644
--- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserAddressClient.java
+++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserAddressClient.java
@@ -5,7 +5,7 @@
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
/**
@@ -21,6 +21,6 @@
* @param id
* @return
*/
- @PostMapping("/t-app-user-address/getAppUserAddressById")
- R<TAppUserAddress> getAppUserAddressById(Long id);
+ @PostMapping("/t-app-user-address/getAppUserAddressById/{id}")
+ R<TAppUserAddress> getAppUserAddressById(@PathVariable("id") Long id);
}
diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java
index 9812ddd..845eba3 100644
--- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java
+++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java
@@ -6,10 +6,7 @@
import com.ruoyi.common.core.domain.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.*;
import java.util.List;
@@ -37,11 +34,11 @@
* @param id
* @return
*/
- @PostMapping(value = "/t-app-user/user/getUserById")
- R<TAppUser> getUserById(Long id);
+ @PostMapping(value = "/t-app-user/user/getUserById/{id}")
+ R<TAppUser> getUserById(@PathVariable("id") Long id);
- @PostMapping("/t-app-user/")
- R updateAppUser(TAppUser appUser);
+ @PostMapping("/t-app-user//user/updateAppUser")
+ R updateAppUser(@RequestBody TAppUser appUser);
}
diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserIntegralChangeClient.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserIntegralChangeClient.java
index 2c86199..eed0fbd 100644
--- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserIntegralChangeClient.java
+++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserIntegralChangeClient.java
@@ -6,6 +6,7 @@
import com.ruoyi.common.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
/**
* @author zhibing.pu
@@ -20,5 +21,5 @@
* @return
*/
@PostMapping("/t-app-user-integral-change/addAppUserIntegralChange")
- R addAppUserIntegralChange(TAppUserIntegralChange appUserIntegralChange);
+ R addAppUserIntegralChange(@RequestBody TAppUserIntegralChange appUserIntegralChange);
}
diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppCoupon.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppCoupon.java
index 0f6d8d1..b3bea84 100644
--- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppCoupon.java
+++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppCoupon.java
@@ -45,6 +45,9 @@
@ApiModelProperty(value = "结束时间")
@TableField("end_time")
private LocalDateTime endTime;
+ @ApiModelProperty(value = "开始时间")
+ @TableField("start_time")
+ private LocalDateTime startTime;
@ApiModelProperty(value = "获得方式(1=积分兑换,2=现金购买)")
@TableField("ways_to_obtain")
@@ -77,6 +80,10 @@
@TableField("orderId")
private Long orderId;
+ @ApiModelProperty(value = "当前领取优惠卷的json记录")
+ @TableField("coupon_json")
+ private String couponJson;
+
}
diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppUserVipDetail.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppUserVipDetail.java
index 9ca255a..577fc54 100644
--- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppUserVipDetail.java
+++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppUserVipDetail.java
@@ -9,6 +9,7 @@
import lombok.EqualsAndHashCode;
import java.io.Serializable;
+import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
@@ -38,6 +39,16 @@
@TableField("charge_num")
private Integer chargeNum;
+
+
+ @ApiModelProperty(value = "购买时折扣金额")
+ @TableField("discount_money")
+ private BigDecimal discountMoney;
+
+ @ApiModelProperty(value = "该会员记录应赠送的充电次数")
+ @TableField("send_charge_num")
+ private Integer sendChargeNum;
+
@ApiModelProperty(value = "会员id")
@TableField("vip_id")
private Integer vipId;
@@ -53,5 +64,14 @@
@TableField("create_time")
private LocalDateTime createTime;
+ @ApiModelProperty(value = "已赠送的月份")
+ @TableField("send_month")
+ private Integer sendMonth;
+
+
+ @ApiModelProperty(value = "要赠送的优惠卷")
+ @TableField("coupon_ids")
+ private String couponIds;
+
}
diff --git a/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/ChargingPileFallbackFactory.java b/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/ChargingPileFallbackFactory.java
index 8b4f691..f8bb5cf 100644
--- a/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/ChargingPileFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/factory/ChargingPileFallbackFactory.java
@@ -2,6 +2,7 @@
import com.ruoyi.chargingPile.api.feignClient.ChargingPileClient;
import com.ruoyi.chargingPile.api.model.TChargingPile;
+import com.ruoyi.chargingPile.api.vo.SiteInfoVO;
import com.ruoyi.common.core.domain.R;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -35,6 +36,11 @@
public R<BigDecimal> getServiceMoney(String param) {
return R.fail("根据会员折扣、预付金额 计算服务费失败:"+throwable.getMessage());
}
+
+ @Override
+ public R<SiteInfoVO> getSiteInfoByNumber(String number) {
+ return R.fail("通过桩编号获取电站信息失败:"+throwable.getMessage());
+ }
};
}
}
diff --git a/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/feignClient/ChargingGunClient.java b/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/feignClient/ChargingGunClient.java
index 015c04b..149625a 100644
--- a/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/feignClient/ChargingGunClient.java
+++ b/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/feignClient/ChargingGunClient.java
@@ -6,6 +6,7 @@
import com.ruoyi.common.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
/**
@@ -20,8 +21,8 @@
* @param id
* @return
*/
- @PostMapping("/t-charging-gun/getAllName")
- R<String> getAllName(Integer id);
+ @PostMapping("/t-charging-gun/getAllName/{id}")
+ R<String> getAllName(@PathVariable("id") Integer id);
/**
@@ -29,6 +30,6 @@
* @param id
* @return
*/
- @PostMapping("/t-charging-gun/getChargingGunById")
- R<TChargingGun> getChargingGunById(Integer id);
+ @PostMapping("/t-charging-gun/getChargingGunById/{id}")
+ R<TChargingGun> getChargingGunById(@PathVariable("id") Integer id);
}
diff --git a/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/feignClient/ChargingPileClient.java b/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/feignClient/ChargingPileClient.java
index a330a00..b2e13b0 100644
--- a/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/feignClient/ChargingPileClient.java
+++ b/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/feignClient/ChargingPileClient.java
@@ -2,6 +2,7 @@
import com.ruoyi.chargingPile.api.factory.ChargingPileFallbackFactory;
import com.ruoyi.chargingPile.api.model.TChargingPile;
+import com.ruoyi.chargingPile.api.vo.SiteInfoVO;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import io.swagger.annotations.ApiOperation;
@@ -24,12 +25,16 @@
*/
@ApiOperation(value = "管理后台-通过站点id获取充电桩列表 不分页")
@PostMapping(value = "/t-charging-pile/getChargingPileBySiteId")
- public R<List<TChargingPile>> getChargingPileBySiteId(@RequestParam("siteId") Integer siteId);
+ R<List<TChargingPile>> getChargingPileBySiteId(@RequestParam("siteId") Integer siteId);
/**
* 小程序远程调用 根据会员折扣、预付金额 计算服务费
* @return
*/
- @PostMapping(value = "/getServiceMoney")
- public R<BigDecimal> getServiceMoney(@RequestParam("param") String param);
+ @PostMapping(value = "/t-accounting-strategy/getServiceMoney")
+ R<BigDecimal> getServiceMoney(@RequestParam("param") String param);
+
+ @PostMapping("/site/getSiteInfoByNumber")
+ @ApiOperation(value = "扫一扫后通过桩编号获取电站信息", tags = {"小程序-扫一扫"})
+ R<SiteInfoVO> getSiteInfoByNumber(@RequestParam("number") String number);
}
diff --git a/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/vo/SiteInfoVO.java b/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/vo/SiteInfoVO.java
index 39fae79..df3a14a 100644
--- a/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/vo/SiteInfoVO.java
+++ b/ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/vo/SiteInfoVO.java
@@ -20,4 +20,13 @@
private BigDecimal vipElectrovalence;
@ApiModelProperty(value = "超时占位费说明")
private String spaceChargeExplain;
+
+ @ApiModelProperty(value = "上次选择车辆logo")
+ private String carLogo;
+ @ApiModelProperty(value = "上次选择车辆车牌号")
+ private String licensePlate;
+ @ApiModelProperty(value = "上次选择车辆品牌")
+ private String vehicleBrand;
+ @ApiModelProperty(value = "上次选择车辆id")
+ private Long id;
}
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/ChargingOrderFallbackFactory.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/ChargingOrderFallbackFactory.java
index c398faf..ee6192f 100644
--- a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/ChargingOrderFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/ChargingOrderFallbackFactory.java
@@ -44,6 +44,11 @@
public R<TChargingOrder> getOrderDetailByGunId(Integer chargingGunId) {
return R.fail("根据充电枪获取正在充电的订单:" + throwable.getMessage());
}
+
+ @Override
+ public R<Long> getCar() {
+ return R.fail("获取用户最近使用车辆充电的车辆id:" + throwable.getMessage());
+ }
};
}
}
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ChargingOrderAccountingStrategyClient.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ChargingOrderAccountingStrategyClient.java
index c9ede24..5d51fbc 100644
--- a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ChargingOrderAccountingStrategyClient.java
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ChargingOrderAccountingStrategyClient.java
@@ -6,6 +6,7 @@
import com.ruoyi.order.api.factory.ChargingOrderFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
@@ -26,8 +27,8 @@
* @param days 天数
* @return
*/
- @PostMapping("/t-charging-order-accounting-strategy/getTotalElectricQuantity")
- R<List<List<Map<String, Object>>>> getTotalElectricQuantity(Integer days, @RequestParam("siteIds") Set<Integer> siteIds);
+ @PostMapping("/t-charging-order-accounting-strategy/getTotalElectricQuantity/{days}")
+ R<List<List<Map<String, Object>>>> getTotalElectricQuantity(@PathVariable("days") Integer days, @RequestParam("siteIds") Set<Integer> siteIds);
/**
@@ -35,6 +36,6 @@
* @param days
* @return
*/
- @PostMapping("/t-charging-order-getDailyChargingDegree-strategy/getUtilizationTrend")
- R<List<Double>> getDailyChargingDegree(Integer days, @RequestParam("siteIds") Set<Integer> siteIds);
+ @PostMapping("/t-charging-order-getDailyChargingDegree-strategy/getUtilizationTrend/{days}")
+ R<List<Double>> getDailyChargingDegree(@PathVariable("days") Integer days, @RequestParam("siteIds") Set<Integer> siteIds);
}
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ChargingOrderClient.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ChargingOrderClient.java
index b7402f2..5d19dd8 100644
--- a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ChargingOrderClient.java
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/ChargingOrderClient.java
@@ -39,4 +39,11 @@
*/
@PostMapping(value = "/t-charging-order/getOrderDetailByGunId")
R<TChargingOrder> getOrderDetailByGunId(@RequestParam("chargingGunId") Integer chargingGunId);
+
+ /**
+ * 获取用户最近使用车辆充电的车辆id
+ * @return
+ */
+ @GetMapping(value = "/t-charging-order/getCar")
+ public R<Long> getCar();
}
diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/OrderClient.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/OrderClient.java
index c00f97c..9e59397 100644
--- a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/OrderClient.java
+++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/OrderClient.java
@@ -7,6 +7,7 @@
import com.ruoyi.order.api.query.TActivityStatisticsQuery;
import com.ruoyi.order.api.vo.TActivityVO;
import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@@ -36,4 +37,5 @@
*/
@PostMapping(value = "/t-exchange-order/activityStatistics")
public R<TActivityVO> activityStatistics(@RequestBody TActivityStatisticsQuery dto);
+
}
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/THtml.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/THtml.java
index f4d0e56..553d1cb 100644
--- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/THtml.java
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/THtml.java
@@ -24,7 +24,7 @@
@EqualsAndHashCode(callSuper = false)
@TableName("t_html")
@ApiModel(value="THtml对象", description="")
-public class THtml extends BasePojo {
+public class THtml {
private static final long serialVersionUID = 1L;
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/NoticeQueryDto.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/NoticeQueryDto.java
new file mode 100644
index 0000000..879c7cd
--- /dev/null
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/NoticeQueryDto.java
@@ -0,0 +1,12 @@
+package com.ruoyi.other.api.dto;
+
+import com.ruoyi.common.core.web.page.BasePage;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class NoticeQueryDto extends BasePage {
+ private String content;
+ @ApiModelProperty("0未开始1已开始2已结束")
+ private Integer status;
+}
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/VipCouponDto.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/VipCouponDto.java
new file mode 100644
index 0000000..f725386
--- /dev/null
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/VipCouponDto.java
@@ -0,0 +1,10 @@
+package com.ruoyi.other.api.dto;
+
+import com.ruoyi.other.api.domain.TCoupon;
+import lombok.Data;
+
+@Data
+public class VipCouponDto {
+ private TCoupon tCoupon;
+ private Integer num;
+ }
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/VipInfoDto.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/VipInfoDto.java
new file mode 100644
index 0000000..0783c96
--- /dev/null
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/VipInfoDto.java
@@ -0,0 +1,35 @@
+package com.ruoyi.other.api.dto;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.annotations.License;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.List;
+@Data
+public class VipInfoDto {
+
+ @ApiModelProperty("月卡价格")
+ private BigDecimal monthlyCard;
+ @ApiModelProperty("季卡价格")
+ private BigDecimal seasonCard;
+ @ApiModelProperty("年卡价格")
+ private BigDecimal annualCard;
+ @ApiModelProperty("最高抵扣价格")
+ private BigDecimal maximumDeduction;
+ @ApiModelProperty("抵扣次数")
+ private Integer discountTimes;
+
+ @ApiModelProperty(value = "双倍积分开关(0=否,1=是)")
+ private Integer doubleIntegration;
+
+ @ApiModelProperty(value = "商城专享价开关(0=否,1=是)")
+ private Integer mallExclusivePrice;
+ @ApiModelProperty(value = "可赠送的优惠卷列表")
+
+ private List<VipCouponDto> vipCouponDtos;
+
+ @ApiModelProperty(value = "最高总折扣")
+ private BigDecimal totalDiscount;
+}
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/OtherFallbackFactory.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/OtherFallbackFactory.java
index 4099d98..049f55c 100644
--- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/OtherFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/OtherFallbackFactory.java
@@ -6,6 +6,7 @@
import com.ruoyi.account.api.vo.CouponListVOVO;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.other.api.domain.TCompany;
+import com.ruoyi.other.api.domain.TCoupon;
import com.ruoyi.other.api.domain.TUserTag;
import com.ruoyi.other.api.feignClient.OtherClient;
import org.slf4j.Logger;
@@ -85,6 +86,11 @@
public R<List<CouponListVOVO>> getCouponInfoByCouponIds(List<CouponListVOVO> list) {
return R.fail("我的优惠券列表获取信息:"+throwable.getMessage());
}
+
+ @Override
+ public R<TCoupon> getCouponById(Integer id) {
+ return R.fail("查询优惠卷:"+throwable.getMessage());
+ }
};
}
}
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/VipFallbackFactory.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/VipFallbackFactory.java
index a4e1f0a..8a3cf05 100644
--- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/VipFallbackFactory.java
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/VipFallbackFactory.java
@@ -1,6 +1,7 @@
package com.ruoyi.other.api.factory;
import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.other.api.domain.TVip;
import com.ruoyi.other.api.feignClient.VipClient;
import org.slf4j.Logger;
@@ -28,6 +29,10 @@
return R.fail("获取最高抵扣、最低起步价,最高折扣的会员失败:" + throwable.getMessage());
}
+ @Override
+ public R<TVip> getInfo(Integer type) {
+ return null;
+ }
@Override
public R<TVip> getInfo1(Integer id) {
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/CouponClient.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/CouponClient.java
index f2f6fd6..7d9affe 100644
--- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/CouponClient.java
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/CouponClient.java
@@ -6,6 +6,7 @@
import com.ruoyi.other.api.factory.CouponFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
/**
@@ -21,6 +22,6 @@
* @param id
* @return
*/
- @PostMapping("/t-coupon/getCouponById")
- R<TCoupon> getCouponById(Integer id);
+ @PostMapping("/t-coupon/getCouponById/{id}")
+ R<TCoupon> getCouponById(@PathVariable("id") Integer id);
}
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/GoodsClient.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/GoodsClient.java
index 05c44ec..1f338d3 100644
--- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/GoodsClient.java
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/GoodsClient.java
@@ -6,6 +6,7 @@
import com.ruoyi.other.api.factory.GoodsFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
/**
@@ -20,6 +21,6 @@
* @param id
* @return
*/
- @PostMapping("/t-goods/getGoodsById")
- R<TGoods> getGoodsById(Integer id);
+ @PostMapping("/t-goods/getGoodsById/{id}")
+ R<TGoods> getGoodsById(@PathVariable("id") Integer id);
}
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/OtherClient.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/OtherClient.java
index 2fe5930..5299faa 100644
--- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/OtherClient.java
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/OtherClient.java
@@ -7,6 +7,7 @@
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.other.api.domain.TCompany;
+import com.ruoyi.other.api.domain.TCoupon;
import com.ruoyi.other.api.domain.TUserTag;
import com.ruoyi.other.api.factory.OtherFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
@@ -64,6 +65,10 @@
R<List<CouponListVOVO>> getCouponInfoByCouponIds(@RequestBody List<CouponListVOVO> list);
+ @PostMapping(value = "/t-coupon/getCouponById")
+ R<TCoupon> getCouponById(@RequestParam Integer id);
+
+
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/RoleSiteClient.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/RoleSiteClient.java
index 7dd2db2..c230ce7 100644
--- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/RoleSiteClient.java
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/RoleSiteClient.java
@@ -6,10 +6,7 @@
import com.ruoyi.other.api.factory.RoleSiteFallbackFactory;
import com.ruoyi.other.api.factory.UserSiteFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.*;
import java.util.List;
@@ -26,8 +23,8 @@
* @param roleId
* @return
*/
- @PostMapping("/t-role-site/getSiteIds")
- R<List<Integer>> getSiteIds(Long roleId);
+ @PostMapping("/t-role-site/getSiteIds/{roleId}")
+ R<List<Integer>> getSiteIds(@PathVariable("roleId") Long roleId);
/**
@@ -36,13 +33,13 @@
* @return
*/
@PostMapping("/t-role-site/addRoleSite")
- R addRoleSite(List<TRoleSite> roleSites);
+ R addRoleSite(@RequestBody List<TRoleSite> roleSites);
/**
* 删除角色站点数据
* @param roleId
* @return
*/
- @DeleteMapping("/t-role-site/delRoleSite")
- R delRoleSite(Long roleId);
+ @DeleteMapping("/t-role-site/delRoleSite/{roleId}")
+ R delRoleSite(@PathVariable("roleId") Long roleId);
}
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/TEvaluationTagClient.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/TEvaluationTagClient.java
index ea305af..8fe1f2c 100644
--- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/TEvaluationTagClient.java
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/TEvaluationTagClient.java
@@ -8,6 +8,7 @@
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@@ -34,5 +35,5 @@
* @return
*/
@PostMapping("/t-evaluation-tag/getListByIds")
- R<List<TEvaluationTag>> getListByIds(List<Integer> tagIds);
+ R<List<TEvaluationTag>> getListByIds(@RequestBody List<Integer> tagIds);
}
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/UserSiteClient.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/UserSiteClient.java
index 68d0746..cd9ba7b 100644
--- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/UserSiteClient.java
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/UserSiteClient.java
@@ -6,10 +6,7 @@
import com.ruoyi.other.api.factory.UserSiteFallbackFactory;
import org.apache.ibatis.annotations.Delete;
import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.*;
import java.util.List;
@@ -26,8 +23,8 @@
* @param userId
* @return
*/
- @PostMapping("/t-user-site/getSiteIds")
- R<List<Integer>> getSiteIds(Long userId);
+ @PostMapping("/t-user-site/getSiteIds/{userId}")
+ R<List<Integer>> getSiteIds(@PathVariable("userId") Long userId);
/**
@@ -35,8 +32,8 @@
* @param userSite
* @return
*/
- @PostMapping("/t-user-site/getSiteIds")
- R addUserSite(List<TUserSite> userSite);
+ @PostMapping("/t-user-site/addUserSite")
+ R addUserSite(@RequestBody List<TUserSite> userSite);
/**
@@ -44,6 +41,6 @@
* @param userId
* @return
*/
- @DeleteMapping("/t-user-site/delUserSite")
- R delUserSite(Long userId);
+ @DeleteMapping("/t-user-site/delUserSite/{userId}")
+ R delUserSite(@PathVariable("userId") Long userId);
}
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/VipClient.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/VipClient.java
index 763a217..b2ca8d3 100644
--- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/VipClient.java
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/VipClient.java
@@ -2,6 +2,7 @@
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.other.api.domain.TVip;
import com.ruoyi.other.api.factory.VipFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
@@ -31,4 +32,8 @@
*/
@PostMapping("/vip/getInfo1")
public R<TVip> getInfo1(@RequestParam("id") Integer id);
+ @PostMapping(value = "/vip/getInfo")
+ R<TVip> getInfo(@RequestParam("id") Integer id);
+
+
}
diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysRole.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysRole.java
index ee2f671..f270637 100644
--- a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysRole.java
+++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysRole.java
@@ -38,23 +38,11 @@
@TableField("role_key")
private String roleKey;
- /** 角色排序 */
- @Excel(name = "角色排序")
- @TableField("role_sort")
- private Integer roleSort;
-
/** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) */
@Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限")
@TableField("data_scope")
private String dataScope;
- /** 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示) */
- @TableField("menu_check_strictly")
- private boolean menuCheckStrictly;
-
- /** 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 ) */
- @TableField("dept_check_strictly")
- private boolean deptCheckStrictly;
/** 角色状态(0正常 1停用) */
@Excel(name = "角色状态", readConverterExp = "0=正常,1=停用")
@@ -137,17 +125,6 @@
this.roleKey = roleKey;
}
- @NotNull(message = "显示顺序不能为空")
- public Integer getRoleSort()
- {
- return roleSort;
- }
-
- public void setRoleSort(Integer roleSort)
- {
- this.roleSort = roleSort;
- }
-
public String getDataScope()
{
return dataScope;
@@ -156,26 +133,6 @@
public void setDataScope(String dataScope)
{
this.dataScope = dataScope;
- }
-
- public boolean isMenuCheckStrictly()
- {
- return menuCheckStrictly;
- }
-
- public void setMenuCheckStrictly(boolean menuCheckStrictly)
- {
- this.menuCheckStrictly = menuCheckStrictly;
- }
-
- public boolean isDeptCheckStrictly()
- {
- return deptCheckStrictly;
- }
-
- public void setDeptCheckStrictly(boolean deptCheckStrictly)
- {
- this.deptCheckStrictly = deptCheckStrictly;
}
public String getStatus()
@@ -252,10 +209,7 @@
.append("roleId", getRoleId())
.append("roleName", getRoleName())
.append("roleKey", getRoleKey())
- .append("roleSort", getRoleSort())
.append("dataScope", getDataScope())
- .append("menuCheckStrictly", isMenuCheckStrictly())
- .append("deptCheckStrictly", isDeptCheckStrictly())
.append("status", getStatus())
.append("delFlag", getDelFlag())
.append("createBy", getCreateBy())
diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java
index 91df803..0bbb062 100644
--- a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java
+++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java
@@ -4,7 +4,9 @@
import java.util.List;
import javax.validation.constraints.*;
+import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
@@ -28,7 +30,7 @@
/** 用户ID */
@Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号")
- @TableField("user_id")
+ @TableId(value = "user_id", type = IdType.AUTO)
private Long userId;
/** 部门ID */
diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feignClient/SysUserClient.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feignClient/SysUserClient.java
index d0f2eb4..20f98de 100644
--- a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feignClient/SysUserClient.java
+++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feignClient/SysUserClient.java
@@ -100,7 +100,7 @@
* @param user
*/
@PostMapping("/user/addSysUser")
- R addSysUser(SysUser user);
+ R addSysUser(@RequestBody SysUser user);
/**
@@ -109,5 +109,5 @@
* @return
*/
@PostMapping("/user/resetPassword")
- R resetPassword(SysUser user);
+ R resetPassword(@RequestBody SysUser user);
}
diff --git a/ruoyi-auth/src/main/resources/bootstrap.yml b/ruoyi-auth/src/main/resources/bootstrap.yml
index f3b4cd8..0f74bbf 100644
--- a/ruoyi-auth/src/main/resources/bootstrap.yml
+++ b/ruoyi-auth/src/main/resources/bootstrap.yml
@@ -43,7 +43,7 @@
enabled: true
application-id: ${spring.application.name}
tx-service-group: seata_tx_group #此处配置自定义的seata事务分组名称
- enable-auto-data-source-proxy: true #开启数据库代理
+ enable-auto-data-source-proxy: false #关闭数据库代理
service:
vgroup-mapping:
seata_tx_group: default
diff --git a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/SignFilter.java b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/SignFilter.java
index 0fe0de6..7ea17ff 100644
--- a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/SignFilter.java
+++ b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/SignFilter.java
@@ -127,13 +127,13 @@
* @return
*/
private boolean authSign(JSONObject jsonStr, String sign, String nonce_str) {
+ System.err.println("请求签名:" + sign);
String signUrlEncode = localSignUrl(jsonStr, nonce_str);
signUrlEncode = signUrlEncode.replaceAll("& #40;", "\\(")
.replaceAll("& #41;", "\\)");
if(sign.equals(signUrlEncode)){
return true;
}
-
System.err.println("签名值:" + signUrlEncode);
return false;
}
diff --git a/ruoyi-modules/ruoyi-system/pom.xml b/ruoyi-modules/ruoyi-system/pom.xml
index dd3928c..fe35873 100644
--- a/ruoyi-modules/ruoyi-system/pom.xml
+++ b/ruoyi-modules/ruoyi-system/pom.xml
@@ -61,10 +61,10 @@
</dependency>
<!-- RuoYi Common DataSource -->
- <dependency>
- <groupId>com.ruoyi</groupId>
- <artifactId>ruoyi-common-datasource</artifactId>
- </dependency>
+ <!--<dependency>-->
+ <!--<groupId>com.ruoyi</groupId>-->
+ <!--<artifactId>ruoyi-common-datasource</artifactId>-->
+ <!--</dependency>-->
<!-- RuoYi Common DataScope -->
<dependency>
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysRoleController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysRoleController.java
index 1ab7ca1..7b05f57 100644
--- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysRoleController.java
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysRoleController.java
@@ -112,8 +112,10 @@
for (SysRole record : page.getRecords()) {
List<Integer> data = roleSiteClient.getSiteIds(record.getRoleId()).getData();
List<Site> sites = siteClient.getSiteByIds(data).getData();
- List<String> collect = sites.stream().map(Site::getName).collect(Collectors.toList());
- record.setSiteNames(collect);
+ if(null != sites){
+ List<String> collect = sites.stream().map(Site::getName).collect(Collectors.toList());
+ record.setSiteNames(collect);
+ }
}
return AjaxResult.success(page);
}
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java
index 8ca54af..dc848a4 100644
--- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java
@@ -695,7 +695,9 @@
@PostMapping("/addSysUser")
@Transactional(rollbackFor = Exception.class)
public R addSysUser(@RequestBody SysUser user){
- user.setUserName(user.getPhonenumber());
+ if(StringUtils.isEmpty(user.getUserName())){
+ user.setUserName(user.getPhonenumber());
+ }
if(!org.springframework.util.StringUtils.hasLength(user.getNickName())){
user.setNickName(user.getPhonenumber());
}
@@ -707,7 +709,9 @@
}
user.setCreateBy(SecurityUtils.getUsername());
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
- user.setRoleType(1);
+ if(null == user.getRoleType()){
+ user.setRoleType(1);
+ }
userService.insertUser(user);
SysUserRole sysUserRole = new SysUserRole();
sysUserRole.setRoleId(user.getRoleId());
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java
index f243dcd..972e823 100644
--- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java
@@ -1,25 +1,26 @@
package com.ruoyi.system.mapper;
import java.util.List;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.api.domain.SysOperLog;
/**
* 操作日志 数据层
- *
+ *
* @author ruoyi
*/
-public interface SysOperLogMapper
-{
+public interface SysOperLogMapper extends BaseMapper<SysOperLog> {
/**
* 新增操作日志
- *
+ *
* @param operLog 操作日志对象
*/
public int insertOperlog(SysOperLog operLog);
/**
* 查询系统操作日志集合
- *
+ *
* @param operLog 操作日志对象
* @return 操作日志集合
*/
@@ -27,7 +28,7 @@
/**
* 批量删除系统操作日志
- *
+ *
* @param operIds 需要删除的操作日志ID
* @return 结果
*/
@@ -35,7 +36,7 @@
/**
* 查询操作日志详细
- *
+ *
* @param operId 操作ID
* @return 操作日志对象
*/
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
index 53c564d..2fe6613 100644
--- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
@@ -112,7 +112,7 @@
public List<Long> selectDeptListByRoleId(Long roleId)
{
SysRole role = roleMapper.selectRoleById(roleId);
- return deptMapper.selectDeptListByRoleId(roleId, role.isDeptCheckStrictly());
+ return deptMapper.selectDeptListByRoleId(roleId, false);
}
/**
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java
index 0ff8d39..b424abf 100644
--- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java
@@ -156,7 +156,7 @@
public List<Long> selectMenuListByRoleId(Long roleId)
{
SysRole role = roleMapper.selectRoleById(roleId);
- return menuMapper.selectMenuListByRoleId(roleId, role.isMenuCheckStrictly());
+ return menuMapper.selectMenuListByRoleId(roleId, false);
}
/**
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java
index 5174654..b2e0900 100644
--- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java
@@ -7,11 +7,14 @@
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.mapper.SysOperLogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.api.domain.SysOperLog;
import com.ruoyi.system.service.ISysOperLogService;
+
+import javax.annotation.Resource;
/**
* 操作日志 服务层处理
@@ -19,8 +22,10 @@
* @author ruoyi
*/
@Service
-public class SysOperLogServiceImpl implements ISysOperLogService {
- @Autowired
+public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOperLog> implements ISysOperLogService {
+
+
+ @Resource
private SysOperLogMapper operLogMapper;
/**
@@ -73,50 +78,5 @@
@Override
public void cleanOperLog() {
operLogMapper.cleanOperLog();
- }
-
- @Override
- public boolean saveBatch(Collection<SysOperLog> entityList, int batchSize) {
- return false;
- }
-
- @Override
- public boolean saveOrUpdateBatch(Collection<SysOperLog> entityList, int batchSize) {
- return false;
- }
-
- @Override
- public boolean updateBatchById(Collection<SysOperLog> entityList, int batchSize) {
- return false;
- }
-
- @Override
- public boolean saveOrUpdate(SysOperLog entity) {
- return false;
- }
-
- @Override
- public SysOperLog getOne(Wrapper<SysOperLog> queryWrapper, boolean throwEx) {
- return null;
- }
-
- @Override
- public Map<String, Object> getMap(Wrapper<SysOperLog> queryWrapper) {
- return null;
- }
-
- @Override
- public <V> V getObj(Wrapper<SysOperLog> queryWrapper, Function<? super Object, V> mapper) {
- return null;
- }
-
- @Override
- public BaseMapper<SysOperLog> getBaseMapper() {
- return null;
- }
-
- @Override
- public Class<SysOperLog> getEntityClass() {
- return null;
}
}
diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml
index 644448f..cb911b6 100644
--- a/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml
+++ b/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml
@@ -44,7 +44,7 @@
enabled: true
application-id: ${spring.application.name}
tx-service-group: seata_tx_group #此处配置自定义的seata事务分组名称
- enable-auto-data-source-proxy: true #开启数据库代理
+ enable-auto-data-source-proxy: false #关闭数据库代理
service:
vgroup-mapping:
seata_tx_group: default
diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml
index f28abf0..64b5981 100644
--- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml
+++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml
@@ -164,7 +164,7 @@
<select id="getSysRoleByIds" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
<if test="null != ids and ids.size() > 0">
- where r.id in
+ where r.role_id in
<foreach collection="ids" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppCouponController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppCouponController.java
index 9504465..54626a4 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppCouponController.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppCouponController.java
@@ -12,23 +12,25 @@
import com.ruoyi.account.api.vo.ExchangeRecordVO;
import com.ruoyi.account.service.TAppCouponService;
import com.ruoyi.account.service.TAppUserCarService;
+import com.ruoyi.chargingPile.api.feignClient.ChargingPileClient;
+import com.ruoyi.chargingPile.api.vo.SiteInfoVO;
+import com.ruoyi.chargingPile.api.feignClient.ChargingPileClient;
import com.ruoyi.common.core.domain.R;
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.service.TokenService;
+import com.ruoyi.order.api.feignClient.ChargingOrderClient;
import com.ruoyi.other.api.domain.TCoupon;
import com.ruoyi.other.api.feignClient.OtherClient;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Date;
import java.util.List;
/**
@@ -44,13 +46,45 @@
public class TAppCouponController {
@Autowired
private TAppCouponService tAppCouponService;
- @Autowired
- private OtherClient otherClient;
@Autowired
private TAppUserCarService appUserCarService;
@Autowired
private TokenService tokenService;
+ @Autowired
+ private ChargingPileClient chargingPileClient;
+ @Autowired
+ private ChargingOrderClient chargingOrderClient;
+ /**
+ * 查询用户可用优惠券数量
+ * @return
+ */
+ @ApiOperation(value = "通过桩编号获取电站详情", tags = {"小程序-扫一扫"})
+ @GetMapping(value = "/scan/siteInfo")
+ public AjaxResult<SiteInfoVO> siteInfo(String number) {
+ SiteInfoVO data = chargingPileClient.getSiteInfoByNumber(number).getData();
+ List<TAppUserCar> cars = appUserCarService.list(new QueryWrapper<TAppUserCar>()
+ .eq("app_user_id",tokenService.getLoginUserApplet().getUserId())
+ .orderByDesc("create_time"));
+ Long data1 = chargingOrderClient.getCar().getData();
+ if (!cars.isEmpty()){
+ if (data1 == -1){
+ // 没有充电订单 展示最新添加的车辆
+ data.setLicensePlate(cars.get(0).getLicensePlate());
+ data.setVehicleBrand(cars.get(0).getVehicleBrand());
+ data.setId(cars.get(0).getId());
+ }else{
+ for (TAppUserCar car : cars) {
+ if (car.getId().equals(data1)){
+ data.setLicensePlate(car.getLicensePlate());
+ data.setVehicleBrand(car.getVehicleBrand());
+ data.setId(car.getId());
+ }
+ }
+ }
+ }
+ return AjaxResult.ok(data);
+ }
/**
* 查询用户可用优惠券数量
* @param dto
@@ -63,16 +97,15 @@
return AjaxResult.ok(res);
}
/**
- * 选择车辆列表
+ * 选择车辆列表 远程调用
* @return
*/
@ApiOperation(value = "选择车辆列表", tags = {"小程序-扫一扫"})
@PostMapping(value = "/scan/carList")
- public AjaxResult<List<TAppUserCar>> carList() {
- // todo 用户id
+ public R<List<TAppUserCar>> carList() {
List<TAppUserCar> appUserId = appUserCarService.list(new QueryWrapper<TAppUserCar>()
.eq("app_user_id",tokenService.getLoginUserApplet().getUserId()));
- return AjaxResult.ok(appUserId);
+ return R.ok(appUserId);
}
/**
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java
index 217799e..bff645a 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java
@@ -1,6 +1,7 @@
package com.ruoyi.account.controller;
+import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
@@ -14,6 +15,7 @@
import com.ruoyi.account.wx.body.resq.Code2SessionResqBody;
import com.ruoyi.account.wx.model.WeixinProperties;
import com.ruoyi.account.wx.tools.WxAppletTools;
+import com.ruoyi.account.util.GiveVipUtil;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.utils.bean.BeanUtils;
import com.ruoyi.common.core.web.domain.AjaxResult;
@@ -27,6 +29,7 @@
import com.ruoyi.order.api.model.TChargingOrder;
import com.ruoyi.order.api.model.TExchangeOrder;
import com.ruoyi.other.api.domain.TCompany;
+import com.ruoyi.other.api.domain.TCoupon;
import com.ruoyi.other.api.domain.TUserTag;
import com.ruoyi.other.api.feignClient.OtherClient;
import com.ruoyi.system.api.domain.SysRole;
@@ -34,13 +37,16 @@
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
+import org.apache.poi.ss.formula.functions.T;
import lombok.extern.slf4j.Slf4j;
+import org.aspectj.weaver.loadtime.Aj;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
import java.time.Duration;
+import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
@@ -78,12 +84,70 @@
@Resource
private ExchangeOrderClient exchangeOrderClient;
+ @Autowired
+ private TokenService tokenService;
+ @Autowired
+ private RedisService redisService;
+ @Autowired
+ private WeixinProperties wxConfig;
+ @Autowired
+ private RestTemplate wxRestTemplate;
+
+ @Resource
+ private TAppUserSignService signService;
+ @Resource
+ private TAppCouponService appCouponService;
+ @Resource
+ private TAppUserCarService carService;
+
+
+ @ApiOperation(value = "查询当前用户是否为会员 0否1是", tags = {"小程序--查询当前用户是否为会员"})
+ @PostMapping(value = "/getUserInfo")
+ public AjaxResult<Integer> getUserInfo() {
+ TAppUser byId = appUserService.getById(tokenService.getLoginUserApplet().getUserId());
+ if (byId.getVipEndTime() == null){
+ return AjaxResult.ok(0);
+ }else if (byId.getVipEndTime().isAfter(LocalDateTime.now())){
+ return AjaxResult.ok(1);
+ }else{
+ return AjaxResult.ok(0);
+ }
+ }
+ @ApiOperation(value = "通过code获得openid, 1 --->对应的appid:wx4c405fa42539fc21 2---->对应的appid:wx02d9f6c92e6d3c86")
+ @GetMapping("openId-by-jscode2session/{code}")
+ public AjaxResult<Map<String, Object>> jscode2session(@PathVariable String code) {
+ log.info("<<<<<<<<换取openid开始<<<<<<<<:{}", code);
+ WxAppletTools appletTools = new WxAppletTools(wxRestTemplate, wxConfig);
+ Code2SessionRespBody body = appletTools.getOpenIdByJscode2session(new Code2SessionResqBody().build(code));
+ String openid = body.getOpenid();
+ String sessionKey = body.getSessionKey();
+ TAppUser appUser = appUserService.getOne(Wrappers.lambdaQuery(TAppUser.class).eq(TAppUser::getWxOpenid, openid).last("limit 1"));
+ if (Objects.isNull(appUser)) {
+ appUser = new TAppUser();
+ appUser.setWxOpenid(openid);
+ appUserService.save(appUser);
+ }
+ // 提前对sessionKey进行删除
+ log.info("换取sessionKey:{}", sessionKey);
+ // 将sessionKey进行存储,后续获取信息需要
+ redisService.setCacheObject(openid, sessionKey);
+ LoginUserApplet loginUserApplet = new LoginUserApplet();
+ if(ObjectUtils.isNotNull(appUser)){
+ loginUserApplet.setUserId(appUser.getId());
+ }
+ HashMap<String, Object> tokenInfos = new HashMap<>();
+ tokenInfos.put("token",tokenService.createTokenApplet(loginUserApplet));
+ tokenInfos.put("info",loginUserApplet);
+ return AjaxResult.ok(tokenInfos);
+ }
@ApiOperation(value = "管理后台-根据手机号查询用户ids", tags = {"管理后台-活动费用统计"})
@PostMapping(value = "/user/getUserIdsByPhone")
public R<List<Long>> getUserIdsByPhone(@RequestParam("phone") String phone) {
return R.ok(appUserService.list(new QueryWrapper<TAppUser>().like("phone",phone)).stream().map(TAppUser::getId).collect(Collectors.toList()));
}
+ @Resource
+ private GiveVipUtil giveVipUtil;
@ApiOperation(value = "单位管理列表", tags = {"用户管理-单位管理"})
@PostMapping(value = "/unit/page")
public R<Page<TCompany>> unitPage(@RequestBody UnitListQueryDto unitListQueryDto) {
@@ -96,6 +160,20 @@
}
return R.ok(data);
}
+
+
+ @ApiOperation(value = "单位下拉框", tags = {"用户管理-单位管理"})
+ @PostMapping(value = "/unit/select")
+ public R<List<TCompany>> unitSelect() {
+ UnitListQueryDto unitListQueryDto = new UnitListQueryDto();
+ unitListQueryDto.setPageCurr(1);
+ unitListQueryDto.setPageSize(9999);
+ //拿到单位列表
+ R<Page<TCompany>> pageR = otherClient.queryUnitPage(unitListQueryDto);
+
+ return R.ok(pageR.getData().getRecords());
+ }
+
@ApiOperation(value = "单位管理添加或编辑", tags = {"用户管理-单位管理"})
@PostMapping(value = "/unit/addOrUpdate")
@@ -267,7 +345,7 @@
return R.ok(userDetailDto);
}
- @ApiOperation(value = "用户详情积分明细", tags = {"用户管理-用户列表"})
+ @ApiOperation(value = "用户详情积分明细", tags = {"后台-用户管理-用户列表","小程序-个人中心"})
@PostMapping(value = "/user/points/page")
public R<Page<TAppUserIntegralChange>> pointsDetail(@RequestBody PointsQueryDto pointsQueryDto) {
List<Integer> types = new ArrayList<>();
@@ -303,7 +381,7 @@
}
- @ApiOperation(value = "用户详情积分明细", tags = {"用户管理-用户列表"})
+ @ApiOperation(value = "冻结解冻用户", tags = {"后台-用户管理-用户列表"})
@PostMapping(value = "/user/status/change")
public R pointsDetail(@RequestBody UserChangeDto userChangeDto) {
TAppUser appUser = appUserService.getById(userChangeDto.getUserId());
@@ -312,37 +390,76 @@
return R.ok();
}
+ @ApiOperation(value = "个人中心信息", tags = {"小程序-个人中心"})
+ @PostMapping(value = "/user/info")
+ public R<AppUserInfoDto> info() {
+ Long userId = 1L;
+ TAppUser byId = appUserService.getById(userId);
+ AppUserInfoDto appUserInfoDto = new AppUserInfoDto();
+
+ //判断会员
+ if (byId.getVipEndTime()==null||byId.getVipEndTime().isBefore(LocalDateTime.now())){
+ appUserInfoDto.setIsVip(0);
+ }else {
+ appUserInfoDto.setIsVip(1);
+ appUserInfoDto.setVipExpireTime(byId.getVipEndTime());
+ }
+ //判断当天是否签到
+ Long count = signService.lambdaQuery().eq(TAppUserSign::getSignDay, LocalDate.now()).count();
+ appUserInfoDto.setIsSign(count>0?1:0);
+ //获取当前拥有的优惠卷数量
+ Long coupons = appCouponService.lambdaQuery().eq(TAppCoupon::getAppUserId, userId).eq(TAppCoupon::getStatus, 1).count();
+ appUserInfoDto.setCouponNum(Math.toIntExact(coupons));
+ //当前绑定的车辆
+ List<TAppUserCar> list = carService.lambdaQuery().eq(TAppUserCar::getAppUserId, userId).list();
+ appUserInfoDto.setUserCars(list);
+ return R.ok(appUserInfoDto);
+
+
+ }
+
+ @ApiOperation(value = "优惠卷列表不分页(1可使用2不可用)", tags = {"小程序-个人中心"})
+ @PostMapping(value = "/user/coupon")
+ public R<List<InfoCouponDto>> userCoupon(@RequestParam("type") Integer type) {
+ LocalDateTime now = LocalDateTime.now();
+
+ List<InfoCouponDto> couponDtos = new ArrayList<>();
+ List<TAppCoupon> list = appCouponService.lambdaQuery().le(TAppCoupon::getStartTime, now).ge(TAppCoupon::getEndTime, now).eq(TAppCoupon::getStatus, type).list();
+ for (TAppCoupon tAppCoupon : list) {
+ TCoupon coupon = JSON.toJavaObject(JSON.parseObject(tAppCoupon.getCouponJson()), TCoupon.class);
+ InfoCouponDto infoCouponDto = new InfoCouponDto();
+ BeanUtils.copyProperties(coupon,infoCouponDto);
+ couponDtos.add(infoCouponDto);
+
+ }
+
+
+ return R.ok(couponDtos);
+
+
+ }
+
+
@ApiOperation(value = "赠送会员", tags = {"用户管理-用户列表"})
@PostMapping(value = "/user/give/vip")
public R giveVip(@RequestBody GiveVipDto giveVipDto) {
TAppUser nowUser = appUserService.getById(giveVipDto.getUserId());
-
- //如果vipEndTime为空或已过期,直接增加
- if (nowUser.getVipEndTime()==null||nowUser.getVipEndTime().isBefore(LocalDateTime.now())) {
- if (giveVipDto.getType() == 1) {
- nowUser.setVipEndTime(LocalDateTime.now().plusDays(31));
- //直接增加vipDetail
- } else if (giveVipDto.getType() == 2) {
- nowUser.setVipEndTime(LocalDateTime.now().plusDays(93));
- } else if (giveVipDto.getType() == 3) {
- nowUser.setVipEndTime(LocalDateTime.now().plusDays(365));
- }
- //直接赠送优惠卷
- }else {
- if (giveVipDto.getType() == 1) {
- nowUser.setVipEndTime(nowUser.getVipEndTime().plusDays(31));
- //如果有这个类型的vip,累加,没有的话,从entTime新增
- } else if (giveVipDto.getType() == 2) {
- nowUser.setVipEndTime(nowUser.getVipEndTime().plusDays(93));
- } else if (giveVipDto.getType() == 3) {
- nowUser.setVipEndTime(nowUser.getVipEndTime().plusDays(365));
- }
+ int plusDay = 0;
+ if (giveVipDto.getType() == 1) {
+ plusDay = 1;
+ } else if (giveVipDto.getType() == 2) {
+ plusDay = 3;
+ } else if (giveVipDto.getType() == 3) {
+ plusDay = 12;
}
+ //增加vipDetail
+ giveVipUtil.sendVip(nowUser, giveVipDto.getVipId(),plusDay);
-
+ appUserService.updateById(nowUser);
+ //执行一次赠送优惠卷的定时任务
return R.ok();
}
@@ -357,7 +474,7 @@
return R.ok(appUserService.list(Wrappers.<TAppUser>lambdaQuery().in(TAppUser::getId,appUserIds)));
}
-
+
/**
* 根据用户id获取用户
* @param id
@@ -368,8 +485,8 @@
TAppUser appUser = appUserService.getById(id);
return R.ok(appUser);
}
-
-
+
+
/**
* 修改用户信息
* @param appUser
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/TAppUserVipDetailService.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/TAppUserVipDetailService.java
index 8e90bd7..4dff539 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/TAppUserVipDetailService.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/TAppUserVipDetailService.java
@@ -13,4 +13,5 @@
*/
public interface TAppUserVipDetailService extends IService<TAppUserVipDetail> {
+ void giveVipCoupun(Long appUserId, Integer vipId,Long recordId,Integer monthNum);
}
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/TAppCouponServiceImpl.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/TAppCouponServiceImpl.java
index a499a52..34f0530 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/TAppCouponServiceImpl.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/TAppCouponServiceImpl.java
@@ -241,8 +241,8 @@
break;
}
}
- // 通过集合的money字段 将money从大到小排序
- data.sort(Comparator.comparing(CouponListVOVO::getMoney).reversed());
+ // 通过集合的money、isUse字段 将money、isUse从大到小排序 将不可用的排在最后
+ data.sort(Comparator.comparing(CouponListVOVO::getMoney).reversed().thenComparing(CouponListVOVO::getIsUse));
pageInfo.setRecords(data);
return pageInfo;
}
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/TAppUserVipDetailServiceImpl.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/TAppUserVipDetailServiceImpl.java
index 50674ce..1894f70 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/TAppUserVipDetailServiceImpl.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/TAppUserVipDetailServiceImpl.java
@@ -1,11 +1,27 @@
package com.ruoyi.account.service.impl;
+import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.account.api.dto.SendCouponDto;
+import com.ruoyi.account.api.feignClient.AppCouponClient;
+import com.ruoyi.account.api.model.TAppCoupon;
import com.ruoyi.account.api.model.TAppUserVipDetail;
import com.ruoyi.account.mapper.TAppUserVipDetailMapper;
+import com.ruoyi.account.service.TAppCouponService;
import com.ruoyi.account.service.TAppUserVipDetailService;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.other.api.domain.TCoupon;
+import com.ruoyi.other.api.domain.TVip;
+import com.ruoyi.other.api.feignClient.OtherClient;
+import com.ruoyi.other.api.feignClient.VipClient;
import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.util.List;
/**
* <p>
@@ -17,5 +33,49 @@
*/
@Service
public class TAppUserVipDetailServiceImpl extends ServiceImpl<TAppUserVipDetailMapper, TAppUserVipDetail> implements TAppUserVipDetailService {
+ @Resource
+ private VipClient vipClient;
+ @Resource
+ private OtherClient otherClient;
+ @Resource
+ private TAppCouponService appCouponService;
+ @Resource
+ private TAppUserVipDetailService tAppUserVipDetailService;
+
+
+
+ @Override
+ public void giveVipCoupun(Long appUserId, Integer vipId,Long recordId,Integer monthNum) {
+ //如果不包含,则更新sendNum,并且赠送优惠卷
+ TAppUserVipDetail byId = tAppUserVipDetailService.getById(recordId);
+ if (byId.getStartTime().plusMonths(byId.getSendMonth()).toLocalDate().compareTo(LocalDate.now())==0&&LocalDate.now().isBefore(byId.getEndTime().toLocalDate())){
+ byId.setSendMonth(byId.getSendMonth()+1);
+ //给这个用户发放对应vip的优惠卷以及充电次数加满
+ List<SendCouponDto> javaList = JSON.parseArray(byId.getCouponIds()).toJavaList(SendCouponDto.class);
+ for (SendCouponDto sendCouponDto : javaList) {
+ Integer number = sendCouponDto.getNumber();
+ for (Integer i = 0; i < number; i++) {
+ R<TCoupon> couponById = otherClient.getCouponById(sendCouponDto.getId());
+ TCoupon coupon = couponById.getData();
+ //将该优惠卷添加到用户优惠卷中
+ TAppCoupon tAppCoupon = new TAppCoupon();
+ tAppCoupon.setAppUserId(appUserId);
+ tAppCoupon.setCouponId(sendCouponDto.getId());
+ if (coupon.getValidityPeriodMode() == 1) {
+ tAppCoupon.setEndTime(coupon.getEndTime());
+ } else {
+ tAppCoupon.setEndTime(LocalDateTime.now().plusDays(coupon.getDays()));
+ }
+ tAppCoupon.setWaysToObtain(4);
+ tAppCoupon.setStatus(1);
+ tAppCoupon.setCouponJson(JSON.toJSONString(coupon));
+ appCouponService.save(tAppCoupon);
+ }
+ }
+
+ }
+ byId.setChargeNum(byId.getSendChargeNum());
+ tAppUserVipDetailService.updateById(byId);
+ }
}
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/task/TaskUtil.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/task/TaskUtil.java
new file mode 100644
index 0000000..0bdf907
--- /dev/null
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/task/TaskUtil.java
@@ -0,0 +1,54 @@
+package com.ruoyi.account.task;
+
+
+import com.ruoyi.account.api.model.TAppUserVipDetail;
+import com.ruoyi.account.service.TAppUserVipDetailService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.time.LocalDate;
+import java.util.List;
+
+
+/**
+ * 定时任务工具类
+ */
+@Component
+public class TaskUtil {
+
+ @Resource
+ private TAppUserVipDetailService tAppUserVipDetailService;
+
+
+
+ /**
+ * 每隔一分钟去处理的定时任务
+ */
+ @Scheduled(fixedRate = 1000 * 60)
+ public void sendVipCoupon(){
+ try {
+ //首先获取当前的月份,用int类型标识
+ LocalDate currentDate = LocalDate.now();
+ int monthNum = currentDate.getMonthValue();
+ //获取在当前时间内生效的vipDetail
+ List<TAppUserVipDetail> recentDetails = tAppUserVipDetailService.lambdaQuery()
+ .ge(TAppUserVipDetail::getStartTime, currentDate)
+ .le(TAppUserVipDetail::getEndTime, currentDate)
+ .orderByDesc(TAppUserVipDetail::getStartTime).list();
+ //判断sendNum是否包括当前月份
+ for (TAppUserVipDetail recentDetail : recentDetails) {
+
+ //赠送优惠卷
+ tAppUserVipDetailService.giveVipCoupun(recentDetail.getAppUserId(), recentDetail.getVipId(),recentDetail.getId(),monthNum);
+
+
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+
+}
diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/GiveVipUtil.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/GiveVipUtil.java
new file mode 100644
index 0000000..b477141
--- /dev/null
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/GiveVipUtil.java
@@ -0,0 +1,96 @@
+package com.ruoyi.account.util;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONArray;
+import com.ruoyi.account.api.dto.SendCouponDto;
+import com.ruoyi.account.api.model.TAppCoupon;
+import com.ruoyi.account.api.model.TAppUser;
+import com.ruoyi.account.api.model.TAppUserVipDetail;
+import com.ruoyi.account.service.TAppCouponService;
+import com.ruoyi.account.service.TAppUserVipDetailService;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.other.api.domain.TCoupon;
+import com.ruoyi.other.api.domain.TVip;
+import com.ruoyi.other.api.feignClient.OtherClient;
+import com.ruoyi.other.api.feignClient.VipClient;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.time.LocalDateTime;
+import java.util.List;
+
+@Component
+public class GiveVipUtil {
+
+ @Resource
+ private VipClient vipClient;
+ @Resource
+ private TAppUserVipDetailService tAppUserVipDetailService;
+ @Resource
+ private OtherClient otherClient;
+ @Resource
+ private TAppCouponService appCouponService;
+ public void sendVip(TAppUser nowUser,Integer vipId,Integer plusDay){
+ if (nowUser.getVipEndTime()==null||nowUser.getVipEndTime().isBefore(LocalDateTime.now())) {
+
+ nowUser.setVipEndTime(LocalDateTime.now().plusMonths(plusDay));
+
+ //直接再detail里新增数据,因为不是续费
+ TAppUserVipDetail tAppUserVipDetail = new TAppUserVipDetail();
+ tAppUserVipDetail.setAppUserId(nowUser.getId());
+ tAppUserVipDetail.setStartTime(LocalDateTime.now());
+ tAppUserVipDetail.setEndTime(LocalDateTime.now().plusMonths(plusDay).minusDays(1));
+ tAppUserVipDetail.setVipId(vipId);
+
+ R<TVip> info = vipClient.getInfo(vipId);
+ TVip vip = info.getData();
+ List<SendCouponDto> javaList = JSON.parseArray(vip.getCoupon()).toJavaList(SendCouponDto.class);
+
+ tAppUserVipDetail.setCouponIds(vip.getCoupon());
+ tAppUserVipDetail.setSendChargeNum(vip.getDiscountTimes());
+ tAppUserVipDetail.setChargeNum(vip.getDiscountTimes());
+ tAppUserVipDetail.setDiscountMoney(vip.getMaximumDeduction());
+ tAppUserVipDetail.setSendMonth(1);
+ tAppUserVipDetailService.save(tAppUserVipDetail);
+ //直接赠送优惠卷
+ for (SendCouponDto sendCouponDto : javaList) {
+ Integer number = sendCouponDto.getNumber();
+ for (Integer i = 0; i < number; i++) {
+
+
+ R<TCoupon> couponById = otherClient.getCouponById(sendCouponDto.getId());
+ TCoupon coupon = couponById.getData();
+ //将该优惠卷添加到用户优惠卷中
+ TAppCoupon tAppCoupon = new TAppCoupon();
+ tAppCoupon.setAppUserId(nowUser.getId());
+ tAppCoupon.setCouponId(Integer.valueOf(sendCouponDto.getId()));
+ if (coupon.getValidityPeriodMode() == 1) {
+ tAppCoupon.setEndTime(coupon.getEndTime());
+ } else {
+ tAppCoupon.setEndTime(LocalDateTime.now().plusDays(coupon.getDays()));
+ }
+ tAppCoupon.setWaysToObtain(4);
+ tAppCoupon.setStatus(1);
+ tAppCoupon.setCouponJson(JSON.toJSONString(coupon));
+ appCouponService.save(tAppCoupon);
+ }
+ }
+
+
+ }else {
+ nowUser.setVipEndTime(nowUser.getVipEndTime().plusDays(plusDay));
+ //获取detail里结束时间大于当前时间的数据,并将enttime延长
+ TAppUserVipDetail tAppUserVipDetail = tAppUserVipDetailService.lambdaQuery().eq(TAppUserVipDetail::getAppUserId, nowUser.getId()).orderByDesc(TAppUserVipDetail::getEndTime).last("limit 1").one();
+
+// TAppUserVipDetail newAppUser = new TAppUserVipDetail();
+// newAppUser.setAppUserId(nowUser.getId());
+// newAppUser.setStartTime(tAppUserVipDetail.getEndTime());
+ tAppUserVipDetail.setEndTime(tAppUserVipDetail.getEndTime().plusMonths(plusDay).minusDays(1));
+// newAppUser.setVipId(vipId);
+ tAppUserVipDetailService.updateById(tAppUserVipDetail);
+// tAppUserVipDetail.setEndTime(tAppUserVipDetail.getEndTime().plusDays(plusDay));
+// tAppUserVipDetailService.updateById(tAppUserVipDetail);
+ }
+
+ }
+}
diff --git a/ruoyi-service/ruoyi-account/src/main/resources/bootstrap.yml b/ruoyi-service/ruoyi-account/src/main/resources/bootstrap.yml
index f550578..7895000 100644
--- a/ruoyi-service/ruoyi-account/src/main/resources/bootstrap.yml
+++ b/ruoyi-service/ruoyi-account/src/main/resources/bootstrap.yml
@@ -43,7 +43,7 @@
enabled: true
application-id: ${spring.application.name}
tx-service-group: seata_tx_group #此处配置自定义的seata事务分组名称
- enable-auto-data-source-proxy: true #开启数据库代理
+ enable-auto-data-source-proxy: false #关闭数据库代理
service:
vgroup-mapping:
seata_tx_group: default
diff --git a/ruoyi-service/ruoyi-chargingPile/pom.xml b/ruoyi-service/ruoyi-chargingPile/pom.xml
index 87b9b86..63d7f4a 100644
--- a/ruoyi-service/ruoyi-chargingPile/pom.xml
+++ b/ruoyi-service/ruoyi-chargingPile/pom.xml
@@ -15,7 +15,12 @@
</description>
<dependencies>
-
+ <dependency>
+ <groupId>com.ruoyi</groupId>
+ <artifactId>ruoyi-api-account</artifactId>
+ <version>3.6.2</version>
+ <scope>compile</scope>
+ </dependency>
<!-- ruoyi-modules-chargingPile-api -->
<dependency>
<groupId>com.ruoyi</groupId>
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/config/DataUpdateHandlerConfig.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/config/DataUpdateHandlerConfig.java
index 6ee7c36..e4d1c1e 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/config/DataUpdateHandlerConfig.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/config/DataUpdateHandlerConfig.java
@@ -7,6 +7,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
+import java.time.LocalDateTime;
import java.util.Date;
/**
@@ -33,8 +34,8 @@
*/
@Override
public void insertFill(MetaObject metaObject) {
- this.setFieldValByName("createTime", new Date(), metaObject);
- this.setFieldValByName("updateTime", new Date(), metaObject);
+ this.setFieldValByName("createTime", LocalDateTime.now(), metaObject);
+ this.setFieldValByName("updateTime", LocalDateTime.now(), metaObject);
}
/**
@@ -44,6 +45,6 @@
*/
@Override
public void updateFill(MetaObject metaObject) {
- this.setFieldValByName("updateTime", new Date(), metaObject);
+ this.setFieldValByName("updateTime", LocalDateTime.now(), metaObject);
}
}
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/PartnerController.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/PartnerController.java
index 3346720..3c71cd9 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/PartnerController.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/PartnerController.java
@@ -81,12 +81,12 @@
@ResponseBody
- @DeleteMapping("/delPartner/{id}")
+ @DeleteMapping("/delPartner")
@ApiOperation(value = "删除合作商", tags = {"管理后台-合作商管理"})
@ApiImplicitParams({
@ApiImplicitParam(value = "合作商id", name = "id", dataTypeClass = Integer.class, required = true)
})
- public AjaxResult delPartner(@PathVariable("id") Integer[] id){
+ public AjaxResult delPartner(@RequestParam("id") List<Integer> id){
return partnerService.delPartner(id);
}
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/SiteController.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/SiteController.java
index 44c9356..8ddb212 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/SiteController.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/SiteController.java
@@ -5,17 +5,11 @@
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.chargingPile.api.dto.GetSiteListDTO;
import com.ruoyi.chargingPile.api.feignClient.ParkingLotClient;
-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.model.TParkingLot;
+import com.ruoyi.chargingPile.api.model.*;
import com.ruoyi.chargingPile.api.query.GetSiteList;
import com.ruoyi.chargingPile.api.query.SiteDetailQuery;
import com.ruoyi.chargingPile.api.query.SiteQuery;
-import com.ruoyi.chargingPile.api.vo.ChargingGunCountVO;
-import com.ruoyi.chargingPile.api.vo.SiteDetailVO;
-import com.ruoyi.chargingPile.api.vo.SiteVO;
-import com.ruoyi.chargingPile.api.vo.TChargingPileVO;
+import com.ruoyi.chargingPile.api.vo.*;
import com.ruoyi.chargingPile.domain.SiteMenu;
import com.ruoyi.chargingPile.service.*;
import com.ruoyi.common.core.domain.R;
@@ -36,6 +30,8 @@
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.time.LocalTime;
import java.util.*;
/**
@@ -69,18 +65,44 @@
@Autowired
private TParkingLotService parkingLotService;
+ @Autowired
+ private TAccountingStrategyService accountingStrategyService;
+ @Autowired
+ private TAccountingStrategyDetailService accountingStrategyDetailService;
+
+ /**
+ * 小程序扫一扫
+ * @param number
+ * @return
+ */
+ @PostMapping("/getSiteInfoByNumber")
+ @ApiOperation(value = "扫一扫后通过桩编号获取电站信息", tags = {"小程序-扫一扫"})
+ public R<SiteInfoVO> getSiteInfoByNumber(@RequestParam("number") String number){
+ SiteInfoVO siteInfoVO = new SiteInfoVO();
+ TChargingPile one = chargingPileService.lambdaQuery().eq(TChargingPile::getNumber, number).one();
+ Site byId = siteService.getById(one.getSiteId());
+ TAccountingStrategy byId1 = accountingStrategyService.getById(byId.getAccountingStrategyId());
+ List<TAccountingStrategyDetail> list = accountingStrategyDetailService.lambdaQuery().eq(TAccountingStrategyDetail::getAccountingStrategyId, byId1.getId()).list();
+ for (TAccountingStrategyDetail tAccountingStrategyDetail : list) {
+ // 当前时间属于那个阶段 取哪个阶段的电价
+ if(LocalTime.now().isAfter(LocalTime.parse(tAccountingStrategyDetail.getStartTime())) && LocalTime.now().isBefore(LocalTime.parse(tAccountingStrategyDetail.getEndTime()))){
+ siteInfoVO.setElectrovalence(tAccountingStrategyDetail.getElectrovalence());
+ siteInfoVO.setVipElectrovalence(tAccountingStrategyDetail.getElectrovalence().multiply(byId1.getDiscount()).setScale(2, BigDecimal.ROUND_HALF_UP));
+ }
+ }
+ siteInfoVO.setName(byId.getName());
+ siteInfoVO.setNumber(one.getNumber().toString());
+ siteInfoVO.setSpaceChargeExplain(byId.getSpaceChargeExplain());
+ return R.ok(siteInfoVO);
+ }
-
-
- @ResponseBody
@GetMapping("/getSiteList")
@ApiOperation(value = "获取站点列表", tags = {"管理后台-站点管理"})
public AjaxResult<PageInfo<GetSiteListDTO>> getSiteList(GetSiteList siteList){
PageInfo<GetSiteListDTO> list = siteService.getSiteList(siteList);
return AjaxResult.success(list);
}
- @ResponseBody
@GetMapping("/getSiteList1")
@ApiOperation(value = "获取站点列表 不分页", tags = {"管理后台-活动费用统计"})
public AjaxResult<List<Site>> getSiteList1(){
@@ -148,12 +170,12 @@
}
@ResponseBody
- @DeleteMapping("/delSite/{id}")
+ @DeleteMapping("/delSite")
@ApiOperation(value = "删除站点", tags = {"管理后台-站点管理"})
@ApiImplicitParams({
@ApiImplicitParam(value = "站点id", name = "id", dataTypeClass = Integer.class, required = true)
})
- public AjaxResult delSite(@PathVariable Integer[] id){
+ public AjaxResult delSite(@RequestParam("id") Integer[] id){
return siteService.delSite(id);
}
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java
index d7f4f4c..53fee20 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java
@@ -179,8 +179,6 @@
}
}
-
-
return AjaxResult.ok(accountingStrategyService.pageList(query));
}
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingGunController.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingGunController.java
index e9f4b05..5820af8 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingGunController.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingGunController.java
@@ -92,8 +92,7 @@
@DeleteMapping(value = "/deleteById")
public AjaxResult<Boolean> deleteById(@RequestParam("id") Integer id) {
TChargingGun chargingGun = chargingGunService.getById(id);
- chargingGun.setDelFlag(true);
- chargingGunService.updateById(chargingGun);
+ chargingGunService.removeById(chargingGun);
return AjaxResult.success();
}
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingPileController.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingPileController.java
index 11b8807..a93b658 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingPileController.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingPileController.java
@@ -117,13 +117,13 @@
@ResponseBody
- @DeleteMapping("/delChargingPile/{id}")
+ @DeleteMapping("/delChargingPile")
@Log(title = "删除充电桩", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE)
@ApiOperation(value = "删除充电桩", tags = {"管理后台-充电桩信息"})
@ApiImplicitParams({
@ApiImplicitParam(value = "充电桩id", name = "id", dataTypeClass = Integer.class, required = true)
})
- public AjaxResult delChargingPile(@PathVariable Integer[] id){
+ public AjaxResult delChargingPile(@RequestParam("id") Integer[] id){
return chargingPileService.delChargingPile(id);
}
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingPileNotificationController.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingPileNotificationController.java
index 9f7c8cd..d4a0f79 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingPileNotificationController.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingPileNotificationController.java
@@ -39,9 +39,9 @@
@ResponseBody
- @DeleteMapping("/delChargingPileNotification/{id}")
+ @DeleteMapping("/delChargingPileNotification")
@ApiOperation(value = "删除系统通知", tags = {"管理后台-系统通知"})
- public AjaxResult delChargingPileNotification(@PathVariable Long id){
+ public AjaxResult delChargingPileNotification(@RequestParam("id") Long id){
TChargingPileNotification chargingPileNotification = chargingPileNotificationService.getById(id);
chargingPileNotification.setDelFlag(1);
chargingPileNotificationService.updateById(chargingPileNotification);
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/IPartnerService.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/IPartnerService.java
index bab0bb9..24b0edf 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/IPartnerService.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/IPartnerService.java
@@ -58,7 +58,7 @@
* 删除合作商
* @param id
*/
- AjaxResult delPartner(Integer[] id);
+ AjaxResult delPartner(List<Integer> id);
/**
* 重置密码
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/PartnerServiceImpl.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/PartnerServiceImpl.java
index 8c79e0e..80097d4 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/PartnerServiceImpl.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/PartnerServiceImpl.java
@@ -165,10 +165,10 @@
if(StringUtils.isEmpty(partner.getPhoneOne())){
return AjaxResult.error("合作商电话1不能为空");
}
- if(StringUtils.isEmpty(partner.getAccount())){
+ if(null == partner.getId() && StringUtils.isEmpty(partner.getAccount())){
return AjaxResult.error("登录账号不能为空");
}
- if(StringUtils.isEmpty(partner.getPassword())){
+ if(null == partner.getId() && StringUtils.isEmpty(partner.getPassword())){
return AjaxResult.error("登录密码不能为空");
}
return AjaxResult.success();
@@ -272,7 +272,7 @@
*/
@Override
@GlobalTransactional(rollbackFor = Exception.class)//分布式事务
- public AjaxResult delPartner(Integer[] ids) {
+ public AjaxResult delPartner(List<Integer> ids) {
//查询有无关联数据
//站点
long count = siteService.count(new LambdaQueryWrapper<Site>().in(Site::getPartnerId, Arrays.asList(ids)).eq(Site::getDelFlag, 0));
@@ -289,8 +289,7 @@
if(null == partner){
return AjaxResult.error("删除失败");
}
- partner.setDelFlag(true);
- this.updateById(partner);
+ this.removeById(partner);
SysUser user = sysUserClient.queryUserByUserName(partner.getAccount()).getData();
user.setDelFlag("2");
sysUserClient.updateUser(user);
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/SiteServiceImpl.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/SiteServiceImpl.java
index a427ee1..0dd482f 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/SiteServiceImpl.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/SiteServiceImpl.java
@@ -210,8 +210,7 @@
}
for (Integer id : ids) {
Site site = this.getById(id);
- site.setDelFlag(true);
- this.updateById(site);
+ this.removeById(site);
}
return AjaxResult.success();
}
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileServiceImpl.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileServiceImpl.java
index fda8e8f..a6567a5 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileServiceImpl.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileServiceImpl.java
@@ -222,8 +222,7 @@
}
for (Integer id : ids) {
TChargingPile chargingPile = this.getById(id);
- chargingPile.setDelFlag(true);
- this.updateById(chargingPile);
+ this.removeById(chargingPile);
}
return AjaxResult.success();
}
diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/resources/bootstrap.yml b/ruoyi-service/ruoyi-chargingPile/src/main/resources/bootstrap.yml
index f462ae6..225c084 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/resources/bootstrap.yml
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/resources/bootstrap.yml
@@ -44,7 +44,7 @@
enabled: true
application-id: ${spring.application.name}
tx-service-group: seata_tx_group #此处配置自定义的seata事务分组名称
- enable-auto-data-source-proxy: true #开启数据库代理
+ enable-auto-data-source-proxy: false #关闭数据库代理
service:
vgroup-mapping:
seata_tx_group: default
diff --git a/ruoyi-service/ruoyi-integration/src/main/resources/bootstrap.yml b/ruoyi-service/ruoyi-integration/src/main/resources/bootstrap.yml
index b35a43c..f8c49a6 100644
--- a/ruoyi-service/ruoyi-integration/src/main/resources/bootstrap.yml
+++ b/ruoyi-service/ruoyi-integration/src/main/resources/bootstrap.yml
@@ -44,7 +44,7 @@
enabled: true
application-id: ${spring.application.name}
tx-service-group: seata_tx_group #此处配置自定义的seata事务分组名称
- enable-auto-data-source-proxy: true #开启数据库代理
+ enable-auto-data-source-proxy: false #关闭数据库代理
service:
vgroup-mapping:
seata_tx_group: default
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
index b2dffa9..af5cec4 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
@@ -44,7 +44,7 @@
* @param
* @return
*/
- @PostMapping(value = "/getCar")
+ @GetMapping(value = "/getCar")
public R<Long> getCar() {
List<TChargingOrder> list = chargingOrderService.list(new LambdaQueryWrapper<TChargingOrder>()
.eq(TChargingOrder::getAppUserId, tokenService.getLoginUserApplet().getUserId())
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderAppealController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderAppealController.java
index 9188660..8d8ec02 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderAppealController.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderAppealController.java
@@ -62,7 +62,7 @@
@GetMapping(value = "/addOrderAppeal")
@ApiOperation(value = "申诉订单", tags = {"小程序-充电记录(个人中心)"})
public AjaxResult addOrderAppeal(@RequestBody TOrderAppeal orderAppeal){
- Long appUserId = tokenService.getLoginUser().getUserid();
+ Long appUserId = tokenService.getLoginUserApplet().getUserId();
orderAppeal.setAppUserId(appUserId);
orderAppeal.setStatus(1);
orderAppealService.save(orderAppeal);
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderEvaluateController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderEvaluateController.java
index 977579c..ab31311 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderEvaluateController.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderEvaluateController.java
@@ -67,8 +67,7 @@
@ApiOperation(value = "删除充电评价", tags = {"管理后台-充电评价"})
public AjaxResult delOrderEvaluate(@PathVariable Long id){
TOrderEvaluate orderEvaluate = orderEvaluateService.getById(id);
- orderEvaluate.setDelFlag(true);
- orderEvaluateService.updateById(orderEvaluate);
+ orderEvaluateService.removeById(orderEvaluate);
return AjaxResult.success();
}
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java
index f189465..ae4d583 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java
@@ -65,7 +65,7 @@
*/
@Override
public Map<String, Object> getMyChargingOrderList(GetMyChargingOrderList query) {
- Long appUserId = tokenService.getLoginUser().getUserid();
+ Long appUserId = tokenService.getLoginUserApplet().getUserId();
Map<String, Object> map = new HashMap<>();
int size = this.baseMapper.getMyChargingOrderList(appUserId, 1, null, null).size();
map.put("number", size);
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TExchangeOrderServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TExchangeOrderServiceImpl.java
index 341d6b7..ab3b9ba 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TExchangeOrderServiceImpl.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TExchangeOrderServiceImpl.java
@@ -58,7 +58,7 @@
*/
@Override
public List<MyExchangeOrderList> getMyExchangeOrder(GetMyExchangeOrder query) {
- Long userid = tokenService.getLoginUser().getUserid();
+ Long userid = tokenService.getLoginUserApplet().getUserId();
LambdaQueryWrapper<TExchangeOrder> wrapper = new LambdaQueryWrapper<TExchangeOrder>().eq(TExchangeOrder::getDelFlag, 0).eq(TExchangeOrder::getAppUserId, userid);
if(query.getStatus() == 0){
wrapper.ne(TExchangeOrder::getStatus, 4);
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderEvaluateServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderEvaluateServiceImpl.java
index e0f76a8..5d772b8 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderEvaluateServiceImpl.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderEvaluateServiceImpl.java
@@ -246,7 +246,7 @@
}
orderEvaluate = new TOrderEvaluate();
BeanUtils.copyProperties(query, orderEvaluate);
- Long userid = tokenService.getLoginUser().getUserid();
+ Long userid = tokenService.getLoginUserApplet().getUserId();
orderEvaluate.setAppUserId(userid);
if(query.getOrderType() == 1){
TChargingOrder chargingOrder = chargingOrderService.getById(query.getOrderId());
diff --git a/ruoyi-service/ruoyi-order/src/main/resources/bootstrap.yml b/ruoyi-service/ruoyi-order/src/main/resources/bootstrap.yml
index 25a9721..9a41659 100644
--- a/ruoyi-service/ruoyi-order/src/main/resources/bootstrap.yml
+++ b/ruoyi-service/ruoyi-order/src/main/resources/bootstrap.yml
@@ -44,7 +44,7 @@
enabled: true
application-id: ${spring.application.name}
tx-service-group: seata_tx_group #此处配置自定义的seata事务分组名称
- enable-auto-data-source-proxy: true #开启数据库代理
+ enable-auto-data-source-proxy: false #关闭数据库代理
service:
vgroup-mapping:
seata_tx_group: default
diff --git a/ruoyi-service/ruoyi-other/pom.xml b/ruoyi-service/ruoyi-other/pom.xml
index 9ab8b38..7179436 100644
--- a/ruoyi-service/ruoyi-other/pom.xml
+++ b/ruoyi-service/ruoyi-other/pom.xml
@@ -51,6 +51,11 @@
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
+ <dependency>
+ <groupId>com.alibaba.cloud</groupId>
+ <artifactId>spring-cloud-starter-alibaba-seata</artifactId>
+ </dependency>
+
<!-- SpringBoot Actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/config/DataSourceProxyConfig.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/config/DataSourceProxyConfig.java
new file mode 100644
index 0000000..5749262
--- /dev/null
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/config/DataSourceProxyConfig.java
@@ -0,0 +1,21 @@
+//package com.ruoyi.other.config;
+//
+//import io.seata.rm.datasource.DataSourceProxy;
+//import org.springframework.context.annotation.Bean;
+//import org.springframework.context.annotation.Configuration;
+//
+//import javax.sql.DataSource;
+//
+///**
+// * @author zhibing.pu
+// * @date 2024/8/17 11:10
+// */
+//@Configuration
+//public class DataSourceProxyConfig {
+//
+//
+// @Bean
+// public DataSource dataSource(DataSource druidDataSource){
+// return new DataSourceProxy(druidDataSource);
+// }
+//}
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TCouponController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TCouponController.java
index f36cca6..3e4f054 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TCouponController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TCouponController.java
@@ -117,6 +117,11 @@
return AjaxResult.ok(tCouponService.pageList(dto));
}
+ @PostMapping(value = "/getCouponById")
+ public R<TCoupon> getCouponById(@RequestParam Integer id) {
+ return R.ok(tCouponService.getById(id));
+
+ }
/**
* 小程序远程调用 获取优惠券信息
*/
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TEvaluationTagController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TEvaluationTagController.java
index 9a49776..191d727 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TEvaluationTagController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TEvaluationTagController.java
@@ -38,8 +38,8 @@
}
@PostMapping("/getTagList")
- public R<List<TEvaluationTagVO>> getTagList() {
- return R.ok(evaluationTagService.getTagList());
+ public R<List<TEvaluationTagVO>> getTagList(@RequestParam("type") Integer type) {
+ return R.ok(evaluationTagService.getTagList(type));
}
@@ -80,13 +80,12 @@
@ResponseBody
- @DeleteMapping("/delEvaluationTag/{id}")
+ @DeleteMapping("/delEvaluationTag")
@ApiOperation(value = "删除评价标签", tags = {"管理后台-评价标签设置"})
- public AjaxResult<TInvoiceType> delEvaluationTag(@PathVariable Integer[] id){
+ public AjaxResult<TInvoiceType> delEvaluationTag(@RequestParam("id") Integer[] id){
List<TEvaluationTag> tEvaluationTags = evaluationTagService.listByIds(Arrays.asList(id));
for (TEvaluationTag evaluationTag : tEvaluationTags) {
- evaluationTag.setDelFlag(true);
- evaluationTagService.updateById(evaluationTag);
+ evaluationTagService.removeById(evaluationTag);
}
return AjaxResult.success();
}
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/THtmlController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/THtmlController.java
index 1739f4d..46b995a 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/THtmlController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/THtmlController.java
@@ -1,9 +1,14 @@
package com.ruoyi.other.controller;
-import org.springframework.web.bind.annotation.RequestMapping;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.other.api.domain.THtml;
+import com.ruoyi.other.api.domain.TNotice;
+import com.ruoyi.other.service.THtmlService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
-import org.springframework.web.bind.annotation.RestController;
+import javax.annotation.Resource;
/**
* <p>
@@ -16,6 +21,21 @@
@RestController
@RequestMapping("/t-html")
public class THtmlController {
+ @Resource
+ private THtmlService htmlService;
+ @ApiOperation(tags = {"后台-内容设置-协议服务"},value = "新增修改")
+ @PostMapping(value = "/saveOrUpdate")
+ public AjaxResult saveOrUpdate(@RequestBody THtml tHtml) {
+ htmlService.saveOrUpdate(tHtml);
+ return AjaxResult.success();
+ }
+
+ @ApiOperation(tags = {"后台-内容设置-协议服务"},value = "查询")
+ @PostMapping(value = "/selectByType/{type}")
+ public AjaxResult selectByType(@PathVariable Integer type) {
+ THtml one = htmlService.lambdaQuery().eq(THtml::getType, type).last("limit 1").one();
+ return AjaxResult.success(one);
+ }
}
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TIntegralRuleController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TIntegralRuleController.java
index 4c80295..b19e461 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TIntegralRuleController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TIntegralRuleController.java
@@ -62,6 +62,9 @@
"11=开票说明")
public R<String> getInfo(Integer type) {
THtml g = htmlService.getOne(new QueryWrapper<THtml>().eq("type",type));
+ if (g == null){
+ return R.ok("");
+ }
return R.ok(g.getContent());
}
@GetMapping("/saveInfo")
@@ -87,10 +90,6 @@
THtml tHtml = new THtml();
tHtml.setType(type);
tHtml.setContent(info);
-
-
- tHtml.setCreateTime(LocalDateTime.now());
- tHtml.setDelFlag(false);
htmlService.save(tHtml);
}else{
g.setContent(info);
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TInvoiceTypeController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TInvoiceTypeController.java
index 6c55b54..9eacc23 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TInvoiceTypeController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TInvoiceTypeController.java
@@ -65,13 +65,12 @@
@ResponseBody
- @DeleteMapping("/delInvoiceType/{id}")
+ @DeleteMapping("/delInvoiceType")
@ApiOperation(value = "删除发票类型", tags = {"管理后台-发票类型管理"})
- public AjaxResult<TInvoiceType> delInvoiceType(@PathVariable Integer[] id){
+ public AjaxResult<TInvoiceType> delInvoiceType(@RequestParam("id") Integer[] id){
List<TInvoiceType> tInvoiceTypes = invoiceTypeService.listByIds(Arrays.asList(id));
for (TInvoiceType invoiceType : tInvoiceTypes) {
- invoiceType.setDelFlag(true);
- invoiceTypeService.updateById(invoiceType);
+ invoiceTypeService.removeById(invoiceType);
}
return AjaxResult.success();
}
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TNoticeController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TNoticeController.java
index ee4dcb9..06838a6 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TNoticeController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TNoticeController.java
@@ -1,9 +1,17 @@
package com.ruoyi.other.controller;
-import org.springframework.web.bind.annotation.RequestMapping;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.other.api.domain.TNotice;
+import com.ruoyi.other.api.dto.NoticeQueryDto;
+import com.ruoyi.other.mapper.SysNoticeMapper;
+import com.ruoyi.other.service.TNoticeService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
-import org.springframework.web.bind.annotation.RestController;
+import javax.annotation.Resource;
+import java.time.LocalDateTime;
/**
* <p>
@@ -16,6 +24,49 @@
@RestController
@RequestMapping("/t-notice")
public class TNoticeController {
+ @Resource
+ private TNoticeService noticeService;
+
+ @ApiOperation(tags = {"后台-内容设置-公告管理"},value = "新增修改")
+ @PostMapping(value = "/saveOrUpdate")
+ public AjaxResult saveOrUpdate(@RequestBody TNotice notice) {
+ noticeService.saveOrUpdate(notice);
+ return AjaxResult.success();
+ }
+
+ @ApiOperation(tags = {"后台-内容设置-公告管理"},value = "删除")
+ @PostMapping(value = "/deleteById/{id}")
+ public AjaxResult deleteById(@PathVariable Integer id) {
+ noticeService.removeById(id);
+ return AjaxResult.success();
+ }
+
+ @ApiOperation(tags = {"后台-内容设置-公告管理"},value = "查询")
+ @PostMapping(value = "/pageList")
+ public AjaxResult<Page<TNotice>> authPageList(@RequestBody NoticeQueryDto query) {
+ if (query.getStatus()==0){
+ return AjaxResult.success(noticeService.lambdaQuery()
+ .le(TNotice::getStartTime, LocalDateTime.now())
+ .like(query.getContent()!=null&&query.getContent()!="",TNotice::getContent,query.getContent())
+ .page(Page.of(query.getPageCurr(),query.getPageSize())));
+ }else if (query.getStatus()==1){
+ return AjaxResult.success(noticeService.lambdaQuery()
+ .ge(TNotice::getStartTime, LocalDateTime.now()).le(TNotice::getEndTime,LocalDateTime.now())
+ .like(query.getContent()!=null&&query.getContent()!="",TNotice::getContent,query.getContent())
+ .page(Page.of(query.getPageCurr(),query.getPageSize())));
+ }else if (query.getStatus()==2){
+ return AjaxResult.success(noticeService.lambdaQuery()
+ .ge(TNotice::getEndTime, LocalDateTime.now())
+ .like(query.getContent()!=null&&query.getContent()!="",TNotice::getContent,query.getContent())
+ .page(Page.of(query.getPageCurr(),query.getPageSize())));
+ }else{
+ return AjaxResult.success(noticeService.lambdaQuery()
+ .like(query.getContent()!=null&&query.getContent()!="",TNotice::getContent,query.getContent())
+ .page(Page.of(query.getPageCurr(),query.getPageSize())));
+ }
+
+
+ }
}
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TSystemConfigurationController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TSystemConfigurationController.java
index a78e805..f63f4a5 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TSystemConfigurationController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TSystemConfigurationController.java
@@ -8,11 +8,7 @@
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
/**
* <p>
@@ -36,12 +32,19 @@
/**
* 查看系统设置
*/
- @ApiOperation(tags = {"小程序-系统设置"},value = "联系客服")
+ @ApiOperation(tags = {"小程序-系统设置","后台-内容设置"},value = "联系客服,查询设置")
@GetMapping(value = "/getDetailById")
public AjaxResult<TSystemConfiguration> getDetailById(@RequestParam(name = "type")@ApiParam(value = "1=客服信息,2=系统设置") Integer type) {
return AjaxResult.ok(systemConfigurationService.getOne(Wrappers.lambdaQuery(TSystemConfiguration.class)
.eq(TSystemConfiguration::getType, type)));
}
+ @ApiOperation(tags = {"后台-内容设置"},value = "客户信息,系统内容设置")
+ @GetMapping(value = "/save")
+ public AjaxResult getDetailById(@RequestBody TSystemConfiguration systemConfiguration) {
+ systemConfigurationService.saveOrUpdate(systemConfiguration);
+ return AjaxResult.success();
+ }
+
}
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java
index 97f0451..a460fb0 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java
@@ -1,13 +1,19 @@
package com.ruoyi.other.controller;
+import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.account.api.dto.SendCouponDto;
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.other.api.domain.TCoupon;
import com.ruoyi.other.api.domain.TIntegralRule;
import com.ruoyi.other.api.domain.TUserTag;
import com.ruoyi.other.api.domain.TVip;
+import com.ruoyi.other.api.dto.VipCouponDto;
+import com.ruoyi.other.api.dto.VipInfoDto;
+import com.ruoyi.other.service.TCouponService;
import com.ruoyi.other.service.TVipService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@@ -16,6 +22,9 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@@ -33,6 +42,8 @@
public class TVipController {
@Autowired
private TVipService vipService;
+ @Resource
+ private TCouponService couponService;
@PostMapping("/saveVip")
@ApiOperation(tags = {"管理后台-会员管理"},value = "会员添加")
public AjaxResult saveVip(@RequestBody TVip dto) {
@@ -57,6 +68,13 @@
return AjaxResult.ok(vipService.getById(id));
}
+
+ @GetMapping("/getById")
+ @ApiOperation(value = "通过id查会员")
+ public R<TVip> getById(Integer id) {
+ return R.ok(vipService.getById(id));
+ }
+
/**
* 远程调用
* @param id
@@ -74,6 +92,16 @@
})
public AjaxResult<PageInfo<TVip>> pageList(Integer pageCurr,Integer pageSize) {
return AjaxResult.ok(vipService.pageList(pageCurr,pageSize));
+ }
+
+ @ApiOperation(tags = {"会员下拉框"},value = "会员列表分页查询")
+ @PostMapping(value = "/select")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "pageCurr", value = "分页参数,当前页码", required = true),
+ @ApiImplicitParam(name = "pageSize", value = "分页参数,每页数量",required = true)
+ })
+ public AjaxResult<List<TVip>> select() {
+ return AjaxResult.ok(vipService.list());
}
//获取会员Map
@@ -115,5 +143,47 @@
}
}
+
+ @ApiOperation(value = "会员信息", tags = {"小程序-个人中心"})
+ @PostMapping("/vipInfo")
+ public AjaxResult vipInfo() {
+ List<VipInfoDto> vipInfoDtos = new ArrayList<>();
+ List<TVip> vips = vipService.lambdaQuery().eq(TVip::getReveal, 1).list();
+ for (TVip vip : vips) {
+ VipInfoDto vipInfoDto = new VipInfoDto();
+ vipInfoDto.setMonthlyCard(vip.getMonthlyCardReveal()==1?vip.getMonthlyCard():null);
+ vipInfoDto.setSeasonCard(vip.getSeasonCardReveal()==1?vip.getSeasonCard():null);
+ vipInfoDto.setAnnualCard(vip.getAnnualCardReveal()==1?vip.getAnnualCard():null);
+ vipInfoDto.setMaximumDeduction(vip.getMaximumDeduction());
+ vipInfoDto.setDiscountTimes(vip.getDiscountTimes());
+ vipInfoDto.setDoubleIntegration(vip.getDoubleIntegration());
+ vipInfoDto.setMallExclusivePrice(vip.getMallExclusivePrice());
+ List<SendCouponDto> javaList = JSON.parseArray(vip.getCoupon()).toJavaList(SendCouponDto.class);
+ List<VipCouponDto> vipCouponDtos = new ArrayList<>();
+ if (!javaList.isEmpty()){
+ for (SendCouponDto sendCouponDto : javaList) {
+ VipCouponDto vipCouponDto = new VipCouponDto();
+ TCoupon byId = couponService.getById(sendCouponDto.getId());
+ vipCouponDto.setNum(sendCouponDto.getNumber());
+ vipCouponDto.setTCoupon(byId);
+ vipCouponDtos.add(vipCouponDto);
+ }
+ }
+
+ vipInfoDto.setVipCouponDtos(vipCouponDtos);
+
+ //计算总折扣
+ BigDecimal total = BigDecimal.ZERO;
+ total = total.add(vip.getMaximumDeduction().multiply(BigDecimal.valueOf(vip.getDiscountTimes())));
+ for (VipCouponDto vipCouponDto : vipCouponDtos) {
+ TCoupon tCoupon = vipCouponDto.getTCoupon();
+ total.add(tCoupon.getDiscount());
+ }
+ vipInfoDto.setTotalDiscount(total);
+ vipInfoDtos.add(vipInfoDto);
+ }
+ return AjaxResult.success(vipInfoDtos);
+ }
+
}
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TEvaluationTagMapper.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TEvaluationTagMapper.java
index 4376dbf..5a71975 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TEvaluationTagMapper.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TEvaluationTagMapper.java
@@ -22,7 +22,7 @@
* 获取评价标签列表
* @return
*/
- List<TEvaluationTagVO> getTagList();
+ List<TEvaluationTagVO> getTagList(Integer type);
/**
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TEvaluationTagService.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TEvaluationTagService.java
index 7b0cb82..0a1555d 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TEvaluationTagService.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TEvaluationTagService.java
@@ -22,7 +22,7 @@
* 查询标签列表
* @return
*/
- List<TEvaluationTagVO> getTagList();
+ List<TEvaluationTagVO> getTagList(Integer type);
/**
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TEvaluationTagServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TEvaluationTagServiceImpl.java
index f6448d9..38bccd5 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TEvaluationTagServiceImpl.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TEvaluationTagServiceImpl.java
@@ -23,8 +23,8 @@
public class TEvaluationTagServiceImpl extends ServiceImpl<TEvaluationTagMapper, TEvaluationTag> implements TEvaluationTagService {
@Override
- public List<TEvaluationTagVO> getTagList() {
- return this.baseMapper.getTagList();
+ public List<TEvaluationTagVO> getTagList(Integer type) {
+ return this.baseMapper.getTagList(type);
}
diff --git a/ruoyi-service/ruoyi-other/src/main/resources/bootstrap.yml b/ruoyi-service/ruoyi-other/src/main/resources/bootstrap.yml
index 0bdf95b..0976d0b 100644
--- a/ruoyi-service/ruoyi-other/src/main/resources/bootstrap.yml
+++ b/ruoyi-service/ruoyi-other/src/main/resources/bootstrap.yml
@@ -37,14 +37,12 @@
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
-
-
---
seata:
enabled: true
application-id: ${spring.application.name}
tx-service-group: seata_tx_group #此处配置自定义的seata事务分组名称
- enable-auto-data-source-proxy: true #开启数据库代理
+ enable-auto-data-source-proxy: true #关闭数据库代理
service:
vgroup-mapping:
seata_tx_group: default
diff --git a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TEvaluationTagMapper.xml b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TEvaluationTagMapper.xml
index ec534eb..db0ab29 100644
--- a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TEvaluationTagMapper.xml
+++ b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TEvaluationTagMapper.xml
@@ -17,7 +17,11 @@
</sql>
<select id="getTagList" resultType="com.ruoyi.other.api.vo.TEvaluationTagVO">
select <include refid="Base_Column_List"></include>
- from t_evaluation_tag where del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} ORDER BY `type`
+ from t_evaluation_tag where del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()}
+ <if test="null != type">
+ and `type` = #{type}
+ </if>
+ ORDER BY `type`
</select>
diff --git a/ruoyi-service/ruoyi-payment/src/main/resources/bootstrap.yml b/ruoyi-service/ruoyi-payment/src/main/resources/bootstrap.yml
index b91155b..fe9bde5 100644
--- a/ruoyi-service/ruoyi-payment/src/main/resources/bootstrap.yml
+++ b/ruoyi-service/ruoyi-payment/src/main/resources/bootstrap.yml
@@ -45,7 +45,7 @@
enabled: true
application-id: ${spring.application.name}
tx-service-group: seata_tx_group #此处配置自定义的seata事务分组名称
- enable-auto-data-source-proxy: true #开启数据库代理
+ enable-auto-data-source-proxy: false #关闭数据库代理
service:
vgroup-mapping:
seata_tx_group: default
--
Gitblit v1.7.1