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 4c762e6..073b926 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,8 +1,10 @@ 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 com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import lombok.extern.slf4j.Slf4j; import org.nl.common.exception.BadRequestException; import org.nl.wms.database.material.service.IMdBaseMaterialService; @@ -12,15 +14,20 @@ import org.nl.wms.pda.service.dao.mapper.PdaMapper; import org.nl.wms.pda.service.dao.vo.PdaResponseVo; import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService; import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup; +import org.nl.wms.sch.material.service.dao.Material; +import org.nl.wms.sch.material.service.dao.mapper.MaterialMapper; import org.nl.wms.sch.point.service.ISchBasePointService; import org.nl.wms.sch.point.service.dao.SchBasePoint; import org.nl.wms.sch.task.service.ISchBaseTaskService; import org.nl.wms.sch.task_manage.GeneralDefinition; import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum; +import org.nl.wms.sch.task_manage.task.tasks.mapper.PointMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; +import java.util.List; + /** * @Author: lyd * @Description: 实现类 @@ -42,6 +49,10 @@ public class PdaServiceImpl implements PdaService { private ISchBaseTaskService taskService; @Autowired private AcsToWmsService acsToWmsService; + @Autowired + private PointMapper pointMapper; + @Autowired + private MaterialMapper materialMapper; @Override public PdaResponseVo dwzt(JSONObject param) { @@ -78,9 +89,50 @@ public class PdaServiceImpl implements PdaService { @Override public PdaResponseVo zpjb(JSONObject param) { - param.put("request_medthod_code", "PONITTask"); - param.put("request_medthod_name", "点对点任务"); - acsToWmsService.acsApply(param); + String subTray=param.getString("sub_tray"); + String motherTray=param.getString("mother_tray"); + //母盘解绑 + if(ObjectUtil.isNotEmpty(subTray)){ + SchBaseVehiclematerialgroup one = vehiclematerialgroupService.getOne(new LambdaQueryWrapper() + .eq(SchBaseVehiclematerialgroup::getVehicle_code, subTray) + .eq(SchBaseVehiclematerialgroup::getGroup_bind_material_status, + GroupBindMaterialStatusEnum.BOUND.getValue())); + if (ObjectUtil.isNotEmpty(one)) { + one.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue()); + one.setUpdate_time(DateUtil.now()); + vehiclematerialgroupService.updateById(one); + } + List schBasePointList= pointMapper.selectList(new LambdaQueryWrapper() + .eq(SchBasePoint::getVehicle_code, subTray)); + for(SchBasePoint schBasePoint:schBasePointList){ + schBasePoint.setVehicle_code(""); + schBasePoint.setVehicle_qty(0); + pointService.update(schBasePoint); + } + } + //子盘解绑 + if(ObjectUtil.isNotEmpty(motherTray)){ + SchBaseVehiclematerialgroup one = vehiclematerialgroupService.getOne(new LambdaQueryWrapper() + .eq(SchBaseVehiclematerialgroup::getVehicle_code, motherTray) + .eq(SchBaseVehiclematerialgroup::getGroup_bind_material_status, + GroupBindMaterialStatusEnum.BOUND.getValue())); + if (ObjectUtil.isNotEmpty(one)) { + one.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue()); + one.setUpdate_time(DateUtil.now()); + vehiclematerialgroupService.updateById(one); + } + List schBasePointList= pointMapper.selectList(new LambdaQueryWrapper() + .eq(SchBasePoint::getVehicle_code, motherTray)); + for(SchBasePoint schBasePoint:schBasePointList){ + schBasePoint.setVehicle_code2(""); + pointService.update(schBasePoint); + } + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.eq("palletSN",motherTray); + updateWrapper.set("group_bind_material_status",GroupBindMaterialStatusEnum.UNBOUND.getValue()); + materialMapper.update(null,updateWrapper); + + } return PdaResponseVo.pdaResultOk("组盘解绑成功"); } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/POINTTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/POINTTask.java index 6962348..45365f1 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/POINTTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/POINTTask.java @@ -145,7 +145,7 @@ public class POINTTask extends AbstractTask { one = vehiclematerialgroupService.getOne(new LambdaQueryWrapper() .eq(SchBaseVehiclematerialgroup::getVehicle_code, vehicleCode2) .eq(SchBaseVehiclematerialgroup::getGroup_bind_material_status, - GroupBindMaterialStatusEnum.UNBOUND.getValue())); + GroupBindMaterialStatusEnum.BOUND.getValue())); if (ObjectUtil.isNotEmpty(one)) { // throw new BadRequestException(vehicleCode + " => " + startPointObj.getVehicle_type() + "的组盘信息未找到"); // } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/mapper/PointMapper.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/mapper/PointMapper.java index fe5b8e1..c1b7ffa 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/mapper/PointMapper.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/mapper/PointMapper.java @@ -1,6 +1,6 @@ package org.nl.wms.sch.task_manage.task.tasks.mapper; -import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.nl.wms.sch.point.service.dao.SchBasePoint; import java.util.List; @@ -10,7 +10,7 @@ import java.util.List; * @Description: * @Date: 2023/10/9 */ -public interface PointMapper { +public interface PointMapper extends BaseMapper { List findPointByRegion(String regionCode,String point_status); List findPointByParentPoint(String pointCode);