commit
0632911e4a
@ -0,0 +1,33 @@
|
|||||||
|
HELP.md
|
||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
!**/src/main/**/target/
|
||||||
|
!**/src/test/**/target/
|
||||||
|
|
||||||
|
### STS ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
build/
|
||||||
|
!**/src/main/**/build/
|
||||||
|
!**/src/test/**/build/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
@ -0,0 +1,150 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>org.example</groupId>
|
||||||
|
<artifactId>BHDemo</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
<name>BHDemo</name>
|
||||||
|
<description>BHDemo</description>
|
||||||
|
<properties>
|
||||||
|
<java.version>1.8</java.version>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
|
<spring-boot.version>2.6.13</spring-boot.version>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.oracle.database.jdbc</groupId>
|
||||||
|
<artifactId>ojdbc6</artifactId>
|
||||||
|
<version>11.2.0.4</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mybatis.spring.boot</groupId>
|
||||||
|
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||||
|
<version>2.2.0</version> <!-- 确保使用最新或兼容的版本 -->
|
||||||
|
</dependency>
|
||||||
|
<!-- 德魯伊數據源-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>druid</artifactId>
|
||||||
|
<version>1.2.23</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mybatis</groupId>
|
||||||
|
<artifactId>mybatis</artifactId>
|
||||||
|
<version>3.5.13</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mybatis</groupId>
|
||||||
|
<artifactId>mybatis-spring</artifactId>
|
||||||
|
<version>2.1.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-context</artifactId>
|
||||||
|
<version>6.1.14</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-all</artifactId>
|
||||||
|
<version>5.8.24</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-net</groupId>
|
||||||
|
<artifactId>commons-net</artifactId>
|
||||||
|
<version>3.6</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-lang</groupId>
|
||||||
|
<artifactId>commons-lang</artifactId>
|
||||||
|
<version>2.4</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--rabbitmq-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-amqp</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
<dependencyManagement>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-dependencies</artifactId>
|
||||||
|
<version>${spring-boot.version}</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</dependencyManagement>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.8.1</version>
|
||||||
|
<configuration>
|
||||||
|
<source>1.8</source>
|
||||||
|
<target>1.8</target>
|
||||||
|
<encoding>UTF-8</encoding>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<!-- <plugin>-->
|
||||||
|
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||||
|
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
|
||||||
|
<!-- <version>${spring-boot.version}</version>-->
|
||||||
|
<!-- <configuration>-->
|
||||||
|
<!-- <mainClass>cn.com.connor.bh.bhdemo.BhDemoApplication</mainClass>-->
|
||||||
|
<!-- <skip>true</skip>-->
|
||||||
|
<!-- </configuration>-->
|
||||||
|
<!-- <executions>-->
|
||||||
|
<!-- <execution>-->
|
||||||
|
<!-- <id>repackage</id>-->
|
||||||
|
<!-- <goals>-->
|
||||||
|
<!-- <goal>repackage</goal>-->
|
||||||
|
<!-- </goals>-->
|
||||||
|
<!-- </execution>-->
|
||||||
|
<!-- </executions>-->
|
||||||
|
<!-- </plugin>-->
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<version>${spring-boot.version}</version>
|
||||||
|
<configuration>
|
||||||
|
<mainClass>cn.com.connor.bh.bhdemo.BhDemoApplication</mainClass>
|
||||||
|
<skip>false</skip>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>repackage</id>
|
||||||
|
<goals>
|
||||||
|
<goal>repackage</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
@ -0,0 +1,16 @@
|
|||||||
|
package cn.com.connor.bh.bhdemo;
|
||||||
|
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
|
|
||||||
|
@SpringBootApplication
|
||||||
|
@MapperScan("cn.com.connor.bh.bhdemo.demos.web.mapper")
|
||||||
|
public class BhDemoApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(BhDemoApplication.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package cn.com.connor.bh.bhdemo.demos.web.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class CappTask {
|
||||||
|
|
||||||
|
private String code;
|
||||||
|
//任务来源
|
||||||
|
private String taskSource;
|
||||||
|
//用户名称
|
||||||
|
private String userName;
|
||||||
|
//用户id
|
||||||
|
private String userId;
|
||||||
|
//流程uid
|
||||||
|
private String flowId;
|
||||||
|
//状态
|
||||||
|
private String status;
|
||||||
|
//数据信息
|
||||||
|
private String msg;
|
||||||
|
//处理开始时间
|
||||||
|
private String starttime;
|
||||||
|
//处理完成时间
|
||||||
|
private String finishtime;
|
||||||
|
//下发完成时间
|
||||||
|
private String endingtime;
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package cn.com.connor.bh.bhdemo.demos.web.mapper;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface TaskMapper {
|
||||||
|
int getByMSG(@Param("MSG") String MSG);
|
||||||
|
|
||||||
|
int insertTask(@Param("map") Map<String, Object> map);
|
||||||
|
|
||||||
|
int updateTask(@Param("map") Map<String, Object> map);
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package cn.com.connor.bh.bhdemo.demos.web.service;
|
||||||
|
|
||||||
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class MqQueueService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RabbitTemplate rabbitTemplate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送消息到指定队列中
|
||||||
|
*/
|
||||||
|
public void sendMsgToQueue(String msg) {
|
||||||
|
String queueName = "StoCAPP";
|
||||||
|
System.out.println("发送消息:" + msg + "到队列:" + queueName);
|
||||||
|
rabbitTemplate.convertAndSend(queueName,msg);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
#下面这些内容是为了让MyBatis映射
|
||||||
|
#指定Mybatis的Mapper文件
|
||||||
|
mybatis.mapper-locations=classpath:mappers/*xml
|
||||||
|
#指定Mybatis的实体目录
|
||||||
|
mybatis.type-aliases-package=cn.com.connor.bh.bhdemo.mybatis.entity
|
||||||
|
# 应用服务 WEB 访问端口
|
||||||
|
server.port=8080
|
||||||
|
|
||||||
|
#数据库连接配置
|
||||||
|
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
|
||||||
|
spring.datasource.druid.url=jdbc:sqlserver://192.168.189.128:1433/bhdemo
|
||||||
|
spring.datasource.druid.username=root
|
||||||
|
spring.datasource.druid.password=123456
|
||||||
|
spring.datasource.druid.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
|||||||
|
server:
|
||||||
|
port: 8080
|
||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
driverClassName: oracle.jdbc.driver.OracleDriver
|
||||||
|
url: jdbc:oracle:thin:@10.41.213.19:1521/orcl
|
||||||
|
username: system
|
||||||
|
password: Aa12345678
|
||||||
|
rabbitmq:
|
||||||
|
host: 192.168.3.125
|
||||||
|
port: 5672
|
||||||
|
# virtual-host: /
|
||||||
|
username: kuma
|
||||||
|
password: 123
|
||||||
|
|
||||||
|
template:
|
||||||
|
default-receive-queue: StoCAPP
|
||||||
|
|
||||||
|
# url: jdbc:oracle:thin:@192.168.3.125:1521/TC12
|
||||||
|
# username: infodba
|
||||||
|
# password: infodba
|
||||||
|
mybatis:
|
||||||
|
mapper-locations: classpath:mapper/*.xml
|
||||||
|
type-aliases-package: cn.com.connor.bh.bhdemo.demos.web.entity
|
||||||
|
configuration:
|
||||||
|
map-underscore-to-camel-case: true
|
@ -0,0 +1,25 @@
|
|||||||
|
server:
|
||||||
|
port: 8080
|
||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
driverClassName: oracle.jdbc.driver.OracleDriver
|
||||||
|
url: jdbc:oracle:thin:@10.41.213.19:1521/orcl
|
||||||
|
username: system
|
||||||
|
password: Aa12345678
|
||||||
|
rabbitmq:
|
||||||
|
host: 192.168.3.125
|
||||||
|
port: 5672
|
||||||
|
username: kuma
|
||||||
|
password: 123
|
||||||
|
|
||||||
|
template:
|
||||||
|
default-receive-queue: StoCAPP
|
||||||
|
|
||||||
|
# url: jdbc:oracle:thin:@192.168.3.125:1521/TC12
|
||||||
|
# username: infodba
|
||||||
|
# password: infodba
|
||||||
|
mybatis:
|
||||||
|
mapper-locations: classpath:mapper/*.xml
|
||||||
|
type-aliases-package: cn.com.connor.bh.bhdemo.demos.web.entity
|
||||||
|
configuration:
|
||||||
|
map-underscore-to-camel-case: true
|
@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="cn.com.connor.bh.bhdemo.demos.web.mapper.TaskMapper">
|
||||||
|
<insert id="insertTask" parameterType="Map" >
|
||||||
|
insert into WHBH_CAPP_TASK (TASKSOURCE, USERNAME, USERID, STATUS, MSG, STARTTIME)
|
||||||
|
values (#{map.TASKSOURCE},#{map.USERNAME},#{map.USERID},#{map.STATUS},#{map.MSG},#{map.STARTTIME})
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateTask" parameterType="Map" >
|
||||||
|
update WHBH_CAPP_TASK set TASKSOURCE = #{map.TASKSOURCE},
|
||||||
|
USERNAME = #{map.USERNAME},
|
||||||
|
USERID = #{map.USERID},
|
||||||
|
STATUS = #{map.STATUS},
|
||||||
|
STARTTIME = #{map.STARTTIME}
|
||||||
|
where MSG = #{map.MSG}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id = "getName" resultType="String">
|
||||||
|
select name from v_emp where barcode=#{code} and rownum = 1
|
||||||
|
</select>
|
||||||
|
<select id="getByMSG" resultType="Integer">
|
||||||
|
SELECT COUNT(*) FROM WHBH_CAPP_TASK WHERE MSG = #{MSG}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,6 @@
|
|||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<h1>hello word!!!</h1>
|
||||||
|
<p>this is a html page</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,13 @@
|
|||||||
|
package cn.com.connor.bh.bhdemo;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
|
||||||
|
@SpringBootTest
|
||||||
|
class BhDemoApplicationTests {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void contextLoads() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in new issue