Browse Source

update

main
wangshaoping 10 months ago
parent
commit
6c5838671c
  1. 19
      app.platform.scheduler.executor/build-common.gradle
  2. 15
      app.platform.scheduler.executor/build-jetty.gradle
  3. 7
      app.platform.scheduler.executor/build-tomcat.gradle
  4. 15
      app.platform.scheduler.executor/build-undertow.gradle
  5. 99
      app.platform.scheduler.executor/build.gradle
  6. 11
      app.platform.scheduler.executor/src/main/resources/public/configure.js
  7. 19
      app.platform.scheduler.manager/build-common.gradle
  8. 15
      app.platform.scheduler.manager/build-jetty.gradle
  9. 7
      app.platform.scheduler.manager/build-tomcat.gradle
  10. 15
      app.platform.scheduler.manager/build-undertow.gradle
  11. 11
      app.platform.scheduler.manager/src/main/resources/public/configure.js
  12. 7
      app.platform/build.gradle
  13. BIN
      erm.frontend/public/webjars/mathfonts/1.0.0/Asana/Asana-Math.woff2
  14. 0
      erm.frontend/public/webjars/mathfonts/1.0.0/DejaVu/DejaVuMathTeXGyre.woff2
  15. BIN
      io.sc.engine.mv.frontend/public/webjars/mathfonts/1.0.0/DejaVu/DejaVuMathTeXGyre.woff2
  16. BIN
      io.sc.engine.mv.frontend/public/webjars/mathfonts/1.0.0/DejaVu/DejaVuSerif.woff2
  17. BIN
      io.sc.engine.rule.frontend/public/webjars/mathfonts/1.0.0/DejaVu/DejaVuMathTeXGyre.woff2
  18. BIN
      io.sc.engine.rule.frontend/public/webjars/mathfonts/1.0.0/DejaVu/DejaVuSerif.woff2
  19. BIN
      io.sc.engine.st.frontend/public/webjars/mathfonts/1.0.0/DejaVu/DejaVuMathTeXGyre.woff2
  20. BIN
      io.sc.platform.developer.frontend/public/webjars/mathfonts/1.0.0/Asana/Asana-Math.woff2
  21. BIN
      io.sc.platform.developer.frontend/public/webjars/mathfonts/1.0.0/DejaVu/DejaVuMathTeXGyre.woff2
  22. BIN
      io.sc.platform.mvc.frontend/public/webjars/mathfonts/1.0.0/DejaVu/DejaVuMathTeXGyre.woff2
  23. 3
      io.sc.platform.orm/src/main/java/io/sc/platform/orm/service/DaoService.java
  24. 49
      io.sc.platform.orm/src/main/java/io/sc/platform/orm/service/impl/DaoServiceImpl.java
  25. 9
      io.sc.platform.orm/src/main/java/io/sc/platform/orm/service/support/criteria/impl/Contains.java
  26. 156
      io.sc.platform.scheduler.executor/src/main/java/io/sc/platform/scheduler/executor/util/DateUtil.java
  27. BIN
      io.sc.platform.scheduler.manager.frontend/public/webjars/mathfonts/1.0.0/DejaVu/DejaVuMathTeXGyre.woff2
  28. BIN
      io.sc.platform.system.frontend/public/webjars/mathfonts/1.0.0/DejaVu/DejaVuMathTeXGyre.woff2
  29. BIN
      io.sc.standard.frontend/public/webjars/mathfonts/1.0.0/DejaVu/DejaVuMathTeXGyre.woff2

19
app.platform.scheduler.executor/build-common.gradle

@ -0,0 +1,19 @@
/**
* (target)
* : -D
* :
* 1. gradle bootwar # , target=tomcat
* 2. gradle bootwar -Dtarget=undertow # undertow, target=undertow
* 3. gradle bootwar -Dtarget=jetty # jetty, target=jetty
*/
def target =System.getProperty("target") ?: "undertow";
System.setProperty('target',target);
// targetRuntime build.gradle
apply from: "build-${target}.gradle"
//
publishPublicationPublicationToMavenRepository.enabled=false
// docker
jibBuildTar.enabled =true

15
app.platform.scheduler.executor/build-jetty.gradle

@ -0,0 +1,15 @@
println "[Jetty] 环境 ......"
configurations {
all*.exclude group: "org.springframework.boot", module: "spring-boot-starter-tomcat"
all*.exclude group: "org.apache.tomcat.embed", module: "tomcat-embed-core"
all*.exclude group: "org.apache.tomcat.embed", module: "tomcat-embed-websocket"
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-jetty")
providedRuntime(
"org.springframework.boot:spring-boot-starter-jetty",
)
}

7
app.platform.scheduler.executor/build-tomcat.gradle

@ -0,0 +1,7 @@
println "[Tomcat] 环境 ......"
dependencies {
providedRuntime(
"org.springframework.boot:spring-boot-starter-tomcat",
)
}

15
app.platform.scheduler.executor/build-undertow.gradle

@ -0,0 +1,15 @@
println "[Undertow] 环境 ......"
configurations {
all*.exclude group: "org.springframework.boot", module: "spring-boot-starter-tomcat"
all*.exclude group: "org.apache.tomcat.embed", module: "tomcat-embed-core"
all*.exclude group: "org.apache.tomcat.embed", module: "tomcat-embed-websocket"
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-undertow")
providedRuntime(
"org.springframework.boot:spring-boot-starter-undertow",
)
}

99
app.platform.scheduler.executor/build.gradle

@ -0,0 +1,99 @@
apply plugin: 'war'
apply plugin: 'com.google.cloud.tools.jib'
apply from: "build-common.gradle"
dependencies {
implementation("org.springframework.boot:spring-boot-starter-web"){
exclude group: "org.springframework.boot", module: "spring-boot-starter-tomcat"
}
}
dependencies {
implementation (
project(":io.sc.platform.scheduler.executor"),
)
}
/**
* replace [application.version] in i18n message file
*/
processResources {
filesMatching('**/messages*.properties') {
println 'replace ${version} in [' + it + ']'
filteringCharset = 'iso8859-1'
filter(org.apache.tools.ant.filters.ReplaceTokens, beginToken: '$version', endToken: '',tokens: [version: '' + project.version])
}
doLast{
// eclipse idea ,:
// 1. environment.properties src/main/resources
// 2. ,
delete "$buildDir/resources/main/running-mode.properties"
}
}
bootWar{
mainClass = "${project.name}.Application"
//launchScript()
manifest {
attributes 'Implementation-Version': archiveVersion,
'Implementation-Title': project.name
}
}
bootJar{
mainClass = "${project.name}.Application"
//launchScript()
manifest {
attributes 'Implementation-Version': archiveVersion,
'Implementation-Title': project.name
}
}
jib {
outputPaths {
tar = "build/libs/${project.name}-${project.version}-image.tar"
}
from {
image = "openjdk:8u342-slim"
//image = "eclipse-temurin:8u382-b05-jdk-focal"
platforms {
platform {
architecture ="arm64"
os ="linux"
}
}
}
to {
image = "${project.name}:${project.version}"
}
extraDirectories {
paths {
path {
from = "build/libs/"
into = "/opt/${project.name}/"
includes = ["${project.name}-${project.version}.war"]
}
}
}
container {
/**
* jvm的启动参数
* user.timezone - Java程序的时区问题
*/
jvmFlags = ["-Duser.timezone=Asia/Shanghai"]
creationTime = "USE_CURRENT_TIMESTAMP"
ports = ["8080"]
entrypoint = [
"java",
"-jar",
"/opt/" + project.name + "/" + project.name + "-" + project.version + ".war",
"--" + project.name + ".home.dir=" + "/opt/" + project.name
]
//entrypoint = "java -version"
//appRoot = "/usr/local/tomcat/webapps/ROOT"
}
}

11
app.platform.scheduler.executor/src/main/resources/public/configure.js

@ -0,0 +1,11 @@
// 在浏览器 window 对象中新建名为 APP 的容器变量, 用于存放平台的全局变量
window.APP = {};
// 全局配置
window.APP.configure ={
// 应用上下文路径
webContextPath: '[(@{/})]'.startsWith('[')? '/' : '[(@{/})]',
// 默认后端 API 请求的服务地址前缀
apiContextPaths: {
DEFAULT: '[(@{/})]'.startsWith('[') ? 'http://localhost:8080/' : '[(@{/})]'
}
};

19
app.platform.scheduler.manager/build-common.gradle

@ -0,0 +1,19 @@
/**
* (target)
* : -D
* :
* 1. gradle bootwar # , target=tomcat
* 2. gradle bootwar -Dtarget=undertow # undertow, target=undertow
* 3. gradle bootwar -Dtarget=jetty # jetty, target=jetty
*/
def target =System.getProperty("target") ?: "undertow";
System.setProperty('target',target);
// targetRuntime build.gradle
apply from: "build-${target}.gradle"
//
publishPublicationPublicationToMavenRepository.enabled=false
// docker
jibBuildTar.enabled =true

15
app.platform.scheduler.manager/build-jetty.gradle

@ -0,0 +1,15 @@
println "[Jetty] 环境 ......"
configurations {
all*.exclude group: "org.springframework.boot", module: "spring-boot-starter-tomcat"
all*.exclude group: "org.apache.tomcat.embed", module: "tomcat-embed-core"
all*.exclude group: "org.apache.tomcat.embed", module: "tomcat-embed-websocket"
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-jetty")
providedRuntime(
"org.springframework.boot:spring-boot-starter-jetty",
)
}

7
app.platform.scheduler.manager/build-tomcat.gradle

@ -0,0 +1,7 @@
println "[Tomcat] 环境 ......"
dependencies {
providedRuntime(
"org.springframework.boot:spring-boot-starter-tomcat",
)
}

15
app.platform.scheduler.manager/build-undertow.gradle

@ -0,0 +1,15 @@
println "[Undertow] 环境 ......"
configurations {
all*.exclude group: "org.springframework.boot", module: "spring-boot-starter-tomcat"
all*.exclude group: "org.apache.tomcat.embed", module: "tomcat-embed-core"
all*.exclude group: "org.apache.tomcat.embed", module: "tomcat-embed-websocket"
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-undertow")
providedRuntime(
"org.springframework.boot:spring-boot-starter-undertow",
)
}

11
app.platform.scheduler.manager/src/main/resources/public/configure.js

@ -0,0 +1,11 @@
// 在浏览器 window 对象中新建名为 APP 的容器变量, 用于存放平台的全局变量
window.APP = {};
// 全局配置
window.APP.configure ={
// 应用上下文路径
webContextPath: '[(@{/})]'.startsWith('[')? '/' : '[(@{/})]',
// 默认后端 API 请求的服务地址前缀
apiContextPaths: {
DEFAULT: '[(@{/})]'.startsWith('[') ? 'http://localhost:8080/' : '[(@{/})]'
}
};

7
app.platform/build.gradle

@ -15,6 +15,10 @@ dependencies {
project(":io.sc.platform.developer"),
project(":io.sc.platform.security.loginform"),
project(":io.sc.platform.scheduler.manager"),
project(":io.sc.platform.scheduler.executor"),
/*
project(":io.sc.engine.mv"),
project(":io.sc.engine.mv.frontend"),
project(":io.sc.engine.mv.sample"),
@ -30,8 +34,7 @@ dependencies {
project(":erm"),
project(":erm.frontend"),
project(":io.sc.platform.scheduler.manager"),
*/
)
}

BIN
erm.frontend/public/webjars/mathfonts/1.0.0/Asana/Asana-Math.woff2

Binary file not shown.

0
io.sc.platform.core.frontend/public/webjars/mathfonts/1.0.0/DejaVu/DejaVuMathTeXGyre.woff2 → erm.frontend/public/webjars/mathfonts/1.0.0/DejaVu/DejaVuMathTeXGyre.woff2

BIN
io.sc.engine.mv.frontend/public/webjars/mathfonts/1.0.0/DejaVu/DejaVuMathTeXGyre.woff2

Binary file not shown.

BIN
io.sc.engine.mv.frontend/public/webjars/mathfonts/1.0.0/DejaVu/DejaVuSerif.woff2

Binary file not shown.

BIN
io.sc.engine.rule.frontend/public/webjars/mathfonts/1.0.0/DejaVu/DejaVuMathTeXGyre.woff2

Binary file not shown.

BIN
io.sc.engine.rule.frontend/public/webjars/mathfonts/1.0.0/DejaVu/DejaVuSerif.woff2

Binary file not shown.

BIN
io.sc.engine.st.frontend/public/webjars/mathfonts/1.0.0/DejaVu/DejaVuMathTeXGyre.woff2

Binary file not shown.

BIN
io.sc.platform.developer.frontend/public/webjars/mathfonts/1.0.0/Asana/Asana-Math.woff2

Binary file not shown.

BIN
io.sc.platform.developer.frontend/public/webjars/mathfonts/1.0.0/DejaVu/DejaVuMathTeXGyre.woff2

Binary file not shown.

BIN
io.sc.platform.mvc.frontend/public/webjars/mathfonts/1.0.0/DejaVu/DejaVuMathTeXGyre.woff2

Binary file not shown.

3
io.sc.platform.orm/src/main/java/io/sc/platform/orm/service/DaoService.java

@ -1,6 +1,7 @@
package io.sc.platform.orm.service;
import java.io.Serializable;
import java.util.Enumeration;
import java.util.List;
import java.util.Map;
@ -38,7 +39,7 @@ public interface DaoService<E,ID extends Serializable,R extends DaoRepository<E,
public List<E> list(Specification<E> specification, QueryParameter queryParameter) throws Exception;
public Page<E> query(QueryParameter queryParameter) throws Exception;
public Page<E> query(Specification<E> specification, QueryParameter queryParameter) throws Exception;
public List<Criteria> buildCriteriaFromEntity(E entity) throws Exception;
public List<Criteria> buildCriteriaFromEntity(Enumeration<String> parameterNames, E entity) throws Exception;
public List<E> getDefaultValues() throws Exception;
public void resetDefaultValues() throws Exception;
}

49
io.sc.platform.orm/src/main/java/io/sc/platform/orm/service/impl/DaoServiceImpl.java

@ -4,7 +4,9 @@ import io.sc.platform.orm.repository.DaoRepository;
import io.sc.platform.orm.service.DaoService;
import io.sc.platform.orm.service.support.*;
import io.sc.platform.orm.service.support.criteria.Criteria;
import io.sc.platform.orm.service.support.criteria.impl.Contains;
import io.sc.platform.orm.service.support.criteria.impl.Equals;
import io.sc.platform.orm.service.support.criteria.impl.IContains;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.core.convert.ConversionService;
@ -421,7 +423,7 @@ public abstract class DaoServiceImpl<E,ID extends Serializable,R extends DaoRepo
}
@Override
public List<Criteria> buildCriteriaFromEntity(E entity) throws Exception {
public List<Criteria> buildCriteriaFromEntity(Enumeration<String> parameterNames,E entity) throws Exception {
if(entity==null){
return Collections.emptyList();
}
@ -435,7 +437,49 @@ public abstract class DaoServiceImpl<E,ID extends Serializable,R extends DaoRepo
DirectFieldAccessFallbackBeanWrapper wrapper = new DirectFieldAccessFallbackBeanWrapper(entity);
Map<String,SingularAttribute<?,?>> attributes =managedTypeAttributes.getSingularAssociationAttributes();
Map<String, SingularAttribute<?,?>> singularAttributes =managedTypeAttributes.getSingularAttributes();
singularAttributes.putAll(managedTypeAttributes.getSingularAssociationAttributes());
if(parameterNames!=null){
while(parameterNames.hasMoreElements()){
String parameterName =parameterNames.nextElement();
SingularAttribute<?,?> singularAttribute =singularAttributes.get(parameterName);
if(singularAttribute!=null){
Object value =wrapper.getPropertyValue(parameterName);
if(value!=null){
if (value instanceof String) {
IContains icontains = new IContains();
icontains.setFieldName(parameterName);
icontains.setValue(value.toString());
result.add(icontains);
} else {
Equals equals = new Equals();
equals.setFieldName(parameterName);
equals.setValue(value.toString());
result.add(equals);
}
}
}
}
}
// attributes.keySet().forEach(fieldName ->{
// JavaTypeAndValue javaTypeAndValue =attributes.get(fieldName);
// Object value =javaTypeAndValue.getValue();
// if(value!=null) {
// if (value instanceof String) {
// IContains icontains = new IContains();
// icontains.setFieldName(fieldName);
// icontains.setValue(value.toString());
// result.add(icontains);
// } else {
// Equals equals = new Equals();
// equals.setFieldName(fieldName);
// equals.setValue(value.toString());
// result.add(equals);
// }
// }
// });
/*
if(attributes==null || attributes.isEmpty()){ return result;}
attributes.keySet().forEach(fieldName ->{
Object value =wrapper.getPropertyValue(fieldName);
@ -451,6 +495,7 @@ public abstract class DaoServiceImpl<E,ID extends Serializable,R extends DaoRepo
}
}
});
*/
return result;
}

9
io.sc.platform.orm/src/main/java/io/sc/platform/orm/service/support/criteria/impl/Contains.java

@ -11,6 +11,7 @@ import java.util.Map;
public class Contains<E> extends Criteria<E> {
protected String value;
@Override
public Predicate getPredicate(Root<E> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
if(!StringUtils.hasText(value)){
@ -35,4 +36,12 @@ public class Contains<E> extends Criteria<E> {
condition.setWhere(where);
return condition;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}

156
io.sc.platform.scheduler.executor/src/main/java/io/sc/platform/scheduler/executor/util/DateUtil.java

@ -1,156 +0,0 @@
package io.sc.platform.scheduler.executor.util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* date util
*
* @author xuxueli 2018-08-19 01:24:11
*/
public class DateUtil {
// ---------------------- format parse ----------------------
private static Logger logger = LoggerFactory.getLogger(DateUtil.class);
private static final String DATE_FORMAT = "yyyy-MM-dd";
private static final String DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
private static final ThreadLocal<Map<String, DateFormat>> dateFormatThreadLocal = new ThreadLocal<Map<String, DateFormat>>();
private static DateFormat getDateFormat(String pattern) {
if (pattern==null || pattern.trim().length()==0) {
throw new IllegalArgumentException("pattern cannot be empty.");
}
Map<String, DateFormat> dateFormatMap = dateFormatThreadLocal.get();
if(dateFormatMap!=null && dateFormatMap.containsKey(pattern)){
return dateFormatMap.get(pattern);
}
synchronized (dateFormatThreadLocal) {
if (dateFormatMap == null) {
dateFormatMap = new HashMap<String, DateFormat>();
}
dateFormatMap.put(pattern, new SimpleDateFormat(pattern));
dateFormatThreadLocal.set(dateFormatMap);
}
return dateFormatMap.get(pattern);
}
/**
* format datetime. like "yyyy-MM-dd"
*
* @param date
* @return
* @throws ParseException
*/
public static String formatDate(Date date) {
return format(date, DATE_FORMAT);
}
/**
* format date. like "yyyy-MM-dd HH:mm:ss"
*
* @param date
* @return
* @throws ParseException
*/
public static String formatDateTime(Date date) {
return format(date, DATETIME_FORMAT);
}
/**
* format date
*
* @param date
* @param patten
* @return
* @throws ParseException
*/
public static String format(Date date, String patten) {
return getDateFormat(patten).format(date);
}
/**
* parse date string, like "yyyy-MM-dd HH:mm:s"
*
* @param dateString
* @return
* @throws ParseException
*/
public static Date parseDate(String dateString){
return parse(dateString, DATE_FORMAT);
}
/**
* parse datetime string, like "yyyy-MM-dd HH:mm:ss"
*
* @param dateString
* @return
* @throws ParseException
*/
public static Date parseDateTime(String dateString) {
return parse(dateString, DATETIME_FORMAT);
}
/**
* parse date
*
* @param dateString
* @param pattern
* @return
* @throws ParseException
*/
public static Date parse(String dateString, String pattern) {
try {
Date date = getDateFormat(pattern).parse(dateString);
return date;
} catch (Exception e) {
logger.warn("parse date error, dateString = {}, pattern={}; errorMsg = {}", dateString, pattern, e.getMessage());
return null;
}
}
// ---------------------- add date ----------------------
public static Date addYears(final Date date, final int amount) {
return add(date, Calendar.YEAR, amount);
}
public static Date addMonths(final Date date, final int amount) {
return add(date, Calendar.MONTH, amount);
}
public static Date addDays(final Date date, final int amount) {
return add(date, Calendar.DAY_OF_MONTH, amount);
}
public static Date addHours(final Date date, final int amount) {
return add(date, Calendar.HOUR_OF_DAY, amount);
}
public static Date addMinutes(final Date date, final int amount) {
return add(date, Calendar.MINUTE, amount);
}
private static Date add(final Date date, final int calendarField, final int amount) {
if (date == null) {
return null;
}
final Calendar c = Calendar.getInstance();
c.setTime(date);
c.add(calendarField, amount);
return c.getTime();
}
}

BIN
io.sc.platform.scheduler.manager.frontend/public/webjars/mathfonts/1.0.0/DejaVu/DejaVuMathTeXGyre.woff2

Binary file not shown.

BIN
io.sc.platform.system.frontend/public/webjars/mathfonts/1.0.0/DejaVu/DejaVuMathTeXGyre.woff2

Binary file not shown.

BIN
io.sc.standard.frontend/public/webjars/mathfonts/1.0.0/DejaVu/DejaVuMathTeXGyre.woff2

Binary file not shown.
Loading…
Cancel
Save