feat:DATA BASE相关接口,去掉首页及在线开发相关接口
This commit is contained in:
parent
10993896c7
commit
f25bf758c9
|
@ -0,0 +1,37 @@
|
|||
package org.jeecg.modules.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.api.QueryRequest;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.modules.system.entity.GardsSampleData;
|
||||
import org.jeecg.modules.system.service.IGardsSampleDataService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("gardsSampleData")
|
||||
@Api(value = "DATA BASE管理", tags = "DATA BASE管理")
|
||||
public class GardsSampleDataController {
|
||||
|
||||
@Autowired
|
||||
private IGardsSampleDataService gardsSampleDataService;
|
||||
|
||||
@GetMapping("findPage")
|
||||
@ApiOperation(value = "分页查询DATA_BASE数据", notes = "分页查询DATA_BASE数据")
|
||||
public Result<IPage<GardsSampleData>> findPage(QueryRequest queryRequest, GardsSampleData gardsSampleData){
|
||||
Result<IPage<GardsSampleData>> result = gardsSampleDataService.findPage(queryRequest, gardsSampleData);
|
||||
return result;
|
||||
}
|
||||
|
||||
@DeleteMapping("deleteById")
|
||||
@ApiOperation(value = "删除DATA_BASE数据", notes = "删除DATA_BASE数据")
|
||||
public Result deleteById(Integer sampleId){
|
||||
return gardsSampleDataService.deleteById(sampleId);
|
||||
}
|
||||
|
||||
}
|
|
@ -249,34 +249,34 @@ public class SysPermissionController {
|
|||
List<SysPermission> metaList = sysPermissionService.queryByUser(loginUser.getUsername());
|
||||
//添加首页路由
|
||||
//update-begin-author:taoyan date:20200211 for: TASK #3368 【路由缓存】首页的缓存设置有问题,需要根据后台的路由配置来实现是否缓存
|
||||
if(!PermissionDataUtil.hasIndexPage(metaList)){
|
||||
SysPermission indexMenu = sysPermissionService.list(new LambdaQueryWrapper<SysPermission>().eq(SysPermission::getName,"首页")).get(0);
|
||||
metaList.add(0,indexMenu);
|
||||
}
|
||||
// if(!PermissionDataUtil.hasIndexPage(metaList)){
|
||||
// SysPermission indexMenu = sysPermissionService.list(new LambdaQueryWrapper<SysPermission>().eq(SysPermission::getName,"首页")).get(0);
|
||||
// metaList.add(0,indexMenu);
|
||||
// }
|
||||
//update-end-author:taoyan date:20200211 for: TASK #3368 【路由缓存】首页的缓存设置有问题,需要根据后台的路由配置来实现是否缓存
|
||||
|
||||
//update-begin--Author:zyf Date:20220425 for:自定义首页地址 LOWCOD-1578
|
||||
String version = request.getHeader(CommonConstant.VERSION);
|
||||
// String version = request.getHeader(CommonConstant.VERSION);
|
||||
//update-begin---author:liusq ---date:2022-06-29 for:接口返回值修改,同步修改这里的判断逻辑-----------
|
||||
SysRoleIndex roleIndex= sysUserService.getDynamicIndexByUserRole(loginUser.getUsername(),version);
|
||||
// SysRoleIndex roleIndex= sysUserService.getDynamicIndexByUserRole(loginUser.getUsername(),version);
|
||||
//update-end---author:liusq ---date:2022-06-29 for:接口返回值修改,同步修改这里的判断逻辑-----------
|
||||
//update-end--Author:zyf Date:20220425 for:自定义首页地址 LOWCOD-1578
|
||||
|
||||
if(roleIndex!=null){
|
||||
List<SysPermission> menus = metaList.stream().filter(sysPermission -> "首页".equals(sysPermission.getName())).collect(Collectors.toList());
|
||||
//update-begin---author:liusq ---date:2022-06-29 for:设置自定义首页地址和组件----------
|
||||
String component = roleIndex.getComponent();
|
||||
String routeUrl = roleIndex.getUrl();
|
||||
boolean route = roleIndex.isRoute();
|
||||
if(oConvertUtils.isNotEmpty(routeUrl)){
|
||||
menus.get(0).setComponent(component);
|
||||
menus.get(0).setRoute(route);
|
||||
menus.get(0).setUrl(routeUrl);
|
||||
}else{
|
||||
menus.get(0).setComponent(component);
|
||||
}
|
||||
//update-end---author:liusq ---date:2022-06-29 for:设置自定义首页地址和组件-----------
|
||||
}
|
||||
// if(roleIndex!=null){
|
||||
// List<SysPermission> menus = metaList.stream().filter(sysPermission -> "首页".equals(sysPermission.getName())).collect(Collectors.toList());
|
||||
// //update-begin---author:liusq ---date:2022-06-29 for:设置自定义首页地址和组件----------
|
||||
// String component = roleIndex.getComponent();
|
||||
// String routeUrl = roleIndex.getUrl();
|
||||
// boolean route = roleIndex.isRoute();
|
||||
// if(oConvertUtils.isNotEmpty(routeUrl)){
|
||||
// menus.get(0).setComponent(component);
|
||||
// menus.get(0).setRoute(route);
|
||||
// menus.get(0).setUrl(routeUrl);
|
||||
// }else{
|
||||
// menus.get(0).setComponent(component);
|
||||
// }
|
||||
// //update-end---author:liusq ---date:2022-06-29 for:设置自定义首页地址和组件-----------
|
||||
// }
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
JSONArray menujsonArray = new JSONArray();
|
||||
|
|
|
@ -0,0 +1,90 @@
|
|||
package org.jeecg.modules.system.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("GARDS_SAMPLE_DATA")
|
||||
public class GardsSampleData implements Serializable {
|
||||
|
||||
@TableField(value = "SITE_DET_CODE")
|
||||
private String siteDetCode;
|
||||
|
||||
@TableField(value = "SAMPLE_ID")
|
||||
private Integer sampleId;
|
||||
|
||||
@TableField(value = "STATION_ID")
|
||||
private Integer stationId;
|
||||
|
||||
@TableField(value = "DETECTOR_ID")
|
||||
private Integer detectorId;
|
||||
|
||||
@TableField(value = "INPUT_FILE_NAME")
|
||||
private String inputFileName;
|
||||
|
||||
@TableField(value = "SAMPLE_TYPE")
|
||||
private String sampleType;
|
||||
|
||||
@TableField(value = "DATA_TYPE")
|
||||
private String dataType;
|
||||
|
||||
@TableField(value = "GEOMETRY")
|
||||
private String geometry;
|
||||
|
||||
@TableField(value = "SPECTRAL_QUALIFIE")
|
||||
private String spectralQualifie;
|
||||
|
||||
@TableField(value = "TRANSMIT_DTG")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date transmitDtg;
|
||||
|
||||
@TableField(value = "COLLECT_START")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date collectStart;
|
||||
|
||||
@TableField(value = "COLLECT_STOP")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date collectStop;
|
||||
|
||||
@TableField(value = "ACQUISITION_START")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date acquisitionStart;
|
||||
|
||||
@TableField(value = "ACQUISITION_STOP")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date acquisitionStop;
|
||||
|
||||
@TableField(value = "ACQUISITION_REAL_SEC")
|
||||
private Double acquisitionRealSec;
|
||||
|
||||
@TableField(value = "ACQUISITION_LIVE_SEC")
|
||||
private Double acquisitionLiveSec;
|
||||
|
||||
@TableField(value = "QUANTITY")
|
||||
private Double quantity;
|
||||
|
||||
@TableField(value = "STATUS")
|
||||
private String status;
|
||||
|
||||
@TableField(value = "MODDATE")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date moddate;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String stationName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String detectorsName;
|
||||
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package org.jeecg.modules.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.system.entity.GardsSampleData;
|
||||
|
||||
public interface GardsSampleDataMapper extends BaseMapper<GardsSampleData> {
|
||||
}
|
|
@ -50,10 +50,10 @@
|
|||
join sys_user_role c on c.role_id = b.id
|
||||
join sys_user d on d.id = c.user_id
|
||||
where p.id = a.permission_id AND d.username = #{username,jdbcType=VARCHAR}
|
||||
)
|
||||
or (p.url like '%:code' and p.url like '/online%' and p.hidden = 1)
|
||||
or (p.url like '%:id' and p.url like '/online%' and p.hidden = 1)
|
||||
or p.url = '/online')
|
||||
))
|
||||
<!-- or (p.url like '%:code' and p.url like '/online%' and p.hidden = 1)
|
||||
or (p.url like '%:id' and p.url like '/online%' and p.hidden = 1
|
||||
or p.url = '/online' -->
|
||||
and p.del_flag = 0
|
||||
<!--update begin Author:lvdandan Date:20200213 for:加入部门权限 -->
|
||||
UNION
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
package org.jeecg.modules.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.common.api.QueryRequest;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.modules.system.entity.GardsSampleData;
|
||||
|
||||
public interface IGardsSampleDataService extends IService<GardsSampleData> {
|
||||
|
||||
/**
|
||||
* 分页查询DATA BASE数据
|
||||
* @param queryRequest
|
||||
* @param gardsSampleData
|
||||
* @return
|
||||
*/
|
||||
Result<IPage<GardsSampleData>> findPage(QueryRequest queryRequest, GardsSampleData gardsSampleData);
|
||||
|
||||
/**
|
||||
* 删除DATA BASE数据
|
||||
* @param sampleId
|
||||
* @return
|
||||
*/
|
||||
Result deleteById(Integer sampleId);
|
||||
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
package org.jeecg.modules.system.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.common.api.QueryRequest;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.modules.system.entity.GardsDetectors;
|
||||
import org.jeecg.modules.system.entity.GardsSampleData;
|
||||
import org.jeecg.modules.system.entity.GardsStations;
|
||||
import org.jeecg.modules.system.mapper.GardsSampleDataMapper;
|
||||
import org.jeecg.modules.system.service.IGardsDetectorsService;
|
||||
import org.jeecg.modules.system.service.IGardsSampleDataService;
|
||||
import org.jeecg.modules.system.service.IGardsStationsService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service("gardsSampleDataService")
|
||||
@DS("ori")
|
||||
public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMapper, GardsSampleData> implements IGardsSampleDataService {
|
||||
|
||||
@Autowired
|
||||
private IGardsStationsService gardsStationsService;
|
||||
|
||||
@Autowired
|
||||
private IGardsDetectorsService gardsDetectorsService;
|
||||
|
||||
@Override
|
||||
public Result<IPage<GardsSampleData>> findPage(QueryRequest queryRequest, GardsSampleData gardsSampleData) {
|
||||
//查询全部台站信息
|
||||
List<GardsStations> gardsStations = gardsStationsService.getGardsStations();
|
||||
//查询全部监测器信息
|
||||
List<GardsDetectors> detectors = gardsDetectorsService.findDetectors();
|
||||
Result<IPage<GardsSampleData>> result = new Result<>();
|
||||
Page<GardsSampleData> page = new Page<>(queryRequest.getPageNo(), queryRequest.getPageSize());
|
||||
LambdaQueryWrapper<GardsSampleData> queryWrapper = new LambdaQueryWrapper<>();
|
||||
Page<GardsSampleData> sampleDataPage = this.baseMapper.selectPage(page, queryWrapper);
|
||||
sampleDataPage.getRecords().forEach(item->{
|
||||
if (CollectionUtils.isNotEmpty(gardsStations)){
|
||||
for (GardsStations stations:gardsStations) {
|
||||
if (stations.getStationId().equals(item.getStationId())){
|
||||
item.setStationName(stations.getStationCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(detectors)){
|
||||
for (GardsDetectors detector:detectors) {
|
||||
if (detector.getDetectorId().equals(item.getDetectorId())){
|
||||
item.setDetectorsName(detector.getDetectorCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
result.setSuccess(true);
|
||||
result.setResult(sampleDataPage);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Result deleteById(Integer sampleId) {
|
||||
Result result = new Result();
|
||||
LambdaQueryWrapper<GardsSampleData> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(GardsSampleData::getSampleId, sampleId);
|
||||
this.baseMapper.delete(queryWrapper);
|
||||
result.success("删除成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user