提交 318d72a0 编写于 作者: O o2null

Merge branch 'fix/#255' into 'develop'

Cleanup 统一处理日志清除

See merge request o2oa/o2oa!1355
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
"pms": "", "pms": "",
"zhengwuDingding": "", "zhengwuDingding": "",
"qiyeweixin": "", "qiyeweixin": "",
"welink": "",
"ws": "", "ws": "",
"dingding": "" "dingding": ""
} }
...@@ -22,6 +23,7 @@ ...@@ -22,6 +23,7 @@
"pms": "", "pms": "",
"zhengwuDingding": "", "zhengwuDingding": "",
"qiyeweixin": "", "qiyeweixin": "",
"welink": "",
"ws": "", "ws": "",
"dingding": "" "dingding": ""
} }
...@@ -32,6 +34,7 @@ ...@@ -32,6 +34,7 @@
"pms": "", "pms": "",
"zhengwuDingding": "", "zhengwuDingding": "",
"qiyeweixin": "", "qiyeweixin": "",
"welink": "",
"ws": "", "ws": "",
"dingding": "" "dingding": ""
} }
...@@ -42,6 +45,7 @@ ...@@ -42,6 +45,7 @@
"pms": "", "pms": "",
"zhengwuDingding": "", "zhengwuDingding": "",
"qiyeweixin": "", "qiyeweixin": "",
"welink": "",
"ws": "", "ws": "",
"dingding": "" "dingding": ""
} }
...@@ -52,6 +56,7 @@ ...@@ -52,6 +56,7 @@
"pms": "", "pms": "",
"zhengwuDingding": "", "zhengwuDingding": "",
"qiyeweixin": "", "qiyeweixin": "",
"welink": "",
"ws": "", "ws": "",
"dingding": "" "dingding": ""
} }
...@@ -76,6 +81,7 @@ ...@@ -76,6 +81,7 @@
"pms": "", "pms": "",
"zhengwuDingding": "", "zhengwuDingding": "",
"qiyeweixin": "", "qiyeweixin": "",
"welink": "",
"ws": "", "ws": "",
"dingding": "" "dingding": ""
} }
...@@ -92,6 +98,7 @@ ...@@ -92,6 +98,7 @@
"pms": "", "pms": "",
"zhengwuDingding": "", "zhengwuDingding": "",
"qiyeweixin": "", "qiyeweixin": "",
"welink": "",
"ws": "", "ws": "",
"dingding": "" "dingding": ""
} }
...@@ -102,6 +109,7 @@ ...@@ -102,6 +109,7 @@
"pms": "", "pms": "",
"zhengwuDingding": "", "zhengwuDingding": "",
"qiyeweixin": "", "qiyeweixin": "",
"welink": "",
"ws": "", "ws": "",
"dingding": "" "dingding": ""
} }
...@@ -134,6 +142,7 @@ ...@@ -134,6 +142,7 @@
"pms": "", "pms": "",
"zhengwuDingding": "", "zhengwuDingding": "",
"qiyeweixin": "", "qiyeweixin": "",
"welink": "",
"ws": "", "ws": "",
"dingding": "" "dingding": ""
} }
...@@ -156,6 +165,7 @@ ...@@ -156,6 +165,7 @@
"pms": "", "pms": "",
"zhengwuDingding": "", "zhengwuDingding": "",
"qiyeweixin": "", "qiyeweixin": "",
"welink": "",
"ws": "", "ws": "",
"dingding": "" "dingding": ""
} }
...@@ -170,6 +180,7 @@ ...@@ -170,6 +180,7 @@
"pms": "", "pms": "",
"zhengwuDingding": "", "zhengwuDingding": "",
"qiyeweixin": "", "qiyeweixin": "",
"welink": "",
"ws": "", "ws": "",
"dingding": "" "dingding": ""
} }
......
...@@ -83,70 +83,70 @@ public class EntityManagerContainer extends EntityManagerContainerBasic { ...@@ -83,70 +83,70 @@ public class EntityManagerContainer extends EntityManagerContainerBasic {
// Object object = jpa.get(field.getName()); // Object object = jpa.get(field.getName());
Object object = FieldUtils.readField(field, jpa, true); Object object = FieldUtils.readField(field, jpa, true);
switch (fieldType) { switch (fieldType) {
case stringValue: case stringValue:
this.persistChecker.stringValue.check(field, null == object ? null : Objects.toString(object), jpa, this.persistChecker.stringValue.check(field, null == object ? null : Objects.toString(object), jpa,
checkPersist, checkPersistType); checkPersist, checkPersistType);
break; break;
case stringValueList: case stringValueList:
this.persistChecker.stringValueList.check(field, null == object ? null : (List<String>) object, jpa, this.persistChecker.stringValueList.check(field, null == object ? null : (List<String>) object, jpa,
checkPersist, checkPersistType); checkPersist, checkPersistType);
break; break;
case dateValue: case dateValue:
this.persistChecker.dateValue.check(field, (null == object ? null : (Date) object), jpa, this.persistChecker.dateValue.check(field, (null == object ? null : (Date) object), jpa, checkPersist,
checkPersist, checkPersistType); checkPersistType);
break; break;
case dateValueList: case dateValueList:
this.persistChecker.dateValueList.check(field, (null == object ? null : (List<Date>) object), jpa, this.persistChecker.dateValueList.check(field, (null == object ? null : (List<Date>) object), jpa,
checkPersist, checkPersistType); checkPersist, checkPersistType);
break; break;
case booleanValue: case booleanValue:
this.persistChecker.booleanValue.check(field, (null == object ? null : (Boolean) object), jpa, this.persistChecker.booleanValue.check(field, (null == object ? null : (Boolean) object), jpa,
checkPersist, checkPersistType); checkPersist, checkPersistType);
break; break;
case booleanValueList: case booleanValueList:
this.persistChecker.booleanValueList.check(field, (null == object ? null : (List<Boolean>) object), this.persistChecker.booleanValueList.check(field, (null == object ? null : (List<Boolean>) object), jpa,
jpa, checkPersist, checkPersistType); checkPersist, checkPersistType);
break; break;
case integerValue: case integerValue:
this.persistChecker.integerValue.check(field, (null == object ? null : (Integer) object), jpa, this.persistChecker.integerValue.check(field, (null == object ? null : (Integer) object), jpa,
checkPersist, checkPersistType); checkPersist, checkPersistType);
break; break;
case integerValueList: case integerValueList:
this.persistChecker.integerValueList.check(field, (null == object ? null : (List<Integer>) object), this.persistChecker.integerValueList.check(field, (null == object ? null : (List<Integer>) object), jpa,
jpa, checkPersist, checkPersistType); checkPersist, checkPersistType);
break; break;
case doubleValue: case doubleValue:
this.persistChecker.doubleValue.check(field, (null == object ? null : (Double) object), jpa, this.persistChecker.doubleValue.check(field, (null == object ? null : (Double) object), jpa,
checkPersist, checkPersistType); checkPersist, checkPersistType);
break; break;
case doubleValueList: case doubleValueList:
this.persistChecker.doubleValueList.check(field, (null == object ? null : (List<Double>) object), this.persistChecker.doubleValueList.check(field, (null == object ? null : (List<Double>) object), jpa,
jpa, checkPersist, checkPersistType); checkPersist, checkPersistType);
break; break;
case longValue: case longValue:
this.persistChecker.longValue.check(field, (null == object ? null : (Long) object), jpa, this.persistChecker.longValue.check(field, (null == object ? null : (Long) object), jpa, checkPersist,
checkPersist, checkPersistType); checkPersistType);
break; break;
case longValueList: case longValueList:
this.persistChecker.longValueList.check(field, (null == object ? null : (List<Long>) object), jpa, this.persistChecker.longValueList.check(field, (null == object ? null : (List<Long>) object), jpa,
checkPersist, checkPersistType); checkPersist, checkPersistType);
break; break;
case floatValue: case floatValue:
this.persistChecker.floatValue.check(field, (null == object ? null : (Float) object), jpa, this.persistChecker.floatValue.check(field, (null == object ? null : (Float) object), jpa, checkPersist,
checkPersist, checkPersistType); checkPersistType);
break; break;
case floatValueList: case floatValueList:
this.persistChecker.floatValueList.check(field, (null == object ? null : (List<Float>) object), jpa, this.persistChecker.floatValueList.check(field, (null == object ? null : (List<Float>) object), jpa,
checkPersist, checkPersistType); checkPersist, checkPersistType);
break; break;
case byteValueArray: case byteValueArray:
this.persistChecker.byteValueArray.check(field, (null == object ? null : (byte[]) object), jpa, this.persistChecker.byteValueArray.check(field, (null == object ? null : (byte[]) object), jpa,
checkPersist, checkPersistType); checkPersist, checkPersistType);
break; break;
case enumValue: case enumValue:
break; break;
default: default:
break; break;
} }
} }
} }
...@@ -161,16 +161,16 @@ public class EntityManagerContainer extends EntityManagerContainerBasic { ...@@ -161,16 +161,16 @@ public class EntityManagerContainer extends EntityManagerContainerBasic {
// Object object = jpa.get(field.getName()); // Object object = jpa.get(field.getName());
Object object = FieldUtils.readField(field, jpa, true); Object object = FieldUtils.readField(field, jpa, true);
switch (fieldType) { switch (fieldType) {
case stringValue: case stringValue:
this.removeChecker.stringValue.check(field, null == object ? null : Objects.toString(object), jpa, this.removeChecker.stringValue.check(field, null == object ? null : Objects.toString(object), jpa,
checkRemove, checkRemoveType); checkRemove, checkRemoveType);
break; break;
case stringValueList: case stringValueList:
this.removeChecker.stringValueList.check(field, null == object ? null : (List<String>) object, jpa, this.removeChecker.stringValueList.check(field, null == object ? null : (List<String>) object, jpa,
checkRemove, checkRemoveType); checkRemove, checkRemoveType);
break; break;
default: default:
break; break;
} }
} }
} }
...@@ -208,19 +208,18 @@ public class EntityManagerContainer extends EntityManagerContainerBasic { ...@@ -208,19 +208,18 @@ public class EntityManagerContainer extends EntityManagerContainerBasic {
t = em.find(cls, id); t = em.find(cls, id);
} }
switch (exceptionWhen) { switch (exceptionWhen) {
case not_found: case not_found:
if (null == t) { if (null == t) {
throw new Exception("can not find entity id: " + id + ", class: " + cls.getCanonicalName() + "."); throw new Exception("can not find entity id: " + id + ", class: " + cls.getCanonicalName() + ".");
} }
break; break;
case found: case found:
if (null != t) { if (null != t) {
throw new Exception( throw new Exception("entity already existed, id: " + id + ", class: " + cls.getCanonicalName() + ".");
"entity already existed, id: " + id + ", class: " + cls.getCanonicalName() + "."); }
} break;
break; default:
default: break;
break;
} }
return t; return t;
} }
...@@ -245,14 +244,14 @@ public class EntityManagerContainer extends EntityManagerContainerBasic { ...@@ -245,14 +244,14 @@ public class EntityManagerContainer extends EntityManagerContainerBasic {
Predicate p = cb.equal(root.get(field.getName()), flag); Predicate p = cb.equal(root.get(field.getName()), flag);
List<T> list = em.createQuery(cq.select(root).where(p).distinct(true)).setMaxResults(2).getResultList(); List<T> list = em.createQuery(cq.select(root).where(p).distinct(true)).setMaxResults(2).getResultList();
switch (list.size()) { switch (list.size()) {
case 0: case 0:
break; break;
case 1: case 1:
t = list.get(0); t = list.get(0);
break out; break out;
case 2: case 2:
throw new Exception("flag get multiple entity flag:" + flag + ", class:" + cls.getName() throw new Exception("flag get multiple entity flag:" + flag + ", class:" + cls.getName()
+ ", attribute:" + field.getName() + "."); + ", attribute:" + field.getName() + ".");
} }
} }
return t; return t;
...@@ -310,15 +309,15 @@ public class EntityManagerContainer extends EntityManagerContainerBasic { ...@@ -310,15 +309,15 @@ public class EntityManagerContainer extends EntityManagerContainerBasic {
cq.select(root).where(p); cq.select(root).where(p);
List<T> list = em.createQuery(cq).setMaxResults(2).getResultList(); List<T> list = em.createQuery(cq).setMaxResults(2).getResultList();
switch (list.size()) { switch (list.size()) {
case 0: case 0:
break; break;
case 1: case 1:
t = list.get(0); t = list.get(0);
break out; break out;
default: default:
throw new Exception("flag get multiple entity flag:" + flag + ", class:" + cls.getName() throw new Exception("flag get multiple entity flag:" + flag + ", class:" + cls.getName()
+ ", attribute:" + field.getName() + ", restrict attrubte:" + singularAttribute + ", attribute:" + field.getName() + ", restrict attrubte:" + singularAttribute
+ ", restrict value:" + restrictValue + "."); + ", restrict value:" + restrictValue + ".");
} }
} }
return t; return t;
...@@ -940,6 +939,19 @@ public class EntityManagerContainer extends EntityManagerContainerBasic { ...@@ -940,6 +939,19 @@ public class EntityManagerContainer extends EntityManagerContainerBasic {
return new ArrayList<>(os); return new ArrayList<>(os);
} }
public <T extends JpaObject> List<String> idsLessThanMax(Class<T> cls, String attribute, Comparable value,
Integer count) throws Exception {
EntityManager em = this.get(cls);
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<String> cq = cb.createQuery(String.class);
Root<T> root = cq.from(cls);
Predicate p = cb.lessThan(root.get(attribute), (Comparable) value);
List<String> os = em.createQuery(cq.select(root.get(JpaObject.id_FIELDNAME)).where(p)).setMaxResults(count)
.getResultList();
List<String> list = new ArrayList<>(os);
return list;
}
public <T extends JpaObject> List<String> idsGreaterThan(Class<T> cls, String attribute, Object value) public <T extends JpaObject> List<String> idsGreaterThan(Class<T> cls, String attribute, Object value)
throws Exception { throws Exception {
EntityManager em = this.get(cls); EntityManager em = this.get(cls);
......
...@@ -135,9 +135,9 @@ public class ResourceFactory { ...@@ -135,9 +135,9 @@ public class ResourceFactory {
private static void internal_driud_c3p0() throws Exception { private static void internal_driud_c3p0() throws Exception {
for (Entry<String, DataServer> entry : Config.nodes().dataServers().entrySet()) { for (Entry<String, DataServer> entry : Config.nodes().dataServers().entrySet()) {
DruidDataSourceC3P0Adapter dataSource = new DruidDataSourceC3P0Adapter(); DruidDataSourceC3P0Adapter dataSource = new DruidDataSourceC3P0Adapter();
String url = "jdbc:h2:tcp://" + entry.getKey() + ":" + entry.getValue().getTcpPort() + "/X;JMX=" String url = "jdbc:h2:tcp://" + entry.getKey() + ":" + entry.getValue().getTcpPort()
+ (entry.getValue().getJmxEnable() ? "TRUE" : "FALSE") + ";CACHE_SIZE=" + "/X;DEFAULT_LOCK_TIMEOUT=99999999;JMX=" + (entry.getValue().getJmxEnable() ? "TRUE" : "FALSE")
+ (entry.getValue().getCacheSize() * 1024); + ";CACHE_SIZE=" + (entry.getValue().getCacheSize() * 1024);
dataSource.setJdbcUrl(url); dataSource.setJdbcUrl(url);
dataSource.setDriverClass(SlicePropertiesBuilder.driver_h2); dataSource.setDriverClass(SlicePropertiesBuilder.driver_h2);
dataSource.setPreferredTestQuery(SlicePropertiesBuilder.validationQueryOfUrl(url)); dataSource.setPreferredTestQuery(SlicePropertiesBuilder.validationQueryOfUrl(url));
...@@ -164,9 +164,9 @@ public class ResourceFactory { ...@@ -164,9 +164,9 @@ public class ResourceFactory {
BasicDataSource dataSource = new BasicDataSource(); BasicDataSource dataSource = new BasicDataSource();
String url = "jdbc:h2:tcp://" + entry.getKey() + ":" + entry.getValue().getTcpPort() + "/X;JMX=" String url = "jdbc:h2:tcp://" + entry.getKey() + ":" + entry.getValue().getTcpPort()
+ (entry.getValue().getJmxEnable() ? "TRUE" : "FALSE") + ";CACHE_SIZE=" + "/X;DEFAULT_LOCK_TIMEOUT=99999999;JMX=" + (entry.getValue().getJmxEnable() ? "TRUE" : "FALSE")
+ (entry.getValue().getCacheSize() * 1024); + ";CACHE_SIZE=" + (entry.getValue().getCacheSize() * 1024);
dataSource.setDriverClassName(SlicePropertiesBuilder.driver_h2); dataSource.setDriverClassName(SlicePropertiesBuilder.driver_h2);
dataSource.setUrl(url); dataSource.setUrl(url);
dataSource.setInitialSize(0); dataSource.setInitialSize(0);
...@@ -188,9 +188,9 @@ public class ResourceFactory { ...@@ -188,9 +188,9 @@ public class ResourceFactory {
private static void internal_driud() throws Exception { private static void internal_driud() throws Exception {
for (Entry<String, DataServer> entry : Config.nodes().dataServers().entrySet()) { for (Entry<String, DataServer> entry : Config.nodes().dataServers().entrySet()) {
DruidDataSource dataSource = new DruidDataSource(); DruidDataSource dataSource = new DruidDataSource();
String url = "jdbc:h2:tcp://" + entry.getKey() + ":" + entry.getValue().getTcpPort() + "/X;JMX=" String url = "jdbc:h2:tcp://" + entry.getKey() + ":" + entry.getValue().getTcpPort()
+ (entry.getValue().getJmxEnable() ? "TRUE" : "FALSE") + ";CACHE_SIZE=" + "/X;DEFAULT_LOCK_TIMEOUT=99999999;JMX=" + (entry.getValue().getJmxEnable() ? "TRUE" : "FALSE")
+ (entry.getValue().getCacheSize() * 1024); + ";CACHE_SIZE=" + (entry.getValue().getCacheSize() * 1024);
dataSource.setDriverClassName(SlicePropertiesBuilder.driver_h2); dataSource.setDriverClassName(SlicePropertiesBuilder.driver_h2);
dataSource.setUrl(url); dataSource.setUrl(url);
dataSource.setInitialSize(0); dataSource.setInitialSize(0);
...@@ -247,10 +247,10 @@ public class ResourceFactory { ...@@ -247,10 +247,10 @@ public class ResourceFactory {
private static void processPlatformExecutors() throws Exception { private static void processPlatformExecutors() throws Exception {
ExecutorService[] services = new ExecutorService[Config.processPlatform().getExecutorCount()]; ExecutorService[] services = new ExecutorService[Config.processPlatform().getExecutorCount()];
for (int i = 0; i < Config.processPlatform().getExecutorCount(); i++) { for (int i = 0; i < Config.processPlatform().getExecutorCount(); i++) {
//services[i] = Executors.newSingleThreadExecutor(); // services[i] = Executors.newSingleThreadExecutor();
services[i] = Executors.newFixedThreadPool(1); services[i] = Executors.newFixedThreadPool(1);
} }
new Resource(Config.RESOURCE_NODE_PROCESSPLATFORMEXECUTORS, services); new Resource(Config.RESOURCE_NODE_PROCESSPLATFORMEXECUTORS, services);
} }
......
package com.x.program.center;
import java.util.Date;
public class LogMessage {
private String remoteAddress;
private String text;
private Date dateTime;
public String getRemoteAddress() {
return remoteAddress;
}
public void setRemoteAddress(String remoteAddress) {
this.remoteAddress = remoteAddress;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public Date getDateTime() {
return dateTime;
}
public void setDateTime(Date dateTime) {
this.dateTime = dateTime;
}
}
package com.x.program.center; package com.x.program.center;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import com.x.base.core.container.EntityManagerContainer; import com.x.base.core.container.EntityManagerContainer;
import com.x.base.core.container.factory.EntityManagerContainerFactory; import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.entity.JpaObject;
import com.x.base.core.entity.annotation.CheckPersistType; import com.x.base.core.entity.annotation.CheckPersistType;
import com.x.base.core.project.bean.NameValuePair; import com.x.base.core.project.bean.NameValuePair;
import com.x.base.core.project.queue.AbstractQueue; import com.x.base.core.project.queue.AbstractQueue;
import com.x.program.center.core.entity.PromptErrorLog; import com.x.program.center.core.entity.PromptErrorLog;
import com.x.program.center.core.entity.ScheduleLog;
import com.x.program.center.core.entity.UnexpectedErrorLog; import com.x.program.center.core.entity.UnexpectedErrorLog;
import com.x.program.center.core.entity.WarnLog; import com.x.program.center.core.entity.WarnLog;
...@@ -16,39 +22,61 @@ public class LogQueue extends AbstractQueue<NameValuePair> { ...@@ -16,39 +22,61 @@ public class LogQueue extends AbstractQueue<NameValuePair> {
protected void execute(NameValuePair pair) { protected void execute(NameValuePair pair) {
try { try {
if (StringUtils.equals(pair.getName(), PromptErrorLog.class.getName())) { if (StringUtils.equals(pair.getName(), PromptErrorLog.class.getName())) {
this.concretePromptErrorLog(pair.getValue(PromptErrorLog.class)); PromptErrorLog o = pair.getValue(PromptErrorLog.class);
if (null != o) {
this.concrete(PromptErrorLog.class, o);
} else {
this.clean(PromptErrorLog.class);
}
} else if (StringUtils.equals(pair.getName(), UnexpectedErrorLog.class.getName())) { } else if (StringUtils.equals(pair.getName(), UnexpectedErrorLog.class.getName())) {
this.concreteUnexpectedErrorLog(pair.getValue(UnexpectedErrorLog.class)); UnexpectedErrorLog o = pair.getValue(UnexpectedErrorLog.class);
if (null != o) {
this.concrete(UnexpectedErrorLog.class, o);
} else {
this.clean(UnexpectedErrorLog.class);
}
} else if (StringUtils.equals(pair.getName(), WarnLog.class.getName())) { } else if (StringUtils.equals(pair.getName(), WarnLog.class.getName())) {
this.concreteWarnLog(pair.getValue(WarnLog.class)); WarnLog o = pair.getValue(WarnLog.class);
if (null != o) {
this.concrete(WarnLog.class, o);
} else {
this.clean(WarnLog.class);
}
} else if (StringUtils.equals(pair.getName(), ScheduleLog.class.getName())) {
ScheduleLog o = pair.getValue(ScheduleLog.class);
if (null != o) {
this.concrete(ScheduleLog.class, o);
} else {
this.clean(ScheduleLog.class);
}
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
private void concretePromptErrorLog(PromptErrorLog o) throws Exception { private <T extends JpaObject> void concrete(Class<T> cls, T o) throws Exception {
try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
emc.beginTransaction(PromptErrorLog.class);
emc.persist(o, CheckPersistType.all);
emc.commit();
}
}
private void concreteUnexpectedErrorLog(UnexpectedErrorLog o) throws Exception {
try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
emc.beginTransaction(UnexpectedErrorLog.class); emc.beginTransaction(cls);
emc.persist(o, CheckPersistType.all); emc.persist(o, CheckPersistType.all);
emc.commit(); emc.commit();
} }
} }
private void concreteWarnLog(WarnLog o) throws Exception { private <T extends JpaObject> void clean(Class<T> cls) throws Exception {
try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { List<String> ids = new ArrayList<>();
emc.beginTransaction(WarnLog.class); do {
emc.persist(o, CheckPersistType.all); try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
emc.commit(); Calendar threshold = Calendar.getInstance();
} threshold.add(Calendar.DATE, -5);
ids = emc.idsLessThanMax(cls, JpaObject.createTime_FIELDNAME, threshold.getTime(), 500);
if (!ids.isEmpty()) {
emc.beginTransaction(cls);
emc.delete(cls, ids);
emc.commit();
}
}
} while (!ids.isEmpty());
} }
} }
...@@ -8,7 +8,23 @@ import java.util.concurrent.ConcurrentHashMap; ...@@ -8,7 +8,23 @@ import java.util.concurrent.ConcurrentHashMap;
import com.google.gson.internal.LinkedTreeMap; import com.google.gson.internal.LinkedTreeMap;
import com.x.base.core.project.config.Config; import com.x.base.core.project.config.Config;
import com.x.base.core.project.logger.LoggerFactory; import com.x.base.core.project.logger.LoggerFactory;
import com.x.program.center.schedule.*; import com.x.program.center.schedule.Area;
import com.x.program.center.schedule.Cleanup;
import com.x.program.center.schedule.CleanupCode;
import com.x.program.center.schedule.CollectLog;
import com.x.program.center.schedule.CollectMarket;
import com.x.program.center.schedule.CollectPerson;
import com.x.program.center.schedule.DingdingSyncOrganization;
import com.x.program.center.schedule.DingdingSyncOrganizationTrigger;
import com.x.program.center.schedule.FireSchedule;
import com.x.program.center.schedule.QiyeweixinSyncOrganization;
import com.x.program.center.schedule.QiyeweixinSyncOrganizationTrigger;
import com.x.program.center.schedule.RefreshApplications;
import com.x.program.center.schedule.TriggerAgent;
import com.x.program.center.schedule.WeLinkSyncOrganization;
import com.x.program.center.schedule.WeLinkSyncOrganizationTrigger;
import com.x.program.center.schedule.ZhengwuDingdingSyncOrganization;
import com.x.program.center.schedule.ZhengwuDingdingSyncOrganizationTrigger;
public class ThisApplication { public class ThisApplication {
...@@ -20,7 +36,7 @@ public class ThisApplication { ...@@ -20,7 +36,7 @@ public class ThisApplication {
public static CenterQueue centerQueue = new CenterQueue(); public static CenterQueue centerQueue = new CenterQueue();
public static LogQueue logQueue; public static LogQueue logQueue = new LogQueue();
public static List<Object> dingdingSyncOrganizationCallbackRequest = new ArrayList<>(); public static List<Object> dingdingSyncOrganizationCallbackRequest = new ArrayList<>();
...@@ -37,7 +53,6 @@ public class ThisApplication { ...@@ -37,7 +53,6 @@ public class ThisApplication {
LoggerFactory.setLevel(Config.logLevel().x_program_center()); LoggerFactory.setLevel(Config.logLevel().x_program_center());
/* 20190927新报告机制 */ /* 20190927新报告机制 */
context().startQueue(centerQueue); context().startQueue(centerQueue);
logQueue = new LogQueue();
context().startQueue(logQueue); context().startQueue(logQueue);
/* 政务钉钉拉入同步 */ /* 政务钉钉拉入同步 */
...@@ -75,11 +90,8 @@ public class ThisApplication { ...@@ -75,11 +90,8 @@ public class ThisApplication {
CenterQueue.REFRESHAPPLICATIONSINTERVAL); CenterQueue.REFRESHAPPLICATIONSINTERVAL);
// 运行间隔由300秒缩减到120秒 // 运行间隔由300秒缩减到120秒
context().scheduleLocal(FireSchedule.class, 180, 120); context().scheduleLocal(FireSchedule.class, 180, 120);
context().scheduleLocal(CleanupScheduleLog.class, 10, 80);
context().scheduleLocal(CleanupCode.class, 10, 60 * 30); context().scheduleLocal(CleanupCode.class, 10, 60 * 30);
context().scheduleLocal(CleanupPromptErrorLog.class, 10, 60 * 30); context().scheduleLocal(Cleanup.class, 10, 60 * 30);
context().scheduleLocal(CleanupUnexpectedErrorLog.class, 10, 60 * 30);
context().scheduleLocal(CleanupWarnLog.class, 10, 60 * 30);
context().scheduleLocal(CollectPerson.class, 10, 60 * 30); context().scheduleLocal(CollectPerson.class, 10, 60 * 30);
context().scheduleLocal(CollectMarket.class, 10, 60 * 60 * 6); context().scheduleLocal(CollectMarket.class, 10, 60 * 60 * 6);
context().scheduleLocal(CollectLog.class, 10, 60 * 30); context().scheduleLocal(CollectLog.class, 10, 60 * 30);
......
package com.x.program.center.jaxrs.schedule; package com.x.program.center.jaxrs.schedule;
import org.apache.commons.lang3.StringUtils;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.x.base.core.container.EntityManagerContainer;
import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.entity.JpaObject; import com.x.base.core.entity.JpaObject;
import com.x.base.core.entity.annotation.CheckPersistType; import com.x.base.core.project.bean.NameValuePair;
import com.x.base.core.project.bean.WrapCopier; import com.x.base.core.project.bean.WrapCopier;
import com.x.base.core.project.bean.WrapCopierFactory; import com.x.base.core.project.bean.WrapCopierFactory;
import com.x.base.core.project.exception.ExceptionAccessDenied;
import com.x.base.core.project.http.ActionResult; import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson; import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WrapBoolean; import com.x.base.core.project.jaxrs.WrapBoolean;
import com.x.base.core.project.tools.StringTools;
import com.x.program.center.ThisApplication;
import com.x.program.center.core.entity.ScheduleLog; import com.x.program.center.core.entity.ScheduleLog;
class ActionReport extends BaseAction { class ActionReport extends BaseAction {
ActionResult<Wo> execute(EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception { ActionResult<Wo> execute(EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception {
try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { ActionResult<Wo> result = new ActionResult<>();
Wi wi = this.convertToWrapIn(jsonElement, Wi.class); Wi wi = gson.fromJson(jsonElement, Wi.class);
if (effectivePerson.isNotManager()) { ScheduleLog o = Wi.copier.copy(wi);
throw new ExceptionAccessDenied(effectivePerson); /** 默认使用传递过来的id,如果不存在那么重新赋值 */
} if (StringUtils.isEmpty(o.getId())) {
ActionResult<Wo> result = new ActionResult<>(); o.setId(StringTools.uniqueToken());
emc.beginTransaction(ScheduleLog.class);
ScheduleLog log = Wi.copier.copy(wi);
emc.persist(log, CheckPersistType.all);
emc.commit();
Wo wo = new Wo();
wo.setValue(true);
result.setData(wo);
return result;
} }
NameValuePair pair = new NameValuePair();
pair.setName(ScheduleLog.class.getName());
pair.setValue(o);
ThisApplication.logQueue.send(pair);
Wo wo = new Wo();
wo.setValue(true);
result.setData(wo);
return result;
} }
public static class Wi extends ScheduleLog { public static class Wi extends ScheduleLog {
......
package com.x.program.center.jaxrs.test; package com.x.program.center.jaxrs.test;
import java.util.ArrayList;
import java.util.List;
import java.util.Map.Entry;
import com.x.base.core.project.Applications;
import com.x.base.core.project.config.CenterServer;
import com.x.base.core.project.config.CenterServers;
import com.x.base.core.project.config.Config;
import com.x.base.core.project.exception.ExceptionAccessDenied;
import com.x.base.core.project.gson.GsonPropertyObject; import com.x.base.core.project.gson.GsonPropertyObject;
import com.x.base.core.project.http.ActionResult; import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson; import com.x.base.core.project.http.EffectivePerson;
...@@ -19,38 +10,10 @@ class ActionTest1 extends BaseAction { ...@@ -19,38 +10,10 @@ class ActionTest1 extends BaseAction {
ActionResult<Wo> result = new ActionResult<>(); ActionResult<Wo> result = new ActionResult<>();
if (!effectivePerson.isManager()) {
throw new ExceptionAccessDenied(effectivePerson);
}
Wo wo = new Wo();
wo.applications = gson.fromJson(Config.resource_node_applications(), Applications.class);
wo.resource_node_centersPirmaryNode = Config.resource_node_centersPirmaryNode();
wo.resource_node_centersPirmaryPort = Config.resource_node_centersPirmaryPort();
wo.resource_node_centersPirmarySslEnable = Config.resource_node_centersPirmarySslEnable();
for (Entry<String, CenterServer> en : Config.nodes().centerServers().orderedEntry()) {
wo.nodes_centerServers_ordered.add(en.getValue());
}
wo.centerServers = Config.nodes().centerServers();
result.setData(wo);
return result; return result;
} }
public static class Wo extends GsonPropertyObject { public static class Wo extends GsonPropertyObject {
private Applications applications;
private String resource_node_centersPirmaryNode;
private Integer resource_node_centersPirmaryPort;
private Boolean resource_node_centersPirmarySslEnable;
private List<CenterServer> nodes_centerServers_ordered = new ArrayList<>();
private CenterServers centerServers;
} }
} }
\ No newline at end of file
package com.x.program.center.schedule;
import java.util.ArrayList;
import java.util.List;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import com.x.base.core.entity.JpaObject;
import com.x.base.core.project.bean.NameValuePair;
import com.x.base.core.project.logger.Logger;
import com.x.base.core.project.logger.LoggerFactory;
import com.x.program.center.ThisApplication;
import com.x.program.center.core.entity.PromptErrorLog;
import com.x.program.center.core.entity.ScheduleLog;
import com.x.program.center.core.entity.UnexpectedErrorLog;
import com.x.program.center.core.entity.WarnLog;
public class Cleanup extends BaseAction {
private static Logger logger = LoggerFactory.getLogger(Cleanup.class);
private List<Class<? extends JpaObject>> list = new ArrayList<>();
private int tag = 0;
public Cleanup() {
list.add(ScheduleLog.class);
list.add(PromptErrorLog.class);
list.add(UnexpectedErrorLog.class);
list.add(WarnLog.class);
}
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
try {
if (pirmaryCenter()) {
ThisApplication.logQueue.send(new NameValuePair(list.get((tag++) % list.size()).getName(), null));
}
} catch (Exception e) {
logger.error(e);
throw new JobExecutionException(e);
}
}
}
\ No newline at end of file
package com.x.program.center.schedule; package com.x.program.center.schedule;
import java.util.Calendar;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import org.quartz.JobExecutionContext; import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException; import org.quartz.JobExecutionException;
import com.x.base.core.container.EntityManagerContainer; import com.x.base.core.project.bean.NameValuePair;
import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.project.logger.Logger; import com.x.base.core.project.logger.Logger;
import com.x.base.core.project.logger.LoggerFactory; import com.x.base.core.project.logger.LoggerFactory;
import com.x.program.center.ThisApplication;
import com.x.program.center.core.entity.PromptErrorLog; import com.x.program.center.core.entity.PromptErrorLog;
import com.x.program.center.core.entity.PromptErrorLog_;
public class CleanupPromptErrorLog extends BaseAction { public class CleanupPromptErrorLog extends BaseAction {
...@@ -27,36 +17,11 @@ public class CleanupPromptErrorLog extends BaseAction { ...@@ -27,36 +17,11 @@ public class CleanupPromptErrorLog extends BaseAction {
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
try { try {
if (pirmaryCenter()) { if (pirmaryCenter()) {
cleanupPromptErrorLog(); ThisApplication.logQueue.send(new NameValuePair(PromptErrorLog.class.getName(), null));
} }
} catch (Exception e) { } catch (Exception e) {
logger.error(e); logger.error(e);
throw new JobExecutionException(e); throw new JobExecutionException(e);
} }
} }
private void cleanupPromptErrorLog() throws Exception {
try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
EntityManager em = emc.get(PromptErrorLog.class);
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<String> cq = cb.createQuery(String.class);
Root<PromptErrorLog> root = cq.from(PromptErrorLog.class);
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DAY_OF_MONTH, -7);
Predicate p = cb.not(cb.greaterThan(root.get(PromptErrorLog_.createTime), cal.getTime()));
cq.select(root.get(PromptErrorLog_.id)).where(p);
List<String> list = em.createQuery(cq).getResultList();
for (int i = 0; i < list.size(); i++) {
if (i % 100 == 0) {
emc.beginTransaction(PromptErrorLog.class);
}
PromptErrorLog o = emc.find(list.get(i), PromptErrorLog.class);
emc.remove(o);
if ((i % 100 == 99) || (i == (list.size() - 1))) {
emc.commit();
}
}
}
}
} }
package com.x.program.center.schedule;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import com.x.base.core.container.EntityManagerContainer;
import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.entity.annotation.CheckRemoveType;
import com.x.base.core.project.logger.Logger;
import com.x.base.core.project.logger.LoggerFactory;
import com.x.program.center.Business;
import com.x.program.center.core.entity.ScheduleLog;
import com.x.program.center.core.entity.ScheduleLog_;
public class CleanupScheduleLog implements Job {
private static Logger logger = LoggerFactory.getLogger(CleanupScheduleLog.class);
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
try {
try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
Business business = new Business(emc);
this.clearScheduleLog(business);
}
} catch (Exception e) {
e.printStackTrace();
throw new JobExecutionException(e);
}
}
private void clearScheduleLog(Business business) throws Exception {
List<ScheduleLog> list = new ArrayList<>();
do {
EntityManagerContainer emc = business.entityManagerContainer();
EntityManager em = emc.get(ScheduleLog.class);
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<ScheduleLog> cq = cb.createQuery(ScheduleLog.class);
Root<ScheduleLog> root = cq.from(ScheduleLog.class);
Calendar threshold = Calendar.getInstance();
threshold.add(Calendar.DATE, -7);
Predicate p = cb.lessThan(root.get(ScheduleLog_.createTime), threshold.getTime());
list = em.createQuery(cq.select(root).where(p)).setMaxResults(2000).getResultList();
if (!list.isEmpty()) {
emc.beginTransaction(ScheduleLog.class);
list.stream().forEach(o -> {
try {
emc.remove(o, CheckRemoveType.all);
} catch (Exception e) {
logger.error(e);
}
});
emc.commit();
}
} while (!list.isEmpty());
}
}
\ No newline at end of file
package com.x.program.center.schedule; package com.x.program.center.schedule;
import java.util.Calendar;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import org.quartz.JobExecutionContext; import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException; import org.quartz.JobExecutionException;
import com.x.base.core.container.EntityManagerContainer; import com.x.base.core.project.bean.NameValuePair;
import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.project.logger.Logger; import com.x.base.core.project.logger.Logger;
import com.x.base.core.project.logger.LoggerFactory; import com.x.base.core.project.logger.LoggerFactory;
import com.x.program.center.ThisApplication;
import com.x.program.center.core.entity.UnexpectedErrorLog; import com.x.program.center.core.entity.UnexpectedErrorLog;
import com.x.program.center.core.entity.UnexpectedErrorLog_;
public class CleanupUnexpectedErrorLog extends BaseAction { public class CleanupUnexpectedErrorLog extends BaseAction {
...@@ -27,7 +17,7 @@ public class CleanupUnexpectedErrorLog extends BaseAction { ...@@ -27,7 +17,7 @@ public class CleanupUnexpectedErrorLog extends BaseAction {
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
try { try {
if (pirmaryCenter()) { if (pirmaryCenter()) {
cleanupUnexpectedErrorLog(); ThisApplication.logQueue.send(new NameValuePair(UnexpectedErrorLog.class.getName(), null));
} }
} catch (Exception e) { } catch (Exception e) {
logger.error(e); logger.error(e);
...@@ -35,27 +25,4 @@ public class CleanupUnexpectedErrorLog extends BaseAction { ...@@ -35,27 +25,4 @@ public class CleanupUnexpectedErrorLog extends BaseAction {
} }
} }
private void cleanupUnexpectedErrorLog() throws Exception {
try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
EntityManager em = emc.get(UnexpectedErrorLog.class);
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<String> cq = cb.createQuery(String.class);
Root<UnexpectedErrorLog> root = cq.from(UnexpectedErrorLog.class);
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DAY_OF_MONTH, -7);
Predicate p = cb.not(cb.greaterThan(root.get(UnexpectedErrorLog_.createTime), cal.getTime()));
cq.select(root.get(UnexpectedErrorLog_.id)).where(p);
List<String> list = em.createQuery(cq).getResultList();
for (int i = 0; i < list.size(); i++) {
if (i % 100 == 0) {
emc.beginTransaction(UnexpectedErrorLog.class);
}
UnexpectedErrorLog o = emc.find(list.get(i), UnexpectedErrorLog.class);
emc.remove(o);
if ((i % 100 == 99) || (i == (list.size() - 1))) {
emc.commit();
}
}
}
}
} }
package com.x.program.center.schedule; package com.x.program.center.schedule;
import java.util.Calendar;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import org.quartz.JobExecutionContext; import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException; import org.quartz.JobExecutionException;
import com.x.base.core.container.EntityManagerContainer; import com.x.base.core.project.bean.NameValuePair;
import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.project.logger.Logger; import com.x.base.core.project.logger.Logger;
import com.x.base.core.project.logger.LoggerFactory; import com.x.base.core.project.logger.LoggerFactory;
import com.x.program.center.ThisApplication;
import com.x.program.center.core.entity.WarnLog; import com.x.program.center.core.entity.WarnLog;
import com.x.program.center.core.entity.WarnLog_;
public class CleanupWarnLog extends BaseAction { public class CleanupWarnLog extends BaseAction {
...@@ -27,35 +17,11 @@ public class CleanupWarnLog extends BaseAction { ...@@ -27,35 +17,11 @@ public class CleanupWarnLog extends BaseAction {
public void execute(JobExecutionContext arg0) throws JobExecutionException { public void execute(JobExecutionContext arg0) throws JobExecutionException {
try { try {
if (pirmaryCenter()) { if (pirmaryCenter()) {
cleanupWarnLog(); ThisApplication.logQueue.send(new NameValuePair(WarnLog.class.getName(), null));
} }
} catch (Exception e) { } catch (Exception e) {
logger.error(e); logger.error(e);
throw new JobExecutionException(e); throw new JobExecutionException(e);
} }
} }
private void cleanupWarnLog() throws Exception {
try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
EntityManager em = emc.get(WarnLog.class);
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<String> cq = cb.createQuery(String.class);
Root<WarnLog> root = cq.from(WarnLog.class);
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DAY_OF_MONTH, -7);
Predicate p = cb.not(cb.greaterThan(root.get(WarnLog_.createTime), cal.getTime()));
cq.select(root.get(WarnLog_.id)).where(p);
List<String> list = em.createQuery(cq).getResultList();
for (int i = 0; i < list.size(); i++) {
if (i % 100 == 0) {
emc.beginTransaction(WarnLog.class);
}
WarnLog o = emc.find(list.get(i), WarnLog.class);
emc.remove(o);
if ((i % 100 == 99) || (i == (list.size() - 1))) {
emc.commit();
}
}
}
}
} }
package com.x.program.center.schedule; package com.x.program.center.schedule;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import com.x.base.core.container.EntityManagerContainer; import com.x.base.core.container.EntityManagerContainer;
import com.x.base.core.container.factory.EntityManagerContainerFactory; import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.entity.JpaObject; import com.x.base.core.entity.JpaObject;
import com.x.base.core.entity.annotation.CheckPersistType; import com.x.base.core.entity.annotation.CheckPersistType;
import com.x.base.core.project.annotation.FieldDescribe;
import com.x.base.core.project.bean.NameValuePair; import com.x.base.core.project.bean.NameValuePair;
import com.x.base.core.project.bean.WrapCopier; import com.x.base.core.project.bean.WrapCopier;
import com.x.base.core.project.bean.WrapCopierFactory; import com.x.base.core.project.bean.WrapCopierFactory;
import com.x.base.core.project.config.CenterServer;
import com.x.base.core.project.config.Collect; import com.x.base.core.project.config.Collect;
import com.x.base.core.project.config.Config; import com.x.base.core.project.config.Config;
import com.x.base.core.project.connection.ActionResponse; import com.x.base.core.project.connection.ActionResponse;
import com.x.base.core.project.connection.ConnectionAction; import com.x.base.core.project.connection.ConnectionAction;
import com.x.base.core.project.gson.GsonPropertyObject;
import com.x.base.core.project.http.HttpToken;
import com.x.base.core.project.http.WrapOutBoolean;
import com.x.base.core.project.jaxrs.WrapString;
import com.x.base.core.project.logger.Logger; import com.x.base.core.project.logger.Logger;
import com.x.base.core.project.logger.LoggerFactory; import com.x.base.core.project.logger.LoggerFactory;
import com.x.base.core.project.tools.Host;
import com.x.base.core.project.tools.ListTools; import com.x.base.core.project.tools.ListTools;
import com.x.organization.core.entity.Person;
import com.x.program.center.Business; import com.x.program.center.Business;
import com.x.program.center.core.entity.Application; import com.x.program.center.core.entity.Application;
import com.x.program.center.core.entity.Attachment; import com.x.program.center.core.entity.Attachment;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.jetty.deploy.App;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class CollectMarket extends BaseAction { public class CollectMarket extends BaseAction {
......
...@@ -16,21 +16,21 @@ public final class PersistenceProperties extends AbstractPersistenceProperties { ...@@ -16,21 +16,21 @@ public final class PersistenceProperties extends AbstractPersistenceProperties {
public static final String table = "CTE_SCHEDULELOG"; public static final String table = "CTE_SCHEDULELOG";
} }
public static class ClockTimer { // public static class ClockTimer {
public static final String table = "CTE_CLOCKTIMER"; // public static final String table = "CTE_CLOCKTIMER";
} // }
//
public static class ClockTimerLog { // public static class ClockTimerLog {
public static final String table = "CTE_CLOCKTIMERLOG"; // public static final String table = "CTE_CLOCKTIMERLOG";
} // }
//
public static class ClockSchedule { // public static class ClockSchedule {
public static final String table = "CTE_CLOCKSCHEDULE"; // public static final String table = "CTE_CLOCKSCHEDULE";
} // }
//
public static class ClockScheduleLog { // public static class ClockScheduleLog {
public static final String table = "CTE_CLOCKSCHEDULELOG"; // public static final String table = "CTE_CLOCKSCHEDULELOG";
} // }
public static class PromptErrorLog { public static class PromptErrorLog {
public static final String table = "CTE_PROMPTERRORLOG"; public static final String table = "CTE_PROMPTERRORLOG";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册