更新料箱库, 删除一次只下发一个任务给wcs的限制, 添加上报上位机回调

This commit is contained in:
李宇奇 2026-01-09 16:01:40 +08:00
parent 6af6bd1209
commit efbe57735c
8 changed files with 68 additions and 56 deletions

View File

@ -28,3 +28,4 @@ replay_pid*
/.idea/inspectionProfiles/Project_Default.xml /.idea/inspectionProfiles/Project_Default.xml
/.idea/CoolRequestHistoryPersistent.xml /.idea/CoolRequestHistoryPersistent.xml
/.idea/CoolRequestCookiePersistent.xml /.idea/CoolRequestCookiePersistent.xml
/.mvn

View File

@ -0,0 +1,15 @@
package com.wms_main.model.dto.request.mywms;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@AllArgsConstructor
@NoArgsConstructor
@Data
public class OrderInCancel {
@JsonProperty("vehicleNo")
private String vehicleNo;
}

View File

@ -457,24 +457,24 @@ public class StackerTaskServiceImpl implements IStackerTaskService {
if (!appTaskBakService.save(wmsTask.of())) { if (!appTaskBakService.save(wmsTask.of())) {
log.info("备份入库任务失败,任务:{}", wmsTask.getTaskId()); log.info("备份入库任务失败,任务:{}", wmsTask.getTaskId());
} }
// OrderInCBReq orderInCBReq = new OrderInCBReq(); OrderInCBReq orderInCBReq = new OrderInCBReq();
// orderInCBReq.setTaskId(orderIn.getOrderId()); orderInCBReq.setTaskId(orderIn.getOrderId());
// orderInCBReq.setVehicleNo(wmsTask.getVehicleId()); orderInCBReq.setVehicleNo(wmsTask.getVehicleId());
// orderInCBReq.setLocationId(wmsTask.getDestination()); orderInCBReq.setLocationId(wmsTask.getDestination());
// orderInCBReq.setResult(OrderInCBEnums.COMPLETE.getCode()); orderInCBReq.setResult(OrderInCBEnums.COMPLETE.getCode());
// orderInCBReq.setResultMessage("入库完成"); orderInCBReq.setResultMessage("入库完成");
// int times = 0; int times = 0;
// MesApiResponse response = null; MesApiResponse response = null;
// do { do {
// Thread.sleep(15000L * times); Thread.sleep(15000L * times);
// response = externalApiService.invokeOrderInCB(orderInCBReq); response = externalApiService.invokeOrderInCB(orderInCBReq);
// times++; times++;
// } while (response.getCode() != 0 && times <= 10); } while (response.getCode() != 0 && times <= 10);
// if (response.getCode() != 0) { if (response.getCode() != 0) {
// log.error("[wms]上报失败"); log.error("[wms]上报失败");
// } else { } else {
// log.info("[wms]上报成功"); log.info("[wms]上报成功");
// } }
} }
} }
@ -580,26 +580,26 @@ public class StackerTaskServiceImpl implements IStackerTaskService {
appOrderOutService.removeBatchByIds(orderOuts); appOrderOutService.removeBatchByIds(orderOuts);
} }
} }
// for (TAppOrderOut orderOut : orderOuts) { for (TAppOrderOut orderOut : orderOuts) {
// OrderOutCBReq orderOutCBReq = new OrderOutCBReq(); OrderOutCBReq orderOutCBReq = new OrderOutCBReq();
// orderOutCBReq.setTaskId(orderOut.getOrderId()); orderOutCBReq.setTaskId(orderOut.getOrderId());
// orderOutCBReq.setVehicleNo(vehicleId); orderOutCBReq.setVehicleNo(vehicleId);
// orderOutCBReq.setResult(OrderOutCBEnums.COMPLETE.getCode()); orderOutCBReq.setResult(OrderOutCBEnums.COMPLETE.getCode());
// orderOutCBReq.setResultMessage("出库完成"); orderOutCBReq.setResultMessage("出库完成");
// int times = 0; int times = 0;
// MesApiResponse response = null; MesApiResponse response = null;
// do { do {
// response = externalApiService.invokeOrderOutCB(orderOutCBReq); response = externalApiService.invokeOrderOutCB(orderOutCBReq);
// times++; times++;
// Thread.sleep(15000L * times); Thread.sleep(15000L * times);
// } while (response.getCode() != 0 && times <= 10); } while (response.getCode() != 0 && times <= 10);
// if (response.getCode() != 0) { if (response.getCode() != 0) {
// log.error("[WMS]上报失败"); log.error("[WMS]上报失败");
// } else { } else {
// log.info("[WMS]上报成功"); log.info("[WMS]上报成功");
// } }
// } }
} }
} }
} }

View File

@ -49,10 +49,6 @@ public class WcsStackerTaskSender implements Job {
*/ */
@Override @Override
public void execute(JobExecutionContext jobExecutionContext) { public void execute(JobExecutionContext jobExecutionContext) {
if (appWcsTaskService.exists(new LambdaQueryWrapper<TAppWcsTask>().eq(TAppWcsTask::getWcsTaskStatus,
WcsStackerTaskStatusEnums.WAIT.getCode()))) {
return;
}
// 查询到所有的待下发的wcsTask并按优先级排序 // 查询到所有的待下发的wcsTask并按优先级排序
List<TAppWcsTask> waitSendWcsTaskList = appWcsTaskService.list( List<TAppWcsTask> waitSendWcsTaskList = appWcsTaskService.list(
new LambdaQueryWrapper<TAppWcsTask>() new LambdaQueryWrapper<TAppWcsTask>()

View File

@ -5,9 +5,9 @@ spring:
datasource: datasource:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
# 本地 # 本地
# url: jdbc:mysql://localhost:3306/wms_mengyang_box?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true # url: jdbc:mysql://localhost:3306/wms_mengyang_box?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
# username: root # username: root
# password: root # password: root
# 服务器 # 服务器
url: jdbc:mysql://localhost:3306/wms_mengyang_box?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true url: jdbc:mysql://localhost:3306/wms_mengyang_box?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
username: user username: user

View File

@ -1,4 +1,4 @@
package com.wms_main.service.api.serviceImpl; package com.wms_main.service.api.serviceImpl;
import com.wms_main.app.AppCommon; import com.wms_main.app.AppCommon;
@ -45,14 +45,14 @@ public class WcsApiServiceImpl implements IWcsApiService {
public WcsApiResponse<WcsStackerTask> sendWcsStackerTask(WcsStackerTaskRequest request) { public WcsApiResponse<WcsStackerTask> sendWcsStackerTask(WcsStackerTaskRequest request) {
// 设置http请求 // 设置http请求
HttpRequest httpRequest = HttpRequest.postInstanceOf(appCommon.getConfigByKey(AppConfigKeyEnums.WCS_STACKER_TASK_URL.getKey()), request); HttpRequest httpRequest = HttpRequest.postInstanceOf(appCommon.getConfigByKey(AppConfigKeyEnums.WCS_STACKER_TASK_URL.getKey()), request);
HttpResponse httpResponse = httpClient.httpPost(httpRequest); HttpResponse httpResponse = httpClient.httpPost(httpRequest);
if (httpResponse != null && httpResponse.isSuccess()) { if (httpResponse != null && httpResponse.isSuccess()) {
WcsApiResponse<WcsStackerTask> response = new WcsApiResponse<>(); WcsApiResponse<WcsStackerTask> response = new WcsApiResponse<>();
response = httpResponse.getData(response.getClass().asSubclass(WcsApiResponse.class)); response = httpResponse.getData(response.getClass().asSubclass(WcsApiResponse.class));
return response; return response;
} }
return WcsApiResponse.error("请求未获得响应信息。", null); return WcsApiResponse.error("请求未获得响应信息。", null);
// return WcsApiResponse.success("请求未获得响应信息。", null); // return WcsApiResponse.success("请求未获得响应信息。", null);
} }
/** /**

View File

@ -5,9 +5,9 @@ spring:
datasource: datasource:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
# 本地 # 本地
# url: jdbc:mysql://localhost:3306/wms_mengyang_tp?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true # url: jdbc:mysql://localhost:3306/wms_mengyang_tp?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
# username: root # username: root
# password: root # password: root
# 服务器 # 服务器
url: jdbc:mysql://localhost:3306/wms_mengyang_tp?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true url: jdbc:mysql://localhost:3306/wms_mengyang_tp?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
username: user username: user