diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java index 302de7b..9658f1b 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java @@ -1,6 +1,7 @@ package org.nl.wms.pda.service.impl; import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import lombok.extern.slf4j.Slf4j; @@ -78,19 +79,21 @@ public class PdaServiceImpl implements PdaService { .eq(SchBaseVehiclematerialgroup::getVehicle_code, vehicleCode) .eq(SchBaseVehiclematerialgroup::getGroup_bind_material_status, GroupBindMaterialStatusEnum.BOUND.getValue())); - groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue()); - groupEntity.setUpdate_id(GeneralDefinition.ACS_ID); - groupEntity.setUpdate_name(GeneralDefinition.ACS_NAME); - groupEntity.setUpdate_time(DateUtil.now()); - vehiclematerialgroupService.update(groupEntity); - SchBasePoint pointObj=pointService.getById(groupEntity.getPoint_code()); - if(pointObj.getVehicle_code().contains(",")){ - vehicleCode+=','; + if(ObjectUtil.isNotEmpty(groupEntity)) { + groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue()); + groupEntity.setUpdate_id(GeneralDefinition.ACS_ID); + groupEntity.setUpdate_name(GeneralDefinition.ACS_NAME); + groupEntity.setUpdate_time(DateUtil.now()); + vehiclematerialgroupService.update(groupEntity); + SchBasePoint pointObj = pointService.getById(groupEntity.getPoint_code()); + if (pointObj.getVehicle_code().contains(",")) { + vehicleCode += ','; + } + pointObj.setVehicle_code(pointObj.getVehicle_code().replace(vehicleCode, "")); + pointObj.setVehicle_qty(pointObj.getVehicle_qty() - 1); + pointService.update(pointObj); + //清空组盘表的信息 } - pointObj.setVehicle_code(pointObj.getVehicle_code().replace(vehicleCode,"")); - pointObj.setVehicle_qty(pointObj.getVehicle_qty()-1); - pointService.update(pointObj); - //清空组盘表的信息 return PdaResponseVo.pdaResultOk("清空物料信息请求成功"); } @Override