调整wms接口增加的字段
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
package com.ruoyi;
|
||||
|
||||
import com.ruoyi.job.service.IMydoJobService;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
/**
|
||||
* 启动程序
|
||||
*
|
||||
@@ -23,5 +27,6 @@ public class RuoYiApplication
|
||||
// System.setProperty("spring.devtools.restart.enabled", "false");
|
||||
SpringApplication.run(RuoYiApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 福来瑞达WCS系统启动成功 ლ(´ڡ`ლ)゙ ");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import lombok.NoArgsConstructor;
|
||||
public class StockinReceive {
|
||||
|
||||
/**
|
||||
* 系统生成的任务编号(唯一)
|
||||
* 系统生成的任务编号(唯一)/wms下发的任务号
|
||||
*/
|
||||
private String taskCode;
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -150,7 +151,7 @@ public class ApiServiceImpl implements IApiService {
|
||||
*/
|
||||
@Override
|
||||
public RequestLog finishMydoJob(Map<String, Object> param) {
|
||||
return requestLogService.getRequestLog(JOB_FINISH_URL, "任务完成上报", JSONUtil.toJsonStr(param));
|
||||
return requestLogService.getRequestLog(WMS_TASK_FINISH, "任务完成上报", JSONUtil.toJsonStr(param));
|
||||
}
|
||||
|
||||
|
||||
@@ -576,6 +577,31 @@ public class ApiServiceImpl implements IApiService {
|
||||
}
|
||||
}
|
||||
|
||||
//// @PostConstruct
|
||||
// void qwe() {
|
||||
// HashMap<String, Object> map = new HashMap<>();
|
||||
// map.put("v_param", "RK");
|
||||
// mydoJobService.getJobId(map);
|
||||
// String s = map.get("v_serial").toString();
|
||||
// System.out.println(s);
|
||||
//
|
||||
//
|
||||
// map.put("v_param", "CK");
|
||||
// mydoJobService.getJobId(map);
|
||||
// s = map.get("v_serial").toString();
|
||||
// System.out.println(s);
|
||||
//
|
||||
// map.put("v_param", "2");
|
||||
// mydoJobService.getTaskNo(map);
|
||||
// s = map.get("v_serial").toString();
|
||||
// System.out.println(s);
|
||||
//
|
||||
// map.put("v_param", "3");
|
||||
// mydoJobService.getTaskNo(map);
|
||||
// s = map.get("v_serial").toString();
|
||||
// System.out.println(s);
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class Constant {
|
||||
public static final String WMS_STOCKIN_MYDOJOB = WMS_BASE_URL + "/api/external/taskIssue";
|
||||
|
||||
/**
|
||||
* 向wms请求任务回传url
|
||||
* 出入库回传url
|
||||
*/
|
||||
public static final String WMS_TASK_FINISH = WMS_BASE_URL + "/api/external/taskIssue";
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ public class JobCallBackController extends BaseController
|
||||
return toAjax(jobCallBackService.deleteJobCallBackByIds(ids));
|
||||
}
|
||||
|
||||
@Scheduled(fixedDelay=1500)
|
||||
@Scheduled(fixedDelay=2000)
|
||||
public void jobCallBack() {
|
||||
jobCallBackService.jobCallBack();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package com.ruoyi.job.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
@@ -11,6 +15,10 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
||||
* @author ruoyi
|
||||
* @date 2025-09-25
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
public class JobCallBack extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -34,110 +42,17 @@ public class JobCallBack extends BaseEntity
|
||||
@Excel(name = "状态")
|
||||
private String status;
|
||||
|
||||
/** 备用字段1 */
|
||||
@Excel(name = "备用字段1")
|
||||
private String spare1;
|
||||
/** wms任务类型编号 */
|
||||
@Excel(name = "wms任务类型编号")
|
||||
private String taskTypeCode;
|
||||
|
||||
/** 备用字段2 */
|
||||
@Excel(name = "备用字段2")
|
||||
private String spare2;
|
||||
/** 请求唯一编号,原样回传到响应中,便于追踪 */
|
||||
@Excel(name = "请求唯一编号")
|
||||
private String reqCode;
|
||||
|
||||
/** 备用字段3 */
|
||||
@Excel(name = "备用字段3")
|
||||
private String spare3;
|
||||
/** wms任务编号 */
|
||||
@Excel(name = "wms任务编号")
|
||||
private String taskCode;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setType(String type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setTaskNo(Long taskNo)
|
||||
{
|
||||
this.taskNo = taskNo;
|
||||
}
|
||||
|
||||
public Long getTaskNo()
|
||||
{
|
||||
return taskNo;
|
||||
}
|
||||
|
||||
public void setMydojobId(String mydojobId)
|
||||
{
|
||||
this.mydojobId = mydojobId;
|
||||
}
|
||||
|
||||
public String getMydojobId()
|
||||
{
|
||||
return mydojobId;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public void setSpare3(String spare3)
|
||||
{
|
||||
this.spare3 = spare3;
|
||||
}
|
||||
|
||||
public String getSpare3()
|
||||
{
|
||||
return spare3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("type", getType())
|
||||
.append("taskNo", getTaskNo())
|
||||
.append("mydojobId", getMydojobId())
|
||||
.append("status", getStatus())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("spare1", getSpare1())
|
||||
.append("spare2", getSpare2())
|
||||
.append("spare3", getSpare3())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,4 +97,10 @@ public class MydoJob extends BaseEntity
|
||||
private String traySize;
|
||||
|
||||
private List<String> epList;
|
||||
|
||||
/**
|
||||
* wms下发的任务号
|
||||
*/
|
||||
@Excel(name = "wms任务号")
|
||||
private String wmsTaskNo;
|
||||
}
|
||||
|
||||
@@ -100,4 +100,19 @@ public interface MydoJobMapper
|
||||
List<MydoJob> getInJobByEntranceId(@Param("entranceId") String exitId);
|
||||
|
||||
MydoJob selectMydoJobByExitId(@Param("exitId") String exitId);
|
||||
|
||||
/**
|
||||
* 获取本地生成作业号
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
void getJobId(HashMap<String, Object> map);
|
||||
|
||||
/**
|
||||
* 获取本地生成的任务号
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
void getTaskNo(HashMap<String, Object> map);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.ruoyi.job.service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 作业信息Service接口
|
||||
@@ -93,4 +95,19 @@ public interface IMydoJobService
|
||||
List<MydoJob> getInJobByEntranceId(String exitId);
|
||||
|
||||
MydoJob selectMydoJobByExitId(String exitId);
|
||||
|
||||
/**
|
||||
* 获取本地生成作业号
|
||||
* @param type RK-入库 CK-出库
|
||||
* @return
|
||||
*/
|
||||
String getJobId(String type);
|
||||
|
||||
/**
|
||||
* 获取本地生成任务号
|
||||
* @param type 2-入库 3-出库
|
||||
* @return
|
||||
*/
|
||||
String getTaskNo(String type);
|
||||
|
||||
}
|
||||
|
||||
@@ -103,39 +103,46 @@ public class JobCallBackServiceImpl implements IJobCallBackService
|
||||
|
||||
@Override
|
||||
public void jobCallBack() {
|
||||
// List<JobCallBack> jobCallBackList = jobCallBackMapper.selectJobCallBackListNoSuccess();
|
||||
// for (JobCallBack jobCallBack : jobCallBackList) {
|
||||
//获取【刚刚创建】和【请求失败】的回传记录
|
||||
List<JobCallBack> jobCallBackList = jobCallBackMapper.selectJobCallBackListNoSuccess();
|
||||
for (JobCallBack jobCallBack : jobCallBackList) {
|
||||
|
||||
//设定请求参数
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
param.put("taskTypeCode", jobCallBack.getTaskTypeCode());
|
||||
param.put("reqCode", jobCallBack.getReqCode());
|
||||
param.put("taskCode", jobCallBack.getTaskCode());
|
||||
|
||||
//请求回传
|
||||
RequestLog requestLog = apiService.finishMydoJob(param);
|
||||
if ("0".equals(requestLog.getIsSuccessful())){
|
||||
jobCallBack.setStatus("1");
|
||||
}else{
|
||||
jobCallBack.setStatus("99");
|
||||
}
|
||||
jobCallBackMapper.updateJobCallBack(jobCallBack);
|
||||
}
|
||||
|
||||
// List<JobCallBack> list = jobCallBackMapper.getTopJobCallBack();
|
||||
// if(list != null && list.size() > 0){
|
||||
// JobCallBack jobCallBack = list.get(0);
|
||||
// Map<String, Object> param = new HashMap<>();
|
||||
// param.put("jobId", jobCallBack.getMydojobId());
|
||||
// param.put("taskNo", jobCallBack.getTaskNo());
|
||||
// param.put("wmsType", jobCallBack.getType());
|
||||
// RequestLog requestLog = apiService.finishMydoJob(param);
|
||||
// if ("1".equals(requestLog.getIsSuccessful())){
|
||||
// if ("0".equals(requestLog.getIsSuccessful())){
|
||||
// jobCallBack.setStatus("1");
|
||||
// jobCallBackMapper.updateJobCallBack(jobCallBack);
|
||||
// }else{
|
||||
// if(Integer.parseInt(jobCallBack.getSpare1()) < 2){
|
||||
// jobCallBack.setSpare1(String.valueOf(Integer.parseInt(jobCallBack.getSpare1())+1));
|
||||
// jobCallBackMapper.updateJobCallBack(jobCallBack);
|
||||
// }else{
|
||||
// jobCallBack.setStatus("2");
|
||||
// jobCallBackMapper.updateJobCallBack(jobCallBack);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
List<JobCallBack> list = jobCallBackMapper.getTopJobCallBack();
|
||||
if(list != null && list.size() > 0){
|
||||
JobCallBack jobCallBack = list.get(0);
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
param.put("jobId", jobCallBack.getMydojobId());
|
||||
param.put("taskNo", jobCallBack.getTaskNo());
|
||||
param.put("wmsType", jobCallBack.getType());
|
||||
RequestLog requestLog = apiService.finishMydoJob(param);
|
||||
if ("0".equals(requestLog.getIsSuccessful())){
|
||||
jobCallBack.setStatus("1");
|
||||
jobCallBackMapper.updateJobCallBack(jobCallBack);
|
||||
}else{
|
||||
if(Integer.parseInt(jobCallBack.getSpare1()) < 2){
|
||||
jobCallBack.setSpare1(String.valueOf(Integer.parseInt(jobCallBack.getSpare1())+1));
|
||||
jobCallBackMapper.updateJobCallBack(jobCallBack);
|
||||
}else{
|
||||
jobCallBack.setStatus("2");
|
||||
jobCallBackMapper.updateJobCallBack(jobCallBack);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ import com.ruoyi.job.mapper.MydoJobMapper;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.job.service.IMydoJobService;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
/**
|
||||
* 作业信息Service业务层处理
|
||||
*
|
||||
@@ -171,7 +173,7 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动处理同一【作业单号】的作业
|
||||
* 手动完成同一【作业单号】的作业
|
||||
* 如果【jobid】和【taskno】是一对多的情况,使用上一个方法<OuthandFinish>手动完成作业会导致整个【jobid】单据完成回传
|
||||
* @param jobIds
|
||||
* @return
|
||||
@@ -180,19 +182,33 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
public AjaxResult OuthandFinish(String[] jobIds) {
|
||||
//获取所有符合【任务单号】的作业
|
||||
for (String jobId : jobIds) {
|
||||
|
||||
//todo 是否需要校验响应成功后再执行历史表操作
|
||||
|
||||
//插入历史表
|
||||
mydoJobMapper.insertHistory(jobId);
|
||||
|
||||
//生成回传记录的参数
|
||||
MydoJob mydoJob = mydoJobMapper.selectMydoJobByJobId(jobId);
|
||||
JobCallBack jobCallBack = new JobCallBack();
|
||||
long jobIdNum = Long.parseLong(mydoJob.getInOrOut());
|
||||
if (jobIdNum > 20){
|
||||
jobCallBack.setType("2");
|
||||
}else{jobCallBack.setType("1");}
|
||||
}else{
|
||||
jobCallBack.setType("1");
|
||||
}
|
||||
|
||||
jobCallBack.setMydojobId(mydoJob.getJobId());
|
||||
jobCallBack.setStatus("0");
|
||||
jobCallBack.setTaskNo(Convert.toLong(mydoJob.getTaskNo()));
|
||||
jobCallBack.setCreateTime(new Date());
|
||||
jobCallBack.setSpare1("0");
|
||||
jobCallBack.setTaskCode(mydoJob.getWmsTaskNo());
|
||||
// jobCallBack.setTaskTypeCode();//todo wms下发的任务类型
|
||||
jobCallBack.setReqCode(mydoJob.getJobId() + mydoJob.getTaskNo());
|
||||
// jobCallBack.setSpare1("0");
|
||||
jobCallBackService.insertJobCallBack(jobCallBack);
|
||||
|
||||
//移除实时任务
|
||||
mydoJobMapper.deleteMydoJobByJobId(jobId);
|
||||
}
|
||||
|
||||
@@ -201,14 +217,15 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
|
||||
/**
|
||||
* 手动处理指定批量【任务号】的作业
|
||||
* >>需要确定【jobid】是否由wms下发
|
||||
* >>如果【jobid】和【taskno】是一对多的情况,使用上一个方法<OuthandFinish>手动完成作业会导致整个【jobid】单据完成回传
|
||||
* >>如果【jobid】和【taskno】是一对一的情况,则直接使用 <OuthandFinish> 方法手动完成即可
|
||||
* @param taskNos
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult ManuelTaskFinish(String[] taskNos) {
|
||||
//todo 需要确定【jobid】是否由wms下发
|
||||
// 如果【jobid】和【taskno】是一对多的情况,使用上一个方法<OuthandFinish>手动完成作业会导致整个【jobid】单据完成回传
|
||||
// 如果【jobid】和【taskno】是一对一的情况,则直接使用<OuthandFinish>方法手动完成即可
|
||||
|
||||
//获取所有符合【任务号】的作业
|
||||
for (String taskNo : taskNos) {
|
||||
MydoJob mydoJob = mydoJobMapper.selectMydoJobByTaskNo(taskNo);
|
||||
@@ -224,7 +241,8 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
jobCallBack.setStatus("0");
|
||||
jobCallBack.setTaskNo(Convert.toLong(taskNo));
|
||||
jobCallBack.setCreateTime(new Date());
|
||||
jobCallBack.setSpare1("0");
|
||||
|
||||
// jobCallBack.setSpare1("0");
|
||||
jobCallBackService.insertJobCallBack(jobCallBack);
|
||||
mydoJobMapper.deleteMydoJobByTaskNo(taskNo);
|
||||
}
|
||||
@@ -262,4 +280,32 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
return mydoJobMapper.selectJobByTaskNo(taskNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取本地生成作业号
|
||||
* @param type RK-入库 CK-出库
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String getJobId(String type) {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("v_param", type);
|
||||
mydoJobMapper.getJobId(map);
|
||||
return map.get("v_serial").toString();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取本地生成任务号
|
||||
* @param type 2-入库 3-出库
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String getTaskNo(String type) {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("v_param", type);
|
||||
mydoJobMapper.getTaskNo(map);
|
||||
return map.get("v_serial").toString();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.UUID;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import com.ruoyi.api.domain.wcs2wms.JobParam;
|
||||
import com.ruoyi.api.domain.wcs2wms.exception.TaskExceptionReceive;
|
||||
import com.ruoyi.api.domain.wcs2wms.exception.TaskExceptionRequest;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.bas.cargospace.domain.BasCargoSpace;
|
||||
@@ -155,19 +156,26 @@ public class DdjThread implements Runnable {
|
||||
TaskExceptionRequest taskExceptionRequest = new TaskExceptionRequest();
|
||||
taskExceptionRequest.setTaskClass(mydoJob.getInOrOut());
|
||||
taskExceptionRequest.setType(TASK_EXCEPTION_STOCKIN_OCCUPIED);
|
||||
taskExceptionRequest.setTaskCode(String.valueOf(mydoJob));
|
||||
taskExceptionRequest.setTaskCode(mydoJob.getWmsTaskNo());
|
||||
taskExceptionRequest.setTaskTypeCode("");//todo 不知道填什么内容
|
||||
taskExceptionRequest.setReqCode(UUID.randomUUID().toString());
|
||||
taskExceptionRequest.setReqCode(mydoJob.getJobId() + mydoJob.getTaskNo());
|
||||
taskExceptionRequest.setAdverseCauses("当前位置已有货物,盘点后重新分配货位");
|
||||
|
||||
AjaxResult ajaxResult = apiService.reAssign(taskExceptionRequest);
|
||||
if (ajaxResult.isSuccess()){
|
||||
//获取返回的新货位
|
||||
MydoJob mydoJobReAssign = BeanUtil.toBean(ajaxResult.get("data"), MydoJob.class);
|
||||
//获取返回的任务号和新分配的货位
|
||||
TaskExceptionReceive mydoJobReAssign = BeanUtil.toBean(ajaxResult.get("result"), TaskExceptionReceive.class);
|
||||
|
||||
MydoJob wmsJob = new MydoJob();
|
||||
wmsJob.setInOrOut(mydoJobReAssign.getTaskCode());
|
||||
if (mydoJobService.selectMydoJobList(wmsJob).size() == 0) {
|
||||
log.warn("该任务不存在,任务号:{}", mydoJobReAssign.getTaskCode());
|
||||
return;
|
||||
}
|
||||
|
||||
//更新任务参数
|
||||
mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
|
||||
mydoJob.setCargoSpaceId(mydoJobReAssign.getCargoSpaceId());
|
||||
mydoJob.setCargoSpaceId(mydoJobReAssign.getSiteCode());
|
||||
mydoJob.setFaultFlag("2");
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
|
||||
@@ -209,8 +217,8 @@ public class DdjThread implements Runnable {
|
||||
//作废作业
|
||||
InvalidMydoJob(rwh, ddj.getId());
|
||||
|
||||
//重置【取货无货】的出库异常货位库存信息
|
||||
// basCargoSpaceService.resetCargoSpaceByStockoutException(mydoJob.getCargoSpaceId());
|
||||
//清空/重置【取货无货】的出库异常货位库存信息
|
||||
basCargoSpaceService.resetCargoSpaceByStockoutException(mydoJob.getCargoSpaceId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.ruoyi.queue.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcSsjRead;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
@@ -107,7 +108,7 @@ public class PortConvThread implements Runnable {
|
||||
//请求参数
|
||||
HashMap<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("taskTypeCode", inSsjDevice.getTrayCode());//任务类型编号
|
||||
paramMap.put("reqCode", UUID.randomUUID().toString());//任请求码
|
||||
paramMap.put("reqCode", UUID.randomUUID().toString());//请求码
|
||||
paramMap.put("cntCode", inSsjDevice.getTrayCode());//容器编号
|
||||
int height = inSsjDevice.getHeight();
|
||||
int weight = inSsjDevice.getWeight();
|
||||
@@ -182,8 +183,12 @@ public class PortConvThread implements Runnable {
|
||||
//获取wms下发的任务号和分配货位
|
||||
StockinReceive result = BeanUtil.toBean(ajaxResult.get("result"), StockinReceive.class);
|
||||
MydoJob mydoJob = new MydoJob();
|
||||
// mydoJob.setJobId();
|
||||
mydoJob.setTrayCode(result.getCntCode());
|
||||
mydoJob.setCargoSpaceId(result.getSiteCode());
|
||||
mydoJob.setWmsTaskNo(result.getTaskCode());
|
||||
mydoJob.setJobId(mydoJobService.getJobId("RK"));
|
||||
mydoJob.setTaskNo(mydoJobService.getTaskNo("1"));
|
||||
// mydoJob.setTaskNo(result.getTaskCode());//todo 确定是否用获取的任务号作为wcs的任务号
|
||||
|
||||
//todo 校验wms分配的货位(排列层)是否合法
|
||||
@@ -243,7 +248,10 @@ public class PortConvThread implements Runnable {
|
||||
jobCallBack.setStatus("0");
|
||||
jobCallBack.setTaskNo(Convert.toLong(mydoJob.getTaskNo()));
|
||||
jobCallBack.setCreateTime(new Date());
|
||||
jobCallBack.setSpare1("0");
|
||||
jobCallBack.setTaskTypeCode("");//todo ???
|
||||
jobCallBack.setReqCode(UUID.randomUUID().toString());
|
||||
jobCallBack.setTaskCode(mydoJob.getWmsTaskNo());
|
||||
// jobCallBack.setSpare1("0");
|
||||
jobCallBackService.insertJobCallBack(jobCallBack);
|
||||
}
|
||||
}
|
||||
@@ -252,15 +260,11 @@ public class PortConvThread implements Runnable {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void inDispatch1(DeviceSsj ssjDevice) {
|
||||
//有入库请求就肯定是电气的任务号的作业
|
||||
if(StrUtil.isNotBlank(ssjDevice.getTrayCode()) && ssjDevice.getRkqq()==1 && ssjDevice.getTaskNo()<1000){
|
||||
|
||||
@@ -11,13 +11,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="mydojobId" column="mydojob_id" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="spare1" column="spare1" />
|
||||
<result property="spare2" column="spare2" />
|
||||
<result property="spare3" column="spare3" />
|
||||
<!-- <result property="spare1" column="spare1" />-->
|
||||
<!-- <result property="spare2" column="spare2" />-->
|
||||
<!-- <result property="spare3" column="spare3" />-->
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectJobCallBackVo">
|
||||
select id, type, task_no, mydojob_id, status, create_time, spare1, spare2, spare3 from job_call_back
|
||||
select id, type, task_no, mydojob_id, status, create_time from job_call_back
|
||||
</sql>
|
||||
|
||||
<select id="selectJobCallBackList" parameterType="JobCallBack" resultMap="JobCallBackResult">
|
||||
@@ -50,9 +50,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="mydojobId != null">mydojob_id,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="spare1 != null">spare1,</if>
|
||||
<if test="spare2 != null">spare2,</if>
|
||||
<if test="spare3 != null">spare3,</if>
|
||||
<!-- <if test="spare1 != null">spare1,</if>-->
|
||||
<!-- <if test="spare2 != null">spare2,</if>-->
|
||||
<!-- <if test="spare3 != null">spare3,</if>-->
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="type != null">#{type},</if>
|
||||
@@ -60,9 +60,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="mydojobId != null">#{mydojobId},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="spare1 != null">#{spare1},</if>
|
||||
<if test="spare2 != null">#{spare2},</if>
|
||||
<if test="spare3 != null">#{spare3},</if>
|
||||
<!-- <if test="spare1 != null">#{spare1},</if>-->
|
||||
<!-- <if test="spare2 != null">#{spare2},</if>-->
|
||||
<!-- <if test="spare3 != null">#{spare3},</if>-->
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -74,9 +74,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="mydojobId != null">mydojob_id = #{mydojobId},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="spare1 != null">spare1 = #{spare1},</if>
|
||||
<if test="spare2 != null">spare2 = #{spare2},</if>
|
||||
<if test="spare3 != null">spare3 = #{spare3},</if>
|
||||
<!-- <if test="spare1 != null">spare1 = #{spare1},</if>-->
|
||||
<!-- <if test="spare2 != null">spare2 = #{spare2},</if>-->
|
||||
<!-- <if test="spare3 != null">spare3 = #{spare3},</if>-->
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
@@ -93,7 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</delete>
|
||||
|
||||
<select id="getTopJobCallBack" resultMap="JobCallBackResult">
|
||||
select top(1) id, type, task_no, mydojob_id, status, create_time, spare1, spare2, spare3 from job_call_back
|
||||
select top(1) id, type, task_no, mydojob_id, status, create_timefrom job_call_back
|
||||
where status = '0' and spare1 in ('0','1','2')
|
||||
order by create_time asc
|
||||
</select>
|
||||
|
||||
@@ -25,13 +25,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="flag" column="flag" />
|
||||
<result property="trayCode" column="tray_code" />
|
||||
<result property="traySize" column="tray_size" />
|
||||
<result property="wmsTaskNo" column="wms_task_no" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMydoJobVo">
|
||||
select job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_code,tray_size from mydo_job_wcs
|
||||
select job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_code,tray_size,wms_task_no from mydo_job_wcs
|
||||
</sql>
|
||||
<sql id="selectMydoJobFinishVo">
|
||||
select job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_code,tray_size from mydo_job_wcs_finish
|
||||
select job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_code,tray_size,wms_task_no from mydo_job_wcs_finish
|
||||
</sql>
|
||||
|
||||
<select id="selectMydoJobList" parameterType="MydoJob" resultMap="MydoJobResult">
|
||||
@@ -47,23 +48,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{targetCargoSpaceId}
|
||||
</if>
|
||||
<if test="priority != null ">and priority = #{priority}</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="startTime != null and startTime != ''">and start_time = #{startTime}</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="exitId != null and exitId != ''">and exit_id = #{exitId}</if>
|
||||
<if test="warehouseId != null and warehouseId != ''">and warehouse_id = #{warehouseId}</if>
|
||||
<if test="faultFlag != null and faultFlag != ''">and fault_flag = #{faultFlag}</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="startTime != null and startTime != ''">and start_time = #{startTime}</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="exitId != null and exitId != ''">and exit_id = #{exitId}</if>
|
||||
<if test="warehouseId != null and warehouseId != ''">and warehouse_id = #{warehouseId}</if>
|
||||
<if test="faultFlag != null and faultFlag != ''">and fault_flag = #{faultFlag}</if>
|
||||
<if test="flag != null and flag != ''">and flag = #{flag}</if>
|
||||
<if test="trayCode != null and trayCode != ''">and tray_code = #{trayCode}</if>
|
||||
<if test="traySize != null and traySize != ''">and traySize = #{tray_size}</if>
|
||||
<if test="trayCode != null and trayCode != ''">and tray_code = #{trayCode}</if>
|
||||
<if test="traySize != null and traySize != ''">and traySize = #{tray_size}</if>
|
||||
<if test="epList != null and epList.size() > 0">
|
||||
and entrance_id in
|
||||
<foreach item="item" index="index" collection="epList" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="wmsTaskNo != null and wmsTaskNo != ''">and wms_task_no = #{wmsTaskNo}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -76,7 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
select job_id, a.status, task_no, a.roadway_id, b.cargo_space_name as cargo_space_id, target_roadway_id,
|
||||
target_cargo_space_id, priority, execution_phase, in_or_out, create_time,
|
||||
start_time, finish_time, entrance_id, exit_id, a.warehouse_id, fault_flag,
|
||||
flag,a.tray_code,tray_size
|
||||
flag,a.tray_code,tray_size,wms_task_no
|
||||
from mydo_job_wcs a,bas_cargo_space b
|
||||
where a.cargo_space_id = b.cargo_space_id
|
||||
and task_no = #{taskNo}
|
||||
@@ -104,7 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
)}
|
||||
</select>
|
||||
<select id="selectMydoJobByExitList" resultMap="MydoJobResult">
|
||||
select TOP 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_code,tray_size from mydo_job_wcs
|
||||
select TOP 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_code,tray_size,wms_task_no from mydo_job_wcs
|
||||
where exit_id in
|
||||
<foreach item="item" index="index" collection="exitList" separator="," open="(" close=")">
|
||||
#{item}
|
||||
@@ -115,7 +117,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectMydoJobByExitList1" resultMap="MydoJobResult">
|
||||
select TOP 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_code,tray_size from mydo_job_wcs
|
||||
select TOP 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_code,tray_size,wms_task_no from mydo_job_wcs
|
||||
where exit_id = #{exitId}
|
||||
and roadway_id = #{roadwayId}
|
||||
and in_or_out > 20
|
||||
@@ -146,6 +148,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="flag != null">flag,</if>
|
||||
<if test="trayCode != null">tray_code,</if>
|
||||
<if test="traySize != null">tray_size,</if>
|
||||
<if test="wmsTaskNo != null">wms_task_no,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="jobId != null">#{jobId},</if>
|
||||
@@ -168,7 +171,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="flag != null">#{flag},</if>
|
||||
<if test="trayCode != null">#{trayCode},</if>
|
||||
<if test="traySize != null">#{traySize},</if>
|
||||
|
||||
<if test="wmsTaskNo != null">#{wmsTaskNo},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertHistory">
|
||||
@@ -198,6 +201,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="flag != null">flag = #{flag},</if>
|
||||
<if test="trayCode != null">tray_code = #{trayCode},</if>
|
||||
<if test="traySize != null">tray_size = #{traySize},</if>
|
||||
<if test="wmsTaskNo != null">wms_task_no = #{wmsTaskNo},</if>
|
||||
</trim>
|
||||
where job_id = #{jobId}
|
||||
</update>
|
||||
@@ -237,10 +241,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="exitId != null and exitId != ''"> and exit_id = #{exitId}</if>
|
||||
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
|
||||
<if test="faultFlag != null and faultFlag != ''"> and fault_flag = #{faultFlag}</if>
|
||||
<if test="jobId != null and jobId != ''"> and job_id = #{jobId}</if>
|
||||
<if test="flag != null and flag != ''"> and flag = #{flag}</if>
|
||||
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
|
||||
<if test="traySize != null and traySize != ''"> and tray_size = #{traySize}</if>
|
||||
<if test="jobId != null and jobId != ''"> and job_id = #{jobId}</if>
|
||||
<if test="flag != null and flag != ''"> and flag = #{flag}</if>
|
||||
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
|
||||
<if test="traySize != null and traySize != ''"> and tray_size = #{traySize}</if>
|
||||
<if test="wmsTaskNo != null and wmsTaskNo != ''">and wms_task_no = #{wmsTaskNo}</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectMydoJobByEntranceList" resultMap="MydoJobResult">
|
||||
@@ -296,6 +301,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="flag != null and flag != ''"> and flag = #{flag}</if>
|
||||
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
|
||||
<if test="traySize != null and traySize != ''"> and tray_size = #{traySize}</if>
|
||||
<if test="wmsTaskNo != null and wmsTaskNo != ''">and wms_task_no = #{wmsTaskNo}</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectRunningMydoJobByExitList" resultMap="MydoJobResult">
|
||||
@@ -318,4 +324,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
and in_or_out < 20
|
||||
and status in (1,3)
|
||||
</select>
|
||||
|
||||
<select id="getJobId" statementType="CALLABLE" parameterType="java.util.Map" >
|
||||
{ CALL util_serial_job(
|
||||
#{v_param, mode=IN, jdbcType=VARCHAR},
|
||||
#{v_serial, mode=OUT, jdbcType=VARCHAR}
|
||||
)
|
||||
}
|
||||
</select>
|
||||
|
||||
<select id="getTaskNo" statementType="CALLABLE" parameterType="java.util.Map" >
|
||||
{ CALL util_serial_task(
|
||||
#{v_param, mode=IN, jdbcType=VARCHAR},
|
||||
#{v_serial, mode=OUT, jdbcType=VARCHAR}
|
||||
)
|
||||
}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user