test:(增加电子围栏组)

dev
zhang xu 2024-06-03 21:31:17 +08:00
parent b89390bbc3
commit ec9c7af03b
9 changed files with 218 additions and 57 deletions

View File

@ -0,0 +1,23 @@
package com.muyu;
import com.muyu.common.security.annotation.EnableCustomConfig;
import com.muyu.common.security.annotation.EnableMyFeignClients;
import com.muyu.common.swagger.annotation.EnableCustomSwagger2;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @ClassDescription:
* @JdkVersion: 17
* @Author: zhangxu
* @Created: 2024/6/3 21:00
*/
@EnableCustomConfig
@EnableCustomSwagger2
@EnableMyFeignClients
@SpringBootApplication
public class CloudManyDataSourceApplication {
public static void main(String[] args) {
SpringApplication.run(CloudManyDataSourceApplication.class);
}
}

View File

@ -0,0 +1,28 @@
# Tomcat
server:
port: 9205
# Spring
spring:
application:
# 应用名称
name: muyu-many-datasource
profiles:
# 环境配置
active: dev
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 115.159.67.205:8848
config:
# 配置中心地址
server-addr: 115.159.67.205:8848
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
logging:
level:
com.muyu.mapper: DEBUG

View File

@ -71,9 +71,6 @@ public class FenceGroups extends BaseEntity {
.groupName(fenceGroupsEditReq.getGroupName())
.build();
}
/**
*
* */
private List<Fences> fencesList;
}

View File

@ -1,12 +1,22 @@
package com.muyu.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.muyu.common.core.annotation.Excel;
import com.muyu.common.core.web.domain.BaseEntity;
import com.muyu.domain.req.FencesEditReq;
import com.muyu.domain.req.FencesQueryReq;
import com.muyu.domain.req.FencesSaveReq;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.apache.naming.factory.BeanFactory;
import org.springframework.beans.factory.annotation.Autowired;
import java.math.BigDecimal;
import java.util.List;
/**
* @ClassDescription:
@ -19,44 +29,99 @@ import org.springframework.beans.factory.annotation.Autowired;
@NoArgsConstructor
@SuperBuilder
public class Fences extends BaseEntity {
/**
*
*id
* **/
private static final long serialVersionUID = 1L;
/** 围栏id */
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty(name = "围栏id", value = "围栏id")
private Long id;
/**
*id
*
* **/
private String groupId;
/**
*
*
* **/
/** 围栏组id */
@Excel(name = "围栏组id")
@ApiModelProperty(name = "围栏组id", value = "围栏组id")
private Long groupId;
/** 电子围栏名称 */
@Excel(name = "电子围栏名称")
@ApiModelProperty(name = "电子围栏名称", value = "电子围栏名称")
private String fenceName;
/**
*
*
* **/
/** 围栏类型 */
@Excel(name = "围栏类型")
@ApiModelProperty(name = "围栏类型", value = "围栏类型")
private String fenceType;
/**
*
*
* **/
private Double radius;
/**
*
*
* **/
/** 半径 */
@Excel(name = "半径")
@ApiModelProperty(name = "半径", value = "半径")
private String radius;
/** 驶入、驶出 */
@Excel(name = "驶入、驶出")
@ApiModelProperty(name = "驶入、驶出", value = "驶入、驶出")
private String eventType;
/**
*
*
* **/
private String staut;
/**
*
*
* **/
/** 围栏状态 */
@Excel(name = "围栏状态")
@ApiModelProperty(name = "围栏状态", value = "围栏状态")
private String status;
/** 坐标 */
@Excel(name = "坐标")
@ApiModelProperty(name = "坐标", value = "坐标")
private String polygonPoints;
/**
*
*/
@Excel(name = "坐标")
@ApiModelProperty(name = "坐标", value = "坐标")
@TableField(exist = false)
private List<Path> path;
/**
*
*/
public static Fences queryBuild( FencesQueryReq fencesQueryReq){
return Fences.builder()
.groupId(fencesQueryReq.getGroupId())
.fenceName(fencesQueryReq.getFenceName())
.fenceType(fencesQueryReq.getFenceType())
.radius(fencesQueryReq.getRadius())
.eventType(fencesQueryReq.getEventType())
.status(fencesQueryReq.getStatus())
.polygonPoints(fencesQueryReq.getPolygonPoints())
.build();
}
/**
*
*/
public static Fences saveBuild(FencesSaveReq fencesSaveReq){
return Fences.builder()
.groupId(fencesSaveReq.getGroupId())
.fenceName(fencesSaveReq.getFenceName())
.fenceType(fencesSaveReq.getFenceType())
.radius(fencesSaveReq.getRadius())
.eventType(fencesSaveReq.getEventType())
.status(fencesSaveReq.getStatus())
.polygonPoints(fencesSaveReq.getPolygonPoints())
.build();
}
/**
*
*/
public static Fences editBuild(Long id, FencesEditReq fencesEditReq){
return Fences.builder()
.id(id)
.groupId(fencesEditReq.getGroupId())
.fenceName(fencesEditReq.getFenceName())
.fenceType(fencesEditReq.getFenceType())
.radius(fencesEditReq.getRadius())
.eventType(fencesEditReq.getEventType())
.status(fencesEditReq.getStatus())
.polygonPoints(fencesEditReq.getPolygonPoints())
.build();
}
}

View File

@ -1,5 +1,6 @@
package com.muyu.domain.req;
import com.muyu.domain.Fences;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -8,6 +9,8 @@ import lombok.experimental.SuperBuilder;
import io.swagger.annotations.*;
import com.muyu.common.core.web.domain.BaseEntity;
import java.util.List;
/**
* fence_groups
*
@ -33,4 +36,6 @@ public class FenceGroupsSaveReq extends BaseEntity {
@ApiModelProperty(name = "电子围栏名称", value = "电子围栏名称")
private String groupName;
private List<Fences> fencesList;
}

View File

@ -22,3 +22,4 @@ public class NetworkingApplication {
SpringApplication.run(NetworkingApplication.class, args);
}
}

View File

@ -1,4 +1,4 @@
package com.muyu.system.controller;
package com.muyu.networking.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
@ -11,20 +11,13 @@ import com.muyu.domain.req.FenceGroupsSaveReq;
import com.muyu.networking.service.FenceGroupsService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
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 org.springframework.web.bind.annotation.*;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.utils.poi.ExcelUtil;
import com.muyu.common.core.web.controller.BaseController;
import com.muyu.common.log.annotation.Log;
import com.muyu.common.log.enums.BusinessType;
import com.muyu.common.security.annotation.RequiresPermissions;
/**
@ -44,7 +37,6 @@ public class FenceGroupsController extends BaseController {
*
*/
@ApiOperation("获取电子围栏组列表")
@RequiresPermissions("system:groups:list")
@GetMapping("/list")
public Result<TableDataInfo<FenceGroups>> list(FenceGroupsQueryReq fenceGroupsQueryReq) {
startPage();
@ -56,7 +48,6 @@ public class FenceGroupsController extends BaseController {
*
*/
@ApiOperation("导出电子围栏组列表")
@RequiresPermissions("system:groups:export")
@Log(title = "电子围栏组", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, FenceGroups fenceGroups) {
@ -69,7 +60,7 @@ public class FenceGroupsController extends BaseController {
*
*/
@ApiOperation("获取电子围栏组详细信息")
@RequiresPermissions("system:groups:query")
@GetMapping(value = "/{id}")
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
public Result<FenceGroups> getInfo(@PathVariable("id") Long id) {
@ -79,7 +70,7 @@ public class FenceGroupsController extends BaseController {
/**
*
*/
@RequiresPermissions("system:groups:add")
@Log(title = "电子围栏组", businessType = BusinessType.INSERT)
@PostMapping
@ApiOperation("新增电子围栏组")
@ -90,7 +81,7 @@ public class FenceGroupsController extends BaseController {
/**
*
*/
@RequiresPermissions("system:groups:edit")
@Log(title = "电子围栏组", businessType = BusinessType.UPDATE)
@PutMapping("/{id}")
@ApiOperation("修改电子围栏组")
@ -101,7 +92,7 @@ public class FenceGroupsController extends BaseController {
/**
*
*/
@RequiresPermissions("system:groups:remove")
@Log(title = "电子围栏组", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
@ApiOperation("删除电子围栏组")

View File

@ -0,0 +1,22 @@
package com.muyu.networking.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.domain.FenceGroups;
import java.util.List;
/**
* @ClassDescription:
* @JdkVersion: 17
* @Author: zhangxu
* @Created: 2024/6/2 16:35
*/
public interface FenceGroupsService extends IService<FenceGroups> {
/***
*
* */
public List<FenceGroups> list(FenceGroups fenceGroups);
}

View File

@ -0,0 +1,29 @@
package com.muyu.networking.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.domain.FenceGroups;
import com.muyu.networking.mapper.FenceGroupsMapper;
import com.muyu.networking.service.FenceGroupsService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @ClassDescription:
* @JdkVersion: 17
* @Author: zhangxu
* @Created: 2024/6/2 16:38
*/
@Service
public class FenceGroupsServiceImpl extends ServiceImpl<FenceGroupsMapper, FenceGroups> implements FenceGroupsService {
@Override
public List<FenceGroups> list(FenceGroups fenceGroups) {
LambdaQueryWrapper<FenceGroups> queryWrapper = new LambdaQueryWrapper<>();
return list(queryWrapper);
}
}