电子围栏合并
parent
0addc68684
commit
0f315a08a3
|
@ -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>
|
|
@ -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;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue