修改出库任务优先级

This commit is contained in:
刘汗青
2026-05-13 14:30:55 +08:00
parent 8e60b8e9c1
commit b4ed427de9
4 changed files with 6 additions and 3 deletions

View File

@@ -17,5 +17,6 @@ public class ReceiveJob {
private String jobId; private String jobId;
private String roadwayId; private String roadwayId;
private String warehouseId; private String warehouseId;
private Long priority;
} }

View File

@@ -368,6 +368,7 @@ public class ApiServiceImpl implements IApiService {
mydoJob.setCreateTime(DateUtils.getNowDate()); mydoJob.setCreateTime(DateUtils.getNowDate());
mydoJob.setExecutionPhase("0"); mydoJob.setExecutionPhase("0");
mydoJob.setWarehouseId(receiveOutJob.getWarehouseId()); mydoJob.setWarehouseId(receiveOutJob.getWarehouseId());
mydoJob.setPriority(receiveOutJob.getPriority());
int i = mydoJobService.insertMydoJob(mydoJob); int i = mydoJobService.insertMydoJob(mydoJob);
if (i > 0) { if (i > 0) {
return AjaxResult.success(); return AjaxResult.success();

View File

@@ -22,19 +22,19 @@ public class CheckWeight {
// 只清空 300ms 内收到的历史数据 // 只清空 300ms 内收到的历史数据
// 时间到立刻停止清空,开始读最新重量 // 时间到立刻停止清空,开始读最新重量
byte[] clearBuf = new byte[4096]; byte[] clearBuf = new byte[4096];
long endClearTime = System.currentTimeMillis() + 1000; // 最多清300毫秒 long endClearTime = System.currentTimeMillis() + 800; // 最多清300毫秒
while (System.currentTimeMillis() < endClearTime) { while (System.currentTimeMillis() < endClearTime) {
if (is.available() > 0) { if (is.available() > 0) {
is.read(clearBuf); is.read(clearBuf);
} else { } else {
Thread.sleep(5); Thread.sleep(50);
} }
} }
// ======================================================================== // ========================================================================
// 清空完成 → 读取最新数据 // 清空完成 → 读取最新数据
Thread.sleep(100); Thread.sleep(200);
byte[] bytes = new byte[256]; byte[] bytes = new byte[256];
int read = is.read(bytes); int read = is.read(bytes);
if (read != -1) { if (read != -1) {

View File

@@ -249,5 +249,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and status = #{status} and status = #{status}
and roadway_id = #{roadwayId} and roadway_id = #{roadwayId}
and warehouse_id = #{warehouseId} and warehouse_id = #{warehouseId}
order by priority desc,create_time asc
</select> </select>
</mapper> </mapper>