Merge branch 'master' into rescue
This commit is contained in:
commit
6e87e7cf54
@ -18,6 +18,7 @@ public enum InspectionFileEnum {
|
||||
JY_EQUIPMENT("jy_equipment","救援设备文件夹"),
|
||||
WX_STAFF("wxstaff", "维修员工文件夹"),
|
||||
INSPECTION_CUSTOMER("small_inspection_member_folder", "检测客户资料夹"),
|
||||
REPAIR_CUSTOMER("small_repair_customer_member_folder", "维修客户文件夹"),
|
||||
;
|
||||
|
||||
|
||||
|
||||
@ -826,6 +826,19 @@ public class PartnerOwnController extends BaseController {
|
||||
return success(partnerList.staticsTable5(partners.getPartnerId(), startTime, endTime));
|
||||
}
|
||||
|
||||
/**
|
||||
* @description :待收款
|
||||
* @author xyc
|
||||
* @date 09:46 2025/10/10
|
||||
* @param startTime {@link String}
|
||||
* @param endTime {@link String}
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult
|
||||
**/
|
||||
@GetMapping("/channelMoneyStaticsByBusi")
|
||||
public CommonResult<?> channelMoneyStaticsByBusi(String busi, String startTime, String endTime) throws Exception {
|
||||
return success(partnerList.channelMoneyStaticsByBusi(busi,startTime, endTime));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询检测类型统计
|
||||
*
|
||||
|
||||
@ -757,13 +757,33 @@ public class UserClientPartnerOwnController extends BaseController {
|
||||
return success(partnerList.staticsTable4(partners.getPartnerId(), startTime, endTime));
|
||||
}
|
||||
|
||||
//统计表格5
|
||||
/**
|
||||
* @description :待收款
|
||||
* @author xyc
|
||||
* @date 09:46 2025/10/10
|
||||
* @param startTime {@link String}
|
||||
* @param endTime {@link String}
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult
|
||||
**/
|
||||
@GetMapping("/staticsTable5")
|
||||
public CommonResult staticsTable5(String startTime, String endTime) throws Exception {
|
||||
ShopMallPartners partners = partnerList.shopInfo();
|
||||
return success(partnerList.staticsTable5(partners.getPartnerId(), startTime, endTime));
|
||||
}
|
||||
|
||||
/**
|
||||
* @description :待收款
|
||||
* @author xyc
|
||||
* @date 09:46 2025/10/10
|
||||
* @param startTime {@link String}
|
||||
* @param endTime {@link String}
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult
|
||||
**/
|
||||
@GetMapping("/channelMoneyStaticsByBusi")
|
||||
public CommonResult<?> channelMoneyStaticsByBusi(String busi, String startTime, String endTime) throws Exception {
|
||||
return success(partnerList.channelMoneyStaticsByBusi(busi,startTime, endTime));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询检测类型统计
|
||||
*
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package cn.iocoder.yudao.module.inspection.controller.admin;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.common.SystemEnum;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionBusinessChannel;
|
||||
import cn.iocoder.yudao.module.inspection.service.InspectionBusinessChannelService;
|
||||
@ -27,6 +28,7 @@ public class InspectionBusinessChannelController {
|
||||
return CommonResult.success(inspectionBusinessChannelService.list(Wrappers.<InspectionBusinessChannel>lambdaQuery()
|
||||
.eq(ObjectUtil.isNotEmpty(channel.getType()), InspectionBusinessChannel::getType, channel.getType())
|
||||
.like(ObjectUtil.isNotEmpty(channel.getName()), InspectionBusinessChannel::getName, channel.getName())
|
||||
.eq(InspectionBusinessChannel::getSystemCode, SystemEnum.INSPECTION.getCode())
|
||||
.orderByAsc(InspectionBusinessChannel::getSort)));
|
||||
}
|
||||
|
||||
|
||||
@ -47,4 +47,16 @@ public class StatisticsController {
|
||||
public CommonResult<?> queryStaffStatisticsGroupByGoods(@RequestBody DlInspectionProject dlInspectionProject) {
|
||||
return CommonResult.success(statisticsService.queryStaffCountGroupByGoods(dlInspectionProject));
|
||||
}
|
||||
|
||||
/**
|
||||
* @description : 获取员工产值排行榜
|
||||
* @author xyc
|
||||
* @date 16:52 2025/10/11
|
||||
* @param dlInspectionProject {@link DlInspectionProject}
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
|
||||
**/
|
||||
@PostMapping("/queryOutputMoneyStatisticsRanking")
|
||||
public CommonResult<?> queryOutputMoneyStatisticsRanking(@RequestBody DlInspectionProject dlInspectionProject) {
|
||||
return CommonResult.success(statisticsService.queryOutputMoneyStatisticsRanking(dlInspectionProject));
|
||||
}
|
||||
}
|
||||
|
||||
@ -101,6 +101,8 @@ public interface AppInspectionPartnerMapper extends BaseMapper<ShopMallPartners>
|
||||
List<Map<String, Object>> staticsTable4(@Param("partnerId") Long partnerId, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
List<Map<String, Object>> staticsTable5(@Param("partnerId") Long partnerId, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
List<Map<String, Object>> busiMoneyStatics( @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
List<Map<String, Object>> channelMoneyStaticsByBusi(@Param("busi")String busi, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
Long dhjNum(@Param("partnerId") Long partnerId, @Param("dateStr") String dateStr);
|
||||
|
||||
|
||||
@ -72,4 +72,22 @@ public interface InspectionWorkNodeMapper extends BaseMapper<InspectionWorkNode>
|
||||
* @return: java.util.Map<java.lang.String,java.lang.Object>
|
||||
**/
|
||||
Map<String, Object> queryStaffInspectionCount(DlInspectionProject dlInspectionProject);
|
||||
|
||||
/**
|
||||
* @description: 获取员工项目统计
|
||||
* @author: 许
|
||||
* @date: 2025/10/9 14:07
|
||||
* @param: [dlInspectionProject]
|
||||
* @return: java.util.Map<java.lang.String,java.lang.Object>
|
||||
**/
|
||||
Map<String, Object> queryOutputMoneyStatistics(DlInspectionProject dlInspectionProject);
|
||||
|
||||
/**
|
||||
* @description : 获取员工项目统计排名
|
||||
* @author xyc
|
||||
* @date 16:48 2025/10/11
|
||||
* @param dlInspectionProject {@link DlInspectionProject}
|
||||
* @return java.util.Map<java.lang.String,java.lang.Object>
|
||||
**/
|
||||
List<Map<String, Object>> queryOutputMoneyStatisticsRanking(DlInspectionProject dlInspectionProject);
|
||||
}
|
||||
|
||||
@ -36,4 +36,9 @@ public class InspectionListQuery {
|
||||
* 项目id
|
||||
*/
|
||||
private String projectId;
|
||||
|
||||
/**
|
||||
* 类型 1=待收款
|
||||
*/
|
||||
private String type;
|
||||
}
|
||||
|
||||
@ -169,6 +169,15 @@ public interface AppInspectionPartnerService extends IService<ShopMallPartners>
|
||||
List<Map<String, Object>> staticsTable4(Long partnerId, String startTime, String endTime);
|
||||
|
||||
List<Map<String, Object>> staticsTable5(Long partnerId, String startTime, String endTime);
|
||||
/**
|
||||
* @description : 来源待收款金额统计(通过渠道)
|
||||
* @author xyc
|
||||
* @date 10:53 2025/10/10
|
||||
* @param startTime {@link String}
|
||||
* @param endTime {@link String}
|
||||
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
|
||||
**/
|
||||
List<Map<String, Object>> channelMoneyStaticsByBusi(String busi,String startTime, String endTime);
|
||||
|
||||
|
||||
//新检测金额折线图
|
||||
|
||||
@ -94,16 +94,17 @@ public interface IInspectionWorkNodeService extends IService<InspectionWorkNode>
|
||||
|
||||
/**
|
||||
* 完成异常节点
|
||||
*
|
||||
* @param idList
|
||||
*/
|
||||
void updateException(Long inspectionInfoId,List<String> idList);
|
||||
void updateException(Long inspectionInfoId, List<String> idList);
|
||||
|
||||
/**
|
||||
* @description: 员工统计根据车型
|
||||
* @author: 许
|
||||
* @date: 2025/8/5 11:41
|
||||
* @param: [dlInspectionProject]
|
||||
* @return: java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
|
||||
* @return: java.util.List<java.util.Map < java.lang.String, java.lang.Object>>
|
||||
**/
|
||||
List<Map<String, Object>> queryStaffCountGroupByGoods(DlInspectionProject dlInspectionProject);
|
||||
|
||||
@ -112,7 +113,16 @@ public interface IInspectionWorkNodeService extends IService<InspectionWorkNode>
|
||||
* @author: 许
|
||||
* @date: 2025/8/5 14:04
|
||||
* @param: [dlInspectionProject]
|
||||
* @return: java.util.Map<java.lang.String,java.lang.Object>
|
||||
* @return: java.util.Map<java.lang.String, java.lang.Object>
|
||||
**/
|
||||
Map<String, Object> queryStaffInspectionCount(DlInspectionProject dlInspectionProject);
|
||||
|
||||
/**
|
||||
* @param dlInspectionProject {@link DlInspectionProject}
|
||||
* @return java.util.Map<java.lang.String, java.lang.Object>
|
||||
* @description : 获取员工统计信息
|
||||
* @author xyc
|
||||
* @date 17:23 2025/10/9
|
||||
**/
|
||||
Map<String, Object> queryOutputMoneyStatistics(DlInspectionProject dlInspectionProject);
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.inspection.service;
|
||||
|
||||
import cn.iocoder.yudao.module.inspection.entity.DlInspectionProject;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface StatisticsService {
|
||||
@ -23,4 +24,13 @@ public interface StatisticsService {
|
||||
* @return: java.util.Map<java.lang.String,java.lang.Object>
|
||||
**/
|
||||
Map<String, Object> queryStaffCountGroupByGoods(DlInspectionProject dlInspectionProject);
|
||||
|
||||
/**
|
||||
* @description: 获取员工产值排行榜
|
||||
* @author: 许
|
||||
* @date: 2025/8/5 14:07
|
||||
* @param: [dlInspectionProject]
|
||||
* @return: java.util.Map<java.lang.String,java.lang.Object>
|
||||
**/
|
||||
List<Map<String, Object>> queryOutputMoneyStatisticsRanking(DlInspectionProject dlInspectionProject);
|
||||
}
|
||||
|
||||
@ -77,6 +77,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
@ -2285,6 +2286,15 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description :待收款
|
||||
* @author xyc
|
||||
* @date 09:47 2025/10/10
|
||||
* @param partnerId {@link Long}
|
||||
* @param startTime {@link String}
|
||||
* @param endTime {@link String}
|
||||
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
|
||||
**/
|
||||
@Override
|
||||
public List<Map<String, Object>> staticsTable5(Long partnerId, String startTime, String endTime) {
|
||||
if (StringUtils.isEmpty(startTime)) {
|
||||
@ -2293,7 +2303,27 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
||||
}
|
||||
startTime = startTime + " 00:00:00";
|
||||
endTime = endTime + " 23:59:59";
|
||||
List<Map<String, Object>> res = baseMapper.staticsTable5(partnerId, startTime, endTime);
|
||||
List<Map<String, Object>> res = baseMapper.busiMoneyStatics(startTime, endTime);
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description : 来源待收款金额统计(通过渠道)
|
||||
* @author xyc
|
||||
* @date 10:53 2025/10/10
|
||||
* @param startTime {@link String}
|
||||
* @param endTime {@link String}
|
||||
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
|
||||
**/
|
||||
@Override
|
||||
public List<Map<String, Object>> channelMoneyStaticsByBusi(String busi,String startTime, String endTime) {
|
||||
if (StringUtils.isEmpty(startTime)) {
|
||||
startTime = DateUtil.format(new Date(), "yyyy-MM-dd");
|
||||
endTime = DateUtil.format(new Date(), "yyyy-MM-dd");
|
||||
}
|
||||
startTime = startTime + " 00:00:00";
|
||||
endTime = endTime + " 23:59:59";
|
||||
List<Map<String, Object>> res = baseMapper.channelMoneyStaticsByBusi(busi,startTime, endTime);
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -2538,24 +2568,32 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
||||
.filter(info -> info.getReturnCarUserId() != null) // 过滤 null 值
|
||||
.collect(Collectors.groupingBy(InspectionInfo::getReturnCarUserId));
|
||||
|
||||
// 先计算所有项目的总完成数
|
||||
// 先计算所有项目的总完成数和总产值
|
||||
Map<String, Long> projectTotalMap = new HashMap<>();
|
||||
Map<String, BigDecimal> projectTotalOutputValueMap = new HashMap<>(); // 总产值统计
|
||||
|
||||
for (Map<String, Object> stringObjectMap : staffCount) {
|
||||
Set<Long> inspectionInfoIds = new HashSet<>();
|
||||
BigDecimal userTotalOutputValue = BigDecimal.ZERO; // 员工总产值
|
||||
|
||||
Long userId = (Long) stringObjectMap.get("userId");
|
||||
List<Map<String, Object>> children = (List<Map<String, Object>>) stringObjectMap.get("children");
|
||||
|
||||
// 处理项目节点
|
||||
for (Map<String, Object> child : children) {
|
||||
BigDecimal outputValue = (BigDecimal) child.get("outputValue");
|
||||
if (outputValue != null) {
|
||||
userTotalOutputValue = userTotalOutputValue.add(outputValue);
|
||||
}
|
||||
|
||||
inspectionInfoIds.addAll(
|
||||
children.stream()
|
||||
.map(map -> (String) map.get("inspectionInfoId")) // 获取逗号分隔的字符串
|
||||
.flatMap(idsStr -> Arrays.stream(idsStr.split(","))) // 拆分成单个ID字符串
|
||||
.map(String::trim) // 去除前后空格
|
||||
.filter(idStr -> !idStr.isEmpty()) // 过滤空字符串
|
||||
.map(Long::valueOf) // 转换为Long类型
|
||||
Arrays.stream(((String) child.get("inspectionInfoId")).split(","))
|
||||
.map(String::trim)
|
||||
.filter(idStr -> !idStr.isEmpty())
|
||||
.map(Long::valueOf)
|
||||
.collect(Collectors.toList())
|
||||
);
|
||||
}
|
||||
|
||||
// 获取所有接车信息
|
||||
List<InspectionInfo> inspectionInfos = meetManIdCountMap.get(userId);
|
||||
@ -2568,18 +2606,20 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
||||
inspectionInfoIds.addAll(inspectionInfos.stream().map(InspectionInfo::getId).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
HashMap<String, Object> objectObjectHashMap = new HashMap<>();
|
||||
objectObjectHashMap.put("count", meetCount);
|
||||
objectObjectHashMap.put("projectName", "接车拍照");
|
||||
children.add(objectObjectHashMap);
|
||||
// 添加工单相关项目(这些项目产值暂时为0)
|
||||
HashMap<String, Object> meetCarMap = new HashMap<>();
|
||||
meetCarMap.put("count", meetCount);
|
||||
meetCarMap.put("projectName", "接车拍照");
|
||||
meetCarMap.put("outputValue", BigDecimal.ZERO);
|
||||
children.add(meetCarMap);
|
||||
|
||||
HashMap<String, Object> meetCarHashMap = new HashMap<>();
|
||||
meetCarHashMap.put("count", meetGoCount);
|
||||
meetCarHashMap.put("projectName", "上门接车");
|
||||
children.add(meetCarHashMap);
|
||||
HashMap<String, Object> meetGoMap = new HashMap<>();
|
||||
meetGoMap.put("count", meetGoCount);
|
||||
meetGoMap.put("projectName", "上门接车");
|
||||
meetGoMap.put("outputValue", BigDecimal.ZERO);
|
||||
children.add(meetGoMap);
|
||||
|
||||
//还车
|
||||
//设置totalCount
|
||||
// 还车信息
|
||||
List<InspectionInfo> returnCarInfoList = returnCarUserIdCountMap.get(userId);
|
||||
long returnCount = 0;
|
||||
long returnGoCount = 0;
|
||||
@ -2587,42 +2627,43 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
||||
if (CollUtil.isNotEmpty(returnCarInfoList)) {
|
||||
inspectionInfoIds.addAll(returnCarInfoList.stream().map(InspectionInfo::getId).collect(Collectors.toList()));
|
||||
|
||||
returnCount = Optional.ofNullable(returnCarInfoList)
|
||||
.orElse(Collections.emptyList())
|
||||
.stream()
|
||||
.filter(Objects::nonNull)
|
||||
returnCount = returnCarInfoList.stream()
|
||||
.filter(i -> i.getReturnType() != null && i.getReturnType() == 0)
|
||||
.count();
|
||||
|
||||
returnGoCount = Optional.ofNullable(returnCarInfoList)
|
||||
.orElse(Collections.emptyList())
|
||||
.stream()
|
||||
.filter(Objects::nonNull)
|
||||
returnGoCount = returnCarInfoList.stream()
|
||||
.filter(i -> i.getReturnType() != null && i.getReturnType() == 1)
|
||||
.count();
|
||||
}
|
||||
|
||||
stringObjectMap.put("totalCount", Long.parseLong(String.valueOf(inspectionInfoIds.size())));
|
||||
stringObjectMap.put("totalCount", inspectionInfoIds.size());
|
||||
stringObjectMap.put("totalOutputValue", userTotalOutputValue); // 设置员工总产值
|
||||
|
||||
Map<String, Object> objectObjectHashMap1 = new HashMap<>();
|
||||
objectObjectHashMap1.put("count", returnCount);
|
||||
objectObjectHashMap1.put("projectName", "还车拍照");
|
||||
children.add(objectObjectHashMap1);
|
||||
Map<String, Object> returnCarMap = new HashMap<>();
|
||||
returnCarMap.put("count", returnCount);
|
||||
returnCarMap.put("projectName", "还车拍照");
|
||||
returnCarMap.put("outputValue", BigDecimal.ZERO);
|
||||
children.add(returnCarMap);
|
||||
|
||||
Map<String, Object> returnCarHashMap = new HashMap<>();
|
||||
returnCarHashMap.put("count", returnGoCount);
|
||||
returnCarHashMap.put("projectName", "上门还车");
|
||||
children.add(returnCarHashMap);
|
||||
Map<String, Object> returnGoMap = new HashMap<>();
|
||||
returnGoMap.put("count", returnGoCount);
|
||||
returnGoMap.put("projectName", "上门还车");
|
||||
returnGoMap.put("outputValue", BigDecimal.ZERO);
|
||||
children.add(returnGoMap);
|
||||
}
|
||||
|
||||
// 计算每个项目的总完成数
|
||||
// 计算每个项目的总完成数和总产值
|
||||
for (Map<String, Object> staff : staffCount) {
|
||||
List<Map<String, Object>> children = (List<Map<String, Object>>) staff.get("children");
|
||||
if (children != null) {
|
||||
for (Map<String, Object> child : children) {
|
||||
String projectName = (String) child.get("projectName");
|
||||
Long count = (Long) child.get("count");
|
||||
BigDecimal outputValue = (BigDecimal) child.get("outputValue");
|
||||
|
||||
projectTotalMap.put(projectName, projectTotalMap.getOrDefault(projectName, 0L) + count);
|
||||
projectTotalOutputValueMap.put(projectName,
|
||||
projectTotalOutputValueMap.getOrDefault(projectName, BigDecimal.ZERO).add(outputValue != null ? outputValue : BigDecimal.ZERO));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2646,19 +2687,22 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
||||
}
|
||||
}
|
||||
|
||||
// 按 meetCarCount 降序排序员工
|
||||
staffCount.sort(Comparator.comparingLong(
|
||||
(Map<String, Object> staff) -> (Long) staff.getOrDefault("totalCount", 0L)
|
||||
// 按总产值降序排序员工
|
||||
staffCount.sort(Comparator.comparing(
|
||||
(Map<String, Object> staff) -> (BigDecimal) staff.getOrDefault("totalOutputValue", BigDecimal.ZERO)
|
||||
).reversed());
|
||||
|
||||
// 对每个员工的 children 按 count 降序排序
|
||||
// 对每个员工的 children:先移除 count == 0 的项,再按 count 降序排序
|
||||
// 对每个员工的 children 按产值降序排序
|
||||
staffCount.forEach(staff -> {
|
||||
List<Map<String, Object>> children = (List<Map<String, Object>>) staff.get("children");
|
||||
if (children != null) {
|
||||
children.removeIf(child -> ((Long) child.getOrDefault("count", 0L)) == 0L);
|
||||
children.sort(Comparator.comparingLong(
|
||||
(Map<String, Object> child) -> (Long) child.getOrDefault("count", 0L)
|
||||
children.removeIf(child -> {
|
||||
Long count = (Long) child.getOrDefault("count", 0L);
|
||||
BigDecimal outputValue = (BigDecimal) child.getOrDefault("outputValue", BigDecimal.ZERO);
|
||||
return count == 0L && outputValue.compareTo(BigDecimal.ZERO) == 0;
|
||||
});
|
||||
children.sort(Comparator.comparing(
|
||||
(Map<String, Object> child) -> (BigDecimal) child.getOrDefault("outputValue", BigDecimal.ZERO)
|
||||
).reversed());
|
||||
}
|
||||
});
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.inspection.service.impl;
|
||||
|
||||
import cn.iocoder.yudao.common.SystemEnum;
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionBusinessChannel;
|
||||
import cn.iocoder.yudao.module.inspection.mapper.InspectionBusinessChannelMapper;
|
||||
import cn.iocoder.yudao.module.inspection.service.InspectionBusinessChannelService;
|
||||
@ -18,7 +19,8 @@ public class InspectionBusinessChannelServiceImpl extends ServiceImpl<Inspection
|
||||
@Override
|
||||
public List<InspectionBusinessChannel> getChannelTree() {
|
||||
// 查询所有业务渠道(父节点)
|
||||
return this.list();
|
||||
return this.list(Wrappers.<InspectionBusinessChannel>lambdaQuery()
|
||||
.eq(InspectionBusinessChannel::getSystemCode, SystemEnum.INSPECTION.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -676,7 +676,8 @@ public class InspectionFileServiceImpl extends ServiceImpl<InspectionFileMapper,
|
||||
@Override
|
||||
public void warnReminder() {
|
||||
// 查询出检测小程序的资料文件夹
|
||||
InspectionFile inspectionFile = baseMapper.selectOne(new LambdaQueryWrapper<InspectionFile>().eq(InspectionFile::getDefaultKey, InspectionFileEnum.INSPECTION_CUSTOMER.getType()));
|
||||
// TODO 优化 暂未适配其他系统
|
||||
InspectionFile inspectionFile = baseMapper.selectOne(new LambdaQueryWrapper<InspectionFile>().in(InspectionFile::getDefaultKey, InspectionFileEnum.INSPECTION_CUSTOMER.getType()));
|
||||
if (inspectionFile != null) {
|
||||
// 查询出code中所有带这个文件夹id的文件
|
||||
List<InspectionFile> inspectionFiles = baseMapper.selectList(Wrappers.<InspectionFile>lambdaQuery().like(InspectionFile::getFileCode, inspectionFile.getId()).eq(InspectionFile::getType, InspectionConstants.INSPECTION_FILE));
|
||||
|
||||
@ -26,6 +26,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@ -462,6 +463,7 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
|
||||
m.put("userId", vo.getUserId());
|
||||
m.put("nickname", vo.getNickname());
|
||||
m.put("totalCount", 0L); // 初始总数
|
||||
m.put("totalOutputValue", BigDecimal.ZERO); // 初始总产值
|
||||
m.put("children", new ArrayList<Map<String, Object>>());
|
||||
return m;
|
||||
});
|
||||
@ -469,29 +471,50 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
|
||||
// 添加项目
|
||||
List<Map<String, Object>> children = (List<Map<String, Object>>) userEntry.get("children");
|
||||
vo.setCount(vo.getCount() == null ? 0 : vo.getCount());
|
||||
if (vo.getCount() == 0) {
|
||||
|
||||
// 即使count为0,但如果产值不为0,也要显示
|
||||
if (vo.getCount() == 0 && (vo.getOutputValue() == null || vo.getOutputValue().compareTo(BigDecimal.ZERO) == 0)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Map<String, Object> project = new HashMap<>();
|
||||
project.put("projectName", vo.getProjectName());
|
||||
project.put("count", vo.getCount());
|
||||
project.put("id", vo.getId());
|
||||
project.put("inspectionInfoId", vo.getInspectionInfoIds());
|
||||
project.put("outputValue", vo.getOutputValue() != null ? vo.getOutputValue() : BigDecimal.ZERO);
|
||||
children.add(project);
|
||||
|
||||
// 累加总数
|
||||
// 累加总数和总产值
|
||||
Long currentTotal = (Long) userEntry.get("totalCount");
|
||||
BigDecimal currentOutputValue = (BigDecimal) userEntry.get("totalOutputValue");
|
||||
userEntry.put("totalCount", currentTotal + vo.getCount());
|
||||
userEntry.put("totalOutputValue", currentOutputValue.add(
|
||||
vo.getOutputValue() != null ? vo.getOutputValue() : BigDecimal.ZERO));
|
||||
}
|
||||
|
||||
// 转成 List 并按 totalCount 降序排序
|
||||
// 转成 List 并按总产值降序排序
|
||||
return tempMap.values().stream()
|
||||
.peek(userEntry -> {
|
||||
// 排序每个用户下的项目 children
|
||||
// 排序每个用户下的项目:按产值降序,产值相同按数量降序
|
||||
List<Map<String, Object>> children = (List<Map<String, Object>>) userEntry.get("children");
|
||||
children.sort((a, b) -> Long.compare((Long) b.get("count"), (Long) a.get("count")));
|
||||
children.sort((a, b) -> {
|
||||
BigDecimal outputValueA = (BigDecimal) a.get("outputValue");
|
||||
BigDecimal outputValueB = (BigDecimal) b.get("outputValue");
|
||||
int result = outputValueB.compareTo(outputValueA);
|
||||
if (result == 0) {
|
||||
Long countA = (Long) a.get("count");
|
||||
Long countB = (Long) b.get("count");
|
||||
return Long.compare(countB, countA);
|
||||
}
|
||||
return result;
|
||||
});
|
||||
})
|
||||
.sorted((a, b) -> {
|
||||
BigDecimal outputValueA = (BigDecimal) a.get("totalOutputValue");
|
||||
BigDecimal outputValueB = (BigDecimal) b.get("totalOutputValue");
|
||||
return outputValueB.compareTo(outputValueA);
|
||||
})
|
||||
.sorted((a, b) -> Long.compare((Long) b.get("totalCount"), (Long) a.get("totalCount")))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@ -614,6 +637,18 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
|
||||
return baseMapper.queryStaffInspectionCount(dlInspectionProject);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description :产值统计
|
||||
* @author xyc
|
||||
* @date 17:51 2025/10/9
|
||||
* @param dlInspectionProject {@link DlInspectionProject}
|
||||
* @return java.util.Map<java.lang.String, java.lang.Object>
|
||||
**/
|
||||
@Override
|
||||
public Map<String, Object> queryOutputMoneyStatistics(DlInspectionProject dlInspectionProject) {
|
||||
return baseMapper.queryOutputMoneyStatistics(dlInspectionProject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断传入的 InspectionWorkNode 对象是否在集合中有后续项目
|
||||
*
|
||||
|
||||
@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.inspection.service.impl;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.module.inspection.entity.DlInspectionProject;
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionInfo;
|
||||
import cn.iocoder.yudao.module.inspection.mapper.InspectionWorkNodeMapper;
|
||||
import cn.iocoder.yudao.module.inspection.service.IInspectionInfoService;
|
||||
import cn.iocoder.yudao.module.inspection.service.IInspectionWorkNodeService;
|
||||
import cn.iocoder.yudao.module.inspection.service.StatisticsService;
|
||||
@ -33,6 +34,8 @@ public class StatisticsServiceImpl implements StatisticsService {
|
||||
private final IInspectionInfoService inspectionInfoService;
|
||||
|
||||
private final AdminUserApi adminUserApi;
|
||||
|
||||
private final InspectionWorkNodeMapper inspectionWorkNodeMapper;
|
||||
/**
|
||||
* @description: 获取员工统计信息
|
||||
* @author: 许
|
||||
@ -56,6 +59,10 @@ public class StatisticsServiceImpl implements StatisticsService {
|
||||
/*获取员工信息*/
|
||||
AdminUserRespDTO user = adminUserApi.getUser(dlInspectionProject.getUserId());
|
||||
result.put("staffInfo", user);
|
||||
|
||||
/*产值相关统计*/
|
||||
Map<String, Object> outputMoneyStatistics = inspectionWorkNodeService.queryOutputMoneyStatistics(dlInspectionProject);
|
||||
result.put("outputMoneyStatistics", outputMoneyStatistics);
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -157,4 +164,9 @@ public class StatisticsServiceImpl implements StatisticsService {
|
||||
|
||||
return staffCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> queryOutputMoneyStatisticsRanking(DlInspectionProject dlInspectionProject) {
|
||||
return inspectionWorkNodeMapper.queryOutputMoneyStatisticsRanking(dlInspectionProject);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,8 @@ package cn.iocoder.yudao.module.inspection.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class StaffProjectCountVO {
|
||||
private String id;
|
||||
@ -12,4 +14,6 @@ public class StaffProjectCountVO {
|
||||
private Long nodeCount;
|
||||
// private Long inspectionInfoId;
|
||||
private String inspectionInfoIds;
|
||||
private BigDecimal outputValue; // 项目产值
|
||||
private BigDecimal goodsPrice; // 商品价格
|
||||
}
|
||||
|
||||
@ -248,7 +248,10 @@
|
||||
ip.id AS project_id,
|
||||
GROUP_CONCAT(iwn.inspection_info_id) AS inspectionInfoIds,
|
||||
su.nickname,
|
||||
SUM(IF(iwn.node_count = 0,1,iwn.node_count)) count
|
||||
SUM(IF(iwn.node_count = 0,1,iwn.node_count)) count,
|
||||
-- 添加产值计算:合格节点的商品价格总和(单位:元)
|
||||
COALESCE(SUM(CASE WHEN iwn.status = '2' AND iwn.type = '1' THEN oi.goods_price ELSE 0 END) / 100, 0) AS outputValue,
|
||||
oi.goods_price
|
||||
FROM
|
||||
inspection_staff staff
|
||||
LEFT JOIN inspection_work_node iwn ON iwn.deal_user_id = staff.user_id
|
||||
@ -256,6 +259,8 @@
|
||||
AND iwn.create_time BETWEEN concat(#{datetimeRange[0]}, ' 00:00:00') AND concat(#{datetimeRange[1]}, ' 23:59:59')
|
||||
</if>
|
||||
LEFT JOIN inspection_project ip ON ip.id = iwn.project_id
|
||||
LEFT JOIN inspection_info ii ON iwn.inspection_info_id = ii.id
|
||||
LEFT JOIN order_info oi ON ii.inspection_order_id = oi.id
|
||||
LEFT JOIN (
|
||||
SELECT DISTINCT sur.user_id
|
||||
FROM system_user_role sur
|
||||
@ -270,33 +275,8 @@
|
||||
<if test="userId != null and userId != ''">
|
||||
AND staff.user_id = #{userId}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
GROUP BY staff.user_id ,ip.id
|
||||
|
||||
<!--SELECT
|
||||
ip.id AS project_id,
|
||||
ip.project_name,
|
||||
is2.user_id,
|
||||
su.nickname,
|
||||
iwn.inspection_info_id,
|
||||
COUNT(iwn.id) AS count,
|
||||
SUM(iwn.node_count) AS nodeCount
|
||||
FROM inspection_staff is2
|
||||
CROSS JOIN inspection_project ip
|
||||
LEFT JOIN system_users su ON su.id = is2.user_id
|
||||
left join system_user_role sr on su.id = sr.user_id
|
||||
left join system_role sr2 on sr.role_id = sr2.id
|
||||
INNER JOIN inspection_work_node iwn ON
|
||||
iwn.deal_user_id = is2.user_id
|
||||
AND iwn.project_id = ip.id
|
||||
<if test="datetimeRange != null">
|
||||
AND iwn.create_time BETWEEN #{datetimeRange[0]} AND #{datetimeRange[1]}
|
||||
</if>
|
||||
WHERE
|
||||
is2.deleted = 0
|
||||
AND su.deleted = 0 and sr2.service_package_id = 'jiance' and sr2.code != 'jcyh' and sr2.code != 'jcywjl'
|
||||
GROUP BY is2.user_id, ip.id-->
|
||||
GROUP BY staff.user_id, ip.id
|
||||
</select>
|
||||
|
||||
<select id="selectExceptionNodesByInspectionIds" resultType="java.util.Map">
|
||||
@ -364,8 +344,8 @@
|
||||
<if test="query.datetimeRange != null">
|
||||
AND ii.create_time BETWEEN CONCAT(#{query.datetimeRange[0]}, ' 00:00:00') AND CONCAT(#{query.datetimeRange[1]}, ' 23:59:59')
|
||||
</if>
|
||||
<if test="query.customSource != null">
|
||||
AND ii.customer_source = #{query.customSource}
|
||||
<if test="query.type != null and query.type == 1">
|
||||
AND (oi.pay_type = 'sz' OR oi.cashier_confirm != '1' OR oi.pay_money IS NULL)
|
||||
</if>
|
||||
<if test="query.bussiness != null">
|
||||
AND ii.business_channel = #{query.bussiness}
|
||||
@ -373,7 +353,10 @@
|
||||
<if test="query.projectId != null">
|
||||
AND ip.id = #{query.projectId}
|
||||
</if>
|
||||
<if test="query.type != 1">
|
||||
AND iwn.status = '2'
|
||||
</if>
|
||||
|
||||
AND iwn.deleted = b'0'
|
||||
</where>
|
||||
GROUP BY ii.id
|
||||
@ -486,4 +469,79 @@
|
||||
</where>
|
||||
GROUP BY staff.user_id, ip.id;
|
||||
</select>
|
||||
<select id="queryOutputMoneyStatistics" resultType="java.util.Map">
|
||||
SELECT
|
||||
iw.deal_user_id,
|
||||
|
||||
-- 初检公示产值:流程次数为1的订单公示价格
|
||||
COALESCE(SUM(CASE WHEN iw.node_count = 1 THEN oi.goods_price ELSE 0 END) / 100, 0) AS initialInspectionOutputValue,
|
||||
|
||||
-- 复检公示产值:流程次数大于1的订单公示价格总和
|
||||
COALESCE(SUM(CASE WHEN iw.node_count > 1 THEN oi.goods_price ELSE 0 END) / 100, 0) AS recheckInspectionOutputValue,
|
||||
|
||||
-- 初检合格产值:流程次数为1且status=2且type='1'的订单公示价格
|
||||
COALESCE(SUM(CASE WHEN iw.node_count = 1 AND iw.status = '2' AND iw.type = '1' THEN oi.goods_price ELSE 0 END) / 100, 0) AS initialInspectionPassOutputValue,
|
||||
|
||||
-- 复检合格产值:流程次数大于1且status=2且type='1'的订单公示价格总和
|
||||
COALESCE(SUM(CASE WHEN iw.node_count > 1 AND iw.status = '2' AND iw.type = '1' THEN oi.goods_price ELSE 0 END) / 100, 0) AS recheckInspectionPassOutputValue
|
||||
|
||||
FROM
|
||||
inspection_work_node iw
|
||||
JOIN
|
||||
inspection_info ii ON iw.inspection_info_id = ii.id
|
||||
JOIN
|
||||
order_info oi ON ii.inspection_order_id = oi.id
|
||||
WHERE
|
||||
iw.deal_user_id = #{userId} -- 替换为所需的处理人ID
|
||||
AND iw.deleted = 0 -- 确保流程未被删除
|
||||
AND ii.deleted = 0 -- 确保检测信息未被删除
|
||||
<if test="datetimeRange != null and datetimeRange.size() == 2">
|
||||
AND iw.create_time BETWEEN CONCAT(#{datetimeRange[0]}, ' 00:00:00') AND CONCAT(#{datetimeRange[1]}, ' 23:59:59')
|
||||
</if>
|
||||
GROUP BY
|
||||
iw.deal_user_id;
|
||||
</select>
|
||||
<select id="queryOutputMoneyStatisticsRanking" resultType="java.util.Map"
|
||||
parameterType="cn.iocoder.yudao.module.inspection.entity.DlInspectionProject">
|
||||
SELECT
|
||||
users.nickname,
|
||||
s.user_id AS userId,
|
||||
|
||||
-- 初检公示产值:流程次数为1的订单公示价格
|
||||
COALESCE(SUM(CASE WHEN iw.node_count = 1 THEN oi.goods_price ELSE 0 END) / 100, 0) AS initialInspectionOutputValue,
|
||||
|
||||
-- 复检公示产值:流程次数大于1的订单公示价格总和
|
||||
COALESCE(SUM(CASE WHEN iw.node_count > 1 THEN oi.goods_price ELSE 0 END) / 100, 0) AS recheckInspectionOutputValue,
|
||||
|
||||
-- 初检合格产值
|
||||
COALESCE(SUM(CASE WHEN iw.node_count = 1 AND iw.status = '2' AND iw.type = '1' THEN oi.goods_price ELSE 0 END) / 100, 0) AS initialInspectionPassOutputValue,
|
||||
|
||||
-- 复检合格产值
|
||||
COALESCE(SUM(CASE WHEN iw.node_count > 1 AND iw.status = '2' AND iw.type = '1' THEN oi.goods_price ELSE 0 END) / 100, 0) AS recheckInspectionPassOutputValue,
|
||||
|
||||
-- 总合格产值(初检 + 复检)
|
||||
COALESCE(SUM(CASE WHEN iw.status = '2' AND iw.type = '1' THEN oi.goods_price ELSE 0 END) / 100, 0) AS totalPassOutputValue
|
||||
|
||||
FROM
|
||||
inspection_staff s
|
||||
LEFT JOIN inspection_work_node iw ON s.user_id = iw.deal_user_id
|
||||
LEFT JOIN inspection_info ii ON iw.inspection_info_id = ii.id
|
||||
LEFT JOIN order_info oi ON ii.inspection_order_id = oi.id
|
||||
LEFT JOIN system_users users on users.id = s.user_id
|
||||
|
||||
WHERE
|
||||
s.deleted = 0
|
||||
AND iw.deleted = 0
|
||||
AND ii.deleted = 0
|
||||
<if test="datetimeRange != null and datetimeRange.size() == 2">
|
||||
AND iw.create_time BETWEEN CONCAT(#{datetimeRange[0]}, ' 00:00:00')
|
||||
AND CONCAT(#{datetimeRange[1]}, ' 23:59:59')
|
||||
</if>
|
||||
|
||||
GROUP BY
|
||||
s.user_id, s.unique_code, s.school, s.educational, s.join_date, s.address, s.short_number
|
||||
|
||||
ORDER BY
|
||||
totalPassOutputValue DESC; -- 按总合格产值倒序排行
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -888,6 +888,7 @@ FROM
|
||||
ON oi.id = ii.inspection_order_id AND oi.deleted = '0'
|
||||
WHERE
|
||||
ibc.deleted = '0'
|
||||
AND ibc.system_code = 'jiance'
|
||||
AND ibc.type = '0'
|
||||
GROUP BY
|
||||
ibc.name
|
||||
@ -918,5 +919,43 @@ FROM
|
||||
GROUP BY
|
||||
ibc.name
|
||||
</select>
|
||||
<select id="busiMoneyStatics" resultType="java.util.Map">
|
||||
SELECT
|
||||
ii.business_channel AS channel, -- 渠道
|
||||
COUNT(oi.id) AS order_count, -- 台次(订单数量)
|
||||
ROUND(IFNULL(SUM(oi.goods_price), 0) / 100) AS theAmount -- 金额(单位:元)
|
||||
FROM
|
||||
order_info oi
|
||||
INNER JOIN
|
||||
inspection_info ii ON oi.id = ii.inspection_order_id
|
||||
WHERE
|
||||
ii.create_time BETWEEN #{startTime} AND #{endTime}
|
||||
AND (oi.pay_type = 'sz' OR oi.cashier_confirm != '1' OR oi.pay_money IS NULL)
|
||||
GROUP BY
|
||||
ii.business_channel -- 按渠道分组
|
||||
ORDER BY
|
||||
theAmount DESC;
|
||||
|
||||
</select>
|
||||
<select id="channelMoneyStaticsByBusi" resultType="java.util.Map">
|
||||
SELECT
|
||||
cs.name AS sourceName,
|
||||
COUNT(DISTINCT ii.id) AS pendingCount,
|
||||
ROUND(SUM(COALESCE(oi.goods_price, 0)) / 100, 2) AS pendingAmountYuan
|
||||
FROM inspection_business_channel bc
|
||||
INNER JOIN inspection_business_channel cs ON cs.pid = bc.id AND cs.type = 1
|
||||
INNER JOIN inspection_info ii ON ii.customer_source = cs.name AND ii.deleted = 0
|
||||
INNER JOIN order_info oi ON oi.id = ii.inspection_order_id AND oi.deleted = 0
|
||||
WHERE bc.type = 0
|
||||
<if test="startTime != null">
|
||||
AND ii.create_time BETWEEN #{startTime} AND #{endTime}
|
||||
</if>
|
||||
AND bc.name = #{busi}
|
||||
AND (oi.pay_type = 'sz' OR oi.cashier_confirm != '1' OR oi.pay_money IS NULL)
|
||||
AND bc.deleted = 0
|
||||
AND cs.deleted = 0
|
||||
GROUP BY cs.id, cs.name
|
||||
ORDER BY pendingAmountYuan DESC;
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@ -762,6 +762,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</if>
|
||||
|
||||
</if>
|
||||
<if test="query.chooseStatus == '5'.toString()">
|
||||
AND ins.reinspect_count != 0 AND ins.reinspect_count IS NOT NULL
|
||||
</if>
|
||||
<if test="query.chooseStatus == '6'.toString()">
|
||||
AND ins.recheck_count != 0 AND ins.recheck_count IS NOT NULL
|
||||
</if>
|
||||
<if test="query.payStatus == 0">
|
||||
and (oi.pay_money is null OR oi.pay_type = 'sz')
|
||||
</if>
|
||||
|
||||
@ -164,21 +164,26 @@ public class DlDriveSchoolStudentController {
|
||||
//默认查全部数据
|
||||
String startTimeStr = "";
|
||||
String endTimeStr = "";
|
||||
if("more".equals(timeType)){
|
||||
if(StringUtils.isNotEmpty(startTime)){
|
||||
startTimeStr = startTime+" 00:00:01";
|
||||
if (startTime != null && endTime != null) {
|
||||
startTimeStr = startTime+" 00:00:00";
|
||||
endTimeStr = endTime+" 23:59:59";
|
||||
}else {
|
||||
if ("more".equals(timeType)) {
|
||||
if (StringUtils.isNotEmpty(startTime)) {
|
||||
startTimeStr = startTime + " 00:00:01";
|
||||
}
|
||||
if(StringUtils.isNotEmpty(endTime)) {
|
||||
if (StringUtils.isNotEmpty(endTime)) {
|
||||
endTimeStr = endTime + " 23:59:59";
|
||||
}
|
||||
}else if("month".equals(timeType)){
|
||||
} else if ("month".equals(timeType)) {
|
||||
//当月
|
||||
startTimeStr = DateUtil.format(DateUtil.beginOfMonth(DateUtil.date()),"yyyy-MM-dd")+" 00:00:01";
|
||||
endTimeStr = DateUtil.format(DateUtil.endOfMonth(DateUtil.date()),"yyyy-MM-dd")+" 23:59:59";
|
||||
}else if("day".equals(timeType)){
|
||||
startTimeStr = DateUtil.format(DateUtil.beginOfMonth(DateUtil.date()), "yyyy-MM-dd") + " 00:00:01";
|
||||
endTimeStr = DateUtil.format(DateUtil.endOfMonth(DateUtil.date()), "yyyy-MM-dd") + " 23:59:59";
|
||||
} else if ("day".equals(timeType)) {
|
||||
//当天
|
||||
startTimeStr = DateUtil.formatDate(DateUtil.date())+" 00:00:01";
|
||||
endTimeStr = DateUtil.formatDate(DateUtil.date())+" 23:59:59";
|
||||
startTimeStr = DateUtil.formatDate(DateUtil.date()) + " 00:00:01";
|
||||
endTimeStr = DateUtil.formatDate(DateUtil.date()) + " 23:59:59";
|
||||
}
|
||||
}
|
||||
return success(schoolStudentService.indexGetTrainList(type,coachId,startTimeStr,endTimeStr));
|
||||
}
|
||||
|
||||
@ -583,7 +583,7 @@
|
||||
<if test="type != null and type != ''">
|
||||
AND s.source = #{type}
|
||||
</if>
|
||||
LEFT JOIN drive_school_course_order o ON s.user_id = o.user_id AND o.payment_status > 1 AND o.deleted=0 AND o.is_sign = 1 AND o.if_end = 0
|
||||
Inner JOIN drive_school_course_order o ON s.user_id = o.user_id AND o.payment_status > 1 AND o.deleted=0 AND o.is_sign = 1 AND o.if_end = 0
|
||||
<if test="startTime != null and startTime != ''">
|
||||
AND o.create_time >= #{startTime}
|
||||
</if>
|
||||
|
||||
@ -24,11 +24,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
parameterType="cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RolePageReqVO">
|
||||
select distinct su.*,GROUP_CONCAT(DISTINCT sr2.name SEPARATOR ',') AS roleNames
|
||||
from inspection_staff staff
|
||||
LEFT JOIN system_users su on staff.user_id = su.id
|
||||
left join system_user_role sr on su.id = sr.user_id
|
||||
left join system_role sr2 on sr.role_id = sr2.id
|
||||
inner JOIN system_users su on staff.user_id = su.id
|
||||
inner join system_user_role sr on su.id = sr.user_id
|
||||
inner join system_role sr2 on sr.role_id = sr2.id
|
||||
<where>
|
||||
su.deleted = 0
|
||||
su.deleted = 0 and staff.deleted =0
|
||||
<if test="role.nickname != null">
|
||||
and (su.nickname like CONCAT('%',#{role.nickname},'%') OR su.username like CONCAT('%',#{role.nickname},'%'))
|
||||
</if>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user