|
@ -158,12 +158,23 @@ public class PdaIosInServiceImpl implements PdaIosInService { |
|
|
public PdaResponse groupPlate(JSONObject whereJson) { |
|
|
public PdaResponse groupPlate(JSONObject whereJson) { |
|
|
// 校验载具
|
|
|
// 校验载具
|
|
|
MdPbStoragevehicleinfo vehicleDao = iMdPbStoragevehicleinfoService.getByCode(whereJson.getString("storagevehicle_code")); |
|
|
MdPbStoragevehicleinfo vehicleDao = iMdPbStoragevehicleinfoService.getByCode(whereJson.getString("storagevehicle_code")); |
|
|
|
|
|
// 校验此载具是否有入库状态的组盘信息
|
|
|
|
|
|
boolean is_in = iMdPbGroupplateService.list( |
|
|
|
|
|
new QueryWrapper<GroupPlate>().lambda() |
|
|
|
|
|
.eq(GroupPlate::getStoragevehicle_code, vehicleDao.getStoragevehicle_code()) |
|
|
|
|
|
).stream() |
|
|
|
|
|
.anyMatch(row -> row.getStatus().equals(IOSEnum.GROUP_PLATE_STATUS.code("入库"))); |
|
|
|
|
|
if (is_in) { |
|
|
|
|
|
throw new BadRequestException("当前载具已经入库,请检查数据!【"+whereJson.getString("storagevehicle_code")+"】"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 校验组盘记录
|
|
|
// 校验组盘记录
|
|
|
GroupPlate groupDao = iMdPbGroupplateService.getById(whereJson.getString("group_id")); |
|
|
GroupPlate groupDao = iMdPbGroupplateService.getById(whereJson.getString("group_id")); |
|
|
if (!groupDao.getStatus().equals(IOSEnum.GROUP_PLATE_STATUS.code("生成"))) { |
|
|
if (!groupDao.getStatus().equals(IOSEnum.GROUP_PLATE_STATUS.code("生成"))) { |
|
|
throw new BadRequestException("当前组盘记录不为生成状态!【"+whereJson.getString("group_id")+"】"); |
|
|
throw new BadRequestException("当前信息已经组盘!【"+whereJson.getString("group_id")+"】"); |
|
|
} |
|
|
} |
|
|
// 校验组盘物料批次是否一样
|
|
|
|
|
|
|
|
|
// 校验组盘物料、批次、原单据号、原单据类型是否一样
|
|
|
List<GroupPlate> plateDaoList = iMdPbGroupplateService.list( |
|
|
List<GroupPlate> plateDaoList = iMdPbGroupplateService.list( |
|
|
new QueryWrapper<GroupPlate>().lambda() |
|
|
new QueryWrapper<GroupPlate>().lambda() |
|
|
.eq(GroupPlate::getStoragevehicle_code, whereJson.getString("storagevehicle_code")) |
|
|
.eq(GroupPlate::getStoragevehicle_code, whereJson.getString("storagevehicle_code")) |
|
@ -172,14 +183,16 @@ public class PdaIosInServiceImpl implements PdaIosInService { |
|
|
if (ObjectUtil.isNotEmpty(plateDaoList)) { |
|
|
if (ObjectUtil.isNotEmpty(plateDaoList)) { |
|
|
boolean is_like = plateDaoList.stream() |
|
|
boolean is_like = plateDaoList.stream() |
|
|
.allMatch(row -> row.getMaterial_id().equals(groupDao.getMaterial_id()) && |
|
|
.allMatch(row -> row.getMaterial_id().equals(groupDao.getMaterial_id()) && |
|
|
row.getPcsn().equals(groupDao.getPcsn()) |
|
|
row.getPcsn().equals(groupDao.getPcsn()) && |
|
|
|
|
|
row.getExt_code().equals(groupDao.getExt_code()) && |
|
|
|
|
|
row.getExt_type().equals(groupDao.getExt_type()) |
|
|
); |
|
|
); |
|
|
if (!is_like) { |
|
|
if (!is_like) { |
|
|
throw new BadRequestException("当前托盘所绑物料批次与当前组盘物料批次不一致!"); |
|
|
throw new BadRequestException("当前托盘所绑物料批次或者源单据与当前组盘物料批次不一致!"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 更新数据
|
|
|
// 更新数据组盘数据
|
|
|
groupDao.setStoragevehicle_code(vehicleDao.getStoragevehicle_code()); |
|
|
groupDao.setStoragevehicle_code(vehicleDao.getStoragevehicle_code()); |
|
|
groupDao.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("组盘")); |
|
|
groupDao.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("组盘")); |
|
|
iMdPbGroupplateService.updateById(groupDao); |
|
|
iMdPbGroupplateService.updateById(groupDao); |
|
@ -259,6 +272,9 @@ public class PdaIosInServiceImpl implements PdaIosInService { |
|
|
jsonMst.put("detail_count", 1); |
|
|
jsonMst.put("detail_count", 1); |
|
|
jsonMst.put("bill_type", IOSEnum.BILL_TYPE.code("生产入库")); |
|
|
jsonMst.put("bill_type", IOSEnum.BILL_TYPE.code("生产入库")); |
|
|
jsonMst.put("biz_date", DateUtil.now()); |
|
|
jsonMst.put("biz_date", DateUtil.now()); |
|
|
|
|
|
jsonMst.put("source_id", plateDaoList.get(0).getExt_code()); |
|
|
|
|
|
jsonMst.put("source_type", plateDaoList.get(0).getExt_type()); |
|
|
|
|
|
|
|
|
// 组织明细数据
|
|
|
// 组织明细数据
|
|
|
ArrayList<HashMap> tableData = new ArrayList<>(); |
|
|
ArrayList<HashMap> tableData = new ArrayList<>(); |
|
|
HashMap<String, String> dtl = new HashMap<>(); |
|
|
HashMap<String, String> dtl = new HashMap<>(); |
|
|