add:agv模块看板
This commit is contained in:
13
nl-base-data/src/main/java/org/nl/NlBaseDataApplication.java
Normal file
13
nl-base-data/src/main/java/org/nl/NlBaseDataApplication.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package org.nl;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class NlBaseDataApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(NlBaseDataApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright [2022] [https://www.xiaonuo.vip]
|
||||
*
|
||||
* Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
|
||||
*
|
||||
* 1.请不要删除和修改根目录下的LICENSE文件。
|
||||
* 2.请不要删除和修改Snowy源码头部的版权声明。
|
||||
* 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
|
||||
* 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
|
||||
* 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
|
||||
* 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
|
||||
*/
|
||||
package org.nl.device.controller;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.nl.common.pojo.CommonResult;
|
||||
import org.nl.device.service.dto.DeviceInfo;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
@Tag(name = "设备模块")
|
||||
@RestController()
|
||||
@RequestMapping("/api/device")
|
||||
@Validated
|
||||
@SaIgnore
|
||||
public class DeviceController {
|
||||
static {
|
||||
System.out.println("初始化AGV模块------------");
|
||||
}
|
||||
@GetMapping("list")
|
||||
public CommonResult<List> status() {
|
||||
List<DeviceInfo> list = new ArrayList<>();
|
||||
JSONObject object = new JSONObject();
|
||||
object.put("action","action");
|
||||
object.put("signal","signal");
|
||||
object.put("power","power");
|
||||
for (int i = 0; i < 20; i++) {
|
||||
DeviceInfo build = DeviceInfo.builder()
|
||||
.name("设备1"+i)
|
||||
.code(i + "sdfsdf")
|
||||
.id(String.valueOf(i))
|
||||
.icon("/Users/mima0000/Desktop/car.png")
|
||||
.description("设备介绍")
|
||||
.editParam(object)
|
||||
.type(i%2==1?"货架":"专机")
|
||||
.build();
|
||||
list.add(build);
|
||||
}
|
||||
return CommonResult.data(list);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package org.nl.device.service.dto;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class DeviceInfo {
|
||||
/**
|
||||
* 设备Id
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 设备Id
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 车辆类型
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 设备描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 设备编辑时存储信息
|
||||
*/
|
||||
private JSONObject editParam;
|
||||
/**
|
||||
* 设备图标
|
||||
*/
|
||||
private String icon="/Users/mima0000/Desktop/car.png";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright [2022] [https://www.xiaonuo.vip]
|
||||
*
|
||||
* Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
|
||||
*
|
||||
* 1.请不要删除和修改根目录下的LICENSE文件。
|
||||
* 2.请不要删除和修改Snowy源码头部的版权声明。
|
||||
* 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
|
||||
* 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
|
||||
* 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
|
||||
* 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
|
||||
*/
|
||||
package org.nl.point;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.nl.common.pojo.CommonResult;
|
||||
import org.nl.point.dto.PointStatus;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
@Tag(name = "AGV模块")
|
||||
@RestController()
|
||||
@RequestMapping("/api/baseData/point")
|
||||
@Validated
|
||||
@SaIgnore
|
||||
public class PointStatusController {
|
||||
static {
|
||||
System.out.println("初始化AGV模块------------");
|
||||
}
|
||||
@GetMapping("status")
|
||||
public CommonResult<List<PointStatus>> status() {
|
||||
List<PointStatus> list = new ArrayList<>();
|
||||
for (int i = 0; i < new Random().nextInt(100)+10; i++) {
|
||||
PointStatus build = PointStatus.builder().pointCode("A1_1" + i)
|
||||
.pointName("货位" + i)
|
||||
.x(new Random().nextInt(1280))
|
||||
.y(new Random().nextInt(960)).status(String.valueOf(i / 2)).build();
|
||||
list.add(build);
|
||||
}
|
||||
return CommonResult.data(list);
|
||||
}
|
||||
}
|
||||
33
nl-base-data/src/main/java/org/nl/point/dto/PointStatus.java
Normal file
33
nl-base-data/src/main/java/org/nl/point/dto/PointStatus.java
Normal file
@@ -0,0 +1,33 @@
|
||||
package org.nl.point.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PointStatus {
|
||||
/**
|
||||
* 点位编码
|
||||
*/
|
||||
private String pointCode;
|
||||
/**
|
||||
* 车辆类型
|
||||
*/
|
||||
private String pointName;
|
||||
/**
|
||||
* 坐标X
|
||||
*/
|
||||
private int x;
|
||||
/**
|
||||
* 坐标Y
|
||||
*/
|
||||
private int y;
|
||||
/**
|
||||
* 点位状态 0无货1有货
|
||||
*/
|
||||
private String status;
|
||||
}
|
||||
1
nl-base-data/src/main/resources/application.properties
Normal file
1
nl-base-data/src/main/resources/application.properties
Normal file
@@ -0,0 +1 @@
|
||||
spring.application.name=nl-base-data
|
||||
Reference in New Issue
Block a user