Compare commits
4 Commits
33fc47df87
...
efd7f5e9f2
| Author | SHA1 | Date | |
|---|---|---|---|
| efd7f5e9f2 | |||
| ced4cde3e3 | |||
| 5669fd3aa7 | |||
| 74eac6f825 |
@@ -0,0 +1,32 @@
|
||||
package com.lanyuanxiaoyao.leopard.core.entity;
|
||||
|
||||
import com.lanyuanxiaoyao.leopard.core.Constants;
|
||||
import com.lanyuanxiaoyao.service.template.entity.SimpleEntity;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.EntityListeners;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.FieldNameConstants;
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
|
||||
/**
|
||||
* 资产负债表
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
@ToString(callSuper = true)
|
||||
@FieldNameConstants
|
||||
@Entity
|
||||
@DynamicUpdate
|
||||
@DynamicInsert
|
||||
@EntityListeners(AuditingEntityListener.class)
|
||||
@Table(name = Constants.DATABASE_PREFIX + "balance_sheet")
|
||||
public class BalanceSheet extends SimpleEntity {
|
||||
@ManyToOne
|
||||
private Stock stock;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.lanyuanxiaoyao.leopard.core.entity;
|
||||
|
||||
import com.lanyuanxiaoyao.leopard.core.Constants;
|
||||
import com.lanyuanxiaoyao.service.template.entity.SimpleEntity;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.EntityListeners;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.FieldNameConstants;
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
|
||||
/**
|
||||
* 现金流量表
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
@ToString(callSuper = true)
|
||||
@FieldNameConstants
|
||||
@Entity
|
||||
@DynamicUpdate
|
||||
@DynamicInsert
|
||||
@EntityListeners(AuditingEntityListener.class)
|
||||
@Table(name = Constants.DATABASE_PREFIX + "cash_flow")
|
||||
public class CashFlow extends SimpleEntity {
|
||||
@ManyToOne
|
||||
private Stock stock;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.lanyuanxiaoyao.leopard.core.entity;
|
||||
|
||||
import com.lanyuanxiaoyao.leopard.core.Constants;
|
||||
import com.lanyuanxiaoyao.service.template.entity.SimpleEntity;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.EntityListeners;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.FieldNameConstants;
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
|
||||
/**
|
||||
* 利润表
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
@ToString(callSuper = true)
|
||||
@FieldNameConstants
|
||||
@Entity
|
||||
@DynamicUpdate
|
||||
@DynamicInsert
|
||||
@EntityListeners(AuditingEntityListener.class)
|
||||
@Table(name = Constants.DATABASE_PREFIX + "income")
|
||||
public class Income extends SimpleEntity {
|
||||
@ManyToOne
|
||||
private Stock stock;
|
||||
}
|
||||
@@ -62,6 +62,18 @@ public class Stock extends SimpleEntity {
|
||||
@ToString.Exclude
|
||||
private Set<Daily> dailies;
|
||||
|
||||
@OneToMany(mappedBy = "stock", cascade = CascadeType.REMOVE)
|
||||
@ToString.Exclude
|
||||
private Set<Income> incomes;
|
||||
|
||||
@OneToMany(mappedBy = "stock", cascade = CascadeType.REMOVE)
|
||||
@ToString.Exclude
|
||||
private Set<BalanceSheet> balanceSheets;
|
||||
|
||||
@OneToMany(mappedBy = "stock", cascade = CascadeType.REMOVE)
|
||||
@ToString.Exclude
|
||||
private Set<CashFlow> cashFlows;
|
||||
|
||||
@ManyToMany
|
||||
@ToString.Exclude
|
||||
private Set<StockCollection> collections;
|
||||
|
||||
@@ -29,5 +29,9 @@ public class TaskTemplate extends SimpleEntity {
|
||||
@Column(nullable = false, length = 500)
|
||||
private String description;
|
||||
@Column(nullable = false)
|
||||
private String application;
|
||||
@Column(nullable = false)
|
||||
private String chain;
|
||||
@Column(nullable = false)
|
||||
private String expression;
|
||||
}
|
||||
@@ -45,6 +45,10 @@
|
||||
<groupId>com.yomahub</groupId>
|
||||
<artifactId>liteflow-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yomahub</groupId>
|
||||
<artifactId>liteflow-rule-sql</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package com.lanyuanxiaoyao.leopard.server.controller;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.lanyuanxiaoyao.leopard.core.entity.TaskTemplate;
|
||||
import com.lanyuanxiaoyao.leopard.server.service.TaskTemplateService;
|
||||
import com.lanyuanxiaoyao.service.template.controller.SimpleControllerSupport;
|
||||
import java.util.function.Function;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@@ -12,6 +14,9 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RestController
|
||||
@RequestMapping("task_template")
|
||||
public class TaskTemplateController extends SimpleControllerSupport<TaskTemplate, TaskTemplateController.Item, TaskTemplateController.Item, TaskTemplateController.Item> {
|
||||
@Value("${spring.application.name}")
|
||||
private String application;
|
||||
|
||||
public TaskTemplateController(TaskTemplateService service) {
|
||||
super(service);
|
||||
}
|
||||
@@ -23,7 +28,9 @@ public class TaskTemplateController extends SimpleControllerSupport<TaskTemplate
|
||||
template.setId(item.id());
|
||||
template.setName(item.name());
|
||||
template.setDescription(item.description());
|
||||
template.setChain(item.chain());
|
||||
template.setApplication(application);
|
||||
template.setChain(IdUtil.simpleUUID());
|
||||
template.setExpression(item.expression());
|
||||
return template;
|
||||
};
|
||||
}
|
||||
@@ -33,7 +40,7 @@ public class TaskTemplateController extends SimpleControllerSupport<TaskTemplate
|
||||
template.getId(),
|
||||
template.getName(),
|
||||
template.getDescription(),
|
||||
template.getChain()
|
||||
template.getExpression()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -51,7 +58,7 @@ public class TaskTemplateController extends SimpleControllerSupport<TaskTemplate
|
||||
Long id,
|
||||
String name,
|
||||
String description,
|
||||
String chain
|
||||
String expression
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.lanyuanxiaoyao.leopard.server.service;
|
||||
import com.lanyuanxiaoyao.leopard.core.entity.TaskTemplate;
|
||||
import com.lanyuanxiaoyao.leopard.core.repository.TaskTemplateRepository;
|
||||
import com.lanyuanxiaoyao.service.template.service.SimpleServiceSupport;
|
||||
import com.yomahub.liteflow.meta.LiteflowMetaOperator;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@@ -10,4 +11,29 @@ public class TaskTemplateService extends SimpleServiceSupport<TaskTemplate> {
|
||||
public TaskTemplateService(TaskTemplateRepository repository) {
|
||||
super(repository);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long save(TaskTemplate entity) {
|
||||
Long id = super.save(entity);
|
||||
LiteflowMetaOperator.reloadAllChain();
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(Iterable<TaskTemplate> taskTemplates) {
|
||||
super.save(taskTemplates);
|
||||
LiteflowMetaOperator.reloadAllChain();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(Iterable<Long> ids) {
|
||||
super.remove(ids);
|
||||
LiteflowMetaOperator.reloadAllChain();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(Long id) {
|
||||
super.remove(id);
|
||||
LiteflowMetaOperator.reloadAllChain();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ spring:
|
||||
datasource:
|
||||
# url: jdbc:mysql://mysql.lanyuanxiaoyao.com:43780/leopard?useSSL=false
|
||||
# url: jdbc:mysql://192.168.31.127:3780/leopard?useSSL=false
|
||||
url: jdbc:postgresql://81.71.3.24:6785/leopard
|
||||
url: jdbc:postgresql://81.71.3.24:6785/leopard_dev
|
||||
username: leopard
|
||||
password: '9NEzFzovnddf@PyEP?e*AYAWnCyd7UhYwQK$pJf>7?ccFiN^x4$eKEZ5~E<7<+~X'
|
||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
@@ -37,5 +37,11 @@ fenix:
|
||||
print-banner: false
|
||||
liteflow:
|
||||
print-banner: false
|
||||
rule-source: flow.xml
|
||||
check-node-exists: false
|
||||
check-node-exists: false
|
||||
rule-source-ext-data-map:
|
||||
applicationName: ${spring.application.name}
|
||||
sqlLogEnabled: true
|
||||
chainTableName: leopard_task_template
|
||||
chainApplicationNameField: application
|
||||
chainNameField: chain
|
||||
elDataField: expression
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${LOGGING_PARENT:-.}/archive/${APP_NAME:-run}-%d{yyyy-MM-dd}.gz</fileNamePattern>
|
||||
<MaxHistory>7</MaxHistory>
|
||||
<totalSizeCap>5GB</totalSizeCap>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %p [${HOSTNAME}] [%t] %logger: %m%n%wEx</pattern>
|
||||
@@ -27,7 +28,7 @@
|
||||
</appender>
|
||||
|
||||
<logger name="com.zaxxer.hikari" level="ERROR"/>
|
||||
<!--<logger name="org.hibernate.SQL" level="DEBUG"/>-->
|
||||
<logger name="org.hibernate.SQL" level="DEBUG"/>
|
||||
|
||||
<root level="INFO">
|
||||
<appender-ref ref="Console"/>
|
||||
|
||||
@@ -55,8 +55,8 @@ function TaskTemplateSave() {
|
||||
},
|
||||
{
|
||||
type: 'input-text',
|
||||
name: 'chain',
|
||||
label: '流程编号',
|
||||
name: 'expression',
|
||||
label: 'EL表达式',
|
||||
required: true,
|
||||
clearable: true,
|
||||
},
|
||||
|
||||
5
pom.xml
5
pom.xml
@@ -68,6 +68,11 @@
|
||||
<artifactId>liteflow-spring-boot-starter</artifactId>
|
||||
<version>${liteflow.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yomahub</groupId>
|
||||
<artifactId>liteflow-rule-sql</artifactId>
|
||||
<version>${liteflow.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
Reference in New Issue
Block a user