diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/service/impl/DriveSchoolInfoServiceImpl.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/service/impl/DriveSchoolInfoServiceImpl.java index b87f3790..312a7254 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/service/impl/DriveSchoolInfoServiceImpl.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/jx/service/impl/DriveSchoolInfoServiceImpl.java @@ -267,44 +267,13 @@ public class DriveSchoolInfoServiceImpl implements IDriveSchoolInfoService */ @Override 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); - - if (schoolInfoByDeptId != null) { - schoolInfoByDeptId.setJlId(jlId); - } else { - System.err.println("未找到部门 ID 为 " + deptId + " 的驾校信息"); - throw new RuntimeException("未找到指定部门的驾校信息"); - } - return schoolInfoByDeptId; } - @Override public List findSelfSchoolData() { @@ -319,15 +288,6 @@ public class DriveSchoolInfoServiceImpl implements IDriveSchoolInfoService 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; - }*/ /** * 计算两个经纬度之间的距离 diff --git a/dl-module-jx/src/main/resources/mapper/jx/DriveSchoolInfoMapper.xml b/dl-module-jx/src/main/resources/mapper/jx/DriveSchoolInfoMapper.xml index e3dd1cea..ffd0075b 100644 --- a/dl-module-jx/src/main/resources/mapper/jx/DriveSchoolInfoMapper.xml +++ b/dl-module-jx/src/main/resources/mapper/jx/DriveSchoolInfoMapper.xml @@ -152,7 +152,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" diff --git a/dl-module-jx/src/main/resources/mapper/jx/DriveSchoolSwiperMapper.xml b/dl-module-jx/src/main/resources/mapper/jx/DriveSchoolSwiperMapper.xml index 50e7f386..e5c35404 100644 --- a/dl-module-jx/src/main/resources/mapper/jx/DriveSchoolSwiperMapper.xml +++ b/dl-module-jx/src/main/resources/mapper/jx/DriveSchoolSwiperMapper.xml @@ -128,6 +128,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND list_order = #{driveSchoolSwiper.listOrder} + ORDER BY list_order ASC diff --git a/sql/增量DB.sql b/sql/增量DB.sql new file mode 100644 index 00000000..6c0fb9af --- /dev/null +++ b/sql/增量DB.sql @@ -0,0 +1,3 @@ +--增加封面图字段用来回显首页 +ALTER TABLE `system_service_package` +ADD COLUMN `cover_img` varchar(255) NULL COMMENT '服务icon' AFTER `menu_ids`; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/service/ServicePackageController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/service/ServicePackageController.java index dbd15b11..b8d6c2a5 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/service/ServicePackageController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/service/ServicePackageController.java @@ -88,5 +88,9 @@ public class ServicePackageController { List list = servicePackageService.getServicePackageListByStatus(CommonStatusEnum.ENABLE.getStatus()); return success(BeanUtils.toBean(list, ServicePackageSimpleRespVO.class)); } - -} \ No newline at end of file + @GetMapping({"/getPackageListByTenantId"}) + public CommonResult> getPackageListByTenantId() { + List list = servicePackageService.getPackageListByTenantId(); + return success(list); + } +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/service/vo/ServicePackageRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/service/vo/ServicePackageRespVO.java index 973a3345..56260992 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/service/vo/ServicePackageRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/service/vo/ServicePackageRespVO.java @@ -19,6 +19,7 @@ public class ServicePackageRespVO { @Schema(description = "套餐名", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") @ExcelProperty("套餐名") private String name; + private String coverImg; @Schema(description = "套餐状态(0正常 1停用)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") @ExcelProperty("租户状态(0正常 1停用)") @@ -36,4 +37,4 @@ public class ServicePackageRespVO { @ExcelProperty("创建时间") private LocalDateTime createTime; -} \ No newline at end of file +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/service/vo/ServicePackageSaveReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/service/vo/ServicePackageSaveReqVO.java index ca9c3acf..fa132dd5 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/service/vo/ServicePackageSaveReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/service/vo/ServicePackageSaveReqVO.java @@ -15,6 +15,7 @@ public class ServicePackageSaveReqVO { @Schema(description = "套餐名", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") @NotEmpty(message = "套餐名不能为空") private String name; + private String coverImg; @Schema(description = "套餐状态(0正常 1停用)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") @NotNull(message = "套餐状态(0正常 1停用)不能为空") @@ -27,4 +28,4 @@ public class ServicePackageSaveReqVO { @NotEmpty(message = "关联的菜单编号不能为空") private Set menuIds; -} \ No newline at end of file +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/service/vo/ServicePackageSimpleRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/service/vo/ServicePackageSimpleRespVO.java index 0bf2d82b..1f22a1ec 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/service/vo/ServicePackageSimpleRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/service/vo/ServicePackageSimpleRespVO.java @@ -17,4 +17,5 @@ public class ServicePackageSimpleRespVO { @NotNull(message = "套餐名不能为空") private String name; + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/service/ServicePackageDO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/service/ServicePackageDO.java index 7787592c..55e46527 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/service/ServicePackageDO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/service/ServicePackageDO.java @@ -40,10 +40,11 @@ public class ServicePackageDO extends BaseDO { * 备注 */ private String remark; + private String coverImg; /** * 关联的菜单编号 */ @TableField(typeHandler = JacksonTypeHandler.class) private Set menuIds; -} \ No newline at end of file +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/service/ServicePackageMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/service/ServicePackageMapper.java index daa1d1a3..a52428e3 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/service/ServicePackageMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/service/ServicePackageMapper.java @@ -29,4 +29,7 @@ public interface ServicePackageMapper extends BaseMapperX { default List selectListByStatus(Integer status) { return selectList(ServicePackageDO::getStatus, status); } -} \ No newline at end of file + + + List getPackageListByTenantId(); +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/service/ServicePackageService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/service/ServicePackageService.java index 5edda829..cd1fb307 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/service/ServicePackageService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/service/ServicePackageService.java @@ -78,4 +78,14 @@ public interface ServicePackageService { * @param ids ids **/ List getServicePackageByIds(List ids); -} \ No newline at end of file + + /** + * 查租户服务 + * + * @author zcy + * @date 10:37 2024/9/24 + **/ + List getPackageListByTenantId(); + + +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/service/ServicePackageServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/service/ServicePackageServiceImpl.java index 2a2085a0..40cf2ed4 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/service/ServicePackageServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/service/ServicePackageServiceImpl.java @@ -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.datapermission.core.rule.DataPermissionRule; 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.module.system.api.service.dto.ServicePackageDto; 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.RoleService; import cn.iocoder.yudao.module.system.service.tenant.TenantService; +import com.alibaba.fastjson.JSONArray; import org.springframework.stereotype.Service; import javax.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -155,4 +158,19 @@ public class ServicePackageServiceImpl implements ServicePackageService { public List getServicePackageByIds(List ids){ return servicePackageMapper.selectList(new LambdaQueryWrapperX().in(ServicePackageDO::getId, ids)); } -} \ No newline at end of file + + @Override + public List getPackageListByTenantId() { + //获取当前登录用户 + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + Long tenantId = loginUser.getTenantId(); + TenantDO tenant = tenantService.getTenant(tenantId); + Set packageId = tenant.getPackageId(); + List ids =new ArrayList<>(); + for (String s : packageId) { + ids.add(s); + } + return this.getServicePackageByIds(ids); + + } +}