fix: 分切下料,送轴业务
This commit is contained in:
@@ -121,6 +121,7 @@ public class SlitterPdaServiceImpl implements SlitterPdaService {
|
||||
log.info("手持分切确认上料, {}", param);
|
||||
// point_code
|
||||
String pointCode = param.getString("point_code");
|
||||
String option = param.getString("option");
|
||||
// 获取对应任务
|
||||
SchBaseTask task = taskService.getTaskByPointCodeX(null, pointCode, null, null);
|
||||
if (ObjectUtil.isEmpty(task)) {
|
||||
@@ -132,7 +133,7 @@ public class SlitterPdaServiceImpl implements SlitterPdaService {
|
||||
acsParam.put("device_code", pointCode);
|
||||
acsParam.put("task_code", task.getTask_code());
|
||||
acsParam.put("product_area", task.getProduct_area());
|
||||
acsParam.put("option", "1");
|
||||
acsParam.put("option", option);
|
||||
paramArr.add(acsParam);
|
||||
JSONObject jsonObject = wmsToAcsService.updateTask(paramArr);
|
||||
log.info("分切下发ACS,执行AGV动作,请求参数{},返回结果:{}", paramArr, jsonObject);
|
||||
|
||||
@@ -378,18 +378,14 @@ public class NbjPdaServiceImpl implements NbjPdaService {
|
||||
taskParam.put("point_code1", startPoint.getPoint_code());
|
||||
taskParam.put("config_code", "PdaSendShaftAGVTask");
|
||||
taskParam.put("create_mode", GeneralDefinition.PDA_CREATION);
|
||||
if (ObjectUtil.isEmpty(device)) {
|
||||
// 如果没有选择目的地,就是根据点位上维护的信息送
|
||||
List<String> collect = Stream.of(startPoint.getQzz_no1(), startPoint.getQzz_no2())
|
||||
.filter(value -> value != null && !value.isEmpty()).collect(Collectors.toList());
|
||||
List<PdmBiSlittingproductionplan> plans = slittingproductionplanService.list(
|
||||
new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getQzzno, collect)
|
||||
.eq(PdmBiSlittingproductionplan::getStatus, "01")
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, "0"));
|
||||
if (plans.size() == 0) {
|
||||
throw new BadRequestException("系统找不到对应的分切计划,请确保维护了点位信息,或者指定设备!");
|
||||
}
|
||||
List<String> collect = Stream.of(startPoint.getQzz_no1(), startPoint.getQzz_no2())
|
||||
.filter(value -> value != null && !value.isEmpty()).collect(Collectors.toList());
|
||||
List<PdmBiSlittingproductionplan> plans = slittingproductionplanService.list(
|
||||
new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getQzzno, collect)
|
||||
.eq(PdmBiSlittingproductionplan::getStatus, "01")
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, "0"));
|
||||
if (plans.size() > 0) {
|
||||
// 获取上轴分切计划和下轴分切计划,各一条
|
||||
PdmBiSlittingproductionplan currentUpPlan = plans.stream()
|
||||
.filter(p -> "1".equals(p.getUp_or_down()))
|
||||
@@ -399,12 +395,18 @@ public class NbjPdaServiceImpl implements NbjPdaService {
|
||||
.filter(p -> "2".equals(p.getUp_or_down()))
|
||||
.findFirst()
|
||||
.orElse(new PdmBiSlittingproductionplan());
|
||||
PdmBiSlittingproductionplan demoPlan = plans.get(0);
|
||||
StIvtCutpointivt endPoint = stIvtCutpointivtService.getPintByExtCode(demoPlan.getResource_name(), false);
|
||||
taskParam.put("point_code2", endPoint.getPoint_code());
|
||||
taskParam.put("vehicle_code", currentUpPlan.getQzzno());
|
||||
taskParam.put("vehicle_code2", currentDownPlan.getQzzno());
|
||||
}
|
||||
if (ObjectUtil.isEmpty(device)) {
|
||||
if (plans.size() == 0) {
|
||||
throw new BadRequestException("系统找不到对应的分切计划,请确保维护了点位信息,或者指定设备!");
|
||||
}
|
||||
PdmBiSlittingproductionplan demoPlan = plans.get(0);
|
||||
// 如果没有选择目的地,就是根据点位上维护的信息送
|
||||
taskParam.put("is_flag", "1");
|
||||
StIvtCutpointivt endPoint = stIvtCutpointivtService.getPintByExtCode(demoPlan.getResource_name(), false);
|
||||
taskParam.put("point_code2", endPoint.getPoint_code());
|
||||
} else {
|
||||
StIvtCutpointivt endPoint = stIvtCutpointivtService.getPintByExtCode(device, false);
|
||||
taskParam.put("point_code2", endPoint.getPoint_code());
|
||||
|
||||
@@ -107,10 +107,10 @@ public class OtherOperationServiceImpl implements OtherOperationService {
|
||||
JSONObject requestObj = JSONObject.parseObject(task.getRequest_param());
|
||||
List<SchBasePoint> allSjgPoints;
|
||||
if ("1".equals(type)) {
|
||||
// 满入:把对应的点位禁用,并且发起通知,从新获取新点位
|
||||
exceptionPoint.setIs_used(false);
|
||||
// 满入:把对应的点位设置有货,并且发起通知,从新获取新点位
|
||||
exceptionPoint.setPoint_status("2");
|
||||
exceptionPoint.setUpdate_time(DateUtil.now());
|
||||
log.info("满入禁用点位");
|
||||
log.info("满入点位设置有货");
|
||||
pointService.updateById(exceptionPoint);
|
||||
// 查找空位终点即可
|
||||
allSjgPoints = pointService.getAllBusinessNotTaskPoint("A1",
|
||||
|
||||
@@ -74,6 +74,7 @@ public class PdaSendShaftAGVTask extends AbstractTask {
|
||||
task.setRequest_param(JSONObject.toJSONString(form));
|
||||
task.setHandle_class(THIS_CLASS);
|
||||
task.setTask_status(TaskStatus.START_AND_POINT.getCode());
|
||||
TaskUtils.setCreateByDefault(task);
|
||||
taskService.save(task);
|
||||
return task.getTask_id();
|
||||
}
|
||||
@@ -82,20 +83,16 @@ public class PdaSendShaftAGVTask extends AbstractTask {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void finishTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) {
|
||||
checkTaskOptionStatus(taskObj);
|
||||
JSONObject requestObj = JSONObject.parseObject(taskObj.getRequest_param());
|
||||
String isFlag = requestObj.getString("is_flag");
|
||||
String endPointCode = taskObj.getPoint_code2();
|
||||
StIvtCutpointivt endPoint = stIvtCutpointivtService.getOneByCode(endPointCode);
|
||||
if ("1".equals(isFlag)) {
|
||||
List<String> collect = Stream.of(taskObj.getVehicle_code(), taskObj.getVehicle_code2()).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
|
||||
// 有工单,则需要将工单设置入站完成:05
|
||||
if (collect.size() > 0) {
|
||||
// 终点赋值
|
||||
endPoint.setUp_qzzno(taskObj.getVehicle_code());
|
||||
endPoint.setDown_qzzno(taskObj.getVehicle_code2());
|
||||
PointUtils.setCutUpdateByType(endPoint, taskFinishedType);
|
||||
stIvtCutpointivtService.updateById(endPoint);
|
||||
}
|
||||
// 有工单,则需要将工单设置入站完成:05
|
||||
List<String> collect = Stream.of(taskObj.getVehicle_code(), taskObj.getVehicle_code2()).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
|
||||
if (collect.size() > 0) {
|
||||
List<PdmBiSlittingproductionplan> plans = slittingproductionplanService.getByQzzNos(collect);
|
||||
plans.forEach(p -> {
|
||||
p.setStatus("05");
|
||||
|
||||
@@ -62,9 +62,9 @@ public class SubRollDownAGVTask extends AbstractTask {
|
||||
if (emptyPoint.size() > 0) {
|
||||
// 有空架子就是四点任务
|
||||
SchBasePoint point = emptyPoint.get(0);
|
||||
task.setVehicle_code2(point.getVehicle_code());
|
||||
task.setPoint_code3(point.getPoint_code());
|
||||
task.setPoint_code4(task.getPoint_code1());
|
||||
task.setVehicle_code2(point.getVehicle_code());
|
||||
}
|
||||
// 创建任务
|
||||
task.setHandle_class(THIS_CLASS);
|
||||
@@ -79,13 +79,8 @@ public class SubRollDownAGVTask extends AbstractTask {
|
||||
public void finishTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) {
|
||||
checkTaskOptionStatus(taskObj);
|
||||
JSONObject requestObj = JSONObject.parseObject(taskObj.getRequest_param());
|
||||
// 任务设置071
|
||||
taskObj.setTask_status(TaskStatus.PICK_UP_COMPLETED.getCode());
|
||||
TaskUtils.setUpdateByType(taskObj, TaskFinishedTypeEnum.AUTO_ACS);
|
||||
taskService.updateById(taskObj);
|
||||
// 终点赋值
|
||||
String endPointCode = taskObj.getPoint_code2();
|
||||
SchBasePoint endPoint = pointService.getById(endPointCode);
|
||||
SchBasePoint endPoint = pointService.getById(taskObj.getPoint_code2());
|
||||
endPoint.setPoint_status("3");
|
||||
endPoint.setMaterial_code(requestObj.getString("container_name"));
|
||||
endPoint.setVehicle_code(taskObj.getVehicle_code());
|
||||
@@ -104,11 +99,6 @@ public class SubRollDownAGVTask extends AbstractTask {
|
||||
endPoint2.setSource_id("");
|
||||
PointUtils.setUpdateByType(endPoint2, taskFinishedType);
|
||||
pointService.updateById(endPoint2);
|
||||
} else {
|
||||
// 起点清空(没有取货完成的业务),终点赋值
|
||||
String startPointCode = taskObj.getPoint_code1();
|
||||
SchBasePoint startPoint = pointService.getById(startPointCode);
|
||||
clearPoint(startPoint, TaskFinishedTypeEnum.AUTO_ACS);
|
||||
}
|
||||
// 任务完成
|
||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||
@@ -136,7 +126,7 @@ public class SubRollDownAGVTask extends AbstractTask {
|
||||
}
|
||||
// 取货完成
|
||||
// 起点清空(没有取货完成的业务),终点赋值
|
||||
String startPointCode = task.getPoint_code3();
|
||||
String startPointCode = task.getPoint_code1();
|
||||
SchBasePoint startPoint = pointService.getById(startPointCode);
|
||||
clearPoint(startPoint, TaskFinishedTypeEnum.AUTO_ACS);
|
||||
// 任务设置071
|
||||
|
||||
@@ -5,9 +5,11 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.pdm.bi.dao.PdmBiSlittingproductionplan;
|
||||
import org.nl.wms.pdm.bi.service.IpdmBiSlittingproductionplanService;
|
||||
import org.nl.wms.pdm.ivt.bcut.service.IBstIvtCutpointivtService;
|
||||
@@ -121,13 +123,6 @@ public class SlitterDownAGVTask extends AbstractTask {
|
||||
.filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
|
||||
// 获取分切计划
|
||||
List<PdmBiSlittingproductionplan> list = slittingproductionplanService.getByQzzNos(qzzNo, "06");
|
||||
// 起点清空
|
||||
String startPointCode = taskObj.getPoint_code1();
|
||||
StIvtCutpointivt startPoint = stIvtCutpointivtService.getOneByCode(startPointCode);
|
||||
startPoint.setUp_qzzno("");
|
||||
startPoint.setDown_qzzno("");
|
||||
PointUtils.setCutUpdateByType(startPoint, taskFinishedType);
|
||||
stIvtCutpointivtService.updateById(startPoint);
|
||||
// 终点设置数据
|
||||
String endPointCode = taskObj.getPoint_code2();
|
||||
BstIvtCutpointivt endPoint = bstIvtCutpointivtService.getPintByAgvCode(endPointCode, false);
|
||||
@@ -185,4 +180,23 @@ public class SlitterDownAGVTask extends AbstractTask {
|
||||
setUpdateByType(taskObj, taskFinishedType);
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void agvPickUpCompleted(SchBaseTask task) {
|
||||
// 起点清空
|
||||
String startPointCode = task.getPoint_code1();
|
||||
StIvtCutpointivt startPoint = stIvtCutpointivtService.getOneByCode(startPointCode);
|
||||
startPoint.setUp_qzzno("");
|
||||
startPoint.setDown_qzzno("");
|
||||
PointUtils.setCutUpdateByType(startPoint, TaskFinishedTypeEnum.AUTO_ACS);
|
||||
stIvtCutpointivtService.updateById(startPoint);
|
||||
LambdaUpdateWrapper<SchBaseTask> lam = new LambdaUpdateWrapper<>();
|
||||
lam.set(SchBaseTask::getTask_status, TaskStatus.PICK_UP_COMPLETED.getCode())
|
||||
.set(SchBaseTask::getUpdate_id, SecurityUtils.getCurrentUserId())
|
||||
.set(SchBaseTask::getUpdate_name, SecurityUtils.getCurrentNickName())
|
||||
.set(SchBaseTask::getUpdate_time, DateUtil.now())
|
||||
.eq(SchBaseTask::getTask_code, task.getTask_code());
|
||||
boolean update = taskService.update(lam);
|
||||
log.info("任务[{}]取货完成执行{}", task.getTask_code(), update);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class SlitterUpTrussTask extends AbstractTask {
|
||||
String pointCode = requestObj.getString("zc_point");
|
||||
// 终点为出口
|
||||
List<SchBasePoint> endPoints = pointService.getHotNotTaskPoint("A1", HX_REGION,
|
||||
"1", "1");
|
||||
"5", "1");
|
||||
if (endPoints.size() == 0) {
|
||||
throw new BadRequestException("烘箱没有可以用的对接位!");
|
||||
}
|
||||
|
||||
@@ -147,7 +147,6 @@
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="point_code" label="点位编码" width="100px" show-overflow-tooltip />
|
||||
<el-table-column prop="full_point_code" label="满轴位" width="110px" show-overflow-tooltip />
|
||||
<el-table-column prop="full_vehicle_code" label="满轴载具编码" width="120px" show-overflow-tooltip />
|
||||
@@ -163,6 +162,8 @@
|
||||
{{ dict.label.sch_empty_point_status[scope.row.empty_point_status] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="up_qzzno" label="上轴" width="110px" show-overflow-tooltip />
|
||||
<el-table-column prop="down_qzzno" label="下轴" width="110px" show-overflow-tooltip />
|
||||
<el-table-column prop="ext_code" label="外部编码" width="100px" show-overflow-tooltip />
|
||||
<el-table-column prop="product_area" label="生产区域" />
|
||||
<el-table-column prop="point_location" label="位置">
|
||||
|
||||
Reference in New Issue
Block a user