add:添加废箔耳波,载具类型
This commit is contained in:
@@ -84,7 +84,16 @@ public class SlitterPdaServiceImpl implements SlitterPdaService {
|
||||
@Override
|
||||
public JSONObject queryOrderInfo(JSONObject param) {
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("data", rawfoilworkorderService.getAllUsedRawPlanOnZc());
|
||||
String type = param.getString("type");
|
||||
List<PdmBiRawfoilworkorder> allUsedRawPlanOnZc = rawfoilworkorderService.getAllUsedRawPlanOnZc();
|
||||
if ("1".equals(type)){
|
||||
List<PdmBiRawfoilworkorder> a1Hxhc = allUsedRawPlanOnZc.stream().filter(item -> item.getZc_point().contains("A1_HXHC")).collect(Collectors.toList());
|
||||
result.put("data", a1Hxhc);
|
||||
|
||||
} else {
|
||||
result.put("data", allUsedRawPlanOnZc);
|
||||
}
|
||||
|
||||
result.put("message", "操作成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -71,6 +71,7 @@ public class OtherPdaServiceImpl implements OtherPdaService {
|
||||
// point_code
|
||||
String pointCode = param.getString("point_code");
|
||||
String startPoint = param.getString("start_point");
|
||||
String vehicle_type = param.getString("vehicle_type");
|
||||
List<SchBaseTask> schBaseTasks = taskService.checkHaveTask(pointCode);
|
||||
if (schBaseTasks.size() > 0) {
|
||||
throw new BadRequestException("点位[" + pointCode + "]已经存在任务!");
|
||||
@@ -82,6 +83,7 @@ public class OtherPdaServiceImpl implements OtherPdaService {
|
||||
taskParam.put("config_code", "SendWasteFoilAGVTask");
|
||||
taskParam.put("create_mode", GeneralDefinition.PDA_CREATION);
|
||||
taskParam.put("task_status", TaskStatus.SURE_END.getCode());
|
||||
taskParam.put("vehicle_type", vehicle_type);
|
||||
//起点不为空就是漏斗复位任务
|
||||
if (StrUtil.isNotEmpty(startPoint)){
|
||||
taskParam.put("point_code1", startPoint);
|
||||
@@ -102,6 +104,7 @@ public class OtherPdaServiceImpl implements OtherPdaService {
|
||||
String flag = param.getString("flag");
|
||||
// 判断是否能够搬运
|
||||
String pointCode = param.getString("point_code");
|
||||
String vehicle_type = param.getString("vehicle_type");
|
||||
SchBaseTask task = checkTask(pointCode);
|
||||
|
||||
JSONObject upTaskRequestObj = JSONObject.parseObject(task.getRequest_param());
|
||||
@@ -112,7 +115,7 @@ public class OtherPdaServiceImpl implements OtherPdaService {
|
||||
// 最后一条任务, 创建去终点的任务
|
||||
// 获取一个废箔位置
|
||||
List<SchBasePoint> fbPoints = pointService.getAllBusinessNotTaskPoint("A1", "A1-FB",
|
||||
"1", "1", null, null);
|
||||
"1", "1", vehicle_type, null);
|
||||
if (CollectionUtil.isEmpty(fbPoints)) {
|
||||
throw new BadRequestException("找不到废箔点位,请稍后再试!");
|
||||
}
|
||||
@@ -126,6 +129,7 @@ public class OtherPdaServiceImpl implements OtherPdaService {
|
||||
taskParam.put("index_task", upTaskRequestObj.getInteger("index_task") + 1);
|
||||
taskParam.put("carNo", task.getCar_no());
|
||||
taskParam.put("task_status", TaskStatus.START_AND_POINT.getCode());
|
||||
taskParam.put("vehicle_type", vehicle_type);
|
||||
sendWasteFoilAGVTask.createTask(taskParam);
|
||||
} else {
|
||||
// 获取其中一条任务设置起点
|
||||
|
||||
@@ -85,6 +85,9 @@ public interface IstIvtHotpointivtService extends IService<StIvtHotpointivt> {
|
||||
*/
|
||||
StIvtHotpointivt getPointByCode(String pointCode, boolean flag);
|
||||
|
||||
|
||||
StIvtHotpointivt getNoUsedPointByCode(String pointCode, boolean flag);
|
||||
|
||||
/**
|
||||
* 获取需要烘烤的点位
|
||||
* @return /
|
||||
|
||||
@@ -148,6 +148,16 @@ public class StIvtHotpointivtServiceImpl extends ServiceImpl<StIvtHotpointivtMap
|
||||
return getOne(lam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StIvtHotpointivt getNoUsedPointByCode(String pointCode, boolean flag) {
|
||||
Assert.notNull(pointCode, "点位编码不能为空!");
|
||||
LambdaQueryWrapper<StIvtHotpointivt> lam = new QueryWrapper<StIvtHotpointivt>().lambda();
|
||||
lam.eq(StIvtHotpointivt::getPoint_code, pointCode)
|
||||
.eq(flag, StIvtHotpointivt::getIs_used, "0");
|
||||
return getOne(lam);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<StIvtHotpointivt> getNeedBakingPoint() {
|
||||
return stIvtHotpointivtMapper.getNeedBakingPoint();
|
||||
|
||||
@@ -83,10 +83,12 @@ public class AutoQueryDeviceStatus {
|
||||
String last_time = countdown_house + "小时" + countdown_min + "分钟";
|
||||
redisUtils.hset(device_code, "temperature","0");
|
||||
redisUtils.hset(device_code, "last_time", last_time);
|
||||
redisUtils.hset(device_code, "is_off", "1");
|
||||
}else {
|
||||
String last_time = countdown_house + "小时" + countdown_min + "分钟";
|
||||
redisUtils.hset(device_code, "temperature", row.getString("temperature"));
|
||||
redisUtils.hset(device_code, "last_time", last_time);
|
||||
redisUtils.hset(device_code, "is_off", "0");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public class AutoSendWasteFoilAGVTask {
|
||||
SchBaseTask task = waitTaskFilter.get(0);
|
||||
// 查找废箔起点
|
||||
List<SchBasePoint> fbPoints = pointService.getAllBusinessNotTaskPoint("A1", "A1-FB",
|
||||
"1", "2", null, null);
|
||||
"1", "2", task.getVehicle_type(), null);
|
||||
if (CollectionUtil.isEmpty(fbPoints)) {
|
||||
log.error("找不到废箔点位 - {}", task);
|
||||
return;
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
AND 0 = (SELECT COUNT(*) FROM sch_base_task t WHERE t.task_status <![CDATA[<]]> '07'
|
||||
AND (t.point_code1 = p.point_code OR t.point_code2 = p.point_code OR t.point_code3 = p.point_code
|
||||
OR t.point_code4 = p.point_code))
|
||||
ORDER BY p.update_time
|
||||
ORDER BY p.update_time DESC
|
||||
</select>
|
||||
|
||||
<select id="getAllBusinessTaskPoint" resultType="org.nl.wms.sch.point.service.dao.SchBasePoint">
|
||||
|
||||
@@ -151,7 +151,6 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
String pointStatus = entity.getPoint_status();
|
||||
// 根据点位状态来判断更新内容
|
||||
if (ObjectUtil.isNotEmpty(pointStatus) && pointStatus.equals(PointStatusEnum.EMPTY_POINT.getCode())) {
|
||||
entity.setVehicle_type("");
|
||||
entity.setVehicle_code("");
|
||||
entity.setVehicle_qty(0);
|
||||
entity.setMaterial_code("");
|
||||
@@ -248,11 +247,11 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
List<SchBasePoint> list = getAllBusinessNotTaskPoint("A1", "A1-FB", null, null, null, null);
|
||||
List<SchBasePoint> zdList = list.stream().filter(item -> item.getPoint_code().contains("ZD")).collect(Collectors.toList());
|
||||
if ("1".equals(point_type)){
|
||||
List<SchBasePoint> qdList = list.stream().filter(item -> item.getPoint_code().contains("QD") && "1".equals(item.getPoint_status())).collect(Collectors.toList());
|
||||
List<SchBasePoint> qdList = list.stream().filter(item -> item.getPoint_code().contains("QD") && "2".equals(item.getPoint_status())).collect(Collectors.toList());
|
||||
zdList.addAll(qdList);
|
||||
return zdList;
|
||||
}
|
||||
List<SchBasePoint> qdList = list.stream().filter(item -> item.getPoint_code().contains("QD") && "2".equals(item.getPoint_status())).collect(Collectors.toList());
|
||||
List<SchBasePoint> qdList = list.stream().filter(item -> item.getPoint_code().contains("QD") && "1".equals(item.getPoint_status())).collect(Collectors.toList());
|
||||
zdList.addAll(qdList);
|
||||
return zdList;
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ public class InHotTrussTask extends AbstractTask {
|
||||
String flag = "0";
|
||||
PdmBiRawfoilworkorder order = rawfoilworkorderService.getByContainerName(orderCode);
|
||||
// TODO: 没有设置是否烘烤、时间、温度、不继续
|
||||
if (ObjectUtil.isNotNull(order)&&GeneralDefinition.YES.equals(order.getIs_baking())) {
|
||||
if (ObjectUtil.isNotNull(order)&&GeneralDefinition.YES.equals(order.getIs_baking())&& StrUtil.isEmpty(isStorage)) {
|
||||
|
||||
String bakingTemperature = order.getBaking_temperature();
|
||||
requestObj.put("baking_temperature", bakingTemperature);
|
||||
@@ -118,7 +118,8 @@ public class InHotTrussTask extends AbstractTask {
|
||||
for (StIvtHotpointivt hotPoint : hotList) {
|
||||
String pointCode = hotPoint.getPoint_code();
|
||||
String pointTemperature = (String) redisUtils.hget(pointCode, "temperature");
|
||||
if (ObjectUtil.isNotEmpty(pointTemperature) && Integer.valueOf(pointTemperature) < 50 ) {
|
||||
String isOff = (String) redisUtils.hget(pointCode, "is_off");
|
||||
if (ObjectUtil.isNotEmpty(pointTemperature) && Integer.valueOf(pointTemperature) < 50 && "0".equals(isOff) ) {
|
||||
task.setPoint_code2(pointCode);
|
||||
flag = "1";
|
||||
break;
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package org.nl.wms.sch.task_manage.tasks.slitter;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.wms.pdm.bi.dao.PdmBiRawfoilworkorder;
|
||||
import org.nl.wms.pdm.bi.service.IpdmBiRawfoilworkorderService;
|
||||
import org.nl.wms.pdm.ivt.hot.service.IstIvtHotpointivtService;
|
||||
import org.nl.wms.pdm.ivt.hot.service.dao.StIvtHotpointivt;
|
||||
import org.nl.wms.sch.point.service.ISchBasePointService;
|
||||
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch.task.service.ISchBaseTaskService;
|
||||
@@ -23,6 +26,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import java.util.List;
|
||||
|
||||
import static org.nl.wms.util.PointUtils.clearPoint;
|
||||
import static org.nl.wms.util.PointUtils.hotClearPoint;
|
||||
import static org.nl.wms.util.TaskUtils.*;
|
||||
|
||||
/**
|
||||
@@ -45,6 +49,9 @@ public class SlitterUpTrussTask extends AbstractTask {
|
||||
private IpdmBiRawfoilworkorderService rawfoilworkorderService;
|
||||
@Autowired
|
||||
private RedissonClient redissonClient;
|
||||
|
||||
@Autowired
|
||||
private IstIvtHotpointivtService hotpointivtService;
|
||||
@Override
|
||||
public void create() throws BadRequestException {
|
||||
|
||||
@@ -90,7 +97,15 @@ public class SlitterUpTrussTask extends AbstractTask {
|
||||
String startPointCode = taskObj.getPoint_code1();
|
||||
String endPointCode = taskObj.getPoint_code2();
|
||||
SchBasePoint startPoint = pointService.getById(startPointCode);
|
||||
if (ObjectUtil.isNotEmpty(startPoint)) {
|
||||
clearPoint(startPoint, taskFinishedType);
|
||||
}
|
||||
|
||||
StIvtHotpointivt startHotPoint = hotpointivtService.getNoUsedPointByCode(startPointCode, false);
|
||||
if (ObjectUtil.isNotEmpty(startHotPoint)) {
|
||||
// 起点清空
|
||||
hotClearPoint(startHotPoint, taskFinishedType);
|
||||
}
|
||||
|
||||
// 创建AGV任务
|
||||
log.info("点位{}更新完毕,创建AGV任务给分切机上料", startPointCode);
|
||||
|
||||
@@ -55,7 +55,6 @@ public class PointUtils {
|
||||
}
|
||||
SchBasePointServiceImpl pointService = SpringContextHolder.getBean(SchBasePointServiceImpl.class);
|
||||
point.setPoint_status(PointStatusEnum.EMPTY_POINT.getCode());
|
||||
point.setVehicle_type("");
|
||||
point.setVehicle_code("");
|
||||
point.setIng_task_code("");
|
||||
point.setSource_id("");
|
||||
|
||||
Reference in New Issue
Block a user