长兴特科拉项目
This commit is contained in:
@@ -229,21 +229,10 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
public void execute() {
|
public void execute() {
|
||||||
try {
|
try {
|
||||||
device_code = this.getDeviceCode();
|
device_code = this.getDeviceCode();
|
||||||
heartbeat = this.itemProtocol.getHeartbeat();
|
|
||||||
mode = this.itemProtocol.getMode();
|
mode = this.itemProtocol.getMode();
|
||||||
move = this.itemProtocol.getMove();
|
|
||||||
action = this.itemProtocol.getAction();
|
|
||||||
container_direction = this.itemProtocol.getContainer_direction();
|
|
||||||
container_type = this.itemProtocol.getContainer_type();
|
|
||||||
error = this.itemProtocol.getError();
|
|
||||||
task = this.itemProtocol.getTask();
|
|
||||||
to_command = this.itemProtocol.getTo_command();
|
|
||||||
to_target = this.itemProtocol.getTotarget();
|
|
||||||
to_task = this.itemProtocol.getTo_task();
|
|
||||||
to_container_no = this.itemProtocol.getContainer_direction();
|
|
||||||
|
|
||||||
|
|
||||||
if(move==1){
|
if(mode==1){
|
||||||
taskAgvService.autoCreate(device_code);
|
taskAgvService.autoCreate(device_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -167,16 +167,13 @@ public class ItemProtocol {
|
|||||||
|
|
||||||
public static List<ItemDto> getReadableItemDtos() {
|
public static List<ItemDto> getReadableItemDtos() {
|
||||||
ArrayList list = new ArrayList();
|
ArrayList list = new ArrayList();
|
||||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB600.B0"));
|
list.add(new ItemDto(item_mode, "工作模式", "40001", Boolean.valueOf(true)));
|
||||||
list.add(new ItemDto(item_mode, "工作模式", "DB600.B1", Boolean.valueOf(true)));
|
|
||||||
list.add(new ItemDto(item_move, "光电开关信号", "DB600.B2"));
|
|
||||||
list.add(new ItemDto(item_error, "报警信号", "DB600.B6"));
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<ItemDto> getWriteableItemDtos() {
|
public static List<ItemDto> getWriteableItemDtos() {
|
||||||
ArrayList list = new ArrayList();
|
ArrayList list = new ArrayList();
|
||||||
list.add(new ItemDto(item_to_command, "下发命令", "DB601.W1", Boolean.valueOf(true)));
|
// list.add(new ItemDto(item_to_command, "下发命令", "DB601.W1", Boolean.valueOf(true)));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ public class XgHttpUtil {
|
|||||||
return new UnifiedResponse<>(false, "未开启连接该系统!");
|
return new UnifiedResponse<>(false, "未开启连接该系统!");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
System.out.println(REQUEST_ADAPTER.getUrl());
|
||||||
String body = HttpRequest
|
String body = HttpRequest
|
||||||
.post(REQUEST_ADAPTER.getUrl() + path)
|
.post(REQUEST_ADAPTER.getUrl() + path)
|
||||||
.setConnectionTimeout(10000)
|
.setConnectionTimeout(10000)
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package org.nl.acs.route.service.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("acs_routepile_line")
|
||||||
|
public class RoutePileLineEntity implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备编码
|
||||||
|
*/
|
||||||
|
private String device_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取货起点1
|
||||||
|
*/
|
||||||
|
private String start_point_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 放货点1
|
||||||
|
*/
|
||||||
|
private String next_point_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取货起点2
|
||||||
|
*/
|
||||||
|
private String start_point_code2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 放货点2
|
||||||
|
*/
|
||||||
|
private String next_point_code2;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private String create_time;
|
||||||
|
|
||||||
|
private String device_addr;
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package org.nl.acs.route.service.mapper;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.nl.acs.route.service.dao.RouteLineEntity;
|
||||||
|
import org.nl.acs.route.service.dao.RoutePileLineEntity;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
@Repository
|
||||||
|
public interface IRoutePileLineServiceMapper extends BaseMapper<RoutePileLineEntity> {
|
||||||
|
}
|
||||||
@@ -15,8 +15,11 @@ import org.nl.acs.instruction.enums.InstructionStatusEnum;
|
|||||||
import org.nl.acs.instruction.service.InstructionAgvService;
|
import org.nl.acs.instruction.service.InstructionAgvService;
|
||||||
|
|
||||||
import org.nl.acs.instruction.service.dto.QueryInstructionPo;
|
import org.nl.acs.instruction.service.dto.QueryInstructionPo;
|
||||||
|
import org.nl.acs.instruction.service.mapper.IInstructionServiceMapper;
|
||||||
import org.nl.acs.route.service.dao.RouteLineEntity;
|
import org.nl.acs.route.service.dao.RouteLineEntity;
|
||||||
|
import org.nl.acs.route.service.dao.RoutePileLineEntity;
|
||||||
import org.nl.acs.route.service.mapper.IRouteLineServiceMapper;
|
import org.nl.acs.route.service.mapper.IRouteLineServiceMapper;
|
||||||
|
import org.nl.acs.route.service.mapper.IRoutePileLineServiceMapper;
|
||||||
import org.nl.acs.task.enums.TaskStatusEnum;
|
import org.nl.acs.task.enums.TaskStatusEnum;
|
||||||
import org.nl.acs.task.enums.TaskTypeEnum;
|
import org.nl.acs.task.enums.TaskTypeEnum;
|
||||||
import org.nl.acs.task.service.TaskAgvService;
|
import org.nl.acs.task.service.TaskAgvService;
|
||||||
@@ -48,13 +51,17 @@ import java.util.Objects;
|
|||||||
public class TaskAgvServiceImpl implements TaskAgvService{
|
public class TaskAgvServiceImpl implements TaskAgvService{
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
// @Autowired
|
||||||
private InstructionAgvService instructionService;
|
// private InstructionAgvService instructionService;
|
||||||
|
|
||||||
private final IRouteLineServiceMapper routeLineServiceDao;
|
private final IRouteLineServiceMapper routeLineServiceDao;
|
||||||
|
|
||||||
private final ITaskAgvServiceMapper taskAgvServiceDao;
|
private final ITaskAgvServiceMapper taskAgvServiceDao;
|
||||||
|
|
||||||
|
private final IInstructionServiceMapper instructionService;
|
||||||
|
|
||||||
|
private final IRoutePileLineServiceMapper routePileLineServiceMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> queryAll(QueryTaskPo po) {
|
public Map<String, Object> queryAll(QueryTaskPo po) {
|
||||||
|
|
||||||
@@ -158,34 +165,27 @@ public class TaskAgvServiceImpl implements TaskAgvService{
|
|||||||
dto.setStart_device_code(driverCode);
|
dto.setStart_device_code(driverCode);
|
||||||
dto.setUpdate_time(now);
|
dto.setUpdate_time(now);
|
||||||
dto.setCreate_time(now);
|
dto.setCreate_time(now);
|
||||||
|
dto.setVehicle_code(driverCode);
|
||||||
dto.setTask_code(task_code);
|
dto.setTask_code(task_code);
|
||||||
// entity.setRoute_plan_code(route_plan_code);
|
// entity.setRoute_plan_code(route_plan_code);
|
||||||
dto.setTask_status("0");
|
dto.setTask_status("0");
|
||||||
dto.setCreate_type(TaskTypeEnum.Standard_AGV_Task.getCode());
|
dto.setCreate_type(TaskTypeEnum.Standard_AGV_Task.getCode());
|
||||||
dto.setPriority("1");
|
dto.setPriority("1");
|
||||||
dto.setStart_point_code("TE-01");
|
RoutePileLineEntity pileLineEntity=queryRouteLine(driverCode);
|
||||||
dto.setNext_point_code("ZD-01");
|
dto.setStart_point_code(pileLineEntity.getStart_point_code());
|
||||||
dto.setStart_point_code2("TE-01");
|
dto.setNext_point_code(pileLineEntity.getNext_point_code());
|
||||||
dto.setNext_point_code2("ZD-02");
|
dto.setStart_point_code2(pileLineEntity.getStart_point_code2());
|
||||||
// //判断起点终点设备类型
|
dto.setNext_point_code2(pileLineEntity.getNext_point_code2());
|
||||||
// if (queryRouteLine(dto.getStart_point_code(), dto.getNext_point_code())) {
|
|
||||||
// throw new Exception(dto.getStart_point_code() + "->" + dto.getNext_point_code() + "起点路由不通!");
|
|
||||||
// }
|
|
||||||
// //判断起点2终点2设备类型
|
|
||||||
// if (queryRouteLine(dto.getStart_point_code2(), dto.getNext_point_code2())) {
|
|
||||||
// throw new Exception(dto.getStart_point_code2() + "->" + dto.getNext_point_code2() + "起点2路由不通!");
|
|
||||||
// }
|
|
||||||
TaskEntity entity=new TaskEntity();
|
TaskEntity entity=new TaskEntity();
|
||||||
BeanUtils.copyProperties(dto,entity);
|
BeanUtils.copyProperties(dto,entity);
|
||||||
taskAgvServiceDao.insert(entity);
|
taskAgvServiceDao.insert(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean queryRouteLine(String start_point, String next_point){
|
private RoutePileLineEntity queryRouteLine(String device_code){
|
||||||
QueryWrapper<RouteLineEntity> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<RoutePileLineEntity> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("device_code", start_point);
|
queryWrapper.eq("device_code", device_code);
|
||||||
queryWrapper.eq("next_device_code", next_point);
|
List<RoutePileLineEntity> list=routePileLineServiceMapper.selectList(queryWrapper);
|
||||||
List<RouteLineEntity> list=routeLineServiceDao.selectList(queryWrapper);
|
return list.get(0);
|
||||||
return list.isEmpty();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -208,13 +208,13 @@ public class TaskAgvServiceImpl implements TaskAgvService{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void finish(String id) {
|
public void finish(String id) {
|
||||||
QueryInstructionPo po=new QueryInstructionPo();
|
|
||||||
po.setTask_id(id);
|
|
||||||
List<String> statusList=new ArrayList<>();
|
List<String> statusList=new ArrayList<>();
|
||||||
statusList.add(InstructionStatusEnum.READY.getIndex());
|
statusList.add(InstructionStatusEnum.READY.getIndex());
|
||||||
statusList.add(InstructionStatusEnum.BUSY.getIndex());
|
statusList.add(InstructionStatusEnum.BUSY.getIndex());
|
||||||
po.setInstructionAllStatus(statusList);
|
QueryWrapper<InstructionEntity> queryWrapper = new QueryWrapper<>();
|
||||||
List<InstructionEntity> list=instructionService.queryInstructionList(po);
|
queryWrapper.in("instruction_status",statusList);
|
||||||
|
queryWrapper.eq("task_id",id);
|
||||||
|
List<InstructionEntity> list= instructionService.selectList(queryWrapper);
|
||||||
if(!list.isEmpty()){
|
if(!list.isEmpty()){
|
||||||
throw new BadRequestException("有指令未完成!");
|
throw new BadRequestException("有指令未完成!");
|
||||||
}
|
}
|
||||||
@@ -231,13 +231,13 @@ public class TaskAgvServiceImpl implements TaskAgvService{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void cancel(String id) throws Exception {
|
public void cancel(String id) throws Exception {
|
||||||
QueryInstructionPo po=new QueryInstructionPo();
|
|
||||||
po.setTask_id(id);
|
|
||||||
List<String> statusList=new ArrayList<>();
|
List<String> statusList=new ArrayList<>();
|
||||||
statusList.add(InstructionStatusEnum.READY.getIndex());
|
statusList.add(InstructionStatusEnum.READY.getIndex());
|
||||||
statusList.add(InstructionStatusEnum.BUSY.getIndex());
|
statusList.add(InstructionStatusEnum.BUSY.getIndex());
|
||||||
po.setInstructionAllStatus(statusList);
|
QueryWrapper<InstructionEntity> queryWrapper = new QueryWrapper<>();
|
||||||
List<InstructionEntity> list=instructionService.queryInstructionList(po);
|
queryWrapper.in("instruction_status",statusList);
|
||||||
|
queryWrapper.eq("task_id",id);
|
||||||
|
List<InstructionEntity> list= instructionService.selectList(queryWrapper);
|
||||||
if(!list.isEmpty()){
|
if(!list.isEmpty()){
|
||||||
throw new BadRequestException("有指令未完成!");
|
throw new BadRequestException("有指令未完成!");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ public class AutoCreateAgvInst {
|
|||||||
BeanUtils.copyProperties(taskEntity,instructionEntity);
|
BeanUtils.copyProperties(taskEntity,instructionEntity);
|
||||||
instructionEntity.setInstruction_type(taskEntity.getTask_type());
|
instructionEntity.setInstruction_type(taskEntity.getTask_type());
|
||||||
instructionEntity.setInstruction_id(IdUtil.simpleUUID());
|
instructionEntity.setInstruction_id(IdUtil.simpleUUID());
|
||||||
|
instructionEntity.setExecute_device_code(taskEntity.getStart_device_code());
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
instructionEntity.setCreate_time(now);
|
instructionEntity.setCreate_time(now);
|
||||||
instructionEntity.setCreate_by("auto");
|
instructionEntity.setCreate_by("auto");
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
server:
|
server:
|
||||||
port: 8010
|
port: 8011
|
||||||
#配置数据源
|
#配置数据源
|
||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
druid:
|
druid:
|
||||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||||
url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.4.121}:${DB_PORT:3306}/${DB_NAME:yy_lms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3307}/${DB_NAME:tekela_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||||
username: ${DB_USER:root}
|
username: ${DB_USER:root}
|
||||||
password: ${DB_PWD:123456}
|
password: ${DB_PWD:123456}
|
||||||
# 初始连接数
|
# 初始连接数
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
server:
|
server:
|
||||||
port: 8010
|
port: 8011
|
||||||
#配置数据源
|
#配置数据源
|
||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
druid:
|
druid:
|
||||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||||
url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.4.121}:${DB_PORT:3306}/${DB_NAME:yy_lms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3307}/${DB_NAME:tekela_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||||
username: ${DB_USER:root}
|
username: ${DB_USER:root}
|
||||||
password: ${DB_PWD:123456}
|
password: ${DB_PWD:123456}
|
||||||
# 初始连接数
|
# 初始连接数
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import javax.annotation.Generated;
|
|||||||
|
|
||||||
@Generated(
|
@Generated(
|
||||||
value = "org.mapstruct.ap.MappingProcessor",
|
value = "org.mapstruct.ap.MappingProcessor",
|
||||||
date = "2024-12-03T17:52:04+0800",
|
date = "2024-12-16T17:54:35+0800",
|
||||||
comments = "version: 1.2.0.Final, compiler: javac, environment: Java 1.8.0_291 (Oracle Corporation)"
|
comments = "version: 1.2.0.Final, compiler: javac, environment: Java 1.8.0_291 (Oracle Corporation)"
|
||||||
)
|
)
|
||||||
public class RedisConvertImpl implements RedisConvert {
|
public class RedisConvertImpl implements RedisConvert {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vue-cli-service serve",
|
"dev": "vue-cli-service serve",
|
||||||
"dev2": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
|
"dev2": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
|
||||||
"build:prod": "vue-cli-service build",
|
"build:prod": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
|
||||||
"build:stage": "vue-cli-service build --mode staging",
|
"build:stage": "vue-cli-service build --mode staging",
|
||||||
"preview": "node build/index.js --preview",
|
"preview": "node build/index.js --preview",
|
||||||
"lint": "eslint --ext .js,.vue src",
|
"lint": "eslint --ext .js,.vue src",
|
||||||
|
|||||||
@@ -484,12 +484,12 @@
|
|||||||
<el-table-column prop="next_point_code" :label="$t('task.select.Delivery_point')"
|
<el-table-column prop="next_point_code" :label="$t('task.select.Delivery_point')"
|
||||||
:min-width="flexWidth('next_point_code',crud.data,$t('task.select.Delivery_point'))"
|
:min-width="flexWidth('next_point_code',crud.data,$t('task.select.Delivery_point'))"
|
||||||
/>
|
/>
|
||||||
<el-table-column prop="next_point_code2" :label="$t('task.select.Delivery_point2')"
|
|
||||||
:min-width="flexWidth('next_point_code',crud.data,$t('task.select.Delivery_point2'))"
|
|
||||||
/>
|
|
||||||
<el-table-column prop="start_point_code2" :label="$t('task.select.Pickup_point2')"
|
<el-table-column prop="start_point_code2" :label="$t('task.select.Pickup_point2')"
|
||||||
:min-width="flexWidth('start_point_code',crud.data,$t('task.select.Pickup_point2'))"
|
:min-width="flexWidth('start_point_code',crud.data,$t('task.select.Pickup_point2'))"
|
||||||
/>
|
/>
|
||||||
|
<el-table-column prop="next_point_code2" :label="$t('task.select.Delivery_point2')"
|
||||||
|
:min-width="flexWidth('next_point_code',crud.data,$t('task.select.Delivery_point2'))"
|
||||||
|
/>
|
||||||
<!-- <el-table-column prop="agv_system_type" :label="$t('task.txt_box.AGV_system')" show-overflow-tooltip="true"-->
|
<!-- <el-table-column prop="agv_system_type" :label="$t('task.txt_box.AGV_system')" show-overflow-tooltip="true"-->
|
||||||
<!-- width="150px"-->
|
<!-- width="150px"-->
|
||||||
<!-- >-->
|
<!-- >-->
|
||||||
|
|||||||
Reference in New Issue
Block a user