opt:优化定时器调度
This commit is contained in:
@@ -61,4 +61,10 @@ public interface IMdPbPapervehicleService extends IService<MdPbPapervehicle> {
|
||||
* @return
|
||||
*/
|
||||
List<MdPbPapervehicle> getAllTubesByPoint(String location);
|
||||
|
||||
/**
|
||||
* 获取任务中的管芯信息
|
||||
* @return
|
||||
*/
|
||||
List<MdPbPapervehicle> getInfoByTask();
|
||||
}
|
||||
|
||||
@@ -21,4 +21,6 @@ public interface MdPbPapervehicleMapper extends BaseMapper<MdPbPapervehicle> {
|
||||
Integer checkHaveTaskByPoints(List<String> pointCodes);
|
||||
|
||||
List<MdPbPapervehicle> getAllTubesByPoint(String location);
|
||||
|
||||
List<MdPbPapervehicle> getInfoByTask();
|
||||
}
|
||||
|
||||
@@ -70,4 +70,14 @@
|
||||
AND bs.is_used = '1'
|
||||
AND p.qty > 0
|
||||
</select>
|
||||
|
||||
<select id="getInfoByTask" resultType="org.nl.b_lms.bst.ivt.papervehicle.service.dao.MdPbPapervehicle">
|
||||
SELECT p.* FROM sch_base_task t1
|
||||
LEFT JOIN md_pb_papervehicle p ON p.vehicle_code = t1.vehicle_code2 AND p.qty > 0
|
||||
WHERE t1.task_type = '010807' AND t1.task_status <![CDATA[ < ]]> '07' AND t1.is_delete = '0'
|
||||
UNION
|
||||
SELECT p.* FROM sch_base_task t2
|
||||
LEFT JOIN md_pb_papervehicle p ON p.vehicle_code = t2.vehicle_code AND p.qty > 0
|
||||
WHERE t2.task_type = '010808' AND t2.task_status <![CDATA[ < ]]> '07' AND t2.is_delete = '0'
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -108,5 +108,8 @@ public class MdPbPapervehicleServiceImpl extends ServiceImpl<MdPbPapervehicleMap
|
||||
public List<MdPbPapervehicle> getAllTubesByPoint(String location) {
|
||||
return mdPbPapervehicleMapper.getAllTubesByPoint(location);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MdPbPapervehicle> getInfoByTask() {
|
||||
return mdPbPapervehicleMapper.getInfoByTask();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,4 +103,6 @@ public interface IBstIvtStockingivtService extends IService<BstIvtStockingivt> {
|
||||
List<MdPbPapervehicle> showDetail2(Map param);
|
||||
|
||||
PdmBiOrderbominfo showBom2(Map param);
|
||||
|
||||
List<BstIvtStockingivt> getMoveTaskPoints();
|
||||
}
|
||||
|
||||
@@ -44,4 +44,6 @@ public interface BstIvtStockingivtMapper extends BaseMapper<BstIvtStockingivt> {
|
||||
List<BhTubeMovePointDto> getCanMovePointList(String location, String pointType);
|
||||
|
||||
List<ShowStockView> showPapervehicleView(String product_area, String material_code);
|
||||
|
||||
List<BstIvtStockingivt> getMoveTaskPoints();
|
||||
}
|
||||
|
||||
@@ -117,4 +117,15 @@
|
||||
p.vehicle_code,
|
||||
p.material_code
|
||||
</select>
|
||||
|
||||
<select id="getMoveTaskPoints" resultType="org.nl.b_lms.bst.ivt.stockingivt.service.dao.BstIvtStockingivt">
|
||||
SELECT
|
||||
s.*
|
||||
FROM
|
||||
sch_base_task t
|
||||
LEFT JOIN bst_ivt_stockingivt s ON s.point_code = t.point_code1 AND s.point_type = '2' AND s.is_used = '1'
|
||||
WHERE t.task_type = '010816'
|
||||
AND t.task_status <![CDATA[ <> ]]> '07'
|
||||
AND t.is_delete = '0'
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -197,4 +197,9 @@ public class BstIvtStockingivtServiceImpl extends ServiceImpl<BstIvtStockingivtM
|
||||
PdmBiOrderbominfo order = pdmBiOrderbominfoService.getOne(lam);
|
||||
return order;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BstIvtStockingivt> getMoveTaskPoints() {
|
||||
return bstIvtStockingivtMapper.getMoveTaskPoints();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,8 +42,11 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@@ -73,8 +76,6 @@ public class AutoCallAirShaftTask extends Prun {
|
||||
@Autowired
|
||||
private IBstIvtStockingivtService stockingivtService;
|
||||
@Autowired
|
||||
private ISysNoticeService noticeService;
|
||||
@Autowired
|
||||
private StockAreaSendVehicleTask stockAreaSendVehicleTask;
|
||||
@Autowired
|
||||
private StockAreaCallTubeTask stockAreaCallTubeTask;
|
||||
@@ -599,20 +600,19 @@ public class AutoCallAirShaftTask extends Prun {
|
||||
log.info("同位置的另一台穿拔轴机构:{}", one);
|
||||
// 另一台所需要的数量
|
||||
int otherDeviceTubeSize = 0;
|
||||
if (ObjectUtil.isNotEmpty(one)) {
|
||||
if (one.getTube_code1().equals(tubes.get(0))) {
|
||||
otherDeviceTubeSize = (int) Stream.of(one.getTube_code1(), one.getTube_code2()).filter(ObjectUtil::isNotEmpty).count();
|
||||
}
|
||||
}
|
||||
// 缺省的数量
|
||||
int needQuantity = 0;
|
||||
// 判断当前区域location对应的备货区是否含有相同的纸管 校验了不在搬运中
|
||||
// todo: 要考虑防止所需要的托盘被搬走!
|
||||
// type=1(桁架底下的托盘), 关联对象material_code=纸管, qty > 0
|
||||
List<BstIvtStockingivt> useList = stockingivtService.getPaperTubePoint("1", tubes.get(0), location, 0);
|
||||
// type=2(桁架底下的托盘), 关联对象material_code=纸管, qty > 0
|
||||
List<BstIvtStockingivt> useList = stockingivtService.getPaperTubePoint("2", tubes.get(0), location, 0);
|
||||
if (useList.size() > 0) {
|
||||
// 求和,三个托盘中需要的管芯的数量。
|
||||
int sum = useList.stream().mapToInt(BstIvtStockingivt::getQty).sum();
|
||||
if (ObjectUtil.isNotEmpty(one)) {
|
||||
if (one.getTube_code1().equals(tubes.get(0))) {
|
||||
otherDeviceTubeSize = (int) Stream.of(one.getTube_code1(), one.getTube_code2()).filter(ObjectUtil::isNotEmpty).count();
|
||||
}
|
||||
}
|
||||
// 说明三个位置中有包含此纸管的数据。
|
||||
if (sum >= tubes.size() + otherDeviceTubeSize) {
|
||||
return true;
|
||||
@@ -622,7 +622,30 @@ public class AutoCallAirShaftTask extends Prun {
|
||||
// 兜底
|
||||
needQuantity = needTemp > 0 ? needTemp : 1;
|
||||
}
|
||||
// todo: 要考虑type=3的正在搬运往套轴区三个点的托盘是否有该库存,如有直接返回true
|
||||
// 2.2 查询是否存在任务正在搬运过来。(路上的是另一台机构的轴)
|
||||
List<MdPbPapervehicle> havePapers = papervehicleService.getInfoByTask();
|
||||
if (CollectionUtil.isNotEmpty(havePapers)) {
|
||||
Map<String, Integer> sumByMaterialCode = havePapers.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
MdPbPapervehicle::getMaterial_code,
|
||||
Collectors.mapping(
|
||||
MdPbPapervehicle::getQty,
|
||||
Collectors.reducing(
|
||||
0,
|
||||
Integer::sum
|
||||
)
|
||||
)
|
||||
));
|
||||
int sumQty = sumByMaterialCode.get(tubes.get(0)).intValue();
|
||||
if (sumQty >= needQuantity ) {
|
||||
log.info("AGV正在搬运管芯...");
|
||||
return true;
|
||||
}
|
||||
// 如果不够,就计算还缺多少个
|
||||
int needTemp = needQuantity - sumQty;
|
||||
// 兜底
|
||||
needQuantity = needTemp > 0 ? needTemp : tubes.size();
|
||||
}
|
||||
// 查找type=3的位置(待命的托盘)中是否存在(需要判断的是单独一个托盘) 校验了不在搬运中
|
||||
List<BhTubePointDto> stockingivtList = stockingivtService.getNeedPaperTubePoint("3", tubes.get(0), location);
|
||||
// 找一个点位: 目的需要的点位
|
||||
@@ -635,15 +658,28 @@ public class AutoCallAirShaftTask extends Prun {
|
||||
}
|
||||
}
|
||||
if (needPoint == null) {
|
||||
// 不存在则站内通知
|
||||
noticeService.createNotice("备货区找不到[" + tubes.get(0) + "]的纸管信息",
|
||||
"点位[" + empty.getPoint_name() + "]无法从备货区找到纸管信息",
|
||||
NoticeTypeEnum.EXCEPTION.getCode());
|
||||
log.info("备货区找不到[" + tubes.get(0) + "]的纸管信息");
|
||||
return false;
|
||||
}
|
||||
// 找到就创建AGV搬运任务
|
||||
// 筛选3个位置中数量最少的搬走, 如果是空位,直接搬运过来
|
||||
List<BhTubeMovePointDto> needMovePointList = stockingivtService.getCanMovePointList(location, "1");
|
||||
List<BhTubeMovePointDto> needMovePointListAll = stockingivtService.getCanMovePointList(location, "2");
|
||||
// 过滤掉另一台穿拔轴需要的轴的数据
|
||||
List<BhTubeMovePointDto> needMovePointList = new ArrayList<>();
|
||||
if (ObjectUtil.isEmpty(one)) {
|
||||
needMovePointList = needMovePointListAll;
|
||||
} else {
|
||||
List<String> otherTubes = Stream.of(one.getTube_code1(), one.getTube_code2()).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
|
||||
needMovePointList = needMovePointListAll.stream().filter(bh -> {
|
||||
String vehicleCode = bh.getVehicle_code();
|
||||
if (otherTubes.size() == 0 || "0".equals(bh.getIvt_status()) || ObjectUtil.isEmpty(vehicleCode)) {
|
||||
return true;
|
||||
}
|
||||
List<MdPbPapervehicle> list = papervehicleService.list(new LambdaQueryWrapper<MdPbPapervehicle>()
|
||||
.eq(MdPbPapervehicle::getVehicle_code, vehicleCode).eq(MdPbPapervehicle::getMaterial_code, otherTubes.get(0)));
|
||||
return list.size() == 0;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
// 空位就直接创建搬过来的任务
|
||||
BhTubeMovePointDto needMovePoint = needMovePointList.size() > 0 ? needMovePointList.get(0) : null;
|
||||
if (ObjectUtil.isEmpty(needMovePoint) || "0".equals(needMovePoint.getIvt_status())) {
|
||||
@@ -661,12 +697,28 @@ public class AutoCallAirShaftTask extends Prun {
|
||||
stockAreaCallTubeTask.createTask(param);
|
||||
return true;
|
||||
}
|
||||
// 3.2 判断是否有单独拉出去的任务,有的话直接拉过来。
|
||||
List<BstIvtStockingivt> stockingivts = stockingivtService.getMoveTaskPoints();
|
||||
if (CollectionUtil.isNotEmpty(stockingivts)) {
|
||||
BstIvtStockingivt bstIvtStockingivt = stockingivts.get(0);
|
||||
// 直接搬过来即可
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("point_code1", needPoint.getPoint_code());
|
||||
param.put("point_code2", bstIvtStockingivt.getPoint_code());
|
||||
param.put("vehicle_code", needPoint.getVehicle_code());
|
||||
param.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
param.put("task_type", SlitterEnum.TASK_TYPE.code("备货区送纸管"));
|
||||
// 存储纸管信息
|
||||
List<MdPbPapervehicle> paperList = mdPbPapervehicleService.list(new LambdaQueryWrapper<MdPbPapervehicle>()
|
||||
.eq(MdPbPapervehicle::getVehicle_code, needPoint.getVehicle_code()));
|
||||
doSavePaperInfos(paperList, param);
|
||||
stockAreaCallTubeTask.createTask(param);
|
||||
return true;
|
||||
}
|
||||
// 查找一个没有任务的空位
|
||||
List<BstIvtStockingivt> list = stockingivtService.getEmptyPointNotTask("3");
|
||||
if (list.size() == 0) {
|
||||
noticeService.createNotice("备货区找不到空位置搬运",
|
||||
"点位[" + empty.getPoint_name() + "]无法从备货区找到空位",
|
||||
NoticeTypeEnum.EXCEPTION.getCode());
|
||||
log.info("备货区找不到空位置搬运");
|
||||
return false;
|
||||
}
|
||||
BstIvtStockingivt endPoint = list.get(0);
|
||||
|
||||
@@ -1,325 +0,0 @@
|
||||
package org.nl.init;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.nl.b_lms.bst.ivt.shafttubeivt.service.dao.BstIvtShafttubeivt;
|
||||
import org.nl.b_lms.bst.ivt.shafttubeivt.service.dao.mapper.BstIvtShafttubeivtMapper;
|
||||
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.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.dao.mapper.PdmBiSubpackagerelationMapper;
|
||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||
import org.nl.b_lms.sch.point.dao.mapper.SchBasePointMapper;
|
||||
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
||||
import org.nl.b_lms.sch.tasks.first_floor_area.*;
|
||||
import org.nl.b_lms.sch.tasks.slitter.service.impl.SlitterServiceImpl;
|
||||
import org.nl.b_lms.sch.tasks.slitter.util.SlitterTaskUtil;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.OutBoxManageService;
|
||||
import org.nl.common.enums.ContainerLevelEnum;
|
||||
import org.nl.common.enums.PackageInfoIvtEnum;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit.jupiter.SpringExtension;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Slf4j
|
||||
@ExtendWith(SpringExtension.class)
|
||||
@DisplayName("event test")
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
public class EventTest {
|
||||
|
||||
@Resource
|
||||
private ZxqTask zxqTask;
|
||||
@Resource
|
||||
private ZxDjwTask zxDjwTask;
|
||||
|
||||
@Resource
|
||||
private ISysParamService iSysParamService;
|
||||
|
||||
@Resource
|
||||
private DjqTask djqTask;
|
||||
@Resource
|
||||
private GzqTask gzqTask;
|
||||
|
||||
@Resource
|
||||
private DjqToKzjhcwTask djqToKzjhcwTask;
|
||||
|
||||
@Resource
|
||||
private OutBoxManageService outBoxManageService;
|
||||
|
||||
@Resource
|
||||
private IbstIvtPackageinfoivtService packageinfoivtService;
|
||||
|
||||
@Resource
|
||||
private PdmBiSubpackagerelationMapper pdmBiSubpackagerelationMapper;
|
||||
@Autowired
|
||||
private BstIvtShafttubeivtMapper bstIvtShafttubeivtMapper;
|
||||
@Autowired
|
||||
private SchBasePointMapper schBasePointMapper;
|
||||
@Autowired
|
||||
private IPdmBiSlittingproductionplanService slittingproductionplanService;
|
||||
@Test
|
||||
public void sss() {
|
||||
System.out.println(schBasePointMapper.queryKZPoint());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getWeight() {
|
||||
List<PdmBiSlittingproductionplan> plans = slittingproductionplanService.getByQzzNos(Arrays.asList("B203-4"));
|
||||
String weights = "";
|
||||
SlitterTaskUtil.setPaperWeightStr(weights, plans);
|
||||
slittingproductionplanService.updateBatchById(plans);
|
||||
System.out.println(weights);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidate() {
|
||||
// 示例数据
|
||||
JSONArray jsonArray = JSONArray.parseArray(
|
||||
"[{\"container_name\":\"A\", \"site\":\"1\"},{\"container_name\":\"B\", \"site\":\"2\"}]"
|
||||
);
|
||||
|
||||
PdmBiSlittingproductionplan p1 = new PdmBiSlittingproductionplan();
|
||||
PdmBiSlittingproductionplan p2 = new PdmBiSlittingproductionplan();
|
||||
p1.setContainer_name("A");
|
||||
p1.setUp_or_down("1");
|
||||
p2.setContainer_name("B");
|
||||
p2.setUp_or_down("2");
|
||||
List<PdmBiSlittingproductionplan> plans = Arrays.asList(p1, p2);
|
||||
|
||||
// 执行校验
|
||||
SlitterTaskUtil.validateConsistency(jsonArray, plans);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void sl() {
|
||||
List<BstIvtShafttubeivt> notTaskShaftCache = bstIvtShafttubeivtMapper.getNotTaskShaftCache("3", "4", "0");
|
||||
System.out.println(notTaskShaftCache);
|
||||
}
|
||||
|
||||
/**
|
||||
* 装箱区->空载具缓存位补空
|
||||
*/
|
||||
@Test
|
||||
public void zxToKzjHcw() {
|
||||
//djqToKzjhcwTask.toKzjHcw("");
|
||||
}
|
||||
|
||||
/**
|
||||
* 满轴->待检
|
||||
*/
|
||||
@Test
|
||||
public void mzToDj() {
|
||||
//子卷成色等级
|
||||
String level = "1";
|
||||
//子卷号
|
||||
String containerName = "1";
|
||||
//起点
|
||||
String pointCode1 = "2";
|
||||
//查询库位信息
|
||||
List<BstIvtPackageinfoivt> bstIvtPackageinfoivtList = packageinfoivtService
|
||||
.list(new LambdaUpdateWrapper<BstIvtPackageinfoivt>()
|
||||
.eq(BstIvtPackageinfoivt::getIs_used, PackageInfoIvtEnum.IS_USED.code("启用"))
|
||||
.orderByAsc(BstIvtPackageinfoivt::getSort_seq));
|
||||
JSONObject toDjqTask = new JSONObject();
|
||||
//获取子卷号
|
||||
toDjqTask.put("vehicle_code", containerName);
|
||||
// 判断子卷等级属于待检区还是管制区,创建满轴缓存位到待检区或管制区的agv任务
|
||||
if (Stream.of(ContainerLevelEnum.BEST, ContainerLevelEnum.WELL, ContainerLevelEnum.COMMON).anyMatch(enumItem -> enumItem.getCode().equals(level))) {
|
||||
List<BstIvtPackageinfoivt> djqPointList = bstIvtPackageinfoivtList.stream()
|
||||
.filter(r -> PackageInfoIvtEnum.POINT_STATUS.code("待检区").equals(r.getPoint_status())
|
||||
&& PackageInfoIvtEnum.IVT_STATUS.code("空").equals(r.getIvt_status())).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(djqPointList)) {
|
||||
throw new BadRequestException("待检区暂无空余库位!");
|
||||
}
|
||||
toDjqTask.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("满轴缓存位->待检区"));
|
||||
toDjqTask.put("point_code1", pointCode1);
|
||||
toDjqTask.put("point_code2", djqPointList.get(0).getPoint_code());
|
||||
djqTask.createTask(toDjqTask);
|
||||
} else if (Stream.of(ContainerLevelEnum.REWORK, ContainerLevelEnum.CONTROL).anyMatch(enumItem -> enumItem.getCode().equals(level))) {
|
||||
List<BstIvtPackageinfoivt> gkqPointList = bstIvtPackageinfoivtList.stream()
|
||||
.filter(r -> PackageInfoIvtEnum.POINT_STATUS.code("管制区").equals(r.getPoint_status())
|
||||
&& PackageInfoIvtEnum.IVT_STATUS.code("空").equals(r.getIvt_status())).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(gkqPointList)) {
|
||||
throw new BadRequestException("管控区暂无空余库位!");
|
||||
}
|
||||
toDjqTask.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("满轴缓存位->管制区"));
|
||||
toDjqTask.put("point_code1", pointCode1);
|
||||
toDjqTask.put("point_code2", gkqPointList.get(0).getPoint_code());
|
||||
gzqTask.createTask(toDjqTask);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 待检->装箱
|
||||
*/
|
||||
@Test
|
||||
public void djToZx() {
|
||||
//子卷号
|
||||
String containerName = "";
|
||||
//起点
|
||||
String pointCode1 = "";
|
||||
//木箱
|
||||
String boxSn = "";
|
||||
//装箱区点位
|
||||
List<BstIvtPackageinfoivt> zxqPointList = packageinfoivtService
|
||||
.list(new LambdaUpdateWrapper<BstIvtPackageinfoivt>()
|
||||
.eq(BstIvtPackageinfoivt::getPoint_status, PackageInfoIvtEnum.POINT_STATUS.code("装箱区"))
|
||||
.eq(BstIvtPackageinfoivt::getIs_used, PackageInfoIvtEnum.IS_USED.code("启用"))
|
||||
.eq(BstIvtPackageinfoivt::getIvt_status, PackageInfoIvtEnum.IVT_STATUS.code("空"))
|
||||
//装箱区1
|
||||
.eq(BstIvtPackageinfoivt::getBlock, "1")
|
||||
.orderByAsc(BstIvtPackageinfoivt::getSort_seq));
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("待检区->装箱区"));
|
||||
jo.put("vehicle_code", containerName);
|
||||
jo.put("point_code1", pointCode1);
|
||||
//木箱号
|
||||
jo.put("vehicle_code2", boxSn);
|
||||
//装箱区没满,则确定起点与终点,如果满了则只确定起点
|
||||
if (CollectionUtils.isNotEmpty(zxqPointList)) {
|
||||
jo.put("point_code2", zxqPointList.get(0).getPoint_code());
|
||||
}
|
||||
zxqTask.createTask(jo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 空木箱出库
|
||||
*/
|
||||
@Test
|
||||
public void outBox() {
|
||||
JSONObject boxInfo = new JSONObject();
|
||||
boxInfo.put("device_code", "ZXQ_1_1");
|
||||
boxInfo.put("material_code", "MX61102");
|
||||
String workorderId = "1597797877554483218";
|
||||
//子卷个数
|
||||
boxInfo.put("num", "1");
|
||||
String boxSn = outBoxManageService.outBox(boxInfo);
|
||||
if (StringUtils.isBlank(boxSn)) {
|
||||
throw new BadRequestException("库位 -> 装箱对接位,木箱码不能为空!");
|
||||
}
|
||||
//更新子卷包装关系更新木箱号
|
||||
UpdateWrapper<PdmBiSubpackagerelation> updateWrapper1 = new UpdateWrapper<>();
|
||||
updateWrapper1.set("package_box_sn", boxSn);
|
||||
updateWrapper1.eq("workorder_id", workorderId);
|
||||
pdmBiSubpackagerelationMapper.update(null, updateWrapper1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 装箱区->装箱对接位桁架任务
|
||||
*/
|
||||
@Test
|
||||
public void transferToPacking() {
|
||||
JSONObject jo = new JSONObject();
|
||||
//子卷号
|
||||
String containerName = "A1642211060505E2";
|
||||
//获取纸管长度
|
||||
String frpDescription = "1300";
|
||||
//获取木箱高度等级
|
||||
String height = "730";
|
||||
//起点
|
||||
String point_code1 = "ZXQ_1_9";
|
||||
//终点
|
||||
String point_code2 = "ZXQ_1_1";
|
||||
//托盘类型 1小托盘 2大托盘
|
||||
String containerType = "2";
|
||||
//木箱高度等级
|
||||
String heightLevel = "";
|
||||
String heightLevel1 = iSysParamService.findByCode("height_level_1").getValue();
|
||||
String heightLevel2 = iSysParamService.findByCode("height_level_2").getValue();
|
||||
if (Integer.parseInt(height) <= Integer.parseInt(heightLevel1)) {
|
||||
heightLevel = "1";
|
||||
} else if (Integer.parseInt(height) > Integer.parseInt(heightLevel1) && Integer.parseInt(height) <= Integer.parseInt(heightLevel2)) {
|
||||
heightLevel = "2";
|
||||
} else {
|
||||
heightLevel = "3";
|
||||
}
|
||||
jo.put("point_code1", point_code1);
|
||||
jo.put("point_code2", point_code2);
|
||||
jo.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("装箱区->装箱对接位"));
|
||||
jo.put("vehicle_code", containerName);
|
||||
jo.put("acs_task_type", PackageInfoIvtEnum.ACS_TASK_TYPE.code("桁架任务"));
|
||||
jo.put("is_send", "1");
|
||||
JSONObject param = new JSONObject();
|
||||
//木箱最大数量
|
||||
param.put("maxNo", "1");
|
||||
//木箱放入子卷数量
|
||||
param.put("boxNo", "1");
|
||||
//是否最后子卷
|
||||
param.put("lastOne", "1");
|
||||
//子卷号
|
||||
param.put("barcode", containerName);
|
||||
//子卷长度
|
||||
param.put("len", frpDescription);
|
||||
//木箱高度等级
|
||||
param.put("heightLevel", heightLevel);
|
||||
//托盘类型 1小托盘 2大托盘
|
||||
param.put("containerType", containerType);
|
||||
jo.put("request_param", param.toString());
|
||||
zxDjwTask.createTask(jo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 装箱区->装箱对接位桁架任务2
|
||||
*/
|
||||
@Test
|
||||
public void transferToPacking1() {
|
||||
//下发装箱区->装箱对接位桁架任务
|
||||
JSONObject jo = new JSONObject();
|
||||
//子卷号
|
||||
String containerName = "";
|
||||
//获取纸管长度
|
||||
String frpDescription = "";
|
||||
//起点
|
||||
String point_code1 = "ZXQ_1_8";
|
||||
//终点
|
||||
String point_code2 = "ZXQ_1_1";
|
||||
jo.put("point_code1", point_code1);
|
||||
jo.put("point_code2", point_code2);
|
||||
jo.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("装箱区->装箱对接位"));
|
||||
jo.put("vehicle_code", containerName);
|
||||
jo.put("acs_task_type", PackageInfoIvtEnum.ACS_TASK_TYPE.code("桁架任务"));
|
||||
jo.put("is_send", "1");
|
||||
JSONObject param = new JSONObject();
|
||||
//木箱最大数量
|
||||
param.put("maxNo", "1");
|
||||
//木箱放入子卷数量
|
||||
param.put("boxNo", "1");
|
||||
//是否最后子卷
|
||||
param.put("lastOne", "1");
|
||||
//子卷号
|
||||
param.put("barcode", containerName);
|
||||
//子卷长度
|
||||
param.put("len", frpDescription);
|
||||
//托盘类型 1小托盘 2大托盘
|
||||
param.put("containerType", "1");
|
||||
jo.put("request_param", param.toString());
|
||||
zxDjwTask.createTask(jo);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String name = "纸制筒管|纸管|6英寸|12|650";
|
||||
if (name.contains("3英寸") || name.contains("3.12英寸")) {
|
||||
System.out.println("4");
|
||||
} else {
|
||||
System.out.println("5");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user