优化修正请求和响应逻辑
This commit is contained in:
@@ -20,12 +20,12 @@ public class ResponseResult {
|
||||
/**
|
||||
* 请求是否成功
|
||||
*/
|
||||
private Integer success;
|
||||
private boolean success;
|
||||
|
||||
/**
|
||||
* 提示信息
|
||||
*/
|
||||
private boolean message;
|
||||
private String message;
|
||||
|
||||
/**
|
||||
* 成功时返回任务信息对象
|
||||
|
||||
@@ -40,6 +40,6 @@ public class TaskExceptionRequest {
|
||||
/**
|
||||
* 异常任务的类型 - 1052-入库有货,2-出库无货
|
||||
*/
|
||||
private int type;
|
||||
private String type;
|
||||
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ import java.util.Map;
|
||||
public interface IApiService
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* 生成agv队列
|
||||
* @param code1 起点
|
||||
@@ -90,6 +89,13 @@ public interface IApiService
|
||||
*/
|
||||
RequestLog finishMydoJob(Map<String, Object> param);
|
||||
|
||||
/**
|
||||
* @@@ FT568 任务完成回传 适应wms的自定义响应格式
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
RequestLog finishMydoJobForResponseResult(Map<String, Object> param);
|
||||
|
||||
/**
|
||||
* 下发agv任务
|
||||
* @param agvQueue
|
||||
@@ -144,6 +150,11 @@ public interface IApiService
|
||||
*/
|
||||
AjaxResult createInMydoJob(Map<String, Object> param);
|
||||
|
||||
/**
|
||||
* @@@ FT568 入库请求生成作业 处理了请求响应,适应wms的自定义响应格式
|
||||
*/
|
||||
AjaxResult createMydoJobForStockin(Map<String, Object> param);
|
||||
|
||||
/**
|
||||
* 入库请求作业异常反馈(扫码失败、外形、称重等异常)
|
||||
*/
|
||||
|
||||
@@ -77,4 +77,13 @@ public interface IRequestLogService
|
||||
public RequestLog getRequestLog(String url, String param);
|
||||
|
||||
RequestLog getRequestLog2(String url, String param, String endPoint);
|
||||
|
||||
/**
|
||||
* @@@ FT568 使用用户自定义的wms请求响应
|
||||
* @param url
|
||||
* @param endPoint
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
RequestLog getRequestLogForResponseResult(String url, String endPoint, String param);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskRespons
|
||||
import com.ruoyi.api.domain.agv.genAgvSchedulingTask.PositionCodeData;
|
||||
import com.ruoyi.api.domain.wcs2wms.JobParam;
|
||||
import com.ruoyi.api.domain.wcs2wms.ReceiveJob;
|
||||
import com.ruoyi.api.domain.wcs2wms.ResponseResult;
|
||||
import com.ruoyi.api.domain.wcs2wms.exception.TaskExceptionReceive;
|
||||
import com.ruoyi.api.domain.wcs2wms.exception.TaskExceptionRequest;
|
||||
import com.ruoyi.api.domain.wcs2wms.stockout.StockoutReceive;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
@@ -54,6 +56,7 @@ import static com.ruoyi.common.TaskStatusCode.TASK_EP_ROADWAY_SSJ;
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ApiServiceImpl implements IApiService {
|
||||
|
||||
@Autowired
|
||||
private RequestLogServiceImpl requestLogService;
|
||||
@Autowired
|
||||
@@ -155,6 +158,15 @@ public class ApiServiceImpl implements IApiService {
|
||||
return requestLogService.getRequestLog(WMS_TASK_FINISH, "任务完成上报", JSONUtil.toJsonStr(param));
|
||||
}
|
||||
|
||||
/**
|
||||
* @@@ FT568 任务完成回传 适应wms的自定义响应格式
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
public RequestLog finishMydoJobForResponseResult(Map<String, Object> param) {
|
||||
return requestLogService.getRequestLogForResponseResult(WMS_TASK_FINISH, "任务完成上报", JSONUtil.toJsonStr(param));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 处理agv状态返回
|
||||
@@ -266,10 +278,13 @@ public class ApiServiceImpl implements IApiService {
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult reAssign(TaskExceptionRequest taskExceptionRequest) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(WMS_TASK_EXCEPTION, "入库异常-重新分配货位", JSONUtil.toJsonStr(taskExceptionRequest));
|
||||
RequestLog requestLog = requestLogService.getRequestLogForResponseResult(WMS_TASK_EXCEPTION, "入库异常-重新分配货位", JSONUtil.toJsonStr(taskExceptionRequest));
|
||||
if ("1".equals(requestLog.getIsSuccessful())){
|
||||
InterfaceReceive bean = JSONUtil.toBean(requestLog.getResponseBody(), InterfaceReceive.class);
|
||||
MydoJob wmsMydoJob = BeanUtil.toBean(bean.getData(), MydoJob.class);
|
||||
//请求获取新分配的货位
|
||||
ResponseResult bean = JSONUtil.toBean(requestLog.getResponseBody(), ResponseResult.class);
|
||||
MydoJob wmsMydoJob = BeanUtil.toBean(bean.getResult(), MydoJob.class);
|
||||
|
||||
//更新任务信息
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByJobId(wmsMydoJob.getJobId());
|
||||
mydoJob.setCargoSpaceId(wmsMydoJob.getCargoSpaceId());
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
@@ -299,7 +314,7 @@ public class ApiServiceImpl implements IApiService {
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult reMaterial(TaskExceptionRequest taskExceptionRequest) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(WMS_TASK_EXCEPTION, "出库无货异常-任务作废", JSONUtil.toJsonStr(taskExceptionRequest));
|
||||
RequestLog requestLog = requestLogService.getRequestLogForResponseResult(WMS_TASK_EXCEPTION, "出库无货异常-任务作废", JSONUtil.toJsonStr(taskExceptionRequest));
|
||||
if ("1".equals(requestLog.getIsSuccessful())){
|
||||
return AjaxResult.success();
|
||||
}
|
||||
@@ -434,7 +449,23 @@ public class ApiServiceImpl implements IApiService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 入库请求作业异常反馈(扫码失败、外形、称重等异常)
|
||||
* @@@ FT568 请求wms获取入库任务参数 - 适应wms的自定义请求响应格式
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult createMydoJobForStockin(Map<String, Object> param) {
|
||||
RequestLog requestLog = requestLogService.getRequestLogForResponseResult(WMS_STOCKIN_MYDOJOB, "入库请求生成作业", JSONUtil.toJsonStr(param));
|
||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||
ResponseResult bean = JSONUtil.toBean(requestLog.getResponseBody(), ResponseResult.class);
|
||||
return AjaxResult.success(bean.getResult());
|
||||
} else {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @@@ FT568 入库请求作业异常反馈(扫码失败、外形、称重等异常)
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -9,6 +9,7 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.ruoyi.api.domain.InterfaceReceive;
|
||||
import com.ruoyi.api.domain.wcs2wms.ResponseResult;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -131,6 +132,7 @@ public class RequestLogServiceImpl implements IRequestLogService
|
||||
String resStr = HttpUtil.post(url, param);
|
||||
requestLog.setResponseBody(resStr);
|
||||
InterfaceReceive bean = JSONUtil.toBean(resStr, InterfaceReceive.class);
|
||||
|
||||
if (bean.getCode() == 200) {
|
||||
requestLog.setResponseTime(DateUtil.format(responseTime, "yyyy-MM-dd HH:mm:ss"));
|
||||
requestLog.setResponseStatus("1");
|
||||
@@ -173,6 +175,7 @@ public class RequestLogServiceImpl implements IRequestLogService
|
||||
String resStr = HttpUtil.post(url, param);
|
||||
requestLog.setResponseBody(resStr);
|
||||
InterfaceReceive bean = JSONUtil.toBean(resStr, InterfaceReceive.class);
|
||||
|
||||
if (bean.getCode() == 0) {
|
||||
requestLog.setResponseTime(DateUtil.format(responseTime, "yyyy-MM-dd HH:mm:ss"));
|
||||
requestLog.setResponseStatus("1");
|
||||
@@ -198,6 +201,56 @@ public class RequestLogServiceImpl implements IRequestLogService
|
||||
return requestLog;
|
||||
}
|
||||
|
||||
/**
|
||||
* @@@ FT568 使用用户自定义的wms请求响应
|
||||
* @param url
|
||||
* @param endPoint
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public RequestLog getRequestLogForResponseResult(String url, String endPoint, String param) {
|
||||
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(endPoint);
|
||||
requestLog.setRequestMethod("post");
|
||||
requestLog.setRequestHeaders(null);
|
||||
requestLog.setRequestBody(param);
|
||||
requestLog.setRequestUrl(url);
|
||||
Date responseTime =new Date();
|
||||
try {
|
||||
String resStr = HttpUtil.post(url, param);
|
||||
requestLog.setResponseBody(resStr);
|
||||
ResponseResult bean = JSONUtil.toBean(resStr, ResponseResult.class);
|
||||
|
||||
if (bean.getCode() == 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.setResponseTime(DateUtil.format(responseTime, "yyyy-MM-dd HH:mm:ss"));
|
||||
requestLog.setResponseStatus("0");
|
||||
requestLog.setErrorDetails(bean.isSuccess() + "-" + bean.getMessage());
|
||||
requestLog.setIsSuccessful("0");
|
||||
requestLog.setDuration(Convert.toStr(DateUtil.between(requestTime, responseTime, DateUnit.MS)));
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
requestLog.setResponseTime(DateUtil.format(responseTime, "yyyy-MM-dd HH:mm:ss"));
|
||||
requestLog.setErrorDetails(e.getMessage());
|
||||
requestLog.setIsSuccessful("0");
|
||||
requestLog.setResponseStatus("0");
|
||||
requestLog.setDuration(Convert.toStr(DateUtil.between(requestTime, responseTime, DateUnit.MS)));
|
||||
} finally {
|
||||
insertRequestLog(requestLog);
|
||||
}
|
||||
return requestLog;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 插入请求日志
|
||||
@@ -219,5 +272,24 @@ public class RequestLogServiceImpl implements IRequestLogService
|
||||
return requestLog;
|
||||
}
|
||||
|
||||
/**
|
||||
* @@@ FT568 将wms自定义的响应格式解析为本地响应格式(减少其他改动)
|
||||
* @param responseStr 请求响应字符串
|
||||
* @return
|
||||
*/
|
||||
public InterfaceReceive resultToBean(String responseStr) {
|
||||
|
||||
InterfaceReceive interfaceReceive = new InterfaceReceive();
|
||||
|
||||
//返回供应商wms自定义的ResponseResult,解析为本地InterfaceReceive响应格式
|
||||
ResponseResult result =JSONUtil.toBean(responseStr, ResponseResult.class);
|
||||
interfaceReceive.setCode(result.getCode());
|
||||
interfaceReceive.setMsg(result.isSuccess() + "-" + result.getMessage());
|
||||
interfaceReceive.setData(result.getResult());
|
||||
|
||||
return interfaceReceive;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -22,7 +22,12 @@ public class Constant {
|
||||
|
||||
//#endregion
|
||||
|
||||
|
||||
/**
|
||||
* 本地测试wms服务端url
|
||||
*/
|
||||
public static final String WMS_STOCKIN_MYDOJOB_LOCAL = "http://localhost:5066/api/TestModel/WcsStockin";
|
||||
public static final String WMS_TASK_FINISH_LOCAL = "http://localhost:5066/api/TestModel/WcsCallBack";
|
||||
public static final String WMS_TASK_EXCEPTION_LOCAL = "http://localhost:5066/api/TestModel/WcsException";
|
||||
|
||||
/**
|
||||
* 向wms请求入库url
|
||||
|
||||
@@ -8,23 +8,23 @@ public class ConvException {
|
||||
/**
|
||||
* 外形检测异常
|
||||
*/
|
||||
public static final int CHECK_SIZE_EXCEPTION = 0;
|
||||
public static final int CHECK_SIZE_EXCEPTION = 1;
|
||||
|
||||
|
||||
/**
|
||||
* 超重
|
||||
*/
|
||||
public static final int CHECK_OVERWEIGHT_EXCEPTION = 1;
|
||||
public static final int CHECK_OVERWEIGHT_EXCEPTION = 2;
|
||||
|
||||
/**
|
||||
* 扫码异常
|
||||
*/
|
||||
public static final int CHECK_BARCODE_EXCEPTION = 2;
|
||||
public static final int CHECK_BARCODE_EXCEPTION = 3;
|
||||
|
||||
/**
|
||||
* 输送机非自动
|
||||
*/
|
||||
public static final int CHECK_MODE_EXCEPTION = 3;
|
||||
public static final int CHECK_MODE_EXCEPTION = 4;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -98,11 +98,11 @@ public class DeviceSsj extends BaseEntity
|
||||
/**
|
||||
* 托盘高度
|
||||
*/
|
||||
private int height;
|
||||
private String height;
|
||||
|
||||
/**
|
||||
* 称重
|
||||
*/
|
||||
private int weight;
|
||||
private String weight;
|
||||
|
||||
}
|
||||
|
||||
@@ -104,8 +104,10 @@ public class JobCallBackController extends BaseController
|
||||
return toAjax(jobCallBackService.deleteJobCallBackByIds(ids));
|
||||
}
|
||||
|
||||
@Scheduled(fixedDelay=2000)
|
||||
@Scheduled(fixedDelay=3000)
|
||||
public void jobCallBack() {
|
||||
jobCallBackService.jobCallBack();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ public class MydoJob extends BaseEntity
|
||||
|
||||
private String trayCode;
|
||||
|
||||
// private String inOut;
|
||||
private String inOut;
|
||||
|
||||
private String flag;
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import cn.hutool.core.lang.UUID;
|
||||
import com.ruoyi.api.domain.RequestLog;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
@@ -110,12 +111,13 @@ public class JobCallBackServiceImpl implements IJobCallBackService
|
||||
//设定请求参数
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
param.put("taskTypeCode", jobCallBack.getTaskTypeCode());
|
||||
param.put("reqCode", jobCallBack.getReqCode());
|
||||
param.put("reqCode", UUID.randomUUID().toString().replace("-", ""));
|
||||
param.put("taskCode", jobCallBack.getTaskCode());
|
||||
|
||||
//请求回传
|
||||
RequestLog requestLog = apiService.finishMydoJob(param);
|
||||
if ("0".equals(requestLog.getIsSuccessful())){
|
||||
// RequestLog requestLog = apiService.finishMydoJob(param);
|
||||
RequestLog requestLog = apiService.finishMydoJobForResponseResult(param);//@@@ FT568 返回自定义的wms响应格式
|
||||
if ("1".equals(requestLog.getIsSuccessful())){
|
||||
jobCallBack.setStatus("1");
|
||||
}else{
|
||||
jobCallBack.setStatus("99");
|
||||
|
||||
@@ -124,9 +124,11 @@ public class DdjThread implements Runnable {
|
||||
|
||||
// 1.联机自动【5】 2.设备状态 - 运行中【1】 3.执行阶段【2】
|
||||
if (ddj.getCzfs() == 5 && ddj.getSbzt() == 1 && ddj.getJdbz() == 2) {
|
||||
|
||||
//根据堆垛机上任务号,修改任务执行阶段
|
||||
Long rwh = ddj.getRwh();
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh, ddj.getId());
|
||||
|
||||
if (ddjDeviceExecutionQueue != null && !"1".equals(ddjDeviceExecutionQueue.getSpare1())) {
|
||||
//修改队列执行阶段
|
||||
ddjDeviceExecutionQueue.setRwzt(ddj.getJdbz());
|
||||
@@ -143,7 +145,7 @@ public class DdjThread implements Runnable {
|
||||
// 判断堆垛机上任务是否已重分,若未重分,则调用接口,请求重分货位
|
||||
Long rwh = ddj.getRwh();
|
||||
|
||||
//获取堆垛机正在执行中的任务和队列
|
||||
//查村正在执行中的【任务号】获取堆垛机队列
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh, ddj.getId());
|
||||
|
||||
@@ -155,10 +157,10 @@ public class DdjThread implements Runnable {
|
||||
//上报异常 - 向wms请求重分接口
|
||||
TaskExceptionRequest taskExceptionRequest = new TaskExceptionRequest();
|
||||
taskExceptionRequest.setTaskClass(mydoJob.getInOrOut());
|
||||
taskExceptionRequest.setType(TASK_EXCEPTION_STOCKIN_OCCUPIED);
|
||||
taskExceptionRequest.setType(String.valueOf(TASK_EXCEPTION_STOCKIN_OCCUPIED));
|
||||
taskExceptionRequest.setTaskCode(mydoJob.getWmsTaskNo());
|
||||
taskExceptionRequest.setTaskTypeCode("");//todo 不知道填什么内容
|
||||
taskExceptionRequest.setReqCode(mydoJob.getJobId() + mydoJob.getTaskNo());
|
||||
taskExceptionRequest.setTaskTypeCode("");//todo 不知道填什么
|
||||
taskExceptionRequest.setReqCode(UUID.randomUUID().toString().replace("-", ""));
|
||||
taskExceptionRequest.setAdverseCauses("当前位置已有货物,盘点后重新分配货位");
|
||||
|
||||
AjaxResult ajaxResult = apiService.reAssign(taskExceptionRequest);
|
||||
@@ -192,7 +194,13 @@ public class DdjThread implements Runnable {
|
||||
|
||||
|
||||
// -------------------------------------- 4 取货无货,作废当前任务,重新分配单据 --------------------------------------
|
||||
|
||||
//测试数据
|
||||
// ddj.setCzfs(5);
|
||||
// ddj.setSbzt(1053);
|
||||
// ddj.setYxxf(1);
|
||||
// ddj.setJdbz(3);
|
||||
// ddj.setRwh(Long.valueOf(51217));
|
||||
// ddj.setId(1);
|
||||
// 1.联机自动【5】 2.设备状态-取货无货【1053】 3.执行阶段【<5】(任务执行中)
|
||||
if (ddj.getCzfs() == 5 && ddj.getSbzt() == 1053 && ddj.getJdbz() < 5) {
|
||||
Long rwh = ddj.getRwh();
|
||||
@@ -203,13 +211,14 @@ public class DdjThread implements Runnable {
|
||||
|
||||
//找到对应任务 调用api接口 取货无货,重新分配单据
|
||||
if (ObjUtil.isNotNull(ddjDeviceExecutionQueue)) {
|
||||
|
||||
//向wms返回异常信息
|
||||
TaskExceptionRequest taskExceptionRequest = new TaskExceptionRequest();
|
||||
taskExceptionRequest.setTaskClass(mydoJob.getInOrOut());
|
||||
taskExceptionRequest.setType(TASK_EXCEPTION_STOCKOUT_EMPTY);
|
||||
taskExceptionRequest.setType(String.valueOf(TASK_EXCEPTION_STOCKIN_OCCUPIED));
|
||||
taskExceptionRequest.setTaskCode(String.valueOf(mydoJob));
|
||||
taskExceptionRequest.setTaskTypeCode("");//todo 不知道填什么内容
|
||||
taskExceptionRequest.setReqCode(UUID.randomUUID().toString());
|
||||
taskExceptionRequest.setTaskTypeCode("");//todo 不知道填什么
|
||||
taskExceptionRequest.setReqCode(UUID.randomUUID().toString().replace("-", ""));
|
||||
taskExceptionRequest.setAdverseCauses("取货位置空,盘点后作废该任务");
|
||||
|
||||
AjaxResult ajaxResult = apiService.reMaterial(taskExceptionRequest);
|
||||
|
||||
@@ -4,8 +4,6 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.lang.UUID;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.ruoyi.api.domain.wcs2wms.ResponseResult;
|
||||
import com.ruoyi.api.domain.wcs2wms.stockin.StockinReceive;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.bas.cargospace.domain.BasCargoSpace;
|
||||
@@ -22,6 +20,9 @@ import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||
import com.ruoyi.queue.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcSsjRead;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.*;
|
||||
@@ -36,6 +37,7 @@ import static com.ruoyi.schedule.plcRead.ssj.PlcSsjRead.writeToSsjQH;
|
||||
* 出入口输送线线程
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class PortConvThread implements Runnable {
|
||||
|
||||
public HashMap<String, List<String>> ssjCodeList;
|
||||
@@ -44,7 +46,8 @@ public class PortConvThread implements Runnable {
|
||||
private IAgvQueueService agvQueueService;
|
||||
private IMydoJobService mydoJobService;
|
||||
private IJobCallBackService jobCallBackService;
|
||||
private IBasCargoSpaceService cargoSpaceService;
|
||||
private IBasCargoSpaceService basCargoSpaceService;
|
||||
|
||||
|
||||
public boolean isRun = true;
|
||||
|
||||
@@ -59,6 +62,7 @@ public class PortConvThread implements Runnable {
|
||||
agvQueueService = SpringUtils.getBean(IAgvQueueService.class);
|
||||
mydoJobService = SpringUtils.getBean(IMydoJobService.class);
|
||||
jobCallBackService = SpringUtils.getBean(IJobCallBackService.class);
|
||||
basCargoSpaceService = SpringUtils.getBean(IBasCargoSpaceService.class);
|
||||
log.info("初始化服务 {},{}", apiService, agvQueueService);
|
||||
}
|
||||
|
||||
@@ -96,26 +100,37 @@ public class PortConvThread implements Runnable {
|
||||
|
||||
|
||||
public void inDispatch(DeviceSsj inSsjDevice) {
|
||||
// 测试数据
|
||||
// inSsjDevice.setInOrOut(1);
|
||||
// inSsjDevice.setTrayCode("T888888");
|
||||
// inSsjDevice.setKx(0);
|
||||
// inSsjDevice.setDw(1);
|
||||
// inSsjDevice.setHeight("1");
|
||||
// inSsjDevice.setWeight("100");
|
||||
// inSsjDevice.setException(0);
|
||||
// inSsjDevice.setRkqq(1);
|
||||
|
||||
switch (inSsjDevice.getInOrOut()) {
|
||||
//---------------------------入库模式---------------------------
|
||||
case 1:
|
||||
//---------------------------入口取输送机(叉车取放货位置)---------------------------
|
||||
//输送机【非空闲】、【输送到位】、【条码不为空】、有【入库请求】
|
||||
//输送机【非空闲】、【输送到位】(【条码不为空】、有【入库请求】)
|
||||
if (inSsjDevice.getKx() != 1 && inSsjDevice.getDw() == 1) {
|
||||
|
||||
AjaxResult ajaxResult;
|
||||
|
||||
//请求参数
|
||||
HashMap<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("taskTypeCode", inSsjDevice.getTrayCode());//任务类型编号
|
||||
paramMap.put("taskTypeCode", "inBound");//任务类型编号
|
||||
paramMap.put("reqCode", UUID.randomUUID().toString());//请求码
|
||||
paramMap.put("cntCode", inSsjDevice.getTrayCode());//容器编号
|
||||
int height = inSsjDevice.getHeight();
|
||||
int weight = inSsjDevice.getWeight();
|
||||
String height = inSsjDevice.getHeight();
|
||||
String weight = inSsjDevice.getWeight();
|
||||
paramMap.put("weight", weight);//重量
|
||||
paramMap.put("height", height);//高度
|
||||
paramMap.put("altimetry", height);//高度
|
||||
paramMap.put("adverseCauses", "");//异常信息
|
||||
|
||||
//入库口异常校验
|
||||
//-----------------入库口异常校验-----------------
|
||||
switch (inSsjDevice.getException()) {
|
||||
|
||||
//外形检测异常
|
||||
@@ -155,35 +170,34 @@ public class PortConvThread implements Runnable {
|
||||
return;
|
||||
}
|
||||
|
||||
//校验:有【入库请求】再请求获取wcs任务
|
||||
//-----------------校验:有【入库请求】再请求获取wcs任务-----------------
|
||||
if (inSsjDevice.getRkqq() != 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
//校验:当前条码任务已存在
|
||||
//-----------------校验:当前条码任务已存在-----------------
|
||||
MydoJob job = new MydoJob();
|
||||
job.setTrayCode(inSsjDevice.getTrayCode());
|
||||
if (mydoJobService.selectMydoJobList(job).size() > 0) {
|
||||
if (!mydoJobService.selectMydoJobList(job).isEmpty()) {
|
||||
log.warn("【生成wcs任务异常】该托盘号已有作业,托盘条码:{}",inSsjDevice.getTrayCode());
|
||||
return;
|
||||
}
|
||||
|
||||
//校验:当前条码已有库存
|
||||
//-----------------校验:当前条码已有库存-----------------
|
||||
BasCargoSpace cargoSpace = new BasCargoSpace();
|
||||
cargoSpace.setTrayCode(inSsjDevice.getTrayCode());
|
||||
if (cargoSpaceService.selectBasCargoSpaceList(cargoSpace).size() > 0) {
|
||||
if (!basCargoSpaceService.selectBasCargoSpaceList(cargoSpace).isEmpty()) {
|
||||
log.warn("【生成wcs任务异常】该托盘号已有库存,托盘条码:{}",inSsjDevice.getTrayCode());
|
||||
return;
|
||||
}
|
||||
|
||||
//请求生成wcs任务
|
||||
ajaxResult = apiService.createInMydoJob(paramMap);
|
||||
//-----------------请求生成wcs任务-----------------
|
||||
ajaxResult = apiService.createMydoJobForStockin(paramMap);
|
||||
if (ajaxResult.isSuccess()) {
|
||||
|
||||
//获取wms下发的任务号和分配货位
|
||||
StockinReceive result = BeanUtil.toBean(ajaxResult.get("result"), StockinReceive.class);
|
||||
StockinReceive result = BeanUtil.toBean(ajaxResult.get("data"), StockinReceive.class);
|
||||
MydoJob mydoJob = new MydoJob();
|
||||
// mydoJob.setJobId();
|
||||
mydoJob.setTrayCode(result.getCntCode());
|
||||
mydoJob.setCargoSpaceId(result.getSiteCode());
|
||||
mydoJob.setWmsTaskNo(result.getTaskCode());
|
||||
@@ -201,23 +215,26 @@ public class PortConvThread implements Runnable {
|
||||
|
||||
mydoJob.setStatus("1");
|
||||
mydoJob.setInOrOut("1");
|
||||
mydoJob.setEntranceId("G1004");
|
||||
mydoJob.setExecutionPhase(TASK_EP_CREATE);
|
||||
mydoJob.setCreateTime(new Date());
|
||||
// mydoJob.setTraySize(Convert.toStr(inSsjDevice.getTraySize()));
|
||||
mydoJob.setFaultFlag("0");
|
||||
mydoJob.setPriority(Long.valueOf(10));
|
||||
|
||||
//拿到正常作业,插到wcs作业表,下发给输送机任务号,覆盖任务号
|
||||
if (mydoJobService.insertMydoJob(mydoJob) == 1) {
|
||||
log.info("请求生成wcs作业成功,wms下发任务单号:{}, 任务号:{},托盘条码:{},分配货位:{}", mydoJob.getJobId(), mydoJob.getTaskNo(), mydoJob.getTrayCode(), mydoJob.getCargoSpaceId());
|
||||
//如果还没有生成wcs任务 - 先生成一条任务记录
|
||||
if (mydoJobService.selectInOrOutMydoJobList(mydoJob).isEmpty()) {
|
||||
mydoJobService.insertMydoJob(mydoJob);
|
||||
log.info("【入库请求】请求生成wcs作业成功,wms下发任务单号:{}, 任务号:{},托盘条码:{},分配货位:{}", mydoJob.getJobId(), mydoJob.getTaskNo(), mydoJob.getTrayCode(), mydoJob.getCargoSpaceId());
|
||||
}else{
|
||||
//向输送机下发任务号
|
||||
//如果已经生成入库任务 - 向输送机下发任务号
|
||||
//todo 调整输送去向值
|
||||
int i = writeToSsj(inSsjDevice.getPlcDbWriteAddress(), mydoJob.getTaskNo(), Integer.parseInt(mydoJob.getTraySize()), 1);
|
||||
if (i == 1) {
|
||||
//写入成功则更新执行阶段
|
||||
mydoJob.setExecutionPhase(TASK_EP_LINE_SSJ);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
log.info("G1004入口输送机下发任务号成功:{}", mydoJob.getTaskNo());
|
||||
log.info("【更新状态】G1004入口输送机下发任务号成功:{}", mydoJob.getTaskNo());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,7 +244,7 @@ public class PortConvThread implements Runnable {
|
||||
int i = writeToSsj(inSsjDevice.getPlcDbWriteAddress(), "99", 99, 1);
|
||||
|
||||
//todo 接口调用失败处理
|
||||
log.info("【请求入库】请求生成wcs作业失败退回,请重试");
|
||||
log.info("【入库请求】请求生成wcs作业失败退回,请重试,请求内容:{}");
|
||||
|
||||
}
|
||||
}
|
||||
@@ -239,7 +256,7 @@ public class PortConvThread implements Runnable {
|
||||
//查询该出库任务
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(inSsjDevice.getTaskNo()));
|
||||
if (mydoJob != null && Integer.parseInt(mydoJob.getInOrOut()) > 20) {
|
||||
log.info("设备:{} 位置:{} 任务号:{} 出库到位", "输送线:", inSsjDevice.getDeviceCode(), mydoJob.getTaskNo());
|
||||
log.info("【出库到位】设备:{},位置:{},任务号:{},出库到位", "输送线:", inSsjDevice.getDeviceCode(), mydoJob.getTaskNo());
|
||||
mydoJobService.insertHistory(mydoJob.getJobId());
|
||||
mydoJobService.deleteMydoJobByJobId(mydoJob.getJobId());
|
||||
JobCallBack jobCallBack = new JobCallBack();
|
||||
@@ -249,7 +266,7 @@ public class PortConvThread implements Runnable {
|
||||
jobCallBack.setTaskNo(Convert.toLong(mydoJob.getTaskNo()));
|
||||
jobCallBack.setCreateTime(new Date());
|
||||
jobCallBack.setTaskTypeCode("");//todo ???
|
||||
jobCallBack.setReqCode(UUID.randomUUID().toString());
|
||||
jobCallBack.setReqCode(UUID.randomUUID().toString().replace("-", ""));
|
||||
jobCallBack.setTaskCode(mydoJob.getWmsTaskNo());
|
||||
// jobCallBack.setSpare1("0");
|
||||
jobCallBackService.insertJobCallBack(jobCallBack);
|
||||
|
||||
@@ -53,6 +53,7 @@ public class RoadConvThread implements Runnable {
|
||||
basCargoSpaceService = SpringUtils.getBean(IBasCargoSpaceService.class);
|
||||
ddjDeviceExecutionQueueService = SpringUtils.getBean(IDdjDeviceExecutionQueueService.class);
|
||||
//初始化巷道口 排 列 层
|
||||
//todo 核对堆垛机取放位置的货位编码
|
||||
roadwayMap.put("L1001", Arrays.asList(2, 0, 1));
|
||||
// roadwayMap.put("L1004", Arrays.asList(4, 0, 1));
|
||||
log.info("初始化服务 {},{}", apiService, agvQueueService);
|
||||
@@ -91,82 +92,74 @@ public class RoadConvThread implements Runnable {
|
||||
|
||||
|
||||
public void inDispatch(DeviceSsj roadSsjDevice) {
|
||||
//巷道口到位,且任务号大于1000
|
||||
|
||||
//---------------------------入库任务---------------------------
|
||||
//巷道口输送机到位,且任务号大于1000
|
||||
if (roadSsjDevice.getDw()==1 && roadSsjDevice.getTaskNo()>1000) {
|
||||
|
||||
//查找当前执行的入库任务
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(roadSsjDevice.getTaskNo()));
|
||||
if(ObjUtil.isNotNull(mydoJob)){
|
||||
if(mydoJob.getCargoSpaceId() == null || "".equals(mydoJob.getCargoSpaceId())){
|
||||
AjaxResult ajaxResult = apiService.requestWmsSpace(mydoJob);
|
||||
if(ajaxResult.isSuccess()){
|
||||
BasCargoSpace space = BeanUtil.toBean(ajaxResult.get("data"), BasCargoSpace.class);
|
||||
String cargoSpaceId = space.getCargoSpaceId();
|
||||
mydoJob.setCargoSpaceId(cargoSpaceId);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
}
|
||||
if(mydoJob.getCargoSpaceId()!=null && !"".equals(mydoJob.getCargoSpaceId())){
|
||||
if(mydoJob.getExecutionPhase().equals(TASK_EP_SSJ)){
|
||||
mydoJob.setExecutionPhase(TASK_EP_ROADWAY_SSJ);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
if (ObjUtil.isNotNull(mydoJob) && mydoJob.getExecutionPhase().equals(TASK_EP_ROADWAY_SSJ)
|
||||
&& Convert.toInt(mydoJob.getInOrOut()) < 20) {
|
||||
List<DdjDeviceExecutionQueue> ddjDeviceExecutionQueues = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueListByRwlx(DDJ_RWLX_1, Convert.toInt(mydoJob.getRoadwayId()));
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
List<Integer> pclList = roadwayMap.get(roadSsjDevice.getDeviceCode());
|
||||
if (CollUtil.isEmpty(ddjDeviceExecutionQueues) && ObjUtil.isNotNull(basCargoSpace) && CollUtil.isNotEmpty(pclList)) {
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = new DdjDeviceExecutionQueue();
|
||||
ddjDeviceExecutionQueue.setUuid(IdUtil.simpleUUID());
|
||||
ddjDeviceExecutionQueue.setRwh(Convert.toLong(mydoJob.getTaskNo()));
|
||||
ddjDeviceExecutionQueue.setDevName(mydoJob.getRoadwayId());
|
||||
ddjDeviceExecutionQueue.setDevId(Convert.toInt(mydoJob.getRoadwayId()));
|
||||
ddjDeviceExecutionQueue.setRwzt(0);
|
||||
ddjDeviceExecutionQueue.setYph(pclList.get(0));
|
||||
ddjDeviceExecutionQueue.setYlh(pclList.get(1));
|
||||
ddjDeviceExecutionQueue.setYch(pclList.get(2));
|
||||
ddjDeviceExecutionQueue.setMbph(Convert.toInt(basCargoSpace.getThePlatoon()));
|
||||
ddjDeviceExecutionQueue.setMblh(Convert.toInt(basCargoSpace.getTheColumn()));
|
||||
ddjDeviceExecutionQueue.setMbch(Convert.toInt(basCargoSpace.getTheFloor()));
|
||||
ddjDeviceExecutionQueue.setDdjxf("0");
|
||||
ddjDeviceExecutionQueue.setMlfs(5);
|
||||
ddjDeviceExecutionQueue.setSpare1(mydoJob.getTraySize());
|
||||
ddjDeviceExecutionQueue.setScsj(DateUtil.formatDateTime(DateUtil.date()));
|
||||
ddjDeviceExecutionQueue.setRwlx(DDJ_RWLX_1);
|
||||
ddjDeviceExecutionQueueService.insertDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
|
||||
mydoJob.setExecutionPhase(TASK_EP_DDJ);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
//更新任务阶段: 入口输送机 → 巷道口入库到位
|
||||
if(mydoJob.getExecutionPhase().equals(TASK_EP_SSJ)){
|
||||
mydoJob.setExecutionPhase(TASK_EP_ROADWAY_SSJ);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
|
||||
// 检查任务属性:【任务已存在】、执行阶段-【巷道口输送机到位】、任务类型-【入库】
|
||||
// 下发堆垛机执行队列
|
||||
if (ObjUtil.isNotNull(mydoJob) && mydoJob.getExecutionPhase().equals(TASK_EP_ROADWAY_SSJ)
|
||||
&& Convert.toInt(mydoJob.getInOrOut()) < 20) {
|
||||
List<DdjDeviceExecutionQueue> ddjDeviceExecutionQueues = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueListByRwlx(DDJ_RWLX_1, Convert.toInt(mydoJob.getRoadwayId()));
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
List<Integer> pclList = roadwayMap.get(roadSsjDevice.getDeviceCode());
|
||||
if (CollUtil.isEmpty(ddjDeviceExecutionQueues) && ObjUtil.isNotNull(basCargoSpace) && CollUtil.isNotEmpty(pclList)) {
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = new DdjDeviceExecutionQueue();
|
||||
ddjDeviceExecutionQueue.setUuid(IdUtil.simpleUUID());
|
||||
ddjDeviceExecutionQueue.setRwh(Convert.toLong(mydoJob.getTaskNo()));
|
||||
ddjDeviceExecutionQueue.setDevName(mydoJob.getRoadwayId());
|
||||
ddjDeviceExecutionQueue.setDevId(Convert.toInt(mydoJob.getRoadwayId()));
|
||||
ddjDeviceExecutionQueue.setRwzt(0);
|
||||
ddjDeviceExecutionQueue.setYph(pclList.get(0));
|
||||
ddjDeviceExecutionQueue.setYlh(pclList.get(1));
|
||||
ddjDeviceExecutionQueue.setYch(pclList.get(2));
|
||||
ddjDeviceExecutionQueue.setMbph(Convert.toInt(basCargoSpace.getThePlatoon()));
|
||||
ddjDeviceExecutionQueue.setMblh(Convert.toInt(basCargoSpace.getTheColumn()));
|
||||
ddjDeviceExecutionQueue.setMbch(Convert.toInt(basCargoSpace.getTheFloor()));
|
||||
ddjDeviceExecutionQueue.setDdjxf("0");
|
||||
ddjDeviceExecutionQueue.setMlfs(5);
|
||||
ddjDeviceExecutionQueue.setSpare1(mydoJob.getTraySize());
|
||||
ddjDeviceExecutionQueue.setScsj(DateUtil.formatDateTime(DateUtil.date()));
|
||||
ddjDeviceExecutionQueue.setRwlx(DDJ_RWLX_1);
|
||||
ddjDeviceExecutionQueueService.insertDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
|
||||
//生成堆垛机执行队列后更新任务阶段
|
||||
mydoJob.setExecutionPhase(TASK_EP_DDJ);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(roadSsjDevice.getKx()==1 && roadSsjDevice.getTaskNo() == 0){
|
||||
// List<String> exitList = new ArrayList<>();
|
||||
// if("L1002".equals(roadSsjDevice.getDeviceCode())){
|
||||
// exitList.add("L1001");
|
||||
// }
|
||||
// if("L1004".equals(roadSsjDevice.getDeviceCode())){
|
||||
// exitList.add("L1003");
|
||||
// }
|
||||
// List<MydoJob> inList = mydoJobService.getInJobByEntrance(exitList);
|
||||
String exitId = "";
|
||||
if("L1002".equals(roadSsjDevice.getDeviceCode())){
|
||||
exitId = "L1001";
|
||||
}
|
||||
if("L1004".equals(roadSsjDevice.getDeviceCode())){
|
||||
exitId = "L1003";
|
||||
}
|
||||
|
||||
//---------------------------出库任务---------------------------
|
||||
if(roadSsjDevice.getKx()==1 && roadSsjDevice.getTaskNo() == 0){
|
||||
|
||||
//检查是否有入口是【G1004】的入库任务
|
||||
String exitId = "G1004";
|
||||
List<MydoJob> inList = mydoJobService.getInJobByEntranceId(exitId);
|
||||
|
||||
if(inList.size() == 0){
|
||||
// MydoJob mydoJob = mydoJobService.selectMydoJobByExitList(exitList);
|
||||
|
||||
//检查是否有出库任务
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByExitId(exitId);
|
||||
if (ObjUtil.isNotNull(mydoJob)) {
|
||||
|
||||
//如果有出库任务 - 检查货位编码是否合法
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
if (ObjUtil.isNull(basCargoSpace)) {
|
||||
log.error("货位不存在 cargoSpaceId{}", mydoJob.getCargoSpaceId());
|
||||
log.error("【任务异常】货位不存在 cargoSpaceId{}", mydoJob.getCargoSpaceId());
|
||||
} else {
|
||||
//生成队列
|
||||
List<DdjDeviceExecutionQueue> list = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueListByRwlx(DDJ_RWLX_1, Convert.toInt(mydoJob.getRoadwayId()));
|
||||
@@ -200,7 +193,7 @@ public class RoadConvThread implements Runnable {
|
||||
}
|
||||
}
|
||||
}else{
|
||||
log.info("当前出口"+ exitId+"存在入库任务,无法出库!");
|
||||
log.info("【出库警告】当前出口"+ exitId +"存在入库任务,无法出库!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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="reqCode" column="req_code" />
|
||||
<result property="taskTypeCode" column="task_type_code" />
|
||||
<result property="taskCode" column="task_code" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectJobCallBackVo">
|
||||
select id, type, task_no, mydojob_id, status, create_time from job_call_back
|
||||
select id, type, task_no, mydojob_id, status, create_time,req_code,task_type_code,task_code from job_call_back
|
||||
</sql>
|
||||
|
||||
<select id="selectJobCallBackList" parameterType="JobCallBack" resultMap="JobCallBackResult">
|
||||
@@ -25,11 +25,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<where>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="taskNo != null "> and task_no = #{taskNo}</if>
|
||||
<if test="mydojobId != null and mydojobId != ''"> and mydojob_id = #{mydojobId}</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>
|
||||
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
|
||||
<if test="mydojobId != null and mydojobId != ''"> and mydojob_id = #{mydojobId}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="reqCode != null and reqCode != ''"> and req_code = #{reqCode}</if>
|
||||
<if test="taskTypeCode != null and taskTypeCode != ''"> and task_type_code = #{taskTypeCode}</if>
|
||||
<if test="taskCode != null and taskCode != ''"> and task_code = #{taskCode}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -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="reqCode != null">req_code,</if>
|
||||
<if test="taskTypeCode != null">task_type_code,</if>
|
||||
<if test="taskCode != null">task_code,</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="reqCode != null">#{reqCode},</if>
|
||||
<if test="taskTypeCode != null">#{taskTypeCode},</if>
|
||||
<if test="taskCode != null">#{taskCode},</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="reqCode != null">req_code = #{reqCode},</if>
|
||||
<if test="taskTypeCode != null">task_type_code = #{taskTypeCode},</if>
|
||||
<if test="taskCode != null">task_code = #{taskCode},</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_timefrom job_call_back
|
||||
select top(1) id, type, task_no, mydojob_id, status, create_time,req_code,task_type_code,task_code from job_call_back
|
||||
where status = '0' and spare1 in ('0','1','2')
|
||||
order by create_time asc
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user