fix: map sealed pallet cartons to physical pallet
This commit is contained in:
@@ -32,6 +32,10 @@ public interface LoadingPickItemMapper extends BaseMapper<LoadingPickItemEntity>
|
|||||||
AND label.inbound_id = plan_item.inbound_id
|
AND label.inbound_id = plan_item.inbound_id
|
||||||
AND label.inbound_detail_id = plan_item.inbound_detail_id
|
AND label.inbound_detail_id = plan_item.inbound_detail_id
|
||||||
AND label.batch_status = 'ACTIVE'
|
AND label.batch_status = 'ACTIVE'
|
||||||
|
AND (plan_item.unit_type <> 'SEALED_PALLET'
|
||||||
|
OR EXISTS (SELECT 1 FROM fl_dropship_pallet_carton pallet_carton
|
||||||
|
WHERE pallet_carton.pallet_id = plan_item.pallet_id
|
||||||
|
AND pallet_carton.carton_label_id = label.id))
|
||||||
WHERE pick_item.pick_task_id = #{taskId} AND plan_item.deleted = 0
|
WHERE pick_item.pick_task_id = #{taskId} AND plan_item.deleted = 0
|
||||||
ORDER BY pick_item.id, label.carton_index
|
ORDER BY pick_item.id, label.carton_index
|
||||||
""")
|
""")
|
||||||
|
|||||||
+13
@@ -73,6 +73,19 @@ class LoadingPickPdaTaskSqlContractTest {
|
|||||||
.contains("label.box_code AS boxCode");
|
.contains("label.box_code AS boxCode");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void sealedPalletCartonsAreRestrictedToTheirPhysicalPalletMembership() throws Exception {
|
||||||
|
String sql = LoadingPickItemMapper.class
|
||||||
|
.getDeclaredMethod("selectTaskCartonLabels", long.class)
|
||||||
|
.getAnnotation(Select.class).value()[0];
|
||||||
|
|
||||||
|
assertThat(sql)
|
||||||
|
.contains("plan_item.unit_type <> 'SEALED_PALLET'")
|
||||||
|
.contains("fl_dropship_pallet_carton pallet_carton")
|
||||||
|
.contains("pallet_carton.pallet_id = plan_item.pallet_id")
|
||||||
|
.contains("pallet_carton.carton_label_id = label.id");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void taskDetailResolvesOnlyTheActiveBookingOwnedByItsCurrentPlan() throws Exception {
|
void taskDetailResolvesOnlyTheActiveBookingOwnedByItsCurrentPlan() throws Exception {
|
||||||
String sql = LoadingPickTaskMapper.class
|
String sql = LoadingPickTaskMapper.class
|
||||||
|
|||||||
Reference in New Issue
Block a user