first commit

This commit is contained in:
songqq
2025-12-25 11:51:22 +08:00
commit 0a4e144f07
7 changed files with 142 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
package com.ecep.contract.contractmanager;
import javafx.application.Application;
import javafx.application.Platform;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
@SpringBootApplication
public class ContractManagerApplication {
private static final Logger logger = LoggerFactory.getLogger(ContractManagerApplication.class);
public static void main(String[] args) {
Platform.startup(() -> {
// 启动 SpringBoot
SpringApplication app = new SpringApplication(ContractManagerApplication.class);
ConfigurableApplicationContext run = app.run(args);
logger.info("started {}", run.getApplicationStartup());
});
// 启动 JavaFx 线程
Application.launch(DesktopApplication.class, args);
logger.debug("main done.");
}
}

View File

@@ -0,0 +1,41 @@
package com.ecep.contract.contractmanager;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.concurrent.CompletableFuture;
public class DesktopApplication extends Application {
private static final Logger logger = LoggerFactory.getLogger(DesktopApplication.class);
@Override
public void start(Stage primaryStage) throws Exception {
logger.debug("desktop start");
FXMLLoader loader = new FXMLLoader(getClass().getResource("/ui/start_lamp.fxml"));
Parent root = loader.load();
Scene scene = new Scene(root);
primaryStage.setTitle("销售与采购流程管理");
primaryStage.initStyle(StageStyle.TRANSPARENT);
primaryStage.setScene(scene);
primaryStage.setOnShown(e -> {
System.out.println("Primary shown.");
});
primaryStage.show();
CompletableFuture.runAsync(()->{
Platform.runLater(primaryStage::close);
});
}
}

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"/>
</Console>
</Appenders>
<Loggers>
<Root level="DEBUG">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>

View File

@@ -0,0 +1,4 @@
spring.application.name=Contract-Manager
logging.level.root=INFO
logging.pattern.console=%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n</pattern>
</layout>
</appender>
<root level="DEBUG">
<appender-ref ref="STDOUT"/>
</root>
</configuration>

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.paint.RadialGradient?>
<?import javafx.scene.paint.Stop?>
<?import javafx.scene.shape.Arc?>
<?import javafx.scene.shape.CubicCurve?>
<?import javafx.scene.text.Text?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" style="-fx-background-color: #333;" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1">
<children>
<CubicCurve controlX1="5.292999267578125" controlX2="201.29299926757812" controlY1="-24.0" controlY2="-66.0" endX="252.587646484375" endY="44.0" fill="#3781c6" layoutX="346.0" layoutY="360.0" startX="-198.20700073242188" startY="44.0" stroke="BLACK" strokeWidth="0.0" />
<Arc length="90.0" radiusX="200.0" radiusY="200.0" startAngle="270.0" stroke="BLACK" strokeType="INSIDE" strokeWidth="0.0" type="ROUND">
<fill>
<RadialGradient focusDistance="-1.0" radius="1.0">
<stops>
<Stop color="#07b0ff" />
<Stop color="#ffffff00" offset="1.0" />
</stops>
</RadialGradient>
</fill>
</Arc>
<Text fill="WHITE" layoutX="334.0" layoutY="172.0" stroke="#aeaaaa" strokeLineCap="ROUND" strokeType="OUTSIDE" strokeWidth="0.0" style="-fx-font-size: 36;" text="供应商管理软件" />
<Text fill="#a1a1a1" layoutX="399.0" layoutY="207.0" strokeType="OUTSIDE" strokeWidth="0.0" text="上海电气开利能源工程有限公司" />
<Arc fill="DODGERBLUE" length="90.0" radiusX="150.0" radiusY="150.0" startAngle="270.0" stroke="BLACK" strokeType="INSIDE" strokeWidth="0.0" type="ROUND" />
<Arc fill="#6eb9ff" length="90.0" radiusX="120.0" radiusY="120.0" startAngle="270.0" stroke="BLACK" strokeType="INSIDE" strokeWidth="0.0" type="ROUND" />
<CubicCurve controlX1="-71.41410827636719" controlX2="47.58766174316406" controlY1="-66.0" controlY2="30.0" endX="252.587646484375" endY="44.0" fill="DODGERBLUE" layoutX="125.0" layoutY="360.0" startX="-198.20700073242188" startY="44.0" stroke="BLACK" strokeWidth="0.0" />
</children>
</AnchorPane>

View File

@@ -0,0 +1,13 @@
package com.ecep.contract.contractmanager;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class ContractManagerApplicationTests {
@Test
void contextLoads() {
}
}