opt: 套轴暂存位预留一个位置
fix: 管芯查询判断托盘与点位绑定关系 opt: 手持绑定管芯直接绑定点位与托盘
This commit is contained in:
@@ -5,6 +5,7 @@ import org.nl.common.domain.query.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.b_lms.bst.ivt.papervehicle.service.dao.MdPbPapervehicle;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -40,4 +41,12 @@ public interface IMdPbPapervehicleService extends IService<MdPbPapervehicle> {
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Set<String> ids);
|
||||
|
||||
/**
|
||||
* 获取管芯
|
||||
* @param pointLocation
|
||||
* @param tubes
|
||||
* @return
|
||||
*/
|
||||
List<MdPbPapervehicle> getGXs(String pointLocation, List<String> tubes);
|
||||
}
|
||||
|
||||
@@ -3,10 +3,13 @@ package org.nl.b_lms.bst.ivt.papervehicle.service.dao.mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.b_lms.bst.ivt.papervehicle.service.dao.MdPbPapervehicle;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lyd
|
||||
* @date 2024-06-04
|
||||
**/
|
||||
public interface MdPbPapervehicleMapper extends BaseMapper<MdPbPapervehicle> {
|
||||
|
||||
List<MdPbPapervehicle> getGXs(String pointLocation, List<String> tubes);
|
||||
}
|
||||
|
||||
@@ -2,4 +2,20 @@
|
||||
<!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.papervehicle.service.dao.mapper.MdPbPapervehicleMapper">
|
||||
|
||||
<select id="getGXs" resultType="org.nl.b_lms.bst.ivt.papervehicle.service.dao.MdPbPapervehicle">
|
||||
SELECT
|
||||
p.*
|
||||
FROM
|
||||
`bst_ivt_stockingivt` bs
|
||||
LEFT JOIN md_pb_papervehicle p ON bs.vehicle_code = p.vehicle_code
|
||||
WHERE bs.point_type = '1' AND bs.ivt_status = '1'
|
||||
AND bs.is_used = '1' AND bs.point_location = #{pointLocation}
|
||||
AND IFNULL(p.ivt_id,'') <![CDATA[ <> ]]> '' AND p.qty > 0
|
||||
AND p.material_code IN
|
||||
<foreach item="code" collection="tubes" open="(" separator="," close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
AND 0 = (SELECT COUNT(*) FROM sch_base_task t WHERE t.task_status <![CDATA[ < ]]> '07'
|
||||
AND (t.point_code1 = bs.point_code OR t.point_code2 = bs.point_code) AND t.is_delete = '0')
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -76,4 +77,9 @@ public class MdPbPapervehicleServiceImpl extends ServiceImpl<MdPbPapervehicleMap
|
||||
mdPbPapervehicleMapper.deleteBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MdPbPapervehicle> getGXs(String pointLocation, List<String> tubes) {
|
||||
return mdPbPapervehicleMapper.getGXs(pointLocation, tubes);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -144,10 +145,13 @@ public class BstIvtStockingivtServiceImpl extends ServiceImpl<BstIvtStockingivtM
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject operateIvt(JSONObject jsonObject) {
|
||||
log.info("手持操作管芯托盘 - {}", jsonObject);
|
||||
String vehicle_code = jsonObject.getString("vehicle_code");
|
||||
String row_num = jsonObject.getString("row_num");
|
||||
String material_code = jsonObject.getString("material_code");
|
||||
String point_code = jsonObject.getString("point_code");
|
||||
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
@@ -240,7 +244,24 @@ public class BstIvtStockingivtServiceImpl extends ServiceImpl<BstIvtStockingivtM
|
||||
papervehicle.setUpdate_time(now);
|
||||
papervehicleService.save(papervehicle);
|
||||
}
|
||||
|
||||
// 插入托盘数据到点位
|
||||
// 检查托盘号是不是在其他点位上
|
||||
List<BstIvtStockingivt> stockingivts = bstIvtStockingivtMapper.selectList(new LambdaQueryWrapper<BstIvtStockingivt>()
|
||||
.eq(BstIvtStockingivt::getVehicle_code, vehicle_code)
|
||||
.ne(BstIvtStockingivt::getPoint_code, point_code));
|
||||
if (stockingivts.size() > 1) {
|
||||
throw new BadRequestException("该托盘绑定了多个位置!");
|
||||
}
|
||||
if (stockingivts.size() > 0) {
|
||||
BstIvtStockingivt bstIvtStockingivt = stockingivts.get(0);
|
||||
bstIvtStockingivt.setVehicle_code("");
|
||||
bstIvtStockingivtMapper.updateById(bstIvtStockingivt);
|
||||
}
|
||||
BstIvtStockingivt currentStock = bstIvtStockingivtMapper.selectOne(new LambdaQueryWrapper<BstIvtStockingivt>()
|
||||
.eq(BstIvtStockingivt::getPoint_code, point_code));
|
||||
currentStock.setVehicle_code(vehicle_code);
|
||||
currentStock.setIvt_status("1");
|
||||
bstIvtStockingivtMapper.updateById(currentStock);
|
||||
}
|
||||
|
||||
if (type.equals("2")) {
|
||||
|
||||
@@ -166,7 +166,7 @@ public class AutoCallAirShaftTask {
|
||||
"1", location, "0");
|
||||
stepStr += ",6";
|
||||
// 如果满了就只做拔轴 预留一个货位?,防止套轴直接站满
|
||||
if (emptyShaftPoint.size() <= 1) {
|
||||
if (emptyShaftPoint.size() < 1) {
|
||||
log.info("暂存位没有空位!正在检测是否存在半个点位!");
|
||||
// 校验是否存在半个位置,且有分切计划
|
||||
// 获取只有一个位置的点位
|
||||
@@ -252,15 +252,16 @@ public class AutoCallAirShaftTask {
|
||||
stepStr += ",16";
|
||||
//若套轴暂存位没有相同规格的气胀轴,直接去气胀轴库找即可
|
||||
// 要先判断AGV任务,才能去呼叫出轴
|
||||
if (!toCallAgvMovePaperTube(needPlans, location, empty)) {
|
||||
log.error("呼叫AGV失败-穿拔轴{}不进行套轴,跳过!", empty.getPoint_code());
|
||||
return;
|
||||
}
|
||||
// if (!toCallAgvMovePaperTube(needPlans, location, empty)) {
|
||||
// log.error("呼叫AGV失败-穿拔轴{}不进行套轴,跳过!", empty.getPoint_code());
|
||||
// return;
|
||||
// }
|
||||
// 调用ACS滚条气涨轴下来
|
||||
if (!toAcsOutShaft(qzzSize,location, empty)) {
|
||||
log.error("呼叫出轴失败-穿拔轴{}不进行套轴,跳过!", empty.getPoint_code());
|
||||
return;
|
||||
}
|
||||
toCallAgvMovePaperTube(needPlans, location, empty);
|
||||
// 保存所需要的分切计划数据到点位上(套轴对接位)更新分切计划
|
||||
saveCutPlanMessage(empty, needPlans, qzzSize);
|
||||
stepStr += ",97";
|
||||
@@ -323,10 +324,10 @@ public class AutoCallAirShaftTask {
|
||||
param.put("qzz_size", needPlan.getQzz_size());
|
||||
// 所需的纸管规格
|
||||
SlitterTaskUtil.putNeedPaperSpec(param, needPlans);
|
||||
if (!toCallAgvMovePaperTube(needPlans, location, empty)) {
|
||||
log.error("呼叫AGV失败-穿拔轴{}不进行套轴,跳过!", empty.getPoint_code());
|
||||
return;
|
||||
}
|
||||
// if (!toCallAgvMovePaperTube(needPlans, location, empty)) {
|
||||
// log.error("呼叫AGV失败-穿拔轴{}不进行套轴,跳过!", empty.getPoint_code());
|
||||
// return;
|
||||
// }
|
||||
// 保存所需要的分切计划数据到点位上(套轴对接位)更新分切计划
|
||||
saveCutPlanMessage(empty, needPlans, qzzSize);
|
||||
// 设置是否套轴:1:正常套轴,2:待定(到后面还会申请套轴)
|
||||
@@ -344,7 +345,7 @@ public class AutoCallAirShaftTask {
|
||||
// 拔管数量
|
||||
param.put("pullCount", oldPlans.size());
|
||||
param.put("containers", oldPlans.stream().map(PdmBiSlittingproductionplan::getContainer_name).collect(Collectors.toList()));
|
||||
|
||||
toCallAgvMovePaperTube(needPlans, location, empty);
|
||||
stepStr += ",36";
|
||||
trussCallAirShaftTask.createTask(param);
|
||||
stepStr += ",37";
|
||||
|
||||
@@ -137,42 +137,43 @@
|
||||
AND 0 = ABS(bcp.sort_seq - #{sortSeq})
|
||||
</select>
|
||||
<select id="showManualView" resultType="org.nl.b_lms.sch.tasks.slitter.mapper.dto.CallPlanViewVO">
|
||||
SELECT
|
||||
p.workorder_id,
|
||||
p.resource_name,
|
||||
CASE
|
||||
WHEN LENGTH(p.parent_container_name) > 0 THEN
|
||||
p.parent_container_name ELSE p.restruct_container_name
|
||||
END AS parent_container_name,
|
||||
p.split_group,
|
||||
p.up_or_down,
|
||||
p.qzz_size,
|
||||
p.qzz_generation,
|
||||
MIN(p.start_time) AS start_time,
|
||||
IF(p.paper_tube_or_FRP='1',p.paper_tube_description,p.FRP_description) AS tube,
|
||||
MIN( p.`status` ) AS `status`
|
||||
FROM
|
||||
`pdm_bi_slittingproductionplan` p
|
||||
WHERE
|
||||
p.`status` <![CDATA[ < ]]> '09'
|
||||
AND p.is_delete = '0'
|
||||
AND IFNULL(p.up_or_down, '') <![CDATA[ <> ]]> ''
|
||||
AND IFNULL(p.left_or_right, '') <![CDATA[ <> ]]> ''
|
||||
AND DATE(p.start_time) >= DATE_SUB(CURDATE(), INTERVAL 1 DAY)
|
||||
AND '1' = (SELECT c.is_used FROM st_ivt_cutpointivt c WHERE c.ext_code = p.resource_name)
|
||||
AND p.parent_container_name LIKE '%虚拟-B%'
|
||||
SELECT p.workorder_id,
|
||||
p.resource_name,
|
||||
CASE
|
||||
WHEN LENGTH(p.parent_container_name) > 0 THEN
|
||||
p.parent_container_name
|
||||
ELSE p.restruct_container_name
|
||||
END AS parent_container_name,
|
||||
p.split_group,
|
||||
p.up_or_down,
|
||||
p.qzz_size,
|
||||
p.qzz_generation,
|
||||
p.is_paper_ok,
|
||||
MIN(p.start_time) AS start_time,
|
||||
IF(p.paper_tube_or_FRP = '1', p.paper_tube_description, p.FRP_description) AS tube,
|
||||
MIN(p.`status`) AS `status`
|
||||
FROM `pdm_bi_slittingproductionplan` p
|
||||
WHERE p.`status` <![CDATA[ < ]]> '09'
|
||||
AND p.is_delete = '0'
|
||||
AND IFNULL(p.up_or_down, '') <![CDATA[ <> ]]> ''
|
||||
AND IFNULL(p.left_or_right, '') <![CDATA[ <> ]]> ''
|
||||
AND DATE (p.start_time) >= DATE_SUB(CURDATE()
|
||||
, INTERVAL 1 DAY)
|
||||
AND '1' = (SELECT c.is_used FROM st_ivt_cutpointivt c WHERE c.ext_code = p.resource_name)
|
||||
AND p.parent_container_name LIKE '%虚拟-B%'
|
||||
GROUP BY
|
||||
p.workorder_id,
|
||||
p.resource_name,
|
||||
p.parent_container_name,
|
||||
p.restruct_container_name,
|
||||
p.split_group,
|
||||
p.up_or_down,
|
||||
p.qzz_size,
|
||||
p.qzz_generation,
|
||||
p.paper_tube_or_FRP,
|
||||
p.paper_tube_description,
|
||||
p.FRP_description
|
||||
p.workorder_id,
|
||||
p.resource_name,
|
||||
p.parent_container_name,
|
||||
p.restruct_container_name,
|
||||
p.split_group,
|
||||
p.up_or_down,
|
||||
p.qzz_size,
|
||||
p.is_paper_ok,
|
||||
p.qzz_generation,
|
||||
p.paper_tube_or_FRP,
|
||||
p.paper_tube_description,
|
||||
p.FRP_description
|
||||
ORDER BY
|
||||
`status`, start_time
|
||||
</select>
|
||||
|
||||
@@ -44,4 +44,5 @@ public class CallPlanViewVO implements Serializable {
|
||||
*/
|
||||
private String qzz_generation;
|
||||
private String start_time;
|
||||
private String is_paper_ok;
|
||||
}
|
||||
|
||||
@@ -124,6 +124,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
@Override
|
||||
|
||||
public JSONObject acsRequestShaftLoadTube(JSONObject param) {
|
||||
// hint: 现在的考虑都是基于B1,B2的车间,后续的B3、B4需要再次修改
|
||||
log.info("acs申请套轴的输入参数为:{}", param);
|
||||
JSONObject res = new JSONObject();
|
||||
JSONObject con = new JSONObject();
|
||||
@@ -144,17 +145,22 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
List<String> tubes = Stream.of(point.getTube_code1(), point.getTube_code2())
|
||||
.filter(ObjectUtil::isNotEmpty)
|
||||
.collect(Collectors.toList());
|
||||
// 判断是否存在纸管
|
||||
List<MdPbPapervehicle> list = papervehicleService.list(new LambdaQueryWrapper<MdPbPapervehicle>()
|
||||
.in(MdPbPapervehicle::getMaterial_code, tubes)
|
||||
.gt(MdPbPapervehicle::getQty, 0));
|
||||
// 判断是否存在纸管(查找三点位是否有所需的管芯)
|
||||
// List<MdPbPapervehicle> list = papervehicleService.list(new LambdaQueryWrapper<MdPbPapervehicle>()
|
||||
// .in(MdPbPapervehicle::getMaterial_code, tubes)
|
||||
// .gt(MdPbPapervehicle::getQty, 0));
|
||||
List<MdPbPapervehicle> list = papervehicleService.getGXs(point.getPoint_location(), tubes);
|
||||
// point.getTube_code1() 编码 , getTube_name1() : 纸制筒管|纸管|6英寸|1300 or 纸制筒管|纸管|3英寸|12|650
|
||||
res.put("device_code", deviceCode);
|
||||
res.put("data", con);
|
||||
if ("1".equals(autoSendEmpty.getValue()) && list.size() == 0) {
|
||||
con.put("is_bushing", "2");
|
||||
} else {
|
||||
con.put("is_bushing", list.size() > 0 ? SlitterConstant.SLITTER_YES : SlitterConstant.SLITTER_NO);
|
||||
int sum = list.stream()
|
||||
.mapToInt(e -> e.getQty().intValue())
|
||||
.sum();
|
||||
// 需要求和判断当前数量和所需数
|
||||
con.put("is_bushing", sum >= tubes.size() ? SlitterConstant.SLITTER_YES : SlitterConstant.SLITTER_NO);
|
||||
}
|
||||
con.put("left", point.getTube_code1());
|
||||
con.put("leftSize", ObjectUtil.isNotEmpty(point.getTube_name1())
|
||||
@@ -1060,7 +1066,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
// List<BstIvtCutpointivt> areaEmptyNotTaskPoint = bcutpointivtService.getAreaNotTaskPointByStatus("1",
|
||||
// "1", "0", "2");
|
||||
List<BstIvtCutpointivt> areaEmptyNotTaskPoint = bcutpointivtService.getNBJCanUsePoint("1", "1", "0", "2");
|
||||
if (areaEmptyNotTaskPoint.size() == 0) {
|
||||
if (areaEmptyNotTaskPoint.size() <= 1) {
|
||||
throw new BadRequestException("请求搬运失败,内包间没有可存放位置!");
|
||||
}
|
||||
BstIvtCutpointivt endPoint = areaEmptyNotTaskPoint.get(0);
|
||||
|
||||
Reference in New Issue
Block a user