Compare commits
9 Commits
8ed66117ca
...
6434f9814b
Author | SHA1 | Date |
---|---|---|
|
6434f9814b | |
|
1a337225c1 | |
|
b0205a0059 | |
|
c2c6709c06 | |
|
dde955e0f5 | |
|
a05de8343f | |
|
4fb40c0d3e | |
|
3271c30c0f | |
|
3ede309abe |
|
@ -0,0 +1,13 @@
|
|||
node_modules/
|
||||
dist/
|
||||
vendor/
|
||||
cache/
|
||||
.*/
|
||||
*.min.*
|
||||
*.test.*
|
||||
*.spec.*
|
||||
*.bundle.*
|
||||
*.bundle-min.*
|
||||
*.*.js
|
||||
*.*.ts
|
||||
*.log
|
|
@ -4,10 +4,10 @@ server:
|
|||
|
||||
# nacos线上地址
|
||||
nacos:
|
||||
addr: nacos.muyu.icu:8848
|
||||
addr: 110.42.213.184:8848
|
||||
user-name: nacos
|
||||
password: nacos
|
||||
namespace: muyu-cloud
|
||||
namespace: public
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>cloud-common-xxl</artifactId>
|
||||
|
||||
<description>XllJob定时任务</description>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- MuYu Common Core-->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- xxl-job-core -->
|
||||
<dependency>
|
||||
<groupId>com.xuxueli</groupId>
|
||||
<artifactId>xxl-job-core</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -1,28 +0,0 @@
|
|||
package com.muyu.common.xxl;
|
||||
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Log4j2
|
||||
@Component
|
||||
public class XXLJobConfig {
|
||||
@Bean
|
||||
public XxlJobSpringExecutor xxlJobExecutor(XxlJobProperties xxlJobProperties) {
|
||||
if (StringUtils.isEmpty(xxlJobProperties.getAdminAddresses())){
|
||||
throw new RuntimeException("请在bootstrap.yml当中配置shared-configs项,xxl-job共享配置[application-xxl-config]");
|
||||
}
|
||||
XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
|
||||
xxlJobSpringExecutor.setAdminAddresses(xxlJobProperties.getAdminAddresses());
|
||||
xxlJobSpringExecutor.setAppname(xxlJobProperties.getAppName());
|
||||
xxlJobSpringExecutor.setIp(xxlJobProperties.getIp());
|
||||
xxlJobSpringExecutor.setPort(xxlJobProperties.getPort());
|
||||
xxlJobSpringExecutor.setAccessToken(xxlJobProperties.getAccessToken());
|
||||
xxlJobSpringExecutor.setLogPath(xxlJobProperties.getLogPath());
|
||||
xxlJobSpringExecutor.setLogRetentionDays(xxlJobProperties.getLogRetentionDays());
|
||||
log.info(">>>>>>>>>>> xxl-job config init success.");
|
||||
return xxlJobSpringExecutor;
|
||||
}
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
package com.muyu.common.xxl;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Data
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "xxl-job")
|
||||
public class XxlJobProperties {
|
||||
|
||||
/**
|
||||
* 调度中心部署根地址 [选填]:
|
||||
* 如调度中心集群部署存在多个地址则用逗号分隔。执行器将会使用该地址进行"执行器心跳注册"和"任务结果回调";
|
||||
* 为空则关闭自动注册;
|
||||
*/
|
||||
private String adminAddresses;
|
||||
|
||||
/**
|
||||
* 执行器通讯TOKEN [选填]:
|
||||
* 非空时启用;
|
||||
*/
|
||||
private String accessToken;
|
||||
|
||||
/**
|
||||
* 执行器AppName [选填]:
|
||||
* 执行器心跳注册分组依据;为空则关闭自动注册
|
||||
*/
|
||||
private String appName;
|
||||
|
||||
/**
|
||||
* 执行器注册 [选填]:
|
||||
* 优先使用该配置作为注册地址,为空时使用内嵌服务 ”IP:PORT“ 作为注册地址。
|
||||
* 从而更灵活的支持容器类型执行器动态IP和动态映射端口问题。
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 执行器IP [选填]:
|
||||
* 默认为空表示自动获取IP,多网卡时可手动设置指定IP,该IP不会绑定Host仅作为通讯实用;
|
||||
* 地址信息用于 "执行器注册" 和 "调度中心请求并触发任务";
|
||||
*/
|
||||
private String ip;
|
||||
|
||||
/**
|
||||
* 执行器端口号 [选填]:
|
||||
* 小于等于0则自动获取;默认端口为9999,
|
||||
* 单机部署多个执行器时,注意要配置不同执行器端口;
|
||||
*/
|
||||
private int port;
|
||||
|
||||
/**
|
||||
* 执行器运行日志文件存储磁盘路径 [选填]:
|
||||
* 需要对该路径拥有读写权限;为空则使用默认路径;
|
||||
*/
|
||||
private String logPath;
|
||||
|
||||
/**
|
||||
* 执行器日志文件保存天数 [选填]:
|
||||
* 过期日志自动清理, 限制值大于等于3时生效; 否则, 如-1, 关闭自动清理功能;
|
||||
*/
|
||||
private int logRetentionDays;
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
package com.muyu.common.xxl.demo;
|
||||
|
||||
import com.xxl.job.core.context.XxlJobHelper;
|
||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Log4j2
|
||||
@Component
|
||||
public class XxlJobDemoService {
|
||||
|
||||
/**
|
||||
* 无参测试
|
||||
*/
|
||||
@XxlJob("xxl-job-demo-no-param")
|
||||
public void xxlJobDemoNoParam(){
|
||||
log.info("调度名称:[{}] - 无参", "xxl-job-demo-no-param");
|
||||
}
|
||||
|
||||
/**
|
||||
* 有参测试
|
||||
*/
|
||||
@XxlJob("xxl-job-demo-one-param")
|
||||
public void xxlJobDemoOneParam(){
|
||||
String param = XxlJobHelper.getJobParam();
|
||||
log.info("调度名称:[{}] - 参数:[{}]", "xxl-job-demo-one-param", param);
|
||||
}
|
||||
/**
|
||||
* 分片测试
|
||||
*/
|
||||
@XxlJob("xxl-job-slice-demo")
|
||||
public void xxlJobSliceDemo(){
|
||||
int shardTotal = XxlJobHelper.getShardTotal();
|
||||
int shardIndex = XxlJobHelper.getShardIndex();
|
||||
String param = XxlJobHelper.getJobParam();
|
||||
log.info("调度名称:[{}-[{}/{}(分片位置/分片总数)]] - 参数:[{}]", "xxl-job-slice-demo",shardIndex, shardTotal, param);
|
||||
}
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
com.muyu.common.xxl.XXLJobConfig
|
||||
com.muyu.common.xxl.XxlJobProperties
|
||||
com.muyu.common.xxl.demo.XxlJobDemoService
|
|
@ -18,7 +18,7 @@
|
|||
<module>cloud-common-datascope</module>
|
||||
<module>cloud-common-datasource</module>
|
||||
<module>cloud-common-system</module>
|
||||
<module>cloud-common-xxl</module>
|
||||
|
||||
<module>cloud-common-rabbit</module>
|
||||
</modules>
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ public class ValidateCodeServiceImpl implements ValidateCodeService {
|
|||
CaptchaCodeResp.CaptchaCodeRespBuilder respBuilder = CaptchaCodeResp.builder()
|
||||
.captchaEnabled(captchaEnabled);
|
||||
if (!captchaEnabled) {
|
||||
return Result.success(respBuilder);
|
||||
return Result.success(respBuilder.build());
|
||||
}
|
||||
|
||||
// 保存验证码信息
|
||||
|
|
|
@ -4,10 +4,10 @@ server:
|
|||
|
||||
# nacos线上地址
|
||||
nacos:
|
||||
addr: nacos.muyu.icu:8848
|
||||
addr: 110.42.213.184:8848
|
||||
user-name: nacos
|
||||
password: nacos
|
||||
namespace: muyu-cloud
|
||||
namespace: public
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
|
|
|
@ -0,0 +1,95 @@
|
|||
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-modules</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>cloud-modules-car</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-core</artifactId>
|
||||
</dependency>
|
||||
<!-- 接口模块 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-api-doc</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
</project>
|
|
@ -0,0 +1,23 @@
|
|||
package com.muyu.carrail;
|
||||
|
||||
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
|
||||
@EnableCustomConfig
|
||||
@EnableMyFeignClients
|
||||
@MapperScan("com.muyu.carrail.mapper")
|
||||
@SpringBootApplication
|
||||
public class CloudCarRailApplication {
|
||||
public static void main(String[] args) {
|
||||
// try {
|
||||
//
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
SpringApplication.run(CloudCarRailApplication.class, args);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
package com.muyu.carrail.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.muyu.carrail.domain.SysCorpuscle;
|
||||
import com.muyu.carrail.service.ISysCorpuscleService;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 电子围栏Controller
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-09-17
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/carRail")
|
||||
public class SysCorpuscleController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISysCorpuscleService sysCorpuscleService;
|
||||
|
||||
/**
|
||||
* 查询电子围栏列表
|
||||
*/
|
||||
@RequiresPermissions("carRail:carRail:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<SysCorpuscle>> list(SysCorpuscle sysCorpuscle)
|
||||
{
|
||||
startPage();
|
||||
List<SysCorpuscle> list = sysCorpuscleService.selectSysCorpuscleList(sysCorpuscle);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@RequiresPermissions("carRail:corpuscle:add")
|
||||
@PostMapping
|
||||
public Result<Integer> add(
|
||||
@Validated @RequestBody SysCorpuscle sysCorpuscle)
|
||||
{
|
||||
|
||||
return toAjax(sysCorpuscleService.save(sysCorpuscle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改电子围栏
|
||||
*/
|
||||
@RequiresPermissions("carRail:corpuscle:edit")
|
||||
@PutMapping
|
||||
public Result<Integer> edit(
|
||||
@Validated @RequestBody SysCorpuscle sysCorpuscle)
|
||||
{
|
||||
|
||||
return toAjax(sysCorpuscleService.updateById(sysCorpuscle));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 删除电子围栏
|
||||
*/
|
||||
@RequiresPermissions("carRail:corpuscle:remove")
|
||||
@DeleteMapping("/{ids}")
|
||||
public Result<Integer> remove(@PathVariable("ids") Long[] ids)
|
||||
{
|
||||
sysCorpuscleService.removeBatchByIds(Arrays.asList(ids));
|
||||
return success();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,106 @@
|
|||
package com.muyu.carrail.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import com.muyu.carrail.domain.SysFence;
|
||||
import com.muyu.carrail.service.ISysFenceService;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 围栏组Controller
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-09-17
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/fence")
|
||||
public class SysFenceController extends BaseController
|
||||
{
|
||||
@Resource
|
||||
private ISysFenceService sysFenceService;
|
||||
|
||||
/**
|
||||
* 查询围栏组列表
|
||||
*/
|
||||
@RequiresPermissions("fence:fence:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<SysFence>> list(SysFence sysFence)
|
||||
{
|
||||
startPage();
|
||||
List<SysFence> list = sysFenceService.selectSysFenceList(sysFence);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出围栏组列表
|
||||
*/
|
||||
@RequiresPermissions("fence:fence:export")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysFence sysFence)
|
||||
{
|
||||
List<SysFence> list = sysFenceService.selectSysFenceList(sysFence);
|
||||
ExcelUtil<SysFence> util = new ExcelUtil<SysFence>(SysFence.class);
|
||||
util.exportExcel(response, list, "围栏组数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取围栏组详细信息
|
||||
*/
|
||||
@RequiresPermissions("fence:fence:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public Result<List<SysFence>> getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(sysFenceService.selectSysFenceById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增围栏组
|
||||
*/
|
||||
@RequiresPermissions("fence:fence:add")
|
||||
@PostMapping
|
||||
public Result<Integer> add(
|
||||
@Validated @RequestBody SysFence sysFence)
|
||||
{
|
||||
|
||||
return toAjax(sysFenceService.save(sysFence));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改围栏组
|
||||
*/
|
||||
@RequiresPermissions("fence:fence:edit")
|
||||
@PutMapping
|
||||
public Result<Integer> edit(
|
||||
@Validated @RequestBody SysFence sysFence)
|
||||
{
|
||||
|
||||
return toAjax(sysFenceService.updateById(sysFence));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除围栏组
|
||||
*/
|
||||
@RequiresPermissions("fence:fence:remove")
|
||||
@DeleteMapping("/{ids}")
|
||||
public Result<Integer> remove(@PathVariable("ids") Long[] ids)
|
||||
{
|
||||
sysFenceService.removeBatchByIds(Arrays.asList(ids));
|
||||
return success();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
package com.muyu.carrail.domain;
|
||||
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
|
||||
/**
|
||||
* 电子围栏对象 sys_corpuscle_fence
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-09-17
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Setter
|
||||
@Getter
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("sys_corpuscle_fence")
|
||||
public class SysCorpuscle{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 自增主键 */
|
||||
@TableId( type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/** 围栏编码 */
|
||||
@Excel(name = "围栏编码")
|
||||
private String fenceCode;
|
||||
|
||||
/** 围栏名称 */
|
||||
@Excel(name = "围栏名称")
|
||||
private String fenceName;
|
||||
|
||||
/** 围栏类型(1.驶入 2.驶出) */
|
||||
@Excel(name = "围栏类型(1.驶入 2.驶出)")
|
||||
private Long fenceType;
|
||||
|
||||
/** 围栏位置 */
|
||||
@Excel(name = "围栏位置")
|
||||
private String fencePosition;
|
||||
|
||||
/** 启用状态(1.启用 2.停用) */
|
||||
@Excel(name = "启用状态(1.启用 2.停用)")
|
||||
private String state;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("fenceCode", getFenceCode())
|
||||
.append("fenceName", getFenceName())
|
||||
.append("fenceType", getFenceType())
|
||||
.append("fencePosition", getFencePosition())
|
||||
.append("state", getState())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
package com.muyu.carrail.domain;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 围栏组对象 sys_fence_group
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-09-17
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Setter
|
||||
@Getter
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("sys_fence_group")
|
||||
public class SysFence{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 自增主键 */
|
||||
@TableId( type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/** 围栏组编码 */
|
||||
@Excel(name = "围栏组编码")
|
||||
private String groupCode;
|
||||
|
||||
/** 围栏组名称 */
|
||||
@Excel(name = "围栏组名称")
|
||||
private String groupName;
|
||||
|
||||
/** 围栏组类型 */
|
||||
@Excel(name = "围栏组类型")
|
||||
private String groupType;
|
||||
|
||||
/** 启用状态 */
|
||||
@Excel(name = "启用状态")
|
||||
private String state;
|
||||
|
||||
/** 创建人 */
|
||||
@Excel(name = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@Excel(name = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/** 更新人 */
|
||||
@Excel(name = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/** 更新时间 */
|
||||
@Excel(name = "更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
/** 启用状态 */
|
||||
@Excel(name = "启用状态")
|
||||
private String remark;
|
||||
|
||||
// /** sysfindname */
|
||||
// @Excel(name = "电子围栏集群")
|
||||
// private String sysfindname;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("groupCode", getGroupCode())
|
||||
.append("groupName", getGroupName())
|
||||
.append("groupType", getGroupType())
|
||||
.append("state", getState())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
// .append("sysfindname", getSysfindname())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.muyu.carrail.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.muyu.carrail.domain.SysCorpuscle;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 电子围栏Mapper接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-09-17
|
||||
*/
|
||||
|
||||
public interface SysCorpuscleMapper extends BaseMapper<SysCorpuscle>{
|
||||
|
||||
List<SysCorpuscle> selectCarRail(SysCorpuscle sysCorpuscle);
|
||||
|
||||
boolean addCarRail(SysCorpuscle sysCorpuscle);
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.muyu.carrail.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.carrail.domain.SysFence;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 围栏组Mapper接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-09-17
|
||||
*/
|
||||
public interface SysFenceMapper extends BaseMapper<SysFence>{
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.muyu.carrail.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.muyu.carrail.domain.SysCorpuscle;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* 电子围栏Service接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-09-17
|
||||
*/
|
||||
public interface ISysCorpuscleService extends IService<SysCorpuscle> {
|
||||
|
||||
/**
|
||||
* 查询电子围栏列表
|
||||
*
|
||||
* @param sysCorpuscle 电子围栏
|
||||
* @return 电子围栏集合
|
||||
*/
|
||||
public List<SysCorpuscle> selectSysCorpuscleList(SysCorpuscle sysCorpuscle);
|
||||
|
||||
|
||||
boolean checkIdUnique(SysCorpuscle sysCorpuscle);
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.muyu.carrail.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.carrail.domain.SysFence;
|
||||
|
||||
/**
|
||||
* 围栏组Service接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-09-17
|
||||
*/
|
||||
public interface ISysFenceService extends IService<SysFence> {
|
||||
/**
|
||||
* 精确查询围栏组
|
||||
*
|
||||
* @param id 围栏组主键
|
||||
* @return 围栏组
|
||||
*/
|
||||
public SysFence selectSysFenceById(Long id);
|
||||
|
||||
/**
|
||||
* 查询围栏组列表
|
||||
*
|
||||
* @param sysFence 围栏组
|
||||
* @return 围栏组集合
|
||||
*/
|
||||
public List<SysFence> selectSysFenceList(SysFence sysFence);
|
||||
|
||||
/**
|
||||
* 判断 围栏组 id是否唯一
|
||||
* @param sysFence 围栏组
|
||||
* @return 结果
|
||||
*/
|
||||
Boolean checkIdUnique(SysFence sysFence);
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package com.muyu.carrail.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.muyu.carrail.mapper.SysCorpuscleMapper;
|
||||
import com.muyu.carrail.domain.SysCorpuscle;
|
||||
import com.muyu.carrail.service.ISysCorpuscleService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* 电子围栏Service业务层处理
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-09-17
|
||||
*/
|
||||
@Service
|
||||
public class SysCorpuscleServiceImpl
|
||||
extends ServiceImpl<SysCorpuscleMapper, SysCorpuscle>
|
||||
implements ISysCorpuscleService {
|
||||
|
||||
/**
|
||||
* 精确查询电子围栏
|
||||
*
|
||||
* @param id 电子围栏主键
|
||||
* @return 电子围栏
|
||||
*/
|
||||
@Autowired
|
||||
SysCorpuscleMapper sysCorpuscleMapper;
|
||||
|
||||
@Override
|
||||
public List<SysCorpuscle> selectSysCorpuscleList(SysCorpuscle sysCorpuscle) {
|
||||
return sysCorpuscleMapper.selectCarRail(sysCorpuscle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkIdUnique(SysCorpuscle sysCorpuscle) {
|
||||
return sysCorpuscleMapper.addCarRail(sysCorpuscle);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
package com.muyu.carrail.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.muyu.carrail.domain.SysCorpuscle;
|
||||
import com.muyu.carrail.domain.SysFence;
|
||||
import com.muyu.carrail.mapper.SysFenceMapper;
|
||||
import com.muyu.carrail.service.ISysFenceService;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 围栏组Service业务层处理
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-09-17
|
||||
*/
|
||||
@Service
|
||||
public class SysFenceServiceImpl
|
||||
extends ServiceImpl<SysFenceMapper, SysFence>
|
||||
implements ISysFenceService {
|
||||
|
||||
|
||||
@Override
|
||||
public SysFence selectSysFenceById(Long id) {
|
||||
|
||||
LambdaQueryWrapper<SysFence> queryWrapper = new LambdaQueryWrapper<>();
|
||||
Assert.notNull(id, "id不可为空");
|
||||
queryWrapper.eq(SysFence::getId, id);
|
||||
return this.getOne(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysFence> selectSysFenceList(SysFence sysFence) {
|
||||
LambdaQueryWrapper<SysFence> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (StringUtils.isNotEmpty(sysFence.getGroupCode())){
|
||||
queryWrapper.eq(SysFence::getGroupCode, sysFence.getGroupCode());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sysFence.getGroupName())){
|
||||
queryWrapper.like(SysFence::getGroupName, sysFence.getGroupName());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sysFence.getGroupType())){
|
||||
queryWrapper.eq(SysFence::getGroupType, sysFence.getGroupType());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sysFence.getState())){
|
||||
queryWrapper.eq(SysFence::getState, sysFence.getState());
|
||||
}
|
||||
return this.list(queryWrapper);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean checkIdUnique(SysFence sysFence) {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 10011
|
||||
|
||||
# nacos线上地址
|
||||
nacos:
|
||||
addr: 110.42.213.184:8848
|
||||
user-name: nacos
|
||||
password: nacos
|
||||
namespace: public
|
||||
# SPRING_AMQP_DESERIALIZATION_TRUST_ALL=true spring.amqp.deserialization.trust.all
|
||||
# Spring
|
||||
spring:
|
||||
amqp:
|
||||
deserialization:
|
||||
trust:
|
||||
all: true
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
application:
|
||||
# 应用名称
|
||||
name: cloud-car
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: ${nacos.addr}
|
||||
# nacos用户名
|
||||
username: ${nacos.user-name}
|
||||
# nacos密码
|
||||
password: ${nacos.password}
|
||||
# 命名空间
|
||||
namespace: ${nacos.namespace}
|
||||
config:
|
||||
# 服务注册地址
|
||||
server-addr: ${nacos.addr}
|
||||
# nacos用户名
|
||||
username: ${nacos.user-name}
|
||||
# nacos密码
|
||||
password: ${nacos.password}
|
||||
# 命名空间
|
||||
namespace: ${nacos.namespace}
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
# 系统共享配置
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
# 系统环境Config共享配置
|
||||
- application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
||||
logging:
|
||||
level:
|
||||
com.muyu.carrail.mapper: DEBUG
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
<?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="com.muyu.carrail.mapper.SysFenceMapper">
|
||||
|
||||
<resultMap type="com.muyu.carrail.domain.SysFence" id="SysFenceResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="groupCode" column="group_code" />
|
||||
<result property="groupName" column="group_name" />
|
||||
<result property="groupType" column="group_type" />
|
||||
<result property="state" column="state" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<!-- <result property="sysfindname" column="sysfindname" />-->
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysFenceVo">
|
||||
select id, group_code, group_name, group_type, state, create_by, create_time, update_by, update_time, remark from sys_fence_group
|
||||
</sql>
|
||||
|
||||
<select id="selectSysFenceList" parameterType="com.muyu.carrail.domain.SysFence" resultMap="SysFenceResult">
|
||||
<include refid="selectSysFenceVo"/>
|
||||
|
||||
<where>
|
||||
<if test="groupCode != null and groupCode != ''"> and group_code = #{groupCode}</if>
|
||||
<if test="groupName != null and groupName != ''"> and group_name like concat('%', #{groupName}, '%')</if>
|
||||
<if test="groupType != null and groupType != ''"> and group_type = #{groupType}</if>
|
||||
<if test="state != null and state != ''"> and state = #{state}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysFenceById" parameterType="Long" resultMap="SysFenceResult">
|
||||
<include refid="selectSysFenceVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
<delete id="deleteSysFenceById" parameterType="Long">
|
||||
delete from sys_fence_group where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysFenceByIds" parameterType="String">
|
||||
delete from sys_fence_group where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -0,0 +1,16 @@
|
|||
<?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="com.muyu.carrail.mapper.SysCorpuscleMapper">
|
||||
<insert id="addCarRail">
|
||||
insert into sys_corpuscle_fence(fence_code,fence_name,fence_type,fence_position,state)
|
||||
values(#{fenceCode},#{fenceName},#{fenceType},#{fencePosition},#{state})
|
||||
</insert>
|
||||
|
||||
|
||||
<select id="selectCarRail" resultType="com.muyu.carrail.domain.SysCorpuscle">
|
||||
select * from sys_corpuscle_fence
|
||||
</select>
|
||||
</mapper>
|
|
@ -4,10 +4,10 @@ server:
|
|||
|
||||
# nacos线上地址
|
||||
nacos:
|
||||
addr: nacos.muyu.icu:8848
|
||||
addr: 110.42.213.184:8848
|
||||
user-name: nacos
|
||||
password: nacos
|
||||
namespace: muyu-cloud
|
||||
namespace: public
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9202
|
||||
port: 9203
|
||||
|
||||
# nacos线上地址
|
||||
nacos:
|
||||
addr: nacos.muyu.icu:8848
|
||||
addr: 110.42.213.184:8848
|
||||
user-name: nacos
|
||||
password: nacos
|
||||
namespace: muyu-cloud
|
||||
namespace: public
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
|
@ -47,5 +47,3 @@ spring:
|
|||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
# 系统环境Config共享配置
|
||||
- application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
# xxl-job 配置文件
|
||||
- application-xxl-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
|
|
@ -0,0 +1,91 @@
|
|||
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>cloud-modules</artifactId>
|
||||
<groupId>com.muyu</groupId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>cloud-modules-rail</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
</properties>
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-core</artifactId>
|
||||
</dependency>
|
||||
<!-- 接口模块 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-api-doc</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -0,0 +1,4 @@
|
|||
package com.zhangyi.rail;
|
||||
|
||||
public class CloudRailApplication {
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
package com.zhangyi.rail.controller;
|
||||
|
||||
public class RailController {
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.zhangyi.rail.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Data
|
||||
@Setter
|
||||
@Getter
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("sys_corpuscle_fence")
|
||||
public class SysFenceRail {
|
||||
private static final long seriaversionUID =1L;
|
||||
/** 自增主键 */
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/** 围栏编码 */
|
||||
@Excel(name="围栏编码")
|
||||
private String fenceCode;
|
||||
/**围栏名称**/
|
||||
@Excel(name = "围栏名称")
|
||||
private String fenceName;
|
||||
|
||||
/**围栏类型**/
|
||||
@Excel(name = "围栏类型")
|
||||
private Long fenceType;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -71,16 +71,8 @@
|
|||
<artifactId>cloud-common-api-doc</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- XllJob定时任务 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-xxl</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-rabbit</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -18,4 +18,5 @@ public class CloudSystemApplication {
|
|||
public static void main (String[] args) {
|
||||
SpringApplication.run(CloudSystemApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,53 +1,53 @@
|
|||
package com.muyu.system.rabbit;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.muyu.system.domain.SysConfig;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.amqp.core.Queue;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Log4j2
|
||||
@RestController
|
||||
@RequestMapping("/rabbit/test")
|
||||
public class RabbitTest {
|
||||
|
||||
@Autowired
|
||||
private RabbitTemplate rabbitTemplate;
|
||||
|
||||
@Bean
|
||||
public Queue initQueue(){
|
||||
return new Queue("rabbit.test.init");
|
||||
}
|
||||
|
||||
@RabbitListener(queues = "rabbit.test.init")
|
||||
public void msg(SysConfig sysConfig){
|
||||
log.info("消息队列:[{}], 消息内容:[{}]", "rabbit.test.init", JSONObject.toJSONString(sysConfig));
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void init(){
|
||||
new Thread(() -> {
|
||||
try {
|
||||
Thread.sleep(5000);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
SysConfig sysConfig = SysConfig.builder()
|
||||
.configId(1L)
|
||||
.configKey("ceshi-key")
|
||||
.configName("测试名称")
|
||||
.configType("测试类型")
|
||||
.configValue("测试值")
|
||||
.build();
|
||||
rabbitTemplate.convertAndSend("rabbit.test.init",sysConfig);
|
||||
}).start();
|
||||
}
|
||||
|
||||
}
|
||||
//package com.muyu.system.rabbit;
|
||||
//
|
||||
//import com.alibaba.fastjson2.JSONObject;
|
||||
//import com.muyu.system.domain.SysConfig;
|
||||
//import jakarta.annotation.PostConstruct;
|
||||
//import lombok.extern.log4j.Log4j2;
|
||||
//import org.springframework.amqp.core.Queue;
|
||||
//import org.springframework.amqp.rabbit.annotation.RabbitHandler;
|
||||
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
//import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.context.annotation.Bean;
|
||||
//import org.springframework.web.bind.annotation.RequestMapping;
|
||||
//import org.springframework.web.bind.annotation.RestController;
|
||||
//
|
||||
//@Log4j2
|
||||
//@RestController
|
||||
//@RequestMapping("/rabbit/test")
|
||||
//public class RabbitTest {
|
||||
//
|
||||
// @Autowired
|
||||
// private RabbitTemplate rabbitTemplate;
|
||||
//
|
||||
// @Bean
|
||||
// public Queue initQueue(){
|
||||
// return new Queue("rabbit.test.init");
|
||||
// }
|
||||
//
|
||||
// @RabbitListener(queues = "rabbit.test.init")
|
||||
// public void msg(SysConfig sysConfig){
|
||||
// log.info("消息队列:[{}], 消息内容:[{}]", "rabbit.test.init", JSONObject.toJSONString(sysConfig));
|
||||
// }
|
||||
//
|
||||
// @PostConstruct
|
||||
// public void init(){
|
||||
// new Thread(() -> {
|
||||
// try {
|
||||
// Thread.sleep(5000);
|
||||
// } catch (InterruptedException e) {
|
||||
// throw new RuntimeException(e);
|
||||
// }
|
||||
// SysConfig sysConfig = SysConfig.builder()
|
||||
// .configId(1L)
|
||||
// .configKey("ceshi-key")
|
||||
// .configName("测试名称")
|
||||
// .configType("测试类型")
|
||||
// .configValue("测试值")
|
||||
// .build();
|
||||
// rabbitTemplate.convertAndSend("rabbit.test.init",sysConfig);
|
||||
// }).start();
|
||||
// }
|
||||
//
|
||||
//}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9701
|
||||
port: 9707
|
||||
|
||||
# nacos线上地址
|
||||
nacos:
|
||||
addr: nacos.muyu.icu:8848
|
||||
addr: 110.42.213.184:8848
|
||||
user-name: nacos
|
||||
password: nacos
|
||||
namespace: muyu-cloud
|
||||
namespace: public
|
||||
# SPRING_AMQP_DESERIALIZATION_TRUST_ALL=true spring.amqp.deserialization.trust.all
|
||||
# Spring
|
||||
spring:
|
||||
|
@ -51,10 +51,8 @@ spring:
|
|||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
# 系统环境Config共享配置
|
||||
- application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
# xxl-job 配置文件
|
||||
- application-xxl-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
# rabbit 配置文件
|
||||
- application-rabbit-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
||||
|
||||
logging:
|
||||
level:
|
||||
com.muyu.system.mapper: DEBUG
|
||||
com.muyu.system.mapper: DEBUG
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
<module>cloud-modules-system</module>
|
||||
<module>cloud-modules-gen</module>
|
||||
<module>cloud-modules-file</module>
|
||||
<module>cloud-modules-car</module>
|
||||
<module>cloud-modules-rail</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>cloud-modules</artifactId>
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9100
|
||||
port: 9101
|
||||
|
||||
# nacos线上地址
|
||||
nacos:
|
||||
addr: nacos.muyu.icu:8848
|
||||
addr: 110.42.213.184:8848
|
||||
user-name: nacos
|
||||
password: nacos
|
||||
namespace: muyu-cloud
|
||||
namespace: public
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
|
|
|
@ -5,3 +5,4 @@ docker run --name xxl-job-admin -d \
|
|||
-e PARAMS="--spring.config.additional-location=/config/application.properties" \
|
||||
-v ./log:/data/applogs \
|
||||
xuxueli/xxl-job-admin:2.4.1
|
||||
|
||||
|
|
Loading…
Reference in New Issue