|
|
@@ -4,22 +4,27 @@ import com.uas.erp.schedular.task.support.Method;
|
|
|
import com.uas.erp.schedular.task.support.Role;
|
|
|
import com.uas.erp.schedular.task.support.TaskConfig;
|
|
|
import com.uas.erp.schedular.task.support.TaskMapping;
|
|
|
+import com.uas.erp.schedular.util.DateUtil;
|
|
|
import com.uas.erp.schedular.util.StringUtil;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
import javax.persistence.*;
|
|
|
+import java.io.*;
|
|
|
+import java.util.Date;
|
|
|
import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
|
/**
|
|
|
- * Created by Pro1 on 2017/7/26.
|
|
|
* 基于各个账套的任务配置
|
|
|
+ *
|
|
|
+ * @author Pro1
|
|
|
+ * @date 2017/7/26
|
|
|
*/
|
|
|
@Entity
|
|
|
@IdClass(MasterTaskConfigId.class)
|
|
|
@Table(indexes = {@Index(name = "idx_mod_role_master", columnList = "module,masterName,role"),
|
|
|
@Index(name = "idx_transfer", columnList = "transferMethod")})
|
|
|
-public class MasterTaskConfigEntity {
|
|
|
+public class MasterTaskConfigEntity implements Serializable {
|
|
|
|
|
|
private String module;
|
|
|
|
|
|
@@ -118,6 +123,9 @@ public class MasterTaskConfigEntity {
|
|
|
|
|
|
public void setEnabled(boolean enabled) {
|
|
|
this.enabled = enabled;
|
|
|
+ // 记录被禁用启用的记录
|
|
|
+ System.out.println(DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss") + " MasterTaskConfig disabled, masterName: " + this.masterName +
|
|
|
+ ", beanTitle: " + this.beanTitle + ", methodTitle: " + this.methodTitle + ", enabled: " + this.enabled + ".");
|
|
|
}
|
|
|
|
|
|
public String getCron() {
|
|
|
@@ -203,16 +211,30 @@ public class MasterTaskConfigEntity {
|
|
|
|
|
|
@Override
|
|
|
public boolean equals(Object o) {
|
|
|
- if (this == o) return true;
|
|
|
- if (o == null || getClass() != o.getClass()) return false;
|
|
|
+ if (this == o) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if (o == null || getClass() != o.getClass()) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
MasterTaskConfigEntity entity = (MasterTaskConfigEntity) o;
|
|
|
|
|
|
- if (beanName != null ? !beanName.equals(entity.beanName) : entity.beanName != null) return false;
|
|
|
- if (methodName != null ? !methodName.equals(entity.methodName) : entity.methodName != null) return false;
|
|
|
- if (masterName != null ? !masterName.equals(entity.masterName) : entity.masterName != null) return false;
|
|
|
- if (cron != null ? !cron.equals(entity.cron) : entity.cron != null) return false;
|
|
|
- if (fixedDelay != null ? !fixedDelay.equals(entity.fixedDelay) : entity.fixedDelay != null) return false;
|
|
|
+ if (beanName != null ? !beanName.equals(entity.beanName) : entity.beanName != null) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (methodName != null ? !methodName.equals(entity.methodName) : entity.methodName != null) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (masterName != null ? !masterName.equals(entity.masterName) : entity.masterName != null) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (cron != null ? !cron.equals(entity.cron) : entity.cron != null) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (fixedDelay != null ? !fixedDelay.equals(entity.fixedDelay) : entity.fixedDelay != null) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
return fixedRate != null ? fixedRate.equals(entity.fixedRate) : entity.fixedRate == null;
|
|
|
|
|
|
}
|