|
|
@ -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<SchBaseVehiclematerialgroup>() |
|
|
|
.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<SchBasePoint> schBasePointList= pointMapper.selectList(new LambdaQueryWrapper<SchBasePoint>() |
|
|
|
.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<SchBaseVehiclematerialgroup>() |
|
|
|
.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<SchBasePoint> schBasePointList= pointMapper.selectList(new LambdaQueryWrapper<SchBasePoint>() |
|
|
|
.eq(SchBasePoint::getVehicle_code, motherTray)); |
|
|
|
for(SchBasePoint schBasePoint:schBasePointList){ |
|
|
|
schBasePoint.setVehicle_code2(""); |
|
|
|
pointService.update(schBasePoint); |
|
|
|
} |
|
|
|
UpdateWrapper<Material> updateWrapper = new UpdateWrapper<>(); |
|
|
|
updateWrapper.eq("palletSN",motherTray); |
|
|
|
updateWrapper.set("group_bind_material_status",GroupBindMaterialStatusEnum.UNBOUND.getValue()); |
|
|
|
materialMapper.update(null,updateWrapper); |
|
|
|
|
|
|
|
} |
|
|
|
return PdaResponseVo.pdaResultOk("组盘解绑成功"); |
|
|
|
} |
|
|
|
} |
|
|
|