Browse Source

1.增加查询条件

dist.1.3.0
pref_mail@163.com 10 months ago
parent
commit
5fc61bf372
  1. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java
  2. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  3. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java
  4. 26
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml
  5. 44
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  6. 22
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java

@ -190,7 +190,7 @@ public interface DistributionStockArticleMapper extends BaseMapper<DistributionS
* @param stockArticleEntity
* @return
*/
IPage<DistributionSignforStockArticleVO> pageSignforListOwe(IPage<DistributionSignforStockArticleVO> page,@Param("param") DistributionStockArticleOweDTO stockArticleEntity);
IPage<DistributionSignforStockArticleVO> pageSignforListOwe(IPage<DistributionSignforStockArticleVO> page,@Param("param") DistributionStockArticleOweDTO stockArticleEntity,@Param("collect") List<Long> warehouseIdList);
void updateAllOrderTotalNum(@Param("orderCode") String orderCode, @Param("total") Integer total);

11
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml

@ -1245,6 +1245,17 @@
<where>
ldl.signfor_state = 2
and ldsa.order_status in ('70','80')
<if test="collect != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(collect)">
and ldsa.warehouse_id in
<foreach collection="collect" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
and ldl.warehouse_id in
<foreach collection="collect" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="param.waybillNumber != null and param.waybillNumber != ''">
AND ldsa.waybill_number like concat(#{param.waybillNumber},"%")
</if>

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java

@ -65,7 +65,7 @@ public interface DistrilbutionBillLadingMapper extends BaseMapper<DistrilbutionB
*/
List<DistrilbutionBillLadingExcel> exportDistrilbutionBillLading(@Param("ew") Wrapper<DistrilbutionBillLadingEntity> queryWrapper);
IPage<DistrilbutionBillLadingVO> pageList(IPage<Object> page, @Param("param") DistrilbutionBillLadingDTO distrilbutionBillLadingDTO);
IPage<DistrilbutionBillLadingVO> pageList(IPage<Object> page, @Param("param") DistrilbutionBillLadingDTO distrilbutionBillLadingDTO,@Param("collect") List<Long> collect);
IPage<DistrilbutionBillLadingAppVO> pageListApp(IPage<Object> page, @Param("param") BillLadingAppDTO billLadingAppDTO);

26
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml

@ -71,6 +71,16 @@
LEFT JOIN logpm_distrilbution_bill_package dbp2 ON dbp2.bill_lading_id = dbl2.id
AND dbp2.packet_bar_status IN ( 1, 3 )
LEFT JOIN logpm_distribution_parcel_list ldpl2 ON dbp2.parce_list_id = ldpl2.id
<where>
1=1
<if test="collect != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(collect)">
and dbl2.warehouse_id in
<foreach collection="collect" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
GROUP BY
dbl2.pickup_batch,
ldpl2.SECOND
@ -120,6 +130,12 @@
LEFT JOIN logpm_distribution_stock_article dsa ON lds.stock_article_id = dsa.id
WHERE
lds.order_status != 2
<if test="collect != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(collect)">
and aaa.warehouse_id in
<foreach collection="collect" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
GROUP BY
aaa.id
) AS k
@ -141,6 +157,12 @@
LEFT JOIN logpm_basicdata_client lbc ON ldsl.market_id = lbc.id
WHERE
lddd.inventory_status != 2
<if test="collect != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(collect)">
and bbb.warehouse_id in
<foreach collection="collect" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
GROUP BY
bbb.id
) AS m ON m.id = k.id
@ -150,9 +172,9 @@
<if test="param.pickupBatch != null and param.pickupBatch != ''">and dbl.pickup_batch like
concat('%',#{param.pickupBatch},'%')
</if>
<if test="param.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(param.warehouseIdList)">
<if test="collect != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(collect)">
and dbl.warehouse_id in
<foreach collection="param.warehouseIdList" item="item" open="(" close=")" separator=",">
<foreach collection="collect" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>

44
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

@ -2542,18 +2542,15 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
List<BasicdataWarehouseEntity> myWarehouseList = warehouseClient.getMyWarehouseList();
BasicdataWarehouseEntity currentWarehouse = warehouseClient.getMyCurrentWarehouse();
List<Long> collect = myWarehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
List<Long> collect = null;
if (collect.size() > 1) {
stockArticleEntity.setWarehouseIdList(collect);
} else if (collect.size() == 1) {
stockArticleEntity.setWarehouseId(collect.get(0));
}
if (Func.isNotEmpty(currentWarehouse)) {
stockArticleEntity.setWarehouseIdList(null);
stockArticleEntity.setWarehouseId(currentWarehouse.getId());
if(ObjectUtils.isNotNull(myWarehouseList)){
collect = new ArrayList<>();
collect.add(currentWarehouse.getId());
}else{
collect = myWarehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
}
IPage<DistributionSignforStockArticleVO> distributionStockArticleEntityIPage = baseMapper.pageSignforListOwe(page, stockArticleEntity);
IPage<DistributionSignforStockArticleVO> distributionStockArticleEntityIPage = baseMapper.pageSignforListOwe(page, stockArticleEntity,collect);
//处理创建人
distributionStockArticleEntityIPage.getRecords().forEach(a -> {
if (Func.isNotEmpty(a.getCreateUser())) {
@ -2617,18 +2614,25 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
}
List<BasicdataWarehouseEntity> myWarehouseList = warehouseClient.getMyWarehouseList();
BasicdataWarehouseEntity currentWarehouse = warehouseClient.getMyCurrentWarehouse();
List<Long> collect = myWarehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
List<Long> warehouseIdList = null;
if (collect.size() > 1) {
stockArticleEntity.setWarehouseIdList(collect);
} else if (collect.size() == 1) {
stockArticleEntity.setWarehouseId(collect.get(0));
}
if (Func.isNotEmpty(currentWarehouse)) {
stockArticleEntity.setWarehouseIdList(null);
stockArticleEntity.setWarehouseId(currentWarehouse.getId());
if (ObjectUtils.isNotNull(currentWarehouse)){
warehouseIdList = new ArrayList<>();
warehouseIdList.add(currentWarehouse.getId());
}else{
warehouseIdList=myWarehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
}
IPage<DistributionSignforStockArticleVO> distributionStockArticleEntityIPage = baseMapper.pageSignforListOwe(page, stockArticleEntity);
// if (collect.size() > 1) {
// stockArticleEntity.setWarehouseIdList(collect);
// } else if (collect.size() == 1) {
// stockArticleEntity.setWarehouseId(collect.get(0));
// }
// if (Func.isNotEmpty(currentWarehouse)) {
// stockArticleEntity.setWarehouseIdList(null);
// stockArticleEntity.setWarehouseId(currentWarehouse.getId());
// }
IPage<DistributionSignforStockArticleVO> distributionStockArticleEntityIPage = baseMapper.pageSignforListOwe(page, stockArticleEntity,warehouseIdList);
//处理创建人
List<DistributionSignForStockArticleExcel> signForStockArticleExcels = new ArrayList<>();
distributionStockArticleEntityIPage.getRecords().forEach(a -> {

22
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

@ -2140,16 +2140,22 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
distrilbutionBillLadingDTO.setOrderCodes(orderCodes);
//获取当前登录人仓库
List<BasicdataWarehouseEntity> warehouseList = basicdataWarehouseClient.getMyWarehouseList();
List<Long> collect = warehouseList.stream()
.map(BasicdataWarehouseEntity::getId)
.collect(Collectors.toList());
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
distrilbutionBillLadingDTO.setWarehouseIdList(collect);
List<Long> collect = null;
if (Func.isNotEmpty(myCurrentWarehouse)) {
distrilbutionBillLadingDTO.setWarehouseIdList(null);
distrilbutionBillLadingDTO.setWarehouseId(myCurrentWarehouse.getId());
collect = new ArrayList<>();
collect.add(myCurrentWarehouse.getId());
} else {
collect = warehouseList.stream()
.map(BasicdataWarehouseEntity::getId)
.collect(Collectors.toList());
}
IPage<DistrilbutionBillLadingVO> distrilbutionBillLadingVOIPage = baseMapper.pageList(page, distrilbutionBillLadingDTO);
IPage<DistrilbutionBillLadingVO> distrilbutionBillLadingVOIPage = baseMapper.pageList(page, distrilbutionBillLadingDTO,collect);
List<DistrilbutionBillLadingVO> records = distrilbutionBillLadingVOIPage.getRecords();
// 获取所有的提货单ID
@ -3318,8 +3324,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
distributionAsyncService.sendFactorySignforInfo(s, myCurrentWarehouse, AuthUtil.getUser());
}
//处理库存品签收数据
updateStock(s);

Loading…
Cancel
Save