Compare commits
3 Commits
24fb696a67
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
004c8740b1 | ||
|
|
652607ce15 | ||
|
|
3f38269a1f |
2
pom.xml
2
pom.xml
@@ -37,7 +37,7 @@
|
|||||||
<spring-framework.version>5.3.39</spring-framework.version>
|
<spring-framework.version>5.3.39</spring-framework.version>
|
||||||
<hutool.version>5.8.27</hutool.version>
|
<hutool.version>5.8.27</hutool.version>
|
||||||
<lombok.version>1.18.30</lombok.version>
|
<lombok.version>1.18.30</lombok.version>
|
||||||
<HslCommunication.version>3.7.0</HslCommunication.version>
|
<HslCommunication.version>2.0.0</HslCommunication.version>
|
||||||
<mybatis-plus.version>3.5.2</mybatis-plus.version>
|
<mybatis-plus.version>3.5.2</mybatis-plus.version>
|
||||||
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|||||||
21
ruoyi-admin/src/main/java/com/ruoyi/MyStartupRunner.java
Normal file
21
ruoyi-admin/src/main/java/com/ruoyi/MyStartupRunner.java
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
package com.ruoyi;
|
||||||
|
|
||||||
|
import com.ruoyi.schedule.ScheduleThread;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.CommandLineRunner;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class MyStartupRunner implements CommandLineRunner {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ScheduleThread scheduleThread;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(String... args) throws Exception {
|
||||||
|
// 这里编写项目启动后要执行的方法逻辑
|
||||||
|
//System.out.println("项目启动成功后自动执行此方法");
|
||||||
|
// scheduleThread.startAllThread();
|
||||||
|
// scheduleThread.startAllThread2();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi;
|
package com.ruoyi;
|
||||||
|
|
||||||
|
import com.ruoyi.schedule.ScheduleThread;
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
@@ -7,6 +8,8 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
|||||||
import org.springframework.scheduling.annotation.EnableAsync;
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 启动程序
|
* 启动程序
|
||||||
*
|
*
|
||||||
@@ -17,6 +20,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
|||||||
@EnableAsync
|
@EnableAsync
|
||||||
public class RuoYiApplication
|
public class RuoYiApplication
|
||||||
{
|
{
|
||||||
|
|
||||||
public static void main(String[] args)
|
public static void main(String[] args)
|
||||||
{
|
{
|
||||||
// System.setProperty("spring.devtools.restart.enabled", "false");
|
// System.setProperty("spring.devtools.restart.enabled", "false");
|
||||||
|
|||||||
@@ -1,30 +1,43 @@
|
|||||||
package com.ruoyi.api.controller;
|
package com.ruoyi.api.controller;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import com.mchange.v2.lang.ObjectUtils;
|
||||||
import com.ruoyi.api.domain.agv.agvCallback.AgvCallbackRequest;
|
import com.ruoyi.api.domain.agv.agvCallback.AgvCallbackRequest;
|
||||||
import com.ruoyi.api.domain.agv.agvCallback.AgvCallbackResponse;
|
import com.ruoyi.api.domain.agv.agvCallback.AgvCallbackResponse;
|
||||||
import com.ruoyi.api.service.IApiService;
|
import com.ruoyi.api.service.IApiService;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.queue.agv.service.impl.AgvQueueServiceImpl;
|
||||||
|
import com.ruoyi.system.domain.AgvContainerTask;
|
||||||
|
import com.ruoyi.system.mapper.AgvContainerTaskMapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Agv操作请求
|
* Agv操作请求
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/agv/api")
|
@RequestMapping("/api/agv")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class AgvController extends BaseController {
|
public class AgvController extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IApiService apiService;
|
private IApiService apiService;
|
||||||
|
@Autowired
|
||||||
|
private AgvQueueServiceImpl agvQueueService;
|
||||||
|
@Autowired
|
||||||
|
private AgvContainerTaskMapper agvContainerTaskMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* agv执行状态返回接口
|
* agv执行状态返回接口
|
||||||
|
*
|
||||||
* @param request
|
* @param request
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -34,15 +47,14 @@ public class AgvController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* agv搬运作业
|
* agv搬运作业
|
||||||
* @param param{
|
*
|
||||||
* startPoint:起始点
|
* @param param{ startPoint:起始点
|
||||||
* endPoint:结束点
|
* endPoint:结束点
|
||||||
* containerCode:容器编号
|
* containerCode:容器编号
|
||||||
* taskNo:任务号
|
* taskNo:任务号
|
||||||
* }
|
* }
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/receiveAgvMoveJob")
|
@PostMapping("/receiveAgvMoveJob")
|
||||||
@@ -50,4 +62,98 @@ public class AgvController extends BaseController {
|
|||||||
return apiService.receiveAgvMoveJob(param);
|
return apiService.receiveAgvMoveJob(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取AGV任务定时器
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Scheduled(fixedDelay = 5000)
|
||||||
|
public void queryAgvMoveJob() {
|
||||||
|
apiService.sendContarTask();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Scheduled(fixedDelay = 5000)
|
||||||
|
public void finishAgvMoveJob() {
|
||||||
|
AgvContainerTask agvContainerTask= agvContainerTaskMapper.selectAgvContainerFinishOne();
|
||||||
|
if (agvContainerTask!=null){
|
||||||
|
apiService.finishAgvJob(agvContainerTask.getContainer());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**任务下发
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Scheduled(fixedDelay = 1000)
|
||||||
|
public void sendAgvMoveJob() {
|
||||||
|
AgvContainerTask agvContainerTask = new AgvContainerTask();
|
||||||
|
agvContainerTask.setStatus("0");
|
||||||
|
List<AgvContainerTask> agvContainerTasks = agvContainerTaskMapper.selectAgvContainerTaskList(agvContainerTask);
|
||||||
|
if (agvContainerTasks.size() > 0) {
|
||||||
|
AgvContainerTask agvContainerTask1 = agvContainerTasks.get(0);
|
||||||
|
Map<String, String> param = new HashMap<>();
|
||||||
|
param.put("FromStation", agvContainerTask1.getStartPoint());
|
||||||
|
param.put("ToStation", agvContainerTask1.getEndPoint());
|
||||||
|
param.put("Type", agvContainerTask1.getSpare1());
|
||||||
|
param.put("OrderId", agvContainerTask1.getContainer());
|
||||||
|
// param.put("TaskGuideId", agvContainerTask1.getTaskNo());
|
||||||
|
AjaxResult ajaxResult = apiService.sendAgvCar(param);
|
||||||
|
Integer code = (Integer) ajaxResult.get("code");
|
||||||
|
if (200 == code) {
|
||||||
|
agvContainerTask1.setStatus("1");
|
||||||
|
agvContainerTaskMapper.updateAgvContainerTask(agvContainerTask1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 请求取货放货接口
|
||||||
|
* @param jsonObject
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/checkAllow")
|
||||||
|
public AjaxResult checkAllow(@RequestBody JSONObject jsonObject) {
|
||||||
|
// 取放货站点
|
||||||
|
String requestStation = String.valueOf(jsonObject.get("requestStation"));
|
||||||
|
// 表内主键
|
||||||
|
String orderId = String.valueOf(jsonObject.get("orderId"));
|
||||||
|
String Type = String.valueOf(jsonObject.get("type"));
|
||||||
|
|
||||||
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
|
map.put("v_position", requestStation);
|
||||||
|
map.put("v_orderId", orderId);
|
||||||
|
map.put("v_type", Type);
|
||||||
|
agvQueueService.selectKx(map);
|
||||||
|
Integer vResult = (Integer) map.get("v_result");
|
||||||
|
if (vResult == 1) {
|
||||||
|
return new AjaxResult(1, Type.equals("1") ? "允许取货" : "允许放货");
|
||||||
|
} else {
|
||||||
|
return new AjaxResult(0, Type.equals("1") ? "不允许取货,请等待" : "不允许放货,请等待");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取货放货完成返回接口
|
||||||
|
*
|
||||||
|
* @param jsonObject
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/completionSignal")
|
||||||
|
public AjaxResult completionSignal(@RequestBody JSONObject jsonObject) {
|
||||||
|
|
||||||
|
String orderId = String.valueOf(jsonObject.get("orderId"));
|
||||||
|
String Type = String.valueOf(jsonObject.get("type"));
|
||||||
|
|
||||||
|
|
||||||
|
agvContainerTaskMapper.updateAgvContainerTaskByOrder(orderId);
|
||||||
|
// agvContainerTaskMapper.insertAgvContainerTaskFinish(orderId);
|
||||||
|
// agvContainerTaskMapper.deleteAgvContainerTaskByContainer(orderId);
|
||||||
|
|
||||||
|
return new AjaxResult(1, "返回成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
package com.ruoyi.api.controller;
|
package com.ruoyi.api.controller;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
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.service.IApiService;
|
import com.ruoyi.api.service.IApiService;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@@ -53,4 +55,5 @@ public class Wcs2WmsController {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,4 +136,18 @@ public interface IApiService
|
|||||||
AjaxResult allotSpace(JobParam jobParam);
|
AjaxResult allotSpace(JobParam jobParam);
|
||||||
|
|
||||||
AjaxResult JobFinish(Map<String, Object> param);
|
AjaxResult JobFinish(Map<String, Object> param);
|
||||||
|
|
||||||
|
AjaxResult OutMakeSure(HashMap<String, Object> map);
|
||||||
|
|
||||||
|
void updateLed(HashMap<String, Object> objectObjectHashMap);
|
||||||
|
|
||||||
|
void updateLedError(HashMap<String, Object> objectObjectHashMap);
|
||||||
|
|
||||||
|
void sendContarTask();
|
||||||
|
|
||||||
|
AjaxResult sendAgvCar(Map<String, String> param);
|
||||||
|
|
||||||
|
AjaxResult insertAgvQuene(HashMap<String, Object> objectObjectHashMap);
|
||||||
|
|
||||||
|
void finishAgvJob(String container);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,4 +75,6 @@ public interface IRequestLogService
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public RequestLog getRequestLog(String url, String param);
|
public RequestLog getRequestLog(String url, String param);
|
||||||
|
|
||||||
|
public RequestLog getRequestLogs(String url, String param, String endPoint);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ import com.ruoyi.job.domain.MydoJob;
|
|||||||
import com.ruoyi.job.service.IMydoJobService;
|
import com.ruoyi.job.service.IMydoJobService;
|
||||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||||
import com.ruoyi.queue.agv.service.IAgvQueueService;
|
import com.ruoyi.queue.agv.service.IAgvQueueService;
|
||||||
|
import com.ruoyi.system.domain.AgvContainerTask;
|
||||||
|
import com.ruoyi.system.service.IAgvContainerTaskService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -51,7 +53,8 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
private IAgvQueueService agvQueueService;
|
private IAgvQueueService agvQueueService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IMydoJobService mydoJobService;
|
private IMydoJobService mydoJobService;
|
||||||
|
@Autowired
|
||||||
|
private IAgvContainerTaskService agvContainerTaskService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -138,10 +141,6 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理agv状态返回
|
* 处理agv状态返回
|
||||||
*
|
*
|
||||||
@@ -196,26 +195,24 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
public AjaxResult cancelMydoJob(JobParam jobParam) {
|
public AjaxResult cancelMydoJob(JobParam jobParam) {
|
||||||
|
|
||||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(jobParam.getTaskNo()));
|
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(jobParam.getTaskNo()));
|
||||||
if(mydoJob==null){
|
if (mydoJob == null) {
|
||||||
return AjaxResult.error("任务不存在");
|
return AjaxResult.error("任务不存在");
|
||||||
}
|
}
|
||||||
if("1".equals(mydoJob.getStatus())){
|
if ("1".equals(mydoJob.getStatus())) {
|
||||||
mydoJob.setStatus("5");
|
mydoJob.setStatus("5");
|
||||||
mydoJobService.insertHistory(mydoJob.getJobId());
|
mydoJobService.insertHistory(mydoJob.getJobId());
|
||||||
mydoJobService.deleteMydoJobByJobId(mydoJob.getJobId());
|
mydoJobService.deleteMydoJobByJobId(mydoJob.getJobId());
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}else{
|
} else {
|
||||||
return AjaxResult.error("任务已开始");
|
return AjaxResult.error("任务已开始");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult reAssign(JobParam jobParam) {
|
public AjaxResult reAssign(JobParam jobParam) {
|
||||||
RequestLog requestLog = requestLogService.getRequestLog(RE_ASSIGN_URL, "重新分配货位", JSONUtil.toJsonStr(jobParam));
|
RequestLog requestLog = requestLogService.getRequestLog(RE_ASSIGN_URL, "重新分配货位", JSONUtil.toJsonStr(jobParam));
|
||||||
if ("1".equals(requestLog.getIsSuccessful())){
|
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||||
InterfaceReceive bean = JSONUtil.toBean(requestLog.getResponseBody(), InterfaceReceive.class);
|
InterfaceReceive bean = JSONUtil.toBean(requestLog.getResponseBody(), InterfaceReceive.class);
|
||||||
MydoJob wmsMydoJob = BeanUtil.toBean(bean.getData(), MydoJob.class);
|
MydoJob wmsMydoJob = BeanUtil.toBean(bean.getData(), MydoJob.class);
|
||||||
MydoJob mydoJob = mydoJobService.selectMydoJobByJobId(wmsMydoJob.getJobId());
|
MydoJob mydoJob = mydoJobService.selectMydoJobByJobId(wmsMydoJob.getJobId());
|
||||||
@@ -229,7 +226,7 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
@Override
|
@Override
|
||||||
public AjaxResult reMaterial(JobParam jobParam) {
|
public AjaxResult reMaterial(JobParam jobParam) {
|
||||||
RequestLog requestLog = requestLogService.getRequestLog(RE_MATERIAL_URL, "重新分配物料", JSONUtil.toJsonStr(jobParam));
|
RequestLog requestLog = requestLogService.getRequestLog(RE_MATERIAL_URL, "重新分配物料", JSONUtil.toJsonStr(jobParam));
|
||||||
if ("1".equals(requestLog.getIsSuccessful())){
|
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
return AjaxResult.error();
|
return AjaxResult.error();
|
||||||
@@ -360,7 +357,6 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult receiveOutMydoJob(ReceiveJob receiveOutJob) {
|
public AjaxResult receiveOutMydoJob(ReceiveJob receiveOutJob) {
|
||||||
MydoJob mydoJob = new MydoJob();
|
MydoJob mydoJob = new MydoJob();
|
||||||
@@ -380,7 +376,7 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
int i = mydoJobService.insertMydoJob(mydoJob);
|
int i = mydoJobService.insertMydoJob(mydoJob);
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}else{
|
} else {
|
||||||
return AjaxResult.error();
|
return AjaxResult.error();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -402,7 +398,7 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
int i = mydoJobService.insertMydoJob(mydoJob);
|
int i = mydoJobService.insertMydoJob(mydoJob);
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}else{
|
} else {
|
||||||
return AjaxResult.error();
|
return AjaxResult.error();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -447,4 +443,74 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult OutMakeSure(HashMap<String, Object> map) {
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLog(OUT_MAKE_SURE, "线边直出请求过账", JSONUtil.toJsonStr(map));
|
||||||
|
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||||
|
InterfaceReceive bean = JSONUtil.toBean(requestLog.getResponseBody(), InterfaceReceive.class);
|
||||||
|
return AjaxResult.success(bean.getData());
|
||||||
|
} else {
|
||||||
|
return AjaxResult.error();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateLed(HashMap<String, Object> map) {
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLog(UPDATE_LED, "出库到位更新LED", JSONUtil.toJsonStr(map));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateLedError(HashMap<String, Object> map) {
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLog(UPDATE_LED_ERROR, "更新线体报错信息", JSONUtil.toJsonStr(map));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sendContarTask() {
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLog(QUERY_AGV_QUENE, "请求获取AGV执行队列", JSONUtil.toJsonStr(""));
|
||||||
|
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||||
|
InterfaceReceive bean = JSONUtil.toBean(requestLog.getResponseBody(), InterfaceReceive.class);
|
||||||
|
AgvContainerTask bean1 = BeanUtil.toBean(bean.getData(), AgvContainerTask.class);
|
||||||
|
bean1.setStatus("0");
|
||||||
|
agvContainerTaskService.insertAgvContainerTask(bean1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult sendAgvCar(Map<String, String> param) {
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLogs(SEND_AGV_CAR, "下发AGV执行对列", JSONUtil.toJsonStr(param));
|
||||||
|
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
{
|
||||||
|
return AjaxResult.error();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult insertAgvQuene(HashMap<String, Object> param) {
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLog(INSERT_AGV_QUENE, "请求自动生成AGV执行队列", JSONUtil.toJsonStr(param));
|
||||||
|
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
{
|
||||||
|
return AjaxResult.error();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void finishAgvJob(String container) {
|
||||||
|
HashMap<Object, Object> objectObjectHashMap = new HashMap<>();
|
||||||
|
objectObjectHashMap.put("order", container);
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLog(FINISH_AGV_QUENE, "完成AGV执行队列", JSONUtil.toJsonStr(objectObjectHashMap));
|
||||||
|
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||||
|
|
||||||
|
agvContainerTaskService.deleteAgvContainerTaskByOrderId(container);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import java.util.List;
|
|||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.date.DateUnit;
|
import cn.hutool.core.date.DateUnit;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.http.ContentType;
|
||||||
|
import cn.hutool.http.HttpResponse;
|
||||||
import cn.hutool.http.HttpUtil;
|
import cn.hutool.http.HttpUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.ruoyi.api.domain.InterfaceReceive;
|
import com.ruoyi.api.domain.InterfaceReceive;
|
||||||
@@ -24,8 +26,7 @@ import com.ruoyi.api.service.IRequestLogService;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class RequestLogServiceImpl implements IRequestLogService
|
public class RequestLogServiceImpl implements IRequestLogService {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RequestLogMapper requestLogMapper;
|
private RequestLogMapper requestLogMapper;
|
||||||
|
|
||||||
@@ -36,8 +37,7 @@ public class RequestLogServiceImpl implements IRequestLogService
|
|||||||
* @return 接口记录
|
* @return 接口记录
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public RequestLog selectRequestLogByRequestId(Long requestId)
|
public RequestLog selectRequestLogByRequestId(Long requestId) {
|
||||||
{
|
|
||||||
return requestLogMapper.selectRequestLogByRequestId(requestId);
|
return requestLogMapper.selectRequestLogByRequestId(requestId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,8 +48,7 @@ public class RequestLogServiceImpl implements IRequestLogService
|
|||||||
* @return 接口记录
|
* @return 接口记录
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<RequestLog> selectRequestLogList(RequestLog requestLog)
|
public List<RequestLog> selectRequestLogList(RequestLog requestLog) {
|
||||||
{
|
|
||||||
return requestLogMapper.selectRequestLogList(requestLog);
|
return requestLogMapper.selectRequestLogList(requestLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,11 +59,10 @@ public class RequestLogServiceImpl implements IRequestLogService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertRequestLog(RequestLog requestLog)
|
public int insertRequestLog(RequestLog requestLog) {
|
||||||
{
|
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||||
if ("1".equals(requestLog.getIsSuccessful())){
|
|
||||||
return requestLogMapper.insertRequestLog(requestLog);
|
return requestLogMapper.insertRequestLog(requestLog);
|
||||||
}else {
|
} else {
|
||||||
//log.error("请求失败:" + requestLog.getErrorDetails());
|
//log.error("请求失败:" + requestLog.getErrorDetails());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -77,8 +75,7 @@ public class RequestLogServiceImpl implements IRequestLogService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateRequestLog(RequestLog requestLog)
|
public int updateRequestLog(RequestLog requestLog) {
|
||||||
{
|
|
||||||
return requestLogMapper.updateRequestLog(requestLog);
|
return requestLogMapper.updateRequestLog(requestLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,8 +86,7 @@ public class RequestLogServiceImpl implements IRequestLogService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteRequestLogByRequestIds(Long[] requestIds)
|
public int deleteRequestLogByRequestIds(Long[] requestIds) {
|
||||||
{
|
|
||||||
return requestLogMapper.deleteRequestLogByRequestIds(requestIds);
|
return requestLogMapper.deleteRequestLogByRequestIds(requestIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,8 +97,7 @@ public class RequestLogServiceImpl implements IRequestLogService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteRequestLogByRequestId(Long requestId)
|
public int deleteRequestLogByRequestId(Long requestId) {
|
||||||
{
|
|
||||||
return requestLogMapper.deleteRequestLogByRequestId(requestId);
|
return requestLogMapper.deleteRequestLogByRequestId(requestId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,7 +110,7 @@ public class RequestLogServiceImpl implements IRequestLogService
|
|||||||
* @return requestLog
|
* @return requestLog
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public RequestLog getRequestLog(String url, String endPoint,String param) {
|
public RequestLog getRequestLog(String url, String endPoint, String param) {
|
||||||
RequestLog requestLog = new RequestLog();
|
RequestLog requestLog = new RequestLog();
|
||||||
Date requestTime = new Date();
|
Date requestTime = new Date();
|
||||||
requestLog.setRequestTime(DateUtil.format(requestTime, "yyyy-MM-dd HH:mm:ss"));
|
requestLog.setRequestTime(DateUtil.format(requestTime, "yyyy-MM-dd HH:mm:ss"));
|
||||||
@@ -128,15 +123,17 @@ public class RequestLogServiceImpl implements IRequestLogService
|
|||||||
requestLog.setRequestUrl(url);
|
requestLog.setRequestUrl(url);
|
||||||
try {
|
try {
|
||||||
String resStr = HttpUtil.post(url, param);
|
String resStr = HttpUtil.post(url, param);
|
||||||
|
|
||||||
requestLog.setResponseBody(resStr);
|
requestLog.setResponseBody(resStr);
|
||||||
|
|
||||||
InterfaceReceive bean = JSONUtil.toBean(resStr, InterfaceReceive.class);
|
InterfaceReceive bean = JSONUtil.toBean(resStr, InterfaceReceive.class);
|
||||||
Date responseTime =new Date();
|
Date responseTime = new Date();
|
||||||
if (bean.getCode() == 200) {
|
if (bean.getCode() == 200) {
|
||||||
requestLog.setResponseTime(DateUtil.format(responseTime, "yyyy-MM-dd HH:mm:ss"));
|
requestLog.setResponseTime(DateUtil.format(responseTime, "yyyy-MM-dd HH:mm:ss"));
|
||||||
requestLog.setResponseStatus("1");
|
requestLog.setResponseStatus("1");
|
||||||
requestLog.setDuration(Convert.toStr(DateUtil.between(requestTime, responseTime, DateUnit.MS)));
|
requestLog.setDuration(Convert.toStr(DateUtil.between(requestTime, responseTime, DateUnit.MS)));
|
||||||
requestLog.setIsSuccessful("1");
|
requestLog.setIsSuccessful("1");
|
||||||
}else {
|
} else {
|
||||||
requestLog.setResponseStatus("0");
|
requestLog.setResponseStatus("0");
|
||||||
requestLog.setErrorDetails(bean.getMsg());
|
requestLog.setErrorDetails(bean.getMsg());
|
||||||
requestLog.setIsSuccessful("0");
|
requestLog.setIsSuccessful("0");
|
||||||
@@ -171,4 +168,46 @@ public class RequestLogServiceImpl implements IRequestLogService
|
|||||||
requestLog.setDuration(Convert.toStr(DateUtil.between(requestTime, requestTime, DateUnit.MS)));
|
requestLog.setDuration(Convert.toStr(DateUtil.between(requestTime, requestTime, DateUnit.MS)));
|
||||||
return requestLog;
|
return requestLog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RequestLog getRequestLogs(String url, String param, String endPoint) {
|
||||||
|
RequestLog requestLog = new RequestLog();
|
||||||
|
Date requestTime = new Date();
|
||||||
|
requestLog.setRequestTime(DateUtil.format(requestTime, "yyyy-MM-dd HH:mm:ss"));
|
||||||
|
requestLog.setSourceSystem("wcs");
|
||||||
|
requestLog.setTargetSystem("wms");
|
||||||
|
requestLog.setEndpoint(param);
|
||||||
|
requestLog.setRequestMethod("post");
|
||||||
|
requestLog.setRequestHeaders(null);
|
||||||
|
requestLog.setRequestBody(endPoint);
|
||||||
|
requestLog.setRequestUrl(url);
|
||||||
|
try {
|
||||||
|
// 链式创建POST请求,获取完整响应对象
|
||||||
|
HttpResponse response = HttpUtil.createPost(url)
|
||||||
|
.body(endPoint, "application/json") // 传入表单参数
|
||||||
|
.execute();
|
||||||
|
String body = response.body();
|
||||||
|
int status = response.getStatus();
|
||||||
|
InterfaceReceive bean = JSONUtil.toBean(body, InterfaceReceive.class);
|
||||||
|
Date responseTime = new Date();
|
||||||
|
if (status == 200) {
|
||||||
|
requestLog.setResponseTime(DateUtil.format(responseTime, "yyyy-MM-dd HH:mm:ss"));
|
||||||
|
requestLog.setResponseStatus("1");
|
||||||
|
requestLog.setDuration(Convert.toStr(DateUtil.between(requestTime, responseTime, DateUnit.MS)));
|
||||||
|
requestLog.setIsSuccessful("1");
|
||||||
|
} else {
|
||||||
|
requestLog.setResponseStatus("0");
|
||||||
|
requestLog.setErrorDetails(bean.getMsg());
|
||||||
|
requestLog.setIsSuccessful("0");
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
requestLog.setErrorDetails(e.getMessage());
|
||||||
|
requestLog.setIsSuccessful("0");
|
||||||
|
requestLog.setResponseStatus("0");
|
||||||
|
} finally {
|
||||||
|
insertRequestLog(requestLog);
|
||||||
|
}
|
||||||
|
return requestLog;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ public class RoadCacheServiceImpl implements RoadCacheService {
|
|||||||
HashSet<String> otherCarSiteList = new HashSet<>();
|
HashSet<String> otherCarSiteList = new HashSet<>();
|
||||||
for (WcsSrgvQueue wcsSrgvQueue : otherCarQueue) {
|
for (WcsSrgvQueue wcsSrgvQueue : otherCarQueue) {
|
||||||
if (wcsSrgvQueue.getPathInfo() != null) {
|
if (wcsSrgvQueue.getPathInfo() != null) {
|
||||||
//根据小车当前点位去除已走路径
|
//根据小车当前点位去除已走路径 除了当前点和上一个点之外都解锁
|
||||||
DeviceSrgv otherCarCurrStatus = deviceSrgvService.selectDeviceSrgvByGuid(wcsSrgvQueue.getAgvId());
|
DeviceSrgv otherCarCurrStatus = deviceSrgvService.selectDeviceSrgvByGuid(wcsSrgvQueue.getAgvId());
|
||||||
String currSite = otherCarCurrStatus.getCurrSite();
|
String currSite = otherCarCurrStatus.getCurrSite();
|
||||||
List<String> allSiteList = Arrays.asList(wcsSrgvQueue.getPathInfo().split(","));
|
List<String> allSiteList = Arrays.asList(wcsSrgvQueue.getPathInfo().split(","));
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ package com.ruoyi.common;
|
|||||||
public class Constant {
|
public class Constant {
|
||||||
|
|
||||||
public static final String WMS_BASE_URL = "http://localhost:8080/api2wms/";
|
public static final String WMS_BASE_URL = "http://localhost:8080/api2wms/";
|
||||||
public static final String RCS_BASE_URL = "http://127.0.0.1:8081/rcms-dps/rest/";
|
public static final String RCS_BASE_URL = "http://192.168.188.251:9501/";
|
||||||
|
public static final String WMS_BASE_PDA_URL = "http://localhost:8080/pda/";
|
||||||
|
|
||||||
public static final String JOB_FINISH_URL = WMS_BASE_URL+"jobFinish";
|
public static final String JOB_FINISH_URL = WMS_BASE_URL+"jobFinish";
|
||||||
public static final String CONTINUE_TASK_URL = RCS_BASE_URL+"continueTask";
|
public static final String CONTINUE_TASK_URL = RCS_BASE_URL+"continueTask";
|
||||||
@@ -17,8 +17,13 @@ public class Constant {
|
|||||||
public static final String RE_ASSIGN_URL = WMS_BASE_URL+"reAssign";
|
public static final String RE_ASSIGN_URL = WMS_BASE_URL+"reAssign";
|
||||||
public static final String RE_MATERIAL_URL = WMS_BASE_URL+"reMaterial";
|
public static final String RE_MATERIAL_URL = WMS_BASE_URL+"reMaterial";
|
||||||
public static final String REQUEST_ENTER_URL = WMS_BASE_URL+"requestEnterByTrayCodeAndEntranceId";
|
public static final String REQUEST_ENTER_URL = WMS_BASE_URL+"requestEnterByTrayCodeAndEntranceId";
|
||||||
|
public static final String OUT_MAKE_SURE=WMS_BASE_PDA_URL+"outMakeSure";
|
||||||
|
public static final String UPDATE_LED=WMS_BASE_URL+"updateLed";
|
||||||
|
public static final String QUERY_AGV_QUENE=WMS_BASE_URL+"queryAgvQuene";
|
||||||
|
public static final String FINISH_AGV_QUENE=WMS_BASE_URL+"finishAgvQuene";
|
||||||
|
public static final String SEND_AGV_CAR=RCS_BASE_URL+"api/app/agvs-task";
|
||||||
|
public static final String INSERT_AGV_QUENE=WMS_BASE_URL+"insertAgvQuene";
|
||||||
|
public static final String UPDATE_LED_ERROR=WMS_BASE_URL+"updateLedError";
|
||||||
public static final String WAREHOUSE_01 = "01";
|
public static final String WAREHOUSE_01 = "01";
|
||||||
public static final String WAREHOUSE_02 = "02";
|
public static final String WAREHOUSE_02 = "02";
|
||||||
|
|
||||||
|
|||||||
@@ -83,6 +83,8 @@ public class DeviceSsj extends BaseEntity
|
|||||||
|
|
||||||
@Excel(name="输送线模式 1-入库 2-出库")
|
@Excel(name="输送线模式 1-入库 2-出库")
|
||||||
private int model;
|
private int model;
|
||||||
|
// 报警信息
|
||||||
|
private int errorCode;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ 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.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.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@@ -29,8 +30,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/job/mydoJob")
|
@RequestMapping("/job/mydoJob")
|
||||||
public class MydoJobController extends BaseController
|
public class MydoJobController extends BaseController {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IMydoJobService mydoJobService;
|
private IMydoJobService mydoJobService;
|
||||||
|
|
||||||
@@ -39,8 +39,7 @@ public class MydoJobController extends BaseController
|
|||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:list')")
|
@PreAuthorize("@ss.hasPermi('job:mydoJob:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(MydoJob mydoJob)
|
public TableDataInfo list(MydoJob mydoJob) {
|
||||||
{
|
|
||||||
startPage();
|
startPage();
|
||||||
List<MydoJob> list = mydoJobService.selectMydoJobList(mydoJob);
|
List<MydoJob> list = mydoJobService.selectMydoJobList(mydoJob);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
@@ -51,10 +50,11 @@ public class MydoJobController extends BaseController
|
|||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:list')")
|
@PreAuthorize("@ss.hasPermi('job:mydoJob:list')")
|
||||||
@GetMapping("/listFinish")
|
@GetMapping("/listFinish")
|
||||||
public TableDataInfo listFinish(MydoJob mydoJob)
|
public TableDataInfo listFinish(MydoJob mydoJob) {
|
||||||
{
|
|
||||||
startPage();
|
startPage();
|
||||||
|
// mydoJob.setStatus("3");
|
||||||
List<MydoJob> list = mydoJobService.selectMydoJobFinishList(mydoJob);
|
List<MydoJob> list = mydoJobService.selectMydoJobFinishList(mydoJob);
|
||||||
|
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,9 +64,15 @@ public class MydoJobController extends BaseController
|
|||||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:export')")
|
@PreAuthorize("@ss.hasPermi('job:mydoJob:export')")
|
||||||
@Log(title = "作业信息", businessType = BusinessType.EXPORT)
|
@Log(title = "作业信息", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, MydoJob mydoJob)
|
public void export(HttpServletResponse response, MydoJob mydoJob) {
|
||||||
{
|
List<MydoJob> list = null;
|
||||||
List<MydoJob> list = mydoJobService.selectMydoJobList(mydoJob);
|
if (mydoJob.getStatus().equals("3")) {
|
||||||
|
list = mydoJobService.selectMydoJobList(mydoJob);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
list = mydoJobService.selectMydoJobFinishList(mydoJob);
|
||||||
|
}
|
||||||
|
|
||||||
ExcelUtil<MydoJob> util = new ExcelUtil<MydoJob>(MydoJob.class);
|
ExcelUtil<MydoJob> util = new ExcelUtil<MydoJob>(MydoJob.class);
|
||||||
util.exportExcel(response, list, "作业信息数据");
|
util.exportExcel(response, list, "作业信息数据");
|
||||||
}
|
}
|
||||||
@@ -76,8 +82,7 @@ public class MydoJobController extends BaseController
|
|||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:query')")
|
@PreAuthorize("@ss.hasPermi('job:mydoJob:query')")
|
||||||
@GetMapping(value = "/{jobId}")
|
@GetMapping(value = "/{jobId}")
|
||||||
public AjaxResult getInfo(@PathVariable("jobId") String jobId)
|
public AjaxResult getInfo(@PathVariable("jobId") String jobId) {
|
||||||
{
|
|
||||||
return success(mydoJobService.selectMydoJobByJobId(jobId));
|
return success(mydoJobService.selectMydoJobByJobId(jobId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,8 +92,7 @@ public class MydoJobController extends BaseController
|
|||||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:add')")
|
@PreAuthorize("@ss.hasPermi('job:mydoJob:add')")
|
||||||
@Log(title = "作业信息", businessType = BusinessType.INSERT)
|
@Log(title = "作业信息", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody MydoJob mydoJob)
|
public AjaxResult add(@RequestBody MydoJob mydoJob) {
|
||||||
{
|
|
||||||
return toAjax(mydoJobService.insertMydoJob(mydoJob));
|
return toAjax(mydoJobService.insertMydoJob(mydoJob));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,8 +102,7 @@ public class MydoJobController extends BaseController
|
|||||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:edit')")
|
@PreAuthorize("@ss.hasPermi('job:mydoJob:edit')")
|
||||||
@Log(title = "作业信息", businessType = BusinessType.UPDATE)
|
@Log(title = "作业信息", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody MydoJob mydoJob)
|
public AjaxResult edit(@RequestBody MydoJob mydoJob) {
|
||||||
{
|
|
||||||
return toAjax(mydoJobService.updateMydoJob(mydoJob));
|
return toAjax(mydoJobService.updateMydoJob(mydoJob));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,9 +111,8 @@ public class MydoJobController extends BaseController
|
|||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:remove')")
|
@PreAuthorize("@ss.hasPermi('job:mydoJob:remove')")
|
||||||
@Log(title = "作业信息", businessType = BusinessType.DELETE)
|
@Log(title = "作业信息", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{jobIds}")
|
@DeleteMapping("/{jobIds}")
|
||||||
public AjaxResult remove(@PathVariable String[] jobIds)
|
public AjaxResult remove(@PathVariable String[] jobIds) {
|
||||||
{
|
|
||||||
return toAjax(mydoJobService.deleteMydoJobByJobIds(jobIds));
|
return toAjax(mydoJobService.deleteMydoJobByJobIds(jobIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,8 +120,7 @@ public class MydoJobController extends BaseController
|
|||||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:manualCallback')")
|
@PreAuthorize("@ss.hasPermi('job:mydoJob:manualCallback')")
|
||||||
@Log(title = "作业信息", businessType = BusinessType.UPDATE)
|
@Log(title = "作业信息", businessType = BusinessType.UPDATE)
|
||||||
@GetMapping("/manualCallback/{jobId}")
|
@GetMapping("/manualCallback/{jobId}")
|
||||||
public AjaxResult manualCallback(@PathVariable("jobId") String jobId)
|
public AjaxResult manualCallback(@PathVariable("jobId") String jobId) {
|
||||||
{
|
|
||||||
return mydoJobService.manualCallback(jobId);
|
return mydoJobService.manualCallback(jobId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,10 +24,11 @@ public class MydoJob extends BaseEntity
|
|||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 任务ID */
|
/** 任务ID */
|
||||||
|
@Excel(name = "任务ID")
|
||||||
private String jobId;
|
private String jobId;
|
||||||
|
|
||||||
/** 任务状态 */
|
/** 任务状态 */
|
||||||
@Excel(name = "任务状态")
|
@Excel(name = "任务状态",dictType = "job_status")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/** 任务号 */
|
/** 任务号 */
|
||||||
@@ -35,7 +36,7 @@ public class MydoJob extends BaseEntity
|
|||||||
private String taskNo;
|
private String taskNo;
|
||||||
|
|
||||||
/** 巷道ID */
|
/** 巷道ID */
|
||||||
@Excel(name = "巷道ID")
|
// @Excel(name = "巷道ID")
|
||||||
private String roadwayId;
|
private String roadwayId;
|
||||||
|
|
||||||
/** 货位ID */
|
/** 货位ID */
|
||||||
@@ -55,11 +56,11 @@ public class MydoJob extends BaseEntity
|
|||||||
private Long priority;
|
private Long priority;
|
||||||
|
|
||||||
/** 执行阶段 */
|
/** 执行阶段 */
|
||||||
@Excel(name = "执行阶段")
|
// @Excel(name = "执行阶段")
|
||||||
private String executionPhase;
|
private String executionPhase;
|
||||||
|
|
||||||
/** 任务类型 */
|
/** 任务类型 */
|
||||||
@Excel(name = "任务类型")
|
@Excel(name = "任务类型",dictType = "job_type")
|
||||||
private String inOrOut;
|
private String inOrOut;
|
||||||
|
|
||||||
/** 开始时间 */
|
/** 开始时间 */
|
||||||
@@ -83,9 +84,9 @@ public class MydoJob extends BaseEntity
|
|||||||
private String warehouseId;
|
private String warehouseId;
|
||||||
|
|
||||||
/** 重分标志 */
|
/** 重分标志 */
|
||||||
@Excel(name = "重分标志")
|
// @Excel(name = "重分标志")
|
||||||
private String faultFlag;
|
private String faultFlag;
|
||||||
|
@Excel(name = "托盘条码")
|
||||||
private String trayCode;
|
private String trayCode;
|
||||||
|
|
||||||
private String inOut;
|
private String inOut;
|
||||||
|
|||||||
@@ -89,4 +89,18 @@ public interface MydoJobMapper
|
|||||||
Integer selectExit(String ssj);
|
Integer selectExit(String ssj);
|
||||||
|
|
||||||
Integer selectMydoJobCount();
|
Integer selectMydoJobCount();
|
||||||
|
|
||||||
|
Integer selectMydoJobIn();
|
||||||
|
|
||||||
|
Integer selectMydoJobCountOut();
|
||||||
|
|
||||||
|
Integer selectByJobOut(Integer currFloor);
|
||||||
|
|
||||||
|
Integer selectByJobOutIsOne(Integer currFloor);
|
||||||
|
|
||||||
|
Integer selectMydoJobExit(String exit);
|
||||||
|
|
||||||
|
Integer selectTheFloorYk(String theFloor);
|
||||||
|
|
||||||
|
void deleteMydoJobByTaskNos(List<String> validTaskNos);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,4 +88,16 @@ public interface IMydoJobService
|
|||||||
Integer selectExit(String ssj);
|
Integer selectExit(String ssj);
|
||||||
|
|
||||||
Integer selectMydoJobCount();
|
Integer selectMydoJobCount();
|
||||||
|
|
||||||
|
Integer selectMydoJobIn();
|
||||||
|
|
||||||
|
Integer selectMydoJobCountOut();
|
||||||
|
|
||||||
|
Integer selectByJobOut(Integer currFloor);
|
||||||
|
|
||||||
|
Integer selectByJobOutIsOne(Integer currFloor);
|
||||||
|
|
||||||
|
Integer selectMydoJobExit(String exit);
|
||||||
|
|
||||||
|
Integer selectTheFloorYk(String theFloor);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -193,4 +193,35 @@ public class MydoJobServiceImpl implements IMydoJobService
|
|||||||
public Integer selectMydoJobCount() {
|
public Integer selectMydoJobCount() {
|
||||||
return mydoJobMapper.selectMydoJobCount();
|
return mydoJobMapper.selectMydoJobCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer selectMydoJobIn() {
|
||||||
|
return mydoJobMapper.selectMydoJobIn();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer selectMydoJobCountOut() {
|
||||||
|
return mydoJobMapper.selectMydoJobCountOut();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer selectByJobOut(Integer currFloor) {
|
||||||
|
|
||||||
|
return mydoJobMapper.selectByJobOut(currFloor);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer selectByJobOutIsOne(Integer currFloor) {
|
||||||
|
return mydoJobMapper.selectByJobOutIsOne(currFloor);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer selectMydoJobExit(String exit) {
|
||||||
|
return mydoJobMapper.selectMydoJobExit(exit);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer selectTheFloorYk(String theFloor) {
|
||||||
|
return mydoJobMapper.selectTheFloorYk(theFloor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.queue.agv.mapper;
|
package com.ruoyi.queue.agv.mapper;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||||
|
|
||||||
@@ -67,4 +68,6 @@ public interface AgvQueueMapper
|
|||||||
AgvQueue selectAgvQueueByTaskCode(String taskCode);
|
AgvQueue selectAgvQueueByTaskCode(String taskCode);
|
||||||
|
|
||||||
void insertHistory(String reqCode);
|
void insertHistory(String reqCode);
|
||||||
|
|
||||||
|
void selectKx(HashMap<String, Object> map);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.queue.agv.service;
|
package com.ruoyi.queue.agv.service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||||
|
|
||||||
@@ -71,4 +72,6 @@ public interface IAgvQueueService
|
|||||||
* @param reqCode
|
* @param reqCode
|
||||||
*/
|
*/
|
||||||
void insertHistory(String reqCode);
|
void insertHistory(String reqCode);
|
||||||
|
|
||||||
|
void selectKx(HashMap<String, Object> map);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.queue.agv.service.impl;
|
package com.ruoyi.queue.agv.service.impl;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -100,4 +101,9 @@ public class AgvQueueServiceImpl implements IAgvQueueService
|
|||||||
public void insertHistory(String reqCode) {
|
public void insertHistory(String reqCode) {
|
||||||
agvQueueMapper.insertHistory(reqCode);
|
agvQueueMapper.insertHistory(reqCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void selectKx(HashMap<String, Object> map) {
|
||||||
|
agvQueueMapper.selectKx(map);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,4 +77,8 @@ public interface WcsSrgvQueueMapper
|
|||||||
Integer selectTsj();
|
Integer selectTsj();
|
||||||
|
|
||||||
Integer selectByCaogoPlaceSite(String siteId);
|
Integer selectByCaogoPlaceSite(String siteId);
|
||||||
|
|
||||||
|
Integer selectByEndSite();
|
||||||
|
|
||||||
|
List<String> selectTaskNosByGuids(String[] guids);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,4 +83,6 @@ public interface IWcsSrgvQueueService
|
|||||||
Integer selectTsj();
|
Integer selectTsj();
|
||||||
|
|
||||||
Integer selectByCaogoPlaceSite(String siteId);
|
Integer selectByCaogoPlaceSite(String siteId);
|
||||||
|
|
||||||
|
Integer selectByEndSite();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
package com.ruoyi.queue.srgv.service.impl;
|
package com.ruoyi.queue.srgv.service.impl;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.ObjUtil;
|
import cn.hutool.core.util.ObjUtil;
|
||||||
|
import com.ruoyi.job.mapper.MydoJobMapper;
|
||||||
import com.ruoyi.queue.srgv.domain.WcsSrgvQueueFinish;
|
import com.ruoyi.queue.srgv.domain.WcsSrgvQueueFinish;
|
||||||
import com.ruoyi.queue.srgv.mapper.WcsSrgvQueueFinishMapper;
|
import com.ruoyi.queue.srgv.mapper.WcsSrgvQueueFinishMapper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -26,7 +28,8 @@ public class WcsSrgvQueueServiceImpl implements IWcsSrgvQueueService
|
|||||||
private WcsSrgvQueueMapper wcsSrgvQueueMapper;
|
private WcsSrgvQueueMapper wcsSrgvQueueMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private WcsSrgvQueueFinishMapper wcsSrgvQueueFinishMapper;
|
private WcsSrgvQueueFinishMapper wcsSrgvQueueFinishMapper;
|
||||||
|
@Autowired
|
||||||
|
private MydoJobMapper mydoJobMapper;
|
||||||
/**
|
/**
|
||||||
* 查询四向小车任务队列
|
* 查询四向小车任务队列
|
||||||
*
|
*
|
||||||
@@ -100,9 +103,29 @@ public class WcsSrgvQueueServiceImpl implements IWcsSrgvQueueService
|
|||||||
@Override
|
@Override
|
||||||
public int deleteWcsSrgvQueueByGuids(String[] guids)
|
public int deleteWcsSrgvQueueByGuids(String[] guids)
|
||||||
{
|
{
|
||||||
|
if (guids == null || guids.length == 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
List<String> taskNos = wcsSrgvQueueMapper.selectTaskNosByGuids(guids);
|
||||||
|
deleteMydoJobsByTaskNos(taskNos);
|
||||||
return wcsSrgvQueueMapper.deleteWcsSrgvQueueByGuids(guids);
|
return wcsSrgvQueueMapper.deleteWcsSrgvQueueByGuids(guids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void deleteMydoJobsByTaskNos(List<String> taskNos) {
|
||||||
|
if (taskNos == null || taskNos.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<String> validTaskNos = new ArrayList<>();
|
||||||
|
for (String taskNo : taskNos) {
|
||||||
|
if (taskNo != null && !"".equals(taskNo)) {
|
||||||
|
validTaskNos.add(taskNo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!validTaskNos.isEmpty()) {
|
||||||
|
mydoJobMapper.deleteMydoJobByTaskNos(validTaskNos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除四向小车任务队列信息
|
* 删除四向小车任务队列信息
|
||||||
*
|
*
|
||||||
@@ -131,6 +154,12 @@ public class WcsSrgvQueueServiceImpl implements IWcsSrgvQueueService
|
|||||||
return wcsSrgvQueueMapper.selectByCaogoPlaceSite(siteId);
|
return wcsSrgvQueueMapper.selectByCaogoPlaceSite(siteId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer selectByEndSite() {
|
||||||
|
return wcsSrgvQueueMapper.selectByEndSite();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WcsSrgvQueue insertHistory(String taskNo) {
|
public WcsSrgvQueue insertHistory(String taskNo) {
|
||||||
WcsSrgvQueue wcsSrgvQueue = wcsSrgvQueueMapper.selectWcsSrgvQueueByTaskNo(taskNo);
|
WcsSrgvQueue wcsSrgvQueue = wcsSrgvQueueMapper.selectWcsSrgvQueueByTaskNo(taskNo);
|
||||||
|
|||||||
@@ -73,6 +73,8 @@ public class PlcCdzRead implements Runnable {
|
|||||||
ddsx1 = SoftBasic.ByteToHexString(read2.Content);
|
ddsx1 = SoftBasic.ByteToHexString(read2.Content);
|
||||||
deviceCdz.setStatus(ParseUtil.optInt(0, ddsx1));
|
deviceCdz.setStatus(ParseUtil.optInt(0, ddsx1));
|
||||||
// deviceCdz.setModel(ParseUtil.optInt(2, ddsx1));
|
// deviceCdz.setModel(ParseUtil.optInt(2, ddsx1));
|
||||||
|
}else {
|
||||||
|
log.error(read2.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,8 +118,8 @@ public class PlcCdzRead implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void closeServer() {
|
void closeServer() {
|
||||||
if (readWriteNet != null) {
|
if (siemensS7Net != null) {
|
||||||
readWriteNet.ConnectClose();
|
siemensS7Net.ConnectClose();
|
||||||
}
|
}
|
||||||
setIsConnect(false);
|
setIsConnect(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,8 +123,8 @@ public class PlcDdjRead implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void closeServer() {
|
void closeServer() {
|
||||||
if (readWriteNet != null) {
|
if (siemensS7Net != null) {
|
||||||
readWriteNet.ConnectClose();
|
siemensS7Net.ConnectClose();
|
||||||
}
|
}
|
||||||
setIsConnect(false);
|
setIsConnect(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,23 +78,39 @@ public class PlcSrgvRead implements Runnable {
|
|||||||
OperateResultExOne<byte[]> read1 = modbusTcpNet.Read("4068", (short) 15);//2400-2414
|
OperateResultExOne<byte[]> read1 = modbusTcpNet.Read("4068", (short) 15);//2400-2414
|
||||||
if (read1.IsSuccess) {
|
if (read1.IsSuccess) {
|
||||||
setValueByByte1(read1.Content, deviceSrgv);
|
setValueByByte1(read1.Content, deviceSrgv);
|
||||||
|
}else {
|
||||||
|
log.error(read1.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OperateResultExOne<byte[]> read5 = modbusTcpNet.Read("4081", (short) 2);//2400-2414
|
||||||
|
if (read5.IsSuccess) {
|
||||||
|
setValueByByte5(read1.Content, deviceSrgv);
|
||||||
|
}else {
|
||||||
|
log.error(read1.Message);
|
||||||
|
}
|
||||||
|
|
||||||
//读取二段任务 小车是否接收完成1段作业
|
//读取二段任务 小车是否接收完成1段作业
|
||||||
OperateResultExOne<byte[]> read3 = modbusTcpNet.Read("1000", (short) 2);//2400-2414
|
OperateResultExOne<byte[]> read3 = modbusTcpNet.Read("1000", (short) 2);//2400-2414
|
||||||
if (read3.IsSuccess) {
|
if (read3.IsSuccess) {
|
||||||
setValueByByte3(read3.Content, deviceSrgv);
|
setValueByByte3(read3.Content, deviceSrgv);
|
||||||
|
}else {
|
||||||
|
log.error(read1.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
//读取双字
|
//读取双字
|
||||||
OperateResultExOne<byte[]> read2 = modbusTcpNet.Read("4060", (short) 8);// 4800-4807任务号、原点、目标点、当前
|
OperateResultExOne<byte[]> read2 = modbusTcpNet.Read("4060", (short) 8);// 4800-4807任务号、原点、目标点、当前
|
||||||
if (read2.IsSuccess) {
|
if (read2.IsSuccess) {
|
||||||
setValueByByte2(read2.Content, deviceSrgv);
|
setValueByByte2(read2.Content, deviceSrgv);
|
||||||
|
}else {
|
||||||
|
log.error(read1.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
// //读取双字,路径
|
// //读取双字,路径
|
||||||
OperateResultExOne<byte[]> read4 = modbusTcpNet.Read("6000", (short) 800);// 5000-5799 路径 400个
|
OperateResultExOne<byte[]> read4 = modbusTcpNet.Read("6000", (short) 800);// 5000-5799 路径 400个
|
||||||
if (read4.IsSuccess) {
|
if (read4.IsSuccess) {
|
||||||
setValueByByte4(read4.Content, deviceSrgv);
|
setValueByByte4(read4.Content, deviceSrgv);
|
||||||
|
}else {
|
||||||
|
log.error(read1.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,7 +127,7 @@ public class PlcSrgvRead implements Runnable {
|
|||||||
// agvData.setStatus(0);
|
// agvData.setStatus(0);
|
||||||
agvData.setStatus(Convert.toInt(byteTransform.TransInt16(content, 8)));
|
agvData.setStatus(Convert.toInt(byteTransform.TransInt16(content, 8)));
|
||||||
//载货标志
|
//载货标志
|
||||||
agvData.setCargoFlag(Convert.toInt(byteTransform.TransInt16(content, 13)));
|
// agvData.setCargoFlag(Convert.toInt(byteTransform.TransInt32(content[1], 13)));
|
||||||
//接收完成标志
|
//接收完成标志
|
||||||
// agvData.setFinish(Convert.toInt(byteTransform.TransInt16(content, 10)));
|
// agvData.setFinish(Convert.toInt(byteTransform.TransInt16(content, 10)));
|
||||||
// agvData.setFinish(0);
|
// agvData.setFinish(0);
|
||||||
@@ -131,6 +147,15 @@ public class PlcSrgvRead implements Runnable {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void setValueByByte5(byte[] content, DeviceSrgv agvData) {
|
||||||
|
int cargoFlag = content[27] & 0xFF;
|
||||||
|
agvData.setCargoFlag(cargoFlag);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//单字
|
//单字
|
||||||
private void setValueByByte3(byte[] content, DeviceSrgv agvData) {
|
private void setValueByByte3(byte[] content, DeviceSrgv agvData) {
|
||||||
// agvData.setTaskType(0);
|
// agvData.setTaskType(0);
|
||||||
@@ -219,8 +244,8 @@ public class PlcSrgvRead implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void closeServer() {
|
void closeServer() {
|
||||||
if (readWriteNet != null) {
|
if (modbusTcpNet != null) {
|
||||||
readWriteNet.ConnectClose();
|
modbusTcpNet.ConnectClose();
|
||||||
}
|
}
|
||||||
setIsConnect(false);
|
setIsConnect(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,6 +68,10 @@ public class PlcSsjRead implements Runnable {
|
|||||||
// 线体到位输送机
|
// 线体到位输送机
|
||||||
readPlcOtherSsj(ssjDevice);
|
readPlcOtherSsj(ssjDevice);
|
||||||
break;
|
break;
|
||||||
|
case "4":
|
||||||
|
// 线体到位输送机
|
||||||
|
readPlcInDwSsj(ssjDevice);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,6 +90,19 @@ public class PlcSsjRead implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void readPlcInDwSsj(DeviceSsj ssjDevice) {
|
||||||
|
OperateResultExOne<byte[]> read2 = readWriteNet.Read(ssjDevice.getPlcDbReadAddress(), Short.parseShort("10"));
|
||||||
|
String ddsx1 = "0";
|
||||||
|
if (read2.IsSuccess) {
|
||||||
|
ddsx1 = SoftBasic.ByteToHexString(read2.Content);
|
||||||
|
ssjDevice.setKx(ParseUtil.optInt(4, ddsx1));
|
||||||
|
ssjDevice.setDw(ParseUtil.optInt(6, ddsx1));
|
||||||
|
ssjDevice.setErrorCode(ParseUtil.optInt(8,ddsx1));
|
||||||
|
ssjDevice.setTaskNo(ParseUtil.optDInt(0, ddsx1));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 其他输送机
|
* 其他输送机
|
||||||
*
|
*
|
||||||
@@ -119,6 +136,8 @@ public class PlcSsjRead implements Runnable {
|
|||||||
ssjDevice.setDw(ParseUtil.optInt(6, ddsx1));
|
ssjDevice.setDw(ParseUtil.optInt(6, ddsx1));
|
||||||
// ssjDevice.setTrayCode(ParseUtil.optString(14, 12, ddsx1));
|
// ssjDevice.setTrayCode(ParseUtil.optString(14, 12, ddsx1));
|
||||||
// ssjDevice.setModel(ParseUtil.optInt(28, ddsx1));
|
// ssjDevice.setModel(ParseUtil.optInt(28, ddsx1));
|
||||||
|
}else {
|
||||||
|
log.error(read2.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,6 +158,8 @@ public class PlcSsjRead implements Runnable {
|
|||||||
// ssjDevice.setKx(ParseUtil.optInt(4, ddsx1));
|
// ssjDevice.setKx(ParseUtil.optInt(4, ddsx1));
|
||||||
// ssjDevice.setDw(ParseUtil.optInt(6, ddsx1));
|
// ssjDevice.setDw(ParseUtil.optInt(6, ddsx1));
|
||||||
|
|
||||||
|
}else {
|
||||||
|
log.error(read2.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,6 +197,8 @@ public class PlcSsjRead implements Runnable {
|
|||||||
//去除bytes中
|
//去除bytes中
|
||||||
ssjDevice.setTrayCode(ParseUtil.filterAndConvert(trayCodeRead.Content));
|
ssjDevice.setTrayCode(ParseUtil.filterAndConvert(trayCodeRead.Content));
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
log.error(read2.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,8 +242,8 @@ public class PlcSsjRead implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void closeServer() {
|
void closeServer() {
|
||||||
if (readWriteNet != null) {
|
if (siemensS7Net != null) {
|
||||||
readWriteNet.ConnectClose();
|
siemensS7Net.ConnectClose();
|
||||||
}
|
}
|
||||||
setIsConnect(false);
|
setIsConnect(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,8 +126,8 @@ public class PlcTsjRead implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void closeServer() {
|
void closeServer() {
|
||||||
if (readWriteNet != null) {
|
if (siemensS7Net != null) {
|
||||||
readWriteNet.ConnectClose();
|
siemensS7Net.ConnectClose();
|
||||||
}
|
}
|
||||||
setIsConnect(false);
|
setIsConnect(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ import com.ruoyi.schedule.plcRead.ssj.PlcSsjRead;
|
|||||||
import com.ruoyi.schedule.plcRead.util.Tools;
|
import com.ruoyi.schedule.plcRead.util.Tools;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -37,6 +40,7 @@ public class CdzThread implements Runnable {
|
|||||||
private final Integer LITTLE_BETTERY = 40;
|
private final Integer LITTLE_BETTERY = 40;
|
||||||
private final Integer MIDDLE_BETTERY = 70;
|
private final Integer MIDDLE_BETTERY = 70;
|
||||||
private final Integer MAX_BETTERY = 90;
|
private final Integer MAX_BETTERY = 90;
|
||||||
|
private final Integer JOB_BETTERY=50;
|
||||||
private ISrgvChargingJobService chargingJobService;
|
private ISrgvChargingJobService chargingJobService;
|
||||||
private IDeviceCdzService deviceCdzService;
|
private IDeviceCdzService deviceCdzService;
|
||||||
private IDeviceSrgvService deviceSrgvService;
|
private IDeviceSrgvService deviceSrgvService;
|
||||||
@@ -66,6 +70,19 @@ public class CdzThread implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isMoreThan30Min(String timeStr, String pattern) {
|
||||||
|
// 1. 创建格式化器
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
|
||||||
|
// 2. 解析字符串为时间对象
|
||||||
|
LocalDateTime targetTime = LocalDateTime.parse(timeStr, formatter);
|
||||||
|
// 3. 获取当前系统时间
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
// 4. 计算两个时间相差的总分钟(可正可负)
|
||||||
|
long diffMinutes = ChronoUnit.MINUTES.between(targetTime, now);
|
||||||
|
// 取绝对值:不管是过去/未来时间,只要间隔超30分钟就满足
|
||||||
|
long absDiff = Math.abs(diffMinutes);
|
||||||
|
return absDiff > 30;
|
||||||
|
}
|
||||||
|
|
||||||
void dispatch() {
|
void dispatch() {
|
||||||
Integer count = mydoJobService.selectMydoJobCount();
|
Integer count = mydoJobService.selectMydoJobCount();
|
||||||
@@ -78,7 +95,7 @@ public class CdzThread implements Runnable {
|
|||||||
if (deviceSrgv.getWorkMode() == 5 && deviceSrgv.getStatus() != 3 && deviceSrgv.getChargeFlag() != 2) {
|
if (deviceSrgv.getWorkMode() == 5 && deviceSrgv.getStatus() != 3 && deviceSrgv.getChargeFlag() != 2) {
|
||||||
if (deviceSrgv.getBattery() <= LITTLE_BETTERY) {
|
if (deviceSrgv.getBattery() <= LITTLE_BETTERY) {
|
||||||
littleBatterySRgv.add(deviceSrgv);
|
littleBatterySRgv.add(deviceSrgv);
|
||||||
} else if (deviceSrgv.getBattery() <= MIDDLE_BETTERY && count == 0) {
|
} else if (deviceSrgv.getBattery() <= MIDDLE_BETTERY && isMoreThan30Min(deviceSrgv.getLastTime(),"yyyy-MM-dd HH:mm:ss")) {
|
||||||
middleBatterySRgv.add(deviceSrgv);
|
middleBatterySRgv.add(deviceSrgv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -135,11 +152,11 @@ public class CdzThread implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//生成断电任务 有任务且电量大于50
|
//生成断电任务 有任务且电量大于50
|
||||||
|
|
||||||
List<DeviceCdz> deviceCdzdd = deviceCdzService.selectDeviceCdzHasSRgvList();
|
List<DeviceCdz> deviceCdzdd = deviceCdzService.selectDeviceCdzHasSRgvList();
|
||||||
for (DeviceCdz deviceCdz : deviceCdzdd) {
|
for (DeviceCdz deviceCdz : deviceCdzdd) {
|
||||||
DeviceSrgv deviceSrgv = PlcSrgvRead.deviceSrgvMap.get(deviceCdz.getSpare1());
|
DeviceSrgv deviceSrgv = PlcSrgvRead.deviceSrgvMap.get(deviceCdz.getSpare1());
|
||||||
if (((deviceSrgv.getBattery() >= MIDDLE_BETTERY && count > 0) || deviceSrgv.getBattery() >= MAX_BETTERY)
|
//(deviceSrgv.getBattery() >= JOB_BETTERY && count > 0) ||
|
||||||
|
if (( deviceSrgv.getBattery() >= MAX_BETTERY)
|
||||||
&& deviceSrgv.getWorkMode() == 5
|
&& deviceSrgv.getWorkMode() == 5
|
||||||
&& deviceSrgv.getChargeFlag() == 2 && deviceCdz.getStatus() == 1) {
|
&& deviceSrgv.getChargeFlag() == 2 && deviceCdz.getStatus() == 1) {
|
||||||
createChargingOutJob(PlcSrgvRead.deviceSrgvMap.get(deviceCdz.getSpare1()), deviceCdz);
|
createChargingOutJob(PlcSrgvRead.deviceSrgvMap.get(deviceCdz.getSpare1()), deviceCdz);
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -46,6 +46,13 @@ public class SsjThread implements Runnable {
|
|||||||
ssjCodes2.add("L1004");
|
ssjCodes2.add("L1004");
|
||||||
ssjCodes2.add("L1005");
|
ssjCodes2.add("L1005");
|
||||||
ssjCodeList.put("road", ssjCodes2);
|
ssjCodeList.put("road", ssjCodes2);
|
||||||
|
|
||||||
|
ArrayList<String> ssjCodes4 = new ArrayList<>();
|
||||||
|
ssjCodes4.add("L1006");
|
||||||
|
ssjCodes4.add("L1003");
|
||||||
|
ssjCodeList.put("error", ssjCodes4);
|
||||||
|
|
||||||
|
|
||||||
mydoJobService = SpringUtils.getBean(IMydoJobService.class);
|
mydoJobService = SpringUtils.getBean(IMydoJobService.class);
|
||||||
jobCallBackService = SpringUtils.getBean(IJobCallBackService.class);
|
jobCallBackService = SpringUtils.getBean(IJobCallBackService.class);
|
||||||
apiService = SpringUtils.getBean(IApiService.class);
|
apiService = SpringUtils.getBean(IApiService.class);
|
||||||
@@ -97,28 +104,70 @@ public class SsjThread implements Runnable {
|
|||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
case "error":
|
||||||
|
for (String ssjCode : ssjCodeList.get("error")) {
|
||||||
|
try {
|
||||||
|
if (PlcSsjRead.deviceSsjMap.containsKey(ssjCode)) {
|
||||||
|
inDispatchError(PlcSsjRead.deviceSsjMap.get(ssjCode));
|
||||||
|
} else {
|
||||||
|
log.error("设备不存在 ssjCode{}", ssjCode);
|
||||||
|
}
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void inDispatchError(DeviceSsj deviceSsj) {
|
||||||
|
if (deviceSsj.getErrorCode() > 0) {
|
||||||
|
if (deviceSsj.getDeviceCode().equals("L1003")) {
|
||||||
|
String code = "TD1001";
|
||||||
|
String errorCode = String.valueOf(deviceSsj.getErrorCode());
|
||||||
|
HashMap<String, Object> objectObjectHashMap = new HashMap<>();
|
||||||
|
objectObjectHashMap.put("deviceCode", code);
|
||||||
|
objectObjectHashMap.put("errorCode", errorCode);
|
||||||
|
apiService.updateLedError(objectObjectHashMap);
|
||||||
|
}
|
||||||
|
if (deviceSsj.getDeviceCode().equals("L1006")) {
|
||||||
|
String code = "TD1008";
|
||||||
|
String errorCode = String.valueOf(deviceSsj.getErrorCode());
|
||||||
|
HashMap<String, Object> objectObjectHashMap = new HashMap<>();
|
||||||
|
objectObjectHashMap.put("deviceCode", code);
|
||||||
|
objectObjectHashMap.put("errorCode", errorCode);
|
||||||
|
apiService.updateLedError(objectObjectHashMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void inDispatch(DeviceSsj deviceSsj) {
|
void inDispatch(DeviceSsj deviceSsj) {
|
||||||
//出库到位
|
//出库到位
|
||||||
if (deviceSsj.getDw() == 1 && deviceSsj.getTaskNo() > 0) {
|
if (deviceSsj.getDw() == 1 && deviceSsj.getTaskNo() > 0) {
|
||||||
|
HashMap<String, Object> objectObjectHashMap = new HashMap<>();
|
||||||
|
objectObjectHashMap.put("deviceCode", deviceSsj.getDeviceCode());
|
||||||
|
objectObjectHashMap.put("taskNo", deviceSsj.getTaskNo());
|
||||||
|
apiService.updateLed(objectObjectHashMap);
|
||||||
|
|
||||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(deviceSsj.getTaskNo()));
|
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(deviceSsj.getTaskNo()));
|
||||||
if (mydoJob != null) {
|
if (mydoJob != null && mydoJob.getInOrOut().equals("22")) {
|
||||||
log.info("设备:{} 位置:{} 任务号:{} 出库到位", "输送线", deviceSsj.getDeviceCode(), mydoJob.getTaskNo());
|
// 新增agv执行队列,以及调用wms后台任务过账
|
||||||
mydoJobService.insertHistory(mydoJob.getJobId());
|
AjaxResult ajaxResult1 = apiService.insertAgvQuene(objectObjectHashMap);
|
||||||
mydoJobService.deleteMydoJobByJobId(mydoJob.getJobId());
|
if (ajaxResult1.get("code").equals("200")) {
|
||||||
JobCallBack jobCallBack = new JobCallBack();
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
jobCallBack.setType("2");
|
map.put("trayCode", mydoJob.getTrayCode());
|
||||||
jobCallBack.setMydojobId(mydoJob.getJobId());
|
//拉取
|
||||||
jobCallBack.setStatus("0");
|
AjaxResult ajaxResult = apiService.OutMakeSure(map);
|
||||||
jobCallBack.setTaskNo(Convert.toLong(mydoJob.getTaskNo()));
|
if (ajaxResult.get("code").equals("200")) {
|
||||||
jobCallBack.setCreateTime(new Date());
|
mydoJobService.insertHistory(mydoJob.getJobId());
|
||||||
jobCallBackService.insertJobCallBack(jobCallBack);
|
mydoJobService.deleteMydoJobByJobId(mydoJob.getJobId());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -127,14 +176,22 @@ public class SsjThread implements Runnable {
|
|||||||
if (deviceSsj.getRkqq() == 1 && StrUtil.isNotBlank(deviceSsj.getTrayCode().trim())) {
|
if (deviceSsj.getRkqq() == 1 && StrUtil.isNotBlank(deviceSsj.getTrayCode().trim())) {
|
||||||
String trayCode = deviceSsj.getTrayCode().trim();
|
String trayCode = deviceSsj.getTrayCode().trim();
|
||||||
MydoJob getMydoJob = mydoJobService.selectMydoJobByTrayCode(trayCode);
|
MydoJob getMydoJob = mydoJobService.selectMydoJobByTrayCode(trayCode);
|
||||||
if (getMydoJob != null && deviceSsj.getTaskNo() < 1000) {
|
if (getMydoJob == null && deviceSsj.getTaskNo() < 1000) {
|
||||||
int i = writeToSsj(deviceSsj.getPlcDbWriteAddress(), getMydoJob.getTaskNo(), 1, 1);
|
String exit = "";
|
||||||
if (i == 1) {
|
if (deviceSsj.getDeviceCode().equals("GS1002")) {
|
||||||
getMydoJob.setStatus("3");
|
exit = "L1004";
|
||||||
mydoJobService.updateMydoJob(getMydoJob);
|
}
|
||||||
log.info(deviceSsj.getDeviceCode() + "输送机下发任务号成功:{}", getMydoJob.getTaskNo());
|
if (deviceSsj.getDeviceCode().equals("GS1007")) {
|
||||||
|
exit = "L1005";
|
||||||
|
}
|
||||||
|
Integer count = mydoJobService.selectMydoJobExit(exit);
|
||||||
|
if (count > 0) {
|
||||||
|
int i = writeToSsj(deviceSsj.getPlcDbWriteAddress(), "0", 2, 2);
|
||||||
|
if (i == 1) {
|
||||||
|
log.info(deviceSsj.getDeviceCode() + "有相应入口的出库作业,下发退回,去向2 条码" + deviceSsj.getTrayCode());
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
//todo 查是否为入库模式,不是退回,是否超重
|
//todo 查是否为入库模式,不是退回,是否超重
|
||||||
HashMap<String, Object> map = new HashMap<>();
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
map.put("trayCode", deviceSsj.getTrayCode());
|
map.put("trayCode", deviceSsj.getTrayCode());
|
||||||
@@ -184,27 +241,28 @@ public class SsjThread implements Runnable {
|
|||||||
if (deviceSsj.getDw() == 1 && deviceSsj.getTaskNo() > 1000) {
|
if (deviceSsj.getDw() == 1 && deviceSsj.getTaskNo() > 1000) {
|
||||||
|
|
||||||
MydoJob mydoJob1 = mydoJobService.selectMydoJobByTaskNo(Long.valueOf(deviceSsj.getTaskNo()));
|
MydoJob mydoJob1 = mydoJobService.selectMydoJobByTaskNo(Long.valueOf(deviceSsj.getTaskNo()));
|
||||||
if (mydoJob1.getCargoSpaceId() != null) {
|
if (mydoJob1 != null && mydoJob1.getCargoSpaceId() != null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (mydoJob1 != null && Integer.parseInt(mydoJob1.getInOrOut()) < 20) {
|
||||||
HashMap<String, Object> map = new HashMap<>();
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
map.put("taskNo", deviceSsj.getTaskNo());
|
map.put("taskNo", deviceSsj.getTaskNo());
|
||||||
//拉取
|
map.put("deviceCode", deviceSsj.getDeviceCode());
|
||||||
AjaxResult ajaxResult = apiService.sendCargoSpace(map);
|
//拉取
|
||||||
if (ajaxResult.isSuccess()) {
|
AjaxResult ajaxResult = apiService.sendCargoSpace(map);
|
||||||
MydoJob data = BeanUtil.toBean(ajaxResult.get("data"), MydoJob.class);
|
if (ajaxResult.isSuccess()) {
|
||||||
String cargoSpaceId = data.getCargoSpaceId();
|
MydoJob data = BeanUtil.toBean(ajaxResult.get("data"), MydoJob.class);
|
||||||
String theFloor = data.getClassId();
|
String cargoSpaceId = data.getCargoSpaceId();
|
||||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo((long) deviceSsj.getTaskNo());
|
String theFloor = data.getClassId();
|
||||||
if (mydoJob != null) {
|
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo((long) deviceSsj.getTaskNo());
|
||||||
mydoJob.setTheFloor(theFloor);
|
if (mydoJob != null && cargoSpaceId != null && !cargoSpaceId.equals("")) {
|
||||||
mydoJob.setCargoSpaceId(cargoSpaceId);
|
mydoJob.setTheFloor(theFloor);
|
||||||
mydoJob.setExecutionPhase("2");
|
mydoJob.setCargoSpaceId(cargoSpaceId);
|
||||||
mydoJobService.updateMydoJob(mydoJob);
|
mydoJob.setExecutionPhase("2");
|
||||||
|
mydoJobService.updateMydoJob(mydoJob);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ import com.ruoyi.schedule.plcRead.tsj.PlcTsjRead;
|
|||||||
import com.ruoyi.schedule.plcRead.util.Tools;
|
import com.ruoyi.schedule.plcRead.util.Tools;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.*;
|
||||||
import java.util.List;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class TsjThread implements Runnable {
|
public class TsjThread implements Runnable {
|
||||||
@@ -39,7 +39,7 @@ public class TsjThread implements Runnable {
|
|||||||
private IWcsSrgvQueueService wcsSrgvQueueService;
|
private IWcsSrgvQueueService wcsSrgvQueueService;
|
||||||
private IMydoJobService mydoJobService;
|
private IMydoJobService mydoJobService;
|
||||||
private IWcsSrgvMapService wcsSrgvMapService;
|
private IWcsSrgvMapService wcsSrgvMapService;
|
||||||
|
public IWcsSrgvQueueService wcsSagvQueueMapper;
|
||||||
|
|
||||||
public void init() {
|
public void init() {
|
||||||
tsjDeviceExecutionQueueService = SpringUtils.getBean(ITsjDeviceExecutionQueueService.class);
|
tsjDeviceExecutionQueueService = SpringUtils.getBean(ITsjDeviceExecutionQueueService.class);
|
||||||
@@ -48,6 +48,7 @@ public class TsjThread implements Runnable {
|
|||||||
wcsSrgvQueueService = SpringUtils.getBean(IWcsSrgvQueueService.class);
|
wcsSrgvQueueService = SpringUtils.getBean(IWcsSrgvQueueService.class);
|
||||||
wcsSrgvMapService = SpringUtils.getBean(IWcsSrgvMapService.class);
|
wcsSrgvMapService = SpringUtils.getBean(IWcsSrgvMapService.class);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -102,6 +103,10 @@ public class TsjThread implements Runnable {
|
|||||||
if (czfs == 2 && sbzt == 2 && jdbz == 2 && rwh > 500) {
|
if (czfs == 2 && sbzt == 2 && jdbz == 2 && rwh > 500) {
|
||||||
createSRgvQueueTsjQd(rwh, tsj);
|
createSRgvQueueTsjQd(rwh, tsj);
|
||||||
}
|
}
|
||||||
|
// 提升机放货途中 取消当前小车的路径
|
||||||
|
if (czfs == 2 && sbzt == 2 && jdbz == 3 && rwh > 500) {
|
||||||
|
removePathCar(rwh, tsj);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 2、任务完成
|
* 2、任务完成
|
||||||
@@ -124,6 +129,15 @@ public class TsjThread implements Runnable {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void removePathCar(Long rwh, DeviceTsj tsj) {
|
||||||
|
WcsSrgvQueue wcsSrgvQueue = wcsSrgvQueueService.selectWcsSrgvQueueByTaskNo(String.valueOf(rwh));
|
||||||
|
DeviceSrgv deviceSrgv = PlcSrgvRead.deviceSrgvMap.get(wcsSrgvQueue.getAgvId());
|
||||||
|
if (!deviceSrgv.getCurrSite().equals("07050"+wcsSrgvQueue.getTheFloor()) && tsj.getHczt() == 1 && !wcsSrgvQueue.getPathInfo().isEmpty() && java.util.Arrays.asList(wcsSrgvQueue.getPathInfo().trim().replaceAll(",$", "").split(",")).contains("07050"+wcsSrgvQueue.getTheFloor())&&wcsSrgvQueue.getEndSite().equals("tsj")) {
|
||||||
|
wcsSrgvQueue.setPathInfo("");
|
||||||
|
wcsSrgvQueueService.updateWcsSrgvQueue(wcsSrgvQueue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 下发提升机启动
|
// 下发提升机启动
|
||||||
private void createSRgvQueueTsjQd(Long rwh, DeviceTsj tsj) {
|
private void createSRgvQueueTsjQd(Long rwh, DeviceTsj tsj) {
|
||||||
for (String sRgv : PlcSrgvRead.deviceSrgvMap.keySet()) {
|
for (String sRgv : PlcSrgvRead.deviceSrgvMap.keySet()) {
|
||||||
@@ -184,9 +198,42 @@ public class TsjThread implements Runnable {
|
|||||||
break;
|
break;
|
||||||
case "2":
|
case "2":
|
||||||
//出库
|
//出库
|
||||||
// startSite="tsj";
|
|
||||||
startSite = "09050" + tsj.getDqcs();
|
startSite = "09050" + tsj.getDqcs();
|
||||||
endSite = wcsSrgvQueue.getCargoPlaceSite();
|
// 如果提升机当前层等于1 并且是出库任务,更新出库点位为出库缓存点
|
||||||
|
// Integer i = mydoJobService.selectMydoJobCountOut();
|
||||||
|
if (tsj.getDqcs() == 1 && "2".equals(wcsSrgvQueue.getDefault02())) {
|
||||||
|
WcsSrgvMap wcsSrgvMapParam = new WcsSrgvMap();
|
||||||
|
wcsSrgvMapParam.setRemark("outCache");
|
||||||
|
List<WcsSrgvMap> wcsSrgvMaps = wcsSrgvMapService.selectWcsSrgvMapList(wcsSrgvMapParam);
|
||||||
|
List<String> cacheSite = wcsSrgvMaps.stream().sorted(Comparator.comparing(WcsSrgvMap::getSiteId)).map(WcsSrgvMap::getSiteId).collect(Collectors.toList());
|
||||||
|
List<String> currentSRgvSite = new ArrayList<>();
|
||||||
|
// 判断是否有车是在一样的位置
|
||||||
|
for (String srgvCode : PlcSrgvRead.deviceSrgvMap.keySet()) {
|
||||||
|
currentSRgvSite.add(PlcSrgvRead.deviceSrgvMap.get(srgvCode).getCurrSite());
|
||||||
|
}
|
||||||
|
cacheSite.removeAll(currentSRgvSite);
|
||||||
|
if (CollUtil.isNotEmpty(cacheSite)) {
|
||||||
|
for (String cache : cacheSite) {
|
||||||
|
WcsSrgvQueue wcsSrgvQueueParam = new WcsSrgvQueue();
|
||||||
|
wcsSrgvQueueParam.setEndSite(cache);
|
||||||
|
// 判断是否有车要去这个缓存点 没有就更新
|
||||||
|
List<WcsSrgvQueue> wcsSrgvQueues1 = wcsSrgvQueueService.selectWcsSrgvQueueList(wcsSrgvQueueParam);
|
||||||
|
// WcsSrgvQueue wcsSrgvQueueParam1 = new WcsSrgvQueue();
|
||||||
|
// wcsSrgvQueueParam1.setStartSite(cache);
|
||||||
|
// // 并且从缓存点走的
|
||||||
|
// List<WcsSrgvQueue> wcsSrgvQueues2 = wcsSrgvQueueService.selectWcsSrgvQueueList(wcsSrgvQueueParam1);
|
||||||
|
if (CollUtil.isEmpty(wcsSrgvQueues1)) {
|
||||||
|
wcsSrgvQueue.setStartSite(startSite);
|
||||||
|
wcsSrgvQueue.setEndSite(cacheSite.get(0));
|
||||||
|
wcsSrgvQueue.setDefault02("7");
|
||||||
|
wcsSrgvQueueService.updateWcsSrgvQueue(wcsSrgvQueue);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
endSite = wcsSrgvQueue.getCargoPlaceSite();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "3":
|
case "3":
|
||||||
break;
|
break;
|
||||||
@@ -212,8 +259,16 @@ public class TsjThread implements Runnable {
|
|||||||
WcsSrgvMap wcsSrgvMapq = wcsSrgvMapService.selectWcsSrgvMapBySiteId(cargoPickSite);
|
WcsSrgvMap wcsSrgvMapq = wcsSrgvMapService.selectWcsSrgvMapBySiteId(cargoPickSite);
|
||||||
WcsSrgvMap wcsSrgvMapf = wcsSrgvMapService.selectWcsSrgvMapBySiteId(cargoPlaceSite);
|
WcsSrgvMap wcsSrgvMapf = wcsSrgvMapService.selectWcsSrgvMapBySiteId(cargoPlaceSite);
|
||||||
if (wcsSrgvMapq != null && wcsSrgvMapf != null) {
|
if (wcsSrgvMapq != null && wcsSrgvMapf != null) {
|
||||||
|
Integer count = wcsSrgvQueueService.selectByEndSite();
|
||||||
|
List<DeviceSrgv> collect = PlcSrgvRead.deviceSrgvMap.values().stream().filter(d ->
|
||||||
|
d.getCurrSite().equals(cargoPickSite))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if ((count > 0 || !collect.isEmpty()) && tsj.getDqcs() == 1) {
|
||||||
|
wcsSrgvQueue.setEndSite("070301");
|
||||||
|
} else {
|
||||||
|
wcsSrgvQueue.setEndSite(cargoPickSite);
|
||||||
|
}
|
||||||
|
|
||||||
wcsSrgvQueue.setEndSite(cargoPickSite);
|
|
||||||
wcsSrgvQueue.setDefault02("4");
|
wcsSrgvQueue.setDefault02("4");
|
||||||
wcsSrgvQueue.setTheFloor(wcsSrgvMapq.getTheLayer().toString());
|
wcsSrgvQueue.setTheFloor(wcsSrgvMapq.getTheLayer().toString());
|
||||||
wcsSrgvQueue.setDefault07(wcsSrgvMapf.getTheLayer().toString());
|
wcsSrgvQueue.setDefault07(wcsSrgvMapf.getTheLayer().toString());
|
||||||
@@ -257,7 +312,8 @@ public class TsjThread implements Runnable {
|
|||||||
for (String sRgv : PlcSrgvRead.deviceSrgvMap.keySet()) {
|
for (String sRgv : PlcSrgvRead.deviceSrgvMap.keySet()) {
|
||||||
DeviceSrgv deviceSrgv = PlcSrgvRead.deviceSrgvMap.get(sRgv);
|
DeviceSrgv deviceSrgv = PlcSrgvRead.deviceSrgvMap.get(sRgv);
|
||||||
Integer count = tsjDeviceExecutionQueueService.selectCount();
|
Integer count = tsjDeviceExecutionQueueService.selectCount();
|
||||||
if (deviceSrgv.getSpare2().equals("1") && deviceSrgv.getTaskNo() > 0 && count == 0) {
|
WcsSrgvQueue wcsSrgvQueue1 = wcsSrgvQueueService.selectWcsSrgvQueueByTaskNo(String.valueOf(deviceSrgv.getTaskNo()));
|
||||||
|
if (deviceSrgv.getSpare2().equals("1") && deviceSrgv.getTaskNo() > 0 && count == 0 && wcsSrgvQueue1.getEndSite().equals("tsj")) {
|
||||||
//请求进入输送机
|
//请求进入输送机
|
||||||
WcsSrgvQueue sRgvQueueParam = new WcsSrgvQueue();
|
WcsSrgvQueue sRgvQueueParam = new WcsSrgvQueue();
|
||||||
sRgvQueueParam.setAgvId(Convert.toStr(deviceSrgv.getDeviceId()));
|
sRgvQueueParam.setAgvId(Convert.toStr(deviceSrgv.getDeviceId()));
|
||||||
|
|||||||
@@ -0,0 +1,104 @@
|
|||||||
|
package com.ruoyi.system.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
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.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.system.domain.AgvContainerTask;
|
||||||
|
import com.ruoyi.system.service.IAgvContainerTaskService;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* agv料架搬运任务Controller
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2026-05-15
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/task")
|
||||||
|
public class AgvContainerTaskController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IAgvContainerTaskService agvContainerTaskService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询agv料架搬运任务列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:task:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(AgvContainerTask agvContainerTask)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<AgvContainerTask> list = agvContainerTaskService.selectAgvContainerTaskList(agvContainerTask);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出agv料架搬运任务列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:task:export')")
|
||||||
|
@Log(title = "agv料架搬运任务", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, AgvContainerTask agvContainerTask)
|
||||||
|
{
|
||||||
|
List<AgvContainerTask> list = agvContainerTaskService.selectAgvContainerTaskList(agvContainerTask);
|
||||||
|
ExcelUtil<AgvContainerTask> util = new ExcelUtil<AgvContainerTask>(AgvContainerTask.class);
|
||||||
|
util.exportExcel(response, list, "agv料架搬运任务数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取agv料架搬运任务详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:task:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return success(agvContainerTaskService.selectAgvContainerTaskById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增agv料架搬运任务
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:task:add')")
|
||||||
|
@Log(title = "agv料架搬运任务", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody AgvContainerTask agvContainerTask)
|
||||||
|
{
|
||||||
|
return toAjax(agvContainerTaskService.insertAgvContainerTask(agvContainerTask));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改agv料架搬运任务
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:task:edit')")
|
||||||
|
@Log(title = "agv料架搬运任务", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody AgvContainerTask agvContainerTask)
|
||||||
|
{
|
||||||
|
return toAjax(agvContainerTaskService.updateAgvContainerTask(agvContainerTask));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除agv料架搬运任务
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:task:remove')")
|
||||||
|
@Log(title = "agv料架搬运任务", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(agvContainerTaskService.deleteAgvContainerTaskByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,173 @@
|
|||||||
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* agv料架搬运任务对象 agv_container_task
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2026-05-15
|
||||||
|
*/
|
||||||
|
public class AgvContainerTask extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 作业编码 */
|
||||||
|
@Excel(name = "作业编码")
|
||||||
|
private String container;
|
||||||
|
|
||||||
|
/** 起点 */
|
||||||
|
@Excel(name = "起点")
|
||||||
|
private String startPoint;
|
||||||
|
|
||||||
|
/** 终点 */
|
||||||
|
@Excel(name = "终点")
|
||||||
|
private String endPoint;
|
||||||
|
|
||||||
|
/** 开始时间 */
|
||||||
|
@Excel(name = "开始时间")
|
||||||
|
private String startTime;
|
||||||
|
|
||||||
|
/** 结束时间 */
|
||||||
|
@Excel(name = "结束时间")
|
||||||
|
private String finishTime;
|
||||||
|
|
||||||
|
/** 任务号 */
|
||||||
|
@Excel(name = "任务号")
|
||||||
|
private String taskNo;
|
||||||
|
|
||||||
|
/** 任务状态 0-创建 1-执行中 2-完成 */
|
||||||
|
@Excel(name = "任务状态 0-创建 1-执行中 2-完成")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/** 任务类型 */
|
||||||
|
@Excel(name = "任务类型")
|
||||||
|
private String spare1;
|
||||||
|
|
||||||
|
/** 托盘码 */
|
||||||
|
@Excel(name = "托盘码")
|
||||||
|
private String spare2;
|
||||||
|
|
||||||
|
public void setId(Long id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContainer(String container)
|
||||||
|
{
|
||||||
|
this.container = container;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContainer()
|
||||||
|
{
|
||||||
|
return container;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartPoint(String startPoint)
|
||||||
|
{
|
||||||
|
this.startPoint = startPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStartPoint()
|
||||||
|
{
|
||||||
|
return startPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndPoint(String endPoint)
|
||||||
|
{
|
||||||
|
this.endPoint = endPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEndPoint()
|
||||||
|
{
|
||||||
|
return endPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartTime(String startTime)
|
||||||
|
{
|
||||||
|
this.startTime = startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStartTime()
|
||||||
|
{
|
||||||
|
return startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFinishTime(String finishTime)
|
||||||
|
{
|
||||||
|
this.finishTime = finishTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFinishTime()
|
||||||
|
{
|
||||||
|
return finishTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskNo(String taskNo)
|
||||||
|
{
|
||||||
|
this.taskNo = taskNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTaskNo()
|
||||||
|
{
|
||||||
|
return taskNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(String status)
|
||||||
|
{
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatus()
|
||||||
|
{
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpare1(String spare1)
|
||||||
|
{
|
||||||
|
this.spare1 = spare1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSpare1()
|
||||||
|
{
|
||||||
|
return spare1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpare2(String spare2)
|
||||||
|
{
|
||||||
|
this.spare2 = spare2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSpare2()
|
||||||
|
{
|
||||||
|
return spare2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("container", getContainer())
|
||||||
|
.append("startPoint", getStartPoint())
|
||||||
|
.append("endPoint", getEndPoint())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("startTime", getStartTime())
|
||||||
|
.append("finishTime", getFinishTime())
|
||||||
|
.append("taskNo", getTaskNo())
|
||||||
|
.append("status", getStatus())
|
||||||
|
.append("spare1", getSpare1())
|
||||||
|
.append("spare2", getSpare2())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.system.domain.AgvContainerTask;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* agv料架搬运任务Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2026-05-15
|
||||||
|
*/
|
||||||
|
public interface AgvContainerTaskMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param id agv料架搬运任务主键
|
||||||
|
* @return agv料架搬运任务
|
||||||
|
*/
|
||||||
|
public AgvContainerTask selectAgvContainerTaskById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询agv料架搬运任务列表
|
||||||
|
*
|
||||||
|
* @param agvContainerTask agv料架搬运任务
|
||||||
|
* @return agv料架搬运任务集合
|
||||||
|
*/
|
||||||
|
public List<AgvContainerTask> selectAgvContainerTaskList(AgvContainerTask agvContainerTask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param agvContainerTask agv料架搬运任务
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertAgvContainerTask(AgvContainerTask agvContainerTask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param agvContainerTask agv料架搬运任务
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateAgvContainerTask(AgvContainerTask agvContainerTask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param id agv料架搬运任务主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAgvContainerTaskById(Long id);
|
||||||
|
|
||||||
|
public int deleteAgvContainerTaskByContainer(String orderId);
|
||||||
|
/**
|
||||||
|
* 批量删除agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAgvContainerTaskByIds(Long[] ids);
|
||||||
|
|
||||||
|
void insertAgvContainerTaskFinish(String orderId);
|
||||||
|
|
||||||
|
void updateAgvContainerTaskByOrder(String orderId);
|
||||||
|
|
||||||
|
AgvContainerTask selectAgvContainerFinishOne();
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package com.ruoyi.system.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.system.domain.AgvContainerTask;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* agv料架搬运任务Service接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2026-05-15
|
||||||
|
*/
|
||||||
|
public interface IAgvContainerTaskService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param id agv料架搬运任务主键
|
||||||
|
* @return agv料架搬运任务
|
||||||
|
*/
|
||||||
|
public AgvContainerTask selectAgvContainerTaskById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询agv料架搬运任务列表
|
||||||
|
*
|
||||||
|
* @param agvContainerTask agv料架搬运任务
|
||||||
|
* @return agv料架搬运任务集合
|
||||||
|
*/
|
||||||
|
public List<AgvContainerTask> selectAgvContainerTaskList(AgvContainerTask agvContainerTask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param agvContainerTask agv料架搬运任务
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertAgvContainerTask(AgvContainerTask agvContainerTask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param agvContainerTask agv料架搬运任务
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateAgvContainerTask(AgvContainerTask agvContainerTask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的agv料架搬运任务主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAgvContainerTaskByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除agv料架搬运任务信息
|
||||||
|
*
|
||||||
|
* @param id agv料架搬运任务主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAgvContainerTaskById(Long id);
|
||||||
|
|
||||||
|
void deleteAgvContainerTaskByOrderId(String container);
|
||||||
|
}
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
package com.ruoyi.system.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.system.mapper.AgvContainerTaskMapper;
|
||||||
|
import com.ruoyi.system.domain.AgvContainerTask;
|
||||||
|
import com.ruoyi.system.service.IAgvContainerTaskService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* agv料架搬运任务Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2026-05-15
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class AgvContainerTaskServiceImpl implements IAgvContainerTaskService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private AgvContainerTaskMapper agvContainerTaskMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param id agv料架搬运任务主键
|
||||||
|
* @return agv料架搬运任务
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AgvContainerTask selectAgvContainerTaskById(Long id)
|
||||||
|
{
|
||||||
|
return agvContainerTaskMapper.selectAgvContainerTaskById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询agv料架搬运任务列表
|
||||||
|
*
|
||||||
|
* @param agvContainerTask agv料架搬运任务
|
||||||
|
* @return agv料架搬运任务
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<AgvContainerTask> selectAgvContainerTaskList(AgvContainerTask agvContainerTask)
|
||||||
|
{
|
||||||
|
return agvContainerTaskMapper.selectAgvContainerTaskList(agvContainerTask);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param agvContainerTask agv料架搬运任务
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertAgvContainerTask(AgvContainerTask agvContainerTask)
|
||||||
|
{
|
||||||
|
agvContainerTask.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return agvContainerTaskMapper.insertAgvContainerTask(agvContainerTask);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param agvContainerTask agv料架搬运任务
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateAgvContainerTask(AgvContainerTask agvContainerTask)
|
||||||
|
{
|
||||||
|
return agvContainerTaskMapper.updateAgvContainerTask(agvContainerTask);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的agv料架搬运任务主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteAgvContainerTaskByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return agvContainerTaskMapper.deleteAgvContainerTaskByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除agv料架搬运任务信息
|
||||||
|
*
|
||||||
|
* @param id agv料架搬运任务主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteAgvContainerTaskById(Long id)
|
||||||
|
{
|
||||||
|
return agvContainerTaskMapper.deleteAgvContainerTaskById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteAgvContainerTaskByOrderId(String container) {
|
||||||
|
agvContainerTaskMapper.deleteAgvContainerTaskByContainer(container);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -80,7 +80,7 @@ public class GetDeviceSrgvMap {
|
|||||||
AgvDto dto = new AgvDto();
|
AgvDto dto = new AgvDto();
|
||||||
dto.setId(d.getDeviceId() == null ? "" : String.format("%04d", d.getDeviceId()));
|
dto.setId(d.getDeviceId() == null ? "" : String.format("%04d", d.getDeviceId()));
|
||||||
dto.setTaskNo(d.getTaskNo() == null ? "" : String.valueOf(d.getTaskNo()));
|
dto.setTaskNo(d.getTaskNo() == null ? "" : String.valueOf(d.getTaskNo()));
|
||||||
dto.setIsThere((d.getWorkPhase() >= 3 && d.getWorkPhase() < 6 ? "1" : "0"));
|
dto.setIsThere(d.getCargoFlag()==256?"1":"0");
|
||||||
Integer wp = d.getWorkPhase();
|
Integer wp = d.getWorkPhase();
|
||||||
String status = "0";
|
String status = "0";
|
||||||
if (wp != null) {
|
if (wp != null) {
|
||||||
|
|||||||
@@ -101,14 +101,10 @@ public class GetDeviceSsjMap {
|
|||||||
dto.setAlarmMsg(DictUtils.getDictLabel("ssj_ex", String.valueOf(d.getException())));
|
dto.setAlarmMsg(DictUtils.getDictLabel("ssj_ex", String.valueOf(d.getException())));
|
||||||
dto.setKX(String.valueOf(d.getKx()));
|
dto.setKX(String.valueOf(d.getKx()));
|
||||||
if (!dto.getTaskNo().equals("0")){
|
if (!dto.getTaskNo().equals("0")){
|
||||||
if (dto.getRotationDirection().equals("1")){
|
if (dto.getKX().equals("0")){
|
||||||
dto.setDW(String.valueOf(d.getDw()));
|
dto.setDW("1");
|
||||||
}else {
|
}else {
|
||||||
if (dto.getKX().equals("0")){
|
dto.setDW("0");
|
||||||
dto.setDW("1");
|
|
||||||
}else {
|
|
||||||
dto.setDW("0");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
dto.setDW("0");
|
dto.setDW("0");
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ public class Wcs2wmsgetEmptyCargoSpace {
|
|||||||
dto.setTrayCode(getText(node, "trayCode"));
|
dto.setTrayCode(getText(node, "trayCode"));
|
||||||
dto.setProductCode(getText(node, "productCode"));
|
dto.setProductCode(getText(node, "productCode"));
|
||||||
dto.setProductName(getText(node, "productName"));
|
dto.setProductName(getText(node, "productName"));
|
||||||
|
dto.setCargoSpaceId(getText(node, "cargoSpaceId"));
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,5 +126,6 @@ public class Wcs2wmsgetEmptyCargoSpace {
|
|||||||
private String trayCode;
|
private String trayCode;
|
||||||
private String productCode;
|
private String productCode;
|
||||||
private String productName;
|
private String productName;
|
||||||
|
private String cargoSpaceId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -144,4 +144,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
#{reqCode}
|
#{reqCode}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
<select id="selectKx" parameterType="java.util.Map" statementType="CALLABLE">
|
||||||
|
{call proc_select_kx(#{v_position,mode=IN,jdbcType=VARCHAR},
|
||||||
|
#{v_orderId,mode=IN,jdbcType=VARCHAR},
|
||||||
|
#{v_type,mode=IN,jdbcType=VARCHAR},
|
||||||
|
#{v_result,mode=OUT,jdbcType=INTEGER},
|
||||||
|
#{v_result_msg,mode=OUT,jdbcType=VARCHAR})}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="setFloor != null">set_floor = #{setFloor},</if>
|
<if test="setFloor != null">set_floor = #{setFloor},</if>
|
||||||
<if test="powerTime != null">power_time = #{powerTime},</if>
|
<if test="powerTime != null">power_time = #{powerTime},</if>
|
||||||
<if test="lastTime != null">last_time = #{lastTime},</if>
|
|
||||||
<if test="agvStatus != null">agv_status = #{agvStatus},</if>
|
<if test="agvStatus != null">agv_status = #{agvStatus},</if>
|
||||||
<if test="taskNo != null">task_no = #{taskNo},</if>
|
<if test="taskNo != null">task_no = #{taskNo},</if>
|
||||||
<if test="srcSite != null">src_site = #{srcSite},</if>
|
<if test="srcSite != null">src_site = #{srcSite},</if>
|
||||||
@@ -227,6 +227,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<update id="updateLastTimeByAgvId" parameterType="String">
|
<update id="updateLastTimeByAgvId" parameterType="String">
|
||||||
update device_srgv set last_time =getdate() where agv_id=#{agvId}
|
update device_srgv set last_time =convert(varchar,getdate(),120) where guid=#{agvId}
|
||||||
</update>
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="priority != null "> and priority = #{priority}</if>
|
<if test="priority != null "> and priority = #{priority}</if>
|
||||||
<if test="executionPhase != null and executionPhase != ''"> and execution_phase = #{executionPhase}</if>
|
<if test="executionPhase != null and executionPhase != ''"> and execution_phase = #{executionPhase}</if>
|
||||||
<if test="inOrOut != null and inOrOut != ''"> and in_or_out = #{inOrOut}</if>
|
<if test="inOrOut != null and inOrOut != ''"> and in_or_out = #{inOrOut}</if>
|
||||||
<if test="startTime != null and startTime != ''"> and start_time = #{startTime}</if>
|
<if test="startTime != null and startTime != ''"> and finish_time >= #{startTime}</if>
|
||||||
<if test="finishTime != null and finishTime != ''"> and finish_time = #{finishTime}</if>
|
<if test="finishTime != null and finishTime != ''"> and finish_time <= #{finishTime}</if>
|
||||||
<if test="entranceId != null and entranceId != ''"> and entrance_id = #{entranceId}</if>
|
<if test="entranceId != null and entranceId != ''"> and entrance_id = #{entranceId}</if>
|
||||||
<if test="exitId != null and exitId != ''"> and exit_id = #{exitId}</if>
|
<if test="exitId != null and exitId != ''"> and exit_id = #{exitId}</if>
|
||||||
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
|
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
|
||||||
@@ -229,8 +229,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="priority != null "> and priority = #{priority}</if>
|
<if test="priority != null "> and priority = #{priority}</if>
|
||||||
<if test="executionPhase != null and executionPhase != ''"> and execution_phase = #{executionPhase}</if>
|
<if test="executionPhase != null and executionPhase != ''"> and execution_phase = #{executionPhase}</if>
|
||||||
<if test="inOrOut != null and inOrOut != ''"> and in_or_out = #{inOrOut}</if>
|
<if test="inOrOut != null and inOrOut != ''"> and in_or_out = #{inOrOut}</if>
|
||||||
<if test="startTime != null and startTime != ''"> and start_time = #{startTime}</if>
|
<if test="startTime != null and startTime != ''"> and finish_time >= #{startTime}</if>
|
||||||
<if test="finishTime != null and finishTime != ''"> and finish_time = #{finishTime}</if>
|
<if test="finishTime != null and finishTime != ''"> and finish_time <= #{finishTime}</if>
|
||||||
<if test="entranceId != null and entranceId != ''"> and entrance_id = #{entranceId}</if>
|
<if test="entranceId != null and entranceId != ''"> and entrance_id = #{entranceId}</if>
|
||||||
<if test="exitId != null and exitId != ''"> and exit_id = #{exitId}</if>
|
<if test="exitId != null and exitId != ''"> and exit_id = #{exitId}</if>
|
||||||
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
|
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
|
||||||
@@ -251,50 +251,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
<select id="selectMydoJobOut" resultMap="MydoJobResult">
|
<select id="selectMydoJobOut" resultMap="MydoJobResult">
|
||||||
WITH floor_group AS (
|
WITH floor_group AS (
|
||||||
SELECT
|
SELECT
|
||||||
b.cargo_space_id,
|
b.cargo_space_id,
|
||||||
b.group_coding_no,
|
b.group_coding_no,
|
||||||
b.the_floor,
|
b.the_floor,
|
||||||
b.group_coding,
|
b.group_coding,
|
||||||
a.task_no AS task_no,
|
a.task_no,
|
||||||
a.job_id AS job_id,
|
a.job_id,
|
||||||
a.in_or_out, -- 之前新增的字段
|
a.in_or_out,
|
||||||
a.target_cargo_space_id, -- 新增字段:加入target_cargo_space_id
|
a.target_cargo_space_id,
|
||||||
ROW_NUMBER() OVER (PARTITION BY b.the_floor ORDER BY b.group_coding DESC) AS rn
|
ROW_NUMBER() OVER (
|
||||||
FROM
|
PARTITION BY b.the_floor, b.group_coding_no
|
||||||
mydo_job_wcs a
|
ORDER BY b.group_coding DESC,
|
||||||
INNER JOIN bas_cargo_space b
|
CASE WHEN a.in_or_out = 30 THEN 0 ELSE 1 END,
|
||||||
ON a.cargo_space_id = b.cargo_space_id
|
a.create_time ASC,
|
||||||
AND a.the_floor = b.the_floor
|
a.job_id ASC
|
||||||
WHERE
|
) AS rn
|
||||||
a.in_or_out >= 20
|
FROM mydo_job_wcs a
|
||||||
AND a.status = '1'
|
INNER JOIN bas_cargo_space b
|
||||||
GROUP BY
|
ON a.cargo_space_id = b.cargo_space_id
|
||||||
b.group_coding_no,
|
AND a.the_floor = b.the_floor
|
||||||
b.cargo_space_id,
|
WHERE a.in_or_out >= 20
|
||||||
b.the_floor,
|
|
||||||
b.group_coding,
|
|
||||||
a.task_no,
|
|
||||||
a.job_id,
|
|
||||||
a.create_time,
|
|
||||||
a.in_or_out, -- 之前新增的分组字段
|
|
||||||
a.target_cargo_space_id -- 分组字段中新增:必须加入GROUP BY
|
|
||||||
)
|
)
|
||||||
SELECT
|
SELECT
|
||||||
cargo_space_id,
|
cargo_space_id,
|
||||||
group_coding_no,
|
group_coding_no,
|
||||||
the_floor,
|
the_floor,
|
||||||
task_no,
|
group_coding,
|
||||||
job_id,
|
task_no,
|
||||||
in_or_out, -- 之前新增的展示字段
|
job_id,
|
||||||
target_cargo_space_id -- 最终查询结果中显示该字段
|
in_or_out,
|
||||||
FROM
|
target_cargo_space_id
|
||||||
floor_group
|
FROM floor_group
|
||||||
WHERE
|
WHERE rn = 1 -- ✅ 每次每层每个通道只取 1 条
|
||||||
rn <= 1
|
ORDER BY group_coding DESC;
|
||||||
ORDER BY
|
|
||||||
group_coding DESC;
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
<select id="selectMydoJobByTrayCode" resultMap="MydoJobResult">
|
<select id="selectMydoJobByTrayCode" resultMap="MydoJobResult">
|
||||||
<include refid="selectMydoJobVo"/>
|
<include refid="selectMydoJobVo"/>
|
||||||
@@ -310,5 +300,37 @@ select count(1) from mydo_job_wcs where in_or_out>=20 and exit_id = #{exitId}
|
|||||||
select count(1) from mydo_job_wcs
|
select count(1) from mydo_job_wcs
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectMydoJobIn" resultType="java.lang.Integer">
|
||||||
|
select count(1) from mydo_job_wcs where in_or_out <20 and cargo_space_id is null and status='3' and execution_phase='1'
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectMydoJobCountOut" resultType="java.lang.Integer">
|
||||||
|
select count(1) from mydo_job_wcs where in_or_out>20
|
||||||
|
</select>
|
||||||
|
<select id="selectByJobOut" parameterType="java.lang.Integer" resultType="java.lang.Integer">
|
||||||
|
select count(1)
|
||||||
|
from mydo_job_wcs
|
||||||
|
where in_or_out > 20
|
||||||
|
and status = '1'
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectByJobOutIsOne" parameterType="java.lang.Integer" resultType="java.lang.Integer">
|
||||||
|
select count(1) from mydo_job_wcs where in_or_out>20 and status='1' and the_floor=1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectMydoJobExit" parameterType="string" resultType="integer">
|
||||||
|
select count(1) from mydo_job_wcs where in_or_out>20 and exit_id=#{exit}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectTheFloorYk" parameterType="string" resultType="java.lang.Integer">
|
||||||
|
select count(1) from mydo_job_wcs where the_floor=#{theFloor} and in_or_out=30
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<delete id="deleteMydoJobByTaskNos">
|
||||||
|
delete from mydo_job_wcs where task_no in
|
||||||
|
<foreach item="taskNo" collection="taskNos" open="(" separator="," close=")">
|
||||||
|
#{taskNo}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -222,4 +222,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
select count(1) from wcs_srgv_queue where cargo_place_site=#{siteId}
|
select count(1) from wcs_srgv_queue where cargo_place_site=#{siteId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectByEndSite" resultType="java.lang.Integer" >
|
||||||
|
select count(1) from wcs_srgv_queue where end_site='070101' or end_site ='050101'
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectTaskNosByGuids" parameterType="String" resultType="string">
|
||||||
|
select task_no from wcs_srgv_queue where guid in
|
||||||
|
<foreach item="guid" collection="array" open="(" separator="," close=")">
|
||||||
|
#{guid}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -0,0 +1,116 @@
|
|||||||
|
<?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.ruoyi.system.mapper.AgvContainerTaskMapper">
|
||||||
|
|
||||||
|
<resultMap type="AgvContainerTask" id="AgvContainerTaskResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="container" column="container" />
|
||||||
|
<result property="startPoint" column="start_point" />
|
||||||
|
<result property="endPoint" column="end_point" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="startTime" column="start_time" />
|
||||||
|
<result property="finishTime" column="finish_time" />
|
||||||
|
<result property="taskNo" column="task_no" />
|
||||||
|
<result property="status" column="status" />
|
||||||
|
<result property="spare1" column="spare1" />
|
||||||
|
<result property="spare2" column="spare2" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectAgvContainerTaskVo">
|
||||||
|
select id, container, start_point, end_point, create_time, start_time, finish_time, task_no, status, spare1, spare2 from agv_container_task
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectAgvContainerTaskList" parameterType="AgvContainerTask" resultMap="AgvContainerTaskResult">
|
||||||
|
<include refid="selectAgvContainerTaskVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="container != null and container != ''"> and container = #{container}</if>
|
||||||
|
<if test="startPoint != null and startPoint != ''"> and start_point = #{startPoint}</if>
|
||||||
|
<if test="endPoint != null and endPoint != ''"> and end_point = #{endPoint}</if>
|
||||||
|
<if test="startTime != null and startTime != ''"> and start_time = #{startTime}</if>
|
||||||
|
<if test="finishTime != null and finishTime != ''"> and finish_time = #{finishTime}</if>
|
||||||
|
<if test="taskNo != null and taskNo != ''"> and task_no = #{taskNo}</if>
|
||||||
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||||
|
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
|
||||||
|
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectAgvContainerTaskById" parameterType="Long" resultMap="AgvContainerTaskResult">
|
||||||
|
<include refid="selectAgvContainerTaskVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertAgvContainerTask" parameterType="AgvContainerTask" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into agv_container_task
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="container != null">container,</if>
|
||||||
|
<if test="startPoint != null">start_point,</if>
|
||||||
|
<if test="endPoint != null">end_point,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="startTime != null">start_time,</if>
|
||||||
|
<if test="finishTime != null">finish_time,</if>
|
||||||
|
<if test="taskNo != null">task_no,</if>
|
||||||
|
<if test="status != null">status,</if>
|
||||||
|
<if test="spare1 != null">spare1,</if>
|
||||||
|
<if test="spare2 != null">spare2,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="container != null">#{container},</if>
|
||||||
|
<if test="startPoint != null">#{startPoint},</if>
|
||||||
|
<if test="endPoint != null">#{endPoint},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="startTime != null">#{startTime},</if>
|
||||||
|
<if test="finishTime != null">#{finishTime},</if>
|
||||||
|
<if test="taskNo != null">#{taskNo},</if>
|
||||||
|
<if test="status != null">#{status},</if>
|
||||||
|
<if test="spare1 != null">#{spare1},</if>
|
||||||
|
<if test="spare2 != null">#{spare2},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateAgvContainerTask" parameterType="AgvContainerTask">
|
||||||
|
update agv_container_task
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="container != null">container = #{container},</if>
|
||||||
|
<if test="startPoint != null">start_point = #{startPoint},</if>
|
||||||
|
<if test="endPoint != null">end_point = #{endPoint},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="startTime != null">start_time = #{startTime},</if>
|
||||||
|
<if test="finishTime != null">finish_time = #{finishTime},</if>
|
||||||
|
<if test="taskNo != null">task_no = #{taskNo},</if>
|
||||||
|
<if test="status != null">status = #{status},</if>
|
||||||
|
<if test="spare1 != null">spare1 = #{spare1},</if>
|
||||||
|
<if test="spare2 != null">spare2 = #{spare2},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteAgvContainerTaskById" parameterType="Long">
|
||||||
|
delete from agv_container_task where id = #{id}
|
||||||
|
</delete>
|
||||||
|
<delete id="deleteAgvContainerTaskByContainer" parameterType="string">
|
||||||
|
delete from agv_container_task where container = #{container}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteAgvContainerTaskByIds" parameterType="String">
|
||||||
|
delete from agv_container_task where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="insertAgvContainerTaskFinish" parameterType="string">
|
||||||
|
insert into agv_container_task_finish select * from agv_container_task where container=#{orderId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateAgvContainerTaskByOrder" parameterType="string">
|
||||||
|
update agv_container_task set status='2' where container=#{orderId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="selectAgvContainerFinishOne" resultMap="AgvContainerTaskResult">
|
||||||
|
select top 1 * from agv_container_task where status='2'
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -26,9 +26,7 @@ public class AjaxResult extends HashMap<String, Object>
|
|||||||
/**
|
/**
|
||||||
* 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。
|
* 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。
|
||||||
*/
|
*/
|
||||||
public AjaxResult()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化一个新创建的 AjaxResult 对象
|
* 初始化一个新创建的 AjaxResult 对象
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ public class SecurityConfig
|
|||||||
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
||||||
.antMatchers("/swagger-ui.html", "/changeLanguage", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**", "/pda/**").permitAll()
|
.antMatchers("/swagger-ui.html", "/changeLanguage", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**", "/pda/**").permitAll()
|
||||||
.antMatchers("/device/operation/**").permitAll()
|
.antMatchers("/device/operation/**").permitAll()
|
||||||
.antMatchers("/agv/api/**").permitAll()
|
.antMatchers("/api/agv/**").permitAll()
|
||||||
.antMatchers("/device/api/**").permitAll()
|
.antMatchers("/device/api/**").permitAll()
|
||||||
.antMatchers("/wcs2Wms/api/**").permitAll()
|
.antMatchers("/wcs2Wms/api/**").permitAll()
|
||||||
.antMatchers("/test/**").permitAll()
|
.antMatchers("/test/**").permitAll()
|
||||||
|
|||||||
Reference in New Issue
Block a user