c端用户增加 昨日、7天、一个月、一季度 活跃度统计\自动退款金额增加到200元

This commit is contained in:
yuyang 2022-07-04 10:21:55 +08:00
parent 6a9a4f781d
commit 12b4241e36
12 changed files with 52 additions and 35 deletions

View File

@ -30,7 +30,7 @@ spring:
eager: true
transport:
# 控制台地址
dashboard: 127.0.0.1:8718
dashboard: 172.31.183.135:8718
# nacos配置持久化
datasource:
ds1:

View File

@ -14,15 +14,15 @@ spring:
nacos:
discovery:
# 服务注册地址
server-addr: 127.0.0.1:8848
server-addr: 172.31.183.135:8848
config:
# 配置中心地址
server-addr: 127.0.0.1:8848
server-addr: 172.31.183.135:8848
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
logging:
level:
com.xhpc.card.mapper: debug
#logging:
# level:
# com.xhpc.card.mapper: debug

View File

@ -30,21 +30,21 @@ logging:
#二维码Logo图片获取位置
#imgPath: "D:\\Enterprise_Resources\\XiaoHuaMaterialImgs\\xhcd_logo.png"
#imgPath: "/www/wwwroot/scxhua.cn/xhpc-charging-stion/logo.png"
imgPath: "/www/wwwroot/xhpc.scxhua.com/xhpc-charging-stion/logo.png"
imgPath: "/www/wwwroot/scxhua.cn/xhpc-charging-stion/logo.png"
#imgPath: "/www/wwwroot/xhpc.scxhua.com/xhpc-charging-stion/logo.png"
#生成的二维码存放位置:
#destPath: "D:\\Enterprise_Resources\\XiaoHuaFullImgs"
#destPath: "/www/wwwroot/scxhua.cn/xhpc-charging-stion/XiaoHuaFullImgs"
destPath: "/www/wwwroot/xhpc.scxhua.com/xhpc-charging-stion/XiaoHuaFullImgs"
destPath: "/www/wwwroot/scxhua.cn/xhpc-charging-stion/XiaoHuaFullImgs"
#destPath: "/www/wwwroot/xhpc.scxhua.com/xhpc-charging-stion/XiaoHuaFullImgs"
#生成的最终完整图片的存放位置:
#fullImgDestPath: "D:\\Enterprise_Resources\\XiaoHuaFullImgs\\"
#fullImgDestPath: "/www/wwwroot/scxhua.cn/xhpc-charging-stion/XiaoHuaFullImgs/"
fullImgDestPath: "/www/wwwroot/xhpc.scxhua.com/xhpc-charging-stion/XiaoHuaFullImgs/"
fullImgDestPath: "/www/wwwroot/scxhua.cn/xhpc-charging-stion/XiaoHuaFullImgs/"
#fullImgDestPath: "/www/wwwroot/xhpc.scxhua.com/xhpc-charging-stion/XiaoHuaFullImgs/"
#底图图片存放位置:
#bottomImg: "D:\\Enterprise_Resources\\XiaoHuaMaterialImgs\\BottomImg.png"
#bottomImg: "/www/wwwroot/scxhua.cn/xhpc-charging-stion/BottomImg.png"
bottomImg: "/www/wwwroot/xhpc.scxhua.com/xhpc-charging-stion/BottomImg.png"
bottomImg: "/www/wwwroot/scxhua.cn/xhpc-charging-stion/BottomImg.png"
#bottomImg: "/www/wwwroot/xhpc.scxhua.com/xhpc-charging-stion/BottomImg.png"
#生成的二维码zip包位置
#zipLocation: "D:\\Enterprise_Resources\\QrZip"
#zipLocation: "/www/wwwroot/scxhua.cn/dist"
zipLocation: "/www/wwwroot/xhpc.scxhua.com/dist"
zipLocation: "/www/wwwroot/scxhua.cn/dist"
#zipLocation: "/www/wwwroot/xhpc.scxhua.com/dist"

View File

@ -112,8 +112,9 @@
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.5</version>
<scope>compile</scope>
<scope>test</scope>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.apache.poi</groupId>-->
<!-- <artifactId>poi-ooxml</artifactId>-->

View File

@ -1219,6 +1219,7 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
}
});
}catch (Exception e){
e.printStackTrace();
logger.info("<<<<<<<<<<<<<<<<运行异常,结算失败,数据回滚>>>>>>>>>>>>>>>>>"+xhpcChargeOrder.getSerialNumber());
logger.info("<<<<<<<<<<<<<<<<运行异常,结算失败,数据回滚>>>>>>>>>>>>>>>>>");
e.printStackTrace();
@ -1627,19 +1628,19 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
CacheOrderData cacheOrderData = (CacheOrderData) cacheMap.get("orderData");
if (cacheOrderData != null) {
int number = 0;
if (!"0".equals(cacheOrderData.getT1PowerQuantity().toString())) {
if (cacheOrderData.getT1PowerQuantity() !=null && !"0".equals(cacheOrderData.getT1PowerQuantity().toString())) {
number++;
rateTimeList = xhpcRealTimeOrderMapper.getRateTimeList(chargingStationId, rateModelId, "00");
}
if (!"0".equals(cacheOrderData.getT2PowerQuantity().toString())) {
if (cacheOrderData.getT2PowerQuantity() !=null &&!"0".equals(cacheOrderData.getT2PowerQuantity().toString())) {
number++;
rateTimeList = xhpcRealTimeOrderMapper.getRateTimeList(chargingStationId, rateModelId, "01");
}
if (!"0".equals(cacheOrderData.getT3PowerQuantity().toString())) {
if (cacheOrderData.getT3PowerQuantity() !=null && !"0".equals(cacheOrderData.getT3PowerQuantity().toString())) {
number++;
rateTimeList = xhpcRealTimeOrderMapper.getRateTimeList(chargingStationId, rateModelId, "02");
}
if (!"0".equals(cacheOrderData.getT4PowerQuantity().toString())) {
if (cacheOrderData.getT4PowerQuantity() !=null && !"0".equals(cacheOrderData.getT4PowerQuantity().toString())) {
number++;
rateTimeList = xhpcRealTimeOrderMapper.getRateTimeList(chargingStationId, rateModelId, "03");
}

View File

@ -23,3 +23,6 @@ spring:
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
#logging:
# level:
# com.xhpc.order.mapper: debug

View File

@ -23,9 +23,9 @@ spring:
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
logging:
level:
com.xhpc.order.mapper: debug
#logging:
# level:
# com.xhpc.payment.mapper: debug
##获取微信openid地址
WXGETJSCODE: "https://api.weixin.qq.com/sns/jscode2session?appid=wxd0a48e00319ef8a7&secret=e26d9088b58e24af69411d5933cece47&js_code="
@ -55,7 +55,7 @@ ALIPAYPRIVATEKEY: "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCGHX1s315EK
#支付宝appid
ALIPAYAPPID: "2021002156615717"
#应用公钥证书路径
CERTPATH: "/www/wwwroot/scxhua.cn/xhpc-payment/appCertPublicKey.crt"
CERTPATH: "/www/wwwroot/scxhua.cn/xhpc.scxhua.com/appCertPublicKey.crt"
#支付宝公钥证书路径
PUBLICCERTPATH: "/www/wwwroot/scxhua.cn/xhpc-payment/alipayCertPublicKey_RSA2.crt"
#支付宝根证书路径

View File

@ -15,7 +15,6 @@ spring:
# 环境配置
active: dev
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 172.31.183.135:8848

View File

@ -57,7 +57,7 @@ public interface XhpcAppUserMapper {
public List<Map<String, Object>> selectAppUserList(@Param("phone") String phone,@Param("tenantId") String tenantId);
public Map<String, Object> userSum(@Param("phone")String phone,@Param("time")String time,@Param("tenantId") String tenantId);
public Map<String, Object> userSum(@Param("phone")String phone,@Param("time1")String time1,@Param("time2")String time2,@Param("time3")String time3,@Param("time4")String time4,@Param("tenantId") String tenantId);
/**
* 手机号查询C端用户信息

View File

@ -99,11 +99,21 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU
@Override
public Map<String, Object> userSum(String phone) {
LoginUser logUser = tokenService.getLoginUser();
//最近30天用户的活跃度
Date newDate = DateUtil.offset(new Date(), DateField.DAY_OF_MONTH, -30);
String time = DateUtil.format(newDate, "yyyy-MM-dd HH:mm:ss");
return xhpcAppUserMapper.userSum(phone,time,logUser.getTenantId());
//昨日用户的活跃度
Date newDate1 = DateUtil.offset(new Date(), DateField.DAY_OF_MONTH, -1);
String time1 = DateUtil.format(newDate1, "yyyy-MM-dd HH:mm:ss");
//7天用户的活跃度
Date newDate2 = DateUtil.offset(new Date(), DateField.DAY_OF_MONTH, -7);
String time2 = DateUtil.format(newDate2, "yyyy-MM-dd HH:mm:ss");
//一个月用户的活跃度
Date newDate3 = DateUtil.offset(new Date(), DateField.DAY_OF_MONTH, -30);
String time3 = DateUtil.format(newDate3, "yyyy-MM-dd HH:mm:ss");
//3个月天用户的活跃度
Date newDate4 = DateUtil.offset(new Date(), DateField.DAY_OF_MONTH, -90);
String time4 = DateUtil.format(newDate4, "yyyy-MM-dd HH:mm:ss");
return xhpcAppUserMapper.userSum(phone,time1,time2,time3,time4,logUser.getTenantId());
}
/**

View File

@ -14,10 +14,10 @@ spring:
nacos:
discovery:
# 服务注册地址
server-addr: 172.31.183.135:8858
server-addr: 172.31.183.135:8848
config:
# 配置中心地址
server-addr: 172.31.183.135:8858
server-addr: 172.31.183.135:8848
# 配置文件格式
file-extension: yml
# 共享配置

View File

@ -211,9 +211,12 @@
<select id="userSum" resultType="map">
select
count(xau.app_user_id) userSum,
(select count(DISTINCT user_id) from xhpc_charge_order where create_time &gt;= #{time} and tenant_id =#{tenantId}) userVitality,
(select count(DISTINCT user_id) from xhpc_charge_order where create_time &gt;= #{time1} and tenant_id =#{tenantId}) one,
(select count(DISTINCT user_id) from xhpc_charge_order where create_time &gt;= #{time2} and tenant_id =#{tenantId}) two,
(select count(DISTINCT user_id) from xhpc_charge_order where create_time &gt;= #{time3} and tenant_id =#{tenantId}) three,
(select count(DISTINCT user_id) from xhpc_charge_order where create_time &gt;= #{time4} and tenant_id =#{tenantId}) four,
sum(xau.balance) balance
from xhpc_app_user xau where 1=1
from xhpc_app_user xau where del_flag=0
<if test="phone != null and phone != ''">
and xau.phone like concat('%', #{phone}, '%')
</if>