优化调整
This commit is contained in:
@@ -103,9 +103,35 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ✅ Kotlin 核心标准库(必加) -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-jdk8</artifactId>
|
||||||
|
<version>1.9.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- ✅ Kotlin 反射(Spring Boot 配置绑定、@ConfigurationProperties、JSON 序列化必需) -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-reflect</artifactId>
|
||||||
|
<version>1.9.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- ✅ Kotlin 协程(后端异步编程、WebFlux、suspend Controller 必需) -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jetbrains.kotlinx</groupId>
|
||||||
|
<artifactId>kotlinx-coroutines-core</artifactId>
|
||||||
|
<version>1.9.0</version> <!-- ✅ 与 Kotlin 1.9.x 兼容 -->
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
||||||
|
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
|
||||||
|
<!-- <testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>-->
|
||||||
|
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
@@ -131,6 +157,48 @@
|
|||||||
<warName>${project.artifactId}</warName>
|
<warName>${project.artifactId}</warName>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
|
<!-- ✅ Kotlin Maven 插件 -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-maven-plugin</artifactId>
|
||||||
|
<version>1.9.0</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>compile</id>
|
||||||
|
<goals>
|
||||||
|
<goal>compile</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<sourceDirs>
|
||||||
|
<sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
|
||||||
|
<sourceDir>${project.basedir}/src/main/java</sourceDir>
|
||||||
|
</sourceDirs>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>test-compile</id>
|
||||||
|
<goals>
|
||||||
|
<goal>test-compile</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<sourceDirs>
|
||||||
|
<sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
|
||||||
|
<sourceDir>${project.basedir}/src/test/java</sourceDir>
|
||||||
|
</sourceDirs>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<source>16</source>
|
||||||
|
<target>16</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
</plugins>
|
</plugins>
|
||||||
<finalName>${project.artifactId}</finalName>
|
<finalName>${project.artifactId}</finalName>
|
||||||
</build>
|
</build>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
import org.springframework.scheduling.annotation.EnableAsync;
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
|
||||||
@@ -20,6 +21,10 @@ import javax.annotation.PostConstruct;
|
|||||||
@EnableScheduling
|
@EnableScheduling
|
||||||
@EnableAsync
|
@EnableAsync
|
||||||
@MapperScan("com.**.mapper")
|
@MapperScan("com.**.mapper")
|
||||||
|
@ComponentScan(basePackages = {
|
||||||
|
"com.ruoyi",
|
||||||
|
"kotlin"
|
||||||
|
})
|
||||||
public class RuoYiApplication
|
public class RuoYiApplication
|
||||||
{
|
{
|
||||||
public static void main(String[] args)
|
public static void main(String[] args)
|
||||||
@@ -27,6 +32,5 @@ public class RuoYiApplication
|
|||||||
// System.setProperty("spring.devtools.restart.enabled", "false");
|
// System.setProperty("spring.devtools.restart.enabled", "false");
|
||||||
SpringApplication.run(RuoYiApplication.class, args);
|
SpringApplication.run(RuoYiApplication.class, args);
|
||||||
System.out.println("(♥◠‿◠)ノ゙ 福来瑞达WCS系统启动成功 ლ(´ڡ`ლ)゙ ");
|
System.out.println("(♥◠‿◠)ノ゙ 福来瑞达WCS系统启动成功 ლ(´ڡ`ლ)゙ ");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import lombok.NoArgsConstructor;
|
|||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class taskFinishReceive {
|
public class TaskFinishReceive {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务类型(必填)
|
* 任务类型(必填)
|
||||||
@@ -19,7 +19,6 @@ import com.ruoyi.api.domain.agv.genAgvSchedulingTask.PositionCodeData;
|
|||||||
import com.ruoyi.api.domain.wcs2wms.JobParam;
|
import com.ruoyi.api.domain.wcs2wms.JobParam;
|
||||||
import com.ruoyi.api.domain.wcs2wms.ReceiveJob;
|
import com.ruoyi.api.domain.wcs2wms.ReceiveJob;
|
||||||
import com.ruoyi.api.domain.wcs2wms.ResponseResult;
|
import com.ruoyi.api.domain.wcs2wms.ResponseResult;
|
||||||
import com.ruoyi.api.domain.wcs2wms.exception.TaskExceptionReceive;
|
|
||||||
import com.ruoyi.api.domain.wcs2wms.exception.TaskExceptionRequest;
|
import com.ruoyi.api.domain.wcs2wms.exception.TaskExceptionRequest;
|
||||||
import com.ruoyi.api.domain.wcs2wms.stockout.StockoutReceive;
|
import com.ruoyi.api.domain.wcs2wms.stockout.StockoutReceive;
|
||||||
import com.ruoyi.api.service.IApiService;
|
import com.ruoyi.api.service.IApiService;
|
||||||
@@ -45,7 +44,6 @@ import java.util.Map;
|
|||||||
|
|
||||||
import static com.ruoyi.common.Constant.*;
|
import static com.ruoyi.common.Constant.*;
|
||||||
import static com.ruoyi.common.TaskStatusCode.TASK_EP_CREATE;
|
import static com.ruoyi.common.TaskStatusCode.TASK_EP_CREATE;
|
||||||
import static com.ruoyi.common.TaskStatusCode.TASK_EP_ROADWAY_SSJ;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 接口记录Service业务层处理
|
* 接口记录Service业务层处理
|
||||||
@@ -65,8 +63,6 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
private IMydoJobService mydoJobService;
|
private IMydoJobService mydoJobService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IWcsPortService wcsPortService;
|
private IWcsPortService wcsPortService;
|
||||||
@Autowired
|
|
||||||
private IBasCargoSpaceService basCargoSpaceService;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -448,6 +444,7 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @@@ FT568 请求wms获取入库任务参数 - 适应wms的自定义请求响应格式
|
* @@@ FT568 请求wms获取入库任务参数 - 适应wms的自定义请求响应格式
|
||||||
* @param param
|
* @param param
|
||||||
@@ -607,38 +604,21 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
@Override
|
@Override
|
||||||
public AjaxResult updateWcsPort(WcsPort wcsPort) {
|
public AjaxResult updateWcsPort(WcsPort wcsPort) {
|
||||||
int i = wcsPortService.updateWcsPort(wcsPort);
|
int i = wcsPortService.updateWcsPort(wcsPort);
|
||||||
if(i>0){
|
if(i > 0){
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}else{
|
}else{
|
||||||
return AjaxResult.error();
|
return AjaxResult.error();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//// @PostConstruct
|
@PostConstruct
|
||||||
// void qwe() {
|
void qwe() {
|
||||||
// HashMap<String, Object> map = new HashMap<>();
|
// LambdaQueryWrapper<MydoJob> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
// map.put("v_param", "RK");
|
// queryWrapper.eq(MydoJob::getTaskNo,"6666");
|
||||||
// mydoJobService.getJobId(map);
|
// MydoJob mydoJob = mydoJobMapper.selectOne(queryWrapper);
|
||||||
// String s = map.get("v_serial").toString();
|
|
||||||
// System.out.println(s);
|
|
||||||
//
|
}
|
||||||
//
|
|
||||||
// map.put("v_param", "CK");
|
|
||||||
// mydoJobService.getJobId(map);
|
|
||||||
// s = map.get("v_serial").toString();
|
|
||||||
// System.out.println(s);
|
|
||||||
//
|
|
||||||
// map.put("v_param", "2");
|
|
||||||
// mydoJobService.getTaskNo(map);
|
|
||||||
// s = map.get("v_serial").toString();
|
|
||||||
// System.out.println(s);
|
|
||||||
//
|
|
||||||
// map.put("v_param", "3");
|
|
||||||
// mydoJobService.getTaskNo(map);
|
|
||||||
// s = map.get("v_serial").toString();
|
|
||||||
// System.out.println(s);
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ package com.ruoyi.common;
|
|||||||
*/
|
*/
|
||||||
public class TaskStatusCode {
|
public class TaskStatusCode {
|
||||||
|
|
||||||
|
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 【任务状态】 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务状态-待执行
|
* 任务状态-待执行
|
||||||
*/
|
*/
|
||||||
@@ -30,36 +32,59 @@ public class TaskStatusCode {
|
|||||||
*/
|
*/
|
||||||
public static final String TASK_STATUS_INVALID = "5";
|
public static final String TASK_STATUS_INVALID = "5";
|
||||||
|
|
||||||
|
|
||||||
|
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 【执行阶段】 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务执行阶段 创建
|
* 任务执行阶段 任务已生成
|
||||||
*/
|
*/
|
||||||
public static final String TASK_EP_CREATE = "0";
|
public static final String TASK_EP_CREATE = "0";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务执行阶段 产线
|
* 任务执行阶段 产线输送到位
|
||||||
*/
|
*/
|
||||||
public static final String TASK_EP_LINE_SSJ = "1";
|
public static final String TASK_EP_LINE_SSJ = "1";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务执行阶段 AGV
|
* 任务执行阶段 AGV
|
||||||
*/
|
*/
|
||||||
public static final String TASK_EP_AGV = "2";
|
public static final String TASK_EP_AGV = "2";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务执行阶段 入口输送机
|
* 任务执行阶段 入口输送机
|
||||||
*/
|
*/
|
||||||
public static final String TASK_EP_SSJ = "3";
|
public static final String TASK_EP_SSJ = "3";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务执行阶段 巷道口
|
* 任务执行阶段 巷道口入库到位
|
||||||
*/
|
*/
|
||||||
public static final String TASK_EP_ROADWAY_SSJ = "4";
|
public static final String TASK_EP_ROADWAY_SSJ = "4";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务执行阶段 堆垛机
|
* 任务执行阶段 堆垛机执行
|
||||||
*/
|
*/
|
||||||
public static final String TASK_EP_DDJ = "5";
|
public static final String TASK_EP_DDJ = "5";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务执行阶段 堆垛机放货完成
|
||||||
|
*/
|
||||||
|
public static final String TASK_EP_DDJ_FINISH = "6";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务执行阶段 输送机出库到位-出库完成
|
||||||
|
*/
|
||||||
|
public static final String TASK_EP_SSJ_STOCKOUT_FINISH = "6";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务执行阶段 任务超时-自动结束当前任务
|
||||||
|
*/
|
||||||
|
public static final String TASK_EP_DDJ_FINISH_TIMEOUT = "6_TIMEOUT_FINISH";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务执行阶段 回传wms完成
|
* 任务执行阶段 回传wms完成
|
||||||
*/
|
*/
|
||||||
public static final String TASK_EP_WMS_FINISH = "6";
|
public static final String TASK_EP_WMS_FINISH = "9";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,22 @@
|
|||||||
package com.ruoyi.common;
|
package com.ruoyi.common;
|
||||||
|
|
||||||
public class TaskType {
|
/**
|
||||||
|
|
||||||
/**
|
|
||||||
* 堆垛机任务类型
|
* 堆垛机任务类型
|
||||||
*/
|
*/
|
||||||
//1-二楼入出
|
public class TaskType {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1-二楼入出
|
||||||
|
*/
|
||||||
public static final int DDJ_RWLX_1 = 1;
|
public static final int DDJ_RWLX_1 = 1;
|
||||||
//2-一楼出库
|
/**
|
||||||
|
* 2-一楼出库
|
||||||
|
*/
|
||||||
public static final int DDJ_RWLX_2 = 2;
|
public static final int DDJ_RWLX_2 = 2;
|
||||||
//3-一楼入库
|
/**
|
||||||
|
* 3-一楼入库
|
||||||
|
*/
|
||||||
public static final int DDJ_RWLX_3 = 3;
|
public static final int DDJ_RWLX_3 = 3;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.ruoyi.common;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wms自定义的任务类型
|
||||||
|
*/
|
||||||
|
public class WmsTaskTypeCode {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部wms定义的入库类型
|
||||||
|
*/
|
||||||
|
public static final String WMS_TASK_TYPE_STOCKIN = "1";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部wms定义的出库类型
|
||||||
|
*/
|
||||||
|
public static final String WMS_TASK_TYPE_STOCKOUT = "2";
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,6 +2,8 @@ package com.ruoyi.job.controller;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@@ -14,6 +16,9 @@ import com.ruoyi.job.service.IMydoJobService;
|
|||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
import static com.ruoyi.common.TaskStatusCode.TASK_EP_DDJ_FINISH;
|
||||||
|
import static com.ruoyi.common.TaskStatusCode.TASK_EP_SSJ_STOCKOUT_FINISH;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 作业信息Controller
|
* 作业信息Controller
|
||||||
*
|
*
|
||||||
@@ -114,4 +119,23 @@ public class MydoJobController extends BaseController
|
|||||||
{
|
{
|
||||||
return mydoJobService.OuthandFinish(jobIds);
|
return mydoJobService.OuthandFinish(jobIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理未正常移除的【堆垛机执行完成】或【出库到位】的遗留任务
|
||||||
|
*/
|
||||||
|
@Scheduled(fixedDelay = 3000)
|
||||||
|
public void mydoJobHandler() {
|
||||||
|
//此处堆垛机执行完成-【TASK_EP_DDJ_FINISH】或出库到位-【TASK_EP_SSJ_STOCKOUT_FINISH】的常量值相同,均可表示任务【已完成】
|
||||||
|
//用其中一种状态查询所有标记为【已完成】的任务
|
||||||
|
List<MydoJob> jobs = mydoJobService.selectMydoJobList(
|
||||||
|
new MydoJob().builder().executionPhase(TASK_EP_DDJ_FINISH).build()
|
||||||
|
);
|
||||||
|
if (!jobs.isEmpty()) {
|
||||||
|
for (MydoJob job : jobs) {
|
||||||
|
mydoJobService.taskFinish(Long.valueOf(job.getTaskNo()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,6 @@
|
|||||||
package com.ruoyi.job.domain;
|
package com.ruoyi.job.domain;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.*;
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.ToString;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
@@ -19,6 +14,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@ToString
|
@ToString
|
||||||
|
@Builder
|
||||||
public class JobCallBack extends BaseEntity
|
public class JobCallBack extends BaseEntity
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@@ -36,7 +32,7 @@ public class JobCallBack extends BaseEntity
|
|||||||
|
|
||||||
/** mydojob作业号 */
|
/** mydojob作业号 */
|
||||||
@Excel(name = "mydojob作业号")
|
@Excel(name = "mydojob作业号")
|
||||||
private String mydojobId;
|
private String mydoJobId;
|
||||||
|
|
||||||
/** 状态 */
|
/** 状态 */
|
||||||
@Excel(name = "状态")
|
@Excel(name = "状态")
|
||||||
|
|||||||
@@ -2,10 +2,7 @@ package com.ruoyi.job.domain;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.*;
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.ToString;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
@@ -23,6 +20,7 @@ import java.util.List;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@ToString
|
@ToString
|
||||||
|
@Builder
|
||||||
//@TableName("mydo_job_wcs")
|
//@TableName("mydo_job_wcs")
|
||||||
public class MydoJob extends BaseEntity
|
public class MydoJob extends BaseEntity
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import org.apache.ibatis.annotations.Param;
|
|||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
* @date 2025-09-22
|
* @date 2025-09-22
|
||||||
*/
|
*/
|
||||||
public interface MydoJobMapper extends BaseMapper<MydoJob>
|
public interface MydoJobMapper
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 查询作业信息
|
* 查询作业信息
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import org.apache.ibatis.annotations.Param;
|
|||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
* @date 2025-09-22
|
* @date 2025-09-22
|
||||||
*/
|
*/
|
||||||
public interface IMydoJobService extends IService<MydoJob>
|
public interface IMydoJobService
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 查询作业信息
|
* 查询作业信息
|
||||||
@@ -69,6 +69,8 @@ public interface IMydoJobService extends IService<MydoJob>
|
|||||||
|
|
||||||
boolean ddjTaskFinish(Long rwh, Integer id);
|
boolean ddjTaskFinish(Long rwh, Integer id);
|
||||||
|
|
||||||
|
boolean taskFinish(Long rwh);
|
||||||
|
|
||||||
boolean InvalidMydoJob(Long rwh, Integer id);
|
boolean InvalidMydoJob(Long rwh, Integer id);
|
||||||
|
|
||||||
MydoJob selectMydoJobByExitList(List<String> exitList);
|
MydoJob selectMydoJobByExitList(List<String> exitList);
|
||||||
|
|||||||
@@ -1,26 +1,24 @@
|
|||||||
package com.ruoyi.job.service.impl;
|
package com.ruoyi.job.service.impl;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.lang.UUID;
|
import cn.hutool.core.lang.UUID;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.job.domain.JobCallBack;
|
import com.ruoyi.job.domain.JobCallBack;
|
||||||
import com.ruoyi.job.service.IJobCallBackService;
|
import com.ruoyi.job.service.IJobCallBackService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.job.mapper.MydoJobMapper;
|
import com.ruoyi.job.mapper.MydoJobMapper;
|
||||||
import com.ruoyi.job.domain.MydoJob;
|
import com.ruoyi.job.domain.MydoJob;
|
||||||
import com.ruoyi.job.service.IMydoJobService;
|
import com.ruoyi.job.service.IMydoJobService;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import static com.ruoyi.common.WmsTaskTypeCode.WMS_TASK_TYPE_STOCKIN;
|
||||||
|
import static com.ruoyi.common.WmsTaskTypeCode.WMS_TASK_TYPE_STOCKOUT;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 作业信息Service业务层处理
|
* 作业信息Service业务层处理
|
||||||
@@ -29,7 +27,7 @@ import javax.annotation.PostConstruct;
|
|||||||
* @date 2025-09-22
|
* @date 2025-09-22
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class MydoJobServiceImpl extends ServiceImpl<MydoJobMapper, MydoJob> implements IMydoJobService
|
public class MydoJobServiceImpl implements IMydoJobService
|
||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
private MydoJobMapper mydoJobMapper;
|
private MydoJobMapper mydoJobMapper;
|
||||||
@@ -133,6 +131,24 @@ public class MydoJobServiceImpl extends ServiceImpl<MydoJobMapper, MydoJob> impl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean taskFinish(Long rwh) {
|
||||||
|
MydoJob task = selectMydoJobByTaskNo(rwh);
|
||||||
|
insertHistory(task.getJobId());
|
||||||
|
deleteMydoJobByJobId(task.getJobId());
|
||||||
|
JobCallBack jobCallBack = new JobCallBack();
|
||||||
|
jobCallBack.setType("2");
|
||||||
|
jobCallBack.setMydoJobId(task.getJobId());
|
||||||
|
jobCallBack.setStatus("0");
|
||||||
|
jobCallBack.setTaskNo(Convert.toLong(task.getTaskNo()));
|
||||||
|
jobCallBack.setCreateTime(new Date());
|
||||||
|
jobCallBack.setTaskTypeCode(Integer.valueOf(task.getInOrOut()) < 20 ? WMS_TASK_TYPE_STOCKIN : WMS_TASK_TYPE_STOCKOUT);//todo ???
|
||||||
|
jobCallBack.setReqCode(UUID.randomUUID().toString().replace("-", ""));
|
||||||
|
jobCallBack.setTaskCode(task.getWmsTaskNo());
|
||||||
|
jobCallBackService.insertJobCallBack(jobCallBack);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean InvalidMydoJob(Long rwh, Integer id) {
|
public boolean InvalidMydoJob(Long rwh, Integer id) {
|
||||||
HashMap<String, Object> map = new HashMap<>();
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
@@ -198,18 +214,19 @@ public class MydoJobServiceImpl extends ServiceImpl<MydoJobMapper, MydoJob> impl
|
|||||||
long jobIdNum = Long.parseLong(mydoJob.getInOrOut());
|
long jobIdNum = Long.parseLong(mydoJob.getInOrOut());
|
||||||
if (jobIdNum > 20){
|
if (jobIdNum > 20){
|
||||||
jobCallBack.setType("2");
|
jobCallBack.setType("2");
|
||||||
|
jobCallBack.setTaskTypeCode(WMS_TASK_TYPE_STOCKOUT);//todo wms下发的任务类型
|
||||||
}else{
|
}else{
|
||||||
jobCallBack.setType("1");
|
jobCallBack.setType("1");
|
||||||
|
jobCallBack.setTaskTypeCode(WMS_TASK_TYPE_STOCKIN);//todo wms下发的任务类型
|
||||||
}
|
}
|
||||||
|
|
||||||
jobCallBack.setMydojobId(mydoJob.getJobId());
|
jobCallBack.setMydoJobId(mydoJob.getJobId());
|
||||||
jobCallBack.setStatus("0");
|
jobCallBack.setStatus("0");
|
||||||
jobCallBack.setTaskNo(Convert.toLong(mydoJob.getTaskNo()));
|
jobCallBack.setTaskNo(Convert.toLong(mydoJob.getTaskNo()));
|
||||||
jobCallBack.setCreateTime(new Date());
|
jobCallBack.setCreateTime(new Date());
|
||||||
jobCallBack.setTaskCode(mydoJob.getWmsTaskNo());
|
jobCallBack.setTaskCode(mydoJob.getWmsTaskNo());
|
||||||
jobCallBack.setTaskTypeCode("");//todo wms下发的任务类型
|
|
||||||
jobCallBack.setReqCode(UUID.randomUUID().toString());
|
jobCallBack.setReqCode(UUID.randomUUID().toString());
|
||||||
// jobCallBack.setSpare1("0");
|
|
||||||
jobCallBackService.insertJobCallBack(jobCallBack);
|
jobCallBackService.insertJobCallBack(jobCallBack);
|
||||||
|
|
||||||
//移除实时任务
|
//移除实时任务
|
||||||
@@ -241,12 +258,10 @@ public class MydoJobServiceImpl extends ServiceImpl<MydoJobMapper, MydoJob> impl
|
|||||||
} else {
|
} else {
|
||||||
jobCallBack.setType("1");
|
jobCallBack.setType("1");
|
||||||
}
|
}
|
||||||
jobCallBack.setMydojobId(mydoJob.getJobId());
|
jobCallBack.setMydoJobId(mydoJob.getJobId());
|
||||||
jobCallBack.setStatus("0");
|
jobCallBack.setStatus("0");
|
||||||
jobCallBack.setTaskNo(Convert.toLong(taskNo));
|
jobCallBack.setTaskNo(Convert.toLong(taskNo));
|
||||||
jobCallBack.setCreateTime(new Date());
|
jobCallBack.setCreateTime(new Date());
|
||||||
|
|
||||||
// jobCallBack.setSpare1("0");
|
|
||||||
jobCallBackService.insertJobCallBack(jobCallBack);
|
jobCallBackService.insertJobCallBack(jobCallBack);
|
||||||
mydoJobMapper.deleteMydoJobByTaskNo(taskNo);
|
mydoJobMapper.deleteMydoJobByTaskNo(taskNo);
|
||||||
}
|
}
|
||||||
@@ -254,6 +269,7 @@ public class MydoJobServiceImpl extends ServiceImpl<MydoJobMapper, MydoJob> impl
|
|||||||
return AjaxResult.success("操作成功");
|
return AjaxResult.success("操作成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<MydoJob> getInJobByEntranceId(String exitId) {
|
public List<MydoJob> getInJobByEntranceId(String exitId) {
|
||||||
return mydoJobMapper.getInJobByEntranceId(exitId);
|
return mydoJobMapper.getInJobByEntranceId(exitId);
|
||||||
@@ -312,5 +328,4 @@ public class MydoJobServiceImpl extends ServiceImpl<MydoJobMapper, MydoJob> impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,14 @@ public interface DdjDeviceExecutionQueueFinishMapper
|
|||||||
*/
|
*/
|
||||||
public DdjDeviceExecutionQueueFinish selectDdjDeviceExecutionQueueFinishByUuid(String uuid);
|
public DdjDeviceExecutionQueueFinish selectDdjDeviceExecutionQueueFinishByUuid(String uuid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询堆垛机完成队列
|
||||||
|
*
|
||||||
|
* @param taskNo 堆垛机完成队列任务号
|
||||||
|
* @return 堆垛机完成队列
|
||||||
|
*/
|
||||||
|
public DdjDeviceExecutionQueueFinish selectDdjDeviceExecutionQueueFinishByTaskNo(String taskNo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询堆垛机完成队列列表
|
* 查询堆垛机完成队列列表
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -20,6 +20,14 @@ public interface DdjDeviceExecutionQueueMapper
|
|||||||
*/
|
*/
|
||||||
public DdjDeviceExecutionQueue selectDdjDeviceExecutionQueueByUuid(String uuid);
|
public DdjDeviceExecutionQueue selectDdjDeviceExecutionQueueByUuid(String uuid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询堆垛机执行队列
|
||||||
|
*
|
||||||
|
* @param taskNo 堆垛机执行队列主键
|
||||||
|
* @return 堆垛机执行队列
|
||||||
|
*/
|
||||||
|
public DdjDeviceExecutionQueue selectDdjDeviceExecutionQueueByTaskNo(String taskNo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询堆垛机执行队列列表
|
* 查询堆垛机执行队列列表
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ public interface IDdjDeviceExecutionQueueFinishService
|
|||||||
*/
|
*/
|
||||||
public DdjDeviceExecutionQueueFinish selectDdjDeviceExecutionQueueFinishByUuid(String uuid);
|
public DdjDeviceExecutionQueueFinish selectDdjDeviceExecutionQueueFinishByUuid(String uuid);
|
||||||
|
|
||||||
|
public DdjDeviceExecutionQueueFinish selectDdjDeviceExecutionQueueFinishByTaskNo(String taskNo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询堆垛机完成队列列表
|
* 查询堆垛机完成队列列表
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -19,6 +19,14 @@ public interface IDdjDeviceExecutionQueueService
|
|||||||
*/
|
*/
|
||||||
public DdjDeviceExecutionQueue selectDdjDeviceExecutionQueueByUuid(String uuid);
|
public DdjDeviceExecutionQueue selectDdjDeviceExecutionQueueByUuid(String uuid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询堆垛机执行队列
|
||||||
|
*
|
||||||
|
* @param TaskNo 堆垛机执行队列任务号
|
||||||
|
* @return 堆垛机执行队列
|
||||||
|
*/
|
||||||
|
public DdjDeviceExecutionQueue selectDdjDeviceExecutionQueueByTaskNo(String TaskNo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询堆垛机执行队列列表
|
* 查询堆垛机执行队列列表
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -31,6 +31,10 @@ public class DdjDeviceExecutionQueueFinishServiceImpl implements IDdjDeviceExecu
|
|||||||
return ddjDeviceExecutionQueueFinishMapper.selectDdjDeviceExecutionQueueFinishByUuid(uuid);
|
return ddjDeviceExecutionQueueFinishMapper.selectDdjDeviceExecutionQueueFinishByUuid(uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DdjDeviceExecutionQueueFinish selectDdjDeviceExecutionQueueFinishByTaskNo(String taskNo){
|
||||||
|
return ddjDeviceExecutionQueueFinishMapper.selectDdjDeviceExecutionQueueFinishByTaskNo(taskNo);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询堆垛机完成队列列表
|
* 查询堆垛机完成队列列表
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -31,6 +31,18 @@ public class DdjDeviceExecutionQueueServiceImpl implements IDdjDeviceExecutionQu
|
|||||||
return ddjDeviceExecutionQueueMapper.selectDdjDeviceExecutionQueueByUuid(uuid);
|
return ddjDeviceExecutionQueueMapper.selectDdjDeviceExecutionQueueByUuid(uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询堆垛机执行队列
|
||||||
|
*
|
||||||
|
* @param taskNo 堆垛机执行队列主键
|
||||||
|
* @return 堆垛机执行队列
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public DdjDeviceExecutionQueue selectDdjDeviceExecutionQueueByTaskNo(String taskNo)
|
||||||
|
{
|
||||||
|
return ddjDeviceExecutionQueueMapper.selectDdjDeviceExecutionQueueByTaskNo(taskNo);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询堆垛机执行队列列表
|
* 查询堆垛机执行队列列表
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static com.ruoyi.common.TaskExceptionType.TASK_EXCEPTION_STOCKIN_OCCUPIED;
|
import static com.ruoyi.common.TaskExceptionType.TASK_EXCEPTION_STOCKIN_OCCUPIED;
|
||||||
import static com.ruoyi.common.TaskExceptionType.TASK_EXCEPTION_STOCKOUT_EMPTY;
|
import static com.ruoyi.common.TaskStatusCode.TASK_EP_DDJ_FINISH;
|
||||||
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@@ -114,9 +114,12 @@ public class DdjThread implements Runnable {
|
|||||||
|
|
||||||
//满足上述条件,表示该任务已完成-执行任务回传
|
//满足上述条件,表示该任务已完成-执行任务回传
|
||||||
if (mydoJob != null && ddjDeviceExecutionQueue != null) {
|
if (mydoJob != null && ddjDeviceExecutionQueue != null) {
|
||||||
//回传完成信号
|
//标记为堆垛机执行完成
|
||||||
|
mydoJob.setExecutionPhase(TASK_EP_DDJ_FINISH);
|
||||||
|
mydoJobService.updateMydoJob(mydoJob);
|
||||||
|
//回传完成信号 - 方法在存储过程【proc_mydojob_finish】中
|
||||||
ddjTaskFinish(rwh, ddj.getId());
|
ddjTaskFinish(rwh, ddj.getId());
|
||||||
log.info("堆垛机:"+ddj.getId()+"任务完成,任务号:"+ddj.getRwh());
|
log.info("【堆垛机入库】堆垛机:"+ddj.getId()+"任务完成,任务号:"+ddj.getRwh());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,7 +174,7 @@ public class DdjThread implements Runnable {
|
|||||||
MydoJob wmsJob = new MydoJob();
|
MydoJob wmsJob = new MydoJob();
|
||||||
wmsJob.setInOrOut(mydoJobReAssign.getTaskCode());
|
wmsJob.setInOrOut(mydoJobReAssign.getTaskCode());
|
||||||
if (mydoJobService.selectMydoJobList(wmsJob).size() == 0) {
|
if (mydoJobService.selectMydoJobList(wmsJob).size() == 0) {
|
||||||
log.warn("该任务不存在,任务号:{}", mydoJobReAssign.getTaskCode());
|
log.warn("【响应异常】该任务不存在,任务号:{}", mydoJobReAssign.getTaskCode());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -257,9 +260,9 @@ public class DdjThread implements Runnable {
|
|||||||
ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||||
mydoJob.setFaultFlag("0");
|
mydoJob.setFaultFlag("0");
|
||||||
mydoJobService.updateMydoJob(mydoJob);
|
mydoJobService.updateMydoJob(mydoJob);
|
||||||
log.info("堆垛机放货目标有货,重分货位下发任务成功 rwh:{}", rwh);
|
log.info("【入库异常】堆垛机放货目标有货,重分货位下发任务成功 rwh:{}", rwh);
|
||||||
} else {
|
} else {
|
||||||
log.error("堆垛机放货目标有货,重分货位下发任务失败!!!!!!!");
|
log.error("【出库异常】堆垛机放货目标有货,重分货位下发任务失败!!!!!!!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -275,7 +278,7 @@ public class DdjThread implements Runnable {
|
|||||||
ddjDeviceExecutionQueueRunningParam.setDevId(ddj.getId());
|
ddjDeviceExecutionQueueRunningParam.setDevId(ddj.getId());
|
||||||
List<DdjDeviceExecutionQueue> ddjDeviceExecutionRunningQueues = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueList(ddjDeviceExecutionQueueRunningParam);
|
List<DdjDeviceExecutionQueue> ddjDeviceExecutionRunningQueues = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueList(ddjDeviceExecutionQueueRunningParam);
|
||||||
if (CollUtil.isNotEmpty(ddjDeviceExecutionRunningQueues)) {
|
if (CollUtil.isNotEmpty(ddjDeviceExecutionRunningQueues)) {
|
||||||
log.error("堆垛机有正在执行的任务 {}" , ddjDeviceExecutionRunningQueues.get(0).getRwh());
|
log.error("【提示】堆垛机有正在执行的任务 {}" , ddjDeviceExecutionRunningQueues.get(0).getRwh());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -294,9 +297,9 @@ public class DdjThread implements Runnable {
|
|||||||
ddjDeviceExecutionQueue.setXfsj(DateUtil.formatDateTime(DateUtil.date()));
|
ddjDeviceExecutionQueue.setXfsj(DateUtil.formatDateTime(DateUtil.date()));
|
||||||
ddjDeviceExecutionQueue.setDdjxf("1");
|
ddjDeviceExecutionQueue.setDdjxf("1");
|
||||||
ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||||
log.info("堆垛机下发任务成功 rwh:{}", ddjDeviceExecutionQueue.getRwh());
|
log.info("【执行成功】堆垛机下发任务成功 rwh:{}", ddjDeviceExecutionQueue.getRwh());
|
||||||
} else {
|
} else {
|
||||||
log.error("堆垛机下发任务失败!!!!!!!");
|
log.error("【执行异常】堆垛机下发任务失败!!!!!!!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -339,9 +342,9 @@ public class DdjThread implements Runnable {
|
|||||||
int mbch = Convert.toInt(queue.getMbch());
|
int mbch = Convert.toInt(queue.getMbch());
|
||||||
int mlfs = 5;
|
int mlfs = 5;
|
||||||
int xfwc = 1;
|
int xfwc = 1;
|
||||||
int hwlx = Convert.toInt(queue.getSpare1());
|
int rwlx = Convert.toInt(queue.getSpare1());
|
||||||
int jym = Tools.getJYM(taskNo, yph, ylh, ych, mbph, mblh, mbch, mlfs, hwlx);
|
int jym = Tools.getJYM(taskNo, yph, ylh, ych, mbph, mblh, mbch, mlfs, rwlx);
|
||||||
byte[] sendData = Tools.sendDataToDevice(taskNo, null, yph, ylh, ych, mbph, mblh, mbch, mlfs, hwlx, xfwc, jym);
|
byte[] sendData = Tools.sendDataToDevice(taskNo, null, yph, ylh, ych, mbph, mblh, mbch, mlfs, rwlx, xfwc, jym);
|
||||||
if (devId==1){
|
if (devId==1){
|
||||||
return PlcDdj1Read.WriteToDDJ("DB61.0", sendData);
|
return PlcDdj1Read.WriteToDDJ("DB61.0", sendData);
|
||||||
}else {
|
}else {
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.ruoyi.schedule.scheduleTask.ssj;
|
|||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.lang.UUID;
|
import cn.hutool.core.lang.UUID;
|
||||||
import cn.hutool.core.util.ObjUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.ruoyi.api.domain.wcs2wms.stockin.StockinReceive;
|
import com.ruoyi.api.domain.wcs2wms.stockin.StockinReceive;
|
||||||
import com.ruoyi.api.service.IApiService;
|
import com.ruoyi.api.service.IApiService;
|
||||||
@@ -17,20 +16,23 @@ import com.ruoyi.job.domain.JobCallBack;
|
|||||||
import com.ruoyi.job.domain.MydoJob;
|
import com.ruoyi.job.domain.MydoJob;
|
||||||
import com.ruoyi.job.service.IJobCallBackService;
|
import com.ruoyi.job.service.IJobCallBackService;
|
||||||
import com.ruoyi.job.service.IMydoJobService;
|
import com.ruoyi.job.service.IMydoJobService;
|
||||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
|
||||||
import com.ruoyi.queue.agv.service.IAgvQueueService;
|
|
||||||
import com.ruoyi.schedule.plcRead.ssj.PlcSsjRead;
|
import com.ruoyi.schedule.plcRead.ssj.PlcSsjRead;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.net.InetSocketAddress;
|
||||||
|
import java.net.Socket;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import static com.ruoyi.common.TaskStatusCode.*;
|
import static com.ruoyi.common.TaskStatusCode.*;
|
||||||
|
import static com.ruoyi.common.WmsTaskTypeCode.WMS_TASK_TYPE_STOCKIN;
|
||||||
|
import static com.ruoyi.common.WmsTaskTypeCode.WMS_TASK_TYPE_STOCKOUT;
|
||||||
import static com.ruoyi.schedule.plcRead.ssj.PlcSsjRead.writeToSsj;
|
import static com.ruoyi.schedule.plcRead.ssj.PlcSsjRead.writeToSsj;
|
||||||
import static com.ruoyi.schedule.plcRead.ssj.PlcSsjRead.writeToSsjQH;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 出入口输送线线程
|
* 出入口输送线线程
|
||||||
@@ -137,6 +139,7 @@ public class PortConvThread implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求wms获取wcs任务参数
|
* 请求wms获取wcs任务参数
|
||||||
* @param inSsjDevice
|
* @param inSsjDevice
|
||||||
@@ -152,12 +155,12 @@ public class PortConvThread implements Runnable {
|
|||||||
|
|
||||||
//请求参数
|
//请求参数
|
||||||
HashMap<String, Object> paramMap = new HashMap<>();
|
HashMap<String, Object> paramMap = new HashMap<>();
|
||||||
paramMap.put("taskTypeCode", "inBound");//任务类型编号
|
paramMap.put("taskTypeCode", WMS_TASK_TYPE_STOCKIN);//todo wms自定义的任务类型编号
|
||||||
paramMap.put("reqCode", UUID.randomUUID().toString());//请求码
|
paramMap.put("reqCode", UUID.randomUUID().toString());//请求码
|
||||||
paramMap.put("cntCode", inSsjDevice.getTrayCode());//容器编号
|
paramMap.put("cntCode", inSsjDevice.getTrayCode());//容器编号
|
||||||
String height = inSsjDevice.getHeight();
|
String height = inSsjDevice.getHeight();
|
||||||
String weight = inSsjDevice.getWeight();
|
// String weight = inSsjDevice.getWeight();//todo 需要直读重量或从plc读值?
|
||||||
paramMap.put("weight", weight);//重量
|
paramMap.put("weight", getWeight(MOXA_IP, MOXA_PORT, SO_TIMEOUT_MS));//重量
|
||||||
paramMap.put("altimetry", height);//高度
|
paramMap.put("altimetry", height);//高度
|
||||||
String errorMessage = "";
|
String errorMessage = "";
|
||||||
|
|
||||||
@@ -221,14 +224,14 @@ public class PortConvThread implements Runnable {
|
|||||||
mydoJob.setWmsTaskNo(result.getTaskCode());
|
mydoJob.setWmsTaskNo(result.getTaskCode());
|
||||||
mydoJob.setJobId(mydoJobService.getJobId("RK"));
|
mydoJob.setJobId(mydoJobService.getJobId("RK"));
|
||||||
mydoJob.setTaskNo(mydoJobService.getTaskNo("1"));
|
mydoJob.setTaskNo(mydoJobService.getTaskNo("1"));
|
||||||
// mydoJob.setTaskNo(result.getTaskCode());//todo 确定是否用获取的任务号作为wcs的任务号
|
// mydoJob.setTaskNo(result.getTaskCode());//需要确定是否用获取的任务号作为wcs的任务号
|
||||||
|
|
||||||
//校验:wms分配的货位(排列层)是否合法
|
//校验:wms分配的货位(排列层)是否合法
|
||||||
if (result.getSiteCode() == null || result.getSiteCode().isEmpty()) {
|
if (result.getSiteCode() == null || result.getSiteCode().isEmpty()) {
|
||||||
log.info("【请求参数异常】分配货位:null,无法生成作业,托盘条码:{}",inSsjDevice.getTrayCode());
|
log.info("【请求参数异常】分配货位:null,无法生成作业,托盘条码:{}",inSsjDevice.getTrayCode());
|
||||||
return;
|
return;
|
||||||
}else {
|
}else {
|
||||||
mydoJob.setRoadwayId(basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId()).getRoadwayId());
|
// mydoJob.setRoadwayId(basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId()).getRoadwayId());
|
||||||
}
|
}
|
||||||
|
|
||||||
mydoJob.setStatus("1");
|
mydoJob.setStatus("1");
|
||||||
@@ -291,30 +294,87 @@ public class PortConvThread implements Runnable {
|
|||||||
* @param inSsjDevice
|
* @param inSsjDevice
|
||||||
*/
|
*/
|
||||||
private void finishStockoutMydoJob(DeviceSsj inSsjDevice){
|
private void finishStockoutMydoJob(DeviceSsj inSsjDevice){
|
||||||
//出库到位
|
//出库到位
|
||||||
if (inSsjDevice.getDw() == 1 && inSsjDevice.getTaskNo() > 0) {
|
if (inSsjDevice.getDw() == 1 && inSsjDevice.getTaskNo() > 0) {
|
||||||
//查询该出库任务
|
//查询该出库任务
|
||||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(inSsjDevice.getTaskNo()));
|
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(inSsjDevice.getTaskNo()));
|
||||||
if (mydoJob != null && Integer.parseInt(mydoJob.getInOrOut()) > 20) {
|
if (mydoJob != null && Integer.parseInt(mydoJob.getInOrOut()) > 20) {
|
||||||
log.info("【出库到位】设备:{},位置:{},任务号:{},出库到位", "输送线:", inSsjDevice.getDeviceCode(), mydoJob.getTaskNo());
|
log.info("【出库到位】设备:{},位置:{},任务号:{},出库到位", "输送线:", inSsjDevice.getDeviceCode(), mydoJob.getTaskNo());
|
||||||
mydoJobService.insertHistory(mydoJob.getJobId());
|
mydoJob.setExecutionPhase(TASK_EP_SSJ_STOCKOUT_FINISH);
|
||||||
mydoJobService.deleteMydoJobByJobId(mydoJob.getJobId());
|
mydoJobService.updateMydoJob(mydoJob);
|
||||||
JobCallBack jobCallBack = new JobCallBack();
|
mydoJobService.taskFinish(Long.valueOf(mydoJob.getTaskNo()));
|
||||||
jobCallBack.setType("2");
|
|
||||||
jobCallBack.setMydojobId(mydoJob.getJobId());
|
|
||||||
jobCallBack.setStatus("0");
|
|
||||||
jobCallBack.setTaskNo(Convert.toLong(mydoJob.getTaskNo()));
|
|
||||||
jobCallBack.setCreateTime(new Date());
|
|
||||||
jobCallBack.setTaskTypeCode("");//todo ???
|
|
||||||
jobCallBack.setReqCode(UUID.randomUUID().toString().replace("-", ""));
|
|
||||||
jobCallBack.setTaskCode(mydoJob.getWmsTaskNo());
|
|
||||||
// jobCallBack.setSpare1("0");
|
|
||||||
jobCallBackService.insertJobCallBack(jobCallBack);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ====== 【请按实际修改】======
|
||||||
|
private static final String MOXA_IP = "192.168.1.200"; // NPort 5110 的 IP
|
||||||
|
private static final int MOXA_PORT = 4001; // NPort 配置的 Local Port
|
||||||
|
private static final int RECONNECT_DELAY_SEC = 3; // 断线后重试间隔(秒)
|
||||||
|
private static final int SO_TIMEOUT_MS = 5000; // Socket 读超时(防卡死)
|
||||||
|
private static final Pattern WEIGHT_PATTERN = Pattern.compile(
|
||||||
|
"[+-]?\\d+\\.\\d{1,3}(?=[\\s\\r\\n]|kg|g|lb|$)"); // 匹配如 +12.34、-5.678、345.0kg
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从 MOXA NPort 5110(TCP Server 模式)读取单次称重值
|
||||||
|
*
|
||||||
|
* @param moxaIp MOXA 设备 IP(如 "192.168.1.200")
|
||||||
|
* @param moxaPort MOXA 配置的 TCP 端口(如 4001)
|
||||||
|
* @param timeout 最大等待时间(单位:毫秒),建议 2000~5000
|
||||||
|
* @return 重量(kg),成功时为非 NaN 的 Double;失败(超时/断连/解析失败)返回 null
|
||||||
|
*/
|
||||||
|
public static Double getWeight(String moxaIp, int moxaPort, long timeout) {
|
||||||
|
Socket socket = null;
|
||||||
|
try {
|
||||||
|
// 1️⃣ - 建立连接(带连接超时)
|
||||||
|
socket = new Socket();
|
||||||
|
socket.connect(new InetSocketAddress(moxaIp, moxaPort), 3000); // 连接超时 3s
|
||||||
|
socket.setSoTimeout((int) Math.min(timeout, Integer.MAX_VALUE)); // 读超时
|
||||||
|
|
||||||
|
// 2 - 发送请求指令(可选:仅当秤需指令才启用)
|
||||||
|
// OutputStream out = socket.getOutputStream();
|
||||||
|
// out.write("\r\n".getBytes(StandardCharsets.US_ASCII)); // 或 "\r", "W\r\n"
|
||||||
|
// out.flush();
|
||||||
|
|
||||||
|
// 3 - 读响应(使用 BufferedInputStream + 手动读字节,更健壮于无换行场景)
|
||||||
|
InputStream in = socket.getInputStream();
|
||||||
|
byte[] buffer = new byte[128];
|
||||||
|
int len = in.read(buffer);
|
||||||
|
if (len <= 0) return null;
|
||||||
|
|
||||||
|
String response = new String(buffer, 0, len, StandardCharsets.US_ASCII).trim();
|
||||||
|
if (response.isEmpty()) return null;
|
||||||
|
|
||||||
|
// 4 - 解析重量(兼容常见格式:+12.34、-5.678、00012.34kg、123.45\r\n)
|
||||||
|
Pattern p = Pattern.compile("[+-]?\\d*\\.?\\d+(?=[\\s\\r\\n]|kg|g|lb|$)");
|
||||||
|
java.util.regex.Matcher m = p.matcher(response);
|
||||||
|
if (m.find()) {
|
||||||
|
try {
|
||||||
|
double w = Double.parseDouble(m.group());
|
||||||
|
// 过滤明显异常值(可选)
|
||||||
|
if (Double.isFinite(w) && Math.abs(w) < 1e6) {
|
||||||
|
return w;
|
||||||
|
}
|
||||||
|
} catch (NumberFormatException ignored) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
|
||||||
|
} catch (IOException e) {
|
||||||
|
return null; // 连接失败、读超时、解析异常等均返回 null
|
||||||
|
} finally {
|
||||||
|
if (socket != null && !socket.isClosed()) {
|
||||||
|
try { socket.close(); } catch (IOException ignored) {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void inDispatch1(DeviceSsj ssjDevice) {
|
public void inDispatch1(DeviceSsj ssjDevice) {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import static com.ruoyi.common.TaskStatusCode.*;
|
import static com.ruoyi.common.TaskStatusCode.*;
|
||||||
import static com.ruoyi.common.TaskType.DDJ_RWLX_1;
|
import static com.ruoyi.common.TaskType.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 巷道口输送机(堆垛机取放位)线程 检测当前巷道有没有入库作业,没有作业,生成堆垛机出库队列
|
* 巷道口输送机(堆垛机取放位)线程 检测当前巷道有没有入库作业,没有作业,生成堆垛机出库队列
|
||||||
@@ -106,30 +106,29 @@ public class RoadConvThread implements Runnable {
|
|||||||
*/
|
*/
|
||||||
private void sendStackerIn(DeviceSsj roadSsjDevice){
|
private void sendStackerIn(DeviceSsj roadSsjDevice){
|
||||||
//模拟数据
|
//模拟数据
|
||||||
roadSsjDevice.setDw(1);
|
// roadSsjDevice.setDw(1);
|
||||||
roadSsjDevice.setTaskNo(85012);
|
// roadSsjDevice.setTaskNo(85012);
|
||||||
|
|
||||||
//---------------------------入库任务---------------------------
|
//---------------------------入库任务---------------------------
|
||||||
//巷道口输送机到位,且任务号大于1000
|
//巷道口输送机到位,且任务号大于1000
|
||||||
if (roadSsjDevice.getDw()==1 && roadSsjDevice.getTaskNo()>1000) {
|
if (roadSsjDevice.getDw()==1 && roadSsjDevice.getTaskNo()>1000) {
|
||||||
|
|
||||||
//查找当前执行的入库任务
|
//根据输送机【任务号】查找当前执行的入库任务
|
||||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(roadSsjDevice.getTaskNo()));
|
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(roadSsjDevice.getTaskNo()));
|
||||||
if(ObjUtil.isNotNull(mydoJob)){
|
if(ObjUtil.isNotNull(mydoJob)){
|
||||||
|
|
||||||
//更新任务阶段: 入口输送机 → 巷道口入库到位
|
//如果任务存在 - 表示该任务已经巷道口输送到位
|
||||||
|
//更新任务阶段【巷道口入库到位】
|
||||||
if(mydoJob.getExecutionPhase().equals(TASK_EP_SSJ)){
|
if(mydoJob.getExecutionPhase().equals(TASK_EP_SSJ)){
|
||||||
mydoJob.setExecutionPhase(TASK_EP_ROADWAY_SSJ);
|
mydoJob.setExecutionPhase(TASK_EP_ROADWAY_SSJ);
|
||||||
mydoJobService.updateMydoJob(mydoJob);
|
mydoJobService.updateMydoJob(mydoJob);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查任务属性:【任务已存在】、执行阶段-【巷道口输送机到位】、任务类型-【入库】
|
// 检查任务属性:【任务已存在】、执行阶段-【巷道口输送机到位】、任务类型-【入库】 → 下发堆垛机执行队列
|
||||||
// 下发堆垛机执行队列
|
if (mydoJob.getExecutionPhase().equals(TASK_EP_ROADWAY_SSJ) && Convert.toInt(mydoJob.getInOrOut()) < 20) {
|
||||||
if (ObjUtil.isNotNull(mydoJob)
|
|
||||||
&& mydoJob.getExecutionPhase().equals(TASK_EP_ROADWAY_SSJ)
|
|
||||||
&& Convert.toInt(mydoJob.getInOrOut()) < 20) {
|
|
||||||
|
|
||||||
//检查堆垛机是否在正在执行中
|
//检查堆垛机是否在正在执行中/已经有执行队列
|
||||||
List<DdjDeviceExecutionQueue> ddjDeviceExecutionQueues = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueListByRwlx(DDJ_RWLX_1, Convert.toInt(mydoJob.getRoadwayId()));
|
List<DdjDeviceExecutionQueue> ddjDeviceExecutionQueues = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueListByRwlx(DDJ_RWLX_3, Convert.toInt(mydoJob.getRoadwayId()));
|
||||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
|
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||||
List<Integer> pclList = roadwayMap.get(roadSsjDevice.getDeviceCode());
|
List<Integer> pclList = roadwayMap.get(roadSsjDevice.getDeviceCode());
|
||||||
|
|
||||||
@@ -149,9 +148,9 @@ public class RoadConvThread implements Runnable {
|
|||||||
ddjDeviceExecutionQueue.setMbch(Convert.toInt(basCargoSpace.getTheFloor()));
|
ddjDeviceExecutionQueue.setMbch(Convert.toInt(basCargoSpace.getTheFloor()));
|
||||||
ddjDeviceExecutionQueue.setDdjxf("0");
|
ddjDeviceExecutionQueue.setDdjxf("0");
|
||||||
ddjDeviceExecutionQueue.setMlfs(5);
|
ddjDeviceExecutionQueue.setMlfs(5);
|
||||||
ddjDeviceExecutionQueue.setSpare1(mydoJob.getTraySize());
|
// ddjDeviceExecutionQueue.setSpare1(mydoJob.getTraySize());
|
||||||
ddjDeviceExecutionQueue.setScsj(DateUtil.formatDateTime(DateUtil.date()));
|
ddjDeviceExecutionQueue.setScsj(DateUtil.formatDateTime(DateUtil.date()));
|
||||||
ddjDeviceExecutionQueue.setRwlx(DDJ_RWLX_1);
|
ddjDeviceExecutionQueue.setRwlx(DDJ_RWLX_3);
|
||||||
ddjDeviceExecutionQueueService.insertDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
ddjDeviceExecutionQueueService.insertDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||||
|
|
||||||
//下发后更新任务阶段
|
//下发后更新任务阶段
|
||||||
@@ -188,7 +187,7 @@ public class RoadConvThread implements Runnable {
|
|||||||
log.error("【任务异常】货位不存在 cargoSpaceId{}", mydoJob.getCargoSpaceId());
|
log.error("【任务异常】货位不存在 cargoSpaceId{}", mydoJob.getCargoSpaceId());
|
||||||
} else {
|
} else {
|
||||||
//生成队列
|
//生成队列
|
||||||
List<DdjDeviceExecutionQueue> list = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueListByRwlx(DDJ_RWLX_1, Convert.toInt(mydoJob.getRoadwayId()));
|
List<DdjDeviceExecutionQueue> list = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueListByRwlx(DDJ_RWLX_2, Convert.toInt(mydoJob.getRoadwayId()));
|
||||||
List<Integer> pclList = roadwayMap.get(roadSsjDevice.getDeviceCode());
|
List<Integer> pclList = roadwayMap.get(roadSsjDevice.getDeviceCode());
|
||||||
if (CollUtil.isEmpty(list) && CollUtil.isNotEmpty(pclList)) {
|
if (CollUtil.isEmpty(list) && CollUtil.isNotEmpty(pclList)) {
|
||||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = new DdjDeviceExecutionQueue();
|
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = new DdjDeviceExecutionQueue();
|
||||||
@@ -207,7 +206,7 @@ public class RoadConvThread implements Runnable {
|
|||||||
ddjDeviceExecutionQueue.setMlfs(5);
|
ddjDeviceExecutionQueue.setMlfs(5);
|
||||||
ddjDeviceExecutionQueue.setSpare1(mydoJob.getTraySize());
|
ddjDeviceExecutionQueue.setSpare1(mydoJob.getTraySize());
|
||||||
ddjDeviceExecutionQueue.setScsj(DateUtil.formatDateTime(DateUtil.date()));
|
ddjDeviceExecutionQueue.setScsj(DateUtil.formatDateTime(DateUtil.date()));
|
||||||
ddjDeviceExecutionQueue.setRwlx(DDJ_RWLX_1);
|
ddjDeviceExecutionQueue.setRwlx(DDJ_RWLX_2);
|
||||||
ddjDeviceExecutionQueueService.insertDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
ddjDeviceExecutionQueueService.insertDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||||
|
|
||||||
//修改作业状态
|
//修改作业状态
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ logging:
|
|||||||
user:
|
user:
|
||||||
password:
|
password:
|
||||||
# 密码最大错误次数
|
# 密码最大错误次数
|
||||||
maxRetryCount: 5
|
maxRetryCount: 10
|
||||||
# 密码锁定时间(默认10分钟)
|
# 密码锁定时间(默认10分钟)
|
||||||
lockTime: 10
|
lockTime: 10
|
||||||
|
|
||||||
@@ -107,6 +107,18 @@ mybatis:
|
|||||||
# 加载全局的配置文件
|
# 加载全局的配置文件
|
||||||
configLocation: classpath:mybatis/mybatis-config.xml
|
configLocation: classpath:mybatis/mybatis-config.xml
|
||||||
|
|
||||||
|
#MybatisPlus
|
||||||
|
#mybatis-plus:
|
||||||
|
# # Mapper XML 扫描路径(若你用了 XML)
|
||||||
|
# mapper-locations: classpath*:mapper/**/*Mapper.xml
|
||||||
|
# # 实体类别名包(让 XML 中能用 User 而非全限定名)
|
||||||
|
# type-aliases-package: com.ruoyi.**.domain
|
||||||
|
# configuration:
|
||||||
|
# map-underscore-to-camel-case: true
|
||||||
|
# cache-enabled: false
|
||||||
|
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
|
# interceptor: com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor
|
||||||
|
|
||||||
# PageHelper分页插件
|
# PageHelper分页插件
|
||||||
pagehelper:
|
pagehelper:
|
||||||
helperDialect: sqlserver
|
helperDialect: sqlserver
|
||||||
@@ -128,3 +140,4 @@ xss:
|
|||||||
excludes: /system/notice
|
excludes: /system/notice
|
||||||
# 匹配链接
|
# 匹配链接
|
||||||
urlPatterns: /system/*,/monitor/*,/tool/*
|
urlPatterns: /system/*,/monitor/*,/tool/*
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="id" column="id" />
|
<result property="id" column="id" />
|
||||||
<result property="type" column="type" />
|
<result property="type" column="type" />
|
||||||
<result property="taskNo" column="task_no" />
|
<result property="taskNo" column="task_no" />
|
||||||
<result property="mydojobId" column="mydojob_id" />
|
<result property="mydoJobId" column="mydoJob_Id" />
|
||||||
<result property="status" column="status" />
|
<result property="status" column="status" />
|
||||||
<result property="createTime" column="create_time" />
|
<result property="createTime" column="create_time" />
|
||||||
<result property="reqCode" column="req_code" />
|
<result property="reqCode" column="req_code" />
|
||||||
@@ -17,7 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectJobCallBackVo">
|
<sql id="selectJobCallBackVo">
|
||||||
select id, type, task_no, mydojob_id, status, create_time,req_code,task_type_code,task_code from job_call_back
|
select id, type, task_no, mydoJob_Id, status, create_time,req_code,task_type_code,task_code from job_call_back
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectJobCallBackList" parameterType="JobCallBack" resultMap="JobCallBackResult">
|
<select id="selectJobCallBackList" parameterType="JobCallBack" resultMap="JobCallBackResult">
|
||||||
@@ -25,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<where>
|
<where>
|
||||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||||
<if test="taskNo != null "> and task_no = #{taskNo}</if>
|
<if test="taskNo != null "> and task_no = #{taskNo}</if>
|
||||||
<if test="mydojobId != null and mydojobId != ''"> and mydojob_id = #{mydojobId}</if>
|
<if test="mydoJobId != null and mydoJobId != ''"> and mydoJob_Id = #{mydoJobId}</if>
|
||||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||||
<if test="reqCode != null and reqCode != ''"> and req_code = #{reqCode}</if>
|
<if test="reqCode != null and reqCode != ''"> and req_code = #{reqCode}</if>
|
||||||
<if test="taskTypeCode != null and taskTypeCode != ''"> and task_type_code = #{taskTypeCode}</if>
|
<if test="taskTypeCode != null and taskTypeCode != ''"> and task_type_code = #{taskTypeCode}</if>
|
||||||
@@ -47,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="type != null">type,</if>
|
<if test="type != null">type,</if>
|
||||||
<if test="taskNo != null">task_no,</if>
|
<if test="taskNo != null">task_no,</if>
|
||||||
<if test="mydojobId != null">mydojob_id,</if>
|
<if test="mydoJobId != null">mydoJob_Id,</if>
|
||||||
<if test="status != null">status,</if>
|
<if test="status != null">status,</if>
|
||||||
<if test="createTime != null">create_time,</if>
|
<if test="createTime != null">create_time,</if>
|
||||||
<if test="reqCode != null">req_code,</if>
|
<if test="reqCode != null">req_code,</if>
|
||||||
@@ -57,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="type != null">#{type},</if>
|
<if test="type != null">#{type},</if>
|
||||||
<if test="taskNo != null">#{taskNo},</if>
|
<if test="taskNo != null">#{taskNo},</if>
|
||||||
<if test="mydojobId != null">#{mydojobId},</if>
|
<if test="mydoJobId != null">#{mydoJobId},</if>
|
||||||
<if test="status != null">#{status},</if>
|
<if test="status != null">#{status},</if>
|
||||||
<if test="createTime != null">#{createTime},</if>
|
<if test="createTime != null">#{createTime},</if>
|
||||||
<if test="reqCode != null">#{reqCode},</if>
|
<if test="reqCode != null">#{reqCode},</if>
|
||||||
@@ -71,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="type != null">type = #{type},</if>
|
<if test="type != null">type = #{type},</if>
|
||||||
<if test="taskNo != null">task_no = #{taskNo},</if>
|
<if test="taskNo != null">task_no = #{taskNo},</if>
|
||||||
<if test="mydojobId != null">mydojob_id = #{mydojobId},</if>
|
<if test="mydoJobId != null">mydoJob_Id = #{mydoJobId},</if>
|
||||||
<if test="status != null">status = #{status},</if>
|
<if test="status != null">status = #{status},</if>
|
||||||
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
<if test="reqCode != null">req_code = #{reqCode},</if>
|
<if test="reqCode != null">req_code = #{reqCode},</if>
|
||||||
@@ -93,7 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="getTopJobCallBack" resultMap="JobCallBackResult">
|
<select id="getTopJobCallBack" resultMap="JobCallBackResult">
|
||||||
select top(1) id, type, task_no, mydojob_id, status, create_time,req_code,task_type_code,task_code from job_call_back
|
select top(1) id, type, task_no, mydoJob_Id, status, create_time,req_code,task_type_code,task_code from job_call_back
|
||||||
where status = '0' and spare1 in ('0','1','2')
|
where status = '0' and spare1 in ('0','1','2')
|
||||||
order by create_time asc
|
order by create_time asc
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -61,6 +61,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
where uuid = #{uuid}
|
where uuid = #{uuid}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectDdjDeviceExecutionQueueFinishByTaskNo" parameterType="String" resultMap="DdjDeviceExecutionQueueFinishResult">
|
||||||
|
<include refid="selectDdjDeviceExecutionQueueFinishVo"/>
|
||||||
|
where rwh = #{taskNo}
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertDdjDeviceExecutionQueueFinish" parameterType="DdjDeviceExecutionQueueFinish">
|
<insert id="insertDdjDeviceExecutionQueueFinish" parameterType="DdjDeviceExecutionQueueFinish">
|
||||||
insert into ddj_device_execution_queue_finish
|
insert into ddj_device_execution_queue_finish
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
|||||||
@@ -61,6 +61,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<include refid="selectDdjDeviceExecutionQueueVo"/>
|
<include refid="selectDdjDeviceExecutionQueueVo"/>
|
||||||
where uuid = #{uuid}
|
where uuid = #{uuid}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectDdjDeviceExecutionQueueByTaskNo" parameterType="String" resultMap="DdjDeviceExecutionQueueResult">
|
||||||
|
<include refid="selectDdjDeviceExecutionQueueVo"/>
|
||||||
|
where rwh = #{taskNo}
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="selectDdjDeviceExecutionQueueListByRwlx"
|
<select id="selectDdjDeviceExecutionQueueListByRwlx"
|
||||||
resultMap="DdjDeviceExecutionQueueResult">
|
resultMap="DdjDeviceExecutionQueueResult">
|
||||||
<include refid="selectDdjDeviceExecutionQueueVo"/>
|
<include refid="selectDdjDeviceExecutionQueueVo"/>
|
||||||
|
|||||||
@@ -129,6 +129,12 @@
|
|||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-annotation</artifactId>
|
||||||
|
<version>3.5.14</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -88,7 +88,7 @@
|
|||||||
<el-table v-loading="loading" :data="jobCallBackList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="jobCallBackList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center"/>
|
<el-table-column type="selection" width="55" align="center"/>
|
||||||
<el-table-column label="主键" align="center" prop="id"/>
|
<el-table-column label="主键" align="center" prop="id"/>
|
||||||
<el-table-column label="作业ID" align="center" prop="mydojobId"/>
|
<el-table-column label="作业ID" align="center" prop="mydoJobId"/>
|
||||||
<el-table-column label="任务号" align="center" prop="taskNo"/>
|
<el-table-column label="任务号" align="center" prop="taskNo"/>
|
||||||
<el-table-column label="任务类型" align="center" prop="type">
|
<el-table-column label="任务类型" align="center" prop="type">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@@ -139,7 +139,7 @@
|
|||||||
<el-input v-model="form.id" placeholder="请输入主键" style="width: 240px" disabled/>
|
<el-input v-model="form.id" placeholder="请输入主键" style="width: 240px" disabled/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="作业ID" prop="jobId">
|
<el-form-item label="作业ID" prop="jobId">
|
||||||
<el-input v-model="form.mydojobId" placeholder="请输入作业ID" style="width: 240px"/>
|
<el-input v-model="form.mydoJobId" placeholder="请输入作业ID" style="width: 240px"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="任务号" prop="taskNo">
|
<el-form-item label="任务号" prop="taskNo">
|
||||||
<el-input v-model="form.taskNo" placeholder="请输入任务号" style="width: 240px"/>
|
<el-input v-model="form.taskNo" placeholder="请输入任务号" style="width: 240px"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user