0723
This commit is contained in:
parent
2fc7a2a7c2
commit
48e5aaa90c
@ -129,4 +129,20 @@ public class DriveSchoolCarController extends BaseController
|
||||
public CommonResult getCarNoAll(){
|
||||
return success(driveSchoolCarService.getCarNoAll());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据教练id获取车牌号
|
||||
*/
|
||||
@GetMapping("/getCarNoByCoachId")
|
||||
public CommonResult getCarNoByCoachId(Long coachId){
|
||||
return success(driveSchoolCarService.getCarNoByCoachId(coachId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据车牌号获取教练信息
|
||||
*/
|
||||
@GetMapping("/getCoachInfoByCarNo")
|
||||
public CommonResult getCoachInfoByCarNo(String carNo){
|
||||
return success(driveSchoolCarService.getCoachInfoByCarNo(carNo));
|
||||
}
|
||||
}
|
||||
|
@ -73,4 +73,14 @@ public interface IDriveSchoolCarService extends IService<DriveSchoolCar>
|
||||
*/
|
||||
List<DriveSchoolCar> getCarNoByCoachUserId(Long userId);
|
||||
List<DriveSchoolCar> getCarNoAll();
|
||||
|
||||
/**
|
||||
* 根据教练id获取车牌号
|
||||
*/
|
||||
List<DriveSchoolCar> getCarNoByCoachId(Long coachId);
|
||||
|
||||
/**
|
||||
* 根据车牌号获取教练信息
|
||||
*/
|
||||
List<DriveSchoolCar> getCoachInfoByCarNo(String carNo);
|
||||
}
|
||||
|
@ -317,4 +317,31 @@ public class DriveSchoolCarServiceImpl extends ServiceImpl<DriveSchoolCarMapper,
|
||||
.orderByDesc(DriveSchoolCar::getCreateTime)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据教练id获取车牌号
|
||||
*/
|
||||
@Override
|
||||
public List<DriveSchoolCar> getCarNoByCoachId(Long coachId) {
|
||||
return driveSchoolCarMapper.selectList(
|
||||
new LambdaQueryWrapper<DriveSchoolCar>()
|
||||
.eq(DriveSchoolCar::getUserId, coachId)
|
||||
.eq(DriveSchoolCar::getDeleted, 0)
|
||||
.orderByDesc(DriveSchoolCar::getCreateTime)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据车牌号获取教练信息
|
||||
*/
|
||||
@Override
|
||||
public List<DriveSchoolCar> getCoachInfoByCarNo(String carNo) {
|
||||
return driveSchoolCarMapper.selectList(
|
||||
new LambdaQueryWrapper<DriveSchoolCar>()
|
||||
.eq(DriveSchoolCar::getCarNo, carNo)
|
||||
.eq(DriveSchoolCar::getDeleted, 0)
|
||||
.orderByDesc(DriveSchoolCar::getCreateTime)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -2,14 +2,12 @@ package cn.iocoder.yudao.module.train.controller.admin;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||
import cn.iocoder.yudao.module.train.entity.DriveSchoolCoachClock;
|
||||
import cn.iocoder.yudao.module.train.service.IDriveSchoolCoachClockService;
|
||||
import cn.iocoder.yudao.module.train.vo.DriveSchoolCoachClockVO;
|
||||
import cn.iocoder.yudao.module.train.vo.TrainCarCountVO;
|
||||
import cn.iocoder.yudao.module.train.vo.TrainDetailsByCarVO;
|
||||
import cn.iocoder.yudao.module.train.vo.TrainVO;
|
||||
import cn.iocoder.yudao.module.train.vo.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@ -17,7 +15,10 @@ import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
@ -40,8 +41,8 @@ public class DriveSchoolCoachClockController {
|
||||
public CommonResult<IPage<?>> getPage(DriveSchoolCoachClockVO pageReqVO,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
Page<DriveSchoolCoachClockVO> page = new Page<>(pageNo,pageSize);
|
||||
return success(coachClockService.queryListPage(pageReqVO,page));
|
||||
Page<DriveSchoolCoachClockVO> page = new Page<>(pageNo, pageSize);
|
||||
return success(coachClockService.queryListPage(pageReqVO, page));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -57,13 +58,13 @@ public class DriveSchoolCoachClockController {
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "教练到场打卡")
|
||||
public CommonResult<String> createObj( @RequestBody DriveSchoolCoachClockVO coachClockVO) {
|
||||
public CommonResult<String> createObj(@RequestBody DriveSchoolCoachClockVO coachClockVO) {
|
||||
return success(coachClockService.createObj(coachClockVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "教练离场打卡")
|
||||
public CommonResult<?> updateObj( @RequestBody DriveSchoolCoachClockVO coachClockVO) {
|
||||
public CommonResult<?> updateObj(@RequestBody DriveSchoolCoachClockVO coachClockVO) {
|
||||
coachClockService.updateObj(coachClockVO);
|
||||
return success(true);
|
||||
}
|
||||
@ -87,6 +88,7 @@ public class DriveSchoolCoachClockController {
|
||||
|
||||
/**
|
||||
* 车辆打卡数据列表
|
||||
*
|
||||
* @param trainCarCountVO
|
||||
* @return
|
||||
*/
|
||||
@ -111,4 +113,67 @@ public class DriveSchoolCoachClockController {
|
||||
public void noClockInRemind() {
|
||||
coachClockService.noClockInRemind();
|
||||
}
|
||||
|
||||
/**
|
||||
* PC端打卡统计数据获取
|
||||
*/
|
||||
@GetMapping("getCloakAndTrainCount")
|
||||
public CommonResult<CloakAndTrainCountVO> getCloakAndTrainCount(CloakAndTrainCountVO cloakAndTrainCountVO) {
|
||||
return success(coachClockService.getCloakAndTrainCount(cloakAndTrainCountVO));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出数据获取
|
||||
*/
|
||||
@GetMapping("coachClockAll")
|
||||
public CommonResult<IPage<CoachClockExportVO>> coachClockAll(CoachClockExportVO coachClockExportVO,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
Page<CoachClockExportVO> page = new Page<>(pageNo, pageSize);
|
||||
return success(coachClockService.coachClockAll(coachClockExportVO, page));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出
|
||||
*
|
||||
* @param exportVO
|
||||
* @param response
|
||||
* @throws IOException
|
||||
*/
|
||||
@GetMapping("/coachClockRecordExport")
|
||||
public void exportCommission(CoachClockExportVO exportVO, HttpServletResponse response) throws IOException {
|
||||
// 校验导出类型
|
||||
if (exportVO.getExportType() == null || !Arrays.asList("current", "all", "range").contains(exportVO.getExportType())) {
|
||||
throw new IllegalArgumentException("无效的导出类型: " + exportVO.getExportType());
|
||||
}
|
||||
|
||||
// 根据不同类型查询数据
|
||||
List<CoachClockExportVO> exportData;
|
||||
String fileName = "教练打卡记录";
|
||||
|
||||
switch (exportVO.getExportType()) {
|
||||
case "current":
|
||||
exportData = coachClockService.getCoachClockRecordList(exportVO);
|
||||
fileName += "_第" + exportVO.getPageNo() + "页";
|
||||
break;
|
||||
case "all":
|
||||
exportData = coachClockService.getAllCoachClockRecordList(exportVO);
|
||||
fileName += "_全部数据";
|
||||
break;
|
||||
case "range":
|
||||
exportData = coachClockService.getCoachClockListByRange(exportVO);
|
||||
fileName += "_" + exportVO.getStartPage() + "-" + exportVO.getEndPage() + "页";
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("无效的导出类型: " + exportVO.getExportType());
|
||||
}
|
||||
|
||||
|
||||
// 导出Excel
|
||||
ExcelUtils.write(response, fileName + ".xlsx", "教练打卡记录", CoachClockExportVO.class, exportData);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -2,18 +2,21 @@ package cn.iocoder.yudao.module.train.controller.admin;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent;
|
||||
import cn.iocoder.yudao.module.base.mapper.DlDriveSchoolStudentMapper;
|
||||
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO;
|
||||
import cn.iocoder.yudao.module.course.service.ProcessService;
|
||||
import cn.iocoder.yudao.module.course.vo.CommissionExportVO;
|
||||
import cn.iocoder.yudao.module.jx.domain.DriveSchoolCar;
|
||||
import cn.iocoder.yudao.module.jx.mapper.DriveSchoolCarMapper;
|
||||
import cn.iocoder.yudao.module.jx.vo.DriveSchoolCarVO;
|
||||
import cn.iocoder.yudao.module.train.entity.Train;
|
||||
import cn.iocoder.yudao.module.train.service.TrainService;
|
||||
import cn.iocoder.yudao.module.train.vo.NoClockInRemindVO;
|
||||
import cn.iocoder.yudao.module.train.vo.TrainExportVO;
|
||||
import cn.iocoder.yudao.module.train.vo.TrainStudentCountVO;
|
||||
import cn.iocoder.yudao.module.train.vo.TrainVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -27,7 +30,10 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
@ -249,4 +255,51 @@ public class TrainController {
|
||||
public CommonResult<List<Train>> getTrainStudentList(@RequestParam(value = "coachClockId") String coachClockId){
|
||||
return success(trainService.getTrainStudentList(coachClockId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取学员导出数据列表
|
||||
*/
|
||||
@GetMapping("getExportList")
|
||||
public CommonResult<IPage<TrainExportVO>> getExportList(TrainExportVO exportVO,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize){
|
||||
Page<TrainExportVO> page = new Page<>(pageNo, pageSize);
|
||||
return success(trainService.getExportList(exportVO,page));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出数据(支持三种模式)
|
||||
* @param exportVO 包含导出类型(exportType)、分页参数等
|
||||
*/
|
||||
@GetMapping("/export")
|
||||
public void exportCommission(TrainExportVO exportVO, HttpServletResponse response) throws IOException {
|
||||
// 校验导出类型
|
||||
if (exportVO.getExportType() == null || !Arrays.asList("current", "all", "range").contains(exportVO.getExportType())) {
|
||||
throw new IllegalArgumentException("无效的导出类型: " + exportVO.getExportType());
|
||||
}
|
||||
|
||||
// 根据不同类型查询数据
|
||||
List<TrainExportVO> exportData;
|
||||
String fileName = "学员训练记录";
|
||||
|
||||
switch (exportVO.getExportType()) {
|
||||
case "current":
|
||||
exportData = trainService.getTrainList(exportVO);
|
||||
fileName += "_第" + exportVO.getPageNo() + "页";
|
||||
break;
|
||||
case "all":
|
||||
exportData = trainService.getAllTrainList(exportVO);
|
||||
fileName += "_全部数据";
|
||||
break;
|
||||
case "range":
|
||||
exportData = trainService.getTrainListByRange(exportVO);
|
||||
fileName += "_" + exportVO.getStartPage() + "-" + exportVO.getEndPage() + "页";
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("无效的导出类型: " + exportVO.getExportType());
|
||||
}
|
||||
|
||||
// 导出Excel
|
||||
ExcelUtils.write(response, fileName + ".xlsx", "学员训练记录", TrainExportVO.class, exportData);
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,7 @@
|
||||
package cn.iocoder.yudao.module.train.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.train.entity.DriveSchoolCoachClock;
|
||||
import cn.iocoder.yudao.module.train.vo.DriveSchoolCoachClockVO;
|
||||
import cn.iocoder.yudao.module.train.vo.TrainCarCountVO;
|
||||
import cn.iocoder.yudao.module.train.vo.TrainDetailsByCarVO;
|
||||
import cn.iocoder.yudao.module.train.vo.*;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -37,4 +35,15 @@ public interface DriveSchoolCoachClockMapper extends BaseMapper<DriveSchoolCoach
|
||||
* @return
|
||||
*/
|
||||
List<DriveSchoolCoachClock> noClockInRemind();
|
||||
|
||||
/**
|
||||
* 导出数据获取
|
||||
*/
|
||||
IPage<CoachClockExportVO> coachClockExport(@Param("entity") CoachClockExportVO coachClockExportVO, Page<CoachClockExportVO> page);
|
||||
|
||||
|
||||
CloakAndTrainCountVO getTrainStudentCount(@Param("entity") CloakAndTrainCountVO cloakAndTrainCountVO);
|
||||
CloakAndTrainCountVO getTrainCarCount(@Param("entity") CloakAndTrainCountVO cloakAndTrainCountVO);
|
||||
|
||||
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.train.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.train.entity.Train;
|
||||
import cn.iocoder.yudao.module.train.vo.NoClockInRemindVO;
|
||||
import cn.iocoder.yudao.module.train.vo.TrainExportVO;
|
||||
import cn.iocoder.yudao.module.train.vo.TrainStudentCountVO;
|
||||
import cn.iocoder.yudao.module.train.vo.TrainVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
@ -38,4 +39,9 @@ public interface TrainMapper extends BaseMapper<Train> {
|
||||
*/
|
||||
List<Train> selectStudentByCoachClockId(String coachClockId);
|
||||
|
||||
/**
|
||||
* 获取学员导出数据列表
|
||||
*/
|
||||
IPage<TrainExportVO> getExportList(@Param("entity") TrainExportVO entity, Page<TrainExportVO> page);
|
||||
|
||||
}
|
||||
|
@ -1,10 +1,8 @@
|
||||
package cn.iocoder.yudao.module.train.service;
|
||||
|
||||
import cn.iocoder.yudao.module.base.vo.BusinessRecordExportVO;
|
||||
import cn.iocoder.yudao.module.train.entity.DriveSchoolCoachClock;
|
||||
import cn.iocoder.yudao.module.train.vo.DriveSchoolCoachClockVO;
|
||||
import cn.iocoder.yudao.module.train.vo.TrainCarCountVO;
|
||||
import cn.iocoder.yudao.module.train.vo.TrainDetailsByCarVO;
|
||||
import cn.iocoder.yudao.module.train.vo.TrainVO;
|
||||
import cn.iocoder.yudao.module.train.vo.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
@ -61,9 +59,28 @@ public interface IDriveSchoolCoachClockService extends IService<DriveSchoolCoach
|
||||
*/
|
||||
List<TrainDetailsByCarVO> trainClockByCarDetail(TrainDetailsByCarVO trainDetailsByCarVO);
|
||||
|
||||
/**
|
||||
* PC端打卡统计数据获取
|
||||
*/
|
||||
CloakAndTrainCountVO getCloakAndTrainCount(CloakAndTrainCountVO cloakAndTrainCountVO);
|
||||
|
||||
/**
|
||||
* 每天晚上7点提醒未进行离场打卡的教练进行打卡
|
||||
*/
|
||||
void noClockInRemind();
|
||||
|
||||
/**
|
||||
* 导出数据获取
|
||||
*/
|
||||
IPage<CoachClockExportVO> coachClockAll(CoachClockExportVO exportVO, Page<CoachClockExportVO> page);
|
||||
|
||||
/**
|
||||
* 导出的三种形式
|
||||
* @param exportVO
|
||||
* @return
|
||||
*/
|
||||
List<CoachClockExportVO> getCoachClockRecordList(CoachClockExportVO exportVO);
|
||||
List<CoachClockExportVO> getAllCoachClockRecordList(CoachClockExportVO exportVO);
|
||||
List<CoachClockExportVO> getCoachClockListByRange(CoachClockExportVO exportVO);
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,9 @@
|
||||
package cn.iocoder.yudao.module.train.service;
|
||||
|
||||
import cn.iocoder.yudao.module.course.vo.CommissionExportVO;
|
||||
import cn.iocoder.yudao.module.train.entity.Train;
|
||||
import cn.iocoder.yudao.module.train.vo.NoClockInRemindVO;
|
||||
import cn.iocoder.yudao.module.train.vo.TrainExportVO;
|
||||
import cn.iocoder.yudao.module.train.vo.TrainVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -97,4 +99,16 @@ public interface TrainService extends IService<Train> {
|
||||
* 根据教练打卡id,获取对应学员列表信息
|
||||
*/
|
||||
List<Train> getTrainStudentList(String coachClockId);
|
||||
|
||||
/**
|
||||
* 获取学员导出数据列表
|
||||
*/
|
||||
IPage<TrainExportVO> getExportList(TrainExportVO exportVO, Page<TrainExportVO> page);
|
||||
|
||||
/**
|
||||
* 三种导出
|
||||
*/
|
||||
List<TrainExportVO> getTrainList(TrainExportVO exportVO);
|
||||
List<TrainExportVO> getAllTrainList(TrainExportVO exportVO);
|
||||
List<TrainExportVO> getTrainListByRange(TrainExportVO exportVO);
|
||||
}
|
||||
|
@ -4,26 +4,27 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.iocoder.yudao.module.base.constant.SchoolBaseConstants;
|
||||
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolCoach;
|
||||
import cn.iocoder.yudao.module.base.service.SchoolNotifyMessageSendService;
|
||||
import cn.iocoder.yudao.module.base.vo.BusinessRecordExportVO;
|
||||
import cn.iocoder.yudao.module.course.entity.Process;
|
||||
import cn.iocoder.yudao.module.train.entity.DriveSchoolCoachClock;
|
||||
import cn.iocoder.yudao.module.train.entity.Train;
|
||||
import cn.iocoder.yudao.module.train.mapper.DriveSchoolCoachClockMapper;
|
||||
import cn.iocoder.yudao.module.train.mapper.TrainMapper;
|
||||
import cn.iocoder.yudao.module.train.service.IDriveSchoolCoachClockService;
|
||||
import cn.iocoder.yudao.module.train.vo.DriveSchoolCoachClockVO;
|
||||
import cn.iocoder.yudao.module.train.vo.NoClockInRemindVO;
|
||||
import cn.iocoder.yudao.module.train.vo.TrainCarCountVO;
|
||||
import cn.iocoder.yudao.module.train.vo.TrainDetailsByCarVO;
|
||||
import cn.iocoder.yudao.module.train.vo.*;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
@ -248,6 +249,42 @@ public class DriveSchoolCoachClockServiceImpl extends ServiceImpl<DriveSchoolCoa
|
||||
return trainDetailsByCarVOList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CloakAndTrainCountVO getCloakAndTrainCount(CloakAndTrainCountVO cloakAndTrainCountVO) {
|
||||
String startTime = "";
|
||||
String endTime = "";
|
||||
if ("more".equals(cloakAndTrainCountVO.getTimeType())) {
|
||||
if (StringUtils.isNotEmpty(cloakAndTrainCountVO.getTrainStartTimeStr())) {
|
||||
startTime = cloakAndTrainCountVO.getTrainStartTimeStr();
|
||||
}
|
||||
if (StringUtils.isNotEmpty(cloakAndTrainCountVO.getTrainEndTimeStr())) {
|
||||
endTime = cloakAndTrainCountVO.getTrainEndTimeStr();
|
||||
}
|
||||
} else if ("month".equals(cloakAndTrainCountVO.getTimeType())) {
|
||||
//当月
|
||||
startTime = DateUtil.format(DateUtil.beginOfMonth(DateUtil.date()), "yyyy-MM-dd");
|
||||
endTime = DateUtil.format(DateUtil.endOfMonth(DateUtil.date()), "yyyy-MM-dd");
|
||||
} else if ("day".equals(cloakAndTrainCountVO.getTimeType())) {
|
||||
//当天
|
||||
startTime = DateUtil.formatDate(DateUtil.date());
|
||||
endTime = DateUtil.formatDate(DateUtil.date());
|
||||
}
|
||||
cloakAndTrainCountVO.setTrainStartTimeStr(startTime);
|
||||
cloakAndTrainCountVO.setTrainEndTimeStr(endTime);
|
||||
|
||||
CloakAndTrainCountVO trainStudentCount = driveSchoolCoachClockMapper.getTrainStudentCount(cloakAndTrainCountVO);
|
||||
CloakAndTrainCountVO trainCarCount = driveSchoolCoachClockMapper.getTrainCarCount(cloakAndTrainCountVO);
|
||||
CloakAndTrainCountVO returnCount = new CloakAndTrainCountVO();
|
||||
returnCount.setTotalStudentCount(trainStudentCount.getTotalStudentCount());
|
||||
returnCount.setSubject2StudentCount(trainStudentCount.getSubject2StudentCount());
|
||||
returnCount.setSubject3StudentCount(trainStudentCount.getSubject3StudentCount());
|
||||
returnCount.setTotalCarCount(trainCarCount.getTotalCarCount());
|
||||
returnCount.setSubject2CarCount(trainCarCount.getSubject2CarCount());
|
||||
returnCount.setSubject3CarCount(trainCarCount.getSubject3CarCount());
|
||||
|
||||
return returnCount;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 每天晚上7点提醒未进行离场打卡的教练进行打卡
|
||||
@ -262,4 +299,140 @@ public class DriveSchoolCoachClockServiceImpl extends ServiceImpl<DriveSchoolCoa
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出数据获取
|
||||
*/
|
||||
@Override
|
||||
public IPage<CoachClockExportVO> coachClockAll(CoachClockExportVO exportVO, Page<CoachClockExportVO> page) {
|
||||
String startTime = "";
|
||||
String endTime = "";
|
||||
|
||||
if ("more".equals(exportVO.getTimeType())) {
|
||||
if (StringUtils.isNotEmpty(exportVO.getTrainStartTimeStr())) {
|
||||
startTime = exportVO.getTrainStartTimeStr();
|
||||
}
|
||||
if (StringUtils.isNotEmpty(exportVO.getTrainEndTimeStr())) {
|
||||
endTime = exportVO.getTrainEndTimeStr();
|
||||
}
|
||||
} else if ("month".equals(exportVO.getTimeType())) {
|
||||
//当月
|
||||
startTime = DateUtil.format(DateUtil.beginOfMonth(DateUtil.date()), "yyyy-MM-dd");
|
||||
endTime = DateUtil.format(DateUtil.endOfMonth(DateUtil.date()), "yyyy-MM-dd");
|
||||
} else if ("day".equals(exportVO.getTimeType())) {
|
||||
//当天
|
||||
startTime = DateUtil.formatDate(DateUtil.date());
|
||||
endTime = DateUtil.formatDate(DateUtil.date());
|
||||
}
|
||||
|
||||
exportVO.setTrainStartTimeStr(startTime);
|
||||
exportVO.setTrainEndTimeStr(endTime);
|
||||
|
||||
IPage<CoachClockExportVO> coachClockExportVOIPage = driveSchoolCoachClockMapper.coachClockExport(exportVO, page);
|
||||
List<CoachClockExportVO> records = coachClockExportVOIPage.getRecords();
|
||||
|
||||
List<CoachClockExportVO> resultList = new ArrayList<>(records.size());
|
||||
|
||||
for (CoachClockExportVO record : records) {
|
||||
List<Train> studentTrainList = trainMapper.selectStudentByCoachClockId(record.getId());
|
||||
CoachClockExportVO resultVO = new CoachClockExportVO();
|
||||
BeanUtils.copyProperties(record, resultVO);
|
||||
resultVO.setStudentTrainList(studentTrainList);
|
||||
|
||||
resultList.add(resultVO);
|
||||
}
|
||||
|
||||
return coachClockExportVOIPage.setRecords(resultList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出的三种形式
|
||||
* @param exportVO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<CoachClockExportVO> getCoachClockRecordList(CoachClockExportVO exportVO) {
|
||||
Page<CoachClockExportVO> page = new Page<>(exportVO.getPageNo(), exportVO.getPageSize());
|
||||
IPage<CoachClockExportVO> result = driveSchoolCoachClockMapper.coachClockExport(exportVO, page);
|
||||
List<CoachClockExportVO> records = result.getRecords();
|
||||
|
||||
// 对每条记录追加 studentTrainList 和 studentTrainStr
|
||||
return enrichCoachClockExport(records);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CoachClockExportVO> getAllCoachClockRecordList(CoachClockExportVO exportVO) {
|
||||
Page<CoachClockExportVO> page = new Page<>(1, Integer.MAX_VALUE);
|
||||
IPage<CoachClockExportVO> result = driveSchoolCoachClockMapper.coachClockExport(exportVO, page);
|
||||
List<CoachClockExportVO> records = result.getRecords();
|
||||
|
||||
return enrichCoachClockExport(records);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CoachClockExportVO> getCoachClockListByRange(CoachClockExportVO exportVO) {
|
||||
List<CoachClockExportVO> allData = new ArrayList<>();
|
||||
|
||||
for (int i = exportVO.getStartPage(); i <= exportVO.getEndPage(); i++) {
|
||||
Page<CoachClockExportVO> page = new Page<>(i, exportVO.getPageSize());
|
||||
IPage<CoachClockExportVO> result = driveSchoolCoachClockMapper.coachClockExport(exportVO, page);
|
||||
List<CoachClockExportVO> records = result.getRecords();
|
||||
allData.addAll(records);
|
||||
|
||||
if (i >= result.getPages()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return enrichCoachClockExport(allData);
|
||||
}
|
||||
|
||||
private List<CoachClockExportVO> enrichCoachClockExport(List<CoachClockExportVO> records) {
|
||||
for (CoachClockExportVO record : records) {
|
||||
List<Train> studentTrainList = trainMapper.selectStudentByCoachClockId(record.getId());
|
||||
record.setStudentTrainList(studentTrainList);
|
||||
|
||||
if (studentTrainList != null && !studentTrainList.isEmpty()) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
|
||||
for (Train train : studentTrainList) {
|
||||
String subjectStr = convertSubjectToStr(train.getSubject());
|
||||
String userName = train.getUserName() != null ? train.getUserName() : "";
|
||||
String carNo = train.getCarNo() != null ? train.getCarNo() : "";
|
||||
String startTimeStr = train.getStartTime() != null ? sdf.format(train.getStartTime()) : "";
|
||||
String endTimeStr = train.getEndTime() != null ? sdf.format(train.getEndTime()) : "";
|
||||
String trainTimeStr = train.getTrainTime() != null ? train.getTrainTime().intValue() + " 分钟" : "0 分钟";
|
||||
|
||||
// 学员排在科目前面
|
||||
sb.append(" ").append(userName)
|
||||
.append(" | ").append(subjectStr)
|
||||
.append(" | ").append(carNo)
|
||||
.append(" | 到场:").append(startTimeStr)
|
||||
.append(" | 离场:").append(endTimeStr)
|
||||
.append(" | 训练时长:").append(trainTimeStr)
|
||||
.append("\n");
|
||||
}
|
||||
|
||||
record.setStudentTrainStr(sb.toString().trim());
|
||||
}
|
||||
}
|
||||
|
||||
return records;
|
||||
}
|
||||
|
||||
private String convertSubjectToStr(Integer subject) {
|
||||
if (subject == null) {
|
||||
return "未知科目";
|
||||
}
|
||||
switch (subject) {
|
||||
case 1: return "科目一";
|
||||
case 2: return "科目二";
|
||||
case 3: return "科目三";
|
||||
case 4: return "科目四";
|
||||
default: return "未知科目";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -7,10 +7,12 @@ import cn.iocoder.yudao.module.base.constant.SchoolBaseConstants;
|
||||
import cn.iocoder.yudao.module.base.service.SchoolNotifyMessageSendService;
|
||||
import cn.iocoder.yudao.module.course.entity.Process;
|
||||
import cn.iocoder.yudao.module.course.service.ProcessService;
|
||||
import cn.iocoder.yudao.module.course.vo.CommissionExportVO;
|
||||
import cn.iocoder.yudao.module.train.entity.Train;
|
||||
import cn.iocoder.yudao.module.train.mapper.TrainMapper;
|
||||
import cn.iocoder.yudao.module.train.service.TrainService;
|
||||
import cn.iocoder.yudao.module.train.vo.NoClockInRemindVO;
|
||||
import cn.iocoder.yudao.module.train.vo.TrainExportVO;
|
||||
import cn.iocoder.yudao.module.train.vo.TrainVO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -21,6 +23,7 @@ import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@ -205,4 +208,50 @@ public class TrainServiceImpl extends ServiceImpl<TrainMapper, Train> implements
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取学员导出数据列表
|
||||
*/
|
||||
@Override
|
||||
public IPage<TrainExportVO> getExportList(TrainExportVO exportVO, Page<TrainExportVO> page) {
|
||||
return trainMapper.getExportList(exportVO,page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 三种导出
|
||||
*/
|
||||
@Override
|
||||
public List<TrainExportVO> getTrainList(TrainExportVO exportVO) {
|
||||
// 分页查询当前页
|
||||
Page<TrainExportVO> page = new Page<>(exportVO.getPageNo(), exportVO.getPageSize());
|
||||
IPage<TrainExportVO> result = trainMapper.getExportList(exportVO, page);
|
||||
return result.getRecords();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TrainExportVO> getAllTrainList(TrainExportVO exportVO) {
|
||||
// 不分页查询全部数据
|
||||
Page<TrainExportVO> page = new Page<>(1, Integer.MAX_VALUE);
|
||||
IPage<TrainExportVO> result = trainMapper.getExportList(exportVO, page);
|
||||
return result.getRecords();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TrainExportVO> getTrainListByRange(TrainExportVO exportVO) {
|
||||
List<TrainExportVO> allData = new ArrayList<>();
|
||||
|
||||
// 循环查询指定范围内的数据
|
||||
for (int i = exportVO.getStartPage(); i <= exportVO.getEndPage(); i++) {
|
||||
Page<TrainExportVO> page = new Page<>(i, exportVO.getPageSize());
|
||||
IPage<TrainExportVO> result = trainMapper.getExportList(exportVO, page);
|
||||
allData.addAll(result.getRecords());
|
||||
|
||||
if (i >= result.getPages()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return allData;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,52 @@
|
||||
package cn.iocoder.yudao.module.train.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CloakAndTrainCountVO {
|
||||
|
||||
/** 总人次 */
|
||||
private String totalStudentCount;
|
||||
|
||||
/** 科目二人次 */
|
||||
private String subject2StudentCount;
|
||||
|
||||
/** 科目三人次 */
|
||||
private String subject3StudentCount;
|
||||
|
||||
/** 总台次 */
|
||||
private String totalCarCount;
|
||||
|
||||
/** 科目二台次 */
|
||||
private String subject2CarCount;
|
||||
|
||||
/** 科目三台次 */
|
||||
private String subject3CarCount;
|
||||
|
||||
/** 查询的时间类型 */
|
||||
private String timeType;
|
||||
|
||||
/** 教练id */
|
||||
private Long coachId;
|
||||
|
||||
/** 查询的开始时间 */
|
||||
private String trainStartTimeStr;
|
||||
|
||||
/** 查询的结束时间 */
|
||||
private String trainEndTimeStr;
|
||||
|
||||
/** 车辆的id */
|
||||
private String carId;
|
||||
|
||||
/** 车牌号 */
|
||||
private String carNo;
|
||||
|
||||
/** 教练姓名 */
|
||||
private String userName;
|
||||
|
||||
/** 打卡的科目 */
|
||||
private Integer subject;
|
||||
|
||||
private String userMobile;
|
||||
|
||||
}
|
@ -0,0 +1,144 @@
|
||||
package cn.iocoder.yudao.module.train.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.train.entity.Train;
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class CoachClockExportVO {
|
||||
|
||||
@ExcelIgnore
|
||||
private String id;
|
||||
|
||||
@ExcelIgnore
|
||||
private Long coachId;
|
||||
|
||||
@ExcelProperty(value = "教练", index = 0)
|
||||
private String coachName;
|
||||
|
||||
@ExcelProperty(value = "教练手机号", index = 1)
|
||||
private String coachPhone;
|
||||
|
||||
@ExcelProperty(value = "科目", index = 2)
|
||||
private String subjectStr;
|
||||
|
||||
@ExcelIgnore
|
||||
private Integer subject;
|
||||
|
||||
public void setSubject(Integer subject) {
|
||||
this.subject = subject;
|
||||
this.subjectStr = convertSubjectToStr(subject);
|
||||
}
|
||||
|
||||
private String convertSubjectToStr(Integer subject) {
|
||||
if (subject == null) {
|
||||
return "";
|
||||
}
|
||||
switch (subject) {
|
||||
case 1: return "科目一";
|
||||
case 2: return "科目二";
|
||||
case 3: return "科目三";
|
||||
case 4: return "科目四";
|
||||
default: return "未知科目";
|
||||
}
|
||||
}
|
||||
|
||||
@ExcelIgnore
|
||||
private String carId;
|
||||
|
||||
@ExcelProperty(value = "车牌号", index = 3)
|
||||
private String carNo;
|
||||
|
||||
@ExcelProperty(value = "训练日期", index = 4)
|
||||
private String trainDay;
|
||||
|
||||
@ExcelProperty(value = "训练地址", index = 5)
|
||||
private String addr;
|
||||
|
||||
@ExcelProperty(value = "到场时间", index = 6)
|
||||
private String startTimeStr;
|
||||
|
||||
@ExcelIgnore
|
||||
private LocalDateTime startTime;
|
||||
|
||||
public void setStartTime(LocalDateTime startTime) {
|
||||
this.startTime = startTime;
|
||||
if (startTime != null) {
|
||||
this.startTimeStr = startTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"));
|
||||
}
|
||||
}
|
||||
|
||||
@ExcelProperty(value = "到场备注", index = 7)
|
||||
private String startRemark;
|
||||
|
||||
@ExcelProperty(value = "离场时间", index = 8)
|
||||
private String endTimeStr;
|
||||
|
||||
@ExcelIgnore
|
||||
private LocalDateTime endTime;
|
||||
|
||||
public void setEndTime(LocalDateTime endTime) {
|
||||
this.endTime = endTime;
|
||||
if (endTime != null) {
|
||||
this.endTimeStr = endTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"));
|
||||
}
|
||||
}
|
||||
|
||||
@ExcelProperty(value = "离场备注", index = 9)
|
||||
private String endRemark;
|
||||
|
||||
@ExcelProperty(value = "训练时长(分钟)", index = 10)
|
||||
private Double trainTime;
|
||||
|
||||
@ExcelProperty(value = "学员训练记录", index = 11)
|
||||
private String studentTrainStr;
|
||||
|
||||
@ExcelIgnore
|
||||
private List<Train> studentTrainList;
|
||||
|
||||
@ExcelIgnore
|
||||
private String startImages;
|
||||
|
||||
@ExcelIgnore
|
||||
private String endImages;
|
||||
|
||||
|
||||
@ExcelIgnore
|
||||
private String trainStartTimeStr;
|
||||
@ExcelIgnore
|
||||
private String trainEndTimeStr;
|
||||
|
||||
@ExcelIgnore
|
||||
private String timeType;
|
||||
|
||||
/**
|
||||
* 分页参数
|
||||
*/
|
||||
@ExcelIgnore
|
||||
private Integer pageNo = 1;
|
||||
@ExcelIgnore
|
||||
private Integer pageSize = 10;
|
||||
|
||||
/**
|
||||
* 导出类型:all(全部)、current(当前页)、range(自定义范围)
|
||||
*/
|
||||
@ExcelIgnore
|
||||
private String exportType;
|
||||
|
||||
/**
|
||||
* 自定义范围参数
|
||||
*/
|
||||
@ExcelIgnore
|
||||
private Integer startPage;
|
||||
@ExcelIgnore
|
||||
private Integer endPage;
|
||||
|
||||
|
||||
}
|
@ -44,6 +44,12 @@ public class TrainCarCountVO {
|
||||
/** 训练总时长 */
|
||||
private String trainTimeCount;
|
||||
|
||||
/** 科目二时长 */
|
||||
private String subject2TrainTime;
|
||||
|
||||
/** 科目三时长 */
|
||||
private String subject3TrainTime;
|
||||
|
||||
/** 总学员数 */
|
||||
private String studentCount;
|
||||
}
|
||||
|
@ -0,0 +1,139 @@
|
||||
package cn.iocoder.yudao.module.train.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.train.entity.Train;
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class TrainExportVO {
|
||||
|
||||
@ExcelIgnore
|
||||
private String id;
|
||||
|
||||
@ExcelIgnore
|
||||
private Long userId;
|
||||
|
||||
@ExcelProperty(value = "学员", index = 0)
|
||||
private String userName;
|
||||
|
||||
@ExcelProperty(value = "学员手机号", index = 1)
|
||||
private String userMobile;
|
||||
|
||||
@ExcelIgnore
|
||||
private Long coachId;
|
||||
|
||||
@ExcelProperty(value = "课程", index = 2)
|
||||
private String courseName;
|
||||
|
||||
@ExcelProperty(value = "教练", index = 3)
|
||||
private String coachName;
|
||||
|
||||
@ExcelProperty(value = "科目", index = 4)
|
||||
private String subjectStr;
|
||||
|
||||
@ExcelIgnore
|
||||
private Integer subject;
|
||||
|
||||
public void setSubject(Integer subject) {
|
||||
this.subject = subject;
|
||||
this.subjectStr = convertSubjectToStr(subject);
|
||||
}
|
||||
|
||||
private String convertSubjectToStr(Integer subject) {
|
||||
if (subject == null) {
|
||||
return "";
|
||||
}
|
||||
switch (subject) {
|
||||
case 1: return "科目一";
|
||||
case 2: return "科目二";
|
||||
case 3: return "科目三";
|
||||
case 4: return "科目四";
|
||||
default: return "未知科目";
|
||||
}
|
||||
}
|
||||
|
||||
@ExcelIgnore
|
||||
private String carId;
|
||||
|
||||
@ExcelProperty(value = "车牌号", index = 5)
|
||||
private String carNo;
|
||||
|
||||
@ExcelProperty(value = "训练日期", index = 6)
|
||||
private String trainDay;
|
||||
|
||||
@ExcelProperty(value = "训练地址", index = 7)
|
||||
private String addr;
|
||||
|
||||
@ExcelProperty(value = "到场时间", index = 8)
|
||||
private String startTimeStr;
|
||||
|
||||
@ExcelIgnore
|
||||
private LocalDateTime startTime;
|
||||
|
||||
public void setStartTime(LocalDateTime startTime) {
|
||||
this.startTime = startTime;
|
||||
if (startTime != null) {
|
||||
this.startTimeStr = startTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"));
|
||||
}
|
||||
}
|
||||
|
||||
@ExcelProperty(value = "到场备注", index = 9)
|
||||
private String startRemark;
|
||||
|
||||
@ExcelProperty(value = "离场时间", index = 10)
|
||||
private String endTimeStr;
|
||||
|
||||
@ExcelIgnore
|
||||
private LocalDateTime endTime;
|
||||
|
||||
public void setEndTime(LocalDateTime endTime) {
|
||||
this.endTime = endTime;
|
||||
if (endTime != null) {
|
||||
this.endTimeStr = endTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"));
|
||||
}
|
||||
}
|
||||
|
||||
@ExcelProperty(value = "离场备注", index = 11)
|
||||
private String endRemark;
|
||||
|
||||
@ExcelProperty(value = "训练时长(分钟)", index = 12)
|
||||
private Double trainTime;
|
||||
|
||||
|
||||
@ExcelIgnore
|
||||
private String trainStartTimeStr;
|
||||
@ExcelIgnore
|
||||
private String trainEndTimeStr;
|
||||
|
||||
@ExcelIgnore
|
||||
private String timeType;
|
||||
|
||||
/**
|
||||
* 分页参数
|
||||
*/
|
||||
@ExcelIgnore
|
||||
private Integer pageNo = 1;
|
||||
@ExcelIgnore
|
||||
private Integer pageSize = 10;
|
||||
|
||||
/**
|
||||
* 导出类型:all(全部)、current(当前页)、range(自定义范围)
|
||||
*/
|
||||
@ExcelIgnore
|
||||
private String exportType;
|
||||
|
||||
/**
|
||||
* 自定义范围参数
|
||||
*/
|
||||
@ExcelIgnore
|
||||
private Integer startPage;
|
||||
@ExcelIgnore
|
||||
private Integer endPage;
|
||||
|
||||
|
||||
}
|
@ -43,6 +43,9 @@
|
||||
<if test="entity.userId != null">
|
||||
AND user_id = #{entity.userId}
|
||||
</if>
|
||||
<if test="entity.carNo != null and entity.carNo != '' ">
|
||||
AND car_no = #{entity.carNo}
|
||||
</if>
|
||||
<if test="entity.trainDayStartTime != null and entity.trainDayStartTime != '' ">
|
||||
AND train_day >= #{entity.trainDayStartTime}
|
||||
</if>
|
||||
@ -60,7 +63,9 @@
|
||||
SUM(CASE WHEN dscc.subject = 2 THEN 1 ELSE 0 END) AS subject2Count,
|
||||
SUM(CASE WHEN dscc.subject = 3 THEN 1 ELSE 0 END) AS subject3Count,
|
||||
SUM(dscc.train_time) AS trainTimeCount,
|
||||
COUNT(dst.coach_clock_id) AS studentCount
|
||||
COUNT(dst.coach_clock_id) AS studentCount,
|
||||
SUM(CASE WHEN dscc.subject = 2 THEN dscc.train_time ELSE 0 END) AS subject2TrainTime,
|
||||
SUM(CASE WHEN dscc.subject = 3 THEN dscc.train_time ELSE 0 END) AS subject3TrainTime
|
||||
FROM
|
||||
drive_school_coach_clock dscc
|
||||
LEFT JOIN
|
||||
@ -104,7 +109,8 @@
|
||||
start_time,
|
||||
end_time,
|
||||
car_id,
|
||||
car_no
|
||||
car_no,
|
||||
train_time
|
||||
FROM drive_school_coach_clock
|
||||
WHERE
|
||||
car_id = #{entity.carId}
|
||||
@ -122,7 +128,7 @@
|
||||
</select>
|
||||
|
||||
<select id="noClockInRemind" resultType="cn.iocoder.yudao.module.train.entity.DriveSchoolCoachClock">
|
||||
SELECT user_id
|
||||
SELECT user_id,tenant_id
|
||||
FROM drive_school_coach_clock
|
||||
WHERE
|
||||
DATE (create_time) = CURDATE()
|
||||
@ -130,4 +136,103 @@
|
||||
AND end_time IS NULL
|
||||
AND deleted = 0
|
||||
</select>
|
||||
|
||||
|
||||
<select id="coachClockExport" resultType="cn.iocoder.yudao.module.train.vo.CoachClockExportVO">
|
||||
SELECT
|
||||
id,
|
||||
user_name AS coachName,
|
||||
user_mobile AS coachPhone,
|
||||
car_no,
|
||||
subject,
|
||||
addr,
|
||||
train_day,
|
||||
start_time,
|
||||
start_remark,
|
||||
end_time,
|
||||
end_remark,
|
||||
train_time,
|
||||
start_images,
|
||||
end_images
|
||||
FROM drive_school_coach_clock
|
||||
WHERE deleted = 0
|
||||
<if test="entity.coachId != null">
|
||||
AND user_id = #{entity.coachId}
|
||||
</if>
|
||||
<if test="entity.carNo != null and entity.carNo != ''">
|
||||
AND car_no = #{entity.carNo}
|
||||
</if>
|
||||
<if test="entity.subject!= null">
|
||||
AND subject = #{entity.subject}
|
||||
</if>
|
||||
<if test="entity.trainStartTimeStr != null and entity.trainStartTimeStr != '' ">
|
||||
AND train_day >= #{entity.trainStartTimeStr}
|
||||
</if>
|
||||
<if test="entity.trainEndTimeStr != null and entity.trainEndTimeStr != '' ">
|
||||
AND train_day <= #{entity.trainEndTimeStr}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getTrainStudentCount" resultType="cn.iocoder.yudao.module.train.vo.CloakAndTrainCountVO">
|
||||
SELECT
|
||||
COALESCE(COUNT(*), 0) AS totalStudentCount,
|
||||
COALESCE(SUM(CASE WHEN subject = 2 THEN 1 ELSE 0 END), 0) AS subject2StudentCount,
|
||||
COALESCE(SUM(CASE WHEN subject = 3 THEN 1 ELSE 0 END), 0) AS subject3StudentCount
|
||||
FROM
|
||||
drive_school_train
|
||||
WHERE
|
||||
deleted = 0
|
||||
AND subject IS NOT NULL
|
||||
AND user_id IS NOT NULL
|
||||
AND course_id IS NOT NULL
|
||||
<if test="entity.coachId != null">
|
||||
AND coach_id = #{entity.coachId}
|
||||
</if>
|
||||
<if test="entity.userName != null and entity.userName != '' ">
|
||||
AND user_name like CONCAT('%', #{entity.userName}, '%')
|
||||
</if>
|
||||
<if test="entity.userMobile != null and entity.userMobile != '' ">
|
||||
AND user_mobile like CONCAT('%', #{entity.userMobile}, '%')
|
||||
</if>
|
||||
<if test="entity.subject!= null">
|
||||
AND subject = #{entity.subject}
|
||||
</if>
|
||||
<if test="entity.carNo != null and entity.carNo != '' ">
|
||||
AND car_no = #{entity.carNo}
|
||||
</if>
|
||||
<if test="entity.trainStartTimeStr!=null and entity.trainStartTimeStr!=''">
|
||||
AND create_time >= #{entity.trainStartTimeStr}
|
||||
</if>
|
||||
<if test="entity.trainEndTimeStr!=null and entity.trainEndTimeStr!=''">
|
||||
AND create_time <= #{entity.trainEndTimeStr}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getTrainCarCount" resultType="cn.iocoder.yudao.module.train.vo.CloakAndTrainCountVO">
|
||||
SELECT
|
||||
COALESCE(SUM(CASE WHEN subject = 2 THEN 1 ELSE 0 END), 0) AS subject2CarCount,
|
||||
COALESCE(SUM(CASE WHEN subject = 3 THEN 1 ELSE 0 END), 0) AS subject3CarCount,
|
||||
COALESCE(COUNT(*), 0) AS totalCarCount
|
||||
FROM
|
||||
drive_school_coach_clock
|
||||
WHERE
|
||||
deleted = 0
|
||||
AND subject IN (2, 3)
|
||||
<if test="entity.coachId != null">
|
||||
AND user_id = #{entity.coachId}
|
||||
</if>
|
||||
<if test="entity.subject!= null">
|
||||
AND subject = #{entity.subject}
|
||||
</if>
|
||||
<if test="entity.carNo != null and entity.carNo != '' ">
|
||||
AND car_no = #{entity.carNo}
|
||||
</if>
|
||||
<if test="entity.trainStartTimeStr != null and entity.trainStartTimeStr != '' ">
|
||||
AND train_day >= #{entity.trainStartTimeStr}
|
||||
</if>
|
||||
<if test="entity.trainEndTimeStr != null and entity.trainEndTimeStr != '' ">
|
||||
AND train_day <= #{entity.trainEndTimeStr}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -57,12 +57,12 @@
|
||||
COALESCE(SUM(CASE WHEN subject = 2 THEN 1 ELSE 0 END), 0) AS subject2Count,
|
||||
COALESCE(SUM(CASE WHEN subject = 3 THEN 1 ELSE 0 END), 0) AS subject3Count
|
||||
FROM
|
||||
drive_school_train
|
||||
drive_school_train
|
||||
WHERE
|
||||
deleted = 0
|
||||
AND subject IS NOT NULL
|
||||
AND user_id IS NOT NULL
|
||||
AND course_id IS NOT NULL
|
||||
deleted = 0
|
||||
AND subject IS NOT NULL
|
||||
AND user_id IS NOT NULL
|
||||
AND course_id IS NOT NULL
|
||||
<if test="coachId != null and coachId != ''">
|
||||
AND coach_id = #{coachId}
|
||||
</if>
|
||||
@ -149,7 +149,10 @@
|
||||
SELECT
|
||||
subject,
|
||||
user_name,
|
||||
train_time
|
||||
train_time,
|
||||
start_time,
|
||||
end_time,
|
||||
car_no
|
||||
FROM drive_school_train
|
||||
WHERE
|
||||
deleted = 0
|
||||
@ -158,4 +161,50 @@
|
||||
</if>
|
||||
ORDER BY train_time DESC
|
||||
</select>
|
||||
|
||||
<select id="getExportList" resultType="cn.iocoder.yudao.module.train.vo.TrainExportVO">
|
||||
SELECT
|
||||
id,
|
||||
user_id,
|
||||
user_name,
|
||||
user_mobile,
|
||||
course_name,
|
||||
coach_id,
|
||||
coach_name,
|
||||
subject,
|
||||
train_day,
|
||||
train_time,
|
||||
start_time,
|
||||
end_time,
|
||||
start_remark,
|
||||
end_remark,
|
||||
car_no,
|
||||
addr
|
||||
FROM drive_school_train
|
||||
WHERE deleted = 0
|
||||
AND subject IS NOT NULL
|
||||
AND user_id IS NOT NULL
|
||||
AND course_id IS NOT NULL
|
||||
<if test="entity.coachId != null and entity.coachId != ''">
|
||||
AND coach_id = #{entity.coachId}
|
||||
</if>
|
||||
<if test="entity.userName != null and entity.userName != ''">
|
||||
AND user_name like concat('%',#{entity.userName},'%')
|
||||
</if>
|
||||
<if test="entity.userMobile != null and entity.userMobile != ''">
|
||||
AND user_mobile like concat('%',#{entity.userMobile},'%')
|
||||
</if>
|
||||
<if test="entity.carNo != null and entity.carNo != '' ">
|
||||
AND car_no = #{entity.carNo}
|
||||
</if>
|
||||
<if test="entity.subject != null ">
|
||||
AND subject = #{entity.subject}
|
||||
</if>
|
||||
<if test="entity.trainStartTimeStr != null and entity.trainStartTimeStr != ''">
|
||||
AND train_day >= #{entity.trainStartTimeStr}
|
||||
</if>
|
||||
<if test="entity.trainEndTimeStr != null and entity.trainEndTimeStr != ''">
|
||||
AND train_day <= #{entity.trainEndTimeStr}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue
Block a user