|
@ -1,6 +1,7 @@ |
|
|
package org.nl.wms.pda.service.impl; |
|
|
package org.nl.wms.pda.service.impl; |
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
|
|
import cn.hutool.core.lang.Assert; |
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
@ -20,6 +21,8 @@ import org.nl.wms.sch.material.service.dao.Material; |
|
|
import org.nl.wms.sch.material.service.dao.mapper.MaterialMapper; |
|
|
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.ISchBasePointService; |
|
|
import org.nl.wms.sch.point.service.dao.SchBasePoint; |
|
|
import org.nl.wms.sch.point.service.dao.SchBasePoint; |
|
|
|
|
|
import org.nl.wms.sch.task.service.ISchBaseTaskService; |
|
|
|
|
|
import org.nl.wms.sch.task.service.dao.SchBaseTask; |
|
|
import org.nl.wms.sch.task_manage.GeneralDefinition; |
|
|
import org.nl.wms.sch.task_manage.GeneralDefinition; |
|
|
import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum; |
|
|
import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum; |
|
|
import org.nl.wms.sch.task_manage.task.tasks.mapper.PointMapper; |
|
|
import org.nl.wms.sch.task_manage.task.tasks.mapper.PointMapper; |
|
@ -39,7 +42,7 @@ import java.util.List; |
|
|
@Lazy |
|
|
@Lazy |
|
|
public class PdaServiceImpl implements PdaService { |
|
|
public class PdaServiceImpl implements PdaService { |
|
|
@Autowired |
|
|
@Autowired |
|
|
private PdaMapper pdaMapper; |
|
|
private ISchBaseTaskService taskService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private ISchBasePointService pointService; |
|
|
private ISchBasePointService pointService; |
|
|
@Autowired |
|
|
@Autowired |
|
@ -116,16 +119,8 @@ public class PdaServiceImpl implements PdaService { |
|
|
PdaResponseVo result = new PdaResponseVo(); |
|
|
PdaResponseVo result = new PdaResponseVo(); |
|
|
String subTray = param.getString("sub_tray"); |
|
|
String subTray = param.getString("sub_tray"); |
|
|
subTray = subTray.trim(); |
|
|
subTray = subTray.trim(); |
|
|
if(ObjectUtil.isEmpty(subTray)){ |
|
|
|
|
|
result = PdaResponseVo.pdaResultError("子托盘号不能为空!"); |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
String motherTray = param.getString("mother_tray"); |
|
|
String motherTray = param.getString("mother_tray"); |
|
|
motherTray = motherTray.trim(); |
|
|
motherTray = motherTray.trim(); |
|
|
if(ObjectUtil.isEmpty(motherTray)){ |
|
|
|
|
|
result = PdaResponseVo.pdaResultError("母托盘号不能为空!"); |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
//子拖盘解绑
|
|
|
//子拖盘解绑
|
|
|
if(ObjectUtil.isNotEmpty(subTray)){ |
|
|
if(ObjectUtil.isNotEmpty(subTray)){ |
|
|
//查询母托盘
|
|
|
//查询母托盘
|
|
@ -188,45 +183,69 @@ public class PdaServiceImpl implements PdaService { |
|
|
new_sub_tray = new_sub_tray.trim(); |
|
|
new_sub_tray = new_sub_tray.trim(); |
|
|
if(ObjectUtil.isEmpty(new_sub_tray)){ |
|
|
if(ObjectUtil.isEmpty(new_sub_tray)){ |
|
|
result = PdaResponseVo.pdaResultError("新子托盘号不能为空!"); |
|
|
result = PdaResponseVo.pdaResultError("新子托盘号不能为空!"); |
|
|
}else{ |
|
|
return result; |
|
|
|
|
|
} |
|
|
List<Material> materialList = materialMapper.selectList(new LambdaQueryWrapper<Material>() |
|
|
List<Material> materialList = materialMapper.selectList(new LambdaQueryWrapper<Material>() |
|
|
.eq(Material::getPalletSN,new_sub_tray) |
|
|
.eq(Material::getPalletSN,new_sub_tray) |
|
|
.le(Material::getReturn_status, "1") |
|
|
.le(Material::getReturn_status, "1") |
|
|
.eq(Material::getGroup_bind_material_status, GroupBindMaterialStatusEnum.BOUND.getValue())); |
|
|
.eq(Material::getGroup_bind_material_status, GroupBindMaterialStatusEnum.BOUND.getValue())); |
|
|
if (ObjectUtil.isEmpty(materialList)) { |
|
|
if (ObjectUtil.isEmpty(materialList)) { |
|
|
result = PdaResponseVo.pdaResultError("新子托盘号无组盘入库单据信息!"); |
|
|
result = PdaResponseVo.pdaResultError("新子托盘号无组盘入库单据信息!"); |
|
|
}else{ |
|
|
return result; |
|
|
if(ObjectUtil.isEmpty(sub_tray)){ |
|
|
} |
|
|
result = PdaResponseVo.pdaResultError("原子托盘号不能为空!"); |
|
|
if(ObjectUtil.isEmpty(sub_tray)){ |
|
|
}else if (!sub_tray.startsWith("YBHC")){ |
|
|
result = PdaResponseVo.pdaResultError("原子托盘号不能为空!"); |
|
|
result = PdaResponseVo.pdaResultError("原子托盘号非缓存临时码!"); |
|
|
return result; |
|
|
}else{ |
|
|
} |
|
|
//更新点位载具
|
|
|
if(!sub_tray.startsWith("YBHC")){ |
|
|
LambdaUpdateWrapper<SchBasePoint> updateWrapper = new LambdaUpdateWrapper<>(); |
|
|
result = PdaResponseVo.pdaResultError("原子托盘号非缓存临时码YBHC开头!"); |
|
|
updateWrapper.eq(SchBasePoint::getVehicle_code2,sub_tray); |
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
//查询点位记录
|
|
|
|
|
|
LambdaQueryWrapper<SchBasePoint> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
queryWrapper.eq(SchBasePoint::getVehicle_code2,sub_tray); |
|
|
|
|
|
int countPoint = pointMapper.selectCount(queryWrapper); |
|
|
|
|
|
if(countPoint<=0){ |
|
|
|
|
|
result = PdaResponseVo.pdaResultError("原子托盘号未在系统点位仓位上!"); |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
//判断该子托盘是否存在未完成任务
|
|
|
|
|
|
Integer sub_tray_lists = taskService.findUnFinishTasksBySub_tray("",sub_tray); |
|
|
|
|
|
if(sub_tray_lists>0){ |
|
|
|
|
|
result = PdaResponseVo.pdaResultError("该任务申请子托盘[\"+sub_tray+\"]存在未完成的任务!"); |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
//查询组盘记录
|
|
|
|
|
|
LambdaQueryWrapper<SchBaseVehiclematerialgroup> queryWrapper_group = new LambdaQueryWrapper<>(); |
|
|
|
|
|
queryWrapper_group.eq(SchBaseVehiclematerialgroup::getVehicle_code,sub_tray); |
|
|
|
|
|
queryWrapper_group.le(SchBaseVehiclematerialgroup::getGroup_bind_material_status,"2"); |
|
|
|
|
|
int countGroup = vehiclematerialgroupMapper.selectCount(queryWrapper_group); |
|
|
|
|
|
if(countGroup<=0){ |
|
|
|
|
|
result = PdaResponseVo.pdaResultError("原子托盘号无已绑定的组盘记录!"); |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
//更新点位载具
|
|
|
|
|
|
LambdaUpdateWrapper<SchBasePoint> updateWrapper = new LambdaUpdateWrapper<>(); |
|
|
|
|
|
updateWrapper.eq(SchBasePoint::getVehicle_code2,sub_tray); |
|
|
|
|
|
|
|
|
updateWrapper.set(SchBasePoint::getVehicle_code2,new_sub_tray); |
|
|
updateWrapper.set(SchBasePoint::getVehicle_code2,new_sub_tray); |
|
|
updateWrapper.set(SchBasePoint::getUpdate_id,currentUserId); |
|
|
updateWrapper.set(SchBasePoint::getUpdate_id,currentUserId); |
|
|
updateWrapper.set(SchBasePoint::getUpdate_name,nickName); |
|
|
updateWrapper.set(SchBasePoint::getUpdate_name,nickName); |
|
|
updateWrapper.set(SchBasePoint::getUpdate_time,now); |
|
|
updateWrapper.set(SchBasePoint::getUpdate_time,now); |
|
|
pointMapper.update(null,updateWrapper); |
|
|
pointMapper.update(null,updateWrapper); |
|
|
|
|
|
|
|
|
//更新组盘载具
|
|
|
//更新组盘载具
|
|
|
LambdaUpdateWrapper<SchBaseVehiclematerialgroup> updateWrapper_group = new LambdaUpdateWrapper<>(); |
|
|
LambdaUpdateWrapper<SchBaseVehiclematerialgroup> updateWrapper_group = new LambdaUpdateWrapper<>(); |
|
|
updateWrapper_group.eq(SchBaseVehiclematerialgroup::getVehicle_code,sub_tray); |
|
|
updateWrapper_group.eq(SchBaseVehiclematerialgroup::getVehicle_code,sub_tray); |
|
|
updateWrapper_group.le(SchBaseVehiclematerialgroup::getGroup_bind_material_status,"2"); |
|
|
updateWrapper_group.le(SchBaseVehiclematerialgroup::getGroup_bind_material_status,"2"); |
|
|
|
|
|
|
|
|
updateWrapper_group.set(SchBaseVehiclematerialgroup::getVehicle_code,new_sub_tray); |
|
|
updateWrapper_group.set(SchBaseVehiclematerialgroup::getVehicle_code,new_sub_tray); |
|
|
updateWrapper_group.set(SchBaseVehiclematerialgroup::getSource_vehicle_code,sub_tray); |
|
|
updateWrapper_group.set(SchBaseVehiclematerialgroup::getSource_vehicle_code,sub_tray); |
|
|
updateWrapper_group.set(SchBaseVehiclematerialgroup::getUpdate_id,currentUserId); |
|
|
updateWrapper_group.set(SchBaseVehiclematerialgroup::getUpdate_id,currentUserId); |
|
|
updateWrapper_group.set(SchBaseVehiclematerialgroup::getUpdate_name,nickName); |
|
|
updateWrapper_group.set(SchBaseVehiclematerialgroup::getUpdate_name,nickName); |
|
|
updateWrapper_group.set(SchBaseVehiclematerialgroup::getUpdate_time,now); |
|
|
updateWrapper_group.set(SchBaseVehiclematerialgroup::getUpdate_time,now); |
|
|
vehiclematerialgroupMapper.update(null,updateWrapper_group); |
|
|
vehiclematerialgroupMapper.update(null,updateWrapper_group); |
|
|
result = PdaResponseVo.pdaResultOk("缓存码变更成功!"); |
|
|
result = PdaResponseVo.pdaResultOk("缓存码变更成功!"); |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|