Преглед изворни кода

修改创建租户时是否包含机场

tags/v2.5.0^2
xiao пре 1 година
родитељ
комит
d3278d210c
8 измењених фајлова са 43 додато и 11 уклоњено
  1. +8
    -2
      tuoheng_oidc_admin/src/main/java/com/tuoheng/controller/PlatformController.java
  2. +10
    -2
      tuoheng_oidc_admin/src/main/java/com/tuoheng/model/dto/Platform.java
  3. +3
    -1
      tuoheng_oidc_admin/src/main/java/com/tuoheng/service/PlatformService.java
  4. +22
    -6
      tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/PlatformServiceImpl.java
  5. BIN
      tuoheng_oidc_admin/target/classes/com/tuoheng/controller/PlatformController.class
  6. BIN
      tuoheng_oidc_admin/target/classes/com/tuoheng/model/dto/Platform.class
  7. BIN
      tuoheng_oidc_admin/target/classes/com/tuoheng/service/PlatformService.class
  8. BIN
      tuoheng_oidc_admin/target/classes/com/tuoheng/service/impl/PlatformServiceImpl.class

+ 8
- 2
tuoheng_oidc_admin/src/main/java/com/tuoheng/controller/PlatformController.java Прегледај датотеку

@@ -5,6 +5,7 @@ import com.tuoheng.until.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
@@ -23,7 +24,12 @@ public class PlatformController {
* @return
*/
@GetMapping("/list")
public JsonResult list(){
return platformService.findAll();
// public JsonResult list(){
// return platformService.findAll();
// }

public JsonResult listWithAirportOption(@RequestParam boolean includeAirport) {
return platformService.findAllWithAirportOption(includeAirport);
}

}

+ 10
- 2
tuoheng_oidc_admin/src/main/java/com/tuoheng/model/dto/Platform.java Прегледај датотеку

@@ -4,15 +4,17 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
* 平台表
*
* @TableName platform
*/
@TableName(value ="platform")
@TableName(value = "platform")
@Data
public class Platform implements Serializable {
/**
@@ -63,4 +65,10 @@ public class Platform implements Serializable {

@TableField(exist = false)
private static final long serialVersionUID = 1L;

/**
*是否包含机场平台
*/
@TableField("is_airport")
private Boolean isAirport;
}

+ 3
- 1
tuoheng_oidc_admin/src/main/java/com/tuoheng/service/PlatformService.java Прегледај датотеку

@@ -14,5 +14,7 @@ public interface PlatformService extends IService<Platform> {
* 查询各平台名称
* @return
*/
JsonResult findAll();
//JsonResult findAll();
JsonResult findAllWithAirportOption(boolean includeAirport);

}

+ 22
- 6
tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/PlatformServiceImpl.java Прегледај датотеку

@@ -1,10 +1,11 @@
package com.tuoheng.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tuoheng.mapper.PlatformMapper;
import com.tuoheng.model.dto.Platform;
import com.tuoheng.service.PlatformService;
import com.tuoheng.mapper.PlatformMapper;
import com.tuoheng.until.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -28,14 +29,29 @@ public class PlatformServiceImpl extends ServiceImpl<PlatformMapper, Platform>
*
* @return
*/
// @Override
// public JsonResult findAll() {
//
// List<Platform> platforms = platformMapper.selectList(Wrappers.<Platform>lambdaQuery()
// .eq(Platform::getMark, 1));
//
// return JsonResult.success(platforms);
// }

//通过机场条件进行查询
@Override
public JsonResult findAll() {

List<Platform> platforms = platformMapper.selectList(Wrappers.<Platform>lambdaQuery()
.eq(Platform::getMark, 1));

public JsonResult findAllWithAirportOption(boolean includeAirport) {
LambdaQueryWrapper<Platform> queryWrapper = Wrappers.<Platform>lambdaQuery()
.eq(Platform::getMark, 1);
// 筛选是否含机场平台
if (!includeAirport) {
queryWrapper.eq(Platform::getIsAirport, false); // 只筛选非机场平台
}

List<Platform> platforms = platformMapper.selectList(queryWrapper);
return JsonResult.success(platforms);
}

}



BIN
tuoheng_oidc_admin/target/classes/com/tuoheng/controller/PlatformController.class Прегледај датотеку


BIN
tuoheng_oidc_admin/target/classes/com/tuoheng/model/dto/Platform.class Прегледај датотеку


BIN
tuoheng_oidc_admin/target/classes/com/tuoheng/service/PlatformService.class Прегледај датотеку


BIN
tuoheng_oidc_admin/target/classes/com/tuoheng/service/impl/PlatformServiceImpl.class Прегледај датотеку


Loading…
Откажи
Сачувај