Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
35ae8e340f
@ -80,6 +80,8 @@ public class SecurityConfig {
|
||||
.requestMatchers("/mapLayer/**").permitAll()
|
||||
.requestMatchers("/mapmodule/**").permitAll()
|
||||
.requestMatchers("/mapLegend/**").permitAll()
|
||||
.requestMatchers("/base/msalongb/**").permitAll()
|
||||
.requestMatchers("/base/msalongdetb/**").permitAll()
|
||||
.requestMatchers("/sms/**").permitAll()
|
||||
.requestMatchers(HttpMethod.GET, "/").permitAll()
|
||||
.requestMatchers(HttpMethod.GET,
|
||||
|
||||
@ -197,4 +197,12 @@ public class SwaggerConfig {
|
||||
.packagesToScan("com.yfd.platform.qgc_sys.mapcfg.controller")
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public GroupedOpenApi groupLygkApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("6. 沿程配置管理")
|
||||
.packagesToScan("com.yfd.platform.qgc_lygk.along.controller")
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package com.yfd.platform.qgc_lygk.along.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongB;
|
||||
import com.yfd.platform.qgc_lygk.along.service.IMsAlongBService;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 沿程配置表控制器
|
||||
*
|
||||
* @author migration
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base/msalongb")
|
||||
@Tag(name = "沿程配置表控制器")
|
||||
public class MsAlongBController {
|
||||
|
||||
@Resource
|
||||
private IMsAlongBService msAlongBService;
|
||||
/**
|
||||
* 条件过滤数据列表
|
||||
*/
|
||||
@Operation(summary = "条件过滤数据列表")
|
||||
@PostMapping("/GetKendoList")
|
||||
public ResponseResult getKendoList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
DataSourceResult<MsAlongB> result = msAlongBService.getKendoList(dataSourceRequest);
|
||||
return ResponseResult.successData(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存或修改
|
||||
*/
|
||||
@Operation(summary = "保存或修改")
|
||||
@PostMapping("/save")
|
||||
public ResponseResult save(@RequestBody MsAlongB msAlongB) {
|
||||
if (msAlongB == null) {
|
||||
return ResponseResult.error("沿程配置信息不能为空.");
|
||||
}
|
||||
if (StrUtil.isBlank(msAlongB.getName())) {
|
||||
throw new BizException("沿程配置名称(name)不能为空.");
|
||||
}
|
||||
if (StrUtil.isBlank(msAlongB.getCode())) {
|
||||
throw new BizException("沿程配置编码(code)不能为空.");
|
||||
}
|
||||
msAlongBService.saveOrUpdate(msAlongB);
|
||||
return ResponseResult.success("保存成功.");
|
||||
}
|
||||
|
||||
// @Operation(summary = "沿程配置删除")
|
||||
// @PostMapping("/delete")
|
||||
// public ResponseResult deleteData(@RequestBody List<String> ids) {
|
||||
// mapmoduleBService.delelteByIds(ids);
|
||||
// return ResponseResult.success("删除成功.");
|
||||
// }
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
package com.yfd.platform.qgc_lygk.along.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongB;
|
||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongDetB;
|
||||
import com.yfd.platform.qgc_lygk.along.service.IMsAlongDetBService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 沿程配置明细表控制器
|
||||
*
|
||||
* @author migration
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base/msalongdetb")
|
||||
@Tag(name = "沿程配置明细表控制器")
|
||||
public class MsAlongDetBController {
|
||||
|
||||
@Resource
|
||||
private IMsAlongDetBService msAlongDetBService;
|
||||
|
||||
/**
|
||||
* 条件过滤数据列表
|
||||
*/
|
||||
@Operation(summary = "条件过滤数据列表")
|
||||
@PostMapping("/GetKendoList")
|
||||
public ResponseResult getKendoList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
DataSourceResult<MsAlongDetB> result = msAlongDetBService.getKendoList(dataSourceRequest);
|
||||
return ResponseResult.successData(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存或修改
|
||||
*/
|
||||
@Operation(summary = "保存或修改")
|
||||
@PostMapping("/save")
|
||||
public ResponseResult save(@RequestBody MsAlongDetB msAlongDetB) {
|
||||
if (msAlongDetB == null) {
|
||||
return ResponseResult.error("沿程配置明细信息不能为空.");
|
||||
}
|
||||
msAlongDetBService.saveOrUpdate(msAlongDetB);
|
||||
return ResponseResult.success("保存成功.");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,87 @@
|
||||
package com.yfd.platform.qgc_lygk.along.domain;
|
||||
|
||||
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 io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 沿程配置表
|
||||
*
|
||||
* @author migration
|
||||
*/
|
||||
@Data
|
||||
@TableName("MS_ALONG_B")
|
||||
@Schema(description = "沿程配置表")
|
||||
public class MsAlongB implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
/** 沿程配置名称 */
|
||||
@TableField("NAME")
|
||||
private String name;
|
||||
|
||||
/** 沿程配置编码 */
|
||||
@TableField("CODE")
|
||||
private String code;
|
||||
|
||||
/** 沿程配置所属流域 */
|
||||
@TableField("RVCD")
|
||||
private String rvcd;
|
||||
|
||||
/** 河流名称(非数据库字段) */
|
||||
@TableField(exist = false)
|
||||
private String rvnm;
|
||||
|
||||
/** 备注 */
|
||||
@TableField("REMARK")
|
||||
private String remark;
|
||||
|
||||
/** 创建人 */
|
||||
@TableField("RECORD_USER")
|
||||
private String recordUser;
|
||||
|
||||
/** 创建人名称(非数据库字段) */
|
||||
@TableField(exist = false)
|
||||
private String recordUserName;
|
||||
|
||||
/** 创建时间 */
|
||||
@TableField("RECORD_TIME")
|
||||
private Date recordTime;
|
||||
|
||||
/** 更新人 */
|
||||
@TableField("MODIFY_USER")
|
||||
private String modifyUser;
|
||||
|
||||
/** 更新人名称(非数据库字段) */
|
||||
@TableField(exist = false)
|
||||
private String modifyUserName;
|
||||
|
||||
/** 更新时间 */
|
||||
@TableField("MODIFY_TIME")
|
||||
private Date modifyTime;
|
||||
|
||||
/** 是否已删除:0=未删除 1=已删除 */
|
||||
@TableField("IS_DELETED")
|
||||
private Integer isDeleted;
|
||||
|
||||
/** 删除人 */
|
||||
@TableField("DELETE_USER")
|
||||
private String deleteUser;
|
||||
|
||||
/** 删除时间 */
|
||||
@TableField("DELETE_TIME")
|
||||
private Date deleteTime;
|
||||
|
||||
/** 排序 */
|
||||
@TableField("ORDER_INDEX")
|
||||
private Integer orderIndex;
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
package com.yfd.platform.qgc_lygk.along.domain;
|
||||
|
||||
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 io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 沿程配置明细表
|
||||
*
|
||||
* @author migration
|
||||
*/
|
||||
@Data
|
||||
@TableName("MS_ALONGDET_B")
|
||||
@Schema(description = "沿程配置明细表")
|
||||
@Accessors(chain = true)
|
||||
public class MsAlongDetB implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
/** 站点编码 */
|
||||
@TableField("STCD")
|
||||
private String stcd;
|
||||
|
||||
/** 站点名称(非数据库字段) */
|
||||
@TableField(exist = false)
|
||||
private String stnm;
|
||||
|
||||
/** 所属电站编码 */
|
||||
@TableField("RSTCD")
|
||||
private String rstcd;
|
||||
|
||||
/** 排序序号 */
|
||||
@TableField("SORT")
|
||||
private String sort;
|
||||
|
||||
/** 沿程配置表ID */
|
||||
@TableField("ALONG_ID")
|
||||
private String alongId;
|
||||
|
||||
/** 站类 */
|
||||
@TableField("STTP")
|
||||
private String sttp;
|
||||
|
||||
/** 站类名称(非数据库字段) */
|
||||
@TableField(exist = false)
|
||||
private String sttpName;
|
||||
|
||||
/** 创建人 */
|
||||
@TableField("RECORD_USER")
|
||||
private String recordUser;
|
||||
|
||||
/** 创建时间 */
|
||||
@TableField("RECORD_TIME")
|
||||
private Date recordTime;
|
||||
|
||||
/** 更新人 */
|
||||
@TableField("MODIFY_USER")
|
||||
private String modifyUser;
|
||||
|
||||
/** 更新时间 */
|
||||
@TableField("MODIFY_TIME")
|
||||
private Date modifyTime;
|
||||
|
||||
/** 是否已删除:0=未删除 1=已删除 */
|
||||
@TableField("IS_DELETED")
|
||||
private Integer isDeleted;
|
||||
|
||||
/** 删除人 */
|
||||
@TableField("DELETE_USER")
|
||||
private String deleteUser;
|
||||
|
||||
/** 删除时间 */
|
||||
@TableField("DELETE_TIME")
|
||||
private Date deleteTime;
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package com.yfd.platform.qgc_lygk.along.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongB;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 沿程配置表 Mapper 接口
|
||||
*
|
||||
* @author migration
|
||||
*/
|
||||
@Mapper
|
||||
public interface MsAlongBMapper extends BaseMapper<MsAlongB> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package com.yfd.platform.qgc_lygk.along.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongDetB;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 沿程配置明细表 Mapper 接口
|
||||
*
|
||||
* @author migration
|
||||
*/
|
||||
@Mapper
|
||||
public interface MsAlongDetBMapper extends BaseMapper<MsAlongDetB> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package com.yfd.platform.qgc_lygk.along.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongB;
|
||||
|
||||
/**
|
||||
* 沿程配置表 Service 接口
|
||||
*
|
||||
* @author migration
|
||||
*/
|
||||
public interface IMsAlongBService extends IService<MsAlongB> {
|
||||
/**
|
||||
* 条件过滤数据列表(Kendo 数据源)
|
||||
*
|
||||
* @param dataSourceRequest 数据源请求
|
||||
* @return 数据源结果
|
||||
*/
|
||||
DataSourceResult<MsAlongB> getKendoList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
// /**
|
||||
// * 保存或更新沿程配置
|
||||
// *
|
||||
// * @param msAlongB 沿程配置实体
|
||||
// */
|
||||
// void saveOrUpdate(MsAlongB msAlongB);
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package com.yfd.platform.qgc_lygk.along.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongDetB;
|
||||
|
||||
/**
|
||||
* 沿程配置明细表 Service 接口
|
||||
*
|
||||
* @author migration
|
||||
*/
|
||||
public interface IMsAlongDetBService extends IService<MsAlongDetB> {
|
||||
|
||||
/**
|
||||
* 条件过滤数据列表(Kendo 数据源)
|
||||
*
|
||||
* @param dataSourceRequest 数据源请求
|
||||
* @return 数据源结果
|
||||
*/
|
||||
DataSourceResult<MsAlongDetB> getKendoList(DataSourceRequest dataSourceRequest);
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package com.yfd.platform.qgc_lygk.along.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yfd.platform.common.DataSourceLoadOptionsBase;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongB;
|
||||
import com.yfd.platform.qgc_lygk.along.mapper.MsAlongBMapper;
|
||||
import com.yfd.platform.qgc_lygk.along.service.IMsAlongBService;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 沿程配置表 Service 实现类
|
||||
*
|
||||
* @author migration
|
||||
*/
|
||||
@Service
|
||||
public class MsAlongBServiceImpl extends ServiceImpl<MsAlongBMapper, MsAlongB> implements IMsAlongBService {
|
||||
|
||||
@Override
|
||||
public DataSourceResult<MsAlongB> getKendoList(DataSourceRequest dataSourceRequest) {
|
||||
// 1. 构建查询条件
|
||||
QueryWrapper<MsAlongB> wrapper = DataSourceRequestUtil.buildQueryWrapper(
|
||||
dataSourceRequest, MsAlongB.class);
|
||||
|
||||
// 2. 分页参数处理
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest == null ? null : dataSourceRequest.toDevRequest();
|
||||
Page<MsAlongB> page = loadOptions == null ? null
|
||||
: (Page<MsAlongB>) QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake());
|
||||
|
||||
// 3. 执行查询
|
||||
Page<MsAlongB> resultPage;
|
||||
if (page != null) {
|
||||
resultPage = this.page(page, wrapper);
|
||||
} else {
|
||||
List<MsAlongB> list = this.list(wrapper);
|
||||
resultPage = new Page<>();
|
||||
resultPage.setRecords(list);
|
||||
resultPage.setTotal(list.size());
|
||||
}
|
||||
|
||||
// 4. 构建结果
|
||||
DataSourceResult<MsAlongB> dataSourceResult = new DataSourceResult<>();
|
||||
dataSourceResult.setData(resultPage.getRecords());
|
||||
dataSourceResult.setTotal(resultPage.getTotal());
|
||||
return dataSourceResult;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public boolean saveOrUpdate(MsAlongB msAlongB) {
|
||||
// super.saveOrUpdate(msAlongB);
|
||||
// return super.saveOrUpdate(msAlongB);
|
||||
// }
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
package com.yfd.platform.qgc_lygk.along.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yfd.platform.common.DataSourceLoadOptionsBase;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongDetB;
|
||||
import com.yfd.platform.qgc_lygk.along.mapper.MsAlongDetBMapper;
|
||||
import com.yfd.platform.qgc_lygk.along.service.IMsAlongDetBService;
|
||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 沿程配置明细表 Service 实现类
|
||||
*
|
||||
* @author migration
|
||||
*/
|
||||
@Service
|
||||
public class MsAlongDetBServiceImpl extends ServiceImpl<MsAlongDetBMapper, MsAlongDetB> implements IMsAlongDetBService {
|
||||
|
||||
@Resource
|
||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||
|
||||
private static final List<CodeToNameMetadataBo> CODE_TO_NAME_META_LIST = new ArrayList<>();
|
||||
|
||||
static {
|
||||
CODE_TO_NAME_META_LIST.add(CodeToNameMetadataBo.builder().codeProperty("stcd").modifyProperty("stnm").dictType("DYNAMIC").dictSource("SD_ENGINFO_B_H").codeColumn("STCD").nameColumn("ENNM").filter("IS_DELETED = 0 ").build());
|
||||
CODE_TO_NAME_META_LIST.add(CodeToNameMetadataBo.builder().codeProperty("sttp").modifyProperty("sttpName").dictType("DYNAMIC").dictSource("SD_STTP_B").codeColumn("STTP_CODE").nameColumn("STTP_NAME").filter("IS_DELETED = 0 ").build());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSourceResult<MsAlongDetB> getKendoList(DataSourceRequest dataSourceRequest) {
|
||||
// 1. 构建查询条件
|
||||
QueryWrapper<MsAlongDetB> wrapper = DataSourceRequestUtil.buildQueryWrapper(
|
||||
dataSourceRequest, MsAlongDetB.class);
|
||||
|
||||
// 2. 分页参数处理
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest == null ? null : dataSourceRequest.toDevRequest();
|
||||
Page<MsAlongDetB> page = loadOptions == null ? null
|
||||
: (Page<MsAlongDetB>) QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake());
|
||||
|
||||
// 3. 执行查询
|
||||
Page<MsAlongDetB> resultPage;
|
||||
if (page != null) {
|
||||
resultPage = this.page(page, wrapper);
|
||||
dictCodeToNameConverter.convertCodeToName(resultPage,CODE_TO_NAME_META_LIST);
|
||||
} else {
|
||||
List<MsAlongDetB> list = this.list(wrapper);
|
||||
dictCodeToNameConverter.convertCodeToName(list,CODE_TO_NAME_META_LIST);
|
||||
resultPage = new Page<>();
|
||||
resultPage.setRecords(list);
|
||||
resultPage.setTotal(list.size());
|
||||
}
|
||||
|
||||
// 4. 构建结果
|
||||
DataSourceResult<MsAlongDetB> dataSourceResult = new DataSourceResult<>();
|
||||
dataSourceResult.setData(resultPage.getRecords());
|
||||
dataSourceResult.setTotal(resultPage.getTotal());
|
||||
return dataSourceResult;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user