feat: 拆单桁架任务
This commit is contained in:
@@ -117,6 +117,9 @@ public class BstIvtCutpointivtServiceImpl extends ServiceImpl<BstIvtCutpointivtM
|
||||
|
||||
@Override
|
||||
public BstIvtCutpointivt getPintByTrussCode(String point, boolean flag) {
|
||||
if (ObjectUtil.isEmpty(point)) {
|
||||
return null;
|
||||
}
|
||||
LambdaQueryWrapper<BstIvtCutpointivt> lam = new QueryWrapper<BstIvtCutpointivt>().lambda();
|
||||
lam.eq(flag, BstIvtCutpointivt::getIs_used, "1")
|
||||
.and(blam -> blam.eq(BstIvtCutpointivt::getTruss_point_code1, point).or()
|
||||
|
||||
@@ -13,12 +13,16 @@ import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingprodu
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterEnum;
|
||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.common.utils.TaskUtils;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.pdm.ivt.deliverycache.service.IDeliverycachepointivtService;
|
||||
import org.nl.wms.pdm.ivt.deliverycache.service.dao.Deliverycachepointivt;
|
||||
import org.nl.wms.pdm.ivt.deliverycache.service.dto.AreaBCachePointDto;
|
||||
import org.nl.wms.sch.AcsTaskDto;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
@@ -34,19 +38,24 @@ import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* 送气胀轴拆单AGV任务
|
||||
*
|
||||
* @Author: liyongde
|
||||
* @Date: 2026/4/21 14:47
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class SendDisassemblyAgvTask extends AbstractAcsTask {
|
||||
private final String THIS_CLASS = SendAirShaftAgvTask.class.getName();
|
||||
private final String THIS_CLASS = SendDisassemblyAgvTask.class.getName();
|
||||
@Autowired
|
||||
private IschBaseTaskService taskService;
|
||||
@Autowired
|
||||
private IPdmBiSlittingproductionplanService slittingproductionplanService;
|
||||
@Autowired
|
||||
private IBstIvtCutpointivtService bcutpointivtService;
|
||||
@Autowired
|
||||
private IDeliverycachepointivtService deliverycachepointivtService;
|
||||
@Autowired
|
||||
private TrussDisassemblyCacheTask trussDisassemblyCacheTask;
|
||||
|
||||
@Override
|
||||
public List<AcsTaskDto> addTask() {
|
||||
@@ -120,18 +129,62 @@ public class SendDisassemblyAgvTask extends AbstractAcsTask {
|
||||
BstIvtCutpointivt endPointObj = bcutpointivtService.getPintByAgvCode(endPoint, false);
|
||||
TaskUtils.pointMaintenanceInventory(task, endPointObj, "2");
|
||||
bcutpointivtService.updateById(endPointObj);
|
||||
List<Deliverycachepointivt> list = deliverycachepointivtService.getAreaBCacheByConditionsAndNoTask(AreaBCachePointDto.builder()
|
||||
.area(endPointObj.getProduct_area())
|
||||
.location(endPointObj.getPoint_location())
|
||||
.pointStatus("01")
|
||||
.plan(endPointObj.getPlan()).build());
|
||||
// 创建桁架任务
|
||||
JSONObject trussTaskParam = new JSONObject();
|
||||
if (ObjectUtil.isNotEmpty(task.getVehicle_code()) && ObjectUtil.isNotEmpty(task.getVehicle_code2())) {
|
||||
|
||||
if (list.size() < 2) {
|
||||
// 原地等待
|
||||
// 分切计划状态修改02->03
|
||||
List<String> collect = Stream.of(task.getVehicle_code(), task.getVehicle_code2())
|
||||
.filter(value -> value != null && !value.isEmpty()).collect(Collectors.toList());
|
||||
PdmBiSlittingproductionplan p = new PdmBiSlittingproductionplan();
|
||||
p.setStatus("03");
|
||||
TaskUtils.updateOptMessageBySlitterPlan(p);
|
||||
slittingproductionplanService.update(p, new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getQzzno, collect));
|
||||
return;
|
||||
}
|
||||
Deliverycachepointivt d1 = list.get(0);
|
||||
Deliverycachepointivt d2 = list.get(1);
|
||||
// 四点
|
||||
trussTaskParam.put("point_code1", endPointObj.getTruss_point_code1());
|
||||
trussTaskParam.put("point_code2", d1.getPoint_code());
|
||||
trussTaskParam.put("point_code3", endPointObj.getTruss_point_code2());
|
||||
trussTaskParam.put("point_code4", d2.getPoint_code());
|
||||
trussTaskParam.put("vehicle_code", task.getVehicle_code());
|
||||
trussTaskParam.put("vehicle_code2", task.getVehicle_code2());
|
||||
trussTaskParam.put("truss_type", "8");
|
||||
trussTaskParam.put("task_type", SlitterEnum.TASK_TYPE.code("拆单桁架任务"));
|
||||
trussTaskParam.put("product_area", endPointObj.getProduct_area());
|
||||
trussDisassemblyCacheTask.createTask(trussTaskParam);
|
||||
} else {
|
||||
if (list.isEmpty()) {
|
||||
// 原地等待
|
||||
// 分切计划状态修改02->03
|
||||
List<String> collect = Stream.of(task.getVehicle_code(), task.getVehicle_code2())
|
||||
.filter(value -> value != null && !value.isEmpty()).collect(Collectors.toList());
|
||||
PdmBiSlittingproductionplan p = new PdmBiSlittingproductionplan();
|
||||
p.setStatus("03");
|
||||
TaskUtils.updateOptMessageBySlitterPlan(p);
|
||||
slittingproductionplanService.update(p, new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getQzzno, collect));
|
||||
return;
|
||||
}
|
||||
// 两点
|
||||
Deliverycachepointivt d1 = list.get(0);
|
||||
trussTaskParam.put("point_code1", ObjectUtil.isNotEmpty(endPointObj.getQzz_no1())
|
||||
? endPointObj.getTruss_point_code1() : endPointObj.getTruss_point_code2());
|
||||
trussTaskParam.put("point_code2", d1.getPoint_code());
|
||||
trussTaskParam.put("truss_type", "8");
|
||||
trussTaskParam.put("task_type", SlitterEnum.TASK_TYPE.code("拆单桁架任务"));
|
||||
trussTaskParam.put("product_area", endPointObj.getProduct_area());
|
||||
trussDisassemblyCacheTask.createTask(trussTaskParam);
|
||||
}
|
||||
// // 分切计划状态修改02->03
|
||||
// List<String> collect = Stream.of(task.getVehicle_code(), task.getVehicle_code2())
|
||||
// .filter(value -> value != null && !value.isEmpty()).collect(Collectors.toList());
|
||||
// PdmBiSlittingproductionplan p = new PdmBiSlittingproductionplan();
|
||||
// p.setStatus("03");
|
||||
// TaskUtils.updateOptMessageBySlitterPlan(p);
|
||||
// slittingproductionplanService.update(p, new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
// .in(PdmBiSlittingproductionplan::getQzzno, collect));
|
||||
}
|
||||
|
||||
// 取消
|
||||
|
||||
@@ -0,0 +1,226 @@
|
||||
package org.nl.b_lms.sch.tasks.slitter;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.bst.ivt.cutpointivt.service.IBstIvtCutpointivtService;
|
||||
import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt;
|
||||
import org.nl.b_lms.bst.ivt.shafttubeivt.service.IBstIvtShafttubeivtService;
|
||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.IPdmBiSlittingproductionplanService;
|
||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingproductionplan;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.common.utils.TaskUtils;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.pdm.ivt.deliverycache.service.IDeliverycachepointivtService;
|
||||
import org.nl.wms.pdm.ivt.deliverycache.service.dao.Deliverycachepointivt;
|
||||
import org.nl.wms.sch.AcsTaskDto;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
*
|
||||
* @Author: liyongde
|
||||
* @Date: 2026/4/21 16:07
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class TrussDisassemblyCacheTask extends AbstractAcsTask {
|
||||
private final String THIS_CLASS = TrussDisassemblyCacheTask.class.getName();
|
||||
@Autowired
|
||||
private IschBaseTaskService taskService;
|
||||
@Autowired
|
||||
private IPdmBiSlittingproductionplanService slittingproductionplanService;
|
||||
@Autowired
|
||||
private IBstIvtCutpointivtService bcutpointivtService;
|
||||
@Autowired
|
||||
private IBstIvtShafttubeivtService shafttubeivtService;
|
||||
@Autowired
|
||||
private IDeliverycachepointivtService deliverycachepointivtService;
|
||||
|
||||
@Override
|
||||
public List<AcsTaskDto> addTask() {
|
||||
/*
|
||||
* 下发给ACS时需要特殊处理
|
||||
*/
|
||||
List<SchBaseTask> taskList = taskService.getIssueTasks(THIS_CLASS);
|
||||
|
||||
ArrayList<AcsTaskDto> resultList = new ArrayList<>();
|
||||
String agv_system_type = "2";
|
||||
for (SchBaseTask task : taskList) {
|
||||
JSONObject object = JSONObject.parseObject(task.getRequest_param());
|
||||
String requestParam = task.getRequest_param();
|
||||
JSONObject requestParamObj = JSONObject.parseObject(requestParam);
|
||||
AcsTaskDto dto = AcsTaskDto.builder()
|
||||
.ext_task_id(task.getTask_id())
|
||||
.task_code(task.getTask_code())
|
||||
.task_type(task.getAcs_task_type())
|
||||
.start_device_code(task.getPoint_code1())
|
||||
.next_device_code(task.getPoint_code2())
|
||||
.start_device_code2(task.getPoint_code3())
|
||||
.next_device_code2(task.getPoint_code4())
|
||||
.vehicle_code(task.getVehicle_code())
|
||||
.truss_type(requestParamObj.getString("truss_type"))
|
||||
.empty_site("0")
|
||||
.agv_system_type(agv_system_type)
|
||||
.priority(task.getPriority())
|
||||
.remark(task.getRemark())
|
||||
.interaction_json(object)
|
||||
.product_area(task.getProduct_area())
|
||||
.build();
|
||||
resultList.add(dto);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 单任务下发,业务逻辑与无参 addTask 保持一致
|
||||
*/
|
||||
@Override
|
||||
public List<AcsTaskDto> addTask(SchBaseTask task) {
|
||||
ArrayList<AcsTaskDto> resultList = new ArrayList<>();
|
||||
String agv_system_type = "2";
|
||||
if (task != null) {
|
||||
JSONObject object = JSONObject.parseObject(task.getRequest_param());
|
||||
String requestParam = task.getRequest_param();
|
||||
JSONObject requestParamObj = JSONObject.parseObject(requestParam);
|
||||
AcsTaskDto dto = AcsTaskDto.builder()
|
||||
.ext_task_id(task.getTask_id())
|
||||
.task_code(task.getTask_code())
|
||||
.task_type(task.getAcs_task_type())
|
||||
.start_device_code(task.getPoint_code1())
|
||||
.next_device_code(task.getPoint_code2())
|
||||
.start_device_code2(task.getPoint_code3())
|
||||
.next_device_code2(task.getPoint_code4())
|
||||
.vehicle_code(task.getVehicle_code())
|
||||
.truss_type(requestParamObj.getString("truss_type"))
|
||||
.empty_site("0")
|
||||
.agv_system_type(agv_system_type)
|
||||
.priority(task.getPriority())
|
||||
.remark(task.getRemark())
|
||||
.interaction_json(object)
|
||||
.product_area(task.getProduct_area())
|
||||
.build();
|
||||
resultList.add(dto);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void updateTaskStatus(JSONObject taskObj, String status) {
|
||||
SchBaseTask task = taskService.getById(taskObj.getString("task_id"));
|
||||
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
|
||||
// 更新任务状态为执行中
|
||||
task.setTask_status(TaskStatusEnum.EXECUTING.getCode());
|
||||
}
|
||||
|
||||
if (StrUtil.equals(status, TaskStatusEnum.FINISHED.getCode())) {
|
||||
// 更改任务状态为完成
|
||||
task.setTask_status(TaskStatusEnum.FINISHED.getCode());
|
||||
String startPoint = task.getPoint_code1();
|
||||
String endPoint = task.getPoint_code2();
|
||||
String endPoint2 = task.getPoint_code4();
|
||||
BstIvtCutpointivt startPointObj = bcutpointivtService.getPintByTrussCode(startPoint, false);
|
||||
Deliverycachepointivt endPointObj = deliverycachepointivtService.getPintByCode(endPoint, false);
|
||||
Deliverycachepointivt endPointObj2 = deliverycachepointivtService.getPintByCode(endPoint2, false);
|
||||
endPointObj.setQzzno(task.getVehicle_code());
|
||||
endPointObj.setPoint_status("02");
|
||||
TaskUtils.updateOptMessageByCachePoint(endPointObj);
|
||||
deliverycachepointivtService.updateById(endPointObj);
|
||||
|
||||
if (endPointObj2 != null) {
|
||||
endPointObj2.setQzzno(task.getVehicle_code());
|
||||
endPointObj2.setPoint_status("02");
|
||||
TaskUtils.updateOptMessageByCachePoint(endPointObj2);
|
||||
deliverycachepointivtService.updateById(endPointObj2);
|
||||
}
|
||||
|
||||
// 起点清空
|
||||
startPointObj.setQzz_size("");
|
||||
startPointObj.setQzz_no1("");
|
||||
startPointObj.setQzz_no2("");
|
||||
startPointObj.setPoint_status("1");
|
||||
TaskUtils.updateOptMessageByBCutPoint(startPointObj);
|
||||
bcutpointivtService.updateById(startPointObj);
|
||||
// 分切计划状态修改02->03
|
||||
List<String> collect = Stream.of(task.getVehicle_code(), task.getVehicle_code2())
|
||||
.filter(value -> value != null && !value.isEmpty()).collect(Collectors.toList());
|
||||
PdmBiSlittingproductionplan p = new PdmBiSlittingproductionplan();
|
||||
p.setStatus("03");
|
||||
TaskUtils.updateOptMessageBySlitterPlan(p);
|
||||
slittingproductionplanService.update(p, new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getQzzno, collect));
|
||||
}
|
||||
// 取消
|
||||
if (status.equals(IOSEnum.IS_NOTANDYES.code("否"))) {
|
||||
task.setTask_status(TaskStatusEnum.FINISHED.getCode());
|
||||
}
|
||||
TaskUtils.updateOptMessageByTask(task);
|
||||
taskService.updateById(task);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createTask(JSONObject form) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
|
||||
SchBaseTask task = new SchBaseTask();
|
||||
task.setTask_id(IdUtil.getStringId());
|
||||
task.setTask_code(IdUtil.getStringId());
|
||||
task.setTask_status(ObjectUtil.isNotEmpty(form.getString("task_status"))
|
||||
? form.getString("task_status")
|
||||
: TaskStatusEnum.START_AND_POINT.getCode());
|
||||
task.setPoint_code1(form.getString("point_code1"));
|
||||
task.setPoint_code2(form.getString("point_code2"));
|
||||
task.setVehicle_code(form.getString("vehicle_code1"));
|
||||
task.setVehicle_code2(form.getString("vehicle_code2"));
|
||||
task.setAcs_task_type("6");
|
||||
task.setIs_delete("0");
|
||||
task.setRequest_param(form.toJSONString());
|
||||
task.setTask_type(form.getString("task_type"));
|
||||
task.setProduct_area(form.getString("product_area"));
|
||||
task.setCreate_id(currentUserId);
|
||||
task.setCreate_name(currentUsername);
|
||||
task.setCreate_time(DateUtil.now());
|
||||
task.setHandle_class(THIS_CLASS);
|
||||
//根据类型获取对应的任务优先级
|
||||
JSONObject priority_jo = WQL.getWO("PDA_COOLIN").addParam("flag", "3").addParam("task_type", task.getTask_type()).process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(priority_jo)) {
|
||||
task.setPriority("1");
|
||||
} else {
|
||||
task.setPriority(priority_jo.getString("value"));
|
||||
}
|
||||
taskService.save(task);
|
||||
this.immediateTaskNotifyAcs(task);
|
||||
return task.getTask_id();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forceFinish(String task_id) {
|
||||
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
this.updateTaskStatus(taskObj, TaskStatusEnum.FINISHED.getCode());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void cancel(String task_id) {
|
||||
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
this.updateTaskStatus(taskObj, "0");
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,8 @@ public enum SlitterEnum {
|
||||
, "拔轴完毕出轴", "010814", "穿拔轴缓存<>气胀轴缓存位", "010815", "备货区单独送空载具", "010816"
|
||||
, "拼单送轴", "010817", "拆单两点移动任务", "010818", "拆单四点移动任务", "010819"
|
||||
, "满轴拼单桁架任务", "010820", "送空轴AGV任务", "010821", "人工叫空轴桁架任务", "010822"
|
||||
, "备货区托盘入库", "010823", "备货区托盘出库", "010824", "送轴拆单任务", "010825")
|
||||
, "备货区托盘入库", "010823", "备货区托盘出库", "010824", "送轴拆单任务", "010825"
|
||||
, "拆单桁架任务", "010826")
|
||||
),
|
||||
/**
|
||||
* 二次请求
|
||||
|
||||
@@ -14,6 +14,7 @@ import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
import org.nl.system.service.param.dao.Param;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.nl.wms.pdm.ivt.deliverycache.service.dao.Deliverycachepointivt;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
@@ -125,6 +126,15 @@ public class TaskUtils {
|
||||
task.setUpdate_time(DateUtil.now());
|
||||
}
|
||||
|
||||
/**
|
||||
* 赋值任务的修改时间、人等信息
|
||||
* @param point 任务
|
||||
*/
|
||||
public static void updateOptMessageByCachePoint(Deliverycachepointivt point) {
|
||||
point.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
point.setUpdate_optname(SecurityUtils.getCurrentUsername());
|
||||
point.setUpdate_time(DateUtil.now());
|
||||
}
|
||||
/**
|
||||
* 赋值任务的修改时间、人等信息
|
||||
* @param point 任务
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.pdm.ivt.deliverycache.service.dao.Deliverycachepointivt;
|
||||
import org.nl.wms.pdm.ivt.deliverycache.service.dto.AreaBCachePointDto;
|
||||
import org.nl.wms.pdm.ivt.deliverycache.service.dto.DeliveryConDto;
|
||||
import org.nl.wms.pdm.ivt.deliverycache.service.dto.DeliverycachepointivtQuery;
|
||||
|
||||
@@ -91,4 +92,13 @@ public interface IDeliverycachepointivtService extends IService<Deliverycachepoi
|
||||
* @return
|
||||
*/
|
||||
Integer countPendingUseByDevice(String resourceName);
|
||||
|
||||
/**
|
||||
* 获取无任务的点位
|
||||
* @param build
|
||||
* @return
|
||||
*/
|
||||
List<Deliverycachepointivt> getAreaBCacheByConditionsAndNoTask(AreaBCachePointDto build);
|
||||
|
||||
Deliverycachepointivt getPintByCode(String pointCode, boolean flag);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.pdm.ivt.deliverycache.service.dao.Deliverycachepointivt;
|
||||
import org.nl.wms.pdm.ivt.deliverycache.service.dto.AreaBCachePointDto;
|
||||
import org.nl.wms.pdm.ivt.deliverycache.service.dto.DeliveryConDto;
|
||||
import org.nl.wms.pdm.ivt.deliverycache.service.dto.DeliverycachepointivtQuery;
|
||||
|
||||
@@ -26,4 +27,6 @@ public interface DeliverycachepointivtMapper extends BaseMapper<Deliverycachepoi
|
||||
IPage<Deliverycachepointivt> selectPageLeftJoin(IPage<Deliverycachepointivt> pages, DeliverycachepointivtQuery param);
|
||||
|
||||
Integer countPendingUseByDevice(String resourceName);
|
||||
|
||||
List<Deliverycachepointivt> getAreaBCacheByConditionsAndNoTask(AreaBCachePointDto conDto);
|
||||
}
|
||||
|
||||
@@ -148,4 +148,31 @@
|
||||
WHERE p.qzzno = sc.qzzno
|
||||
AND p.resource_name = #{resourceName});
|
||||
</select>
|
||||
<select id="getAreaBCacheByConditionsAndNoTask"
|
||||
resultType="org.nl.wms.pdm.ivt.deliverycache.service.dao.Deliverycachepointivt">
|
||||
SELECT
|
||||
sd.*
|
||||
FROM
|
||||
st_ivt_deliverycachepointivt sd
|
||||
<where>
|
||||
sd.product_area = #{area}
|
||||
AND sd.point_location = #{location}
|
||||
AND sd.point_status = #{pointStatus}
|
||||
AND sd.plan = #{plan}
|
||||
AND sd.is_used = '1'
|
||||
AND NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM sch_base_task sbt
|
||||
WHERE
|
||||
(
|
||||
sbt.point_code1 = sd.point_code
|
||||
OR sbt.point_code2 = sd.point_code
|
||||
OR sbt.point_code3 = sd.point_code
|
||||
OR sbt.point_code4 = sd.point_code
|
||||
)
|
||||
AND sbt.task_status <![CDATA[ < ]]> '07'
|
||||
AND sbt.is_delete = '0'
|
||||
)
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package org.nl.wms.pdm.ivt.deliverycache.service.dto;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 二期缓存架子dto
|
||||
* @Author: liyongde
|
||||
* @Date: 2026/4/21 15:47
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
public class AreaBCachePointDto implements Serializable {
|
||||
/** 区域 */
|
||||
private String area;
|
||||
/** 位置 */
|
||||
private String location;
|
||||
/** 点位状态: 01空位,02有气胀轴,03有子卷 */
|
||||
private String pointStatus;
|
||||
/** 子区域 */
|
||||
private String plan;
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package org.nl.wms.pdm.ivt.deliverycache.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -14,11 +16,13 @@ import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.wms.pdm.ivt.deliverycache.service.IDeliverycachepointivtService;
|
||||
import org.nl.wms.pdm.ivt.deliverycache.service.dao.Deliverycachepointivt;
|
||||
import org.nl.wms.pdm.ivt.deliverycache.service.dao.mapper.DeliverycachepointivtMapper;
|
||||
import org.nl.wms.pdm.ivt.deliverycache.service.dto.AreaBCachePointDto;
|
||||
import org.nl.wms.pdm.ivt.deliverycache.service.dto.DeliveryConDto;
|
||||
import org.nl.wms.pdm.ivt.deliverycache.service.dto.DeliverycachepointivtQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -121,4 +125,20 @@ public class DeliverycachepointivtServiceImpl extends ServiceImpl<Deliverycachep
|
||||
return deliverycachepointivtMapper.countPendingUseByDevice(resourceName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Deliverycachepointivt> getAreaBCacheByConditionsAndNoTask(AreaBCachePointDto build) {
|
||||
return deliverycachepointivtMapper.getAreaBCacheByConditionsAndNoTask(build);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Deliverycachepointivt getPintByCode(String pointCode, boolean flag) {
|
||||
if (ObjectUtil.isEmpty(pointCode)) {
|
||||
return null;
|
||||
}
|
||||
LambdaQueryWrapper<Deliverycachepointivt> lam = new QueryWrapper<Deliverycachepointivt>().lambda();
|
||||
lam.eq(flag, Deliverycachepointivt::getIs_used, "1")
|
||||
.eq(Deliverycachepointivt::getPoint_code, pointCode);
|
||||
return deliverycachepointivtMapper.selectOne(lam);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user