fix:货位分配高度丢失;opt:一楼分配逻辑优化
This commit is contained in:
@@ -156,11 +156,11 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
|
||||
* @author gbx
|
||||
*/
|
||||
@SneakyThrows
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, Object> secondaryAllocationPoint(String taskCode, String actionType) {
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", HttpStatus.BAD_REQUEST.value());
|
||||
RedissonUtils.lock(c-> {
|
||||
try {Thread.sleep(1000);} catch (InterruptedException e) {}
|
||||
String pointCode = "";
|
||||
String action = "";
|
||||
switch (actionType) {
|
||||
|
||||
@@ -23,6 +23,9 @@ import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.redisson.api.RLock;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -71,38 +74,23 @@ public class AutoSendVehicleToKzj extends Prun{
|
||||
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
||||
try {
|
||||
if (tryLock) {
|
||||
JSONObject task = new JSONObject();
|
||||
String pointCode2;
|
||||
//todo 只允许2个补空任务,后期需要根据区域动态获取任务数量
|
||||
List<String> taskTypes = new ArrayList<>(Arrays.asList(PackageInfoIvtEnum.TASK_TYPE.code("补空(待检区->空载具缓存位)"), PackageInfoIvtEnum.TASK_TYPE.code("补空(管制区->空载具缓存位)")));
|
||||
List<String> taskTypes = new ArrayList<>(Arrays.asList(PackageInfoIvtEnum.TASK_TYPE.code("补空(待检区->空载具缓存位)")));
|
||||
List<SchBaseTask> existTask = taskService.getExistTasks(taskTypes);
|
||||
if (existTask.size() > 1) {
|
||||
return;
|
||||
}
|
||||
List<BstIvtPackageinfoivt> kzjIvtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("空载具缓存位"), PackageInfoIvtEnum.IVT_STATUS.code("空"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("空载具放货"), PackageInfoIvtEnum.SORT_TYPE.code("降序"), PackageInfoIvtEnum.TASK_TYPE.code("补空(待检区->空载具缓存位)"));
|
||||
//空载具缓存位预分配点
|
||||
if (ObjectUtils.isNotEmpty(kzjIvtList)) {
|
||||
pointCode2 = kzjIvtList.get(0).getPoint_code();
|
||||
if (StringUtils.isBlank(pointCode2)) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
//存在补空的缓存位数量
|
||||
List<BstIvtPackageinfoivt> packageinfoivtList = packageinfoivtService.getBstIvtPackageinfoivts(PackageInfoIvtEnum.POINT_STATUS.code("空载具缓存位"), PackageInfoIvtEnum.IVT_STATUS.code("空"), null,false);
|
||||
task.put("vehicle_code2", PackageInfoIvtEnum.AGV_ACTION_TYPE.code("放货二次分配"));
|
||||
task.put("point_code4", pointCode2);
|
||||
task.put("point_code2", packageinfoivtService.getWaitPoint(kzjIvtList.get(0).getBlock(), kzjIvtList.get(0).getWait_point_type()));
|
||||
if (packageinfoivtList.size() == 1) {
|
||||
getPointCode(task, PackageInfoIvtEnum.TASK_TYPE.code("补空(待检区->空载具缓存位)"));
|
||||
} else {
|
||||
if (existTask.size() % 2 != 0) {
|
||||
getPointCode(task, PackageInfoIvtEnum.TASK_TYPE.code("补空(管制区->空载具缓存位)"));
|
||||
} else {
|
||||
//优先去待检区
|
||||
getPointCode(task, PackageInfoIvtEnum.TASK_TYPE.code("补空(待检区->空载具缓存位)"));
|
||||
}
|
||||
List<BstIvtPackageinfoivt> empPoints = packageinfoivtService.selectEmpPoints(PackageInfoIvtEnum.POINT_STATUS.code("空载具缓存位"), PackageInfoIvtEnum.IVT_STATUS.code("空"));
|
||||
List<BstIvtPackageinfoivt> vehiclePoints = packageinfoivtService.selectEmpPoints(PackageInfoIvtEnum.POINT_STATUS.code("待检区"), PackageInfoIvtEnum.IVT_STATUS.code("空载具"));
|
||||
if (!CollectionUtils.isEmpty(empPoints) && !CollectionUtils.isEmpty(vehiclePoints)){
|
||||
JSONObject task = new JSONObject();
|
||||
task.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("补空(待检区->空载具缓存位)"));
|
||||
task.put("vehicle_code2", PackageInfoIvtEnum.AGV_ACTION_TYPE.code("放货二次分配"));
|
||||
task.put("point_code1", vehiclePoints.get(0).getPoint_code());
|
||||
task.put("point_code2", packageinfoivtService.getWaitPoint(vehiclePoints.get(0).getBlock(), vehiclePoints.get(0).getWait_point_type()));
|
||||
//预占用点位
|
||||
task.put("point_code3", empPoints.get(0).getPoint_code());
|
||||
djqToKzjhcwTask.createTask(task);
|
||||
}
|
||||
} else {
|
||||
log.info("待检区或管制区->空载具缓存位补空任务正在创建被锁住。");
|
||||
|
||||
@@ -114,10 +114,12 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
||||
.eq("is_delete", "0")
|
||||
.orderByDesc("task_id")
|
||||
.last("limit 1"));
|
||||
String vehicleCode2 = one.getVehicle_code2();
|
||||
if (whereJson.getString("vehicle_code").equals(vehicleCode2)){
|
||||
throw new BadRequestException("当前托盘"+whereJson.getString("vehicle_code")+"已经存在木箱入库任务"+one.getTask_code());
|
||||
};
|
||||
if (one!=null){
|
||||
String vehicleCode2 = one.getVehicle_code2();
|
||||
if (whereJson.getString("vehicle_code").equals(vehicleCode2)){
|
||||
throw new BadRequestException("当前托盘"+whereJson.getString("vehicle_code")+"已经存在木箱入库任务"+one.getTask_code());
|
||||
};
|
||||
}
|
||||
//查询仓库是否存在相同木箱
|
||||
JSONArray stIvtStructattr = WQLObject.getWQLObject("st_ivt_structattr").query("storagevehicle_code = '" + boxNo + "'").getResultJSONArray(0);
|
||||
if (stIvtStructattr != null && stIvtStructattr.size() > 0) {
|
||||
@@ -736,6 +738,8 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
||||
json.put("box_length", jsonParam.getString("box_length"));
|
||||
json.put("box_width", jsonParam.getString("box_width"));
|
||||
json.put("box_high", jsonParam.getString("box_high"));
|
||||
json.put("vehicle_type", jsonParam.getString("vehicle_type"));
|
||||
json.put("height", jsonParam.getString("height"));
|
||||
|
||||
String row_num_2 = getMinRow(json);
|
||||
json.put("row_num", row_num_2);
|
||||
|
||||
@@ -1846,7 +1846,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
* 二楼到一楼,成品子卷到达一楼输送线
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public JSONObject sendProductToFirstFloor(JSONObject whereJson) {
|
||||
log.info("sendProductToFirstFloor被调用--------------------------:" + whereJson.toString());
|
||||
if (StringUtils.isBlank(whereJson.getString("device_code")) || StringUtils.isBlank(whereJson.getString("material_barcode"))) {
|
||||
@@ -1897,6 +1896,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
taskParam.put("is_send", true);
|
||||
mzhcwTask.createTask(taskParam);
|
||||
PdmProductSpecServiceImpl.doRecord(SpecEnum.XX,null,Boolean.TRUE,null,whereJson.getString("material_barcode"));
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "反馈成功!");
|
||||
return result;
|
||||
|
||||
@@ -6,7 +6,7 @@ spring:
|
||||
freemarker:
|
||||
check-template-location: false
|
||||
profiles:
|
||||
active: prod
|
||||
active: dev
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
data:
|
||||
|
||||
Reference in New Issue
Block a user