Compare commits

...

3 Commits

Author SHA1 Message Date
4f88619e05 opt: 修复8 2025-11-03 19:24:40 +08:00
895914bd91 opt: 修复7 2025-11-03 19:10:22 +08:00
596e807cba opt: 修复6 2025-11-03 18:51:03 +08:00
7 changed files with 44 additions and 32 deletions

View File

@@ -117,7 +117,7 @@
</select>
<select id="queryAll" resultType="com.alibaba.fastjson.JSONObject">
SELECT
SELECT DISTINCT
ext.group_id as storagevehicleext_id,
ext.storagevehicle_code,
ext.pcsn,

View File

@@ -223,7 +223,7 @@ public class MesToWmsServiceImpl implements MesToWmsService {
)
.le(SchBaseTask::getTask_status, TaskStatus.EXECUTING.getCode()));
if (CollectionUtils.isNotEmpty(schBaseTaskList)) {
throw new BadRequestException("存在正在执行的点位,请核对!");
throw new BadRequestException("该点位存在正在执行的任务,请核对!");
}
MdMeMaterialbase materialbase = materialbaseService.getByCode(groupPlate.getMaterial_code(), false);
@@ -348,7 +348,7 @@ public class MesToWmsServiceImpl implements MesToWmsService {
)
.le(SchBaseTask::getTask_status, TaskStatus.EXECUTING.getCode()));
if (CollectionUtils.isNotEmpty(schBaseTaskList)) {
throw new BadRequestException("存在正在执行的点位,请核对!");
throw new BadRequestException("该点位存在正在执行的任务,请核对!");
}
MdMeMaterialbase materialbase = materialbaseService.getByCode(groupPlate.getMaterial_code(), false);
@@ -482,7 +482,7 @@ public class MesToWmsServiceImpl implements MesToWmsService {
MdPbStoragevehicleinfo mdPbStoragevehicleinfo = iMdPbStoragevehicleinfoService.getByCode(point.getVehicle_code());
if (mdPbStoragevehicleinfo == null) {
throw new BadRequestException("机台" + dto.getDevice_code() + "没有载具的载具!");
throw new BadRequestException("机台" + dto.getDevice_code() + "上的载具不存在");
}
//通过料桶号的料桶类型,匹配确认入库库区
@@ -505,10 +505,10 @@ public class MesToWmsServiceImpl implements MesToWmsService {
} else {
param.put("create_mode", IOSEnum.CREATE_MODE.code("外部接口产生"));
}
//退料
param.put("ext_task_code", dto.getTask_code());
if ("1".equals(dto.getTask_type())) {
//查询组盘
GroupPlate groupPlate = iMdPbGroupplateService.getOne(new LambdaQueryWrapper<GroupPlate>()
.eq(GroupPlate::getStoragevehicle_code, point.getVehicle_code())

View File

@@ -694,7 +694,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
)
.le(SchBaseTask::getTask_status, TaskStatus.EXECUTING.getCode()));
if (CollectionUtils.isNotEmpty(schBaseTaskList)) {
throw new BadRequestException("存在正在执行的点位,请核对!");
throw new BadRequestException("该点位存在正在执行的任务,请核对!");
}

View File

@@ -380,7 +380,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
)
.le(SchBaseTask::getTask_status, TaskStatus.EXECUTING.getCode()));
if (CollectionUtils.isNotEmpty(schBaseTaskList)) {
throw new BadRequestException("存在正在执行的点位,请核对!");
throw new BadRequestException("该点位存在正在执行的任务,请核对!");
}
List<SchBasePoint> schBasePointList = iSchBasePointService.list(new LambdaQueryWrapper<SchBasePoint>()
.eq(SchBasePoint::getPoint_code, whereJson.getString("point_code"))
@@ -419,7 +419,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
)
.le(SchBaseTask::getTask_status, TaskStatus.EXECUTING.getCode()));
if (CollectionUtils.isNotEmpty(schBaseTaskList)) {
throw new BadRequestException("存在正在执行的点位,请核对!");
throw new BadRequestException("该点位存在正在执行的任务,请核对!");
}
iSchBasePointService.update(new LambdaUpdateWrapper<SchBasePoint>()

View File

@@ -224,8 +224,6 @@ public class DownEmptyUpFullTask extends AbstractTask {
}
outBillService.taskFinish(taskObj);
//点位2
pointService.update(new LambdaUpdateWrapper<SchBasePoint>()
.set(SchBasePoint::getVehicle_code, null)
@@ -275,9 +273,11 @@ public class DownEmptyUpFullTask extends AbstractTask {
// //删除
// iMdPbGroupplateService.delete(Collections.singleton(taskObj.getGroup_id()));
iMdPbGroupplateService.update(new LambdaUpdateWrapper<>(GroupPlate.class)
.set(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库"))
.eq(GroupPlate::getStoragevehicle_code,taskObj.getVehicle_code()));
outBillService.taskFinish(taskObj);
// iMdPbGroupplateService.update(new LambdaUpdateWrapper<>(GroupPlate.class)
// .set(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库"))
// .eq(GroupPlate::getStoragevehicle_code,taskObj.getVehicle_code()));
//反馈到MES系统

View File

@@ -175,7 +175,6 @@ public class SeparateMaterialTask extends AbstractTask {
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
taskObj.setRemark("已完成");
taskService.updateById(taskObj);
outBillService.taskFinish(taskObj);
List<GroupPlate> groupPlates = iMdPbGroupplateService.list(new QueryWrapper<GroupPlate>().lambda()
.eq(GroupPlate::getStoragevehicle_code, taskObj.getVehicle_code())
@@ -202,9 +201,11 @@ public class SeparateMaterialTask extends AbstractTask {
.set(Structattr::getUpdate_time, DateUtil.now())
.eq(Structattr::getStruct_code, taskObj.getPoint_code1()));
iMdPbGroupplateService.update(new LambdaUpdateWrapper<>(GroupPlate.class)
.set(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库"))
.eq(GroupPlate::getStoragevehicle_code,taskObj.getVehicle_code()));
// iMdPbGroupplateService.update(new LambdaUpdateWrapper<>(GroupPlate.class)
// .set(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库"))
// .eq(GroupPlate::getStoragevehicle_code,taskObj.getVehicle_code()));
outBillService.taskFinish(taskObj);
// //删除
// iMdPbGroupplateService.delete(Collections.singleton(taskObj.getGroup_id()));

View File

@@ -18,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.List;
/**
@@ -170,15 +171,17 @@ public class UpdateIvtUtils {
*/
private void updateAddFrozenIvt(JSONObject where) {
// 找当前托盘物料库存
GroupPlate extDao = iMdPbGroupPlateService.getOne(
List<GroupPlate> extDaos = iMdPbGroupPlateService.list(
new QueryWrapper<GroupPlate>().lambda()
.eq(GroupPlate::getStoragevehicle_code, where.getString("storagevehicle_code"))
.eq(GroupPlate::getMaterial_id, where.getString("material_id"))
.eq(GroupPlate::getPcsn, where.getString("pcsn"))
.orderByDesc(GroupPlate::getCreate_time)
);
if (ObjectUtil.isEmpty(extDao)) {
if (extDaos.size() == 0) {
throw new BadRequestException("当前载具【" + where.getString("storagevehicle_code") + "】不存在相关物料批次库存,请检查数据!");
}
GroupPlate extDao = extDaos.get(0);
// 减可用数
double canuse_qty = NumberUtil.sub(extDao.getQty(), where.getDoubleValue("change_qty")).doubleValue();
if (canuse_qty < 0) {
@@ -202,15 +205,17 @@ public class UpdateIvtUtils {
*/
private void updateSubFrozenIvt(JSONObject where) {
// 找当前托盘物料库存
GroupPlate extDao = iMdPbGroupPlateService.getOne(
List<GroupPlate> extDaos = iMdPbGroupPlateService.list(
new QueryWrapper<GroupPlate>().lambda()
.eq(GroupPlate::getStoragevehicle_code, where.getString("storagevehicle_code"))
.eq(GroupPlate::getMaterial_id, where.getString("material_id"))
.eq(GroupPlate::getPcsn, where.getString("pcsn"))
.orderByDesc(GroupPlate::getCreate_time)
);
if (ObjectUtil.isEmpty(extDao)) {
throw new BadRequestException("当前载具【" + extDao.getStoragevehicle_code() + "】不存在相关物料批次库存,请检查数据!");
if (extDaos.size() == 0) {
throw new BadRequestException("当前载具【" + where.getString("storagevehicle_code") + "】不存在相关物料批次库存,请检查数据!");
}
GroupPlate extDao = extDaos.get(0);
// 减冻结
double frozen_qty = NumberUtil.sub(extDao.getFrozen_qty(), where.getDoubleValue("change_qty")).doubleValue();
@@ -237,15 +242,17 @@ public class UpdateIvtUtils {
*/
private void updateSubFrozenAddIvt(JSONObject where) {
// 找当前托盘物料库存
GroupPlate extDao = iMdPbGroupPlateService.getOne(
List<GroupPlate> extDaos = iMdPbGroupPlateService.list(
new QueryWrapper<GroupPlate>().lambda()
.eq(GroupPlate::getStoragevehicle_code, where.getString("storagevehicle_code"))
.eq(GroupPlate::getMaterial_id, where.getString("material_id"))
.eq(GroupPlate::getPcsn, where.getString("pcsn")).eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库"))
.eq(GroupPlate::getPcsn, where.getString("pcsn"))
.orderByDesc(GroupPlate::getCreate_time)
);
if (ObjectUtil.isEmpty(extDao)) {
throw new BadRequestException("当前载具【" + extDao.getStoragevehicle_code() + "】不存在相关物料批次库存,请检查数据!");
if (extDaos.size() == 0) {
throw new BadRequestException("当前载具【" + where.getString("storagevehicle_code") + "】不存在相关物料批次库存,请检查数据!");
}
GroupPlate extDao = extDaos.get(0);
// 减冻结
double qty = NumberUtil.sub(extDao.getQty(), extDao.getFrozen_qty()).doubleValue();
if (qty < 0) {
@@ -267,15 +274,17 @@ public class UpdateIvtUtils {
* @param where 输入参数
*/
private void updateAddCanuseIvt(JSONObject where) {
GroupPlate extDao = iMdPbGroupPlateService.getOne(
List<GroupPlate> extDaos = iMdPbGroupPlateService.list(
new QueryWrapper<GroupPlate>().lambda()
.eq(GroupPlate::getStoragevehicle_code, where.getString("storagevehicle_code"))
.eq(GroupPlate::getMaterial_id, where.getString("material_id"))
.eq(GroupPlate::getPcsn, where.getString("pcsn"))
.orderByDesc(GroupPlate::getCreate_time)
);
if (ObjectUtil.isEmpty(extDao)) {
throw new BadRequestException("当前载具【" + extDao.getStoragevehicle_code() + "】不存在相关物料批次库存,请检查数据!");
if (extDaos.size() == 0) {
throw new BadRequestException("当前载具【" + where.getString("storagevehicle_code") + "】不存在相关物料批次库存,请检查数据!");
}
GroupPlate extDao = extDaos.get(0);
double canuse_qty = NumberUtil.add(extDao.getQty(), where.getDoubleValue("change_qty")).doubleValue();
extDao.setQty(BigDecimal.valueOf(canuse_qty));
extDao.setUpdate_id(SecurityUtils.getCurrentUserId());
@@ -291,15 +300,17 @@ public class UpdateIvtUtils {
* @param where 输入参数
*/
private void updateSubCanuseIvt(JSONObject where) {
GroupPlate extDao = iMdPbGroupPlateService.getOne(
List<GroupPlate> extDaos = iMdPbGroupPlateService.list(
new QueryWrapper<GroupPlate>().lambda()
.eq(GroupPlate::getStoragevehicle_code, where.getString("storagevehicle_code"))
.eq(GroupPlate::getMaterial_id, where.getString("material_id"))
.eq(GroupPlate::getPcsn, where.getString("pcsn"))
.orderByDesc(GroupPlate::getCreate_time)
);
if (ObjectUtil.isEmpty(extDao)) {
throw new BadRequestException("当前载具【" + extDao.getStoragevehicle_code() + "】不存在相关物料批次库存,请检查数据!");
if (extDaos.size() == 0) {
throw new BadRequestException("当前载具【" + where.getString("storagevehicle_code") + "】不存在相关物料批次库存,请检查数据!");
}
GroupPlate extDao = extDaos.get(0);
double canuse_qty = NumberUtil.sub(extDao.getQty(), where.getDoubleValue("change_qty")).doubleValue();
if (canuse_qty < 0) {
throw new BadRequestException("可用数不能为负数,请检查变动数量!当前可用数为【" + extDao.getQty() + "】当前变动数为【" + where.getDoubleValue("change_qty") + "");