Browse Source

1.优化在库订单查询

master
pref_mail@163.com 6 months ago
parent
commit
36a40f8970
  1. 1
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationEntity.java
  2. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java
  3. 48
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  4. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java
  5. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  6. 51
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

1
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationEntity.java

@ -45,6 +45,7 @@ public class DistributionReservationEntity extends TenantEntity {
*/
@ApiModelProperty(value = "订单自编号;订单自编号,关联订单表")
private String stockArticleId;
// private String orderCodes;
/**
* 收货人
*/

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

@ -90,7 +90,7 @@ public interface DistributionStockArticleMapper extends BaseMapper<DistributionS
List<Map> fingListByServiceNumber(@Param("serviceNumber") String serviceNumber,@Param("warehouseId") Long warehouseId);
void updateGroundingStatus(@Param("orderCode") String orderCode, @Param("groundingStatus") String groundingStatus,@Param("warehouseId") Long warehouseId);
IPage<DistributionStockArticleEntity> pageListOwe(IPage page,@Param("param")DistributionStockArticleOweDTO stockArticleEntity);
IPage<DistributionStockArticleEntity> pageListOwe(IPage page,@Param("param")DistributionStockArticleOweDTO stockArticleEntity,@Param("warehouseIds")List<Long> warehouseIds);
queryOrderVO selectOneByWrap(@Param("condition") String condition,@Param("collect") List<Long> collect);

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

@ -411,8 +411,7 @@
HAVING count(ldpl.id) > 0
</select>
<select id="pageListOwe" parameterType="com.logpm.distribution.dto.DistributionStockArticleOweDTO"
resultType="com.logpm.distribution.entity.DistributionStockArticleEntity">
<select id="pageListOwe" resultType="com.logpm.distribution.entity.DistributionStockArticleEntity">
select ldsa.id, ldsa.tenant_id,
ldsa.create_user,
ldsa.create_time,
@ -440,12 +439,10 @@
dealerName, ldsa.dealer_code,
ldsa.train_number, ldsa.factory_train, ldsa.sending, ldsa.send_warehouse_id, ldsa.send_warehouse_name,
ldsa.is_zero, ldsa.accept_warehouse_id, ldsa.accept_warehouse_name, ldsa.order_delivery_status,
GROUP_CONCAT( DISTINCT lwtg.tray_code ) trays,
GROUP_CONCAT( DISTINCT lwug.position_code ) allocation
ldsa.trays trays,
ldsa.allocation allocation
from logpm_distribution_stock_article ldsa
LEFT JOIN logpm_distribution_parcel_list ldpl on ldsa.id = ldpl.stock_article_id
LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id
<where>
ldsa.is_deleted = 0 and ldsa.order_status in ('10','20','30','40','50','60','70')
and ldsa.hand_quantity > 0
@ -455,6 +452,12 @@
#{a}
</foreach>
</if>
<if test="warehouseIds != null">
and ldsa.warehouse_id in
<foreach collection="warehouseIds" item="s" open="(" close=")" separator=",">
#{s}
</foreach>
</if>
<if test=" param.orderCodeNumLike != '' and param.orderCodeNumLike != null ">and ldsa.order_code like
concat('%',#{param.orderCodeNumLike},'%')
</if>
@ -477,16 +480,9 @@
concat('%',#{param.waybillNumLike},'%')
</if>
<if test=" param.typeService != '' and param.typeService != null ">
and ldsa.type_service = #{param.typeService}
</if>
<if test=" param.warehouseIdList != null ">and ldsa.warehouse_id in
<foreach collection="param.warehouseIdList" open="(" item="a" close=")" separator=",">
#{a}
</foreach>
</if>
<if test=" param.warehouseId != '' and param.warehouseId != null ">and ldsa.warehouse_id =
#{param.warehouseId}
and ldsa.type_service =#{param.typeService}
</if>
<if test=" param.idsList != null ">and ldsa.id in
<foreach collection="param.idsList" open="(" item="a" close=")" separator=",">
#{a}
@ -533,27 +529,27 @@
<if test=" param.groundingStatus != null and param.groundingStatus != '' ">and ldsa.grounding_status =
#{param.groundingStatus}
</if>
<if test=" param.genre != null and param.groundingStatus != '' ">and ldsa.genre = #{param.genre}</if>
<if test=" param.freezeStatus != null and param.groundingStatus != '' ">and ldsa.freeze_status =
<if test=" param.genre != null and param.genre != '' ">and ldsa.genre=#{param.genre}</if>
<if test=" param.freezeStatus != null and param.freezeStatus != '' ">and ldsa.freeze_status =
#{param.freezeStatus}
</if>
<if test=" param.orderStatus != null and param.groundingStatus != '' ">and ldsa.order_status =
<if test=" param.orderStatus != null and param.orderStatus != '' ">and ldsa.order_status =
#{param.orderStatus}
</if>
<if test=" param.reservationStatus != null and param.groundingStatus != '' ">and ldsa.reservation_status =
<if test=" param.reservationStatus != null and param.reservationStatus != '' ">and ldsa.reservation_status =
#{param.reservationStatus}
</if>
<if test=" param.stockupStatus != null and param.groundingStatus != '' ">and ldsa.stockup_status =
<if test=" param.stockupStatus != null and param.stockupStatus != '' ">and ldsa.stockup_status =
#{param.stockupStatus}
</if>
<if test=" param.notification != null and param.notification != '' ">and ldsa.notification =
#{param.notification}
</if>
<if test=" param.orderReceiveStatus != null and param.groundingStatus != '' ">and ldsa.order_receive_status
<if test=" param.orderReceiveStatus != null and param.orderReceiveStatus != '' ">and ldsa.order_receive_status
=
#{param.orderReceiveStatus}
</if>
<if test=" param.completeSet != null ">and ldsa.complete_set like concat('%',#{param.completeSet},'%')
<if test=" param.completeSet != null ">and ldsa.complete_set =#{param.completeSet}
</if>
<if test=" param.customerName != null and param.customerName != '' ">and ldsa.customer_name like
concat('%',#{param.customerName},'%')
@ -567,11 +563,11 @@
<if test=" param.customerAddress != null and param.customerAddress != '' ">and ldsa.customer_address like
concat('%',#{param.customerAddress},'%')
</if>
<if test=" param.trays != null and param.trays != '' ">and lwtg.tray_code like
concat('%',#{param.trays},'%')
<if test=" param.trays != null and param.trays != '' ">
and ldsa.trays like concat('%',#{param.trays},'%')
</if>
<if test=" param.allocation != null and param.allocation != '' ">and lwug.position_code like
concat('%',#{param.allocation},'%')
<if test=" param.allocation != null and param.allocation != '' ">
and ldsa.allocation like concat('%',#{param.allocation},'%')
</if>
</where>
group by ldsa.id order by ldsa.warehouse_entry_time desc

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java

@ -77,7 +77,6 @@ public interface DistributionStockupMapper extends BaseMapper<DistributionStocku
/**
* 查询预约单记录
* @param page
* @param id
* @return
*/
IPage<DistributionStockupVO> detailReservationOwn(IPage<Object> page,@Param("param")DistributionStockupVO distributionStockupVO);
@ -244,7 +243,6 @@ public interface DistributionStockupMapper extends BaseMapper<DistributionStocku
/**
* 查询备货任务的订单详情
* @param list
* @return
*/
List<DistributionStockupPackageListDetailExcel> exportStockUptOrderDetail(@Param("ids") List<Long> ids);
@ -258,15 +256,12 @@ public interface DistributionStockupMapper extends BaseMapper<DistributionStocku
/**
* 根据备货编码查询出备货任务信息
* @param id
* @param searchCode
* @return
*/
DistributionStockupEntity selectStockUpByStockUpCode(@Param("warehouseId") Long warehouseId,@Param("stockupCode") String stockupCode);
/**
* 查询备货任务计划备货数量
* @param id
* @return
*/
Integer selectStockUpPlanNum(@Param("stockUpId") Long stockUpId);

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -538,10 +538,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionSignforEntity.setDeliveryTime(format);
//通过客户查询已经上车的订单(待定)
// String orderIds = distributionDeliveryInfoMapper.selectorderIdList(e.getId());
distributionSignforEntity.setOrderId(e.getStockArticleId());
// distributionSignforEntity.setOrderId(e.getStockArticleId());
//查询订单总数
Integer i = StringUtils.countMatches(e.getStockArticleId(), ",") + 1;
distributionSignforEntity.setOrderTotal(i);
// Integer i = StringUtils.countMatches(e.getStockArticleId(), ",") + 1;
//// distributionSignforEntity.setOrderTotal(i);
//该客户总件数
Integer i1 = distributionDeliveryInfoMapper.selectWrapCount(e.getId());
distributionSignforEntity.setReservationNum(i1);

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

@ -930,48 +930,19 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
// if(Func.isNotEmpty(stockArticleEntity.getReservation())){
// stockArticleEntity.setReservationStatus("10");
// }
List<BasicdataWarehouseEntity> myWarehouseList = warehouseClient.getMyWatchWarehouse();
List<Long> collect = myWarehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
if (collect.size() > 1) {
stockArticleEntity.setWarehouseIdList(collect);
} else if (collect.size() == 1) {
stockArticleEntity.setWarehouseId(collect.get(0));
}
IPage<DistributionStockArticleEntity> distributionStockArticleEntityIPage = baseMapper.pageListOwe(page, stockArticleEntity);
distributionStockArticleEntityIPage.getRecords().stream().forEach(i -> {
/* DistributionStockArticleEntity distributionStockArticleEntity = baseMapper.getStockArticleQueryQuantity(i.getId());
i.setDeliveryQuantity(distributionStockArticleEntity.getDeliveryQuantity());
List<DistributionParcelListEntity> list = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getStockArticleId, i.getId())
.eq(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiqianshou.getValue())
);
i.setSigninQuantity(distributionStockArticleEntity.getSigninQuantity() + list.size() );*/
if ("1".equals(i.getIsZero())) {
//查询托盘
WarehouseTrayGoodsEntity warehouseTrayGoods = new WarehouseTrayGoodsEntity();
warehouseTrayGoods.setAssociationId(i.getId());
warehouseTrayGoods.setAssociationType("1");
warehouseTrayGoods.setAssociationValue(i.getOrderCode());
warehouseTrayGoods.setWarehouseId(collect.get(0));
List<WarehouseTrayGoodsEntity> trayList = warehouseTrayGoodsClient.getTrayList(warehouseTrayGoods);
if (!trayList.isEmpty()) {
String collect1 = trayList.stream().map(WarehouseTrayGoodsEntity::getTrayCode).collect(Collectors.joining(","));
i.setTrays(collect1);
}
//查询货位
WarehouseUpdownGoodsEntity updownGoodsEntity = new WarehouseUpdownGoodsEntity();
updownGoodsEntity.setAssociationId(i.getId());
updownGoodsEntity.setAssociationType("1");
updownGoodsEntity.setWarehouseId(collect.get(0));
updownGoodsEntity.setAssociationValue(i.getOrderCode());
List<WarehouseUpdownGoodsEntity> information = warehouseUpdownGoodsClient.getLocationStockListInformation(updownGoodsEntity);
if (ObjectUtils.isNotNull(information) && !information.isEmpty()) {
String collect1 = information.stream().map(WarehouseUpdownGoodsEntity::getPositionCode).collect(Collectors.joining(","));
i.setAllocation(collect1);
}
// }
List<Long> warehouseIdList = new ArrayList<>();
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Func.isEmpty(myCurrentWarehouse)){
List<BasicdataWarehouseEntity> myWarehouseList = warehouseClient.getMyWarehouseList();
List<Long> collect = myWarehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
warehouseIdList.addAll(collect);
}else{
warehouseIdList.add(myCurrentWarehouse.getId());
}
});
IPage<DistributionStockArticleEntity> distributionStockArticleEntityIPage = baseMapper.pageListOwe(page, stockArticleEntity,warehouseIdList);
return distributionStockArticleEntityIPage;
}

Loading…
Cancel
Save