Merge branch 'dev' of http://122.51.230.86:3000/dianliang/lanan-system into dev
This commit is contained in:
commit
3bd5ad50a2
@ -46,6 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<include refid="selectPartnerCustomerInfoVo"/>
|
<include refid="selectPartnerCustomerInfoVo"/>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="pagePartnerCustomerInfoList"
|
<select id="pagePartnerCustomerInfoList"
|
||||||
resultType="cn.iocoder.yudao.module.partner.entity.PartnerCustomerInfo">
|
resultType="cn.iocoder.yudao.module.partner.entity.PartnerCustomerInfo">
|
||||||
select pci.*,
|
select pci.*,
|
||||||
|
@ -1,10 +1,13 @@
|
|||||||
package cn.iocoder.yudao.module.jx.controller.admin;
|
package cn.iocoder.yudao.module.jx.controller.admin;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
import cn.iocoder.yudao.module.jx.core.controller.BaseController;
|
import cn.iocoder.yudao.module.jx.core.controller.BaseController;
|
||||||
import cn.iocoder.yudao.module.jx.domain.DriveSchoolInfo;
|
import cn.iocoder.yudao.module.jx.domain.DriveSchoolInfo;
|
||||||
import cn.iocoder.yudao.module.jx.payment.vo.PayVo;
|
import cn.iocoder.yudao.module.jx.payment.vo.PayVo;
|
||||||
import cn.iocoder.yudao.module.jx.service.IDriveSchoolInfoService;
|
import cn.iocoder.yudao.module.jx.service.IDriveSchoolInfoService;
|
||||||
|
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||||
|
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -24,6 +27,8 @@ public class DriveSchoolInfoController extends BaseController
|
|||||||
{
|
{
|
||||||
@Resource
|
@Resource
|
||||||
private IDriveSchoolInfoService driveSchoolInfoService;
|
private IDriveSchoolInfoService driveSchoolInfoService;
|
||||||
|
@Resource
|
||||||
|
private AdminUserApi userApi;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询自己的订单
|
* 查询自己的订单
|
||||||
@ -81,7 +86,10 @@ public class DriveSchoolInfoController extends BaseController
|
|||||||
@GetMapping("/getSchoolInfoByDeptId")
|
@GetMapping("/getSchoolInfoByDeptId")
|
||||||
public CommonResult getSchoolInfoByDeptId()
|
public CommonResult getSchoolInfoByDeptId()
|
||||||
{
|
{
|
||||||
return CommonResult.success(driveSchoolInfoService.getSchoolInfoByDeptId());
|
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||||
|
AdminUserRespDTO sysUser = userApi.getUser(userId);
|
||||||
|
Long deptId = sysUser.getDeptId();
|
||||||
|
return success(driveSchoolInfoService.getSchoolInfoByDeptId(deptId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2,12 +2,16 @@ package cn.iocoder.yudao.module.jx.controller.admin;
|
|||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
import cn.iocoder.yudao.module.jx.core.controller.BaseController;
|
import cn.iocoder.yudao.module.jx.core.controller.BaseController;
|
||||||
|
import cn.iocoder.yudao.module.jx.domain.DriveSchoolSeparate;
|
||||||
import cn.iocoder.yudao.module.jx.domain.DriveSchoolSwiper;
|
import cn.iocoder.yudao.module.jx.domain.DriveSchoolSwiper;
|
||||||
import cn.iocoder.yudao.module.jx.service.IDriveSchoolSwiperService;
|
import cn.iocoder.yudao.module.jx.service.IDriveSchoolSwiperService;
|
||||||
import cn.iocoder.yudao.module.jx.utils.ExcelUtil;
|
import cn.iocoder.yudao.module.jx.utils.ExcelUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.security.PermitAll;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -35,13 +39,21 @@ public class DriveSchoolSwiperController extends BaseController
|
|||||||
return CommonResult.success(list);
|
return CommonResult.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询驾校-轮播图列表
|
||||||
|
*/
|
||||||
@GetMapping("/pclist")
|
@GetMapping("/pclist")
|
||||||
public CommonResult pclist(DriveSchoolSwiper driveSchoolSwiper)
|
@PermitAll
|
||||||
{
|
public CommonResult pclist(DriveSchoolSwiper driveSchoolSwiper) {
|
||||||
List<DriveSchoolSwiper> list = driveSchoolSwiperService.selectDriveSchoolSwiperPclist(driveSchoolSwiper);
|
Page<DriveSchoolSwiper> page = new Page<>(driveSchoolSwiper.getPageNum(), driveSchoolSwiper.getPageSize());
|
||||||
return CommonResult.success(list);
|
IPage<DriveSchoolSwiper> driveSchoolSeparateIPage = driveSchoolSwiperService.selectDriveSchoolSwiperPclist(driveSchoolSwiper, page);
|
||||||
|
|
||||||
|
// IPage<DriveSchoolSwiper> page = driveSchoolSwiperService.selectDriveSchoolSwiperPclist(driveSchoolSwiper, current, size);
|
||||||
|
return CommonResult.success(driveSchoolSeparateIPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出驾校-轮播图列表
|
* 导出驾校-轮播图列表
|
||||||
*/
|
*/
|
||||||
|
@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.jx.domain.DriveSchoolCoach;
|
|||||||
import cn.iocoder.yudao.module.jx.domain.DriveSchoolInfo;
|
import cn.iocoder.yudao.module.jx.domain.DriveSchoolInfo;
|
||||||
import cn.iocoder.yudao.module.jx.mapper.DriveSchoolCoachMapper;
|
import cn.iocoder.yudao.module.jx.mapper.DriveSchoolCoachMapper;
|
||||||
import cn.iocoder.yudao.module.jx.service.IDriveSchoolInfoService;
|
import cn.iocoder.yudao.module.jx.service.IDriveSchoolInfoService;
|
||||||
|
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
import cn.iocoder.yudao.module.system.service.permission.PermissionService;
|
import cn.iocoder.yudao.module.system.service.permission.PermissionService;
|
||||||
@ -44,25 +45,33 @@ public class JxAuthController {
|
|||||||
private DriveSchoolCoachMapper driveSchoolCoachMapper;
|
private DriveSchoolCoachMapper driveSchoolCoachMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private IDriveSchoolInfoService driveSchoolInfoService;
|
private IDriveSchoolInfoService driveSchoolInfoService;
|
||||||
|
@Resource
|
||||||
|
private AdminUserApi userApi;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取
|
* 获取Jx用户信息
|
||||||
*
|
*
|
||||||
* @return 用户信息
|
* @return 用户信息
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getJxInfo")
|
@GetMapping("/getJxInfo")
|
||||||
public CommonResult getJxInfo()
|
public CommonResult getJxInfo()
|
||||||
{
|
{
|
||||||
|
// 获取当前用户信息
|
||||||
|
// Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||||
|
// AdminUserRespDTO sysUser = userApi.getUser(userId);
|
||||||
|
// Long deptId = sysUser.getDeptId();
|
||||||
|
|
||||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||||
// 获取当前登录用户角色编码
|
// 获取当前登录用户角色编码
|
||||||
Set<String> roles = permissionService.getRolePermission(user.getId());
|
Set<String> roles = permissionService.getRolePermission(user.getId());
|
||||||
//获取驾校的
|
//获取驾校的
|
||||||
Long userId = user.getId();
|
Long userId = user.getId();
|
||||||
|
|
||||||
AdminUserDO sysUser = userService.getUser(userId);
|
AdminUserDO sysUser = userService.getUser(userId);
|
||||||
|
Long deptId = sysUser.getDeptId();
|
||||||
|
|
||||||
String phonenumber = sysUser.getMobile();
|
String phonenumber = sysUser.getMobile();
|
||||||
//根据手机号查询驾校教练
|
//根据手机号查询驾校教练
|
||||||
DriveSchoolCoach driveSchoolCoach = driveSchoolCoachMapper.selectByPhonenumber(phonenumber);
|
DriveSchoolCoach driveSchoolCoach = driveSchoolCoachMapper.selectByPhonenumber(phonenumber);
|
||||||
@ -70,7 +79,7 @@ public class JxAuthController {
|
|||||||
if (ObjectUtils.isNotEmpty(driveSchoolCoach)){
|
if (ObjectUtils.isNotEmpty(driveSchoolCoach)){
|
||||||
sysUser.setAvatar(driveSchoolCoach.getImage());
|
sysUser.setAvatar(driveSchoolCoach.getImage());
|
||||||
}
|
}
|
||||||
DriveSchoolInfo driveSchoolInfo = driveSchoolInfoService.getSchoolInfoByDeptId();
|
DriveSchoolInfo driveSchoolInfo = driveSchoolInfoService.getSchoolInfoByDeptId(deptId);
|
||||||
|
|
||||||
Map<String,Object> result = new HashMap<>();
|
Map<String,Object> result = new HashMap<>();
|
||||||
result.put("user", sysUser);
|
result.put("user", sysUser);
|
||||||
|
@ -67,8 +67,19 @@ public interface DriveSchoolInfoMapper
|
|||||||
*/
|
*/
|
||||||
public int deleteDriveSchoolInfoByIds(Long[] ids);
|
public int deleteDriveSchoolInfoByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据部门ID查询驾校信息
|
||||||
|
* @param deptId 部门ID
|
||||||
|
* @return 驾校信息
|
||||||
|
*/
|
||||||
DriveSchoolInfoVO getSchoolInfoByDeptId(Long deptId);
|
DriveSchoolInfoVO getSchoolInfoByDeptId(Long deptId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据驾校ID查询驾校信息
|
||||||
|
* @param jxId 驾校ID
|
||||||
|
* @return 驾校信息
|
||||||
|
*/
|
||||||
DriveSchoolInfoVO findInfoByJxId(Long jxId);
|
DriveSchoolInfoVO findInfoByJxId(Long jxId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,14 @@
|
|||||||
package cn.iocoder.yudao.module.jx.mapper;
|
package cn.iocoder.yudao.module.jx.mapper;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.jx.domain.DriveSchoolSeparate;
|
||||||
import cn.iocoder.yudao.module.jx.domain.DriveSchoolSwiper;
|
import cn.iocoder.yudao.module.jx.domain.DriveSchoolSwiper;
|
||||||
|
import cn.iocoder.yudao.module.jx.domain.DriveSchoolTeachingJournal;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.springframework.data.repository.query.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -29,7 +35,8 @@ public interface DriveSchoolSwiperMapper
|
|||||||
* @param driveSchoolSwiper 驾校-轮播图
|
* @param driveSchoolSwiper 驾校-轮播图
|
||||||
* @return 驾校-轮播图集合
|
* @return 驾校-轮播图集合
|
||||||
*/
|
*/
|
||||||
public List<DriveSchoolSwiper> selectDriveSchoolSwiperList(DriveSchoolSwiper driveSchoolSwiper);
|
List<DriveSchoolSwiper> selectDriveSchoolSwiperList(DriveSchoolSwiper driveSchoolSwiper);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增驾校-轮播图
|
* 新增驾校-轮播图
|
||||||
@ -62,4 +69,12 @@ public interface DriveSchoolSwiperMapper
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteDriveSchoolSwiperByIds(Long[] ids);
|
public int deleteDriveSchoolSwiperByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询驾校-轮播图
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
IPage<DriveSchoolSwiper> selectDriveSchoolSwiperPage(@Param("entity")DriveSchoolSwiper entity , Page<DriveSchoolSwiper> page);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package cn.iocoder.yudao.module.jx.payment.api;
|
package cn.iocoder.yudao.module.jx.payment.api;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
import cn.iocoder.yudao.module.jx.core.controller.BaseController;
|
import cn.iocoder.yudao.module.jx.core.controller.BaseController;
|
||||||
import cn.iocoder.yudao.module.jx.domain.DriveSchoolCoach;
|
import cn.iocoder.yudao.module.jx.domain.DriveSchoolCoach;
|
||||||
@ -12,14 +13,19 @@ import cn.iocoder.yudao.module.jx.service.IDriveSchoolInfoService;
|
|||||||
import cn.iocoder.yudao.module.jx.vo.DriveSchoolInfoVO;
|
import cn.iocoder.yudao.module.jx.vo.DriveSchoolInfoVO;
|
||||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
|
import cn.iocoder.yudao.module.system.service.permission.PermissionService;
|
||||||
|
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.sun.javaws.IconUtil;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单Controller
|
* 订单Controller
|
||||||
@ -38,7 +44,10 @@ public class DriveSchoolPayController extends BaseController
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private AdminUserApi userApi;
|
private AdminUserApi userApi;
|
||||||
|
@Resource
|
||||||
|
private PermissionService permissionService;
|
||||||
|
@Resource
|
||||||
|
private AdminUserService userService;
|
||||||
|
|
||||||
@GetMapping("updatePayById")
|
@GetMapping("updatePayById")
|
||||||
public void updatePayById(Integer id, String name, Integer jlId) {
|
public void updatePayById(Integer id, String name, Integer jlId) {
|
||||||
@ -50,28 +59,41 @@ public class DriveSchoolPayController extends BaseController
|
|||||||
* 查询订单列表
|
* 查询订单列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public CommonResult<IPage<?>> list(DriveSchoolPay driveSchoolPay)
|
public CommonResult<IPage<?>> list(DriveSchoolPay driveSchoolPay) {
|
||||||
{
|
|
||||||
|
|
||||||
int number = 0;
|
// 获取当前用户信息
|
||||||
int numbers = 0;
|
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||||
int allNumber = 0;
|
|
||||||
DriveSchoolInfoVO schoolInfo = driveSchoolInfoService.getSchoolInfoByDeptId();
|
|
||||||
|
|
||||||
|
//获取驾校ID
|
||||||
|
Long userId = user.getId();
|
||||||
|
AdminUserDO sysUser = userService.getUser(userId);
|
||||||
|
Long deptId = sysUser.getDeptId();
|
||||||
|
|
||||||
|
// 记录部门ID
|
||||||
|
System.out.println("User ID: " + userId + " | Dept ID: " + deptId);
|
||||||
|
|
||||||
|
// 获取驾校信息
|
||||||
|
//schoolInfo为null
|
||||||
|
DriveSchoolInfoVO schoolInfo = driveSchoolInfoService.getSchoolInfoByDeptId(deptId);
|
||||||
|
|
||||||
|
// 设置驾校ID
|
||||||
if (schoolInfo != null) {
|
if (schoolInfo != null) {
|
||||||
|
System.out.println("啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊");
|
||||||
driveSchoolPay.setJxId(schoolInfo.getId());
|
driveSchoolPay.setJxId(schoolInfo.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 创建分页对象
|
||||||
Page<DriveSchoolPay> page = new Page<>(driveSchoolPay.getPageNum(), driveSchoolPay.getPageSize());
|
Page<DriveSchoolPay> page = new Page<>(driveSchoolPay.getPageNum(), driveSchoolPay.getPageSize());
|
||||||
IPage<DriveSchoolPay> driveSchoolPayIPage = driveSchoolPayService.selectDriveSchoolPayList(driveSchoolPay, page);
|
IPage<DriveSchoolPay> driveSchoolPayIPage = driveSchoolPayService.selectDriveSchoolPayList(driveSchoolPay, page);
|
||||||
|
|
||||||
|
// 处理记录格式化排序
|
||||||
List<DriveSchoolPay> list = driveSchoolPayIPage.getRecords();
|
List<DriveSchoolPay> list = driveSchoolPayIPage.getRecords();
|
||||||
for (DriveSchoolPay row :list) {
|
int allNumber = (driveSchoolPay.getPageNum() - 1) * driveSchoolPay.getPageSize();
|
||||||
numbers += 1;
|
for (int i = 0; i < list.size(); i++) {
|
||||||
allNumber = (driveSchoolPay.getPageNum()-1) * driveSchoolPay.getPageSize();
|
String formattedNumber = String.format("%05d", allNumber + i + 1);
|
||||||
number = allNumber + numbers;
|
list.get(i).setSorNumber(formattedNumber);
|
||||||
String formattedNumber = String.format("%05d", number);
|
|
||||||
row.setSorNumber(formattedNumber);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return CommonResult.success(driveSchoolPayIPage);
|
return CommonResult.success(driveSchoolPayIPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ public interface IDriveSchoolInfoService
|
|||||||
*/
|
*/
|
||||||
public int deleteDriveSchoolInfoById(Long id);
|
public int deleteDriveSchoolInfoById(Long id);
|
||||||
|
|
||||||
DriveSchoolInfoVO getSchoolInfoByDeptId();
|
DriveSchoolInfoVO getSchoolInfoByDeptId(Long deptId);
|
||||||
|
|
||||||
List<PayVo> findSelfSchoolData();
|
List<PayVo> findSelfSchoolData();
|
||||||
|
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
package cn.iocoder.yudao.module.jx.service;
|
package cn.iocoder.yudao.module.jx.service;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.jx.domain.DriveSchoolSeparate;
|
||||||
import cn.iocoder.yudao.module.jx.domain.DriveSchoolSwiper;
|
import cn.iocoder.yudao.module.jx.domain.DriveSchoolSwiper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -27,7 +30,6 @@ public interface IDriveSchoolSwiperService
|
|||||||
* @return 驾校-轮播图集合
|
* @return 驾校-轮播图集合
|
||||||
*/
|
*/
|
||||||
public List<DriveSchoolSwiper> selectDriveSchoolSwiperList(DriveSchoolSwiper driveSchoolSwiper);
|
public List<DriveSchoolSwiper> selectDriveSchoolSwiperList(DriveSchoolSwiper driveSchoolSwiper);
|
||||||
public List<DriveSchoolSwiper> selectDriveSchoolSwiperPclist(DriveSchoolSwiper driveSchoolSwiper);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增驾校-轮播图
|
* 新增驾校-轮播图
|
||||||
@ -60,4 +62,12 @@ public interface IDriveSchoolSwiperService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteDriveSchoolSwiperById(Long id);
|
public int deleteDriveSchoolSwiperById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询驾校-轮播图
|
||||||
|
*
|
||||||
|
* @param driveSchoolSwiper 驾校-轮播图
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public IPage<DriveSchoolSwiper> selectDriveSchoolSwiperPclist(DriveSchoolSwiper driveSchoolSwiper, Page<DriveSchoolSwiper> page);
|
||||||
}
|
}
|
||||||
|
@ -23,11 +23,13 @@ import com.thoughtworks.xstream.core.SecurityUtils;
|
|||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.repository.query.Param;
|
||||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.config.CommonStr.USER_TYPE_STAFF;
|
import static cn.iocoder.yudao.framework.common.config.CommonStr.USER_TYPE_STAFF;
|
||||||
@ -115,6 +117,7 @@ public class DriveSchoolCoachServiceImpl implements IDriveSchoolCoachService
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private AdminUserService adminUserService;
|
private AdminUserService adminUserService;
|
||||||
|
|
||||||
@ -246,13 +249,16 @@ public class DriveSchoolCoachServiceImpl implements IDriveSchoolCoachService
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DriveSchoolCoach> selectDriveSchoolCoachListAll(DriveSchoolCoach driveSchoolCoach) {
|
public List<DriveSchoolCoach> selectDriveSchoolCoachListAll(@Param("entity") DriveSchoolCoach driveSchoolCoach) {
|
||||||
driveSchoolCoach.setDeptId(12L);
|
// 检查driveSchoolCoach是否为null
|
||||||
DriveSchoolInfo jxInfoData = driveSchoolInfoMapper.findInfoByJxId(driveSchoolCoach.getDeptId());
|
if (driveSchoolCoach == null) {
|
||||||
driveSchoolCoach.setDeptId(jxInfoData.getDeptId());
|
return Collections.emptyList(); // 返回空列表,或者可以根据需求抛出异常
|
||||||
|
}
|
||||||
|
|
||||||
return driveSchoolCoachMapper.selectDriveSchoolCoachListAll(driveSchoolCoach);
|
return driveSchoolCoachMapper.selectDriveSchoolCoachListAll(driveSchoolCoach);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DriveSchoolCoach> findSelfJlListByJxId(Long jxId) {
|
public List<DriveSchoolCoach> findSelfJlListByJxId(Long jxId) {
|
||||||
DriveSchoolInfo jxInfoData = driveSchoolInfoMapper.findInfoByJxId(jxId);
|
DriveSchoolInfo jxInfoData = driveSchoolInfoMapper.findInfoByJxId(jxId);
|
||||||
|
@ -87,14 +87,30 @@ public class DriveSchoolExamPassServiceImpl implements IDriveSchoolExamPassServi
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IPage<DriveSchoolExamPass> selectDriveSchoolExamPassList(DriveSchoolExamPass driveSchoolExamPass, Page<DriveSchoolExamPass> page) {
|
public IPage<DriveSchoolExamPass> selectDriveSchoolExamPassList(DriveSchoolExamPass driveSchoolExamPass, Page<DriveSchoolExamPass> page) {
|
||||||
|
if (driveSchoolExamPass == null) {
|
||||||
|
throw new IllegalArgumentException("driveSchoolExamPass cannot be null");
|
||||||
|
}
|
||||||
|
|
||||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||||
AdminUserRespDTO user = userApi.getUser(userId);
|
AdminUserRespDTO user = userApi.getUser(userId);
|
||||||
Long deptId = user.getDeptId();
|
Long deptId = user.getDeptId();
|
||||||
|
|
||||||
|
// 空值检查
|
||||||
|
if (deptId == null || deptId <= 0) {
|
||||||
|
throw new IllegalArgumentException("无效的部门 ID");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取驾校信息
|
||||||
DriveSchoolInfoVO schoolInfoByDeptId = driveSchoolInfoMapper.getSchoolInfoByDeptId(deptId);
|
DriveSchoolInfoVO schoolInfoByDeptId = driveSchoolInfoMapper.getSchoolInfoByDeptId(deptId);
|
||||||
|
if (schoolInfoByDeptId == null) {
|
||||||
|
throw new RuntimeException("未找到指定部门的驾校信息");
|
||||||
|
}
|
||||||
|
|
||||||
driveSchoolExamPass.setJxId(schoolInfoByDeptId.getId());
|
driveSchoolExamPass.setJxId(schoolInfoByDeptId.getId());
|
||||||
return driveSchoolExamPassMapper.selectDriveSchoolExamPassList(driveSchoolExamPass, page);
|
return driveSchoolExamPassMapper.selectDriveSchoolExamPassList(driveSchoolExamPass, page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private DriveSchoolPayService driveSchoolPayService;
|
private DriveSchoolPayService driveSchoolPayService;
|
||||||
|
|
||||||
@ -201,22 +217,37 @@ public class DriveSchoolExamPassServiceImpl implements IDriveSchoolExamPassServi
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IPage<DriveSchoolExamPass> getBalanceList(DriveSchoolExamPass driveSchoolExamPass, Page<DriveSchoolExamPass> page) {
|
public IPage<DriveSchoolExamPass> getBalanceList(DriveSchoolExamPass driveSchoolExamPass, Page<DriveSchoolExamPass> page) {
|
||||||
|
// 检查 JX ID
|
||||||
if (ObjectUtils.isNotEmpty(driveSchoolExamPass.getJxId())) {
|
if (ObjectUtils.isNotEmpty(driveSchoolExamPass.getJxId())) {
|
||||||
driveSchoolExamPass.setJxId(driveSchoolExamPass.getId());
|
driveSchoolExamPass.setJxId(driveSchoolExamPass.getId());
|
||||||
} else {
|
} else {
|
||||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||||
AdminUserRespDTO user = userApi.getUser(userId);
|
AdminUserRespDTO user = userApi.getUser(userId);
|
||||||
Long deptId = user.getDeptId();
|
Long deptId = user.getDeptId();
|
||||||
|
|
||||||
|
// 获取驾校信息
|
||||||
DriveSchoolInfoVO schoolInfoByDeptId = driveSchoolInfoMapper.getSchoolInfoByDeptId(deptId);
|
DriveSchoolInfoVO schoolInfoByDeptId = driveSchoolInfoMapper.getSchoolInfoByDeptId(deptId);
|
||||||
|
|
||||||
|
// 检查 schoolInfoByDeptId 是否为 null
|
||||||
|
if (schoolInfoByDeptId == null) {
|
||||||
|
throw new RuntimeException("未找到指定部门的驾校信息"); // 抛出合理的异常
|
||||||
|
}
|
||||||
|
|
||||||
driveSchoolExamPass.setJxId(schoolInfoByDeptId.getId());
|
driveSchoolExamPass.setJxId(schoolInfoByDeptId.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 进一步的逻辑处理
|
||||||
|
// 否则进行时间格式化
|
||||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
if (ObjectUtils.isNotEmpty(driveSchoolExamPass.getPayStartTime()) && ObjectUtils.isNotEmpty(driveSchoolExamPass.getPayEndTime())) {
|
if (ObjectUtils.isNotEmpty(driveSchoolExamPass.getPayStartTime()) &&
|
||||||
|
ObjectUtils.isNotEmpty(driveSchoolExamPass.getPayEndTime())) {
|
||||||
driveSchoolExamPass.setPayStartTimes(simpleDateFormat.format(driveSchoolExamPass.getPayStartTime()));
|
driveSchoolExamPass.setPayStartTimes(simpleDateFormat.format(driveSchoolExamPass.getPayStartTime()));
|
||||||
driveSchoolExamPass.setPayEndTimes(simpleDateFormat.format(driveSchoolExamPass.getPayEndTime()));
|
driveSchoolExamPass.setPayEndTimes(simpleDateFormat.format(driveSchoolExamPass.getPayEndTime()));
|
||||||
}
|
}
|
||||||
|
|
||||||
IPage<DriveSchoolExamPass> records = driveSchoolExamPassMapper.getBalanceList(driveSchoolExamPass, page);
|
IPage<DriveSchoolExamPass> records = driveSchoolExamPassMapper.getBalanceList(driveSchoolExamPass, page);
|
||||||
|
|
||||||
|
// 处理余额逻辑
|
||||||
List<DriveSchoolExamPass> balanceList = records.getRecords();
|
List<DriveSchoolExamPass> balanceList = records.getRecords();
|
||||||
balanceList.forEach(s -> {
|
balanceList.forEach(s -> {
|
||||||
DriveSchoolExamPass driveSchoolExamPass1 = new DriveSchoolExamPass();
|
DriveSchoolExamPass driveSchoolExamPass1 = new DriveSchoolExamPass();
|
||||||
@ -227,9 +258,11 @@ public class DriveSchoolExamPassServiceImpl implements IDriveSchoolExamPassServi
|
|||||||
s.setDeducts(new BigDecimal(0));
|
s.setDeducts(new BigDecimal(0));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return records;
|
return records;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int pay(DriveSchoolExamPass driveSchoolExamPass) {
|
public int pay(DriveSchoolExamPass driveSchoolExamPass) {
|
||||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||||
|
@ -260,27 +260,51 @@ public class DriveSchoolInfoServiceImpl implements IDriveSchoolInfoService
|
|||||||
return driveSchoolInfoMapper.deleteDriveSchoolInfoById(id);
|
return driveSchoolInfoMapper.deleteDriveSchoolInfoById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据部门id获取驾校信息
|
||||||
|
*
|
||||||
|
* @return 驾校信息
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public DriveSchoolInfoVO getSchoolInfoByDeptId() {
|
public DriveSchoolInfoVO getSchoolInfoByDeptId(Long deptId) {
|
||||||
|
// 记录deptId
|
||||||
|
System.out.println("Dept ID: " + deptId);
|
||||||
|
|
||||||
|
// 获取教练id
|
||||||
|
Long jlId = 0L;
|
||||||
|
|
||||||
|
// 根据当前用户的手机号获取教练信息
|
||||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||||
AdminUserRespDTO sysUser = userApi.getUser(userId);
|
AdminUserRespDTO sysUser = userApi.getUser(userId);
|
||||||
Long deptId = sysUser.getDeptId();
|
String phonenumber = sysUser.getMobile();
|
||||||
//获取教练id
|
System.out.println("当前用户手机号: " + phonenumber);
|
||||||
// Long userId = SecurityFrameworkUtils.getLoginUserId();
|
|
||||||
// AdminUserRespDTO sysUser = userApi.getUser(userId);
|
// 获取教练信息
|
||||||
//SysUser sysUser =sysUserMapper.selectUserById(userId);
|
|
||||||
String phonenumber=sysUser.getMobile();
|
|
||||||
Long jlId =0L;
|
|
||||||
DriveSchoolCoach driveSchoolCoach = driveSchoolCoachMapper.selectByPhonenumber(phonenumber);
|
DriveSchoolCoach driveSchoolCoach = driveSchoolCoachMapper.selectByPhonenumber(phonenumber);
|
||||||
if (ObjectUtils.isNotEmpty(driveSchoolCoach)){
|
if (driveSchoolCoach != null) {
|
||||||
jlId = driveSchoolCoach.getId();
|
jlId = driveSchoolCoach.getId();
|
||||||
|
System.out.println("教练ID: " + jlId);
|
||||||
|
} else {
|
||||||
|
System.err.println("未找到手机号为 " + phonenumber + " 的教练信息");
|
||||||
|
// 可以选择抛出异常或返回默认值
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取驾校信息
|
||||||
|
DriveSchoolInfoVO schoolInfoByDeptId = driveSchoolInfoMapper.getSchoolInfoByDeptId(deptId);
|
||||||
|
|
||||||
|
if (schoolInfoByDeptId != null) {
|
||||||
|
schoolInfoByDeptId.setJlId(jlId);
|
||||||
|
} else {
|
||||||
|
System.err.println("未找到部门 ID 为 " + deptId + " 的驾校信息");
|
||||||
|
throw new RuntimeException("未找到指定部门的驾校信息");
|
||||||
}
|
}
|
||||||
|
|
||||||
DriveSchoolInfoVO schoolInfoByDeptId = driveSchoolInfoMapper.getSchoolInfoByDeptId(100L);
|
|
||||||
schoolInfoByDeptId.setJlId(jlId);
|
|
||||||
return schoolInfoByDeptId;
|
return schoolInfoByDeptId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PayVo> findSelfSchoolData() {
|
public List<PayVo> findSelfSchoolData() {
|
||||||
|
|
||||||
|
@ -9,6 +9,8 @@ import cn.iocoder.yudao.module.jx.mapper.DriveSchoolInfoMapper;
|
|||||||
import cn.iocoder.yudao.module.jx.mapper.DriveSchoolSwiperMapper;
|
import cn.iocoder.yudao.module.jx.mapper.DriveSchoolSwiperMapper;
|
||||||
import cn.iocoder.yudao.module.jx.service.IDriveSchoolSwiperService;
|
import cn.iocoder.yudao.module.jx.service.IDriveSchoolSwiperService;
|
||||||
import cn.iocoder.yudao.module.jx.vo.DriveSchoolInfoVO;
|
import cn.iocoder.yudao.module.jx.vo.DriveSchoolInfoVO;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.thoughtworks.xstream.core.SecurityUtils;
|
import com.thoughtworks.xstream.core.SecurityUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -60,21 +62,28 @@ public class DriveSchoolSwiperServiceImpl implements IDriveSchoolSwiperService
|
|||||||
@Resource
|
@Resource
|
||||||
private DriveSchoolInfoMapper driveSchoolInfoMapper;
|
private DriveSchoolInfoMapper driveSchoolInfoMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询驾校-轮播图
|
||||||
|
*
|
||||||
|
* @param driveSchoolSwiper 驾校-轮播图
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<DriveSchoolSwiper> selectDriveSchoolSwiperPclist(DriveSchoolSwiper driveSchoolSwiper)
|
public IPage<DriveSchoolSwiper> selectDriveSchoolSwiperPclist(DriveSchoolSwiper driveSchoolSwiper, Page<DriveSchoolSwiper> page) {
|
||||||
{
|
|
||||||
|
|
||||||
Long deptId = 0L;
|
Long deptId = 0L;
|
||||||
if (ObjectUtils.isNotEmpty(driveSchoolSwiper.getJxId())){
|
if (ObjectUtils.isNotEmpty(driveSchoolSwiper.getJxId())) {
|
||||||
DriveSchoolInfoVO schoolInfoByDeptId = driveSchoolInfoMapper.findInfoByJxId(driveSchoolSwiper.getJxId());
|
DriveSchoolInfoVO schoolInfoByDeptId = driveSchoolInfoMapper.findInfoByJxId(driveSchoolSwiper.getJxId());
|
||||||
deptId = schoolInfoByDeptId.getDeptId();
|
deptId = schoolInfoByDeptId.getDeptId();
|
||||||
}else {
|
} else {
|
||||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||||
AdminUserRespDTO user = userApi.getUser(userId);
|
AdminUserRespDTO user = userApi.getUser(userId);
|
||||||
deptId = user.getDeptId();
|
deptId = user.getDeptId();
|
||||||
}
|
}
|
||||||
driveSchoolSwiper.setDeptId(deptId);
|
driveSchoolSwiper.setDeptId(deptId);
|
||||||
return driveSchoolSwiperMapper.selectDriveSchoolSwiperList(driveSchoolSwiper);
|
|
||||||
|
// 创建分页对象
|
||||||
|
// Page<DriveSchoolSwiper> page = new Page<>(driveSchoolSwiper.getPageNum(), driveSchoolSwiper.getPageSize());
|
||||||
|
return driveSchoolSwiperMapper.selectDriveSchoolSwiperPage(driveSchoolSwiper,page);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -155,10 +155,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
where deleted = 0 and dept_id = #{deptId}
|
where deleted = 0 and dept_id = #{deptId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<select id="findInfoByJxId" parameterType="Long" resultMap="DriveSchoolInfoVOResult">
|
<select id="findInfoByJxId" parameterType="Long" resultMap="DriveSchoolInfoVOResult">
|
||||||
<include refid="selectDriveSchoolInfoVo"/>
|
<include refid="selectDriveSchoolInfoVo"/>
|
||||||
where id = #{jxId};
|
where id = #{jxId};
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -21,19 +21,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
select id, swiper_name, dept_id,swiper_picture, jump_url, list_order, creator, create_time, updater, update_time from drive_school_swiper
|
select id, swiper_name, dept_id,swiper_picture, jump_url, list_order, creator, create_time, updater, update_time from drive_school_swiper
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectDriveSchoolSwiperList" parameterType="cn.iocoder.yudao.module.jx.domain.DriveSchoolSwiper" resultMap="DriveSchoolSwiperResult">
|
<select id="selectDriveSchoolSwiperList" resultMap="DriveSchoolSwiperResult">
|
||||||
<include refid="selectDriveSchoolSwiperVo"/>
|
SELECT id, swiper_name, dept_id, swiper_picture, jump_url, list_order, creator, create_time, updater, update_time
|
||||||
|
FROM drive_school_swiper
|
||||||
<where>
|
<where>
|
||||||
deleted = 0
|
deleted = 0
|
||||||
<if test="swiperName != null and swiperName != ''"> and swiper_name like concat('%', #{swiperName}, '%')</if>
|
<if test="swiperName != null and swiperName != ''">
|
||||||
<if test="swiperPicture != null and swiperPicture != ''"> and swiper_picture = #{swiperPicture}</if>
|
AND swiper_name LIKE CONCAT('%', #{swiperName}, '%')
|
||||||
<if test="jumpUrl != null and jumpUrl != ''"> and jump_url = #{jumpUrl}</if>
|
</if>
|
||||||
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
<if test="swiperPicture != null and swiperPicture != ''">
|
||||||
<if test="listOrder != null "> and list_order = #{listOrder}</if>
|
AND swiper_picture = #{swiperPicture}
|
||||||
|
</if>
|
||||||
|
<if test="jumpUrl != null and jumpUrl != ''">
|
||||||
|
AND jump_url = #{jumpUrl}
|
||||||
|
</if>
|
||||||
|
<if test="deptId != null">
|
||||||
|
AND dept_id = #{deptId}
|
||||||
|
</if>
|
||||||
|
<if test="listOrder != null">
|
||||||
|
AND list_order = #{listOrder}
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
order by list_order asc
|
ORDER BY list_order ASC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="selectDriveSchoolSwiperById" parameterType="Long" resultMap="DriveSchoolSwiperResult">
|
<select id="selectDriveSchoolSwiperById" parameterType="Long" resultMap="DriveSchoolSwiperResult">
|
||||||
<include refid="selectDriveSchoolSwiperVo"/>
|
<include refid="selectDriveSchoolSwiperVo"/>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
@ -93,4 +105,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectDriveSchoolSwiperPage" resultMap="DriveSchoolSwiperResult">
|
||||||
|
SELECT id, swiper_name, dept_id, swiper_picture, jump_url, list_order, creator, create_time, updater, update_time
|
||||||
|
FROM drive_school_swiper
|
||||||
|
<where>
|
||||||
|
deleted = 0
|
||||||
|
<if test="driveSchoolSwiper != null">
|
||||||
|
<if test="driveSchoolSwiper.swiperName != null and driveSchoolSwiper.swiperName != ''">
|
||||||
|
AND swiper_name LIKE CONCAT('%', #{driveSchoolSwiper.swiperName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="driveSchoolSwiper.swiperPicture != null and driveSchoolSwiper.swiperPicture != ''">
|
||||||
|
AND swiper_picture = #{driveSchoolSwiper.swiperPicture}
|
||||||
|
</if>
|
||||||
|
<if test="driveSchoolSwiper.jumpUrl != null and driveSchoolSwiper.jumpUrl != ''">
|
||||||
|
AND jump_url = #{driveSchoolSwiper.jumpUrl}
|
||||||
|
</if>
|
||||||
|
<if test="driveSchoolSwiper.deptId != null">
|
||||||
|
AND dept_id = #{driveSchoolSwiper.deptId}
|
||||||
|
</if>
|
||||||
|
<if test="driveSchoolSwiper.listOrder != null">
|
||||||
|
AND list_order = #{driveSchoolSwiper.listOrder}
|
||||||
|
</if>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY list_order ASC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -19,7 +19,9 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -86,7 +88,7 @@ public class RepairProjectServiceImpl extends ServiceImpl<RepairProjectMapper, R
|
|||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
public IPage<RepairProjectRespVO> queryListPage(RepairProjectPageReqVO pageReqVO, Page<RepairProjectRespVO> page) {
|
public IPage<RepairProjectRespVO> queryListPage(RepairProjectPageReqVO pageReqVO, Page<RepairProjectRespVO> page) {
|
||||||
return repairProjectMapper.selectListPage(pageReqVO,page);
|
return repairProjectMapper.selectListPage(pageReqVO, page);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -97,28 +99,29 @@ public class RepairProjectServiceImpl extends ServiceImpl<RepairProjectMapper, R
|
|||||||
@Override
|
@Override
|
||||||
public List<RepairProjectAppvo> getRepairProjectAndCateGory() {
|
public List<RepairProjectAppvo> getRepairProjectAndCateGory() {
|
||||||
List<RepairProjectAppvo> repairProjectAppvos = repairProjectMapper.selectProjectAndCateGory();
|
List<RepairProjectAppvo> repairProjectAppvos = repairProjectMapper.selectProjectAndCateGory();
|
||||||
// 提取并去重 typeId
|
|
||||||
List<String> uniqueTypeIds = repairProjectAppvos.stream()
|
// 使用 LinkedHashMap 按 typeId 分组,排除 typeId 为 null 的条目
|
||||||
.map(RepairProjectAppvo::getTypeId)
|
Map<String, List<RepairProjectAppvo>> groupedByTypeId = new LinkedHashMap<>();
|
||||||
.distinct()
|
for (RepairProjectAppvo appvo : repairProjectAppvos) {
|
||||||
.collect(Collectors.toList());
|
if (ObjectUtil.isNotEmpty(appvo.getTypeId())) {
|
||||||
List<RepairProjectAppvo> list = new ArrayList<>();
|
groupedByTypeId.computeIfAbsent(appvo.getTypeId(), k -> new ArrayList<>()).add(appvo);
|
||||||
for (String uniqueTypeId : uniqueTypeIds) {
|
|
||||||
RepairProjectAppvo repairProjectAppvo = new RepairProjectAppvo();
|
|
||||||
repairProjectAppvo.setTypeId(uniqueTypeId);
|
|
||||||
if (ObjectUtil.isNotEmpty(uniqueTypeId)) {
|
|
||||||
List<RepairProjectAppvo> filteredList = repairProjectAppvos.stream()
|
|
||||||
.filter(appvo -> uniqueTypeId.equals(appvo.getTypeId()))
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
if (CollectionUtil.isNotEmpty(filteredList)) {
|
|
||||||
repairProjectAppvo.setTypeName(filteredList.get(0).getTypeName());
|
|
||||||
repairProjectAppvo.setGroupList(BeanUtil.copyToList(filteredList, RepairProject.class));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
list.add(repairProjectAppvo);
|
|
||||||
}
|
}
|
||||||
return list;
|
|
||||||
|
// 创建结果列表
|
||||||
|
List<RepairProjectAppvo> resultList = new ArrayList<>();
|
||||||
|
for (Map.Entry<String, List<RepairProjectAppvo>> entry : groupedByTypeId.entrySet()) {
|
||||||
|
RepairProjectAppvo repairProjectAppvo = new RepairProjectAppvo();
|
||||||
|
repairProjectAppvo.setTypeId(entry.getKey());
|
||||||
|
List<RepairProjectAppvo> filteredList = entry.getValue();
|
||||||
|
repairProjectAppvo.setTypeName(filteredList.get(0).getTypeName());
|
||||||
|
|
||||||
|
// 只在最后一次调用 copyToList
|
||||||
|
repairProjectAppvo.setGroupList(BeanUtil.copyToList(filteredList, RepairProject.class));
|
||||||
|
resultList.add(repairProjectAppvo);
|
||||||
|
}
|
||||||
|
|
||||||
|
return resultList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -45,8 +45,7 @@ public class DlRepairTicketsController {
|
|||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "维修工单表 新增")
|
@Operation(summary = "维修工单表 新增")
|
||||||
public CommonResult<?> createTicket(@RequestBody DlRepairTicketsRespVO ticketsRespVO) {
|
public CommonResult<?> createTicket(@RequestBody DlRepairTicketsRespVO ticketsRespVO) {
|
||||||
dlRepairTicketsService.createTickets(ticketsRespVO);
|
return CommonResult.success(dlRepairTicketsService.createTickets(ticketsRespVO));
|
||||||
return CommonResult.ok();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -7,10 +7,7 @@ import cn.iocoder.yudao.module.tickets.vo.DlRepairTitemReqVO;
|
|||||||
import cn.iocoder.yudao.module.tickets.vo.DlRepairTitemRespVO;
|
import cn.iocoder.yudao.module.tickets.vo.DlRepairTitemRespVO;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
@ -23,7 +20,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|||||||
* @date 18:21 2024/9/13
|
* @date 18:21 2024/9/13
|
||||||
**/
|
**/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/repair/titem")
|
@RequestMapping("/repair/titem")
|
||||||
public class DlRepairTitemController {
|
public class DlRepairTitemController {
|
||||||
/**
|
/**
|
||||||
* 服务对象
|
* 服务对象
|
||||||
@ -61,5 +58,16 @@ public class DlRepairTitemController {
|
|||||||
public CommonResult<?> getProjectList(@RequestParam("ticketId") String ticketId){
|
public CommonResult<?> getProjectList(@RequestParam("ticketId") String ticketId){
|
||||||
return success(dlRepairTitemService.getProjectList(ticketId));
|
return success(dlRepairTitemService.getProjectList(ticketId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改维修工单子表的维修人员和销售人员信息(app)
|
||||||
|
* @param dlRepairTitemReqVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PutMapping("/updateRepairAndSale")
|
||||||
|
@Operation(summary = "修改维修工单子表的维修人员和销售人员信息")
|
||||||
|
public CommonResult<?> updateRepairAndSale(@RequestBody DlRepairTitemReqVO dlRepairTitemReqVO){
|
||||||
|
return success(dlRepairTitemService.updateRepairAndSale(dlRepairTitemReqVO));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,6 +25,12 @@ public interface DlRepairTitemMapper extends BaseMapper<DlRepairTitem> {
|
|||||||
* @param repairTitemRespVO 查询对象
|
* @param repairTitemRespVO 查询对象
|
||||||
**/
|
**/
|
||||||
IPage<DlRepairTitemRespVO> getTItemPage(@Param("map") DlRepairTitemRespVO repairTitemRespVO, Page<DlRepairTitemRespVO> page);
|
IPage<DlRepairTitemRespVO> getTItemPage(@Param("map") DlRepairTitemRespVO repairTitemRespVO, Page<DlRepairTitemRespVO> page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新工单子表中维修人员、销售人员信息(app)
|
||||||
|
* @param dlRepairTitem
|
||||||
|
*/
|
||||||
|
void updateRepairAndSale(DlRepairTitem dlRepairTitem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ public interface DlRepairTicketsService extends IService<DlRepairTickets> {
|
|||||||
* @author 小李
|
* @author 小李
|
||||||
* @date 11:33 2024/9/20
|
* @date 11:33 2024/9/20
|
||||||
**/
|
**/
|
||||||
void createTickets(DlRepairTicketsRespVO ticketsRespVO);
|
DlRepairTicketsRespVO createTickets(DlRepairTicketsRespVO ticketsRespVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 维修工单表 分页
|
* 维修工单表 分页
|
||||||
|
@ -34,4 +34,11 @@ public interface DlRepairTitemService extends IService<DlRepairTitem> {
|
|||||||
**/
|
**/
|
||||||
List<DlRepairTitem> getProjectList(String ticketId);
|
List<DlRepairTitem> getProjectList(String ticketId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新工单子表中维修人员、销售人员信息(app)
|
||||||
|
* @param dlRepairTitem
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
DlRepairTitem updateRepairAndSale(DlRepairTitem dlRepairTitem);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
|||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
@DSTransactional
|
@DSTransactional
|
||||||
public void createTickets(DlRepairTicketsRespVO ticketsRespVO) {
|
public DlRepairTicketsRespVO createTickets(DlRepairTicketsRespVO ticketsRespVO) {
|
||||||
|
|
||||||
// 门店信息
|
// 门店信息
|
||||||
Long deptId = SecurityFrameworkUtils.getLoginUserDeptId();
|
Long deptId = SecurityFrameworkUtils.getLoginUserDeptId();
|
||||||
@ -232,6 +232,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
|||||||
repairOrderInfoService.saveOrderInfo(repairOrderInfo);
|
repairOrderInfoService.saveOrderInfo(repairOrderInfo);
|
||||||
//最后记录操作日志--创建工单
|
//最后记录操作日志--创建工单
|
||||||
repairRecordsService.saveRepairRecord(ticketsRespVO.getId(),null, RecordTypeEnum.CJGD.getCode(),"创建工单",null);
|
repairRecordsService.saveRepairRecord(ticketsRespVO.getId(),null, RecordTypeEnum.CJGD.getCode(),"创建工单",null);
|
||||||
|
return ticketsRespVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -48,6 +48,18 @@ public class DlRepairTitemServiceImpl extends ServiceImpl<DlRepairTitemMapper, D
|
|||||||
.eq(DlRepairTitem::getTicketId, ticketId);
|
.eq(DlRepairTitem::getTicketId, ticketId);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新工单子表中维修人员、销售人员信息(app)
|
||||||
|
*
|
||||||
|
* @param dlRepairTitem
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public DlRepairTitem updateRepairAndSale(DlRepairTitem dlRepairTitem) {
|
||||||
|
baseMapper.updateRepairAndSale(dlRepairTitem);
|
||||||
|
return dlRepairTitem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,7 +3,27 @@
|
|||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="cn.iocoder.yudao.module.tickets.mapper.DlRepairTitemMapper">
|
<mapper namespace="cn.iocoder.yudao.module.tickets.mapper.DlRepairTitemMapper">
|
||||||
<select id="getTItemPage" resultType="cn.iocoder.yudao.module.tickets.vo.DlRepairTitemRespVO">
|
<update id="updateRepairAndSale" parameterType="cn.iocoder.yudao.module.tickets.entity.DlRepairTitem">
|
||||||
|
UPDATE dl_repair_titem
|
||||||
|
<set>
|
||||||
|
<if test="repairIds != null">
|
||||||
|
repair_ids = #{repairIds},
|
||||||
|
</if>
|
||||||
|
<if test="repairNames != null">
|
||||||
|
repair_names = #{repairNames},
|
||||||
|
</if>
|
||||||
|
<if test="saleId != null">
|
||||||
|
sale_id = #{saleId},
|
||||||
|
</if>
|
||||||
|
<if test="saleName != null">
|
||||||
|
sale_name = #{saleName},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
WHERE ticket_id = #{ticketId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getTItemPage" resultType="cn.iocoder.yudao.module.tickets.vo.DlRepairTitemRespVO">
|
||||||
SELECT drti.id,
|
SELECT drti.id,
|
||||||
drti.ticket_id,
|
drti.ticket_id,
|
||||||
drti.item_name,
|
drti.item_name,
|
||||||
|
Loading…
Reference in New Issue
Block a user