代码更新:
1. 增加站台非计划的配置 2. 调整下发任务的分配逻辑
This commit is contained in:
parent
635e75fa0e
commit
ae69b6625c
|
|
@ -141,7 +141,7 @@ public class JobComponent {
|
|||
* 每2秒执行一次
|
||||
*/
|
||||
// @Scheduled(fixedDelay = 2000)
|
||||
@Async("myThreadPool")
|
||||
// @Async("myThreadPool")
|
||||
@Transactional(isolation = Isolation.REPEATABLE_READ, propagation = Propagation.REQUIRED)
|
||||
public void solveDuplicateTask() {
|
||||
String sendTask = configMap.get(ConfigMapKeyEnum.SEND_TASK.getConfigKey());
|
||||
|
|
|
|||
|
|
@ -111,6 +111,7 @@ public class StandController {
|
|||
.set(request.getStandStatus() != null, Stand::getStandStatus, request.getStandStatus())
|
||||
.set(request.getLastUseTime() != null, Stand::getLastUseTime, request.getLastUseTime())
|
||||
.set(request.getPickVehicleCount() != null, Stand::getPickVehicleCount, request.getPickVehicleCount())
|
||||
.set(request.getAllowNoPlan() != null, Stand::getAllowNoPlan, request.getAllowNoPlan())
|
||||
.eq(Stand::getStandId, request.getStandId());
|
||||
if (standService.update(lambdaUpdateWrapper)) {
|
||||
logger.info("更新站台信息成功。");
|
||||
|
|
|
|||
|
|
@ -163,6 +163,7 @@ public class TaskController {
|
|||
*/
|
||||
private final IWorkService workService;
|
||||
private final WorkFlowLastService workFlowLastService;// 服务
|
||||
private final StandStackerTaskService standStackerTaskService;// 特殊服务
|
||||
|
||||
/**
|
||||
* 接收入库任务请求
|
||||
|
|
@ -487,6 +488,12 @@ public class TaskController {
|
|||
.set(PickTask::getPickStatus, PickTaskStatusEnum.NEW.getCode())
|
||||
.eq(PickTask::getVehicleId, outTask.getVehicleId())
|
||||
.eq(PickTask::getPickStatus, PickTaskStatusEnum.TEMP.getCode()));
|
||||
// 设置特殊
|
||||
standStackerTaskService.update(new LambdaUpdateWrapper<StandStackerTask>()
|
||||
.set(StandStackerTask::getTaskStatus, 1)
|
||||
.set(StandStackerTask::getFinishTime, LocalDateTime.now())
|
||||
.eq(StandStackerTask::getVehicleId, outTask.getVehicleId())
|
||||
.ne(StandStackerTask::getTaskStatus, 1));
|
||||
} else {// 代表整出
|
||||
// 删除当前载具上所有库存
|
||||
List<Stock> removeStocks = stockService.list(new LambdaQueryWrapper<Stock>().eq(Stock::getVehicleId, outTask.getVehicleId()));
|
||||
|
|
|
|||
|
|
@ -94,4 +94,9 @@ public class StandQuery extends PageQuery {
|
|||
*/
|
||||
@JsonProperty("pickVehicleCount")
|
||||
private Integer pickVehicleCount;
|
||||
/**
|
||||
* 是否允许非计划
|
||||
*/
|
||||
@JsonProperty("allowNoPlan")
|
||||
private Integer allowNoPlan;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,4 +92,9 @@ public class StandVo {
|
|||
*/
|
||||
@JsonProperty("pickVehicleCount")
|
||||
private Integer pickVehicleCount;
|
||||
/**
|
||||
* 是否允许非计划
|
||||
*/
|
||||
@JsonProperty("allowNoPlan")
|
||||
private Integer allowNoPlan;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,21 +8,50 @@ import lombok.Data;
|
|||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 盘点记录
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "tbl_app_inventory_history", autoResultMap = true)
|
||||
public class InventoryHistory {
|
||||
/**
|
||||
* 盘点id
|
||||
*/
|
||||
@TableId("inventory_id")
|
||||
private String inventoryId;
|
||||
/**
|
||||
* 料号
|
||||
*/
|
||||
@TableField("goods_id")
|
||||
private String goodsId;
|
||||
/**
|
||||
* 库存数量
|
||||
*/
|
||||
@TableField("stock_num")
|
||||
private BigDecimal stockNum;
|
||||
/**
|
||||
* 实际数量
|
||||
*/
|
||||
@TableField("real_num")
|
||||
private BigDecimal realNum;
|
||||
/**
|
||||
* 盘点状态
|
||||
*/
|
||||
@TableField("inventory_status")
|
||||
private Integer inventoryStatus;
|
||||
/**
|
||||
* 盘点用户
|
||||
*/
|
||||
@TableField("inventory_user")
|
||||
private String inventoryUser;
|
||||
/**
|
||||
* 盘点日期
|
||||
*/
|
||||
@TableField("inventory_date")
|
||||
private LocalDateTime inventoryDate;
|
||||
/**
|
||||
* 箱号
|
||||
*/
|
||||
@TableField("vehicle_id")
|
||||
private String vehicleId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,8 +50,8 @@ public class InventoryList {
|
|||
@TableField("inventory_date")
|
||||
private LocalDateTime inventoryDate;
|
||||
/**
|
||||
* 清单id
|
||||
* 箱号
|
||||
*/
|
||||
@TableField("list_id")
|
||||
private String listId;
|
||||
@TableField("vehicle_id")
|
||||
private String vehicleId;
|
||||
}
|
||||
|
|
|
|||
59
src/main/java/com/wms/entity/table/StandStackerTask.java
Normal file
59
src/main/java/com/wms/entity/table/StandStackerTask.java
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
package com.wms.entity.table;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@TableName(value = "tbl_app_stand_stacker_task", autoResultMap = true)
|
||||
public class StandStackerTask {
|
||||
/**
|
||||
* 料箱号
|
||||
*/
|
||||
@TableId("vehicle_id")
|
||||
private String vehicleId;
|
||||
/**
|
||||
* 堆垛机号
|
||||
*/
|
||||
@TableField("stacker_id")
|
||||
private Integer stackerId;
|
||||
/**
|
||||
* 站台号
|
||||
*/
|
||||
@TableField("stand_id")
|
||||
private String standId;
|
||||
/**
|
||||
* 任务类型
|
||||
* 1:定额
|
||||
* 2:超额
|
||||
*/
|
||||
@TableField("task_type")
|
||||
private Integer taskType;
|
||||
/**
|
||||
* 上次数量类型
|
||||
* 1:去站台最少
|
||||
* 2:去站台最多
|
||||
*/
|
||||
@TableField("last_qty_type")
|
||||
private Integer lastQtyType;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("create_time")
|
||||
private LocalDateTime createTime;
|
||||
/**
|
||||
* 任务状态
|
||||
* 0:初始
|
||||
* 1:完成
|
||||
*/
|
||||
@TableField("task_status")
|
||||
private Integer taskStatus;
|
||||
/**
|
||||
* 完成时间
|
||||
*/
|
||||
@TableField("finish_time")
|
||||
private LocalDateTime finishTime;
|
||||
}
|
||||
64
src/main/java/com/wms/entity/table/StandStackerTaskBak.java
Normal file
64
src/main/java/com/wms/entity/table/StandStackerTaskBak.java
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
package com.wms.entity.table;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@TableName(value = "tbl_app_stand_stacker_task_bak", autoResultMap = true)
|
||||
public class StandStackerTaskBak {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId("record_id")
|
||||
private String recordId;
|
||||
/**
|
||||
* 料箱号
|
||||
*/
|
||||
@TableField("vehicle_id")
|
||||
private String vehicleId;
|
||||
/**
|
||||
* 堆垛机号
|
||||
*/
|
||||
@TableField("stacker_id")
|
||||
private Integer stackerId;
|
||||
/**
|
||||
* 站台号
|
||||
*/
|
||||
@TableField("stand_id")
|
||||
private String standId;
|
||||
/**
|
||||
* 任务类型
|
||||
* 1:定额
|
||||
* 2:超额
|
||||
*/
|
||||
@TableField("task_type")
|
||||
private Integer taskType;
|
||||
/**
|
||||
* 上次数量类型
|
||||
* 1:去站台最少
|
||||
* 2:去站台最多
|
||||
*/
|
||||
@TableField("last_qty_type")
|
||||
private Integer lastQtyType;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("create_time")
|
||||
private LocalDateTime createTime;
|
||||
/**
|
||||
* 任务状态
|
||||
* 0:初始
|
||||
* 1:完成
|
||||
*/
|
||||
@TableField("task_status")
|
||||
private Integer taskStatus;
|
||||
/**
|
||||
* 完成时间
|
||||
*/
|
||||
@TableField("finish_time")
|
||||
private LocalDateTime finishTime;
|
||||
}
|
||||
11
src/main/java/com/wms/mapper/StandStackerTaskBakMapper.java
Normal file
11
src/main/java/com/wms/mapper/StandStackerTaskBakMapper.java
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
package com.wms.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.wms.entity.table.StandStackerTask;
|
||||
import com.wms.entity.table.StandStackerTaskBak;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface StandStackerTaskBakMapper extends BaseMapper<StandStackerTaskBak> {
|
||||
|
||||
}
|
||||
10
src/main/java/com/wms/mapper/StandStackerTaskMapper.java
Normal file
10
src/main/java/com/wms/mapper/StandStackerTaskMapper.java
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
package com.wms.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.wms.entity.table.StandStackerTask;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface StandStackerTaskMapper extends BaseMapper<StandStackerTask> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package com.wms.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.wms.entity.table.StandStackerTask;
|
||||
import com.wms.entity.table.StandStackerTaskBak;
|
||||
|
||||
public interface StandStackerTaskBakService extends IService<StandStackerTaskBak> {
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.wms.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.wms.entity.table.StandStackerTask;
|
||||
|
||||
public interface StandStackerTaskService extends IService<StandStackerTask> {
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,14 @@
|
|||
package com.wms.service.serviceImplements;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.wms.entity.table.StandStackerTask;
|
||||
import com.wms.entity.table.StandStackerTaskBak;
|
||||
import com.wms.mapper.StandStackerTaskBakMapper;
|
||||
import com.wms.mapper.StandStackerTaskMapper;
|
||||
import com.wms.service.StandStackerTaskBakService;
|
||||
import com.wms.service.StandStackerTaskService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class StandStackerTaskBakServiceImpl extends ServiceImpl<StandStackerTaskBakMapper, StandStackerTaskBak> implements StandStackerTaskBakService {
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.wms.service.serviceImplements;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.wms.entity.table.StandStackerTask;
|
||||
import com.wms.mapper.StandStackerTaskMapper;
|
||||
import com.wms.service.StandStackerTaskService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class StandStackerTaskServiceImpl extends ServiceImpl<StandStackerTaskMapper, StandStackerTask> implements StandStackerTaskService {
|
||||
}
|
||||
6
src/main/resources/mapper/StandStackerTaskMapper.xml
Normal file
6
src/main/resources/mapper/StandStackerTaskMapper.xml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?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.wms.mapper.StandStackerTaskMapper">
|
||||
|
||||
</mapper>
|
||||
6
src/main/resources/mapper/StandStackerTaskMapperBak.xml
Normal file
6
src/main/resources/mapper/StandStackerTaskMapperBak.xml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?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.wms.mapper.StandStackerTaskBakMapper">
|
||||
|
||||
</mapper>
|
||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user