rev: 分切子卷号
This commit is contained in:
@@ -206,6 +206,7 @@ public class SlitterPdaServiceImpl implements SlitterPdaService {
|
|||||||
.map(PdmBiSlittingproductionplan::getContainer_name)
|
.map(PdmBiSlittingproductionplan::getContainer_name)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
param.put("container", collect);
|
param.put("container", collect);
|
||||||
|
param.put("qzzs", qzzNo);
|
||||||
param.put("config_code", "SlitterDownAGVTask");
|
param.put("config_code", "SlitterDownAGVTask");
|
||||||
param.put("device_code", device.getPoint_code());
|
param.put("device_code", device.getPoint_code());
|
||||||
param.put("create_mode", GeneralDefinition.PDA_CREATION);
|
param.put("create_mode", GeneralDefinition.PDA_CREATION);
|
||||||
@@ -397,12 +398,13 @@ public class SlitterPdaServiceImpl implements SlitterPdaService {
|
|||||||
String pointCode = row.get(0).getPoint_code();
|
String pointCode = row.get(0).getPoint_code();
|
||||||
StIvtCutpointivt cutDevice = cutpointivtService.getPintByUpOrDownCode(pointCode, false);
|
StIvtCutpointivt cutDevice = cutpointivtService.getPintByUpOrDownCode(pointCode, false);
|
||||||
List<PdmBiSlittingproductionplan> plans = new ArrayList<>();
|
List<PdmBiSlittingproductionplan> plans = new ArrayList<>();
|
||||||
|
int count = 1;
|
||||||
for (CallShaftVo callShaftVo : row) {
|
for (CallShaftVo callShaftVo : row) {
|
||||||
// 保存工单
|
// 保存工单
|
||||||
PdmBiSlittingproductionplan plan = new PdmBiSlittingproductionplan();
|
PdmBiSlittingproductionplan plan = new PdmBiSlittingproductionplan();
|
||||||
plan.setWorkorder_id(IdUtil.getSnowflake(1,1).nextIdStr());
|
plan.setWorkorder_id(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||||
plan.setOrder_type("1");
|
plan.setOrder_type("1");
|
||||||
plan.setContainer_name("-");
|
plan.setContainer_name(TaskUtils.createVirtualSubContainer("yyMMddHHmmss", cutDevice.getExt_code(), count++));
|
||||||
plan.setProduct_name("-");
|
plan.setProduct_name("-");
|
||||||
plan.setDescription("-");
|
plan.setDescription("-");
|
||||||
plan.setWare_house("-");
|
plan.setWare_house("-");
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ public class NbjPdaServiceImpl implements NbjPdaService {
|
|||||||
log.info("手持子卷下线,送到一楼 - {}", param);
|
log.info("手持子卷下线,送到一楼 - {}", param);
|
||||||
// point_code, vehicle_code, container_name
|
// point_code, vehicle_code, container_name
|
||||||
String pointCode = param.getString("point_code");
|
String pointCode = param.getString("point_code");
|
||||||
String containerName = param.getString("container_name");
|
// String containerName = param.getString("container_name");
|
||||||
String vehicleCode = param.getString("vehicle_code");
|
String vehicleCode = param.getString("vehicle_code");
|
||||||
// 校验任务
|
// 校验任务
|
||||||
List<SchBaseTask> schBaseTasks = taskService.checkHaveTask(pointCode);
|
List<SchBaseTask> schBaseTasks = taskService.checkHaveTask(pointCode);
|
||||||
@@ -127,14 +127,14 @@ public class NbjPdaServiceImpl implements NbjPdaService {
|
|||||||
throw new BadRequestException("该点位已经创建过任务!");
|
throw new BadRequestException("该点位已经创建过任务!");
|
||||||
}
|
}
|
||||||
// 判断子卷是否存在
|
// 判断子卷是否存在
|
||||||
PdmBiSlittingproductionplan plan = slittingproductionplanService.getByContainerName(containerName);
|
// PdmBiSlittingproductionplan plan = slittingproductionplanService.getByContainerName(containerName);
|
||||||
if (ObjectUtil.isEmpty(plan)) {
|
// if (ObjectUtil.isEmpty(plan)) {
|
||||||
throw new BadRequestException("子卷[" + containerName + "]的分切计划不存在!");
|
// throw new BadRequestException("子卷[" + containerName + "]的分切计划不存在!");
|
||||||
}
|
// }
|
||||||
SchBasePoint startPoint = pointService.getById(pointCode);
|
SchBasePoint startPoint = pointService.getById(pointCode);
|
||||||
startPoint.setPoint_status("3");
|
startPoint.setPoint_status("3");
|
||||||
// 子卷号
|
// 子卷号
|
||||||
startPoint.setMaterial_code(containerName);
|
// startPoint.setMaterial_code(containerName);
|
||||||
startPoint.setVehicle_code(vehicleCode);
|
startPoint.setVehicle_code(vehicleCode);
|
||||||
setUpdateByPC(startPoint);
|
setUpdateByPC(startPoint);
|
||||||
pointService.updateById(startPoint);
|
pointService.updateById(startPoint);
|
||||||
@@ -142,7 +142,7 @@ public class NbjPdaServiceImpl implements NbjPdaService {
|
|||||||
taskParam.put("device_code", pointCode);
|
taskParam.put("device_code", pointCode);
|
||||||
// 纸管编码
|
// 纸管编码
|
||||||
taskParam.put("vehicle_code", vehicleCode);
|
taskParam.put("vehicle_code", vehicleCode);
|
||||||
taskParam.put("container_name", containerName);
|
// taskParam.put("container_name", containerName);
|
||||||
taskParam.put("config_code", "SubRollDownAGVTask");
|
taskParam.put("config_code", "SubRollDownAGVTask");
|
||||||
taskParam.put("create_mode", GeneralDefinition.PDA_CREATION);
|
taskParam.put("create_mode", GeneralDefinition.PDA_CREATION);
|
||||||
subRollDownAGVTask.apply(taskParam);
|
subRollDownAGVTask.apply(taskParam);
|
||||||
|
|||||||
@@ -138,11 +138,11 @@ public class SubRollDownAGVTask extends AbstractTask {
|
|||||||
public void agvReleaseCompleted(SchBaseTask task) {
|
public void agvReleaseCompleted(SchBaseTask task) {
|
||||||
JSONObject request = JSONObject.parseObject(task.getRequest_param());
|
JSONObject request = JSONObject.parseObject(task.getRequest_param());
|
||||||
if (request.getString("release_point").equals(task.getPoint_code2())) {
|
if (request.getString("release_point").equals(task.getPoint_code2())) {
|
||||||
JSONObject requestObj = JSONObject.parseObject(task.getRequest_param());
|
// JSONObject requestObj = JSONObject.parseObject(task.getRequest_param());
|
||||||
// 终点赋值
|
// 终点赋值
|
||||||
SchBasePoint endPoint = pointService.getById(task.getPoint_code2());
|
SchBasePoint endPoint = pointService.getById(task.getPoint_code2());
|
||||||
endPoint.setPoint_status("3");
|
endPoint.setPoint_status("3");
|
||||||
endPoint.setMaterial_code(requestObj.getString("container_name"));
|
// endPoint.setMaterial_code(requestObj.getString("container_name"));
|
||||||
endPoint.setVehicle_code(task.getVehicle_code());
|
endPoint.setVehicle_code(task.getVehicle_code());
|
||||||
setUpdateByType(endPoint, TaskFinishedTypeEnum.AUTO_ACS);
|
setUpdateByType(endPoint, TaskFinishedTypeEnum.AUTO_ACS);
|
||||||
pointService.updateById(endPoint);
|
pointService.updateById(endPoint);
|
||||||
|
|||||||
@@ -68,12 +68,12 @@ public class SlitterDownAGVTask extends AbstractTask {
|
|||||||
taskLock(task.getConfig_code(), () -> {
|
taskLock(task.getConfig_code(), () -> {
|
||||||
// 分切下料,子卷信息在请求参数中
|
// 分切下料,子卷信息在请求参数中
|
||||||
JSONObject requestObj = JSONObject.parseObject(task.getRequest_param());
|
JSONObject requestObj = JSONObject.parseObject(task.getRequest_param());
|
||||||
JSONArray container = requestObj.getJSONArray("container");
|
JSONArray container = requestObj.getJSONArray("qzzs");
|
||||||
List<String> containerList = container.toJavaList(String.class);
|
List<String> qzzList = container.toJavaList(String.class);
|
||||||
// 获取分切计划,最多4个需要出站的任务
|
// 获取分切计划,最多4个需要出站的任务
|
||||||
List<PdmBiSlittingproductionplan> currentPlans = slittingproductionplanService.list(
|
List<PdmBiSlittingproductionplan> currentPlans = slittingproductionplanService.list(
|
||||||
new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||||
.in(PdmBiSlittingproductionplan::getContainer_name, containerList)
|
.in(PdmBiSlittingproductionplan::getQzzno, qzzList)
|
||||||
.eq(PdmBiSlittingproductionplan::getIs_delete, "0")
|
.eq(PdmBiSlittingproductionplan::getIs_delete, "0")
|
||||||
.eq(PdmBiSlittingproductionplan::getStatus, "05"));
|
.eq(PdmBiSlittingproductionplan::getStatus, "05"));
|
||||||
if (currentPlans.size() == 0) {
|
if (currentPlans.size() == 0) {
|
||||||
|
|||||||
@@ -398,4 +398,14 @@ public class TaskUtils {
|
|||||||
public static String createVirtualContainer(String rollCode, String format, String pointCode) {
|
public static String createVirtualContainer(String rollCode, String format, String pointCode) {
|
||||||
return "R-" + pointCode + "-" + TaskUtils.getDateTime(format) + "-" + rollCode;
|
return "R-" + pointCode + "-" + TaskUtils.getDateTime(format) + "-" + rollCode;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 创建虚拟的子卷号
|
||||||
|
* @param format 时间格式
|
||||||
|
* @param pointCode 点位编码
|
||||||
|
* @param count 计数
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String createVirtualSubContainer(String format, String pointCode, int count) {
|
||||||
|
return "S-" + pointCode + "-" + TaskUtils.getDateTime(format) + "-" + count;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user