fix:空木箱入库校验优化

This commit is contained in:
zhouz
2024-07-29 11:14:34 +08:00
parent 970e6c3cd2
commit 991292e727
5 changed files with 20 additions and 30 deletions

View File

@@ -111,6 +111,7 @@ public class BstIvtBoxinfoServiceImpl extends ServiceImpl<BstIvtBoxinfoMapper, B
boxDao.setBox_high(whereJson.getString("Height"));
boxDao.setBox_length(whereJson.getString("Length"));
boxDao.setBox_width(whereJson.getString("Width"));
boxDao.setVehicle_type(vehicle_type);
this.updateById(boxDao);
}
@@ -130,7 +131,6 @@ public class BstIvtBoxinfoServiceImpl extends ServiceImpl<BstIvtBoxinfoMapper, B
@Override
public JSONObject saveBoxInfo(JSONObject jsonObject) {
//从MES获取包装关系
lmsToMesService.momGetPackingInfo(jsonObject);
String boxNo = jsonObject.getString("box_no");
String box_weight = jsonObject.getString("box_weight");
BstIvtBoxinfo boxinfo = bstIvtBoxinfoMapper.selectOne(new LambdaQueryWrapper<BstIvtBoxinfo>().eq(BstIvtBoxinfo::getBox_no, boxNo));
@@ -146,6 +146,7 @@ public class BstIvtBoxinfoServiceImpl extends ServiceImpl<BstIvtBoxinfoMapper, B
@Override
public BstIvtBoxinfo getBoxInfo(JSONObject jsonObject) {
lmsToMesService.momGetPackingInfo(jsonObject);
String boxNo = jsonObject.getString("box_no");
BstIvtBoxinfo boxinfo = bstIvtBoxinfoMapper.selectOne(new LambdaQueryWrapper<BstIvtBoxinfo>().eq(BstIvtBoxinfo::getBox_no, boxNo));
if (boxinfo == null) {

View File

@@ -176,19 +176,6 @@ public class InBoxManageServiceImpl implements InBoxManageService {
@Transactional
public void boxBinVehicle(JSONObject whereJson) {
/*
* 查询mes木箱信息插入木箱信息表
*/
// TODO 调用mes接口
JSONObject mesBoxInfo = new JSONObject();
// 插入木箱信息表
/*
* 插入木箱对应载具表
*/
IschBasePointService pointService = SpringContextHolder.getBean(IschBasePointService.class);
SchBasePoint point = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getPoint_code, whereJson.getString("point_code")));
if (ObjectUtil.isEmpty(point)) {
@@ -206,6 +193,7 @@ public class InBoxManageServiceImpl implements InBoxManageService {
String boxNO = split[i];
JSONObject jo = new JSONObject();
jo.put("box_no", boxNO);
//调用MES接口插入或更新木箱信息
lmsToMesService.momGetPackingInfo(jo);
}
@@ -214,6 +202,9 @@ public class InBoxManageServiceImpl implements InBoxManageService {
BstIvtBoxinfo boxinfo = iBstIvtBoxinfoService.getOne(
new QueryWrapper<BstIvtBoxinfo>().lambda()
.eq(BstIvtBoxinfo::getBox_no, boxNo));
if (ObjectUtil.isEmpty(boxinfo.getBox_weight()) || Integer.parseInt(boxinfo.getBox_weight()) == 0) {
throw new BadRequestException("请先维护木箱重量后进行入库!");
}
if (StrUtil.isEmpty(boxType)) {
boxType = boxinfo.getMaterial_code();
} else {
@@ -224,7 +215,6 @@ public class InBoxManageServiceImpl implements InBoxManageService {
}
//查询对应的木箱信息
// 查询木箱信息
BstIvtBoxinfo boxDao = iBstIvtBoxinfoService.getOne(
new QueryWrapper<BstIvtBoxinfo>().lambda()
@@ -234,8 +224,6 @@ public class InBoxManageServiceImpl implements InBoxManageService {
throw new BadRequestException("木箱不存在!");
}
// 下发桁架任务
//查询当前入库拆叠盘位的托盘类型是否一致如果一致
String vehicle_type = boxDao.getVehicle_type();
@@ -549,7 +537,7 @@ public class InBoxManageServiceImpl implements InBoxManageService {
"AND storagevehicle_type = '" + jsonParam.getString("vehicle_type") + "'" +
"AND height = '" + jsonParam.getString("height") + "'" +
"AND lock_type = '" + IOSEnum.LOCK_TYPE.code("未锁定") + "' AND stor_id = '" + jsonParam.getString("stor_id") + "' " +
"AND sect_id = '" + jsonParam.getString("sect_id") + "' AND block_num = '"+block_num+"'").getResultJSONArray(0);
"AND sect_id = '" + jsonParam.getString("sect_id") + "' AND block_num = '" + block_num + "'").getResultJSONArray(0);
}
if (ObjectUtil.isEmpty(structArray)) {

View File

@@ -374,6 +374,15 @@ public class BakingServiceImpl implements BakingService {
//判断区域是否属于B1B1的出烘箱流程出到对应的半成品区
if ("B1".equals(product_area)) {
JSONObject jsonRaw = rawTab.query("container_name = '" + jsonHotIvt.getString("container_name") + "' and is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonRaw)) {
throw new BadRequestException("未查询到母卷号:" + jsonHotIvt.getString("container_name") + "对应的生箔工单!");
}
JSONObject jsonMater = materTab.query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonMater)) {
throw new BadRequestException("物料基础信息中无此物料!");
}
//查询当前点位为空且没有任务的桁架内缓存点
JSONObject cache_param = new JSONObject();
cache_param.put("flag", "4");
@@ -390,15 +399,6 @@ public class BakingServiceImpl implements BakingService {
OutHotTask outHotTask = new OutHotTask();
String task_id = outHotTask.createTask(param);
JSONObject jsonRaw = rawTab.query("container_name = '" + jsonHotIvt.getString("container_name") + "' and is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonRaw)) {
throw new BadRequestException("未查询到母卷号:" + jsonHotIvt.getString("container_name") + "对应的生箔工单!");
}
JSONObject jsonMater = materTab.query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonMater)) {
throw new BadRequestException("物料基础信息中无此物料!");
}
//查询该母卷对应最近的一条入烘箱记录
JSONObject last_hot_mst = WQLObject.getWQLObject("ST_IVT_HotRegionIOMst").query("container_name = '" + jsonHotIvt.getString("container_name") + "' AND io_type = '0' order by confirm_time desc").uniqueResult(0);

View File

@@ -325,8 +325,9 @@ public class FeedingServiceImpl implements FeedingService {
task.createTask(jo);
} else {
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("full_point_code = '" + next_point_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(cut_jo) && ObjectUtil.isEmpty(cool_jo)) {
throw new BadRequestException("目的点不存在!");
JSONObject next_cool_jo = WQLObject.getWQLObject("st_ivt_coolpointivt").query("full_point_code = '" + next_point_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(cut_jo) && ObjectUtil.isEmpty(next_cool_jo)) {
throw new BadRequestException("请扫描分切机满轴点位或分切缓存位满轴点位做为终点!");
}
JSONObject task_jo = new JSONObject();
task_jo.put("point_code1", cool_jo.getString("point_code"));

View File

@@ -61,7 +61,7 @@ public class ComPareUtil {
double current_weight = NumberUtil.sub(jsonObject.getDoubleValue("weight"), vehicle_weight);
double box_weight = sub.getBox_weight().doubleValue();
double weight_sys = Double.parseDouble(SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("weight_sys").getValue());
double weight_sys = Double.parseDouble(SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("weight_sys2").getValue());
boolean compaer_result = true;
if (!(NumberUtil.sub(box_weight, weight_sys) <= current_weight && NumberUtil.add(box_weight, weight_sys) >= current_weight)) {