test:(增加电子围栏)
parent
a06d845b7a
commit
b89390bbc3
|
@ -1,9 +1,20 @@
|
|||
package com.muyu.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 com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.domain.req.FenceGroupsEditReq;
|
||||
import com.muyu.domain.req.FenceGroupsQueryReq;
|
||||
import com.muyu.domain.req.FenceGroupsSaveReq;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -14,17 +25,52 @@ import java.util.List;
|
|||
* @Created: 2024/5/31 15:16
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("fence_groups")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "FenceGroups", description = "电子围栏组")
|
||||
public class FenceGroups extends BaseEntity {
|
||||
/**
|
||||
*属性组id
|
||||
* */
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 电子围栏组id */
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
@ApiModelProperty(name = "电子围栏组id", value = "电子围栏组id")
|
||||
private Long id;
|
||||
/**
|
||||
*属性组名称
|
||||
* */
|
||||
|
||||
/** 电子围栏名称 */
|
||||
@Excel(name = "电子围栏名称")
|
||||
@ApiModelProperty(name = "电子围栏名称", value = "电子围栏名称")
|
||||
private String groupName;
|
||||
|
||||
/**
|
||||
* 查询构造器
|
||||
*/
|
||||
public static FenceGroups queryBuild( FenceGroupsQueryReq fenceGroupsQueryReq){
|
||||
return FenceGroups.builder()
|
||||
.groupName(fenceGroupsQueryReq.getGroupName())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加构造器
|
||||
*/
|
||||
public static FenceGroups saveBuild(FenceGroupsSaveReq fenceGroupsSaveReq){
|
||||
return FenceGroups.builder()
|
||||
.groupName(fenceGroupsSaveReq.getGroupName())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改构造器
|
||||
*/
|
||||
public static FenceGroups editBuild(Long id, FenceGroupsEditReq fenceGroupsEditReq){
|
||||
return FenceGroups.builder()
|
||||
.id(id)
|
||||
.groupName(fenceGroupsEditReq.getGroupName())
|
||||
.build();
|
||||
}
|
||||
/**
|
||||
*电子围栏集合
|
||||
* */
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
package com.muyu.domain.req;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 电子围栏组对象 fence_groups
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-06-02
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "FenceGroupsEditReq", description = "电子围栏组")
|
||||
public class FenceGroupsEditReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 电子围栏名称 */
|
||||
@ApiModelProperty(name = "电子围栏名称", value = "电子围栏名称")
|
||||
private String groupName;
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.muyu.domain.req;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 电子围栏组对象 fence_groups
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-06-02
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "FenceGroupsQueryReq", description = "电子围栏组")
|
||||
public class FenceGroupsQueryReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 电子围栏名称 */
|
||||
@ApiModelProperty(name = "电子围栏名称", value = "电子围栏名称")
|
||||
private String groupName;
|
||||
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package com.muyu.domain.req;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 电子围栏组对象 fence_groups
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-06-02
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "FenceGroupsSaveReq", description = "电子围栏组")
|
||||
public class FenceGroupsSaveReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 电子围栏组id */
|
||||
|
||||
@ApiModelProperty(name = "电子围栏组id", value = "电子围栏组id")
|
||||
private Long id;
|
||||
|
||||
/** 电子围栏名称 */
|
||||
|
||||
@ApiModelProperty(name = "电子围栏名称", value = "电子围栏名称")
|
||||
private String groupName;
|
||||
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
package com.muyu.domain.req;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 电子围栏对象 fences
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-06-02
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "FencesEditReq", description = "电子围栏")
|
||||
public class FencesEditReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 围栏组id */
|
||||
@ApiModelProperty(name = "围栏组id", value = "围栏组id")
|
||||
private Long groupId;
|
||||
|
||||
/** 电子围栏名称 */
|
||||
@ApiModelProperty(name = "电子围栏名称", value = "电子围栏名称")
|
||||
private String fenceName;
|
||||
|
||||
/** 围栏类型 */
|
||||
@ApiModelProperty(name = "围栏类型", value = "围栏类型")
|
||||
private String fenceType;
|
||||
|
||||
/** 半径 */
|
||||
@ApiModelProperty(name = "半径", value = "半径")
|
||||
private String radius;
|
||||
|
||||
/** 驶入、驶出 */
|
||||
@ApiModelProperty(name = "驶入、驶出", value = "驶入、驶出")
|
||||
private String eventType;
|
||||
|
||||
/** 围栏状态 */
|
||||
@ApiModelProperty(name = "围栏状态", value = "围栏状态")
|
||||
private String status;
|
||||
|
||||
/** 坐标 */
|
||||
@ApiModelProperty(name = "坐标", value = "坐标")
|
||||
private String polygonPoints;
|
||||
|
||||
}
|
|
@ -0,0 +1,112 @@
|
|||
package com.muyu.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.domain.FenceGroups;
|
||||
import com.muyu.domain.req.FenceGroupsEditReq;
|
||||
import com.muyu.domain.req.FenceGroupsQueryReq;
|
||||
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 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;
|
||||
|
||||
|
||||
/**
|
||||
* 电子围栏组Controller
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-06-02
|
||||
*/
|
||||
@Api(tags = "电子围栏组")
|
||||
@RestController
|
||||
@RequestMapping("/groups")
|
||||
public class FenceGroupsController extends BaseController {
|
||||
@Autowired
|
||||
private FenceGroupsService fenceGroupsService;
|
||||
|
||||
/**
|
||||
* 查询电子围栏组列表
|
||||
*/
|
||||
@ApiOperation("获取电子围栏组列表")
|
||||
@RequiresPermissions("system:groups:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<FenceGroups>> list(FenceGroupsQueryReq fenceGroupsQueryReq) {
|
||||
startPage();
|
||||
List<FenceGroups> list = fenceGroupsService.list(FenceGroups.queryBuild(fenceGroupsQueryReq));
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出电子围栏组列表
|
||||
*/
|
||||
@ApiOperation("导出电子围栏组列表")
|
||||
@RequiresPermissions("system:groups:export")
|
||||
@Log(title = "电子围栏组", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, FenceGroups fenceGroups) {
|
||||
List<FenceGroups> list = fenceGroupsService.list(fenceGroups);
|
||||
ExcelUtil<FenceGroups> util = new ExcelUtil<FenceGroups>(FenceGroups.class);
|
||||
util.exportExcel(response, list, "电子围栏组数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取电子围栏组详细信息
|
||||
*/
|
||||
@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) {
|
||||
return Result.success(fenceGroupsService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增电子围栏组
|
||||
*/
|
||||
@RequiresPermissions("system:groups:add")
|
||||
@Log(title = "电子围栏组", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@ApiOperation("新增电子围栏组")
|
||||
public Result<String> add(@RequestBody FenceGroupsSaveReq fenceGroupsSaveReq) {
|
||||
return toAjax(fenceGroupsService.save(FenceGroups.saveBuild(fenceGroupsSaveReq)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改电子围栏组
|
||||
*/
|
||||
@RequiresPermissions("system:groups:edit")
|
||||
@Log(title = "电子围栏组", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{id}")
|
||||
@ApiOperation("修改电子围栏组")
|
||||
public Result<String> edit(@PathVariable Long id, @RequestBody FenceGroupsEditReq fenceGroupsEditReq) {
|
||||
return toAjax(fenceGroupsService.updateById(FenceGroups.editBuild(id,fenceGroupsEditReq)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除电子围栏组
|
||||
*/
|
||||
@RequiresPermissions("system:groups:remove")
|
||||
@Log(title = "电子围栏组", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation("删除电子围栏组")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4")
|
||||
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||
return toAjax(fenceGroupsService.removeBatchByIds(ids));
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package com.muyu.networking.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.domain.Enterprise;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -10,7 +11,7 @@ import java.util.List;
|
|||
* @author ruoyi
|
||||
* @date 2024-05-25
|
||||
*/
|
||||
public interface EnterpriseMapper
|
||||
public interface EnterpriseMapper extends BaseMapper<Enterprise>
|
||||
{
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
package com.muyu.networking.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.domain.FenceGroups;
|
||||
|
||||
/**
|
||||
* @ClassDescription:
|
||||
* @JdkVersion: 17
|
||||
* @Author: zhangxu
|
||||
* @Created: 2024/6/2 16:33
|
||||
*/
|
||||
public interface FenceGroupsMapper extends BaseMapper<FenceGroups> {
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
<?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.networking.mapper.FenceGroupsMapper">
|
||||
|
||||
<resultMap type="com.muyu.domain.FenceGroups" id="FenceGroupsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="groupName" column="group_name" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectFenceGroupsVo">
|
||||
select id, group_name, remark, create_by, create_time, update_by, update_time from fence_groups
|
||||
</sql>
|
||||
</mapper>
|
Loading…
Reference in New Issue