首页业务处理
This commit is contained in:
parent
d5beed0206
commit
771a4eeadf
@ -267,44 +267,13 @@ public class DriveSchoolInfoServiceImpl implements IDriveSchoolInfoService
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public DriveSchoolInfoVO getSchoolInfoByDeptId(Long deptId) {
|
public DriveSchoolInfoVO getSchoolInfoByDeptId(Long deptId) {
|
||||||
// 记录deptId
|
|
||||||
System.out.println("Dept ID: " + deptId);
|
|
||||||
|
|
||||||
// 获取教练id
|
|
||||||
Long jlId = 0L;
|
|
||||||
|
|
||||||
// 根据当前用户的手机号获取教练信息
|
|
||||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
|
||||||
AdminUserRespDTO sysUser = userApi.getUser(userId);
|
|
||||||
String phonenumber = sysUser.getMobile();
|
|
||||||
System.out.println("当前用户手机号: " + phonenumber);
|
|
||||||
|
|
||||||
// 获取教练信息
|
|
||||||
DriveSchoolCoach driveSchoolCoach = driveSchoolCoachMapper.selectByPhonenumber(phonenumber);
|
|
||||||
if (driveSchoolCoach != null) {
|
|
||||||
jlId = driveSchoolCoach.getId();
|
|
||||||
System.out.println("教练ID: " + jlId);
|
|
||||||
} else {
|
|
||||||
System.err.println("未找到手机号为 " + phonenumber + " 的教练信息");
|
|
||||||
// 可以选择抛出异常或返回默认值
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取驾校信息
|
// 获取驾校信息
|
||||||
DriveSchoolInfoVO schoolInfoByDeptId = driveSchoolInfoMapper.getSchoolInfoByDeptId(deptId);
|
DriveSchoolInfoVO schoolInfoByDeptId = driveSchoolInfoMapper.getSchoolInfoByDeptId(deptId);
|
||||||
|
|
||||||
if (schoolInfoByDeptId != null) {
|
|
||||||
schoolInfoByDeptId.setJlId(jlId);
|
|
||||||
} else {
|
|
||||||
System.err.println("未找到部门 ID 为 " + deptId + " 的驾校信息");
|
|
||||||
throw new RuntimeException("未找到指定部门的驾校信息");
|
|
||||||
}
|
|
||||||
|
|
||||||
return schoolInfoByDeptId;
|
return schoolInfoByDeptId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PayVo> findSelfSchoolData() {
|
public List<PayVo> findSelfSchoolData() {
|
||||||
|
|
||||||
@ -319,15 +288,6 @@ public class DriveSchoolInfoServiceImpl implements IDriveSchoolInfoService
|
|||||||
return payVoList;
|
return payVoList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@Override
|
|
||||||
public DriveSchoolInfo selectDriveSchoolInfoAppletById(Long id) {
|
|
||||||
DriveSchoolInfo driveSchoolInfo = driveSchoolInfoMapper.selectDriveSchoolInfoById(id);
|
|
||||||
double lat = driveSchoolInfo1.getLat().doubleValue();
|
|
||||||
double lgt = driveSchoolInfo1.getLgt().doubleValue();
|
|
||||||
double distance = calculateDistance(driveSchoolInfo.getLat().doubleValue(), driveSchoolInfo.getLgt().doubleValue(), lat, lgt);
|
|
||||||
driveSchoolInfo1.setDistance(distance/1000);
|
|
||||||
return null;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计算两个经纬度之间的距离
|
* 计算两个经纬度之间的距离
|
||||||
|
@ -152,7 +152,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
<select id="getSchoolInfoByDeptId" parameterType="Long" resultMap="DriveSchoolInfoVOResult">
|
<select id="getSchoolInfoByDeptId" parameterType="Long" resultMap="DriveSchoolInfoVOResult">
|
||||||
<include refid="selectDriveSchoolInfoVo"/>
|
<include refid="selectDriveSchoolInfoVo"/>
|
||||||
where deleted = 0 and dept_id = #{deptId}
|
where deleted = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
@ -128,6 +128,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
AND list_order = #{driveSchoolSwiper.listOrder}
|
AND list_order = #{driveSchoolSwiper.listOrder}
|
||||||
</if>
|
</if>
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
</where>
|
</where>
|
||||||
ORDER BY list_order ASC
|
ORDER BY list_order ASC
|
||||||
</select>
|
</select>
|
||||||
|
3
sql/增量DB.sql
Normal file
3
sql/增量DB.sql
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
--增加封面图字段用来回显首页
|
||||||
|
ALTER TABLE `system_service_package`
|
||||||
|
ADD COLUMN `cover_img` varchar(255) NULL COMMENT '服务icon' AFTER `menu_ids`;
|
@ -88,5 +88,9 @@ public class ServicePackageController {
|
|||||||
List<ServicePackageDO> list = servicePackageService.getServicePackageListByStatus(CommonStatusEnum.ENABLE.getStatus());
|
List<ServicePackageDO> list = servicePackageService.getServicePackageListByStatus(CommonStatusEnum.ENABLE.getStatus());
|
||||||
return success(BeanUtils.toBean(list, ServicePackageSimpleRespVO.class));
|
return success(BeanUtils.toBean(list, ServicePackageSimpleRespVO.class));
|
||||||
}
|
}
|
||||||
|
@GetMapping({"/getPackageListByTenantId"})
|
||||||
}
|
public CommonResult<List<ServicePackageDO>> getPackageListByTenantId() {
|
||||||
|
List<ServicePackageDO> list = servicePackageService.getPackageListByTenantId();
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -19,6 +19,7 @@ public class ServicePackageRespVO {
|
|||||||
@Schema(description = "套餐名", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
@Schema(description = "套餐名", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||||
@ExcelProperty("套餐名")
|
@ExcelProperty("套餐名")
|
||||||
private String name;
|
private String name;
|
||||||
|
private String coverImg;
|
||||||
|
|
||||||
@Schema(description = "套餐状态(0正常 1停用)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
@Schema(description = "套餐状态(0正常 1停用)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
@ExcelProperty("租户状态(0正常 1停用)")
|
@ExcelProperty("租户状态(0正常 1停用)")
|
||||||
@ -36,4 +37,4 @@ public class ServicePackageRespVO {
|
|||||||
@ExcelProperty("创建时间")
|
@ExcelProperty("创建时间")
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ public class ServicePackageSaveReqVO {
|
|||||||
@Schema(description = "套餐名", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
@Schema(description = "套餐名", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||||
@NotEmpty(message = "套餐名不能为空")
|
@NotEmpty(message = "套餐名不能为空")
|
||||||
private String name;
|
private String name;
|
||||||
|
private String coverImg;
|
||||||
|
|
||||||
@Schema(description = "套餐状态(0正常 1停用)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
@Schema(description = "套餐状态(0正常 1停用)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
@NotNull(message = "套餐状态(0正常 1停用)不能为空")
|
@NotNull(message = "套餐状态(0正常 1停用)不能为空")
|
||||||
@ -27,4 +28,4 @@ public class ServicePackageSaveReqVO {
|
|||||||
@NotEmpty(message = "关联的菜单编号不能为空")
|
@NotEmpty(message = "关联的菜单编号不能为空")
|
||||||
private Set<Long> menuIds;
|
private Set<Long> menuIds;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -17,4 +17,5 @@ public class ServicePackageSimpleRespVO {
|
|||||||
@NotNull(message = "套餐名不能为空")
|
@NotNull(message = "套餐名不能为空")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -40,10 +40,11 @@ public class ServicePackageDO extends BaseDO {
|
|||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
private String remark;
|
private String remark;
|
||||||
|
private String coverImg;
|
||||||
/**
|
/**
|
||||||
* 关联的菜单编号
|
* 关联的菜单编号
|
||||||
*/
|
*/
|
||||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||||
private Set<Long> menuIds;
|
private Set<Long> menuIds;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -29,4 +29,7 @@ public interface ServicePackageMapper extends BaseMapperX<ServicePackageDO> {
|
|||||||
default List<ServicePackageDO> selectListByStatus(Integer status) {
|
default List<ServicePackageDO> selectListByStatus(Integer status) {
|
||||||
return selectList(ServicePackageDO::getStatus, status);
|
return selectList(ServicePackageDO::getStatus, status);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
List<ServicePackageDO> getPackageListByTenantId();
|
||||||
|
}
|
||||||
|
@ -78,4 +78,14 @@ public interface ServicePackageService {
|
|||||||
* @param ids ids
|
* @param ids ids
|
||||||
**/
|
**/
|
||||||
List<ServicePackageDO> getServicePackageByIds(List<String> ids);
|
List<ServicePackageDO> getServicePackageByIds(List<String> ids);
|
||||||
}
|
|
||||||
|
/**
|
||||||
|
* 查租户服务
|
||||||
|
*
|
||||||
|
* @author zcy
|
||||||
|
* @date 10:37 2024/9/24
|
||||||
|
**/
|
||||||
|
List<ServicePackageDO> getPackageListByTenantId();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -4,6 +4,8 @@ import cn.iocoder.yudao.framework.common.config.CommonStr;
|
|||||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||||
import cn.iocoder.yudao.framework.datapermission.core.rule.DataPermissionRule;
|
import cn.iocoder.yudao.framework.datapermission.core.rule.DataPermissionRule;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||||
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
|
import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
|
||||||
import cn.iocoder.yudao.module.system.api.service.dto.ServicePackageDto;
|
import cn.iocoder.yudao.module.system.api.service.dto.ServicePackageDto;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RoleSaveReqVO;
|
import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RoleSaveReqVO;
|
||||||
@ -14,6 +16,7 @@ import cn.iocoder.yudao.module.system.enums.permission.RoleTypeEnum;
|
|||||||
import cn.iocoder.yudao.module.system.service.permission.PermissionService;
|
import cn.iocoder.yudao.module.system.service.permission.PermissionService;
|
||||||
import cn.iocoder.yudao.module.system.service.permission.RoleService;
|
import cn.iocoder.yudao.module.system.service.permission.RoleService;
|
||||||
import cn.iocoder.yudao.module.system.service.tenant.TenantService;
|
import cn.iocoder.yudao.module.system.service.tenant.TenantService;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -155,4 +158,19 @@ public class ServicePackageServiceImpl implements ServicePackageService {
|
|||||||
public List<ServicePackageDO> getServicePackageByIds(List<String> ids){
|
public List<ServicePackageDO> getServicePackageByIds(List<String> ids){
|
||||||
return servicePackageMapper.selectList(new LambdaQueryWrapperX<ServicePackageDO>().in(ServicePackageDO::getId, ids));
|
return servicePackageMapper.selectList(new LambdaQueryWrapperX<ServicePackageDO>().in(ServicePackageDO::getId, ids));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@Override
|
||||||
|
public List<ServicePackageDO> getPackageListByTenantId() {
|
||||||
|
//获取当前登录用户
|
||||||
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
|
Long tenantId = loginUser.getTenantId();
|
||||||
|
TenantDO tenant = tenantService.getTenant(tenantId);
|
||||||
|
Set<String> packageId = tenant.getPackageId();
|
||||||
|
List<String> ids =new ArrayList<>();
|
||||||
|
for (String s : packageId) {
|
||||||
|
ids.add(s);
|
||||||
|
}
|
||||||
|
return this.getServicePackageByIds(ids);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user