|
|
@ -92,13 +92,35 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
return pdaMapper.queryVehicleGroup(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<VehicleLinkVo> queryExistGroup() { |
|
|
|
List<VehicleLinkVo> vehicleLinkVoList = pdaMapper.queryExistGroup(); |
|
|
|
Iterator<VehicleLinkVo> iterator = vehicleLinkVoList.iterator(); |
|
|
|
while (iterator.hasNext()) { |
|
|
|
VehicleLinkVo vehicleLinkVo = iterator.next(); |
|
|
|
String point_code = vehicleLinkVo.getPoint_code(); |
|
|
|
SchBasePoint point = pointService.getById(point_code); |
|
|
|
if (ObjectUtil.isEmpty(point) || !point.getRegion_code().equals(RegionEnum.ZP.getRegion_code())) { |
|
|
|
iterator.remove(); |
|
|
|
} |
|
|
|
} |
|
|
|
return vehicleLinkVoList; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public PdaResponseVo manualCreateByPda(ManualGroupDto entity) { |
|
|
|
Assert.notNull(entity, "参数不能为空!"); |
|
|
|
SchBaseVehiclematerialgroup groupInfo = vehiclematerialgroupService.getGroupInfo(entity.getVehicle_code(), |
|
|
|
entity.getVehicle_type(), GroupBindMaterialStatusEnum.BOUND.getValue()); |
|
|
|
Assert.isFalse(ObjectUtil.isNotEmpty(groupInfo), "组盘信息已存在"); |
|
|
|
Assert.isFalse(ObjectUtil.isNotEmpty(groupInfo), "组盘信息(载具编码)已存在"); |
|
|
|
LambdaQueryWrapper<SchBaseVehiclematerialgroup> lqw = new LambdaQueryWrapper<>(); |
|
|
|
lqw.eq(SchBaseVehiclematerialgroup::getPoint_code, entity.getPoint_code()) |
|
|
|
.eq(SchBaseVehiclematerialgroup::getGroup_bind_material_status, GroupBindMaterialStatusEnum.BOUND.getValue()); |
|
|
|
SchBaseVehiclematerialgroup one = vehiclematerialgroupService.getOne(lqw); |
|
|
|
if (ObjectUtil.isNotEmpty(one)) { |
|
|
|
throw new BadRequestException("该点位已存在组盘信息!"); |
|
|
|
} |
|
|
|
// 获取点位
|
|
|
|
SchBasePoint basePoint = pointService.getById(entity.getPoint_code()); |
|
|
|
// 获取物料
|
|
|
@ -256,7 +278,7 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
.eq(SchBasePoint::getPoint_status, PointStatusEnum.EMPTY_POINT.getCode()); |
|
|
|
SchBasePoint point = pointService.getOne(lqw); |
|
|
|
if (ObjectUtil.isEmpty(point)) { |
|
|
|
throw new BadRequestException("点位:" + requestParam.getPoint_code() + "状态不为空位!"); |
|
|
|
throw new BadRequestException("点位:" + requestParam.getPoint_code() + "不存咋或点位状态不为空位!"); |
|
|
|
} |
|
|
|
if (!RegionEnum.ZP.getRegion_code().equals(point.getRegion_code())) { |
|
|
|
throw new BadRequestException("点位:" + requestParam.getPoint_code() + "不属于组盘区域,无法进行空托盘入库!"); |
|
|
@ -276,7 +298,9 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
@Override |
|
|
|
public List<VehicleLinkVo> queryLinkMaterial(MaterialQueryDto requestParam) { |
|
|
|
Assert.notNull(requestParam, "参数不能为空!"); |
|
|
|
Assert.notBlank(requestParam.getMaterial_id(), "物料ID不能为空!"); |
|
|
|
if (StrUtil.isEmpty(requestParam.getMaterial_id())) { |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
MdBaseMaterial material = materialService.getById(requestParam.getMaterial_id()); |
|
|
|
Assert.notNull(material, "物料信息有误!未查询出对应的物料信息,物料编码:" + requestParam.getMaterial_code()); |
|
|
|
LambdaQueryWrapper<SchBaseVehiclematerialgroup> lqw = new LambdaQueryWrapper<>(); |
|
|
@ -315,7 +339,11 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
Assert.notBlank(requestParam.getPoint_code1(), "起始点位不能为空!"); |
|
|
|
Assert.notNull(pointService.getById(requestParam.getPoint_code1()), requestParam.getPoint_code1() + ",对应的点位信息不存在!"); |
|
|
|
Assert.notBlank(requestParam.getPoint_code2(), "出库点位不能为空!"); |
|
|
|
Assert.notNull(pointService.getById(requestParam.getPoint_code2()), requestParam.getPoint_code2() + ",对应的点位信息不存在!"); |
|
|
|
SchBasePoint point2 = pointService.getById(requestParam.getPoint_code2()); |
|
|
|
Assert.notNull(point2, requestParam.getPoint_code2() + ",对应的点位信息不存在!"); |
|
|
|
if (!point2.getPoint_status().equals(PointStatusEnum.EMPTY_POINT.getCode())) { |
|
|
|
throw new BadRequestException("出库点位不为空位!"); |
|
|
|
} |
|
|
|
JSONObject param = new JSONObject(); |
|
|
|
param.put("device_code", requestParam.getPoint_code1()); |
|
|
|
param.put("device_code2", requestParam.getPoint_code2()); |
|
|
@ -339,11 +367,12 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
if (ObjectUtil.isEmpty(vehiclematerialgroup)) { |
|
|
|
return new VehicleLinkVo(); |
|
|
|
} |
|
|
|
MdBaseMaterial material = materialService.getById(vehiclematerialgroup.getMaterial_id()); |
|
|
|
VehicleLinkVo vo = new VehicleLinkVo(); |
|
|
|
vo.setPoint_code(vehiclematerialgroup.getPoint_code()); |
|
|
|
vo.setMaterial_id(vehiclematerialgroup.getMaterial_id()); |
|
|
|
vo.setMaterial_code(vehiclematerialgroup.getMaterial_code()); |
|
|
|
vo.setMaterial_name(vehiclematerialgroup.getMaterial_name()); |
|
|
|
vo.setMaterial_code(material.getMaterial_code()); |
|
|
|
vo.setMaterial_name(material.getMaterial_name()); |
|
|
|
vo.setPcsn(vehiclematerialgroup.getPcsn()); |
|
|
|
vo.setMaterial_qty(vehiclematerialgroup.getMaterial_qty()); |
|
|
|
return vo; |
|
|
@ -446,12 +475,19 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
@Override |
|
|
|
public List<PointVo> queryEndPointsByStart(FullVehicleOutDto requestParam) { |
|
|
|
Assert.notNull(requestParam, "请求参数不能为空!"); |
|
|
|
Assert.notBlank(requestParam.getPoint_code1(), "当前点位不能为空!"); |
|
|
|
if (StrUtil.isEmpty(requestParam.getPoint_code1())) { |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
//Assert.notBlank(requestParam.getPoint_code1(), "当前点位不能为空!");
|
|
|
|
SchBasePoint point = pointService.getById(requestParam.getPoint_code1()); |
|
|
|
Assert.notNull(point, requestParam.getPoint_code1() + "对应的点位信息不存在!"); |
|
|
|
if (ObjectUtil.isEmpty(point)) { |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
// Assert.notNull(point, requestParam.getPoint_code1() + "对应的点位信息不存在!");
|
|
|
|
List<String> regions = Arrays.asList(RegionEnum.ZP.getRegion_code(), RegionEnum.JLHC.getRegion_code(), RegionEnum.YCL.getRegion_code()); |
|
|
|
if (regions.contains(point.getRegion_code())) { |
|
|
|
throw new BadRequestException("当前点位信息有误,请检查该点位是否为任务流传所属区域!"); |
|
|
|
return new ArrayList<>(); |
|
|
|
//throw new BadRequestException("当前点位信息有误,请检查该点位是否为任务流传所属区域!");
|
|
|
|
} |
|
|
|
List<PointVo> list = new ArrayList<>(); |
|
|
|
if (StrUtil.isEmpty(point.getNext_point_code())) { |
|
|
@ -494,8 +530,8 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
.eq(SchBaseVehiclematerialgroup::getLink_status, LinkStatusEnum.LINK_FINISH.getType()); |
|
|
|
SchBaseVehiclematerialgroup vehiclematerialgroup = vehiclematerialgroupService.getOne(lqw); |
|
|
|
if (ObjectUtil.isNotEmpty(vehiclematerialgroup)) { |
|
|
|
vehiclematerialgroup.setPoint_code(null); |
|
|
|
vehiclematerialgroup.setPoint_name(null); |
|
|
|
vehiclematerialgroup.setPoint_code(""); |
|
|
|
vehiclematerialgroup.setPoint_name(""); |
|
|
|
vehiclematerialgroupService.update(vehiclematerialgroup); |
|
|
|
} |
|
|
|
SchBasePoint point = pointService.getById(requestParam.getPoint_code()); |
|
|
@ -530,6 +566,7 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
} |
|
|
|
point.setPoint_status(point_status); |
|
|
|
point.setVehicle_code(requestParam.getVehicle_code()); |
|
|
|
point.setVehicle_type(requestParam.getVehicle_type()); |
|
|
|
point.setVehicle_qty(1); |
|
|
|
pointService.update(point); |
|
|
|
return PdaResponseVo.pdaResultOk("绑定成功"); |
|
|
@ -589,6 +626,7 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
return PdaResponseVo.pdaResultOk("创建定点任务请求成功"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public List<PointVo> copyPointVoList(List<SchBasePoint> list) { |
|
|
|
List<PointVo> pointVoList = new ArrayList<>(); |
|
|
@ -696,7 +734,6 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
throw new BadRequestException("请选择需要设置静置的料盅!"); |
|
|
|
} |
|
|
|
SchBaseVehiclematerialgroup vehiclematerialgroup = vehiclematerialgroupService.getById(forcedRestingDto.getGroup_id()); |
|
|
|
vehiclematerialgroup.setStanding_time(forcedRestingDto.getStand_time()); |
|
|
|
vehiclematerialgroupService.updateById(vehiclematerialgroup); |
|
|
|
return PdaResponseVo.pdaResultOk("设置静置时长完成"); |
|
|
|
} |
|
|
|