fix: 判断纸管、呼叫AGV更换托盘
This commit is contained in:
@@ -5,6 +5,7 @@ import org.nl.common.domain.query.PageQuery;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import org.nl.b_lms.bst.ivt.stockingivt.service.dao.BstIvtStockingivt;
|
import org.nl.b_lms.bst.ivt.stockingivt.service.dao.BstIvtStockingivt;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@@ -40,4 +41,38 @@ public interface IBstIvtStockingivtService extends IService<BstIvtStockingivt> {
|
|||||||
* @param ids /
|
* @param ids /
|
||||||
*/
|
*/
|
||||||
void deleteAll(Set<String> ids);
|
void deleteAll(Set<String> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取备货区中指定条件的货位
|
||||||
|
* @param pointType 类型:0暂存位置,1靠近分切机
|
||||||
|
* @param tube 纸管号 两个都是一样的,因此拿一个就行
|
||||||
|
* @param location 位置:0上区域,1下区域
|
||||||
|
* @param qty 数量
|
||||||
|
* @return /
|
||||||
|
*/
|
||||||
|
List<BstIvtStockingivt> getPaperTubePoint(String pointType, String tube, String location, int qty);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取备货区空位,没有任务的位置
|
||||||
|
* @param location 位置:0上区域,1下区域
|
||||||
|
* @param pointType 类型:0暂存位置,1靠近分切机
|
||||||
|
* @return /
|
||||||
|
*/
|
||||||
|
List<BstIvtStockingivt> getEmptyPointNotTask(String location, String pointType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据点位编码获取备货区点位
|
||||||
|
* @param pointCode 编码
|
||||||
|
* @param flag 是否校验可用
|
||||||
|
* @return /
|
||||||
|
*/
|
||||||
|
BstIvtStockingivt getPointByCode(String pointCode, boolean flag);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取一个可以搬走的位置
|
||||||
|
* @param location 位置:0上区域,1下区域
|
||||||
|
* @param pointType 类型:0暂存位置,1靠近分切机
|
||||||
|
* @return /
|
||||||
|
*/
|
||||||
|
BstIvtStockingivt getCanMovePointOne(String location, String pointType);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.nl.b_lms.bst.ivt.stockingivt.service.dao;
|
package org.nl.b_lms.bst.ivt.stockingivt.service.dao;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
@@ -76,5 +77,7 @@ public class BstIvtStockingivt implements Serializable {
|
|||||||
|
|
||||||
/** 规划 */
|
/** 规划 */
|
||||||
private String plan;
|
private String plan;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer qty;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,30 @@ package org.nl.b_lms.bst.ivt.stockingivt.service.dao.mapper;
|
|||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.nl.b_lms.bst.ivt.stockingivt.service.dao.BstIvtStockingivt;
|
import org.nl.b_lms.bst.ivt.stockingivt.service.dao.BstIvtStockingivt;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author lyd
|
* @author lyd
|
||||||
* @date 2024-02-26
|
* @date 2024-02-26
|
||||||
**/
|
**/
|
||||||
public interface BstIvtStockingivtMapper extends BaseMapper<BstIvtStockingivt> {
|
public interface BstIvtStockingivtMapper extends BaseMapper<BstIvtStockingivt> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取备货区中指定条件的货位
|
||||||
|
* @param pointType 类型:0暂存位置,1靠近分切机
|
||||||
|
* @param tube 纸管号 两个都是一样的,因此拿一个就行
|
||||||
|
* @param location 位置:0上区域,1下区域
|
||||||
|
* @param qty 数量
|
||||||
|
* @return /
|
||||||
|
*/
|
||||||
|
List<BstIvtStockingivt> getPaperTubePoint(String pointType, String tube, String location, int qty);
|
||||||
|
/**
|
||||||
|
* 获取备货区空位,没有任务的位置
|
||||||
|
* @param location 位置:0上区域,1下区域
|
||||||
|
* @param pointType 类型:0暂存位置,1靠近分切机
|
||||||
|
* @return /
|
||||||
|
*/
|
||||||
|
List<BstIvtStockingivt> getEmptyPointNotTask(String location, String pointType);
|
||||||
|
|
||||||
|
BstIvtStockingivt getCanMovePointOne(String location, String pointType);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,49 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="org.nl.b_lms.bst.ivt.stockingivt.service.dao.mapper.BstIvtStockingivtMapper">
|
<mapper namespace="org.nl.b_lms.bst.ivt.stockingivt.service.dao.mapper.BstIvtStockingivtMapper">
|
||||||
|
|
||||||
|
<select id="getPaperTubePoint" resultType="org.nl.b_lms.bst.ivt.stockingivt.service.dao.BstIvtStockingivt">
|
||||||
|
SELECT bs.*,
|
||||||
|
mp.qty
|
||||||
|
FROM `bst_ivt_stockingivt` bs
|
||||||
|
LEFT JOIN md_pb_papervehicle mp ON mp.vehicle_code = bs.vehicle_code
|
||||||
|
WHERE bs.point_location = #{location}
|
||||||
|
AND bs.point_type = #{pointType}
|
||||||
|
AND bs.ivt_status = '1'
|
||||||
|
AND bs.is_used = '1'
|
||||||
|
AND mp.material_code = #{tube}
|
||||||
|
AND mp.qty <![CDATA[ >= ]]> #{qty}
|
||||||
|
AND 0 = (SELECT COUNT(*)
|
||||||
|
FROM sch_base_task t
|
||||||
|
WHERE (t.point_code1 = bs.point_code OR t.point_code2 = bs.point_code OR
|
||||||
|
t.point_code3 = bs.point_code)
|
||||||
|
AND t.task_status <![CDATA[ < ]]> '07')
|
||||||
|
</select>
|
||||||
|
<select id="getEmptyPointNotTask"
|
||||||
|
resultType="org.nl.b_lms.bst.ivt.stockingivt.service.dao.BstIvtStockingivt">
|
||||||
|
SELECT bs.*
|
||||||
|
FROM `bst_ivt_stockingivt` bs
|
||||||
|
WHERE bs.point_type = #{pointType}
|
||||||
|
AND bs.point_location = #{location}
|
||||||
|
AND bs.is_used = '1'
|
||||||
|
AND bs.ivt_status = '0'
|
||||||
|
AND 0 = (SELECT COUNT(*)
|
||||||
|
FROM sch_base_task t
|
||||||
|
WHERE (t.point_code1 = bs.point_code OR t.point_code2 = bs.point_code OR
|
||||||
|
t.point_code3 = bs.point_code)
|
||||||
|
AND t.task_status <![CDATA[ < ]]> '07')
|
||||||
|
</select>
|
||||||
|
<select id="getCanMovePointOne"
|
||||||
|
resultType="org.nl.b_lms.bst.ivt.stockingivt.service.dao.BstIvtStockingivt">
|
||||||
|
SELECT bs.*
|
||||||
|
FROM `bst_ivt_stockingivt` bs
|
||||||
|
LEFT JOIN md_pb_papervehicle mp ON mp.vehicle_code = bs.vehicle_code
|
||||||
|
WHERE bs.point_type = #{pointType}
|
||||||
|
AND bs.point_location = #{location}
|
||||||
|
AND 0 = (SELECT COUNT(*)
|
||||||
|
FROM sch_base_task t
|
||||||
|
WHERE (t.point_code1 = bs.point_code OR t.point_code2 = bs.point_code OR
|
||||||
|
t.point_code3 = bs.point_code)
|
||||||
|
AND t.task_status <![CDATA[ < ]]> '07')
|
||||||
|
ORDER BY bs.ivt_status, mp.qty LIMIT 1
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
@@ -17,6 +18,7 @@ import org.nl.b_lms.bst.ivt.stockingivt.service.dao.BstIvtStockingivt;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@@ -77,4 +79,27 @@ public class BstIvtStockingivtServiceImpl extends ServiceImpl<BstIvtStockingivtM
|
|||||||
bstIvtStockingivtMapper.deleteBatchIds(ids);
|
bstIvtStockingivtMapper.deleteBatchIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BstIvtStockingivt> getPaperTubePoint(String pointType, String tube, String location, int qty) {
|
||||||
|
return bstIvtStockingivtMapper.getPaperTubePoint(pointType, tube, location, qty);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BstIvtStockingivt> getEmptyPointNotTask(String location, String pointType) {
|
||||||
|
return bstIvtStockingivtMapper.getEmptyPointNotTask(location, pointType);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BstIvtStockingivt getPointByCode(String pointCode, boolean flag) {
|
||||||
|
LambdaQueryWrapper<BstIvtStockingivt> lam = new LambdaQueryWrapper<>();
|
||||||
|
lam.eq(BstIvtStockingivt::getPoint_code, pointCode)
|
||||||
|
.eq(flag, BstIvtStockingivt::getIs_used, SlitterConstant.SLITTER_YES);
|
||||||
|
return bstIvtStockingivtMapper.selectOne(lam);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BstIvtStockingivt getCanMovePointOne(String location, String pointType) {
|
||||||
|
return bstIvtStockingivtMapper.getCanMovePointOne(location, pointType);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,147 @@
|
|||||||
|
package org.nl.b_lms.sch.tasks.slitter;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.b_lms.bst.ivt.stockingivt.service.IBstIvtStockingivtService;
|
||||||
|
import org.nl.b_lms.bst.ivt.stockingivt.service.dao.BstIvtStockingivt;
|
||||||
|
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.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.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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: lyd
|
||||||
|
* @Description: 备货区送纸管到机械手旁边的备货区 - AGV任务
|
||||||
|
* @Date: 2024/6/4
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class StockAreaCallTubeTask extends AbstractAcsTask {
|
||||||
|
private final String THIS_CLASS = StockAreaCallTubeTask.class.getName();
|
||||||
|
@Autowired
|
||||||
|
private IschBaseTaskService taskService;
|
||||||
|
@Autowired
|
||||||
|
private IBstIvtStockingivtService stockingivtService;
|
||||||
|
@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) {
|
||||||
|
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())
|
||||||
|
.agv_system_type(agv_system_type)
|
||||||
|
.priority(task.getPriority())
|
||||||
|
.remark(task.getRemark())
|
||||||
|
.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();
|
||||||
|
BstIvtStockingivt startPointObj = stockingivtService.getPointByCode(startPoint, false);
|
||||||
|
BstIvtStockingivt endPointObj = stockingivtService.getPointByCode(endPoint, false);
|
||||||
|
// 互换资源 (交换载具号)
|
||||||
|
endPointObj.setIvt_status("1");
|
||||||
|
endPointObj.setVehicle_code(task.getVehicle_code());
|
||||||
|
TaskUtils.updateOptMessageByBStockingPoint(endPointObj);
|
||||||
|
stockingivtService.update(endPointObj);
|
||||||
|
startPointObj.setVehicle_code("");
|
||||||
|
startPointObj.setIvt_status("0");
|
||||||
|
TaskUtils.updateOptMessageByBStockingPoint(startPointObj);
|
||||||
|
stockingivtService.update(startPointObj);
|
||||||
|
}
|
||||||
|
// 取消
|
||||||
|
if (status.equals(IOSEnum.IS_NOTANDYES.code("否"))) {
|
||||||
|
task.setTask_status(TaskStatusEnum.FINISHED.getCode());
|
||||||
|
}
|
||||||
|
task.setUpdate_time(DateUtil.now());
|
||||||
|
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.getSnowflake(1, 1).nextIdStr());
|
||||||
|
task.setTask_code(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||||
|
task.setTask_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_code"));
|
||||||
|
task.setAcs_task_type("3");
|
||||||
|
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.immediateNotifyAcs(null);
|
||||||
|
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");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,168 @@
|
|||||||
|
package org.nl.b_lms.sch.tasks.slitter;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.b_lms.bst.ivt.stockingivt.service.IBstIvtStockingivtService;
|
||||||
|
import org.nl.b_lms.bst.ivt.stockingivt.service.dao.BstIvtStockingivt;
|
||||||
|
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.SecurityUtils;
|
||||||
|
import org.nl.common.utils.TaskUtils;
|
||||||
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
|
import org.nl.modules.wql.WQL;
|
||||||
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: lyd
|
||||||
|
* @Description: 备货区(靠近机械手)送走托盘到暂存位置的备货区 - AGV任务
|
||||||
|
* @Date: 2024/6/4
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class StockAreaSendVehicleTask extends AbstractAcsTask {
|
||||||
|
private final String THIS_CLASS = StockAreaSendVehicleTask.class.getName();
|
||||||
|
@Autowired
|
||||||
|
private IschBaseTaskService taskService;
|
||||||
|
@Autowired
|
||||||
|
private IBstIvtStockingivtService stockingivtService;
|
||||||
|
@Autowired
|
||||||
|
private StockAreaCallTubeTask stockAreaCallTubeTask;
|
||||||
|
@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) {
|
||||||
|
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("")
|
||||||
|
.next_device_code2(task.getPoint_code4())
|
||||||
|
.vehicle_code(task.getVehicle_code())
|
||||||
|
.agv_system_type(agv_system_type)
|
||||||
|
.priority(task.getPriority())
|
||||||
|
.remark(task.getRemark())
|
||||||
|
.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();
|
||||||
|
BstIvtStockingivt startPointObj = stockingivtService.getPointByCode(startPoint, false);
|
||||||
|
BstIvtStockingivt endPointObj = stockingivtService.getPointByCode(endPoint, false);
|
||||||
|
// 互换资源 (交换载具号)
|
||||||
|
endPointObj.setIvt_status("1");
|
||||||
|
endPointObj.setVehicle_code(task.getVehicle_code());
|
||||||
|
TaskUtils.updateOptMessageByBStockingPoint(endPointObj);
|
||||||
|
stockingivtService.update(endPointObj);
|
||||||
|
startPointObj.setVehicle_code("");
|
||||||
|
startPointObj.setIvt_status("0");
|
||||||
|
TaskUtils.updateOptMessageByBStockingPoint(startPointObj);
|
||||||
|
stockingivtService.update(startPointObj);
|
||||||
|
// 创建搬运任务, 将所需要的纸管对应的托盘换过来。
|
||||||
|
String requestParam = task.getRequest_param();
|
||||||
|
JSONObject jsonObject = JSONObject.parseObject(requestParam);
|
||||||
|
if (ObjectUtil.isEmpty(requestParam)) {
|
||||||
|
throw new BadRequestException("任务 code = " + task.getTask_code() + " 参数错误");
|
||||||
|
}
|
||||||
|
JSONObject callPoint = jsonObject.getJSONObject("call_point");
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("point_code1", callPoint.getString("point_code"));
|
||||||
|
param.put("point_code2", startPoint);
|
||||||
|
param.put("vehicle_code", callPoint.getString("vehicle_code"));
|
||||||
|
param.put("task_type", SlitterEnum.TASK_TYPE.code("备货区送纸管"));
|
||||||
|
param.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||||
|
stockAreaCallTubeTask.createTask(param);
|
||||||
|
}
|
||||||
|
// 取消
|
||||||
|
if (status.equals(IOSEnum.IS_NOTANDYES.code("否"))) {
|
||||||
|
task.setTask_status(TaskStatusEnum.FINISHED.getCode());
|
||||||
|
}
|
||||||
|
task.setUpdate_time(DateUtil.now());
|
||||||
|
taskService.updateById(task);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String createTask(JSONObject form) {
|
||||||
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||||
|
JSONObject callPoint = form.getJSONObject("call_point");
|
||||||
|
SchBaseTask task = new SchBaseTask();
|
||||||
|
task.setTask_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||||
|
task.setTask_code(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||||
|
task.setTask_status(TaskStatusEnum.START_AND_POINT.getCode());
|
||||||
|
task.setPoint_code1(form.getString("point_code1"));
|
||||||
|
task.setPoint_code2(form.getString("point_code2"));
|
||||||
|
task.setPoint_code3(callPoint.getString("point_code"));
|
||||||
|
task.setVehicle_code(form.getString("vehicle_code"));
|
||||||
|
task.setAcs_task_type("3");
|
||||||
|
task.setIs_delete("0");
|
||||||
|
task.setRemark("point3只是记录点,不会下到ACS");
|
||||||
|
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.immediateNotifyAcs(null);
|
||||||
|
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");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,23 +10,31 @@ 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.cutpointivt.service.dao.BstIvtCutpointivt;
|
||||||
import org.nl.b_lms.bst.ivt.shafttubeivt.service.IBstIvtShafttubeivtService;
|
import org.nl.b_lms.bst.ivt.shafttubeivt.service.IBstIvtShafttubeivtService;
|
||||||
import org.nl.b_lms.bst.ivt.shafttubeivt.service.dao.BstIvtShafttubeivt;
|
import org.nl.b_lms.bst.ivt.shafttubeivt.service.dao.BstIvtShafttubeivt;
|
||||||
|
import org.nl.b_lms.bst.ivt.stockingivt.service.IBstIvtStockingivtService;
|
||||||
|
import org.nl.b_lms.bst.ivt.stockingivt.service.dao.BstIvtStockingivt;
|
||||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.IPdmBiSlittingproductionplanService;
|
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.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingproductionplan;
|
||||||
|
import org.nl.b_lms.sch.tasks.slitter.StockAreaCallTubeTask;
|
||||||
|
import org.nl.b_lms.sch.tasks.slitter.StockAreaSendVehicleTask;
|
||||||
import org.nl.b_lms.sch.tasks.slitter.TrussCallAirShaftTask;
|
import org.nl.b_lms.sch.tasks.slitter.TrussCallAirShaftTask;
|
||||||
import org.nl.b_lms.sch.tasks.slitter.TrussCallShaftCacheTask;
|
import org.nl.b_lms.sch.tasks.slitter.TrussCallShaftCacheTask;
|
||||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
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.sch.tasks.slitter.constant.SlitterEnum;
|
||||||
import org.nl.b_lms.sch.tasks.slitter.mapper.dto.SlitterPlanDistinctDto;
|
import org.nl.b_lms.sch.tasks.slitter.mapper.dto.SlitterPlanDistinctDto;
|
||||||
import org.nl.b_lms.sch.tasks.slitter.util.SlitterTaskUtil;
|
import org.nl.b_lms.sch.tasks.slitter.util.SlitterTaskUtil;
|
||||||
|
import org.nl.common.enums.NoticeTypeEnum;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.common.utils.TaskUtils;
|
import org.nl.common.utils.TaskUtils;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
|
import org.nl.system.service.notice.ISysNoticeService;
|
||||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: lyd
|
* @Author: lyd
|
||||||
@@ -51,8 +59,17 @@ public class AutoCallAirShaftTask {
|
|||||||
private WmsToAcsService wmsToAcsService;
|
private WmsToAcsService wmsToAcsService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private TrussCallShaftCacheTask trussCallShaftCacheTask;
|
private TrussCallShaftCacheTask trussCallShaftCacheTask;
|
||||||
|
@Autowired
|
||||||
|
private IBstIvtStockingivtService stockingivtService;
|
||||||
|
@Autowired
|
||||||
|
private ISysNoticeService noticeService;
|
||||||
|
@Autowired
|
||||||
|
private StockAreaSendVehicleTask stockAreaSendVehicleTask;
|
||||||
|
@Autowired
|
||||||
|
private StockAreaCallTubeTask stockAreaCallTubeTask;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* hint: 目前只是考虑了上区域
|
||||||
* 执行套轴和拔轴任务的逻辑处理。
|
* 执行套轴和拔轴任务的逻辑处理。
|
||||||
* 该方法首先寻找空闲的插拔轴位,然后根据不同的条件(如标箔或锂电)来确定区域。接着,它会检查是否有分切计划需要执行,
|
* 该方法首先寻找空闲的插拔轴位,然后根据不同的条件(如标箔或锂电)来确定区域。接着,它会检查是否有分切计划需要执行,
|
||||||
* 并根据计划来决定是进行套轴还是拔轴操作。如果需要套轴,它会寻找合适的套轴位置,并且在没有合适位置时会触发滚条气涨轴的操作。
|
* 并根据计划来决定是进行套轴还是拔轴操作。如果需要套轴,它会寻找合适的套轴位置,并且在没有合适位置时会触发滚条气涨轴的操作。
|
||||||
@@ -63,7 +80,8 @@ public class AutoCallAirShaftTask {
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void run() {
|
public void run() {
|
||||||
// 1、获取空的插拔轴位(无任务)
|
// 1、获取空的插拔轴位(无任务)
|
||||||
List<BstIvtShafttubeivt> emptyPoints = bstIvtShafttubeivtService.getAllShaftPointsByConditions("2","0","0");
|
List<BstIvtShafttubeivt> emptyPoints = bstIvtShafttubeivtService.getAllShaftPointsByConditions("2",
|
||||||
|
"0","0");
|
||||||
emptyPoints.forEach(empty -> {
|
emptyPoints.forEach(empty -> {
|
||||||
// 标箔:1,锂电:2 改:大小:4代5代
|
// 标箔:1,锂电:2 改:大小:4代5代
|
||||||
String specification = empty.getQzz_generation();
|
String specification = empty.getQzz_generation();
|
||||||
@@ -76,7 +94,8 @@ public class AutoCallAirShaftTask {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 查看套轴对接位是否满了
|
// 查看套轴对接位是否满了
|
||||||
List<BstIvtCutpointivt> emptyShaftPoint = bcutpointivtService.getAreaNotTaskPointByStatus("1", "1", location, "0");
|
List<BstIvtCutpointivt> emptyShaftPoint = bcutpointivtService.getAreaNotTaskPointByStatus("1",
|
||||||
|
"1", location, "0");
|
||||||
// 如果满了就只做拔轴
|
// 如果满了就只做拔轴
|
||||||
if (emptyShaftPoint.size() == 0) {
|
if (emptyShaftPoint.size() == 0) {
|
||||||
// 如果不需要套轴,就只做拔轴
|
// 如果不需要套轴,就只做拔轴
|
||||||
@@ -111,6 +130,7 @@ public class AutoCallAirShaftTask {
|
|||||||
toAcsOutShaft(qzzSize, location, empty);
|
toAcsOutShaft(qzzSize, location, empty);
|
||||||
// 保存所需要的分切计划数据到点位上(套轴对接位)更新分切计划
|
// 保存所需要的分切计划数据到点位上(套轴对接位)更新分切计划
|
||||||
saveCutPlanMessage(empty, needPlans, qzzSize);
|
saveCutPlanMessage(empty, needPlans, qzzSize);
|
||||||
|
toCallAgvMovePaperTube(needPlans, location, empty);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 查找一条没任务的点位
|
// 查找一条没任务的点位
|
||||||
@@ -121,6 +141,7 @@ public class AutoCallAirShaftTask {
|
|||||||
toAcsOutShaft(qzzSize, location, empty);
|
toAcsOutShaft(qzzSize, location, empty);
|
||||||
// 保存所需要的分切计划数据到点位上(套轴对接位)更新分切计划
|
// 保存所需要的分切计划数据到点位上(套轴对接位)更新分切计划
|
||||||
saveCutPlanMessage(empty, needPlans, qzzSize);
|
saveCutPlanMessage(empty, needPlans, qzzSize);
|
||||||
|
toCallAgvMovePaperTube(needPlans, location, empty);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 创建任务
|
// 创建任务
|
||||||
@@ -159,6 +180,7 @@ public class AutoCallAirShaftTask {
|
|||||||
// 拔管数量
|
// 拔管数量
|
||||||
param.put("pullCount", oldPlans.size());
|
param.put("pullCount", oldPlans.size());
|
||||||
trussCallAirShaftTask.createTask(param);
|
trussCallAirShaftTask.createTask(param);
|
||||||
|
toCallAgvMovePaperTube(needPlans, location, empty);
|
||||||
// 将分切计划is_paper_ok 1(纸管已经准备好) -> 2(已经套轴)
|
// 将分切计划is_paper_ok 1(纸管已经准备好) -> 2(已经套轴)
|
||||||
needPlans.forEach(p -> {
|
needPlans.forEach(p -> {
|
||||||
p.setIs_paper_ok("2");
|
p.setIs_paper_ok("2");
|
||||||
@@ -168,6 +190,75 @@ public class AutoCallAirShaftTask {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 呼叫AGV更换纸管
|
||||||
|
* @param needPlans 所需要套轴的分切计划
|
||||||
|
* @param location 位置
|
||||||
|
*/
|
||||||
|
public void toCallAgvMovePaperTube(List<PdmBiSlittingproductionplan> needPlans, String location, BstIvtShafttubeivt empty) {
|
||||||
|
// 最多两根
|
||||||
|
List<String> tubes = needPlans.stream().map(plan -> {
|
||||||
|
if (SlitterConstant.SLITTER_TYPE_PAPER.equals(plan.getPaper_tube_or_FRP())) {
|
||||||
|
return plan.getPaper_tube_material();
|
||||||
|
} else {
|
||||||
|
return plan.getFRP_material();
|
||||||
|
}
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
// 判断当前区域location对应的备货区是否含有相同的纸管 校验了不在搬运中
|
||||||
|
// type=1, 关联对象material_code=纸管, qty > 0
|
||||||
|
List<BstIvtStockingivt> useList = stockingivtService.getPaperTubePoint("1", tubes.get(0), location, tubes.size());
|
||||||
|
if (useList.size() > 0) {
|
||||||
|
// 说明三个位置中有包含此纸管的数据。
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 查找type=0的位置中是否存在 校验了不在搬运中
|
||||||
|
List<BstIvtStockingivt> stockingivtList = stockingivtService.getPaperTubePoint("0", tubes.get(0), location, tubes.size());
|
||||||
|
if (stockingivtList.size() == 0) {
|
||||||
|
// 不存在则站内通知
|
||||||
|
noticeService.createNotice("备货区找不到[" + tubes.get(0) + "]的纸管信息",
|
||||||
|
"点位[" + empty.getPoint_name() + "]无法从备货区找到纸管信息",
|
||||||
|
NoticeTypeEnum.EXCEPTION.getCode());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 找一个点位: 目的需要的点位
|
||||||
|
BstIvtStockingivt needPoint = stockingivtList.get(0);
|
||||||
|
// 找到就创建AGV搬运任务
|
||||||
|
// 查找一个没有任务的空位
|
||||||
|
List<BstIvtStockingivt> list = stockingivtService.getEmptyPointNotTask(location, "0");
|
||||||
|
if (list.size() == 0) {
|
||||||
|
noticeService.createNotice("备货区找不到空位置搬运",
|
||||||
|
"点位[" + empty.getPoint_name() + "]无法从备货区找到空位",
|
||||||
|
NoticeTypeEnum.EXCEPTION.getCode());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
BstIvtStockingivt endPoint = list.get(0);
|
||||||
|
// 筛选3个位置中数量最少的搬走
|
||||||
|
BstIvtStockingivt needMovePoint = stockingivtService.getCanMovePointOne(location, "1");
|
||||||
|
// 空位就直接创建搬过来的任务
|
||||||
|
if ("0".equals(needMovePoint.getIvt_status())) {
|
||||||
|
// 直接搬过来即可
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("point_code1", needPoint.getPoint_code());
|
||||||
|
param.put("point_code2", needMovePoint.getPoint_code());
|
||||||
|
param.put("vehicle_code", needPoint.getVehicle_code());
|
||||||
|
param.put("task_type", SlitterEnum.TASK_TYPE.code("备货区送纸管"));
|
||||||
|
param.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||||
|
stockAreaCallTubeTask.createTask(param);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 创建任务 -> HINT: 在此任务完成之后会调用搬回来的任务,因此任务中要记录需要搬运的点位放在任务请求参数中。
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("point_code1", needMovePoint.getPoint_code());
|
||||||
|
param.put("point_code2", endPoint.getPoint_code());
|
||||||
|
param.put("vehicle_code", needMovePoint.getVehicle_code());
|
||||||
|
param.put("material_code", tubes.get(0));
|
||||||
|
param.put("call_point", needPoint);
|
||||||
|
param.put("task_type", SlitterEnum.TASK_TYPE.code("备货区送载具"));
|
||||||
|
param.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||||
|
stockAreaSendVehicleTask.createTask(param);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取对应的气胀轴库1
|
* 获取对应的气胀轴库1
|
||||||
* @param qzzSize 气涨轴尺寸
|
* @param qzzSize 气涨轴尺寸
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ public enum SlitterEnum {
|
|||||||
* 任务类型
|
* 任务类型
|
||||||
*/
|
*/
|
||||||
TASK_TYPE(MapOf.of("穿拔轴缓存<>穿拔轴位", "010801", "穿拔轴缓存<>分切对接位", "010802", "穿拔轴位<>气胀轴缓存位", "010803"
|
TASK_TYPE(MapOf.of("穿拔轴缓存<>穿拔轴位", "010801", "穿拔轴缓存<>分切对接位", "010802", "穿拔轴位<>气胀轴缓存位", "010803"
|
||||||
, "分切机下料AGV任务", "010804", "分切机上气胀轴", "010805", "分切机下气胀轴", "010806"));
|
, "分切机下料AGV任务", "010804", "分切机上气胀轴", "010805", "分切机下气胀轴", "010806", "备货区送载具", "010807"
|
||||||
|
, "备货区送纸管", "010808"));
|
||||||
private Map<String, String> code;
|
private Map<String, String> code;
|
||||||
|
|
||||||
public String code(String desc) {
|
public String code(String desc) {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt;
|
import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt;
|
||||||
import org.nl.b_lms.bst.ivt.shafttubeivt.service.dao.BstIvtShafttubeivt;
|
import org.nl.b_lms.bst.ivt.shafttubeivt.service.dao.BstIvtShafttubeivt;
|
||||||
|
import org.nl.b_lms.bst.ivt.stockingivt.service.dao.BstIvtStockingivt;
|
||||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingproductionplan;
|
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.dao.SchBaseTask;
|
||||||
|
|
||||||
@@ -102,4 +103,14 @@ public class TaskUtils {
|
|||||||
point.setUpdate_optname(SecurityUtils.getCurrentUsername());
|
point.setUpdate_optname(SecurityUtils.getCurrentUsername());
|
||||||
point.setUpdate_time(DateUtil.now());
|
point.setUpdate_time(DateUtil.now());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 赋值备货区的修改时间、人等信息
|
||||||
|
* @param point 备货区
|
||||||
|
*/
|
||||||
|
public static void updateOptMessageByBStockingPoint(BstIvtStockingivt point) {
|
||||||
|
point.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||||
|
point.setUpdate_optname(SecurityUtils.getCurrentUsername());
|
||||||
|
point.setUpdate_time(DateUtil.now());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function add(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/bstIvtStockingivt',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function del(ids) {
|
||||||
|
return request({
|
||||||
|
url: 'api/bstIvtStockingivt/',
|
||||||
|
method: 'delete',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function edit(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/bstIvtStockingivt',
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default { add, edit, del }
|
||||||
162
lms/nladmin-ui/src/views/b_lms/bst/ivt/stockingivt/index.vue
Normal file
162
lms/nladmin-ui/src/views/b_lms/bst/ivt/stockingivt/index.vue
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<!--工具栏-->
|
||||||
|
<div class="head-container">
|
||||||
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
|
<crudOperation :permission="permission" />
|
||||||
|
<!--表单组件-->
|
||||||
|
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||||
|
<el-form-item label="点位编码" prop="point_code">
|
||||||
|
<el-input v-model="form.point_code" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="点位名称">
|
||||||
|
<el-input v-model="form.point_name" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="托盘号">
|
||||||
|
<el-input v-model="form.vehicle_code" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="区域">
|
||||||
|
<el-input v-model="form.product_area" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="点位类型">
|
||||||
|
<el-input v-model="form.point_type" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="点位状态">
|
||||||
|
<el-input v-model="form.ivt_status" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="位置">
|
||||||
|
<el-input v-model="form.point_location" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="顺序号" prop="sort_seq">
|
||||||
|
<el-input v-model="form.sort_seq" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否启用" prop="is_used">
|
||||||
|
<el-input v-model="form.is_used" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注">
|
||||||
|
<el-input v-model="form.remark" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="规划">
|
||||||
|
<el-input v-model="form.plan" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||||
|
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</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="点位编码" :min-width="flexWidth('point_code',crud.data,'点位编码')"/>
|
||||||
|
<el-table-column prop="point_name" label="点位名称" :min-width="flexWidth('point_name',crud.data,'点位名称')"/>
|
||||||
|
<el-table-column prop="vehicle_code" label="托盘号" :min-width="flexWidth('vehicle_code',crud.data,'托盘号')"/>
|
||||||
|
<el-table-column prop="product_area" label="区域" :min-width="flexWidth('product_area',crud.data,'区域')"/>
|
||||||
|
<el-table-column prop="point_type" label="点位类型" :min-width="flexWidth('point_type',crud.data,'点位类型')"/>
|
||||||
|
<el-table-column prop="ivt_status" label="点位状态" :min-width="flexWidth('ivt_status',crud.data,'点位状态')"/>
|
||||||
|
<el-table-column prop="point_location" label="位置" :min-width="flexWidth('point_location',crud.data,'位置')"/>
|
||||||
|
<el-table-column prop="sort_seq" label="顺序号" :min-width="flexWidth('sort_seq',crud.data,'顺序号')"/>
|
||||||
|
<el-table-column prop="is_used" label="是否启用" :min-width="flexWidth('is_used',crud.data,'是否启用')"/>
|
||||||
|
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')"/>
|
||||||
|
<el-table-column prop="create_name" label="创建人" :min-width="flexWidth('create_name',crud.data,'创建人')"/>
|
||||||
|
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')"/>
|
||||||
|
<el-table-column prop="update_optname" label="修改人" :min-width="flexWidth('update_optname',crud.data,'修改人')"/>
|
||||||
|
<el-table-column prop="update_time" label="修改时间" :min-width="flexWidth('update_time',crud.data,'修改时间')"/>
|
||||||
|
<el-table-column prop="plan" label="规划" :min-width="flexWidth('plan',crud.data,'规划')"/>
|
||||||
|
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<udOperation
|
||||||
|
:data="scope.row"
|
||||||
|
:permission="permission"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<pagination />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import crudBstIvtStockingivt from './bstIvtStockingivt'
|
||||||
|
import CRUD, {crud, form, header, presenter} from '@crud/crud'
|
||||||
|
import rrOperation from '@crud/RR.operation'
|
||||||
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
|
import udOperation from '@crud/UD.operation'
|
||||||
|
import pagination from '@crud/Pagination'
|
||||||
|
|
||||||
|
const defaultForm = {
|
||||||
|
ivt_id: null,
|
||||||
|
point_code: null,
|
||||||
|
point_name: null,
|
||||||
|
vehicle_code: null,
|
||||||
|
product_area: null,
|
||||||
|
point_type: null,
|
||||||
|
ivt_status: null,
|
||||||
|
point_location: null,
|
||||||
|
sort_seq: null,
|
||||||
|
is_used: null,
|
||||||
|
remark: null,
|
||||||
|
create_id: null,
|
||||||
|
create_name: null,
|
||||||
|
create_time: null,
|
||||||
|
update_optid: null,
|
||||||
|
update_optname: null,
|
||||||
|
update_time: null,
|
||||||
|
plan: null
|
||||||
|
}
|
||||||
|
export default {
|
||||||
|
name: 'BstIvtStockingivt',
|
||||||
|
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||||
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
|
cruds() {
|
||||||
|
return CRUD({
|
||||||
|
title: '备货区点位库存表',
|
||||||
|
url: 'api/bstIvtStockingivt',
|
||||||
|
idField: 'ivt_id',
|
||||||
|
sort: 'ivt_id,desc',
|
||||||
|
crudMethod: { ...crudBstIvtStockingivt }
|
||||||
|
})
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
permission: {
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
ivt_id: [
|
||||||
|
{ required: true, message: '库存记录标识不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
point_code: [
|
||||||
|
{ required: true, message: '点位编码不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
sort_seq: [
|
||||||
|
{ required: true, message: '顺序号不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
is_used: [
|
||||||
|
{ required: true, message: '是否启用不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
create_id: [
|
||||||
|
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
create_name: [
|
||||||
|
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
create_time: [
|
||||||
|
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
} }
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||||
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user