fix:空木箱入库校验优化
This commit is contained in:
@@ -111,6 +111,7 @@ public class BstIvtBoxinfoServiceImpl extends ServiceImpl<BstIvtBoxinfoMapper, B
|
|||||||
boxDao.setBox_high(whereJson.getString("Height"));
|
boxDao.setBox_high(whereJson.getString("Height"));
|
||||||
boxDao.setBox_length(whereJson.getString("Length"));
|
boxDao.setBox_length(whereJson.getString("Length"));
|
||||||
boxDao.setBox_width(whereJson.getString("Width"));
|
boxDao.setBox_width(whereJson.getString("Width"));
|
||||||
|
boxDao.setVehicle_type(vehicle_type);
|
||||||
this.updateById(boxDao);
|
this.updateById(boxDao);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,7 +131,6 @@ public class BstIvtBoxinfoServiceImpl extends ServiceImpl<BstIvtBoxinfoMapper, B
|
|||||||
@Override
|
@Override
|
||||||
public JSONObject saveBoxInfo(JSONObject jsonObject) {
|
public JSONObject saveBoxInfo(JSONObject jsonObject) {
|
||||||
//从MES获取包装关系
|
//从MES获取包装关系
|
||||||
lmsToMesService.momGetPackingInfo(jsonObject);
|
|
||||||
String boxNo = jsonObject.getString("box_no");
|
String boxNo = jsonObject.getString("box_no");
|
||||||
String box_weight = jsonObject.getString("box_weight");
|
String box_weight = jsonObject.getString("box_weight");
|
||||||
BstIvtBoxinfo boxinfo = bstIvtBoxinfoMapper.selectOne(new LambdaQueryWrapper<BstIvtBoxinfo>().eq(BstIvtBoxinfo::getBox_no, boxNo));
|
BstIvtBoxinfo boxinfo = bstIvtBoxinfoMapper.selectOne(new LambdaQueryWrapper<BstIvtBoxinfo>().eq(BstIvtBoxinfo::getBox_no, boxNo));
|
||||||
@@ -146,6 +146,7 @@ public class BstIvtBoxinfoServiceImpl extends ServiceImpl<BstIvtBoxinfoMapper, B
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BstIvtBoxinfo getBoxInfo(JSONObject jsonObject) {
|
public BstIvtBoxinfo getBoxInfo(JSONObject jsonObject) {
|
||||||
|
lmsToMesService.momGetPackingInfo(jsonObject);
|
||||||
String boxNo = jsonObject.getString("box_no");
|
String boxNo = jsonObject.getString("box_no");
|
||||||
BstIvtBoxinfo boxinfo = bstIvtBoxinfoMapper.selectOne(new LambdaQueryWrapper<BstIvtBoxinfo>().eq(BstIvtBoxinfo::getBox_no, boxNo));
|
BstIvtBoxinfo boxinfo = bstIvtBoxinfoMapper.selectOne(new LambdaQueryWrapper<BstIvtBoxinfo>().eq(BstIvtBoxinfo::getBox_no, boxNo));
|
||||||
if (boxinfo == null) {
|
if (boxinfo == null) {
|
||||||
|
|||||||
@@ -176,19 +176,6 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
public void boxBinVehicle(JSONObject whereJson) {
|
public void boxBinVehicle(JSONObject whereJson) {
|
||||||
|
|
||||||
/*
|
|
||||||
* 查询mes木箱信息,插入木箱信息表
|
|
||||||
*/
|
|
||||||
// TODO 调用mes接口
|
|
||||||
JSONObject mesBoxInfo = new JSONObject();
|
|
||||||
|
|
||||||
// 插入木箱信息表
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 插入木箱对应载具表
|
|
||||||
*/
|
|
||||||
|
|
||||||
IschBasePointService pointService = SpringContextHolder.getBean(IschBasePointService.class);
|
IschBasePointService pointService = SpringContextHolder.getBean(IschBasePointService.class);
|
||||||
SchBasePoint point = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getPoint_code, whereJson.getString("point_code")));
|
SchBasePoint point = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getPoint_code, whereJson.getString("point_code")));
|
||||||
if (ObjectUtil.isEmpty(point)) {
|
if (ObjectUtil.isEmpty(point)) {
|
||||||
@@ -206,6 +193,7 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
|||||||
String boxNO = split[i];
|
String boxNO = split[i];
|
||||||
JSONObject jo = new JSONObject();
|
JSONObject jo = new JSONObject();
|
||||||
jo.put("box_no", boxNO);
|
jo.put("box_no", boxNO);
|
||||||
|
//调用MES接口插入或更新木箱信息
|
||||||
lmsToMesService.momGetPackingInfo(jo);
|
lmsToMesService.momGetPackingInfo(jo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,6 +202,9 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
|||||||
BstIvtBoxinfo boxinfo = iBstIvtBoxinfoService.getOne(
|
BstIvtBoxinfo boxinfo = iBstIvtBoxinfoService.getOne(
|
||||||
new QueryWrapper<BstIvtBoxinfo>().lambda()
|
new QueryWrapper<BstIvtBoxinfo>().lambda()
|
||||||
.eq(BstIvtBoxinfo::getBox_no, boxNo));
|
.eq(BstIvtBoxinfo::getBox_no, boxNo));
|
||||||
|
if (ObjectUtil.isEmpty(boxinfo.getBox_weight()) || Integer.parseInt(boxinfo.getBox_weight()) == 0) {
|
||||||
|
throw new BadRequestException("请先维护木箱重量后进行入库!");
|
||||||
|
}
|
||||||
if (StrUtil.isEmpty(boxType)) {
|
if (StrUtil.isEmpty(boxType)) {
|
||||||
boxType = boxinfo.getMaterial_code();
|
boxType = boxinfo.getMaterial_code();
|
||||||
} else {
|
} else {
|
||||||
@@ -224,7 +215,6 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//查询对应的木箱信息
|
|
||||||
// 查询木箱信息
|
// 查询木箱信息
|
||||||
BstIvtBoxinfo boxDao = iBstIvtBoxinfoService.getOne(
|
BstIvtBoxinfo boxDao = iBstIvtBoxinfoService.getOne(
|
||||||
new QueryWrapper<BstIvtBoxinfo>().lambda()
|
new QueryWrapper<BstIvtBoxinfo>().lambda()
|
||||||
@@ -234,8 +224,6 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
|||||||
throw new BadRequestException("木箱不存在!");
|
throw new BadRequestException("木箱不存在!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 下发桁架任务
|
|
||||||
|
|
||||||
//查询当前入库拆叠盘位的托盘类型是否一致如果一致
|
//查询当前入库拆叠盘位的托盘类型是否一致如果一致
|
||||||
String vehicle_type = boxDao.getVehicle_type();
|
String vehicle_type = boxDao.getVehicle_type();
|
||||||
|
|
||||||
@@ -549,7 +537,7 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
|||||||
"AND storagevehicle_type = '" + jsonParam.getString("vehicle_type") + "'" +
|
"AND storagevehicle_type = '" + jsonParam.getString("vehicle_type") + "'" +
|
||||||
"AND height = '" + jsonParam.getString("height") + "'" +
|
"AND height = '" + jsonParam.getString("height") + "'" +
|
||||||
"AND lock_type = '" + IOSEnum.LOCK_TYPE.code("未锁定") + "' AND stor_id = '" + jsonParam.getString("stor_id") + "' " +
|
"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)) {
|
if (ObjectUtil.isEmpty(structArray)) {
|
||||||
|
|||||||
@@ -374,6 +374,15 @@ public class BakingServiceImpl implements BakingService {
|
|||||||
|
|
||||||
//判断区域是否属于B1,B1的出烘箱流程出到对应的半成品区
|
//判断区域是否属于B1,B1的出烘箱流程出到对应的半成品区
|
||||||
if ("B1".equals(product_area)) {
|
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();
|
JSONObject cache_param = new JSONObject();
|
||||||
cache_param.put("flag", "4");
|
cache_param.put("flag", "4");
|
||||||
@@ -390,15 +399,6 @@ public class BakingServiceImpl implements BakingService {
|
|||||||
OutHotTask outHotTask = new OutHotTask();
|
OutHotTask outHotTask = new OutHotTask();
|
||||||
String task_id = outHotTask.createTask(param);
|
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);
|
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);
|
||||||
|
|
||||||
|
|||||||
@@ -325,8 +325,9 @@ public class FeedingServiceImpl implements FeedingService {
|
|||||||
task.createTask(jo);
|
task.createTask(jo);
|
||||||
} else {
|
} else {
|
||||||
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("full_point_code = '" + next_point_code + "'").uniqueResult(0);
|
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)) {
|
JSONObject next_cool_jo = WQLObject.getWQLObject("st_ivt_coolpointivt").query("full_point_code = '" + next_point_code + "'").uniqueResult(0);
|
||||||
throw new BadRequestException("目的点不存在!");
|
if (ObjectUtil.isEmpty(cut_jo) && ObjectUtil.isEmpty(next_cool_jo)) {
|
||||||
|
throw new BadRequestException("请扫描分切机满轴点位或分切缓存位满轴点位做为终点!");
|
||||||
}
|
}
|
||||||
JSONObject task_jo = new JSONObject();
|
JSONObject task_jo = new JSONObject();
|
||||||
task_jo.put("point_code1", cool_jo.getString("point_code"));
|
task_jo.put("point_code1", cool_jo.getString("point_code"));
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public class ComPareUtil {
|
|||||||
double current_weight = NumberUtil.sub(jsonObject.getDoubleValue("weight"), vehicle_weight);
|
double current_weight = NumberUtil.sub(jsonObject.getDoubleValue("weight"), vehicle_weight);
|
||||||
double box_weight = sub.getBox_weight().doubleValue();
|
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;
|
boolean compaer_result = true;
|
||||||
if (!(NumberUtil.sub(box_weight, weight_sys) <= current_weight && NumberUtil.add(box_weight, weight_sys) >= current_weight)) {
|
if (!(NumberUtil.sub(box_weight, weight_sys) <= current_weight && NumberUtil.add(box_weight, weight_sys) >= current_weight)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user