oracle相关实体类中TableName注解表名前增加实例名称

This commit is contained in:
qiaoqinzheng 2023-07-07 14:48:31 +08:00
parent 478ee60133
commit 7478db42c8
78 changed files with 380 additions and 212 deletions

View File

@ -11,7 +11,7 @@ import java.io.Serializable;
* 谱数据到达的时间分析开始和结束时间分析员姓名使用的软件谱分析使用的参数基线类型寻峰方式核素识别方法
*/
@Data
@TableName("GARDS_ANALYSES")
@TableName("RNAUTO.GARDS_ANALYSES")
public class GardsAnalyses implements Serializable {
/**

View File

@ -10,7 +10,7 @@ import java.io.Serializable;
* 存储β-γ符合谱中#b_ gefficiency 数据块中的探测器符合效率刻度点
*/
@Data
@TableName("GARDS_BG_EFFICIENCY_PAIRS")
@TableName("ORIGINAL.GARDS_BG_EFFICIENCY_PAIRS")
public class GardsBgEfficiencyPairs implements Serializable {
/**

View File

@ -9,7 +9,7 @@ import java.io.Serializable;
* 存储数据分析过程中能量分辨率和效率刻度的拟合结果
*/
@Data
@TableName("GARDS_CALIBRATION")
@TableName("RNAUTO.GARDS_CALIBRATION")
public class GardsCalibration implements Serializable {
/**

View File

@ -9,7 +9,7 @@ import java.io.Serializable;
* 存储数据分析过程中能量分辨率和效率刻度实际使用的刻度点数据
*/
@Data
@TableName("GARDS_CALIBRATION_PAIRS")
@TableName("RNAUTO.GARDS_CALIBRATION_PAIRS")
public class GardsCalibrationPairs implements Serializable {
/**

View File

@ -10,7 +10,7 @@ import java.io.Serializable;
* 存储所有能谱中#g_energy#b_energy#b_resolution#g_resolution#g_efficiency数据块中的刻度点
*/
@Data
@TableName("GARDS_CALIBRATION_PAIRS_ORIG")
@TableName("ORIGINAL.GARDS_CALIBRATION_PAIRS_ORIG")
public class GardsCalibrationPairsOrig implements Serializable {
/**

View File

@ -10,7 +10,7 @@ import java.io.Serializable;
* 存储β-γ符合谱中#histogram数据块中的数据
*/
@Data
@TableName("GARDS_HISTOGRAM")
@TableName("ORIGINAL.GARDS_HISTOGRAM")
public class GardsHistogram implements Serializable {
/**

View File

@ -10,7 +10,7 @@ import java.io.Serializable;
import java.util.Date;
@Data
@TableName(value = "gards_met_data")
@TableName(value = "ORIGINAL.GARDS_MET_DATA")
public class GardsMetData implements Serializable {
/**

View File

@ -10,7 +10,7 @@ import java.io.Serializable;
* 存储gamma谱中识别到的核素计算结果
*/
@Data
@TableName("GARDS_NUCL_IDED")
@TableName("RNAUTO.GARDS_NUCL_IDED")
public class GardsNuclIded implements Serializable {
/**

View File

@ -10,7 +10,7 @@ import java.io.Serializable;
* 存储gamma谱中识别到的峰计算结果
*/
@Data
@TableName("GARDS_NUCL_LINES_IDED")
@TableName("RNAUTO.GARDS_NUCL_LINES_IDED")
public class GardsNuclLinesIded implements Serializable {
/**

View File

@ -8,7 +8,7 @@ import java.io.Serializable;
* 存储gamma谱的寻峰结果
*/
@Data
@TableName("GARDS_PEAKS")
@TableName("RNAUTO.GARDS_PEAKS")
public class GardsPeaks implements Serializable {
/**

View File

@ -10,7 +10,7 @@ import java.io.Serializable;
* 存储β-γ符合谱中感兴趣区道址边界数据
*/
@Data
@TableName("GARDS_ROI_CHANNELS")
@TableName("RNAUTO.GARDS_ROI_CHANNELS")
public class GardsRoiChannels implements Serializable {
/**

View File

@ -9,7 +9,7 @@ import java.io.Serializable;
* 存储β-γ符合谱中#ROI_LMITS 数据块中的感兴趣区能量边界数据
*/
@Data
@TableName("GARDS_ROI_LIMITS")
@TableName("ORIGINAL.GARDS_ROI_LIMITS")
public class GardsRoiLimits implements Serializable {
/**

View File

@ -10,7 +10,7 @@ import java.io.Serializable;
* 存储β-γ符合谱中分析过程中的有关感兴趣区ROI计算的中间结果
*/
@Data
@TableName("GARDS_ROI_RESULTS")
@TableName("RNAUTO.GARDS_ROI_RESULTS")
public class GardsRoiResults implements Serializable {
/**

View File

@ -10,7 +10,7 @@ import java.util.Date;
* 存储所有原始数据的基本数据
*/
@Data
@TableName("GARDS_SAMPLE_DATA")
@TableName("ORIGINAL.GARDS_SAMPLE_AUX")
public class GardsSampleAux implements Serializable {
/**

View File

@ -11,7 +11,7 @@ import java.util.Date;
* 存储QCPHD CALIBPHD谱中#CERTIFICATE数据块中的内容
*/
@Data
@TableName("GARDS_SAMPLE_CERT")
@TableName("ORIGINAL.GARDS_SAMPLE_CERT")
public class GardsSampleCert implements Serializable {
/**

View File

@ -9,7 +9,7 @@ import java.io.Serializable;
* 存储QCPHD CALIBPHD谱中#CERTIFICATE数据块中的内容
*/
@Data
@TableName("GARDS_SAMPLE_CERT_LINE")
@TableName("ORIGINAL.GARDS_SAMPLE_CERT_LINE")
public class GardsSampleCertLine implements Serializable {
/**

View File

@ -10,7 +10,7 @@ import java.io.Serializable;
import java.util.Date;
@Data
@TableName("GARDS_SAMPLE_DATA")
@TableName("ORIGINAL.GARDS_SAMPLE_DATA")
public class GardsSampleData implements Serializable {
/**

View File

@ -9,7 +9,7 @@ import java.io.Serializable;
* 存储台站注释
*/
@Data
@TableName("GARDS_SAMPLE_DESCRIPTION")
@TableName("ORIGINAL.GARDS_SAMPLE_DESCRIPTION")
public class GardsSampleDescription implements Serializable {
/**

View File

@ -9,7 +9,7 @@ import java.io.Serializable;
* 存储β-γ符合谱中# Ratios 数据块中的感兴趣区相应核素的计数比率
*/
@Data
@TableName("GARDS_SAMPLE_RATIOS")
@TableName("ORIGINAL.GARDS_SAMPLE_RATIOS")
public class GardsSampleRatios implements Serializable {
/**

View File

@ -10,7 +10,7 @@ import java.io.Serializable;
import java.util.Date;
@Data
@TableName(value = "gards_soh_data")
@TableName(value = "ORIGINAL.GARDS_SOH_DATA")
public class GardsSohData implements Serializable {
/**

View File

@ -9,7 +9,7 @@ import java.io.Serializable;
* 存储所有能谱中#G_Spectrum和#B_Spectrum数据块中的数据
*/
@Data
@TableName("GARDS_SPECTRUM")
@TableName("ORIGINAL.GARDS_SPECTRUM")
public class GardsSpectrum implements Serializable {
/**

View File

@ -11,7 +11,7 @@ import java.io.Serializable;
* IDC没有
*/
@Data
@TableName("GARDS_TOTAL_EFFICIENCY_PAIRS")
@TableName("ORIGINAL.GARDS_TOTAL_EFFICIENCY_PAIRS")
public class GardsTotalEfficiencyPairs implements Serializable {
/**

View File

@ -10,7 +10,7 @@ import java.io.Serializable;
* 存储β-γ符合谱最终分析结果
*/
@Data
@TableName("GARDS_XE_RESULTS")
@TableName("RNAUTO.GARDS_XE_RESULTS")
public class GardsXeResults implements Serializable {
/**

View File

@ -24,15 +24,15 @@ public class SpectrumAnalysesController {
@GetMapping("getDBSearchList")
@ApiOperation(value = "查询台站,探测器数据接口", notes = "查询台站,探测器数据接口")
public Result getDBSearchList(String menuType){
return spectrumAnalysisService.getDBSearchList(menuType);
public Result getDBSearchList(String[] menuTypes){
return spectrumAnalysisService.getDBSearchList(menuTypes);
}
@GetMapping("getDBSpectrumList")
@ApiOperation(value = "获取数据库中交互分析基础数据", notes = "获取数据库中交互分析基础数据")
public Result getDBSpectrumList(QueryRequest queryRequest, GardsSampleData gardsSampleData, String dbName, String menuType,boolean CollectStop, boolean AcqStart,
public Result getDBSpectrumList(QueryRequest queryRequest, GardsSampleData gardsSampleData, String dbName, String[] menuTypes,boolean CollectStop, boolean AcqStart,
@DateTimeFormat(pattern = "yyyy-MM-dd") Date startDate, @DateTimeFormat(pattern = "yyyy-MM-dd") Date endDate) {
return spectrumAnalysisService.getDBSpectrumList(queryRequest, gardsSampleData, dbName, menuType, CollectStop, AcqStart, startDate, endDate);
return spectrumAnalysisService.getDBSpectrumList(queryRequest, gardsSampleData, dbName, menuTypes, CollectStop, AcqStart, startDate, endDate);
}

View File

@ -8,8 +8,8 @@ import java.util.Date;
public interface ISpectrumAnalysisService {
Result getDBSearchList(String menuType);
Result getDBSearchList(String[] menuTypes);
Result getDBSpectrumList(QueryRequest queryRequest, GardsSampleData gardsSampleData, String dbName, String menuType, boolean CollectStop, boolean AcqStart, Date startDate, Date endDate);
Result getDBSpectrumList(QueryRequest queryRequest, GardsSampleData gardsSampleData, String dbName, String[] menuTypes, boolean CollectStop, boolean AcqStart, Date startDate, Date endDate);
}

View File

@ -7,7 +7,7 @@ import java.util.List;
public interface ISysDictService extends IService<SysDict> {
List<String> findStationType(String menuType);
List<String> findStationType(List<String> menuTypeList);
}

View File

@ -23,7 +23,7 @@ import java.util.*;
import java.util.stream.Collectors;
@Service("spectrumAnalysisService")
@DS("auo")
@DS("ora")
public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
@Autowired
@ -36,15 +36,16 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
private GardsDetectorsMapper gardsDetectorsMapper;
@Override
public Result getDBSearchList(String menuType) {
public Result getDBSearchList(String[] menuTypes) {
Result result = new Result();
Map<String, List<String>> map = new HashMap<>();
List<String> menuTypeList = Arrays.asList(menuTypes);
//查询谱对应的台站类型
if (StringUtils.isBlank(menuType)){
if (CollectionUtils.isEmpty(menuTypeList)){
result.error500("谱类型不能为空");
return result;
}
List<String> stationTypes = sysDictService.findStationType(menuType);
List<String> stationTypes = sysDictService.findStationType(menuTypeList);
if (CollectionUtils.isEmpty(stationTypes)) {
result.error500("请先补充数据字典中当前系统类型对应的台站类型信息");
return result;
@ -73,7 +74,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
}
@Override
public Result getDBSpectrumList(QueryRequest queryRequest, GardsSampleData gardsSampleData, String dbName, String menuType, boolean CollectStop, boolean AcqStart, Date startDate, Date endDate) {
public Result getDBSpectrumList(QueryRequest queryRequest, GardsSampleData gardsSampleData, String dbName, String[] menuTypes, boolean CollectStop, boolean AcqStart, Date startDate, Date endDate) {
Result result = new Result();
if (Objects.isNull(startDate)){
result.error500("开始时间不能为空");
@ -85,11 +86,12 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
return result;
}
String endTime = DateUtils.formatDate(endDate, "yyyy-MM-dd") + " 23:59:59";
if (StringUtils.isBlank(menuType)){
List<String> menuTypeList = Arrays.asList(menuTypes);
if (CollectionUtils.isEmpty(menuTypeList)){
result.error500("谱类型不能为空");
return result;
}
List<String> stationTypes = sysDictService.findStationType(menuType);
List<String> stationTypes = sysDictService.findStationType(menuTypeList);
if (CollectionUtils.isEmpty(stationTypes)) {
result.error500("请先补充数据字典中当前系统类型对应的台站类型信息");
return result;

View File

@ -30,11 +30,11 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
@Override
@Transactional(propagation = Propagation.REQUIRES_NEW)
public List<String> findStationType(String menuType) {
public List<String> findStationType(List<String> menuTypeList) {
List<String> menuTypes = new LinkedList<>();
if (menuType.equals("B")) {
if (menuTypeList.contains("B")) {
menuTypes.add("Noble Gas Beta-Gamma");
}else if (menuType.equals("G")) {
}else if (menuTypeList.contains("G")) {
menuTypes.add("Particulate");
menuTypes.add("Noble Gas HPGe");
}

View File

@ -7,7 +7,7 @@ import org.jeecg.modules.base.entity.GardsMetData;
import java.util.List;
@DS("ori")
@DS("ora")
public interface StationMetDataMapper extends BaseMapper<GardsMetData> {
List<GardsMetData> findMetDataList(@Param("stationIds") List<String> stationIds, @Param("startDate") String startDate);

View File

@ -7,7 +7,7 @@ import org.jeecg.modules.base.entity.GardsSampleData;
import java.util.List;
@DS("ori")
@DS("ora")
public interface StationSampleDataMapper extends BaseMapper<GardsSampleData> {
List<GardsSampleData> findSampleDataList(@Param("detectorIds") List<Integer> detectorIds, @Param("startDate") String startDate);

View File

@ -7,7 +7,7 @@ import org.jeecg.modules.base.entity.GardsSohData;
import java.util.List;
@DS("ori")
@DS("ora")
public interface StationSohDataMapper extends BaseMapper<GardsSohData> {
List<GardsSohData> findSohDataList(@Param("stationId") String stationId, @Param("detectorIds") List<Integer> detectorIds, @Param("startDate") String startDate);

View File

@ -1,7 +0,0 @@
package org.jeecg.modules.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.entity.SysUser;
public interface SysUserMapper extends BaseMapper<SysUser> {
}

View File

@ -1,5 +1,6 @@
package org.jeecg.modules.service;
import org.jeecg.modules.entity.SysUser;
import org.jeecg.modules.system.entity.GardsDetectors;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
@ -19,4 +20,7 @@ public interface ICacheTimeService {
@RequestMapping("/gardsDetectors/findStationDetectors")
Map<String, List<GardsDetectors>> findStationDetectors(@RequestBody List<String> stationIds);
@RequestMapping("/sys/user/findUserByName")
SysUser findUserByName(String userName);
}

View File

@ -17,7 +17,6 @@ import org.jeecg.modules.entity.SysUserFocusStation;
import org.jeecg.modules.entity.UserFocusStation;
import org.jeecg.modules.mapper.StationReceivingConfigMapper;
import org.jeecg.modules.mapper.SysUserFocusStationMapper;
import org.jeecg.modules.mapper.SysUserMapper;
import org.jeecg.modules.service.ICacheTimeService;
import org.jeecg.modules.service.ISysUserFocusStationService;
import org.jeecg.modules.system.entity.GardsStations;
@ -28,7 +27,6 @@ import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
@Service("sysUserFocusStationService")
public class SysUserFocusStationServiceImpl extends ServiceImpl<SysUserFocusStationMapper, SysUserFocusStation> implements ISysUserFocusStationService {
@ -36,8 +34,6 @@ public class SysUserFocusStationServiceImpl extends ServiceImpl<SysUserFocusStat
@Autowired
private RedisUtil redisUtil;
@Autowired
private SysUserMapper sysUserMapper;
@Autowired
private ICacheTimeService cacheTimeService;
@Autowired
private StationReceivingConfigMapper stationReceivingConfigMapper;
@ -78,9 +74,7 @@ public class SysUserFocusStationServiceImpl extends ServiceImpl<SysUserFocusStat
//获取当前操作人用户名
String username = JwtUtil.getUserNameByToken(request);
//根据用户名称查询对应的用户信息
LambdaQueryWrapper<SysUser> userQueryWrapper = new LambdaQueryWrapper<>();
userQueryWrapper.eq(SysUser::getUsername, username);
SysUser sysUser = sysUserMapper.selectOne(userQueryWrapper);
SysUser sysUser = cacheTimeService.findUserByName(username);
if (Objects.isNull(sysUser)){
result.error500("当前用户不存在!");
return result;
@ -141,9 +135,7 @@ public class SysUserFocusStationServiceImpl extends ServiceImpl<SysUserFocusStat
//获取当前操作人用户名
String username = JwtUtil.getUserNameByToken(request);
//根据用户名称查询对应的用户信息
LambdaQueryWrapper<SysUser> userQueryWrapper = new LambdaQueryWrapper<>();
userQueryWrapper.eq(SysUser::getUsername, username);
SysUser sysUser = sysUserMapper.selectOne(userQueryWrapper);
SysUser sysUser = cacheTimeService.findUserByName(username);
if (Objects.isNull(sysUser)){
result.error500("当前用户不存在!");
return result;

View File

@ -14,7 +14,7 @@ import java.io.Serializable;
import java.util.Date;
@Data
@TableName("GARDS_DETECTORS")
@TableName("CONFIGURATION.GARDS_DETECTORS")
public class GardsDetectors implements Serializable {
@TableField(value = "DETECTOR_ID")

View File

@ -10,7 +10,7 @@ import java.io.Serializable;
import java.util.Date;
@Data
@TableName("GARDS_NUCLEARFACILITY")
@TableName("CONFIGURATION.GARDS_NUCLEARFACILITY")
public class GardsNuclearfacility implements Serializable {
@TableField(value = "FACILITY_ID")

View File

@ -10,7 +10,7 @@ import java.io.Serializable;
import java.util.Date;
@Data
@TableName(value = "GARDS_STATIONS")
@TableName(value = "CONFIGURATION.GARDS_STATIONS")
public class GardsStations implements Serializable {
@TableField(value = "STATION_ID")

View File

@ -20,6 +20,7 @@ import org.jeecg.common.system.vo.DictQuery;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.*;
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
import org.jeecg.modules.system.entity.GardsStations;
import org.jeecg.modules.system.entity.SysDict;
import org.jeecg.modules.system.entity.SysDictItem;
import org.jeecg.modules.system.model.SysDictTree;
@ -698,4 +699,10 @@ public class SysDictController {
sysDictService.editDictByLowAppId(sysDictVo);
return Result.ok("编辑成功");
}
@RequestMapping("/findStationListByMenuName")
public List<GardsStations> findStationListByMenuName(String menuName){
return sysDictService.findStationListByMenuName(menuName);
}
}

View File

@ -1766,4 +1766,9 @@ public class SysUserController {
return sysUserService.findUserMap();
}
@GetMapping("findUserByName")
public SysUser findUserByName(String userName){
return sysUserService.getUserByName(userName);
}
}

View File

@ -14,7 +14,7 @@ import java.io.Serializable;
import java.util.Date;
@Data
@TableName("GARDS_DETECTORS")
@TableName("CONFIGURATION.GARDS_DETECTORS")
public class GardsDetectors implements Serializable {
/**

View File

@ -14,7 +14,7 @@ import java.io.Serializable;
import java.util.Date;
@Data
@TableName("GARDS_NUCLEARFACILITY")
@TableName("CONFIGURATION.GARDS_NUCLEARFACILITY")
public class GardsNuclearfacility implements Serializable {
/**

View File

@ -17,7 +17,7 @@ import java.sql.Timestamp;
import java.util.Date;
@Data
@TableName(value = "GARDS_STATIONS")
@TableName(value = "CONFIGURATION.GARDS_STATIONS")
public class GardsStations implements Serializable {
/**

View File

@ -20,7 +20,7 @@
MODDATE,
STATION_ID
FROM
GARDS_DETECTORS
CONFIGURATION.GARDS_DETECTORS
<where>
<if test="gardsDetectors.detectorCode != '' and gardsDetectors.detectorCode != null">
and DETECTOR_CODE like CONCAT('%',#{gardsDetectors.detectorCode},'%')
@ -36,7 +36,7 @@
</select>
<select id="findType" resultType="java.lang.String">
SELECT DISTINCT TYPE FROM GARDS_DETECTORS
SELECT DISTINCT TYPE FROM CONFIGURATION.GARDS_DETECTORS
</select>
</mapper>

View File

@ -3,11 +3,11 @@
<mapper namespace="org.jeecg.modules.system.mapper.GardsNuclearfacilityMapper">
<select id="findType" resultType="java.lang.String">
SELECT DISTINCT TYPE FROM GARDS_NUCLEARFACILITY
SELECT DISTINCT TYPE FROM CONFIGURATION.GARDS_NUCLEARFACILITY
</select>
<select id="findLocation" resultType="java.lang.String">
SELECT DISTINCT LOCATION FROM GARDS_NUCLEARFACILITY
SELECT DISTINCT LOCATION FROM CONFIGURATION.GARDS_NUCLEARFACILITY
</select>
</mapper>

View File

@ -3,11 +3,11 @@
<mapper namespace="org.jeecg.modules.system.mapper.GardsStationsMapper">
<select id="findType" resultType="java.lang.String">
SELECT DISTINCT TYPE FROM GARDS_STATIONS
SELECT DISTINCT TYPE FROM CONFIGURATION.GARDS_STATIONS
</select>
<select id="findCountryCode" resultType="java.lang.String">
SELECT DISTINCT COUNTRY_CODE FROM GARDS_STATIONS
SELECT DISTINCT COUNTRY_CODE FROM CONFIGURATION.GARDS_STATIONS
</select>
</mapper>

View File

@ -3,6 +3,7 @@ package org.jeecg.modules.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.system.vo.DictModel;
import org.jeecg.common.system.vo.DictQuery;
import org.jeecg.modules.system.entity.GardsStations;
import org.jeecg.modules.system.entity.SysDict;
import org.jeecg.modules.system.entity.SysDictItem;
import org.jeecg.modules.system.model.TreeSelectModel;
@ -274,4 +275,7 @@ public interface ISysDictService extends IService<SysDict> {
* @param sysDictVo
*/
void editDictByLowAppId(SysDictVo sysDictVo);
List<GardsStations> findStationListByMenuName(String menuName);
}

View File

@ -26,7 +26,7 @@ import java.util.List;
import java.util.Objects;
@Service("gardsSampleDataService")
@DS("ori")
@DS("ora")
public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMapper, GardsSampleData> implements IGardsSampleDataService {
@Autowired
private RedisUtil redisUtil;

View File

@ -3,9 +3,11 @@ package org.jeecg.modules.system.service.impl;
import cn.hutool.core.util.RandomUtil;
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 lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.config.TenantContext;
import org.jeecg.common.constant.CacheConstant;
import org.jeecg.common.constant.CommonConstant;
@ -18,9 +20,11 @@ import org.jeecg.common.system.util.ResourceUtil;
import org.jeecg.common.system.vo.DictModel;
import org.jeecg.common.system.vo.DictModelMany;
import org.jeecg.common.system.vo.DictQuery;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.common.util.SqlInjectionUtil;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
import org.jeecg.modules.system.entity.GardsStations;
import org.jeecg.modules.system.entity.SysDict;
import org.jeecg.modules.system.entity.SysDictItem;
import org.jeecg.modules.system.mapper.SysDictItemMapper;
@ -53,6 +57,8 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
private SysDictMapper sysDictMapper;
@Autowired
private SysDictItemMapper sysDictItemMapper;
@Autowired
private RedisUtil redisUtil;
/**
* 通过查询指定code 获取字典
@ -531,6 +537,39 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
this.updateDictItem(id,sysDictVo.getDictItemsList());
}
@Override
public List<GardsStations> findStationListByMenuName(String menuName) {
List<GardsStations> gardsStationsList = new LinkedList<>();
//获取台站信息
HashMap<String, GardsStations> stationInfoMap = (HashMap<String, GardsStations>) redisUtil.get("stationInfoMap");
List<GardsStations> stationsList = stationInfoMap.values().stream().sorted(Comparator.comparing(GardsStations::getStationId)).collect(Collectors.toList());
//如果传递的菜单名称不为空 则需要过滤出所需的台站信息
if (StringUtils.isNotBlank(menuName)){
//根据菜单名称查询出数据字典中对应的内容
LambdaQueryWrapper<SysDict> dictQueryWrapper = new LambdaQueryWrapper<>();
dictQueryWrapper.eq(SysDict::getDictCode, menuName);
SysDict sysDict = sysDictMapper.selectOne(dictQueryWrapper);
//如果字典内容不为空
if (Objects.nonNull(sysDict)){
LambdaQueryWrapper<SysDictItem> dictItemQueryWrapper = new LambdaQueryWrapper<>();
dictItemQueryWrapper.eq(SysDictItem::getDictId, sysDict.getId());
List<SysDictItem> dictItems = sysDictItemMapper.selectList(dictItemQueryWrapper);
List<String> types = dictItems.stream().map(SysDictItem::getItemValue).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(types)){
//遍历过滤出和类型匹配的台站信息 存入新的数据集合中
for (String type:types) {
gardsStationsList.addAll(stationsList.stream().filter(item-> StringUtils.isNotBlank(item.getType()) && item.getType().equals(type)).collect(Collectors.toList()));
}
}
}else {
gardsStationsList.addAll(stationsList);
}
}else {
gardsStationsList.addAll(stationsList);
}
return gardsStationsList;
}
/**
* 添加字典
* @param dictName

View File

@ -5,6 +5,7 @@ import io.swagger.annotations.ApiOperation;
import org.jeecg.common.api.QueryRequest;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.service.*;
import org.jeecg.modules.system.entity.GardsStations;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
@ -12,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.List;
@RestController
@RequestMapping("webStatistics")
@ -19,13 +21,13 @@ import java.util.Date;
public class WebStatisticsController {
@Autowired
private IGardsSampleDataService gardsSampleDataService;
private IGardsSampleDataWebService gardsSampleDataWebService;
@Autowired
private IGardsMetDataService gardsMetDataService;
@Autowired
private IGardsSohDataService gardsSohDataService;
@Autowired
private ISysDictService sysDictService;
private IMenuNameService menuNameService;
@Autowired
private IGardsSampleCertService gardsSampleCertService;
@ -33,14 +35,18 @@ public class WebStatisticsController {
@GetMapping("findStationList")
@ApiOperation(value = "根据菜单名称查询对应的台站信息", notes = "根据菜单名称查询对应的台站信息")
public Result findStationList(String menuName){
return sysDictService.findList(menuName);
Result result = new Result();
List<GardsStations> gardsStations = menuNameService.findStationListByMenuName(menuName);
result.setSuccess(true);
result.setResult(gardsStations);
return result;
}
@GetMapping("findParticulatePage")
@ApiOperation(value = "气溶胶分页查询", notes = "气溶胶分页查询")
public Result findParticulatePage(QueryRequest queryRequest, Integer[] stationIds, String dataType,
String spectralQualifie, @DateTimeFormat(pattern = "yyyy-MM-dd") Date startTime,@DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime){
return gardsSampleDataService.findParticulatePage(queryRequest, stationIds, dataType, spectralQualifie, startTime, endTime);
return gardsSampleDataWebService.findParticulatePage(queryRequest, stationIds, dataType, spectralQualifie, startTime, endTime);
}
@GetMapping("findMetPage")
@ -58,7 +64,7 @@ public class WebStatisticsController {
@GetMapping("findGeneratedReport")
@ApiOperation(value = "查询报告详情页面", notes = "查询报告详情页面")
public Result findGeneratedReport(Integer sampleId){
return gardsSampleDataService.findGeneratedReport(sampleId);
return gardsSampleDataWebService.findGeneratedReport(sampleId);
}
}

View File

@ -0,0 +1,175 @@
package org.jeecg.modules.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(value = "RNAUTO.GARDS_ANALYSES")
public class GardsAnalysesAuto implements Serializable {
/**
* 分析ID号
*/
@TableField(value = "IDANALYSIS")
private Integer idAnalysis;
/**
* 样品id
*/
@TableField(value = "SAMPLE_ID")
private Integer sampleId;
/**
* 分析开始时间
*/
@TableField(value = "ANALYSISBEGIN")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date analysisBegin;
/**
* 分析结束时间
*/
@TableField(value = "ANALYSISEND")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date analysisEnd;
/**
* Reviewed:交互
*/
@TableField(value = "TYPE")
private String type;
/**
* 使用的软件名称
*/
@TableField(value = "SOFTWARE")
private String software;
/**
* 软件版本号
*/
@TableField(value = "SWVERSION")
private String swVersion;
/**
* 分析员名称
*/
@TableField(value = "ANALYST")
private String analyst;
/**
* 基线计数方法描述
*/
@TableField(value = "BASELINEMETHOD")
private String baseLineMethod;
/**
* 寻峰方法描述
*/
@TableField(value = "PEAKSMETHOD")
private String peaksMethod;
/**
* 核素识别方法描述
*/
@TableField(value = "NUCLIDEMETHOD")
private String nuclideMethod;
/**
* 不确定度计算描述
*/
@TableField(value = "UNCCALCMETHOD")
private String unccalcMethod;
/**
* Lc计算方法描述
*/
@TableField(value = "LCMETHOD")
private String lcMethod;
/**
* 寻峰起始道
*/
@TableField(value = "SEARCHSTARTCHANNEL")
private Integer searchStartChannel;
/**
* 寻峰结束道
*/
@TableField(value = "SEARCHENDCHANNEL")
private Integer searchEndChannel;
/**
* 寻峰阈值能窗宽度
*/
@TableField(value = "SEARCHTHRESHOLD")
private Double searchThreshold;
/**
* 峰数目
*/
@TableField(value = "NUMBEROFPEAKS")
private Integer numberOfPeaks;
/**
* 总计数
*/
@TableField(value = "TOTALCOUNTS")
private Double totalCounts;
/**
* 分级结果
*/
@TableField(value = "CATEGORY")
private Integer cateGory;
/**
* 注释
*/
@TableField(value = "COMMENTS")
private String comments;
/**
* 操作时间
*/
@TableField(value = "MODDATE")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date moddate;
@TableField(value = "USEDGASPHD")
private String usedGasPhd;
@TableField(value = "USEDDETPHD")
private String usedDetPhd;
@TableField(value = "USEDGASPHD_ID")
private Integer usedGasPhdId;
@TableField(value = "USEDDETPHD_ID")
private Integer usedDetPhdId;
@TableField(value = "BASELINE_PATH")
private String baseLinePath;
@TableField(value = "LC_PATH")
private String lcPath;
@TableField(value = "SCAC_PATH")
private String scacPath;
@TableField(value = "LOG_PATH")
private String logPath;
@TableField(value = "REPORT_PAHT")
private String reportPath;
}

View File

@ -10,8 +10,8 @@ import java.io.Serializable;
import java.util.Date;
@Data
@TableName(value = "gards_analyses")
public class GardsAnalyses implements Serializable {
@TableName(value = "RNMAN.GARDS_ANALYSES")
public class GardsAnalysesMan implements Serializable {
/**
* 分析ID号

View File

@ -10,7 +10,7 @@ import java.io.Serializable;
import java.util.Date;
@Data
@TableName(value = "GARDS_BG_EFFICIENCY_PAIRS")
@TableName(value = "ORIGINAL.GARDS_BG_EFFICIENCY_PAIRS")
public class GardsBgEfficiencyPairs implements Serializable {
@TableField(value = "SAMPLE_ID")

View File

@ -7,7 +7,7 @@ import lombok.Data;
import java.io.Serializable;
@Data
@TableName(value = "gards_calibration_pairs_orig")
@TableName(value = "ORIGINAL.GARDS_CALIBRATION_PAIRS_ORIG")
public class GardsCalibrationPairsOrig implements Serializable {
/**

View File

@ -10,7 +10,7 @@ import java.io.Serializable;
import java.util.Date;
@Data
@TableName(value = "GARDS_HISTOGRAM")
@TableName(value = "ORIGINAL.GARDS_HISTOGRAM")
public class GardsHistogram implements Serializable {
@TableField(value = "SAMPLE_ID")

View File

@ -10,7 +10,7 @@ import java.io.Serializable;
import java.util.Date;
@Data
@TableName(value = "GARDS_ROI_LIMITS")
@TableName(value = "ORIGINAL.GARDS_ROI_LIMITS")
public class GardsRoiLimits implements Serializable {
@TableField(value = "SAMPLE_ID")

View File

@ -10,7 +10,7 @@ import java.io.Serializable;
import java.util.Date;
@Data
@TableName(value = "gards_sample_aux")
@TableName(value = "ORIGINAL.GARDS_SAMPLE_AUX")
public class GardsSampleAux implements Serializable {
/**

View File

@ -10,7 +10,7 @@ import java.io.Serializable;
import java.util.Date;
@Data
@TableName(value = "gards_sample_cert")
@TableName(value = "ORIGINAL.GARDS_SAMPLE_CERT")
public class GardsSampleCert implements Serializable {
/**

View File

@ -7,7 +7,7 @@ import lombok.Data;
import java.io.Serializable;
@Data
@TableName(value = "gards_sample_cert_line")
@TableName(value = "ORIGINAL.GARDS_SAMPLE_CERT_LINE")
public class GardsSampleCertLine implements Serializable {
/**

View File

@ -7,7 +7,7 @@ import lombok.Data;
import java.io.Serializable;
@Data
@TableName(value = "gards_sample_description")
@TableName(value = "ORIGINAL.GARDS_SAMPLE_DESCRIPTION")
public class GardsSampleDescription implements Serializable {
@TableField(value = "SAMPLE_ID")

View File

@ -10,7 +10,7 @@ import java.io.Serializable;
import java.util.Date;
@Data
@TableName(value = "GARDS_SAMPLE_RATIOS")
@TableName(value = "ORIGINAL.GARDS_SAMPLE_RATIOS")
public class GardsSampleRatios implements Serializable {
@TableField(value = "SAMPLE_ID")

View File

@ -10,7 +10,7 @@ import java.io.Serializable;
import java.util.Date;
@Data
@TableName(value = "GARDS_SPECTRUM")
@TableName(value = "ORIGINAL.GARDS_SPECTRUM")
public class GardsSpectrum implements Serializable {
@TableField(value = "SAMPLE_ID")

View File

@ -0,0 +1,7 @@
package org.jeecg.modules.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.entity.GardsAnalysesAuto;
public interface GardsAnalysesAutoMapper extends BaseMapper<GardsAnalysesAuto> {
}

View File

@ -0,0 +1,7 @@
package org.jeecg.modules.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.entity.GardsAnalysesMan;
public interface GardsAnalysesManMapper extends BaseMapper<GardsAnalysesMan> {
}

View File

@ -1,7 +0,0 @@
package org.jeecg.modules.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.entity.GardsAnalyses;
public interface GardsAnalysesMapper extends BaseMapper<GardsAnalyses> {
}

View File

@ -3,5 +3,5 @@ package org.jeecg.modules.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.base.entity.GardsSampleData;
public interface GardsSampleDataMapper extends BaseMapper<GardsSampleData> {
public interface GardsSampleDataWebMapper extends BaseMapper<GardsSampleData> {
}

View File

@ -3,11 +3,11 @@ package org.jeecg.modules.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.api.QueryRequest;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.entity.GardsAnalyses;
import org.jeecg.modules.entity.GardsAnalysesAuto;
import java.util.Date;
public interface IAutoService extends IService<GardsAnalyses> {
public interface IAutoService extends IService<GardsAnalysesAuto> {
Result findAutoPage(QueryRequest queryRequest, Integer[] stationIds, Date startTime, Date endTime);

View File

@ -9,7 +9,7 @@ import java.util.Date;
import java.util.List;
public interface IGardsSampleDataService extends IService<GardsSampleData> {
public interface IGardsSampleDataWebService extends IService<GardsSampleData> {
/**
* 分页查询气溶胶相关数据

View File

@ -0,0 +1,17 @@
package org.jeecg.modules.service;
import org.jeecg.modules.system.entity.GardsStations;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.List;
@Component
@FeignClient("jeecg-system")
public interface IMenuNameService {
@RequestMapping("/sys/dict/findStationListByMenuName")
List<GardsStations> findStationListByMenuName(String menuName);
}

View File

@ -3,11 +3,11 @@ package org.jeecg.modules.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.api.QueryRequest;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.entity.GardsAnalyses;
import org.jeecg.modules.entity.GardsAnalysesMan;
import java.util.Date;
public interface IReviewedService extends IService<GardsAnalyses> {
public interface IReviewedService extends IService<GardsAnalysesMan> {
Result findReviewedPage(QueryRequest queryRequest, Integer[] stationIds, Date startTime, Date endTime);

View File

@ -1,16 +0,0 @@
package org.jeecg.modules.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.entity.SysDict;
public interface ISysDictService extends IService<SysDict> {
/**
* 根据系统类型查询对应的台站信息
* @param menuName
* @return
*/
Result findList(String menuName);
}

View File

@ -6,10 +6,10 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
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.entity.GardsAnalyses;
import org.jeecg.modules.mapper.GardsAnalysesMapper;
import org.jeecg.modules.entity.GardsAnalysesAuto;
import org.jeecg.modules.mapper.GardsAnalysesAutoMapper;
import org.jeecg.modules.service.IAutoService;
import org.jeecg.modules.service.IGardsSampleDataService;
import org.jeecg.modules.service.IGardsSampleDataWebService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -18,20 +18,20 @@ import java.util.List;
import java.util.stream.Collectors;
@Service("autoService")
@DS("auo")
public class AutoServiceImpl extends ServiceImpl<GardsAnalysesMapper, GardsAnalyses> implements IAutoService {
@DS("ora")
public class AutoServiceImpl extends ServiceImpl<GardsAnalysesAutoMapper, GardsAnalysesAuto> implements IAutoService {
@Autowired
private IGardsSampleDataService gardsSampleDataService;
private IGardsSampleDataWebService gardsSampleDataService;
@Override
public Result findAutoPage(QueryRequest queryRequest, Integer[] stationIds, Date startTime, Date endTime) {
//查询自动处理后的
LambdaQueryWrapper<GardsAnalyses> analysesQueryWrapper = new LambdaQueryWrapper<>();
List<GardsAnalyses> gardsAnalyses = this.baseMapper.selectList(analysesQueryWrapper);
LambdaQueryWrapper<GardsAnalysesAuto> analysesQueryWrapper = new LambdaQueryWrapper<>();
List<GardsAnalysesAuto> gardsAnalyses = this.baseMapper.selectList(analysesQueryWrapper);
if (CollectionUtils.isNotEmpty(gardsAnalyses)){
//获取全部样品id
List<Integer> sampleIds = gardsAnalyses.stream().map(GardsAnalyses::getSampleId).collect(Collectors.toList());
List<Integer> sampleIds = gardsAnalyses.stream().map(GardsAnalysesAuto::getSampleId).collect(Collectors.toList());
//查询全部样品基础数据
Result result = gardsSampleDataService.findPageBySampleIds(queryRequest, stationIds, startTime, endTime, sampleIds);
return result;

View File

@ -18,7 +18,7 @@ import java.util.Date;
import java.util.Objects;
@Service("gardsMetDataService")
@DS("ori")
@DS("ora")
public class GardsMetDataServiceImpl extends ServiceImpl<GardsMetDataMapper, GardsMetData> implements IGardsMetDataService {
@Override

View File

@ -19,7 +19,7 @@ import java.util.Map;
import java.util.Objects;
@Service("gardsSampleCertService")
@DS("ori")
@DS("ora")
public class GardsSampleCertServiceImpl extends ServiceImpl<GardsSampleCertMapper, GardsSampleCert> implements IGardsSampleCertService {
@Autowired

View File

@ -16,7 +16,7 @@ import org.jeecg.modules.base.entity.GardsSampleData;
import org.jeecg.modules.entity.*;
import org.jeecg.modules.entity.data.*;
import org.jeecg.modules.mapper.*;
import org.jeecg.modules.service.IGardsSampleDataService;
import org.jeecg.modules.service.IGardsSampleDataWebService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
@ -26,9 +26,9 @@ import java.text.ParseException;
import java.util.*;
import java.util.stream.Collectors;
@Service("gardsSampleDataService")
@DS("ori")
public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMapper,GardsSampleData> implements IGardsSampleDataService {
@Service("gardsSampleDataWebService")
@DS("ora")
public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWebMapper,GardsSampleData> implements IGardsSampleDataWebService {
@Autowired
private RedisUtil redisUtil;

View File

@ -21,7 +21,7 @@ import java.util.Map;
import java.util.Objects;
@Service("gardsSohDataService")
@DS("ori")
@DS("ora")
public class GardsSohDataServiceImpl extends ServiceImpl<GardsSohDataMapper, GardsSohData> implements IGardsSohDataService {
@Autowired

View File

@ -6,9 +6,9 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
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.entity.GardsAnalyses;
import org.jeecg.modules.mapper.GardsAnalysesMapper;
import org.jeecg.modules.service.IGardsSampleDataService;
import org.jeecg.modules.entity.GardsAnalysesMan;
import org.jeecg.modules.mapper.GardsAnalysesManMapper;
import org.jeecg.modules.service.IGardsSampleDataWebService;
import org.jeecg.modules.service.IReviewedService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -18,20 +18,20 @@ import java.util.List;
import java.util.stream.Collectors;
@Service("reviewedService")
@DS("man")
public class ReviewedServiceImpl extends ServiceImpl<GardsAnalysesMapper, GardsAnalyses> implements IReviewedService {
@DS("ora")
public class ReviewedServiceImpl extends ServiceImpl<GardsAnalysesManMapper, GardsAnalysesMan> implements IReviewedService {
@Autowired
private IGardsSampleDataService gardsSampleDataService;
private IGardsSampleDataWebService gardsSampleDataService;
@Override
public Result findReviewedPage(QueryRequest queryRequest, Integer[] stationIds, Date startTime, Date endTime) {
//查询自动处理后的
LambdaQueryWrapper<GardsAnalyses> analysesQueryWrapper = new LambdaQueryWrapper<>();
List<GardsAnalyses> gardsAnalyses = this.baseMapper.selectList(analysesQueryWrapper);
LambdaQueryWrapper<GardsAnalysesMan> analysesQueryWrapper = new LambdaQueryWrapper<>();
List<GardsAnalysesMan> gardsAnalyses = this.baseMapper.selectList(analysesQueryWrapper);
if (CollectionUtils.isNotEmpty(gardsAnalyses)){
//获取全部样品id
List<Integer> sampleIds = gardsAnalyses.stream().map(GardsAnalyses::getSampleId).collect(Collectors.toList());
List<Integer> sampleIds = gardsAnalyses.stream().map(GardsAnalysesMan::getSampleId).collect(Collectors.toList());
//查询全部样品基础数据
Result result = gardsSampleDataService.findPageBySampleIds(queryRequest, stationIds, startTime, endTime, sampleIds);
return result;

View File

@ -1,67 +0,0 @@
package org.jeecg.modules.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.modules.entity.SysDict;
import org.jeecg.modules.entity.SysDictItem;
import org.jeecg.modules.mapper.SysDictItemMapper;
import org.jeecg.modules.mapper.SysDictMapper;
import org.jeecg.modules.service.ISysDictService;
import org.jeecg.modules.system.entity.GardsStations;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
@Service("sysDictService")
public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> implements ISysDictService {
@Autowired
private RedisUtil redisUtil;
@Autowired
private SysDictMapper sysDictMapper;
@Autowired
private SysDictItemMapper sysDictItemMapper;
@Override
public Result findList(String menuName) {
Result result = new Result();
List<GardsStations> gardsStationsList = new LinkedList<>();
//获取台站信息
HashMap<String, GardsStations> stationInfoMap = (HashMap<String, GardsStations>) redisUtil.get("stationInfoMap");
List<GardsStations> stationsList = stationInfoMap.values().stream().sorted(Comparator.comparing(GardsStations::getStationId)).collect(Collectors.toList());
//如果传递的菜单名称不为空 则需要过滤出所需的台站信息
if (StringUtils.isNotBlank(menuName)){
//根据菜单名称查询出数据字典中对应的内容
LambdaQueryWrapper<SysDict> dictQueryWrapper = new LambdaQueryWrapper<>();
dictQueryWrapper.eq(SysDict::getDictCode, menuName);
SysDict sysDict = sysDictMapper.selectOne(dictQueryWrapper);
//如果字典内容不为空
if (Objects.nonNull(sysDict)){
LambdaQueryWrapper<SysDictItem> dictItemQueryWrapper = new LambdaQueryWrapper<>();
dictItemQueryWrapper.eq(SysDictItem::getDictId, sysDict.getId());
List<SysDictItem> dictItems = sysDictItemMapper.selectList(dictItemQueryWrapper);
List<String> types = dictItems.stream().map(SysDictItem::getItemValue).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(types)){
//遍历过滤出和类型匹配的台站信息 存入新的数据集合中
for (String type:types) {
gardsStationsList.addAll(stationsList.stream().filter(item-> StringUtils.isNotBlank(item.getType()) && item.getType().equals(type)).collect(Collectors.toList()));
}
}
}else {
gardsStationsList.addAll(stationsList);
}
}else {
gardsStationsList.addAll(stationsList);
}
result.setSuccess(true);
result.setResult(gardsStationsList);
return result;
}
}

View File

@ -15,5 +15,5 @@ spring:
config:
import:
- optional:nacos:jeecg.yaml
- optional:nacos:jeecg-auto-process-@profile.name@.yaml
- optional:nacos:jeecg-@profile.name@.yaml