装箱测试

This commit is contained in:
ls
2026-02-25 17:23:12 +08:00
parent 3f836d4e53
commit 99c8ac4847
14 changed files with 155 additions and 60 deletions

View File

@@ -37,7 +37,7 @@ public enum BoxStackEnum {
STOCK_UP_STATUS(MapOf.of("未开始", "1", "执行中", "2", "完成", "3")),
//木箱库区域
POINT_STATUS(MapOf.of("密集区", "1", "零散区", "2", "缓存区", "3", "等待区", "4","对接区", "5"));
POINT_STATUS(MapOf.of("密集区", "1", "零散区", "2", "缓存区", "3", "等待区", "4","木箱对接区", "5","木箱退货区", "6"));
private Map<String, String> code;

View File

@@ -244,16 +244,14 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
}
}
//是否开启mes
String isOnMes = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("is_on_mes").getValue();
if (isOnMes.equals("1")) {
// 调用方法获取木箱料号:输入:子卷号、输出:木箱信息
r.setBox_type("");
PdmBiOrderbominfo bomInfoDao = iPdmBiOrderbominfoService.getBiOrderbominfoByContainer(r.getContainer_name());
if (ObjectUtil.isNotEmpty(bomInfoDao)) {
r.setBox_type(bomInfoDao.getProductName());
}
// 调用方法获取木箱料号:输入:子卷号、输出:木箱信息
r.setBox_type("");
PdmBiOrderbominfo bomInfoDao = iPdmBiOrderbominfoService.getBiOrderbominfoByContainer(r.getContainer_name());
if (ObjectUtil.isNotEmpty(bomInfoDao)) {
r.setBox_type(bomInfoDao.getProductName());
}
});
return pdmBiSubpackagerelationList;
}

View File

@@ -388,8 +388,8 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
List<BstIvtPackageinfoivt> dtoList;
UpdateWrapper<BstIvtPackageinfoivt> updateWrapper = new UpdateWrapper<>();
JSONObject jo = new JSONObject();
//是否开启mes
String isOnMes = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("is_on_mes").getValue();
//是否开启mes质检
String isOnMes = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("is_mes_package").getValue();
//子卷质检合格品和管制品
if (StringUtils.isNotBlank(whereJson.getString("container_name"))) {
if (whereJson.getString("ivt_status").equals(PackageInfoIvtEnum.IVT_STATUS.code("")) || whereJson.getString("ivt_status").equals(PackageInfoIvtEnum.IVT_STATUS.code("空载具")) || whereJson.getString("ivt_status").equals(PackageInfoIvtEnum.IVT_STATUS.code("有子卷"))) {
@@ -399,11 +399,7 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
PdmBiSubpackagerelation one = subpackagerelationService.getOne(new QueryWrapper<PdmBiSubpackagerelation>()
.eq("container_name", whereJson.getString("container_name")));
if (one!=null){
if (isOnMes.equals(IOSEnum.IS_NOTANDYES.code(""))) {
throw new BadRequestException("包装关系存在,请先解绑MES及LMS包装关系");
}else {
throw new BadRequestException("包装关系存已存在");
}
throw new BadRequestException("包装关系存在,请先解绑MES及LMS包装关系");
}
}
dtoList = bstIvtPackageinfoivtMapper.selectList(new LambdaQueryWrapper<BstIvtPackageinfoivt>().eq(BstIvtPackageinfoivt::getContainer_name, whereJson.getString("container_name")));
@@ -426,14 +422,13 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
}
//获取子卷最新信息
jo.put("container_name", whereJson.getString("container_name"));
//TODO:子卷下料信息MES传递给LMS
if (isOnMes.equals(IOSEnum.IS_NOTANDYES.code(""))) {
if (isOnMes.equals(IOSEnum.IS_NOTANDYES.code(""))) {
lmsToMesService.getInspectionResult(jo);
//子卷下料信息MES传递给LMS
iPdmBiContainerinfoService.createSubInfoByContainer(whereJson.getString("container_name"));
} else {
packageData(whereJson);
}
}
PdmProductSpecServiceImpl.doRecord(SpecEnum.ZJ,MapOf.of("质检结果",whereJson.getString("ivt_status")),Boolean.TRUE,null, packageinfoivt.getContainer_name());
updateWrapper.set("container_name", packageinfoivt.getContainer_name());

View File

@@ -75,7 +75,7 @@ public class AutoMxZxTask {
return;
}
//确定终点有位置生成agv任务 ,无位置生成移库任务
List<BstIvtBoxstack> bstIvtBoxstacks = boxstackMapper.selectAndNoTask( BoxStackEnum.POINT_STATUS.code("对接区"));
List<BstIvtBoxstack> bstIvtBoxstacks = boxstackMapper.selectAndNoTask( BoxStackEnum.POINT_STATUS.code("木箱对接区"));
if (CollectionUtil.isEmpty(bstIvtBoxstacks)){
//获取对接区没有任务的对接位
BstIvtBoxstack bstIvtBoxstack = new BstIvtBoxstack();

View File

@@ -0,0 +1,99 @@
package org.nl.b_lms.sch.tasks.first_floor_area.auto;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
import org.nl.b_lms.sch.point.dao.mapper.BstIvtPackageinfoivtMapper;
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
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.first_floor_area.GzqTask;
import org.nl.common.enums.PackageInfoIvtEnum;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.TimeUnit;
@Slf4j
@Component
@RequiredArgsConstructor
public class AutoSendDjqToZxq extends Prun{
private final String THIS_CLASS = AutoSendDjqToZxq.class.getName();
@Resource
private RedissonClient redissonClient;
@Resource
private GzqTask gzqTask;
@Resource
private IbstIvtPackageinfoivtService packageinfoivtService;
@Resource
private BstIvtPackageinfoivtMapper bstIvtPackageinfoivtMapper;
@Resource
private IschBaseTaskService taskService;
//待检区->装箱区agv自动搬运任务
@Autowired
public void run() {
try {
this.sendDjqToGzq();
}catch (Exception ex){
log.error(ex.getMessage());
}
}
/**
* 普通任务
*/
@SneakyThrows
public void sendDjqToGzq() {
log.info(THIS_CLASS+"-待检区->装箱区定时任务开始执行扫描。");
RLock lock = redissonClient.getLock(THIS_CLASS);
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
try {
if (tryLock) {
List<String> taskTypes = new ArrayList<>(Collections.singletonList(PackageInfoIvtEnum.TASK_TYPE.code("待检区->装箱区")));
List<SchBaseTask> existTask = taskService.getExistTasks(taskTypes);
if (existTask.size() > 2) {
return;
}
JSONObject task = new JSONObject();
//待检区有合格品且过滤未完成任务
List<BstIvtPackageinfoivt> selectEmpPoints = packageinfoivtService.selectEmpPoints(PackageInfoIvtEnum.POINT_STATUS.code("待检区"), PackageInfoIvtEnum.IVT_STATUS.code("合格品"));
if (ObjectUtils.isEmpty(selectEmpPoints)) {
return;
}
//装箱区为空位且过滤未完成任务
List<BstIvtPackageinfoivt> gzqPackageinfoivtList = packageinfoivtService.selectEmpPoints(PackageInfoIvtEnum.POINT_STATUS.code("装箱区"), PackageInfoIvtEnum.IVT_STATUS.code(""));
if (ObjectUtils.isEmpty(gzqPackageinfoivtList)) {
return;
}
task.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("待检区->装箱区"));
task.put("vehicle_code", selectEmpPoints.get(0).getContainer_name());
task.put("point_code1", selectEmpPoints.get(0).getPoint_code());
task.put("vehicle_code2", PackageInfoIvtEnum.AGV_ACTION_TYPE.code("普通任务"));
task.put("point_code2", gzqPackageinfoivtList.get(0).getPoint_code());
gzqTask.createTask(task);
} else {
log.info("待检区->装箱区任务正在创建被锁住。");
}
} finally {
if (lock.isLocked() && lock.isHeldByCurrentThread()) {
lock.unlock();
}
}
}
}

View File

@@ -67,7 +67,7 @@ public enum IOSEnum {
)),
//仓库id
STOR_ID(MapOf.of("二期", "1582991156504039455")),
STOR_ID(MapOf.of("印尼仓库", "1582991156504039424")),
//仓位锁定类型
LOCK_OPERATE(MapOf.of("入库锁定", "1","入库取消","2")),
@@ -79,7 +79,7 @@ public enum IOSEnum {
SECT_TYPE(MapOf.of("主存区", "00","暂存区","01","虚拟区","09")),
//库区
SECT_ID(MapOf.of("二期主存区", "1748219897940414464")),
SECT_ID(MapOf.of("印尼主存区", "2026561243103498240")),
//库存变动类型
IVT_CHANGE(MapOf.of("加待入", "31","加库存","33","减待入","32","加冻结","11","减冻结","12","减库存","21")),

View File

@@ -1676,11 +1676,11 @@ public class StIvtIostorinvOutServiceImpl extends ServiceImpl<StIvtIostorinvOutM
String box_high = boxDao.getBox_high();
if (Integer.parseInt(box_high) <= Integer.parseInt(heightLevel1)) {
height = "'1','2','3'";
height = "1,2,3";
} else if (Integer.parseInt(box_high) > Integer.parseInt(heightLevel1) && Integer.parseInt(box_high) <= Integer.parseInt(heightLevel2)) {
height = "'2','3'";
height = "2,3";
} else {
height = "'3'";
height = "3";
}
moveParam.put("height", height);
moveParam.put("vehicle_type", boxDao.getVehicle_type());
@@ -1812,11 +1812,11 @@ public class StIvtIostorinvOutServiceImpl extends ServiceImpl<StIvtIostorinvOutM
String box_high = boxDao.getBox_high();
if (Integer.parseInt(box_high) <= Integer.parseInt(heightLevel1)) {
height = "'1','2','3'";
height = "1,2,3";
} else if (Integer.parseInt(box_high) > Integer.parseInt(heightLevel1) && Integer.parseInt(box_high) <= Integer.parseInt(heightLevel2)) {
height = "'2','3'";
height = "2,3";
} else {
height = "'3'";
height = "3";
}
moveParam.put("height", height);
moveParam.put("vehicle_type", boxDao.getVehicle_type());

View File

@@ -366,11 +366,11 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
String heightLevel2 = iSysParamService.findByCode("height_level_2").getValue();
String box_high = "3";
if (Integer.parseInt(box_high) <= Integer.parseInt(heightLevel1)) {
height = "'1','2','3'";
height = "1,2,3";
} else if (Integer.parseInt(box_high) > Integer.parseInt(heightLevel1) && Integer.parseInt(box_high) <= Integer.parseInt(heightLevel2)) {
height = "'2','3'";
height = "2,3";
} else {
height = "'3'";
height = "3";
}
attrParam.put("height", height);
StIvtSectattr stIvtSectattr = stIvtSectattrMapper.selectOne(new QueryWrapper<StIvtSectattr>().eq("sect_id", jsonObject.getString("sect_id")));

View File

@@ -263,7 +263,7 @@ public class InBussManageServiceImpl implements InBussManageService {
}
// 主表
JSONObject mst = new JSONObject();
mst.put("stor_id", IOSEnum.STOR_ID.code("二期"));
mst.put("stor_id", IOSEnum.STOR_ID.code("印尼仓库"));
mst.put("bill_status", IOSEnum.BILL_STATUS.code("生成"));
mst.put("total_qty", pdmBiSubpackagerelations.stream().map(row -> Double.valueOf(row.getNet_weight())).reduce(Double::sum).orElse(0.00));
mst.put("detail_count", pdmBiSubpackagerelations.size());
@@ -338,8 +338,8 @@ public class InBussManageServiceImpl implements InBussManageService {
jsonDiv.put("checked", true);
jsonDiv.put("is_send", IOSEnum.IS_SEND.code(""));
jsonDiv.put("point_code", jsonObject.getString("device_code"));
jsonDiv.put("sect_id", IOSEnum.SECT_ID.code("二期主存区"));
jsonDiv.put("stor_id", IOSEnum.STOR_ID.code("二期"));
jsonDiv.put("sect_id", IOSEnum.SECT_ID.code("印尼主存区"));
jsonDiv.put("stor_id", IOSEnum.STOR_ID.code("印尼仓库"));
jsonDiv.put("material_barcode", jsonObject.getString("material_barcode"));
jsonDiv.put("vehicle_code", jsonObject.getString("vehicle_code"));
jsonDiv.put("vehicle_type", jsonObject.getString("vehicleType"));

View File

@@ -469,11 +469,11 @@ public class OutBussManageServiceImpl implements OutBussManageService {
String box_high = boxDao.getBox_high();
if (Integer.parseInt(box_high) <= Integer.parseInt(heightLevel1)) {
height = "'1','2','3'";
height = "1,2,3";
} else if (Integer.parseInt(box_high) > Integer.parseInt(heightLevel1) && Integer.parseInt(box_high) <= Integer.parseInt(heightLevel2)) {
height = "'2','3'";
height = "2,3";
} else {
height = "'3'";
height = "3";
}
moveParam.put("height", height);
moveParam.put("vehicle_type", boxDao.getVehicle_type());
@@ -649,11 +649,11 @@ public class OutBussManageServiceImpl implements OutBussManageService {
String box_high = boxDao.getBox_high();
if (Integer.parseInt(box_high) <= Integer.parseInt(heightLevel1)) {
height = "'1','2','3'";
height = "1,2,3";
} else if (Integer.parseInt(box_high) > Integer.parseInt(heightLevel1) && Integer.parseInt(box_high) <= Integer.parseInt(heightLevel2)) {
height = "'2','3'";
height = "2,3";
} else {
height = "'3'";
height = "3";
}
moveParam.put("height", height);
moveParam.put("vehicle_type", boxDao.getVehicle_type());
@@ -783,11 +783,11 @@ public class OutBussManageServiceImpl implements OutBussManageService {
String box_high = boxDao.getBox_high();
if (Integer.parseInt(box_high) <= Integer.parseInt(heightLevel1)) {
height = "'1','2','3'";
height = "1,2,3";
} else if (Integer.parseInt(box_high) > Integer.parseInt(heightLevel1) && Integer.parseInt(box_high) <= Integer.parseInt(heightLevel2)) {
height = "'2','3'";
height = "2,3";
} else {
height = "'3'";
height = "3";
}
moveParam.put("height", height);
@@ -898,11 +898,11 @@ public class OutBussManageServiceImpl implements OutBussManageService {
String box_high = boxDao.getBox_high();
if (Integer.parseInt(box_high) <= Integer.parseInt(heightLevel1)) {
height = "'1','2','3'";
height = "1,2,3";
} else if (Integer.parseInt(box_high) > Integer.parseInt(heightLevel1) && Integer.parseInt(box_high) <= Integer.parseInt(heightLevel2)) {
height = "'2','3'";
height = "2,3";
} else {
height = "'3'";
height = "3";
}
moveParam.put("height", height);

View File

@@ -21,8 +21,8 @@ public class Init implements ApplicationRunner {
@Override
public void run(ApplicationArguments args) throws Exception {
// initTwoAttr(4,30,3,2, "2");
// createAttr();
// initTwoAttr2(1,10,2, 2, 1, 2);
createAttr();
initTwoAttr2(1,10,2, 2, 1, 2);
}
@@ -69,8 +69,8 @@ public class Init implements ApplicationRunner {
String struct_code = "L" + row + "-" + col_num + "-" + layer_num + "";
JSONObject jsonObject = tab2.query("stor_id = '1582991156504039455'").uniqueResult(0);
JSONObject jsonObjec2 = tab3.query("stor_id = '1582991156504039455' and sect_code = 'BZC01'").uniqueResult(0);
JSONObject jsonObject = tab2.query("stor_id = '1582991156504039424'").uniqueResult(0);
JSONObject jsonObjec2 = tab3.query("stor_id = '1582991156504039424' and sect_code = 'NC02'").uniqueResult(0);
// 新增仓位
json.put("sect_id", jsonObjec2.getString("sect_id"));
@@ -286,8 +286,8 @@ public class Init implements ApplicationRunner {
json.put("struct_code", "91-"+i+"-01");
json.put("struct_name", "91排"+i+"列-01层");
}
JSONObject jsonObject = tab2.query("stor_id = '1597073830499717138'").uniqueResult(0);
JSONObject jsonObjec2 = tab3.query("stor_id = '1597073830499717138' and sect_code = 'XN91'").uniqueResult(0);
JSONObject jsonObject = tab2.query("stor_id = '1582991156504039424'").uniqueResult(0);
JSONObject jsonObjec2 = tab3.query("stor_id = '1582991156504039424' and sect_code = 'NC02'").uniqueResult(0);
// 新增仓位
json.put("simple_name", json.getString("struct_name"));

View File

@@ -161,7 +161,10 @@ public class FeedingServiceImpl implements FeedingService {
public JSONObject handleConfirm(JSONObject form) {
JSONObject json = form.getJSONObject("raw_jo");
String next_point_code = json.getString("point_code");
String container_name = json.getString("container_name");
String container_name = json.getString("parent_container_name");
if (StrUtil.isEmpty(container_name)){
container_name = json.getString("restruct_container_name");
}
StIvtCutpointivt cut_jo = stIvtCutpointivtMapper.selectOne(new LambdaQueryWrapper<StIvtCutpointivt>().eq(StIvtCutpointivt::getPoint_code, next_point_code));
if (ObjectUtil.isEmpty(cut_jo)) {
throw new BadRequestException("找不到分切机:" + next_point_code + "的点位!");

View File

@@ -312,7 +312,7 @@ public class CoolCutTask extends AbstractAcsTask {
coolPointIvtMapper.updateById(jsonCoolIvt);
//更新母卷状态
RawfoilWorkOrder rawfoilWorkOrder = rawfoilWorkOrderMapper.selectOne(new LambdaQueryWrapper<RawfoilWorkOrder>().eq(RawfoilWorkOrder::getContainer_name, schBaseTask.getMaterial_code()));
RawfoilWorkOrder rawfoilWorkOrder = rawfoilWorkOrderMapper.selectOne(new LambdaQueryWrapper<RawfoilWorkOrder>().eq(RawfoilWorkOrder::getContainer_name, schBaseTask.getVehicle_code()));
rawfoilWorkOrder.setOrigin("3");
rawfoilWorkOrder.setRoll_status("3");
rawfoilWorkOrder.setUpdate_optid(currentUserId);

View File

@@ -43,9 +43,9 @@ spring:
reset-enable: false
filters:
DruidFilter,stat
url: jdbc:mysql://localhost:3306/ynhl_lms?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
url: jdbc:mysql://192.168.81.251:3306/yinni_lms?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
username: root
password: password
password: P@ssw0rd.
slave:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
@@ -84,9 +84,9 @@ spring:
reset-enable: false
filters:
DruidFilter,stat
url: jdbc:mysql://127.0.0.1:3306/ynhl_lms?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
url: jdbc:mysql://192.168.81.251:3306/yinni_lms?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
username: root
password: password
password: P@ssw0rd.
rules:
readwrite-splitting:
data-sources: