|
@ -225,8 +225,8 @@ public class PdaIosOutServiceImpl implements PdaIosOutService { |
|
|
JSONObject taskForm = new JSONObject(); |
|
|
JSONObject taskForm = new JSONObject(); |
|
|
taskForm.put("task_type", "STOutTask"); |
|
|
taskForm.put("task_type", "STOutTask"); |
|
|
taskForm.put("TaskCode", CodeUtil.getNewCode("TASK_CODE")); |
|
|
taskForm.put("TaskCode", CodeUtil.getNewCode("TASK_CODE")); |
|
|
taskForm.put("PickingLocation", json.getString("struct_code")); |
|
|
taskForm.put("point_code1", json.getString("struct_code")); |
|
|
taskForm.put("PlacedLocation", whereJson.getString("siteCode")); |
|
|
taskForm.put("point_code2", whereJson.getString("siteCode")); |
|
|
taskForm.put("vehicle_code", json.getString("storagevehicle_code")); |
|
|
taskForm.put("vehicle_code", json.getString("storagevehicle_code")); |
|
|
StOutTask stOutTask = SpringContextHolder.getBean("STOutTask"); |
|
|
StOutTask stOutTask = SpringContextHolder.getBean("STOutTask"); |
|
|
String taskId = stOutTask.create(taskForm); |
|
|
String taskId = stOutTask.create(taskForm); |
|
@ -246,48 +246,33 @@ public class PdaIosOutServiceImpl implements PdaIosOutService { |
|
|
@Override |
|
|
@Override |
|
|
@Transactional |
|
|
@Transactional |
|
|
public PdaResponse callMaterialConfirm(JSONObject whereJson) { |
|
|
public PdaResponse callMaterialConfirm(JSONObject whereJson) { |
|
|
//创建出库单/明细/分配
|
|
|
JSONObject json = whereJson.getJSONObject("obj"); |
|
|
GroupPlate plateDao = mdPbGroupplateMapper.selectOne( |
|
|
SchBasePoint schBasePoint = iSchBasePointService.getOne(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getPoint_code, whereJson.getString("siteCode"))); |
|
|
new LambdaQueryWrapper<GroupPlate>() |
|
|
if (ObjectUtil.isEmpty(schBasePoint)) { |
|
|
.eq(GroupPlate::getGroup_id, whereJson.getString("group_id"))); |
|
|
throw new BadRequestException("未找到目标:" + whereJson.getString("siteCode") + "的点位信息,请检查"); |
|
|
Structattr sectDao = iStructattrService.getOne(new LambdaQueryWrapper<Structattr>() |
|
|
} |
|
|
.eq(Structattr::getStruct_code, whereJson.getString("struct_code"))); |
|
|
|
|
|
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getById(plateDao.getMaterial_id()); |
|
|
|
|
|
whereJson.put("material_id", materDao.getMaterial_id()); |
|
|
|
|
|
whereJson.put("material_code", materDao.getMaterial_code()); |
|
|
|
|
|
whereJson.put("store_id", sectDao.getStor_id()); |
|
|
|
|
|
whereJson.put("store_code", sectDao.getStor_code()); |
|
|
|
|
|
whereJson.put("store_name", sectDao.getStor_name()); |
|
|
|
|
|
whereJson.put("sec", sectDao.getSect_id()); |
|
|
|
|
|
whereJson.put("qty", plateDao.getQty()); |
|
|
|
|
|
whereJson.put("pcsn", plateDao.getPcsn()); |
|
|
|
|
|
whereJson.put("unit_id", plateDao.getQty_unit_id()); |
|
|
|
|
|
whereJson.put("unit_name", plateDao.getQty_unit_name()); |
|
|
|
|
|
//创建出库单据
|
|
|
|
|
|
String disId = createOutBills(whereJson); |
|
|
|
|
|
//锁定货位
|
|
|
//锁定货位
|
|
|
JSONObject lock_map = new JSONObject(); |
|
|
// JSONObject lock_map = new JSONObject();
|
|
|
lock_map.put("struct_code", whereJson.getString("struct_code")); |
|
|
// lock_map.put("struct_code", json.getString("struct_code"));
|
|
|
lock_map.put("lock_type", IOSEnum.LOCK_TYPE.code("出库锁")); |
|
|
// lock_map.put("lock_type", IOSEnum.LOCK_TYPE.code("出库锁"));
|
|
|
iStructattrService.updateStatusByCode("0", lock_map); |
|
|
// iStructattrService.updateStatusByCode("0", lock_map);
|
|
|
//创建任务
|
|
|
//创建任务
|
|
|
JSONObject taskForm = new JSONObject(); |
|
|
JSONObject taskForm = new JSONObject(); |
|
|
taskForm.put("task_type", "STOutTask"); |
|
|
taskForm.put("task_type", IOSConstant.PDA_POINT_TASK); |
|
|
|
|
|
taskForm.put("config_code", IOSConstant.PDA_POINT_TASK); |
|
|
taskForm.put("TaskCode", CodeUtil.getNewCode("TASK_CODE")); |
|
|
taskForm.put("TaskCode", CodeUtil.getNewCode("TASK_CODE")); |
|
|
taskForm.put("PickingLocation", whereJson.getString("struct_code")); |
|
|
taskForm.put("point_code1", json.getString("struct_code")); |
|
|
taskForm.put("PlacedLocation", whereJson.getString("siteCode")); |
|
|
taskForm.put("point_code2", whereJson.getString("siteCode")); |
|
|
taskForm.put("vehicle_code", whereJson.getString("storagevehicle_code")); |
|
|
taskForm.put("vehicle_code", json.getString("storagevehicle_code")); |
|
|
StOutTask stOutTask = SpringContextHolder.getBean("STOutTask"); |
|
|
PdaPointTask pdaPointTask = SpringContextHolder.getBean("PdaPointTask"); |
|
|
String taskId = stOutTask.create(taskForm); |
|
|
pdaPointTask.create(taskForm); |
|
|
//更新任务id
|
|
|
GroupPlate plateDao = mdPbGroupplateMapper.selectOne( |
|
|
ioStorInvDisMapper.update(new IOStorInvDis(), new LambdaUpdateWrapper<IOStorInvDis>() |
|
|
new LambdaQueryWrapper<GroupPlate>() |
|
|
.set(IOStorInvDis::getTask_id, taskId) |
|
|
.eq(GroupPlate::getStoragevehicle_code, json.getString("storagevehicle_code")).eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库"))); |
|
|
.eq(IOStorInvDis::getIostorinvdis_id, disId) |
|
|
|
|
|
); |
|
|
|
|
|
//更新组盘记录表
|
|
|
//更新组盘记录表
|
|
|
mdPbGroupplateMapper.update(new GroupPlate(), new LambdaUpdateWrapper<>(GroupPlate.class) |
|
|
mdPbGroupplateMapper.update(new GroupPlate(), new LambdaUpdateWrapper<>(GroupPlate.class) |
|
|
.set(GroupPlate::getFrozen_qty, plateDao.getQty()) |
|
|
.set(GroupPlate::getFrozen_qty, plateDao.getQty()) |
|
|
.eq(GroupPlate::getGroup_id, whereJson.getString("group_id")) |
|
|
.eq(GroupPlate::getGroup_id, json.getString("group_id")) |
|
|
); |
|
|
); |
|
|
return PdaResponse.requestOk(); |
|
|
return PdaResponse.requestOk(); |
|
|
} |
|
|
} |
|
@ -342,8 +327,8 @@ public class PdaIosOutServiceImpl implements PdaIosOutService { |
|
|
taskForm.put("task_type", IOSConstant.VEHICLE_OUT_TASK); |
|
|
taskForm.put("task_type", IOSConstant.VEHICLE_OUT_TASK); |
|
|
taskForm.put("config_code", IOSConstant.VEHICLE_OUT_TASK); |
|
|
taskForm.put("config_code", IOSConstant.VEHICLE_OUT_TASK); |
|
|
taskForm.put("TaskCode", CodeUtil.getNewCode("TASK_CODE")); |
|
|
taskForm.put("TaskCode", CodeUtil.getNewCode("TASK_CODE")); |
|
|
taskForm.put("PickingLocation", r.getStruct_code()); |
|
|
taskForm.put("point_code1", r.getStruct_code()); |
|
|
taskForm.put("PlacedLocation", whereJson.getString("siteCode")); |
|
|
taskForm.put("point_code2", whereJson.getString("siteCode")); |
|
|
taskForm.put("vehicle_code", r.getStoragevehicle_code()); |
|
|
taskForm.put("vehicle_code", r.getStoragevehicle_code()); |
|
|
applyTaskMap.get(IOSConstant.VEHICLE_OUT_TASK).create(taskForm); |
|
|
applyTaskMap.get(IOSConstant.VEHICLE_OUT_TASK).create(taskForm); |
|
|
}); |
|
|
}); |
|
@ -462,15 +447,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService { |
|
|
} |
|
|
} |
|
|
LambdaUpdateWrapper<SchBasePoint> wrapper = new LambdaUpdateWrapper<>(); |
|
|
LambdaUpdateWrapper<SchBasePoint> wrapper = new LambdaUpdateWrapper<>(); |
|
|
if (IOSEnum.BIND_OR_UNBIND.code("绑定").equals(whereJson.getString("mode"))) { |
|
|
if (IOSEnum.BIND_OR_UNBIND.code("绑定").equals(whereJson.getString("mode"))) { |
|
|
if (StringUtils.isNotBlank(sitePoint.getVehicle_code())) { |
|
|
//查询组盘信息
|
|
|
throw new BadRequestException("当前站点已绑定货架:" + sitePoint.getVehicle_code() + ",请先解绑:" + sitePoint.getVehicle_code()); |
|
|
|
|
|
} |
|
|
|
|
|
//校验是否在其他站点绑定
|
|
|
|
|
|
SchBasePoint shelfPoint = iSchBasePointService.getOne(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getVehicle_code, whereJson.getString("shelfCode"))); |
|
|
|
|
|
if (shelfPoint != null) { |
|
|
|
|
|
throw new BadRequestException("当前货架已绑定在站点:" + sitePoint.getPoint_code() + ",请先解绑。"); |
|
|
|
|
|
} |
|
|
|
|
|
//绑定库存
|
|
|
|
|
|
GroupPlate plateDao = mdPbGroupplateMapper.selectOne( |
|
|
GroupPlate plateDao = mdPbGroupplateMapper.selectOne( |
|
|
new LambdaQueryWrapper<GroupPlate>() |
|
|
new LambdaQueryWrapper<GroupPlate>() |
|
|
.eq(GroupPlate::getStoragevehicle_code, whereJson.getString("shelfCode")).eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("组盘"))); |
|
|
.eq(GroupPlate::getStoragevehicle_code, whereJson.getString("shelfCode")).eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("组盘"))); |
|
@ -478,11 +455,23 @@ public class PdaIosOutServiceImpl implements PdaIosOutService { |
|
|
plateDao.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("入库")); |
|
|
plateDao.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("入库")); |
|
|
mdPbGroupplateMapper.updateById(plateDao); |
|
|
mdPbGroupplateMapper.updateById(plateDao); |
|
|
} |
|
|
} |
|
|
|
|
|
if (StringUtils.isNotBlank(sitePoint.getVehicle_code())) { |
|
|
|
|
|
if (sitePoint.getVehicle_code().equals(whereJson.getString("shelfCode"))) { |
|
|
|
|
|
return PdaResponse.requestOk(); |
|
|
|
|
|
} else { |
|
|
|
|
|
throw new BadRequestException("当前站点已绑定货架:" + sitePoint.getVehicle_type() + "请先解绑,再绑定!"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
//校验是否在其他站点绑定
|
|
|
|
|
|
SchBasePoint shelfPoint = iSchBasePointService.getOne(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getVehicle_code, whereJson.getString("shelfCode"))); |
|
|
|
|
|
if (shelfPoint != null) { |
|
|
|
|
|
throw new BadRequestException("当前货架:" + whereJson.getString("shelfCode") + "已绑定在站点:" + shelfPoint.getPoint_code() + ",请先输入地面站点号:" + shelfPoint.getPoint_code() + ",进行解绑,再绑定。"); |
|
|
|
|
|
} |
|
|
wrapper.set(SchBasePoint::getVehicle_code, whereJson.getString("shelfCode")) |
|
|
wrapper.set(SchBasePoint::getVehicle_code, whereJson.getString("shelfCode")) |
|
|
.set(SchBasePoint::getPoint_status, IOSEnum.POINT_STATUS.code("有货")) |
|
|
.set(SchBasePoint::getPoint_status, IOSEnum.POINT_STATUS.code("有货")) |
|
|
.eq(SchBasePoint::getPoint_code, whereJson.getString("siteCode")); |
|
|
.eq(SchBasePoint::getPoint_code, whereJson.getString("siteCode")); |
|
|
} else { |
|
|
} else { |
|
|
if (StringUtils.isNotBlank(sitePoint.getParent_point_code())) { |
|
|
if (!"0".equals(sitePoint.getParent_point_code())) { |
|
|
List<SchBasePoint> sitePointList = iSchBasePointService.list(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getParent_point_code, sitePoint.getParent_point_code()).eq(SchBasePoint::getIs_used, true)); |
|
|
List<SchBasePoint> sitePointList = iSchBasePointService.list(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getParent_point_code, sitePoint.getParent_point_code()).eq(SchBasePoint::getIs_used, true)); |
|
|
wrapper.in(SchBasePoint::getPoint_code, sitePointList); |
|
|
wrapper.in(SchBasePoint::getPoint_code, sitePointList); |
|
|
} else { |
|
|
} else { |
|
@ -515,6 +504,9 @@ public class PdaIosOutServiceImpl implements PdaIosOutService { |
|
|
throw new BadRequestException("未找到载具所在的点位信息,请检查"); |
|
|
throw new BadRequestException("未找到载具所在的点位信息,请检查"); |
|
|
} |
|
|
} |
|
|
GroupPlate groupPlate = mdPbGroupplateMapper.selectById(whereJson.getString("group_id")); |
|
|
GroupPlate groupPlate = mdPbGroupplateMapper.selectById(whereJson.getString("group_id")); |
|
|
|
|
|
if (ObjectUtil.isEmpty(groupPlate)) { |
|
|
|
|
|
throw new BadRequestException("未找到该载具的组盘信息,请检查"); |
|
|
|
|
|
} |
|
|
if (groupPlate.getFrozen_qty().compareTo(BigDecimal.ZERO) == 0 || groupPlate.getQty().compareTo(BigDecimal.ZERO) == 0) { |
|
|
if (groupPlate.getFrozen_qty().compareTo(BigDecimal.ZERO) == 0 || groupPlate.getQty().compareTo(BigDecimal.ZERO) == 0) { |
|
|
throw new BadRequestException("该载具已出库确认,无需再次操作!"); |
|
|
throw new BadRequestException("该载具已出库确认,无需再次操作!"); |
|
|
} |
|
|
} |
|
@ -567,12 +559,13 @@ public class PdaIosOutServiceImpl implements PdaIosOutService { |
|
|
pointCode = pointList.get(0).getPoint_code(); |
|
|
pointCode = pointList.get(0).getPoint_code(); |
|
|
} |
|
|
} |
|
|
//确定起点
|
|
|
//确定起点
|
|
|
SchBasePoint schBasePoint = iSchBasePointService.getOne(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getVehicle_code, whereJson.getString("vehicle_code"))); |
|
|
SchBasePoint schBasePoint = iSchBasePointService.getOne(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getVehicle_code, whereJson.getString("storagevehicle_code"))); |
|
|
if (ObjectUtil.isEmpty(schBasePoint)) { |
|
|
if (ObjectUtil.isEmpty(schBasePoint)) { |
|
|
throw new BadRequestException("未找到载具所在的点位信息,请检查"); |
|
|
throw new BadRequestException("未找到载具所在的点位信息,请检查"); |
|
|
} |
|
|
} |
|
|
// 生成转运任务
|
|
|
// 生成转运任务
|
|
|
JSONObject task = new JSONObject(); |
|
|
JSONObject task = new JSONObject(); |
|
|
|
|
|
task.put("task_type", IOSConstant.PDA_POINT_TASK); |
|
|
task.put("config_code", IOSConstant.PDA_POINT_TASK); |
|
|
task.put("config_code", IOSConstant.PDA_POINT_TASK); |
|
|
task.put("point_code1", schBasePoint.getPoint_code()); |
|
|
task.put("point_code1", schBasePoint.getPoint_code()); |
|
|
task.put("point_code2", pointCode); |
|
|
task.put("point_code2", pointCode); |
|
|