This commit is contained in:
Lx 2025-04-07 18:04:12 +08:00
parent 12bc14b955
commit 3b72d882fa
12 changed files with 99 additions and 5 deletions

View File

@ -4,11 +4,14 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.module.base.service.DlDriveSchoolCourseService;
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolCourseVO;
import cn.iocoder.yudao.module.jx.domain.DriveSchoolPhone;
import cn.iocoder.yudao.module.jx.service.IDriveSchoolPhoneService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -28,6 +31,9 @@ public class DriveSchoolCourseSmallController {
@Resource
private DlDriveSchoolCourseService courseService;
@Autowired
private IDriveSchoolPhoneService driveSchoolPhoneService;
/**
* 分页获取课程信息
*
@ -79,4 +85,15 @@ public class DriveSchoolCourseSmallController {
public CommonResult<DlDriveSchoolCourseVO> getDlDriveSchoolCoach(@RequestParam("id") String id) {
return success(courseService.queryDetailById(id));
}
/**
* 获取驾校客服电话
*/
@GetMapping("/getServicePhone")
@TenantIgnore
public CommonResult<DriveSchoolPhone> getServicePhone(@RequestParam("tenantId") String tenantId) {
return success(driveSchoolPhoneService.getServicePhoneByTenantId(tenantId));
}
}

View File

@ -73,7 +73,7 @@ public class SchoolCourseOrderSmallProgramController {
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
Page<SchoolCommissionVO> page = new Page<>(pageNo, pageSize);
return success(schoolCourseOrderService.queryPage(page, pageReqVO));
return success(schoolCourseOrderService.queryPageNew(page, pageReqVO));
}
/**

View File

@ -81,4 +81,9 @@ public class DlDriveSchoolCourse extends TenantBaseDO {
* 交付定金的优惠
*/
private double favour;
/**
* 课程详情
*/
private String details;
}

View File

@ -27,6 +27,7 @@ public interface SchoolCourseOrderMapper extends BaseMapper<SchoolCourseOrder> {
* @date 10:11 2025/2/25
**/
IPage<SchoolCourseOrderVO> queryPage(@Param("entity")SchoolCourseOrderVO entity, Page<SchoolCommissionVO> page);
IPage<SchoolCourseOrderVO> queryPageNew(@Param("entity")SchoolCourseOrderVO entity, Page<SchoolCommissionVO> page);
/**
*
@ -38,4 +39,4 @@ public interface SchoolCourseOrderMapper extends BaseMapper<SchoolCourseOrder> {
* @return java.util.List<cn.iocoder.yudao.module.course.vo.SchoolCourseOrderVO>
**/
Double selectByCoachUserId(@Param("coachId")Long coachId,@Param("startTime")String startTime,@Param("endTime")String endTime);
}
}

View File

@ -61,6 +61,7 @@ public interface SchoolCourseOrderService extends IService<SchoolCourseOrder> {
* @date 10:10 2025/2/25
**/
IPage<SchoolCourseOrderVO> queryPage(Page<SchoolCommissionVO> page, SchoolCourseOrderVO pageReqVO);
IPage<SchoolCourseOrderVO> queryPageNew(Page<SchoolCommissionVO> page, SchoolCourseOrderVO pageReqVO);
/**
* 终止订单
@ -86,4 +87,4 @@ public interface SchoolCourseOrderService extends IService<SchoolCourseOrder> {
* @return List<SchoolCourseOrderVO>
*/
List<SchoolCourseOrderVO> getCourseByLoginUser(Long loginUserId);
}
}

View File

@ -81,6 +81,10 @@ public class SchoolCourseOrderServiceImpl extends ServiceImpl<SchoolCourseOrderM
public IPage<SchoolCourseOrderVO> queryPage(Page<SchoolCommissionVO> page, SchoolCourseOrderVO pageReqVO) {
return schoolCourseOrderMapper.queryPage(pageReqVO,page);
}
@Override
public IPage<SchoolCourseOrderVO> queryPageNew(Page<SchoolCommissionVO> page, SchoolCourseOrderVO pageReqVO) {
return schoolCourseOrderMapper.queryPageNew(pageReqVO,page);
}
/**
* 终止订单
@ -177,4 +181,4 @@ public class SchoolCourseOrderServiceImpl extends ServiceImpl<SchoolCourseOrderM
return "ORDER" + UUID.randomUUID().toString().replace("-", "").substring(0, 10);
}
}
}

View File

@ -11,4 +11,14 @@ import lombok.Data;
public class SchoolCourseOrderVO extends SchoolCourseOrder {
private Boolean isCreated;
}
/**
* 课程封面图
*/
private String photo;
/**
* 课程类型
*/
private String type;
}

View File

@ -68,4 +68,11 @@ public interface DriveSchoolPhoneMapper
public int deleteDriveSchoolPhoneByIds(Long[] ids);
DriveSchoolPhone getPhone(DriveSchoolPhone driveSchoolPhone);
/**
* 根据租户id查询客服电话
* @param tenantId
* @return
*/
DriveSchoolPhone getServicePhoneByTenantId(String tenantId);
}

View File

@ -63,4 +63,11 @@ public interface IDriveSchoolPhoneService
public int deleteDriveSchoolPhoneById(Long id);
DriveSchoolPhone getPhone(DriveSchoolPhone driveSchoolPhone);
/**
* 根据租户id查询客服电话
* @param tenantId
* @return
*/
DriveSchoolPhone getServicePhoneByTenantId(String tenantId);
}

View File

@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@ -128,4 +129,14 @@ public class DriveSchoolPhoneServiceImpl implements IDriveSchoolPhoneService
}
return driveSchoolPhoneMapper.getPhone(driveSchoolPhone);
}
/**
* 根据租户id查询客服电话
* @param tenantId
* @return
*/
@Override
public DriveSchoolPhone getServicePhoneByTenantId(String tenantId) {
return driveSchoolPhoneMapper.getServicePhoneByTenantId(tenantId);
}
}

View File

@ -31,6 +31,32 @@
</where>
order by main.create_time desc
</select>
<select id="queryPageNew" resultType="cn.iocoder.yudao.module.course.vo.SchoolCourseOrderVO">
SELECT
main.*,
ds.photo,
ds.type,
CASE
WHEN EXISTS (SELECT 1
FROM drive_school_course_order dsc
WHERE dsc.old_order_id = main.id and dsc.deleted = 0 and main.deleted = 0)
THEN TRUE
ELSE FALSE
END AS isCreated
FROM
drive_school_course_order main
LEFT JOIN drive_school_course ds on main.course_id = ds.id and ds.deleted = 0
<where>
main.deleted = 0
<if test="entity.orderNo!= null and entity.orderNo != ''"> and main.order_no = #{entity.orderNo}</if>
<if test="entity.userName != null and entity.userName != ''"> and main.user_name like concat('%', #{entity.userName}, '%')</if>
<if test="entity.userId != null and entity.userId != ''"> and main.user_id = #{entity.userId}</if>
<if test="entity.paymentStatus != null and entity.paymentStatus != ''"> and main.payment_status = #{entity.paymentStatus}</if>
<if test="entity.ifEnd != null and entity.ifEnd != ''"> and main.if_end = #{entity.ifEnd}</if>
</where>
order by main.create_time desc
</select>
<select id="selectByCoachUserId" resultType="java.lang.Double">
SELECT
SUM(dsco.reserve_money+dsco.rest_money )

View File

@ -93,4 +93,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ORDER BY RAND()
LIMIT 1;
</select>
<select id="getServicePhoneByTenantId" parameterType="String" resultMap="DriveSchoolPhoneResult">
<include refid="selectDriveSchoolPhoneVo"/>
WHERE tenant_id = #{tenantId} AND deleted = 0 LIMIT 1;
</select>
</mapper>