Commit 211962c4 authored by ZWT's avatar ZWT

feat(零碳): 长庆演示系统新增功能

1.新建油田配置表同时生成相关代码及mapper文件,修改部分第三方数据抽取定时任务,增加针对不同井场开关控制逻辑,同时修改首页页面展示逻辑,通过油田配置功能区分不同首页展示功能;
2.新建定时任务配置表同时生成相关代码及mapper文件,定时任务模块增加mybatis配置,用以操作数据库,修改部分第三方数据抽取定时任务,修改使用方式使其脱离框架方便动态控制;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent b14f39c6
package pps.core.common.job; package pps.core.common.job;
import com.google.common.base.Strings; import cn.hutool.core.text.CharSequenceUtil;
import pps.core.common.utils.*; import pps.core.common.utils.*;
import xstartup.base.XStartup; import xstartup.base.XStartup;
import xstartup.base.util.XJsonUtils; import xstartup.base.util.XJsonUtils;
...@@ -89,12 +89,12 @@ public class CounterJob5S { ...@@ -89,12 +89,12 @@ public class CounterJob5S {
CounterBuilder.globalCounterBuilder.setFieldValue("__MASTER__", isMaster + ""); CounterBuilder.globalCounterBuilder.setFieldValue("__MASTER__", isMaster + "");
if (isMaster) { if (isMaster) {
if (Strings.isNullOrEmpty(CounterBuilder.globalCounterBuilder.getFieldValue("__MASTER-TIME__"))) { if (CharSequenceUtil.isBlank(CounterBuilder.globalCounterBuilder.getFieldValue("__MASTER-TIME__"))) {
CounterBuilder.globalCounterBuilder.setFieldValue("__MASTER-TIME__", DateUtil.getCurrentDateTime()); CounterBuilder.globalCounterBuilder.setFieldValue("__MASTER-TIME__", DateUtil.getCurrentDateTime());
CounterBuilder.globalCounterBuilder.addCounter("__MASTER-TIMES__"); CounterBuilder.globalCounterBuilder.addCounter("__MASTER-TIMES__");
} }
} else { } else {
if (!Strings.isNullOrEmpty(CounterBuilder.globalCounterBuilder.getFieldValue("__MASTER-TIME__"))) { if (CharSequenceUtil.isNotBlank(CounterBuilder.globalCounterBuilder.getFieldValue("__MASTER-TIME__"))) {
CounterBuilder.globalCounterBuilder.setFieldValue("__MASTER-TIME__", ""); CounterBuilder.globalCounterBuilder.setFieldValue("__MASTER-TIME__", "");
} }
// onlineNodes.clear(); // onlineNodes.clear();
...@@ -140,12 +140,12 @@ public class CounterJob5S { ...@@ -140,12 +140,12 @@ public class CounterJob5S {
CounterBuilder.globalCounterBuilder.setFieldValue("__MASTER__", isMaster + ""); CounterBuilder.globalCounterBuilder.setFieldValue("__MASTER__", isMaster + "");
if (isMaster) { if (isMaster) {
if (Strings.isNullOrEmpty(CounterBuilder.globalCounterBuilder.getFieldValue("__MASTER-TIME__"))) { if (CharSequenceUtil.isBlank(CounterBuilder.globalCounterBuilder.getFieldValue("__MASTER-TIME__"))) {
CounterBuilder.globalCounterBuilder.setFieldValue("__MASTER-TIME__", DateUtil.getCurrentDateTime()); CounterBuilder.globalCounterBuilder.setFieldValue("__MASTER-TIME__", DateUtil.getCurrentDateTime());
CounterBuilder.globalCounterBuilder.addCounter("__MASTER-TIMES__"); CounterBuilder.globalCounterBuilder.addCounter("__MASTER-TIMES__");
} }
} else { } else {
if (!Strings.isNullOrEmpty(CounterBuilder.globalCounterBuilder.getFieldValue("__MASTER-TIME__"))) { if (CharSequenceUtil.isNotBlank(CounterBuilder.globalCounterBuilder.getFieldValue("__MASTER-TIME__"))) {
CounterBuilder.globalCounterBuilder.setFieldValue("__MASTER-TIME__", ""); CounterBuilder.globalCounterBuilder.setFieldValue("__MASTER-TIME__", "");
} }
} }
......
package pps.core.common.provider.impl; package pps.core.common.provider.impl;
import com.google.common.base.Strings; import cn.hutool.core.text.CharSequenceUtil;
import pps.core.common.cache.ConfigCache; import pps.core.common.cache.ConfigCache;
import pps.core.common.utils.CounterBuilder; import pps.core.common.utils.CounterBuilder;
import xstartup.annotation.XImplement; import xstartup.annotation.XImplement;
...@@ -16,12 +16,12 @@ public class PpsConfigProviderCommonImpl implements XConfigProvider { ...@@ -16,12 +16,12 @@ public class PpsConfigProviderCommonImpl implements XConfigProvider {
@Override @Override
public String findValue(XContext context, String config, String app, String key) { public String findValue(XContext context, String config, String app, String key) {
//todo 实现自定义配置逻辑, 优先级 从低到高 数据库->properties文件 // 实现自定义配置逻辑, 优先级 从低到高 数据库->properties文件
//从Properties文件中加载配置值 //从Properties文件中加载配置值
String configKey = config + "." + key; String configKey = config + "." + key;
String configKeyWithAppName = config + "." + app + "." + key; String configKeyWithAppName = config + "." + app + "." + key;
String configValue = context.getProperty(configKeyWithAppName); String configValue = context.getProperty(configKeyWithAppName);
if (Strings.isNullOrEmpty(configValue)) { if (CharSequenceUtil.isBlank(configValue)) {
configValue = context.getProperty(configKey); configValue = context.getProperty(configKey);
} }
//加载缓存 //加载缓存
......
package pps.core.common.utils; package pps.core.common.utils;
import com.google.common.base.Strings; import cn.hutool.core.text.CharSequenceUtil;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -105,8 +105,7 @@ public class CounterBuilder { ...@@ -105,8 +105,7 @@ public class CounterBuilder {
if (counterName == null || counterName.isEmpty()) { if (counterName == null || counterName.isEmpty()) {
return this; return this;
} }
if (CharSequenceUtil.isNotBlank(this.groupName)) {
if (!Strings.isNullOrEmpty(this.groupName)) {
counterName = String.format("%s-%s", this.groupName, counterName); counterName = String.format("%s-%s", this.groupName, counterName);
} }
...@@ -134,7 +133,7 @@ public class CounterBuilder { ...@@ -134,7 +133,7 @@ public class CounterBuilder {
return this; return this;
} }
if (!Strings.isNullOrEmpty(this.groupName)) { if (CharSequenceUtil.isNotBlank(this.groupName)) {
counterName = String.format("%s-%s", this.groupName, counterName); counterName = String.format("%s-%s", this.groupName, counterName);
} }
...@@ -162,7 +161,7 @@ public class CounterBuilder { ...@@ -162,7 +161,7 @@ public class CounterBuilder {
return this; return this;
} }
if (!Strings.isNullOrEmpty(this.groupName)) { if (CharSequenceUtil.isNotBlank(this.groupName)) {
fieldName = String.format("%s-%s", this.groupName, fieldName); fieldName = String.format("%s-%s", this.groupName, fieldName);
} }
...@@ -186,7 +185,7 @@ public class CounterBuilder { ...@@ -186,7 +185,7 @@ public class CounterBuilder {
return 0; return 0;
} }
if (!Strings.isNullOrEmpty(this.groupName)) { if (CharSequenceUtil.isNotBlank(this.groupName)) {
counterName = String.format("%s-%s", this.groupName, counterName); counterName = String.format("%s-%s", this.groupName, counterName);
} }
...@@ -202,7 +201,7 @@ public class CounterBuilder { ...@@ -202,7 +201,7 @@ public class CounterBuilder {
return ""; return "";
} }
if (!Strings.isNullOrEmpty(this.groupName)) { if (CharSequenceUtil.isNotBlank(this.groupName)) {
fieldName = String.format("%s-%s", this.groupName, fieldName); fieldName = String.format("%s-%s", this.groupName, fieldName);
} }
......
package pps.core.common.utils; package pps.core.common.utils;
import com.google.common.base.Strings; import cn.hutool.core.text.CharSequenceUtil;
import xstartup.base.util.XDateUtils; import xstartup.base.util.XDateUtils;
import java.sql.Timestamp; import java.sql.Timestamp;
...@@ -762,7 +762,7 @@ public class DateUtil { ...@@ -762,7 +762,7 @@ public class DateUtil {
} }
public static LocalDateTime parseLocalDateTime(String dateTime) { public static LocalDateTime parseLocalDateTime(String dateTime) {
if (Strings.isNullOrEmpty(dateTime)) { if (CharSequenceUtil.isBlank(dateTime)) {
return null; return null;
} }
...@@ -810,7 +810,7 @@ public class DateUtil { ...@@ -810,7 +810,7 @@ public class DateUtil {
} }
public static String calcTimeSpan(String begin, String end) { public static String calcTimeSpan(String begin, String end) {
if (Strings.isNullOrEmpty(begin) || Strings.isNullOrEmpty(end)) { if (CharSequenceUtil.isBlank(begin) || CharSequenceUtil.isBlank(end)) {
return ""; return "";
} }
...@@ -824,7 +824,7 @@ public class DateUtil { ...@@ -824,7 +824,7 @@ public class DateUtil {
} }
public static String calcTimeSpanWithMs(String begin, String end) { public static String calcTimeSpanWithMs(String begin, String end) {
if (Strings.isNullOrEmpty(begin) || Strings.isNullOrEmpty(end)) { if (CharSequenceUtil.isBlank(begin) || CharSequenceUtil.isBlank(end)) {
return ""; return "";
} }
......
package pps.core.common.utils; package pps.core.common.utils;
import com.google.common.base.Strings; import cn.hutool.core.text.CharSequenceUtil;
import xstartup.annotation.XText; import xstartup.annotation.XText;
import java.io.Serializable; import java.io.Serializable;
...@@ -119,7 +119,7 @@ public class DynObj extends TreeMap<String, Object> implements Serializable { ...@@ -119,7 +119,7 @@ public class DynObj extends TreeMap<String, Object> implements Serializable {
if (v instanceof String) { if (v instanceof String) {
String strV = (String) v; String strV = (String) v;
if (Strings.isNullOrEmpty(strV)) { if (CharSequenceUtil.isBlank(strV)) {
return defaultValue; return defaultValue;
} else { } else {
return strV; return strV;
...@@ -139,7 +139,7 @@ public class DynObj extends TreeMap<String, Object> implements Serializable { ...@@ -139,7 +139,7 @@ public class DynObj extends TreeMap<String, Object> implements Serializable {
return defaultValue; return defaultValue;
} }
String strValue = v.toString().toLowerCase(); String strValue = v.toString().toLowerCase();
if (Strings.isNullOrEmpty(strValue)) { if (CharSequenceUtil.isBlank(strValue)) {
return defaultValue; return defaultValue;
} }
if (WellKnownRegexValidator.completelyMatches(strValue, WellKnownRegex.INTEGER)) { if (WellKnownRegexValidator.completelyMatches(strValue, WellKnownRegex.INTEGER)) {
...@@ -194,7 +194,7 @@ public class DynObj extends TreeMap<String, Object> implements Serializable { ...@@ -194,7 +194,7 @@ public class DynObj extends TreeMap<String, Object> implements Serializable {
public Integer intValue(String fieldName, Integer defaultValue) { public Integer intValue(String fieldName, Integer defaultValue) {
String strValue = strValue(fieldName, null); String strValue = strValue(fieldName, null);
if (Strings.isNullOrEmpty(strValue)) { if (CharSequenceUtil.isBlank(strValue)) {
return defaultValue; return defaultValue;
} else { } else {
return Integer.parseInt(strValue); return Integer.parseInt(strValue);
...@@ -207,7 +207,7 @@ public class DynObj extends TreeMap<String, Object> implements Serializable { ...@@ -207,7 +207,7 @@ public class DynObj extends TreeMap<String, Object> implements Serializable {
public Double doubleValue(String fieldName, Double defaultValue) { public Double doubleValue(String fieldName, Double defaultValue) {
String strValue = strValue(fieldName, null); String strValue = strValue(fieldName, null);
if (Strings.isNullOrEmpty(strValue)) { if (CharSequenceUtil.isBlank(strValue)) {
return defaultValue; return defaultValue;
} else { } else {
return Double.parseDouble(strValue); return Double.parseDouble(strValue);
...@@ -234,7 +234,7 @@ public class DynObj extends TreeMap<String, Object> implements Serializable { ...@@ -234,7 +234,7 @@ public class DynObj extends TreeMap<String, Object> implements Serializable {
} }
public String stringByLeves(String keys, String defaultValue) { public String stringByLeves(String keys, String defaultValue) {
if (Strings.isNullOrEmpty(keys)) { if (CharSequenceUtil.isBlank(keys)) {
return defaultValue; return defaultValue;
} }
int idx = keys.indexOf("."); int idx = keys.indexOf(".");
......
package pps.core.common.utils; package pps.core.common.utils;
import cn.hutool.core.text.CharSequenceUtil;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
import com.google.common.base.Strings;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -60,7 +60,7 @@ public class IpUtils { ...@@ -60,7 +60,7 @@ public class IpUtils {
} }
public static String getHostIPs(boolean refresh) { public static String getHostIPs(boolean refresh) {
if (!refresh && !Strings.isNullOrEmpty(ips)) { if (!refresh && CharSequenceUtil.isNotBlank(ips)) {
return ips; return ips;
} }
...@@ -87,7 +87,7 @@ public class IpUtils { ...@@ -87,7 +87,7 @@ public class IpUtils {
} }
interfaceAddresses.forEach(item -> { interfaceAddresses.forEach(item -> {
String addr = item.getAddress().getHostAddress(); String addr = item.getAddress().getHostAddress();
if (!Strings.isNullOrEmpty(addr)) { if (CharSequenceUtil.isNotBlank(addr)) {
list.add(addr.trim()); list.add(addr.trim());
} }
}); });
......
package pps.core.common.utils; package pps.core.common.utils;
import com.google.common.base.Strings; import cn.hutool.core.text.CharSequenceUtil;
import xstartup.base.util.XJsonUtils; import xstartup.base.util.XJsonUtils;
import xstartup.base.util.XStringUtils; import xstartup.base.util.XStringUtils;
...@@ -80,7 +80,7 @@ public class SmartRecord extends LinkedHashMap<String, Object> { ...@@ -80,7 +80,7 @@ public class SmartRecord extends LinkedHashMap<String, Object> {
public Integer intValue(String fieldName, Integer defaultValue) { public Integer intValue(String fieldName, Integer defaultValue) {
String strValue = strValue(fieldName, null); String strValue = strValue(fieldName, null);
if (Strings.isNullOrEmpty(strValue)) { if (CharSequenceUtil.isBlank(strValue)) {
return defaultValue; return defaultValue;
} else { } else {
return Integer.parseInt(strValue); return Integer.parseInt(strValue);
...@@ -93,7 +93,7 @@ public class SmartRecord extends LinkedHashMap<String, Object> { ...@@ -93,7 +93,7 @@ public class SmartRecord extends LinkedHashMap<String, Object> {
public Double doubleValue(String fieldName, Double defaultValue) { public Double doubleValue(String fieldName, Double defaultValue) {
String strValue = strValue(fieldName, null); String strValue = strValue(fieldName, null);
if (Strings.isNullOrEmpty(strValue)) { if (CharSequenceUtil.isBlank(strValue)) {
return defaultValue; return defaultValue;
} else { } else {
return Double.parseDouble(strValue); return Double.parseDouble(strValue);
...@@ -102,7 +102,7 @@ public class SmartRecord extends LinkedHashMap<String, Object> { ...@@ -102,7 +102,7 @@ public class SmartRecord extends LinkedHashMap<String, Object> {
public <T> T parseFromJson(String fieldName, Class<T> clz) { public <T> T parseFromJson(String fieldName, Class<T> clz) {
String json = strValue(fieldName); String json = strValue(fieldName);
if (json == null || Strings.isNullOrEmpty(json)) { if (json == null || CharSequenceUtil.isBlank(json)) {
return null; return null;
} }
return XJsonUtils.toObject(json, clz); return XJsonUtils.toObject(json, clz);
...@@ -110,7 +110,7 @@ public class SmartRecord extends LinkedHashMap<String, Object> { ...@@ -110,7 +110,7 @@ public class SmartRecord extends LinkedHashMap<String, Object> {
public <T> T toObj(Class<T> clz) { public <T> T toObj(Class<T> clz) {
String json = XJsonUtils.toJson(this.columnOrPathToClass()); String json = XJsonUtils.toJson(this.columnOrPathToClass());
if (json == null || Strings.isNullOrEmpty(json)) { if (json == null || CharSequenceUtil.isBlank(json)) {
return null; return null;
} }
return XJsonUtils.toObject(json, clz); return XJsonUtils.toObject(json, clz);
......
package pps.core.common.utils; package pps.core.common.utils;
import cn.hutool.core.text.CharSequenceUtil;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
import com.google.common.base.Splitter; import com.google.common.base.Splitter;
import com.google.common.base.Strings;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
...@@ -30,11 +30,11 @@ public class SqlFilter { ...@@ -30,11 +30,11 @@ public class SqlFilter {
public static final Pattern BAD_FORM_PATTERN = Pattern.compile(BAD_FORM_PATTERN_STR, Pattern.CASE_INSENSITIVE); public static final Pattern BAD_FORM_PATTERN = Pattern.compile(BAD_FORM_PATTERN_STR, Pattern.CASE_INSENSITIVE);
public static final String filterValue(String original) { public static final String filterValue(String original) {
if (Strings.isNullOrEmpty(original)) { if (CharSequenceUtil.isBlank(original)) {
return original; return original;
} }
original = original.trim(); original = original.trim();
if (Strings.isNullOrEmpty(original)) { if (CharSequenceUtil.isBlank(original)) {
return original; return original;
} }
...@@ -47,7 +47,7 @@ public class SqlFilter { ...@@ -47,7 +47,7 @@ public class SqlFilter {
List<String> fixedKeywords = new ArrayList<String>(keywords.size()); List<String> fixedKeywords = new ArrayList<String>(keywords.size());
keywords.forEach(keyword -> { keywords.forEach(keyword -> {
String fixed = filterValueNoSpace(keyword); String fixed = filterValueNoSpace(keyword);
if (!Strings.isNullOrEmpty(fixed)) { if (CharSequenceUtil.isNotBlank(fixed)) {
fixedKeywords.add(fixed); fixedKeywords.add(fixed);
} }
}); });
......
package pps.core.common.utils; package pps.core.common.utils;
import com.google.common.base.Strings; import cn.hutool.core.text.CharSequenceUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Set; import java.util.Set;
...@@ -73,13 +73,13 @@ public class ThreadHelper { ...@@ -73,13 +73,13 @@ public class ThreadHelper {
if (iMax == -1) if (iMax == -1)
return "[]"; return "[]";
if (Strings.isNullOrEmpty(seperator)) if (CharSequenceUtil.isBlank(seperator))
seperator = ", "; seperator = ", ";
StringBuilder b = new StringBuilder(); StringBuilder b = new StringBuilder();
b.append('['); b.append('[');
for (int i = 0; ; i++) { for (int i = 0; ; i++) {
b.append(String.valueOf(a[i])); b.append(a[i]);
if (i == iMax) { if (i == iMax) {
return b.append(']').toString(); return b.append(']').toString();
} }
......
package pps.core.common.utils; package pps.core.common.utils;
import com.google.common.base.Strings; import cn.hutool.core.text.CharSequenceUtil;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
...@@ -43,7 +43,7 @@ public class TimeSpanChecker { ...@@ -43,7 +43,7 @@ public class TimeSpanChecker {
} }
public static boolean checkNow(String checkerName, int seconds, boolean skipFirstCheck) { public static boolean checkNow(String checkerName, int seconds, boolean skipFirstCheck) {
if (Strings.isNullOrEmpty(checkerName) || seconds <= 0) { if (CharSequenceUtil.isBlank(checkerName) || seconds <= 0) {
return false; return false;
} }
......
package pps.core.common.utils; package pps.core.common.utils;
import com.google.common.base.Strings; import cn.hutool.core.text.CharSequenceUtil;
import org.joor.Reflect; import org.joor.Reflect;
import xstartup.base.XContext; import xstartup.base.XContext;
import xstartup.base.util.XJsonUtils; import xstartup.base.util.XJsonUtils;
...@@ -60,11 +60,11 @@ public class TraceHelper { ...@@ -60,11 +60,11 @@ public class TraceHelper {
cleanTraceBuilder(); cleanTraceBuilder();
} }
if (!Strings.isNullOrEmpty(traceId) && traceBuilders.contains(traceId)) { if (CharSequenceUtil.isNotBlank(traceId) && traceBuilders.contains(traceId)) {
return traceBuilders.get(traceId); return traceBuilders.get(traceId);
} }
if (Strings.isNullOrEmpty(traceId)) { if (CharSequenceUtil.isBlank(traceId)) {
traceId = UUID.randomUUID().toString().replace("-", ""); traceId = UUID.randomUUID().toString().replace("-", "");
} }
...@@ -90,7 +90,7 @@ public class TraceHelper { ...@@ -90,7 +90,7 @@ public class TraceHelper {
public static TraceBuilder getTraceBuilder(String traceId) { public static TraceBuilder getTraceBuilder(String traceId) {
try { try {
if (Strings.isNullOrEmpty(traceId)) { if (CharSequenceUtil.isBlank(traceId)) {
return null; return null;
} }
......
package pps.core.system.module; package pps.core.system.module;
import cn.hutool.core.text.CharSequenceUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.base.Strings;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import pps.core.common.utils.ManifestComponentInfoHelper; import pps.core.common.utils.ManifestComponentInfoHelper;
...@@ -106,16 +106,16 @@ public class PpsCoreSystemModule extends XModule { ...@@ -106,16 +106,16 @@ public class PpsCoreSystemModule extends XModule {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sysDictionaryEnts.forEach(item -> { sysDictionaryEnts.forEach(item -> {
sb.setLength(0); sb.setLength(0);
if (Strings.isNullOrEmpty(item.getPid())) { if (CharSequenceUtil.isBlank(item.getPid())) {
return; return;
} }
if (!Strings.isNullOrEmpty(item.getDicPath())) { if (CharSequenceUtil.isNotBlank(item.getDicPath())) {
return; return;
} }
buildPath(dics, item.getPid(), sb); buildPath(dics, item.getPid(), sb);
String path = sb.toString(); String path = sb.toString();
if (Strings.isNullOrEmpty(path)) { if (CharSequenceUtil.isBlank(path)) {
return; return;
} }
...@@ -132,7 +132,7 @@ public class PpsCoreSystemModule extends XModule { ...@@ -132,7 +132,7 @@ public class PpsCoreSystemModule extends XModule {
} }
private void buildPath(Map<String, SysDictionaryEnt> dics, String parentId, StringBuilder sb) { private void buildPath(Map<String, SysDictionaryEnt> dics, String parentId, StringBuilder sb) {
if (Strings.isNullOrEmpty(parentId) || "1".equals(parentId)) { if (CharSequenceUtil.isBlank(parentId) || "1".equals(parentId)) {
return; return;
} }
......
package pps.core.system.provider.impl; package pps.core.system.provider.impl;
import cn.hutool.core.text.CharSequenceUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.base.Splitter; import com.google.common.base.Splitter;
import com.google.common.base.Strings;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import pps.cloud.system.service.SysOrganizationCloudService; import pps.cloud.system.service.SysOrganizationCloudService;
...@@ -82,13 +82,13 @@ public class PpsUserSessionInjectProviderImpl implements XSessionInjectProvider ...@@ -82,13 +82,13 @@ public class PpsUserSessionInjectProviderImpl implements XSessionInjectProvider
GetSysOrganizationViewOutput ownerOrg = findOwnerOrg(context, orgInfo.getResult()); GetSysOrganizationViewOutput ownerOrg = findOwnerOrg(context, orgInfo.getResult());
if (ownerOrg != null) { if (ownerOrg != null) {
session.setOwnerOrgId(ownerOrg.getOuId()); session.setOwnerOrgId(ownerOrg.getOuId());
if (Strings.isNullOrEmpty(ownerOrg.getOuId())) { if (CharSequenceUtil.isBlank(ownerOrg.getOuId())) {
session.setOwnerOrgId(ownerOrg.getId()); session.setOwnerOrgId(ownerOrg.getId());
} }
session.setOwnerOrgName(ownerOrg.getOuName()); session.setOwnerOrgName(ownerOrg.getOuName());
session.setOwnerOrgPath(ownerOrg.getOuPath()); session.setOwnerOrgPath(ownerOrg.getOuPath());
session.setOwnerOrgLevel(ownerOrg.getOuLevel()); session.setOwnerOrgLevel(ownerOrg.getOuLevel());
if (Strings.isNullOrEmpty(ownerOrg.getOuPath())) { if (CharSequenceUtil.isBlank(ownerOrg.getOuPath())) {
//路径为空 查询 //路径为空 查询
SysOrganizationRelMapper bean = context.getBean(SysOrganizationRelMapper.class); SysOrganizationRelMapper bean = context.getBean(SysOrganizationRelMapper.class);
QueryWrapper<SysOrganizationRelEnt> qw = new QueryWrapper<SysOrganizationRelEnt>(); QueryWrapper<SysOrganizationRelEnt> qw = new QueryWrapper<SysOrganizationRelEnt>();
......
...@@ -10,6 +10,6 @@ import pps.core.base.entity.ConfigOilFieldEnt; ...@@ -10,6 +10,6 @@ import pps.core.base.entity.ConfigOilFieldEnt;
* @author ZWT * @author ZWT
* @date 2024/06/25 * @date 2024/06/25
*/ */
@Repository(value="pps.core.base.mapper.ConfigOilFieldMapper") @Repository(value = "pps.core.base.mapper.ConfigOilFieldMapper")
public interface ConfigOilFieldMapper extends BaseMapper<ConfigOilFieldEnt> { public interface ConfigOilFieldMapper extends BaseMapper<ConfigOilFieldEnt> {
} }
package pps.core.base.service; package pps.core.base.service;
import cn.hutool.core.text.CharSequenceUtil;
import com.google.common.base.Splitter; import com.google.common.base.Splitter;
import com.google.common.base.Strings;
import pps.core.base.service.data.MyCounterOutput; import pps.core.base.service.data.MyCounterOutput;
import pps.core.common.job.CounterJob5S; import pps.core.common.job.CounterJob5S;
import pps.core.common.utils.*; import pps.core.common.utils.*;
...@@ -68,7 +68,7 @@ public class CounterService { ...@@ -68,7 +68,7 @@ public class CounterService {
String dynObjJson = jedis.get(k); String dynObjJson = jedis.get(k);
DynObj dynObj = XJsonUtils.toObject(dynObjJson, DynObj.class); DynObj dynObj = XJsonUtils.toObject(dynObjJson, DynObj.class);
String owner = dynObj.getString(CounterBuilder.COUNTER_NAME_OWNER); String owner = dynObj.getString(CounterBuilder.COUNTER_NAME_OWNER);
if (Strings.isNullOrEmpty(owner)) { if (CharSequenceUtil.isBlank(owner)) {
owner = dynObj.getString(CounterBuilder.COUNTER_NAME_INSTANCE); owner = dynObj.getString(CounterBuilder.COUNTER_NAME_INSTANCE);
} }
finalOutput.put(owner, dynObj); finalOutput.put(owner, dynObj);
...@@ -85,7 +85,7 @@ public class CounterService { ...@@ -85,7 +85,7 @@ public class CounterService {
String dynObjJson = jedis.get(k); String dynObjJson = jedis.get(k);
DynObj dynObj = XJsonUtils.toObject(dynObjJson, DynObj.class); DynObj dynObj = XJsonUtils.toObject(dynObjJson, DynObj.class);
String owner = dynObj.getString(CounterBuilder.COUNTER_NAME_OWNER); String owner = dynObj.getString(CounterBuilder.COUNTER_NAME_OWNER);
if (Strings.isNullOrEmpty(owner)) { if (CharSequenceUtil.isBlank(owner)) {
owner = dynObj.getString(CounterBuilder.COUNTER_NAME_INSTANCE); owner = dynObj.getString(CounterBuilder.COUNTER_NAME_INSTANCE);
} }
finalOutput.put(owner, dynObj); finalOutput.put(owner, dynObj);
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.base.mapper.ConfigOilFieldViewMapper"> <mapper namespace="pps.core.base.mapper.ConfigOilFieldViewMapper">
<resultMap id="BaseResultMap" type="pps.core.base.entity.ConfigOilFieldView"> <resultMap id="BaseResultMap" type="pps.core.base.entity.ConfigOilFieldView">
<id column="id" property="id" jdbcType="BIGINT" /> <id column="id" property="id" jdbcType="BIGINT"/>
<result column="is_enable" property="isEnable" jdbcType="TINYINT" /> <result column="is_enable" property="isEnable" jdbcType="TINYINT"/>
<result column="oil_field_name" property="oilFieldName" jdbcType="VARCHAR" /> <result column="oil_field_name" property="oilFieldName" jdbcType="VARCHAR"/>
<result column="oil_field_code" property="oilFieldCode" jdbcType="VARCHAR" /> <result column="oil_field_code" property="oilFieldCode" jdbcType="VARCHAR"/>
<result column="home_page_path" property="homePagePath" jdbcType="VARCHAR" /> <result column="home_page_path" property="homePagePath" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
...@@ -18,14 +18,14 @@ ...@@ -18,14 +18,14 @@
</sql> </sql>
<select id="selectOne" parameterType="pps.core.base.entity.ConfigOilFieldView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.base.entity.ConfigOilFieldView" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from config_oil_field from config_oil_field
where where
id=#{id} id=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.base.entity.ConfigOilFieldView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.base.entity.ConfigOilFieldView" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from config_oil_field from config_oil_field
where where
id=#{id} id=#{id}
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.task.mapper.ConfigTimeTaskViewMapper"> <mapper namespace="pps.core.task.mapper.ConfigTimeTaskViewMapper">
<resultMap id="BaseResultMap" type="pps.core.task.entity.ConfigTimeTaskView"> <resultMap id="BaseResultMap" type="pps.core.task.entity.ConfigTimeTaskView">
<id column="id" property="id" jdbcType="BIGINT" /> <id column="id" property="id" jdbcType="BIGINT"/>
<result column="class_path" property="classPath" jdbcType="VARCHAR" /> <result column="class_path" property="classPath" jdbcType="VARCHAR"/>
<result column="method_name" property="methodName" jdbcType="VARCHAR" /> <result column="method_name" property="methodName" jdbcType="VARCHAR"/>
<result column="other_param" property="otherParam" jdbcType="VARCHAR" /> <result column="other_param" property="otherParam" jdbcType="VARCHAR"/>
<result column="scheduling_pattern" property="schedulingPattern" jdbcType="VARCHAR" /> <result column="scheduling_pattern" property="schedulingPattern" jdbcType="VARCHAR"/>
<result column="task_describe" property="taskDescribe" jdbcType="VARCHAR" /> <result column="task_describe" property="taskDescribe" jdbcType="VARCHAR"/>
<result column="is_enable" property="isEnable" jdbcType="TINYINT" /> <result column="is_enable" property="isEnable" jdbcType="TINYINT"/>
<result column="system_source" property="systemSource" jdbcType="VARCHAR" /> <result column="system_source" property="systemSource" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
...@@ -24,14 +24,14 @@ ...@@ -24,14 +24,14 @@
</sql> </sql>
<select id="selectOne" parameterType="pps.core.task.entity.ConfigTimeTaskView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.task.entity.ConfigTimeTaskView" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from config_time_task from config_time_task
where where
id=#{id} id=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.task.entity.ConfigTimeTaskView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.task.entity.ConfigTimeTaskView" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from config_time_task from config_time_task
where where
id=#{id} id=#{id}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment