feat(库存查询报表): 增加筛选条件(库存大于0),增加排序

This commit is contained in:
faramita 2024-12-13 12:03:41 +08:00
parent 715309c01e
commit 6d74f1ae83
4 changed files with 18 additions and 10 deletions

View File

@ -172,4 +172,6 @@ public class InventoryQueryReportDto {
private String createTime;
private BigDecimal totalQty;
private boolean allowZero;
}

View File

@ -45,11 +45,11 @@ public class InventoryQueryReportServiceImpl implements InventoryQueryReportServ
String rollType = inventoryQueryReportDto.getRollType();
List<String> storageBinList = splitSearchField(inventoryQueryReportDto.getStorageBin());
List<String> storageLocationList = splitSearchField(inventoryQueryReportDto.getStorageLocation());
IPage<InventoryQueryReportDto> inventoryQueryReportDtoIPage = inventoryQueryReportMapper.retrieve(iPage, site, erpStorageLocationList, inventoryIdList, carrierList, statusList, itemList, batchNoList, vendorBatchNoList, qualityInspectionStatusList, inventorySpecialMarking, dnOrder, dnOrderSeq, rollType, storageBinList, storageLocationList);
boolean allowZero = inventoryQueryReportDto.isAllowZero();
IPage<InventoryQueryReportDto> inventoryQueryReportDtoIPage = inventoryQueryReportMapper.retrieve(iPage, site, erpStorageLocationList, inventoryIdList, carrierList, statusList, itemList, batchNoList, vendorBatchNoList, qualityInspectionStatusList, inventorySpecialMarking, dnOrder, dnOrderSeq, rollType, storageBinList, storageLocationList, allowZero);
if (CollectionUtil.isNotEmpty(inventoryQueryReportDtoIPage.getRecords())) {
BigDecimal totalQty = inventoryQueryReportMapper.retrieveTotalQty(site, erpStorageLocationList, inventoryIdList, carrierList, statusList, itemList, batchNoList, vendorBatchNoList, qualityInspectionStatusList, inventorySpecialMarking, dnOrder, dnOrderSeq, rollType, storageBinList, storageLocationList);
BigDecimal totalQty = inventoryQueryReportMapper.retrieveTotalQty(site, erpStorageLocationList, inventoryIdList, carrierList, statusList, itemList, batchNoList, vendorBatchNoList, qualityInspectionStatusList, inventorySpecialMarking, dnOrder, dnOrderSeq, rollType, storageBinList, storageLocationList, allowZero);
inventoryQueryReportDtoIPage.getRecords().get(0).setTotalQty(totalQty);
}
return inventoryQueryReportDtoIPage;
@ -77,9 +77,9 @@ public class InventoryQueryReportServiceImpl implements InventoryQueryReportServ
String rollType = inventoryQueryReportDto.getRollType();
List<String> storageBinList = splitSearchField(inventoryQueryReportDto.getStorageBin());
List<String> storageLocationList = splitSearchField(inventoryQueryReportDto.getStorageLocation());
boolean allowZero = inventoryQueryReportDto.isAllowZero();
List<InventoryQueryReportDto> inventoryQueryReportList = inventoryQueryReportMapper.retrieve(site, erpStorageLocationList, inventoryIdList, carrierList, statusList, itemList, batchNoList, vendorBatchNoList, qualityInspectionStatusList, inventorySpecialMarking, dnOrder, dnOrderSeq, rollType, storageBinList, storageLocationList);
List<InventoryQueryReportDto> inventoryQueryReportList = inventoryQueryReportMapper.retrieve(site, erpStorageLocationList, inventoryIdList, carrierList, statusList, itemList, batchNoList, vendorBatchNoList, qualityInspectionStatusList, inventorySpecialMarking, dnOrder, dnOrderSeq, rollType, storageBinList, storageLocationList, allowZero);
for (InventoryQueryReportDto record : inventoryQueryReportList) {
String state = record.getStatus();

View File

@ -23,11 +23,11 @@ import java.util.List;
*/
@Mapper
public interface InventoryQueryReportMapper extends BaseMapper<Inventory> {
IPage<InventoryQueryReportDto> retrieve(IPage<InventoryQueryReportDto> iPage, @Param("site") String site, @Param("erpStorageLocationList") List<String> erpStorageLocationList, @Param("inventoryIdList") List<String> inventoryIdList, @Param("carrierList") List<String> carrierList, @Param("statusList") List<String> statusList, @Param("itemList") List<String> itemList, @Param("batchNoList") List<String> batchNoList, @Param("vendorBatchNoList") List<String> vendorBatchNoList, @Param("qualityInspectionStatusList") List<String> qualityInspectionStatusList, @Param("inventorySpecialMarking") String inventorySpecialMarking, @Param("dnOrder") String dnOrder, @Param("dnOrderSeq") Integer dnOrderSeq, @Param("rollType") String rollType, @Param("storageBinList") List<String> storageBinList, @Param("storageLocationList") List<String> storageLocationList);
IPage<InventoryQueryReportDto> retrieve(IPage<InventoryQueryReportDto> iPage, @Param("site") String site, @Param("erpStorageLocationList") List<String> erpStorageLocationList, @Param("inventoryIdList") List<String> inventoryIdList, @Param("carrierList") List<String> carrierList, @Param("statusList") List<String> statusList, @Param("itemList") List<String> itemList, @Param("batchNoList") List<String> batchNoList, @Param("vendorBatchNoList") List<String> vendorBatchNoList, @Param("qualityInspectionStatusList") List<String> qualityInspectionStatusList, @Param("inventorySpecialMarking") String inventorySpecialMarking, @Param("dnOrder") String dnOrder, @Param("dnOrderSeq") Integer dnOrderSeq, @Param("rollType") String rollType, @Param("storageBinList") List<String> storageBinList, @Param("storageLocationList") List<String> storageLocationList, @Param("allowZero")boolean allowZero);
List<InventoryQueryReportDto> retrieve(@Param("site") String site, @Param("erpStorageLocationList") List<String> erpStorageLocationList, @Param("inventoryIdList") List<String> inventoryIdList, @Param("carrierList") List<String> carrierList, @Param("statusList") List<String> statusList, @Param("itemList") List<String> itemList, @Param("batchNoList") List<String> batchNoList, @Param("vendorBatchNoList") List<String> vendorBatchNoList, @Param("qualityInspectionStatusList") List<String> qualityInspectionStatusList, @Param("inventorySpecialMarking") String inventorySpecialMarking, @Param("dnOrder") String dnOrder, @Param("dnOrderSeq") Integer dnOrderSeq, @Param("rollType") String rollType, @Param("storageBinList") List<String> storageBinList, @Param("storageLocationList") List<String> storageLocationList);
List<InventoryQueryReportDto> retrieve(@Param("site") String site, @Param("erpStorageLocationList") List<String> erpStorageLocationList, @Param("inventoryIdList") List<String> inventoryIdList, @Param("carrierList") List<String> carrierList, @Param("statusList") List<String> statusList, @Param("itemList") List<String> itemList, @Param("batchNoList") List<String> batchNoList, @Param("vendorBatchNoList") List<String> vendorBatchNoList, @Param("qualityInspectionStatusList") List<String> qualityInspectionStatusList, @Param("inventorySpecialMarking") String inventorySpecialMarking, @Param("dnOrder") String dnOrder, @Param("dnOrderSeq") Integer dnOrderSeq, @Param("rollType") String rollType, @Param("storageBinList") List<String> storageBinList, @Param("storageLocationList") List<String> storageLocationList, @Param("allowZero")boolean allowZero);
BigDecimal retrieveTotalQty(@Param("site") String site, @Param("erpStorageLocationList") List<String> erpStorageLocationList, @Param("inventoryIdList") List<String> inventoryIdList, @Param("carrierList") List<String> carrierList, @Param("statusList") List<String> statusList, @Param("itemList") List<String> itemList, @Param("batchNoList") List<String> batchNoList, @Param("vendorBatchNoList") List<String> vendorBatchNoList, @Param("qualityInspectionStatusList") List<String> qualityInspectionStatusList, @Param("inventorySpecialMarking") String inventorySpecialMarking, @Param("dnOrder") String dnOrder, @Param("dnOrderSeq") Integer dnOrderSeq, @Param("rollType") String rollType, @Param("storageBinList") List<String> storageBinList, @Param("storageLocationList") List<String> storageLocationList);
BigDecimal retrieveTotalQty(@Param("site") String site, @Param("erpStorageLocationList") List<String> erpStorageLocationList, @Param("inventoryIdList") List<String> inventoryIdList, @Param("carrierList") List<String> carrierList, @Param("statusList") List<String> statusList, @Param("itemList") List<String> itemList, @Param("batchNoList") List<String> batchNoList, @Param("vendorBatchNoList") List<String> vendorBatchNoList, @Param("qualityInspectionStatusList") List<String> qualityInspectionStatusList, @Param("inventorySpecialMarking") String inventorySpecialMarking, @Param("dnOrder") String dnOrder, @Param("dnOrderSeq") Integer dnOrderSeq, @Param("rollType") String rollType, @Param("storageBinList") List<String> storageBinList, @Param("storageLocationList") List<String> storageLocationList, @Param("allowZero")boolean allowZero);
IPage<InventoryQueryReportDto> doRetrieveInventoryDetailed(Page<InventoryQueryReportDto> page, @Param("site") String site, @Param("palletList") List<String> palletList, @Param("boxList") List<String> boxList, @Param("volumeList") List<String> volumeList, @Param("status") String status, @Param("itemList") List<String> itemList, @Param("storageLocationList") List<String> storageLocationList, @Param("storageBinList") List<String> storageBinList, @Param("groesList") List<String> groesList, @Param("width") BigDecimal width, @Param("bismt") String bismt, @Param("qualityInspectionStatusList") List<String> qualityInspectionStatusList, @Param("sequence") boolean sequence
, @Param("diffValue") Integer diffValue, @Param("customerList") List<String> customerList, @Param("startDateTime") LocalDateTime startDateTime, @Param("endDateTime") LocalDateTime endDateTime, @Param("itemGroupList") List<String> itemGroupList, @Param("disparitySelect") String disparitySelect, @Param("packageType") String packageType, @Param("historyGroesList") List<String> historyGroesList, @Param("rejudg") boolean rejudg, @Param("updateStartDateTime") LocalDateTime updateStartDateTime, @Param("updateEndDateTime") LocalDateTime updateEndDateTime, @Param("shopOrder")String shopOrder, @Param("shopOrderType")String shopOrderType, @Param("zypsqd")String zypsqd);

View File

@ -143,8 +143,11 @@
#{storageLocation}
</foreach>
</if>
<if test="!allowZero">
AND WI.QTY_ON_HAND > 0
</if>
</where>
ORDER BY WI.CREATE_TIME DESC
ORDER BY WI.CREATE_TIME ASC, WI.INVENTORY_ID ASC, WI.STATUS ASC
</select>
<select id="retrieveTotalQty" resultType="java.math.BigDecimal">
@ -191,7 +194,7 @@
<if test="batchNoList != null and batchNoList.size > 0">
AND WI.BATCH_NO IN
<foreach collection="batchNoList" item="batchNo" open="(" separator="," close=")">
#{item}
#{batchNo}
</foreach>
</if>
<if test="vendorBatchNoList != null and vendorBatchNoList.size > 0">
@ -230,6 +233,9 @@
#{storageLocation}
</foreach>
</if>
<if test="!allowZero">
AND WI.QTY_ON_HAND > 0
</if>
</where>
</select>
<select id="doRetrieveInventoryDetailed" resultMap="BaseResultMap">