Commit a38d0954 by 王欣伟

1月7日交付内容开发完成

1 parent 927edc97
Showing 23 changed files with 628 additions and 20 deletions
package com.gsc4cloud.gsc.multidata.controller; package com.gsc4cloud.gsc.multidata.controller;
import com.gsc4cloud.gsc.multidata.entity.DjPaymentAreaInfo; import com.gsc4cloud.gsc.multidata.entity.DjPaymentAreaInfo;
import com.gsc4cloud.gsc.multidata.service.DjPaymentAreaInfoService; import com.gsc4cloud.gsc.multidata.service.slavefirst.DjPaymentAreaInfoService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
......
package com.gsc4cloud.gsc.multidata.controller; package com.gsc4cloud.gsc.multidata.controller;
import com.gsc4cloud.gsc.multidata.entity.PlatformMerchantStaff; import com.gsc4cloud.gsc.multidata.entity.PlatformMerchantStaff;
import com.gsc4cloud.gsc.multidata.service.PlatformMerchantStaffService; import com.gsc4cloud.gsc.multidata.service.slavesecond.PlatformMerchantStaffService;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
......
package com.gsc4cloud.gsc.multidata.controller; package com.gsc4cloud.gsc.multidata.controller;
import com.gsc4cloud.gsc.multidata.dto.SceneUsageDTO;
import com.gsc4cloud.gsc.multidata.dto.TabletCountDTO;
import com.gsc4cloud.gsc.multidata.entity.VcpEvalOrderLog; import com.gsc4cloud.gsc.multidata.entity.VcpEvalOrderLog;
import com.gsc4cloud.gsc.multidata.service.StatPrimaryService; import com.gsc4cloud.gsc.multidata.service.primary.StatPrimaryService;
import com.gsc4cloud.gsc.multidata.service.VcpEvalOrderLogService; import com.gsc4cloud.gsc.multidata.service.primary.VcpEvalOrderLogService;
import com.gsc4cloud.gsc.multidata.service.slavefouth.ClubPointRecordService;
import com.gsc4cloud.gsc.multidata.utils.UsageRateUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -25,6 +30,9 @@ public class StatPrimaryController { ...@@ -25,6 +30,9 @@ public class StatPrimaryController {
@Autowired @Autowired
private StatPrimaryService statPrimaryService; private StatPrimaryService statPrimaryService;
@Autowired
private ClubPointRecordService clubPointRecordService;
/** /**
* 查询所有评估单操作日志 * 查询所有评估单操作日志
*/ */
...@@ -47,6 +55,12 @@ public class StatPrimaryController { ...@@ -47,6 +55,12 @@ public class StatPrimaryController {
return statPrimaryService.getTabletUsageRate(); return statPrimaryService.getTabletUsageRate();
} }
// 编写服务,1.2 平板月覆盖率(发平板的总人数/直营驻店总人数),返回值为分数
@GetMapping("/getTabletCoverageRate")
public Double getTabletCoverageRate() {
return statPrimaryService.getTabletCoverageRate();
}
// 编写服务,1.3 返回提单月覆盖率(提单人数/轻改业务且有发平板的总人数),返回值为分数 // 编写服务,1.3 返回提单月覆盖率(提单人数/轻改业务且有发平板的总人数),返回值为分数
@GetMapping("/getCoverageRate") @GetMapping("/getCoverageRate")
public Double getCoverageRate() { public Double getCoverageRate() {
...@@ -71,4 +85,67 @@ public class StatPrimaryController { ...@@ -71,4 +85,67 @@ public class StatPrimaryController {
return statPrimaryService.getShortCourseCompletionRate(); return statPrimaryService.getShortCourseCompletionRate();
} }
// 编写服务,2.0 各业务月使用覆盖率(活动中心功能使用人数/对应业务且有发平板的总人数),返回一个map结构,key为业务名称,value为覆盖率
@GetMapping("/getBusinessMonthUsageRate")
public Map<String, Double> getBusinessMonthUsageRate() {
// 调用statPrimaryService 获取各业务下平板总数
TabletCountDTO tabletCountDTO = statPrimaryService.getAllBizTabletCount();
// 调用ClubPointRecordService 获取各业务下平板使用人数
List<SceneUsageDTO> sceneUsageList = clubPointRecordService.getSceneUsageList();
// 计算各业务的覆盖率
Map<String, Double> coverageRates = new HashMap<>();
// 初始化三个业务的覆盖率为0.0
coverageRates.put("equity", 0.0);
coverageRates.put("light_upgrade", 0.0);
coverageRates.put("warranty", 0.0);
for (SceneUsageDTO sceneUsage : sceneUsageList) {
Integer scene = sceneUsage.getScene();
Integer userCount = sceneUsage.getUserCount();
// 根据业务场景获取对应的总平板数
String businessName;
int totalTablets = 0;
if (scene == null) {
continue;
}
switch (scene) {
case 0: // 会员权益升级
businessName = "equity";
totalTablets = tabletCountDTO.getEquityTabletCount() != null ? tabletCountDTO.getEquityTabletCount() : 0;
break;
case 1: // 精品升级(轻改)
businessName = "light_upgrade";
totalTablets = tabletCountDTO.getLightUpgradeTabletCount() != null ? tabletCountDTO.getLightUpgradeTabletCount() : 0;
break;
case 3: // 售后众筹(延保)
businessName = "warranty";
totalTablets = tabletCountDTO.getWarrantyTabletCount() != null ? tabletCountDTO.getWarrantyTabletCount() : 0;
break;
default:
// 对于未知业务类型,暂时跳过
continue;
}
// 计算覆盖率
double coverageRate = UsageRateUtil.calculateUsageRate(
userCount != null ? userCount : 0,
totalTablets
);
coverageRates.put(businessName, coverageRate);
}
return coverageRates;
}
// 编写服务,2.5 展业门店覆盖率(使用系统的门店总数/所有展业门店总数),返回值为分数
@GetMapping("/getExhibitionCoverageRate")
public Double getExhibitionCoverageRate() {
return statPrimaryService.getExhibitionCoverageRate();
}
} }
package com.gsc4cloud.gsc.multidata.controller;
import com.gsc4cloud.gsc.multidata.service.slavethirty.StatShopmallService;
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.RestController;
@RestController
@RequestMapping("/api/statv14")
public class StatShopmallController {
@Autowired
private StatShopmallService statShopmallService;
// 编写服务,2.4 商品订单数(积分兑换的商品订单总数),返回值为正整数
@GetMapping("/getShopmallOrderCount")
public Integer getShopmallOrderCount() {
return statShopmallService.getShopmallOrderCount();
}
}
package com.gsc4cloud.gsc.multidata.controller; package com.gsc4cloud.gsc.multidata.controller;
import com.gsc4cloud.gsc.multidata.entity.VcpEvalOrderLog; import com.gsc4cloud.gsc.multidata.entity.VcpEvalOrderLog;
import com.gsc4cloud.gsc.multidata.service.VcpEvalOrderLogService; import com.gsc4cloud.gsc.multidata.service.primary.VcpEvalOrderLogService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
......
package com.gsc4cloud.gsc.multidata.dto;
import lombok.Data;
/**
* 业务场景使用人数DTO
*/
@Data
public class SceneUsageDTO {
/**
* 业务场景,0 会员权益升级 1 精品升级 2 次新车转化 3 售后众筹
*/
private Integer scene;
/**
* 使用人数(去重uuid)
*/
private Integer userCount;
}
package com.gsc4cloud.gsc.multidata.entity.slavefouth;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 埋点记录表实体类
*/
@Data
@TableName("clue_burial_point_record")
public class ClueBurialPointRecord {
/**
* 主键
*/
@TableId(type = IdType.AUTO)
private Integer id;
/**
* 登录账号名称
*/
private String loginAccount;
/**
* 账号类型
*/
private Integer userType;
/**
* 账号uuid
*/
private String uuid;
/**
* 来源:0-生意助手小程序,1-嘀加智享车生活(PC端),2-车生活助手C端-小程序,3-展业助手,4-大模型
*/
private Integer systemSource;
/**
* 游客ID,预留字段
*/
private String visitorId;
/**
* 触发时间
*/
private LocalDateTime eventTime;
/**
* 动作类型,0-点击,1-滚动,2-浏览
*/
private Integer eventType;
/**
* 上一级页面路径
*/
private String prePagePath;
/**
* 当前页面路径
*/
private String pagePath;
/**
* 事件别名
*/
private String eventCode;
/**
* 浏览批次id
*/
private String batchId;
/**
* 业务参数
*/
private String businessParam;
/**
* 创建时间
*/
private LocalDateTime createdTime;
/**
* 删除标示:D 已删除;N 未删除
*/
private String deletedFlag;
/**
* 业务场景,0 会员权益升级 1 精品升级 3 售后众筹 ,2次新车转化
*/
private Integer scene;
/**
* 手机号,车生活助手-C端传递
*/
private String phoneNumber;
/**
* 业务id
*/
private String businessId;
}
package com.gsc4cloud.gsc.multidata.entity.slavethirty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 商城平台子订单实体类
*/
@Data
@TableName("shopmall_platform_sub_order")
public class ShopmallPlatformSubOrder {
/**
* 主键
*/
@TableId(type = IdType.AUTO)
private Integer id;
/**
* 订单编号
*/
private String orderCode;
/**
* 子订单订单编号
*/
private String subOrderCode;
/**
* 第三方子订单编号
*/
private String thirdSubOrderCode;
/**
* (子)订单交易总金额
*/
private BigDecimal orderAmount;
/**
* 兑换积分
*/
private Long redeemPoints;
/**
* 订单状态(1002:待审核,1003:审核不通过,1004:已取消(交易失败) ,1005:订单异常,1006:待处理,1007: 待发货,1008:已发货,1009:已完成(交易成功),1010:售后处理中,1012 订单关闭
*/
private Integer orderStatus;
/**
* 订单发货物流状态信息(1000:待揽件,1001:已揽件,1002:运输中,1003:已 签收,1004:拒收),在订单状态为已发货 (orderStatus 等于 1008、1009)时,才有物流状态信息
*/
private Integer logisticsStatus;
/**
* 发货方式(1001:快递至卖家,1002:上门取件)
*/
private Integer deliverWay;
/**
* 快递公司编码
*/
private String expressCode;
/**
* 快递公司名称
*/
private String expressName;
/**
* 快递单号
*/
private String expressNo;
/**
* (子)订单创建时间
*/
private LocalDateTime createTime;
/**
* (子)订单发货时间
*/
private LocalDateTime deliverTime;
/**
* (子)订单确认收货时间
*/
private LocalDateTime confirmTime;
/**
* (子)订单签收时间
*/
private LocalDateTime signTime;
/**
* (子)订单取消时间
*/
private LocalDateTime cancelTime;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private LocalDateTime createdDate;
/**
* 修改人
*/
private String updatedBy;
/**
* 修改时间
*/
private LocalDateTime updatedDate;
/**
* 删除标识(D:已删除;N:未删除)
*/
private String deletedFlag;
/**
* 订单取消状态(1000:取消成功,1010:取消审核中)
*/
private Integer cancelStatus;
}
\ No newline at end of file \ No newline at end of file
...@@ -67,4 +67,22 @@ public interface InspectionBadgeRecordingsMapper extends BaseMapper<InspectionBa ...@@ -67,4 +67,22 @@ public interface InspectionBadgeRecordingsMapper extends BaseMapper<InspectionBa
* @return 短课程学习完成情况 * @return 短课程学习完成情况
*/ */
ShortCourseCompletionDTO getShortCourseCompletion(@Param("startTime") String startTime, @Param("endTime") String endTime); ShortCourseCompletionDTO getShortCourseCompletion(@Param("startTime") String startTime, @Param("endTime") String endTime);
/**
* 查询直营驻店总人数
* @return 直营驻店总人数
*/
int countDistinctDirectStoreEmployees(@Param("merchantId") Integer merchantId);
/**
* 查询展业门店数量(scene=7且subMerchantType=7)
* @return 展业门店数量
*/
Integer countDistinctExhibitionMerchants();
/**
* 查询总门店数量(subMerchantType=7)
* @return 总门店数量
*/
Integer countDistinctTotalMerchants();
} }
\ No newline at end of file \ No newline at end of file
package com.gsc4cloud.gsc.multidata.mapper.secondary; package com.gsc4cloud.gsc.multidata.mapper.slavefirst;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gsc4cloud.gsc.multidata.entity.DjPaymentAreaInfo; import com.gsc4cloud.gsc.multidata.entity.DjPaymentAreaInfo;
......
package com.gsc4cloud.gsc.multidata.mapper.slavefouth;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gsc4cloud.gsc.multidata.dto.SceneUsageDTO;
import com.gsc4cloud.gsc.multidata.entity.slavefouth.ClueBurialPointRecord;
import java.util.List;
/**
* 埋点记录表 Mapper 接口
*/
public interface ClueBurialPointRecordMapper extends BaseMapper<ClueBurialPointRecord> {
/**
* 获取各业务场景下的平板使用人数
* @return 各业务场景使用人数列表
*/
List<SceneUsageDTO> getSceneUsageList();
}
package com.gsc4cloud.gsc.multidata.mapper.thirdy; package com.gsc4cloud.gsc.multidata.mapper.slavesecond;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gsc4cloud.gsc.multidata.entity.DjPaymentAreaInfo;
import com.gsc4cloud.gsc.multidata.entity.PlatformMerchantStaff; import com.gsc4cloud.gsc.multidata.entity.PlatformMerchantStaff;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/** /**
* 员工表 Mapper 接口 * 员工表 Mapper 接口
......
package com.gsc4cloud.gsc.multidata.mapper.slavethirty;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gsc4cloud.gsc.multidata.entity.slavethirty.ShopmallPlatformSubOrder;
import org.apache.ibatis.annotations.Mapper;
/**
* 商城平台子订单 Mapper 接口
*/
public interface ShopmallPlatformSubOrderMapper extends BaseMapper<ShopmallPlatformSubOrder> {
/**
* 查询未删除的商城平台子订单数量
* @return 未删除的订单数量
*/
Integer selectCountOfNonDeleted();
}
\ No newline at end of file \ No newline at end of file
package com.gsc4cloud.gsc.multidata.service; package com.gsc4cloud.gsc.multidata.service.primary;
import com.gsc4cloud.gsc.multidata.dto.BusinessCoverageDTO; import com.gsc4cloud.gsc.multidata.dto.BusinessCoverageDTO;
import com.gsc4cloud.gsc.multidata.dto.LongCourseCompletionDTO; import com.gsc4cloud.gsc.multidata.dto.LongCourseCompletionDTO;
...@@ -9,6 +9,7 @@ import com.gsc4cloud.gsc.multidata.utils.DatetimeScopeUtil; ...@@ -9,6 +9,7 @@ import com.gsc4cloud.gsc.multidata.utils.DatetimeScopeUtil;
import com.gsc4cloud.gsc.multidata.utils.UsageRateUtil; import com.gsc4cloud.gsc.multidata.utils.UsageRateUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.HashMap; import java.util.HashMap;
...@@ -19,6 +20,9 @@ import java.util.Map; ...@@ -19,6 +20,9 @@ import java.util.Map;
@Service @Service
public class StatPrimaryService { public class StatPrimaryService {
@Value("${zhi.merchant.id:44206988}")
private Integer zhMerchantId;
@Autowired @Autowired
private InspectionBadgeRecordingsMapper inspectionBadgeRecordingsMapper; private InspectionBadgeRecordingsMapper inspectionBadgeRecordingsMapper;
...@@ -37,6 +41,22 @@ public class StatPrimaryService { ...@@ -37,6 +41,22 @@ public class StatPrimaryService {
return UsageRateUtil.calculateUsageRate(actualLoginCount, totalAssetManagement); return UsageRateUtil.calculateUsageRate(actualLoginCount, totalAssetManagement);
} }
public Double getTabletCoverageRate() {
if (zhMerchantId==null) {
log.error("商户ID为空,无法获取商户信息");
return 0.0;
}
// 平板月覆盖率(发平板的总人数/直营驻店总人数)
// 1. 获取发平板的总人数
int totalAssetManagement = inspectionBadgeRecordingsMapper.countTotalAssetManagement();
// 2. 获取直营驻店总人数
int directStoreEmployeeCount = inspectionBadgeRecordingsMapper.countDistinctDirectStoreEmployees(zhMerchantId);
log.info("发平板的总人数:{},直营驻店总人数:{}", totalAssetManagement, directStoreEmployeeCount);
// 使用专门的工具类计算覆盖率
return UsageRateUtil.calculateUsageRate(totalAssetManagement, directStoreEmployeeCount);
}
public Double getCoverageRate() { public Double getCoverageRate() {
String startTime = DatetimeScopeUtil.getLastMonthStart(); String startTime = DatetimeScopeUtil.getLastMonthStart();
String endTime = DatetimeScopeUtil.getLastMonthEnd(); String endTime = DatetimeScopeUtil.getLastMonthEnd();
...@@ -61,6 +81,11 @@ public class StatPrimaryService { ...@@ -61,6 +81,11 @@ public class StatPrimaryService {
// 计算各业务的覆盖率 // 计算各业务的覆盖率
Map<String, Double> coverageRates = new HashMap<>(); Map<String, Double> coverageRates = new HashMap<>();
// 初始化三个业务的覆盖率为0.0
coverageRates.put("light_upgrade", 0.0);
coverageRates.put("warranty", 0.0);
coverageRates.put("equity", 0.0);
for (BusinessCoverageDTO coverage : businessCoverageList) { for (BusinessCoverageDTO coverage : businessCoverageList) {
String businessType = coverage.getCheckTypeLabel(); String businessType = coverage.getCheckTypeLabel();
int userCount = coverage.getTabletUserCount(); int userCount = coverage.getTabletUserCount();
...@@ -125,4 +150,27 @@ public class StatPrimaryService { ...@@ -125,4 +150,27 @@ public class StatPrimaryService {
completionDTO.getTotalCourseCount() != null ? completionDTO.getTotalCourseCount() : 0 completionDTO.getTotalCourseCount() != null ? completionDTO.getTotalCourseCount() : 0
); );
} }
public Double getExhibitionCoverageRate() {
// 展业门店覆盖率(展业门店数/总门店数)
// 1. 获取展业门店数(scene=7且subMerchantType=7)
Integer exhibitionMerchantCount = inspectionBadgeRecordingsMapper.countDistinctExhibitionMerchants();
// 2. 获取总门店数(subMerchantType=7)
Integer totalMerchantCount = inspectionBadgeRecordingsMapper.countDistinctTotalMerchants();
log.info("展业门店数:{},总门店数:{}", exhibitionMerchantCount, totalMerchantCount);
// 使用专门的工具类计算覆盖率
return UsageRateUtil.calculateUsageRate(
exhibitionMerchantCount != null ? exhibitionMerchantCount : 0,
totalMerchantCount != null ? totalMerchantCount : 0
);
}
/**
* 获取各业务下平板总数
* @return 平板总数DTO
*/
public TabletCountDTO getAllBizTabletCount() {
return inspectionBadgeRecordingsMapper.countAllBizTotalAssetManagement();
}
} }
\ No newline at end of file \ No newline at end of file
package com.gsc4cloud.gsc.multidata.service; package com.gsc4cloud.gsc.multidata.service.primary;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.gsc4cloud.gsc.multidata.entity.VcpEvalOrderLog; import com.gsc4cloud.gsc.multidata.entity.VcpEvalOrderLog;
......
package com.gsc4cloud.gsc.multidata.service; package com.gsc4cloud.gsc.multidata.service.slavefirst;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.gsc4cloud.gsc.multidata.entity.DjPaymentAreaInfo; import com.gsc4cloud.gsc.multidata.entity.DjPaymentAreaInfo;
import com.gsc4cloud.gsc.multidata.mapper.secondary.DjPaymentAreaInfoMapper; import com.gsc4cloud.gsc.multidata.mapper.slavefirst.DjPaymentAreaInfoMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
......
package com.gsc4cloud.gsc.multidata.service.slavefouth;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.gsc4cloud.gsc.multidata.dto.SceneUsageDTO;
import com.gsc4cloud.gsc.multidata.mapper.slavefouth.ClueBurialPointRecordMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@DS("slave_4")
public class ClubPointRecordService {
@Autowired
private ClueBurialPointRecordMapper clueBurialPointRecordMapper;
/**
* 获取各业务场景下的平板使用人数
* @return 各业务场景使用人数列表
*/
public List<SceneUsageDTO> getSceneUsageList() {
return clueBurialPointRecordMapper.getSceneUsageList();
}
}
package com.gsc4cloud.gsc.multidata.service; package com.gsc4cloud.gsc.multidata.service.slavesecond;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gsc4cloud.gsc.multidata.entity.PlatformMerchantStaff; import com.gsc4cloud.gsc.multidata.entity.PlatformMerchantStaff;
import com.gsc4cloud.gsc.multidata.mapper.thirdy.PlatformMerchantStaffMapper; import com.gsc4cloud.gsc.multidata.mapper.slavesecond.PlatformMerchantStaffMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
......
package com.gsc4cloud.gsc.multidata.service.slavethirty;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.gsc4cloud.gsc.multidata.mapper.slavethirty.ShopmallPlatformSubOrderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
@DS("slave_3")
public class StatShopmallService {
@Autowired
private ShopmallPlatformSubOrderMapper shopmallPlatformSubOrderMapper;
public Integer getShopmallOrderCount() {
return shopmallPlatformSubOrderMapper.selectCountOfNonDeleted();
}
}
...@@ -110,4 +110,28 @@ ...@@ -110,4 +110,28 @@
GROUP BY stdi.business_id GROUP BY stdi.business_id
) t ) t
</select> </select>
<!-- 查询直营驻店总人数 -->
<select id="countDistinctDirectStoreEmployees" resultType="int">
SELECT COUNT(DISTINCT dclsi.phone_number)
FROM dj_car_life_yq_partner_merchant_ref dclypmr
LEFT JOIN dj_car_life_staff_info dclsi
ON dclypmr.yq_merchant_id = dclsi.merchant_id AND dclsi.deleted_flag = 'N'
WHERE dclypmr.partner_merchant_id = #{merchantId}
AND dclypmr.deleted_flag = 'N'
</select>
<!-- 查询展业门店数量(scene=7且subMerchantType=7) -->
<select id="countDistinctExhibitionMerchants" resultType="java.lang.Integer">
select count(distinct main_merchant_id)
from dj_car_life_scene_merchant_ref
where deleted_flag = 'N' and scene = 7 and sub_merchant_type = 7
</select>
<!-- 查询总门店数量(subMerchantType=7) -->
<select id="countDistinctTotalMerchants" resultType="java.lang.Integer">
select count(distinct main_merchant_id)
from dj_car_life_scene_merchant_ref
where deleted_flag = 'N' and sub_merchant_type = 7
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gsc4cloud.gsc.multidata.mapper.slavefouth.ClueBurialPointRecordMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.gsc4cloud.gsc.multidata.entity.slavefouth.ClueBurialPointRecord">
<id column="id" property="id"/>
<result column="login_account" property="loginAccount"/>
<result column="user_type" property="userType"/>
<result column="uuid" property="uuid"/>
<result column="system_source" property="systemSource"/>
<result column="visitor_id" property="visitorId"/>
<result column="event_time" property="eventTime"/>
<result column="event_type" property="eventType"/>
<result column="pre_page_path" property="prePagePath"/>
<result column="page_path" property="pagePath"/>
<result column="event_code" property="eventCode"/>
<result column="batch_id" property="batchId"/>
<result column="business_param" property="businessParam"/>
<result column="created_time" property="createdTime"/>
<result column="deleted_flag" property="deletedFlag"/>
<result column="scene" property="scene"/>
<result column="phone_number" property="phoneNumber"/>
<result column="business_id" property="businessId"/>
</resultMap>
<!-- 查询各业务场景下的平板使用人数 -->
<resultMap id="sceneUsageMap" type="com.gsc4cloud.gsc.multidata.dto.SceneUsageDTO">
<result property="scene" column="scene"/>
<result property="userCount" column="userCount"/>
</resultMap>
<select id="getSceneUsageList" resultMap="sceneUsageMap">
select scene, count(distinct uuid) as userCount
from clue_burial_point_record
where deleted_flag = 'N' and event_code = 'app_activeity_center'
group by scene
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gsc4cloud.gsc.multidata.mapper.slavethirty.ShopmallPlatformSubOrderMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.gsc4cloud.gsc.multidata.entity.slavethirty.ShopmallPlatformSubOrder">
<id column="id" property="id"/>
<result column="order_code" property="orderCode"/>
<result column="sub_order_code" property="subOrderCode"/>
<result column="third_sub_order_code" property="thirdSubOrderCode"/>
<result column="order_amount" property="orderAmount"/>
<result column="redeem_points" property="redeemPoints"/>
<result column="order_status" property="orderStatus"/>
<result column="logistics_status" property="logisticsStatus"/>
<result column="deliver_way" property="deliverWay"/>
<result column="express_code" property="expressCode"/>
<result column="express_name" property="expressName"/>
<result column="express_no" property="expressNo"/>
<result column="create_time" property="createTime"/>
<result column="deliver_time" property="deliverTime"/>
<result column="confirm_time" property="confirmTime"/>
<result column="sign_time" property="signTime"/>
<result column="cancel_time" property="cancelTime"/>
<result column="created_by" property="createdBy"/>
<result column="created_date" property="createdDate"/>
<result column="updated_by" property="updatedBy"/>
<result column="updated_date" property="updatedDate"/>
<result column="deleted_flag" property="deletedFlag"/>
<result column="cancel_status" property="cancelStatus"/>
</resultMap>
<!-- 查询未删除的商城平台子订单数量 -->
<select id="selectCountOfNonDeleted" resultType="java.lang.Integer">
select count(*) from shopmall_platform_sub_order where deleted_flag ='N'
</select>
</mapper>
\ No newline at end of file \ No newline at end of file
...@@ -49,3 +49,13 @@ spring: ...@@ -49,3 +49,13 @@ spring:
password: wbOTHHX5 password: wbOTHHX5
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.5.1:3310/scrm_account?useSSL=false&serverTimezone=Asia/Shanghai&characterEncoding=utf8 url: jdbc:mysql://192.168.5.1:3310/scrm_account?useSSL=false&serverTimezone=Asia/Shanghai&characterEncoding=utf8
slave_3:
username: dev_admin
password: 1f7e1ed2
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.3.227:3306/scrm_shopmall?useSSL=false&serverTimezone=Asia/Shanghai&characterEncoding=utf8
slave_4:
username: dev_admin
password: 1f7e1ed2
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.3.227:3306/scrm_clue?useSSL=false&serverTimezone=Asia/Shanghai&characterEncoding=utf8
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!