Browse Source

Merge remote-tracking branch 'origin/dev' into dev

training
caoyizhong 1 year ago
parent
commit
7bda10782e
  1. 47
      blade-biz-common/src/main/java/org/springblade/common/constant/reservation/ReservationInventoryStatusConstant.java
  2. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionParcelListEntity.java
  3. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationStocklistEntity.java
  4. 29
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java
  5. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml
  6. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java
  7. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationPackageMapper.java
  8. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationPackageMapper.xml
  9. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationStocklistMapper.java
  10. 15
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationStocklistMapper.xml
  11. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java
  12. 13
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  13. 430
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  14. 18
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  15. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionParcelListWrapper.java
  16. 34
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionStockListWrapper.java

47
blade-biz-common/src/main/java/org/springblade/common/constant/reservation/ReservationInventoryStatusConstant.java

@ -0,0 +1,47 @@
package org.springblade.common.constant.reservation;
/**
* 预约单状态枚举
* 对应码表
* resvervation_status
* @author pref
*/
public enum ReservationInventoryStatusConstant {
zhengchang("正常","1"),
quxiao("取消","2"),
zengjia("增加","3");
/**
* 状态
*/
private String name;
/**
*
*/
private String value;
private ReservationInventoryStatusConstant(String name, String value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionParcelListEntity.java

@ -85,7 +85,7 @@ public class DistributionParcelListEntity extends TenantEntity {
* 包条码
*/
@ApiModelProperty(value = "包条码")
@TableField("order_package_code")
// @TableField("order_package_code")
private String orderPackageCode;
@ApiModelProperty(value = "货区信息")

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationStocklistEntity.java

@ -68,7 +68,7 @@ public class DistributionReservationStocklistEntity extends TenantEntity {
* 库存品状态 1-正常2-取消
*/
@ApiModelProperty(value = "库存品状态 ;1-正常、2-取消")
private Integer stockListStatus;
private String stockListStatus;
/**
* 预留1
*/

29
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java

@ -111,6 +111,35 @@ public class DistributionStockArticleController extends BladeController {
IPage<DistributionStockArticleEntity> pages = distributionStockArticleService.page(Condition.getPage(query), queryWrapper);
return R.data(DistributionStockArticleWrapper.build().pageVO(pages));
} /**
* 配送在库订单 分页
*/
@GetMapping("/selectStockArticleInfoList")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入distributionStockArticle")
public R<IPage<DistributionStockArticleVO>> selectStockArticleInfoList(@ApiIgnore @RequestParam Map<String, Object> distributionStockArticle, Query query) {
Object o = distributionStockArticle.get("orderSelfNumbering");
distributionStockArticle.remove("orderSelfNumbering");
Object o2 = distributionStockArticle.get("startDate");
Object o1 = distributionStockArticle.get("entDate");
Object d = distributionStockArticle.get("id");
distributionStockArticle.remove("id");
distributionStockArticle.remove("startDate");
distributionStockArticle.remove("entDate");
QueryWrapper<DistributionStockArticleEntity> queryWrapper = Condition.getQueryWrapper(distributionStockArticle, DistributionStockArticleEntity.class);
if(Func.isNotEmpty(o)){
queryWrapper.in("order_self_numbering",String.valueOf(o).split(","));
}
if(ObjectUtil.isNotEmpty(d)){
queryWrapper.in("id",String.valueOf(d).split(","));
}
if(ObjectUtil.isNotEmpty(o2)){
queryWrapper.between("warehouse_entry_time",o2,o1);
}
IPage<DistributionStockArticleEntity> pages = distributionStockArticleService.page(Condition.getPage(query), queryWrapper);
IPage<DistributionStockArticleVO> distributionStockArticleVOIPage = distributionStockArticleService.handlePackage(DistributionStockArticleWrapper.build().pageVO(pages));
return R.data(distributionStockArticleVOIPage);
}

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml

@ -91,7 +91,7 @@
logpm_distribution_signfor lds
JOIN logpm_distribution_reservation ldr ON ldr.id = lds.reservation_id
<where>
lds.is_deleted = 0 and lds.delivery_id = #{id}
lds.is_deleted = 0 and lds.delivery_id = #{id} and ldr.reservation_status != 40
</where>
</select>
<select id="selectDistributionDeliverywrapInfoPage" resultType="com.logpm.distribution.vo.DistributionDeliveryInfoVO">
@ -207,6 +207,10 @@
<select id="selectDistributionDeliveryOrderPage" resultType="com.logpm.distribution.vo.DistributionStockArticleVO">
SELECT
distinct ldsa.order_code orderCode,
ldsa.consignee_unit,
ldsa.consignee_person,
ldsa.consignee_address,
ldsa.consignee_mobile,
ldsa.description_goods descriptionGoods,
(

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

@ -70,7 +70,7 @@ public interface DistributionParcelListMapper extends BaseMapper<DistributionPar
* @param id
* @return
*/
Page<DistributionParcelListEntity> getPageVOList(Page<DistributionParcelListVO> objectPage, Long id);
List<DistributionParcelListEntity> getPageVOList( Long id);
List<DistributionParcelListBaseVO> getStockDataBase(@Param("param") DistributionParcelListEntity parcelListEntity);
}

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

@ -101,7 +101,7 @@ public interface DistributionReservationPackageMapper extends BaseMapper<Distrib
* @param id1
* @return
*/
Page<DistributionParcelListEntity> selectPackageVOList(Page<Object> objectPage,@Param("reservationId") Long id,@Param("stockArticleId") Long id1);
List<DistributionParcelListEntity> selectPackageVOList(@Param("reservationId") Long id,@Param("stockArticleId") Long id1);
/**
*

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationPackageMapper.xml

@ -198,10 +198,9 @@ WHERE
logpm_distribution_reservation_package AS ldrp
INNER JOIN logpm_distribution_parcel_list AS ldpl ON ldrp.parce_list_id = ldpl.id
<where>
ldpl.packet_bar_status != 2
ldrp.packet_bar_status != 2
<if test="reservationId != '' and reservationId != null">
and ldrp.reservation_id =#{reservationId}
</if>
<if test="stockArticleId != '' and stockArticleId != null">
and ldrp.stock_article_id =#{stockArticleId}
@ -232,6 +231,7 @@ WHERE
packet_bar_status
FROM logpm_distribution_reservation_package
<where>
packet_bar_status != 2
<if test="reservationId != '' and reservationId != null">
and reservation_id =#{reservationId}
</if>

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationStocklistMapper.java

@ -18,6 +18,7 @@ package com.logpm.distribution.mapper;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionReservationStocklistEntity;
import com.logpm.distribution.entity.DistributionStockListEntity;
import com.logpm.distribution.vo.DistributionReservationStocklistVO;
import com.logpm.distribution.excel.DistributionReservationStocklistExcel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -71,4 +72,11 @@ public interface DistributionReservationStocklistMapper extends BaseMapper<Distr
* @return
*/
List<DistributionParcelListEntity> selectReservationPackageNum(@Param("reservationId")Long id,@Param("stockArticleId") Long stockArticleId);
/**
* 查询预约下的有效库存品
* @param id
* @return
*/
List<DistributionStockListEntity> selectInventory(@Param("reservationId") Long id);
}

15
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationStocklistMapper.xml

@ -102,5 +102,18 @@
</if>
</where>
</select>
<select id="selectInventory" resultType="com.logpm.distribution.entity.DistributionStockListEntity">
SELECT
ldsl.*,
ldrs.reservation_num
FROM
logpm_distribution_reservation_stocklist AS ldrs
INNER JOIN logpm_distribution_stock_list AS ldsl ON ldrs.stocklist_id = ldsl.id
<where>
ldrs.stock_list_status != 2
<if test="reservationId != '' and reservationId != null">
and ldrs.reservation_id = #{reservationId}
</if>
</where>
</select>
</mapper>

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java

@ -17,6 +17,7 @@
package com.logpm.distribution.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.distribution.dto.DistributionStockArticleDTO;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.vo.DistributionStockArticleVO;
@ -105,4 +106,11 @@ public interface IDistributionStockArticleService extends BaseService<Distributi
* @return
*/
OrderPackgeCodeDataVO showOrderPackgeCode(Map<String, Object> params) throws Exception;
/**
* 处理订单包件信息
* @param pageVO
* @return
*/
IPage<DistributionStockArticleVO> handlePackage( IPage<DistributionStockArticleVO> pageVO);
}

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

@ -1186,17 +1186,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
reservationPackageDTO.setReservationId(reservationVOS.getId());
reservationPackageDTO.setStockArticleId(s.getId());
List<DistributionParcelListEntity> parcelListEntities = distributionReservationPackageMapper.getDeliveryReservationPackage(deliveryListEntity.getId(), s.getId());
List<DistributionParcelListVO> distributionParcelListVOS = DistributionParcelListWrapper.build().listVO(parcelListEntities);
//查询出订单的所有包件信息
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListService.getBaseMapper().selectList(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getStockArticleId, s.getId()));
ArrayList<DistributionParcelListVO> packageList = new ArrayList<>();
ArrayList<DistributionParcelListVO> parcelListVOS = new ArrayList<>();
parcelListEntities.forEach(p->{
packageList.add(DistributionParcelListWrapper.build().entityVO(p));
});
parcelListEntityList.forEach(a->{
parcelListVOS.add(DistributionParcelListWrapper.build().entityVO(a));
});
s.setPackageList(packageList);
List<DistributionParcelListVO> parcelListVOS = DistributionParcelListWrapper.build().listVO(parcelListEntityList);
s.setPackageList(distributionParcelListVOS);
s.setParcelListVOS(parcelListVOS);
});
deliveryListVO.setStockArticleList(stockArticleVOS);

430
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

@ -30,11 +30,14 @@ import com.logpm.distribution.mapper.*;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.*;
import com.logpm.distribution.wrapper.DistributionParcelListWrapper;
import com.logpm.distribution.wrapper.DistributionStockArticleWrapper;
import com.logpm.distribution.wrapper.DistributionStockListWrapper;
import org.springblade.common.constant.DistributionTypeConstant;
import org.springblade.common.constant.delivery.DeliveryStatusConstant;
import org.springblade.common.constant.order.OrderReservationStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageFreezeStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStockupStatusConstant;
import org.springblade.common.constant.reservation.*;
import org.springblade.common.constant.signing.SignforStatusConstant;
@ -508,23 +511,23 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//查询根据预约ID查询这些预约的备货状态
List<DistributionReservationEntity> reservationEntityList = baseMapper.selectList(Wrappers.<DistributionReservationEntity>query().lambda().in(DistributionReservationEntity::getId, ids));
boolean flag = reservationEntityList.stream().anyMatch(s -> s.getStockupStatus().equals(ReservationStockupStatusConstant.weibeihuo.getValue()));
if (flag){
if (Func.isNotEmpty(stockup.getLoaderName())){
if (flag) {
if (Func.isNotEmpty(stockup.getLoaderName())) {
distributionStockupEntity.setLoaderName(stockup.getLoaderName());
distributionStockupEntity.setLoaderId(stockup.getLoaderId());
}
if (Func.isNotEmpty(stockup.getGoodsAreaName())){
if (Func.isNotEmpty(stockup.getGoodsAreaName())) {
distributionStockupEntity.setStockupArea(stockup.getGoodsAreaName());
distributionStockupEntity.setGoodsAreaId(stockup.getGoodsAreaId());
}
if (Func.isNotEmpty(stockup.getGoodsAreaName())){
if (Func.isNotEmpty(stockup.getGoodsAreaName())) {
distributionStockupEntity.setStockupArea(stockup.getGoodsAreaName());
distributionStockupEntity.setGoodsAreaId(stockup.getGoodsAreaId());
}
if (Func.isNotEmpty(stockup.getLoadAndUnload())){
if (Func.isNotEmpty(stockup.getLoadAndUnload())) {
distributionStockupEntity.setTeamResponsibility(stockup.getLoadAndUnload());
}
if (Func.isNotEmpty(stockup.getOutboundDate())){
if (Func.isNotEmpty(stockup.getOutboundDate())) {
distributionStockupEntity.setOutboundDate(stockup.getOutboundDate());
}
BladeUser user = AuthUtil.getUser();
@ -535,7 +538,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}
for (int i = 0; i < ids.size(); i++) {
DistributionReservationEntity reservationEntity = this.getById(ids.get(i));
if (Func.equals(reservationEntity.getStockupStatus(),ReservationStockupStatusConstant.weibeihuo.getValue())){
if (Func.equals(reservationEntity.getStockupStatus(), ReservationStockupStatusConstant.weibeihuo.getValue())) {
//如果预约已经备货
DistributionStockupInfoEntity stockupInfoEntity = new DistributionStockupInfoEntity();
stockupInfoEntity.setReservationId(ids.get(i));
@ -699,24 +702,15 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
List<DistributionStockArticleVO> distrinbutionStockArticleVOS = distributionStockArticleMapper.getStockArticleByReservationId(reservationEntity.getId());
distrinbutionStockArticleVOS.forEach(s -> {
//这里查询两个东西,一个是该订单在预约中所被选取的包件信息,以及该订单下所有的包件列表
Page<DistributionParcelListEntity> pageVOList = distributionParcelListMapper.getPageVOList(new Page<>(), s.getId());
s.setParcelListVOS(DistributionParcelListWrapper.build().pageVO(pageVOList).getRecords());
List<DistributionParcelListEntity> pageVOList = distributionParcelListMapper.getPageVOList(s.getId());
s.setParcelListVOS(DistributionParcelListWrapper.build().listVO(pageVOList));
//这里查询出该订单下已经被选取的包件信息
Page<DistributionParcelListEntity> packageVOList = distributionReservationPackageMapper.selectPackageVOList(new Page<>(), reservationEntity.getId(), s.getId());
s.setPackageList(DistributionParcelListWrapper.build().pageVO(packageVOList).getRecords());
List<DistributionParcelListEntity> packageVOList = distributionReservationPackageMapper.selectPackageVOList(reservationEntity.getId(), s.getId());
s.setPackageList(DistributionParcelListWrapper.build().listVO(packageVOList));
});
reservationVO.setStockArticleList(distrinbutionStockArticleVOS);
if (!Func.isEmpty(reservationStocklistEntityList)) {
List<DistributionStockListEntity> stockArticleEntityList = new ArrayList<>();
reservationStocklistEntityList.forEach(a2 -> {
DistributionStockListEntity stockListEntity = distributionStockListService.getById(a2.getStocklistId());
stockListEntity.setReservationNum(a2.getReservationNum());
stockArticleEntityList.add(stockListEntity);
});
List<DistributionStockListVO> stockListVOList = Func.copy(stockArticleEntityList, DistributionStockListVO.class);
//查询出 库存信息
reservationVO.setInventoryList(stockListVOList);
}
List<DistributionStockListEntity> stockArticleEntityList = distributionReservationStocklistMapper.selectInventory(reservationEntity.getId());
reservationVO.setInventoryList(DistributionStockListWrapper.build().listVO(stockArticleEntityList));
return R.data(reservationVO);
}
@ -732,244 +726,182 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
Long id = distributionReservationDTO.getId();
//这里需要查询出这个预约原来的订单、包件信息
List<DistributionReservationStockarticleEntity> distributionReservationStockarticleEntities = distributionReservationStockarticleService.getBaseMapper().selectList(Wrappers.<DistributionReservationStockarticleEntity>query().lambda().eq(DistributionReservationStockarticleEntity::getReservationId, id));
Map<Long, List<DistributionReservationStockarticleEntity>> reservationStockarticleMap = distributionReservationStockarticleEntities.stream().collect(Collectors.groupingBy(DistributionReservationStockarticleEntity::getStockArticleId));
Map<Long, List<DistributionReservationStockarticleEntity>> oldStockArticle = distributionReservationStockarticleEntities.stream().collect(Collectors.groupingBy(DistributionReservationStockarticleEntity::getStockArticleId));
List<DistributionStockArticleDTO> dtoStockArticleList = distributionReservationDTO.getStockArticleList();
Map<Long, List<DistributionStockArticleDTO>> newStockArticleMap = dtoStockArticleList.stream().collect(Collectors.groupingBy(DistributionStockArticleDTO::getId));
newStockArticleMap.forEach((k,v)->{
if (Func.isNotEmpty(reservationStockarticleMap.get(k))){
List<DistributionStockArticleDTO> distributionStockArticleDTOS = newStockArticleMap.get(k);
DistributionStockArticleDTO distributionStockArticleDTO = distributionStockArticleDTOS.get(0);
DistributionStockArticleEntity stockArticleEntity = Func.copy(distributionStockArticleDTO, DistributionStockArticleEntity.class);
//查询出预约订单中间表数据,进行包件数量维护
DistributionReservationStockarticleEntity reservationStockarticleEntity = distributionReservationStockarticleMapper.selectReservationAndStockArticleId(id,k);
Integer reservationNum = reservationStockarticleEntity.getReservationNum();
List<DistributionParcelListEntity> packageList = distributionStockArticleDTO.getPackageListInfo();
//这里将包件数据和原来预约的包件数据进行比对
//查询出这个预约的这个订单下的包包件预约情况
// Page<DistributionParcelListEntity> packageVOList = distributionReservationPackageMapper.selectPackageVOList(new Page<>(), id, k);
List<DistributionReservationPackageEntity> parcelListEntities = distributionReservationPackageMapper.selectPackageByReservationAndStockArticleId( id, k);
//查询出原计划的包件选取情况
Map<Long, List<DistributionReservationPackageEntity>> oldPackageListMap = parcelListEntities.stream().collect(Collectors.groupingBy(DistributionReservationPackageEntity::getParceListId));
Map<Long, List<DistributionParcelListEntity>> newPackageListMap = packageList.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getId));
//表示原来的这个订单在预约单下已经存在
//包件数量累加
Map<Long, List<DistributionStockArticleDTO>> newStockArticle = dtoStockArticleList.stream().collect(Collectors.groupingBy(DistributionStockArticleDTO::getId));
AtomicInteger packTotal = new AtomicInteger();
AtomicInteger reduceTotal = new AtomicInteger();
newStockArticle.forEach((k, v) -> {
if (Func.isEmpty(oldStockArticle.get(k))) {
//这里发生了新增订单的操作
DistributionStockArticleDTO distributionStockArticleDTO = v.get(0);
List<DistributionParcelListEntity> packageListInfo = distributionStockArticleDTO.getPackageListInfo();
AtomicInteger packageNum = new AtomicInteger();
newPackageListMap.forEach((p,i)->{
if (Func.isNotEmpty(oldPackageListMap.get(p))){
//原计划中不存在这个包件信息,这里需要将这条包件信息进行添加
oldPackageListMap.remove(p);
}else {
//从记录中获取不到这个包件信息,这里就需要将这个包件信息和这个预约信息进行关系的绑定
DistributionParcelListEntity distributionParcelListEntity = i.get(0);
DistributionReservationPackageEntity distributionReservationPackageEntity = new DistributionReservationPackageEntity();
distributionReservationPackageEntity.setReservationId(id);
distributionReservationPackageEntity.setStockArticleId(k);
distributionReservationPackageEntity.setPacketBarStatus(ReservationPackageStatusConstant.zhengchang.getValue());
distributionReservationPackageEntity.setParceListId(p);
distributionReservationPackageService.save(distributionReservationPackageEntity);
packageListInfo.forEach(p -> {
DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity();
reservationPackageEntity.setStockArticleId(distributionStockArticleDTO.getId());
reservationPackageEntity.setPacketBarStatus(ReservationPackageStatusConstant.xinzeng.getValue());
reservationPackageEntity.setPacketBarCode(p.getOrderPackageCode());
reservationPackageEntity.setParceListId(p.getId());
reservationPackageEntity.setReservationId(id);
distributionReservationPackageService.save(reservationPackageEntity);
packageNum.getAndAdd(p.getQuantity());
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(p.getId());
parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue());
distributionParcelListService.updateById(parcelListEntity);
});
DistributionReservationStockarticleEntity reservationStockarticleEntity = new DistributionReservationStockarticleEntity();
reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.zengjia.getValue());
reservationStockarticleEntity.setStockArticleCode(distributionStockArticleDTO.getStockArticleCode());
reservationStockarticleEntity.setStockArticleId(distributionStockArticleDTO.getId());
reservationStockarticleEntity.setReservationId(id);
reservationStockarticleEntity.setReservationNum(packageNum.get());
distributionReservationStockarticleService.save(reservationStockarticleEntity);
packTotal.getAndAdd(reservationStockarticleEntity.getReservationNum());
String status = distributionReservationPackageService.judgmentStatus(distributionStockArticleDTO);
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(distributionStockArticleDTO.getId());
stockArticleEntity.setReservationStatus(status);
distributionStockArticleService.updateById(stockArticleEntity);
} else {
//查询出这个订单原来在这个预约中的勾选情况
DistributionStockArticleDTO distributionStockArticleDTO = v.get(0);
List<DistributionReservationPackageEntity> packageEntityList = distributionReservationPackageMapper.selectPackageByReservationAndStockArticleId(id, k);
Map<Long, List<DistributionReservationPackageEntity>> oldPackage = packageEntityList.stream().collect(Collectors.groupingBy(DistributionReservationPackageEntity::getParceListId));
Map<Long, List<DistributionParcelListEntity>> newPackage = distributionStockArticleDTO.getPackageListInfo().stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getId));
AtomicInteger packageNum = new AtomicInteger();
AtomicInteger reduceNum = new AtomicInteger();
newPackage.forEach((m, n) -> {
if (Func.isEmpty(oldPackage.get(m))) {
DistributionParcelListEntity distributionParcelListEntity = n.get(0);
//新增
DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity();
reservationPackageEntity.setStockArticleId(distributionStockArticleDTO.getId());
reservationPackageEntity.setPacketBarStatus(ReservationPackageStatusConstant.xinzeng.getValue());
reservationPackageEntity.setPacketBarCode(distributionParcelListEntity.getOrderPackageCode());
reservationPackageEntity.setParceListId(distributionParcelListEntity.getId());
reservationPackageEntity.setReservationId(id);
distributionReservationPackageService.save(reservationPackageEntity);
packageNum.getAndAdd(distributionParcelListEntity.getQuantity());
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(distributionParcelListEntity.getId());
parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue());
distributionParcelListService.updateById(parcelListEntity);
} else {
oldPackage.remove(m);
//移除
}
});
AtomicInteger deleteNum = new AtomicInteger();
//这里就需要将原来记录剩下的数据进行取消操作,
oldPackageListMap.forEach((o,q)->{
DistributionReservationPackageEntity distributionReservationPackageEntity = q.get(0);
distributionReservationPackageEntity.setPacketBarCode(ReservationPackageStatusConstant.quxiao.getValue());
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(o);
//移除包件进行取消
oldPackage.forEach((o, p) -> {
DistributionReservationPackageEntity reservationPackageEntity = p.get(0);
reservationPackageEntity.setPacketBarStatus(ReservationPackageStatusConstant.quxiao.getValue());
distributionReservationPackageService.updateById(reservationPackageEntity);
//统计减少包件数量
reduceNum.getAndAdd(distributionParcelListService.getById(reservationPackageEntity.getParceListId()).getQuantity());
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(reservationPackageEntity.getParceListId());
parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue());
//将预约订单中间表的数据进行减少
deleteNum.getAndAdd(parcelListEntity.getQuantity());
distributionParcelListService.updateById(parcelListEntity);
});
reservationStockarticleEntity.setReservationNum(reservationNum + packageNum.get() - deleteNum.get());
//对存在订单进行维护
DistributionReservationStockarticleEntity reservationStockarticleEntity = oldStockArticle.get(k).get(0);
Integer reservationNum = reservationStockarticleEntity.getReservationNum();
reservationStockarticleEntity.setReservationNum(reservationNum + packageNum.get() - reduceNum.get());
distributionReservationStockarticleService.updateById(reservationStockarticleEntity);
reservationStockarticleMap.remove(k);
}else {
//这里表示这个订单是新增的
DistributionStockArticleDTO distributionStockArticleDTO = v.get(0);
DistributionStockArticleEntity stockArticleEntity = Func.copy(distributionStockArticleDTO, DistributionStockArticleEntity.class);
List<DistributionParcelListEntity> packageList = distributionStockArticleDTO.getPackageListInfo();
//包件数量累加
AtomicInteger packageCount = new AtomicInteger();
packageList.forEach(p->{
DistributionReservationPackageEntity distributionReservationPackageEntity = new DistributionReservationPackageEntity();
distributionReservationPackageEntity.setReservationId(id);
distributionReservationPackageEntity.setParceListId(p.getId());
distributionReservationPackageEntity.setStockArticleId(stockArticleEntity.getId());
distributionReservationPackageEntity.setPacketBarStatus(ReservationPackageStatusConstant.zhengchang.getValue());
distributionReservationPackageService.save(distributionReservationPackageEntity);
packageCount.getAndAdd(p.getQuantity());
});
DistributionReservationStockarticleEntity reservationStockarticleEntity = new DistributionReservationStockarticleEntity();
reservationStockarticleEntity.setReservationNum(packageCount.get());
reservationStockarticleEntity.setReservationId(id);
reservationStockarticleEntity.setStockArticleId(k);
reservationStockarticleEntity.setStockArticleCode(ReservationOrderStatusConstant.zhengchang.getValue());
distributionReservationStockarticleService.save(reservationStockarticleEntity);
//查询订单下的包件数量,对包件状态进行变更
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListMapper.selectList(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getStockArticleId, k));
if (parcelListEntityList.size()==packageList.size()){
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
}else if (parcelListEntityList.size()>packageList.size()){
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue());
}else {
log.error("订单包件数量有误");
packTotal.getAndAdd(reservationStockarticleEntity.getReservationNum());
oldStockArticle.remove(k);
String status = distributionReservationPackageService.judgmentStatus(distributionStockArticleDTO);
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(distributionStockArticleDTO.getId());
stockArticleEntity.setReservationStatus(status);
distributionStockArticleService.updateById(stockArticleEntity);
}
});
oldStockArticle.forEach((i, j) -> {
//这里就是需要进行取消的订单信息
DistributionReservationStockarticleEntity reservationStockarticleEntity = j.get(0);
reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue());
List<DistributionReservationPackageEntity> packageEntityList = distributionReservationPackageMapper.selectPackageByReservationAndStockArticleId(id, reservationStockarticleEntity.getStockArticleId());
packageEntityList.forEach(p -> {
p.setPacketBarStatus(ReservationPackageStatusConstant.quxiao.getValue());
distributionReservationPackageService.updateById(p);
reduceTotal.getAndAdd(distributionParcelListService.getById(p.getParceListId()).getQuantity());
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(p.getParceListId());
parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue());
distributionParcelListService.updateById(parcelListEntity);
});
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(i);
DistributionStockArticleDTO stockArticleDTO = Func.copy(stockArticleEntity, DistributionStockArticleDTO.class);
String status = distributionReservationPackageService.judgmentStatus(stockArticleDTO);
stockArticleEntity.setReservationStatus(status);
reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue());
distributionReservationStockarticleService.updateById(reservationStockarticleEntity);
});
//库存品修改
//查询出原来的库存品信息
List<DistributionReservationStocklistEntity> reservationStocklistEntities = distributionReservationStocklistService.getBaseMapper().selectList(Wrappers.<DistributionReservationStocklistEntity>query().lambda().eq(DistributionReservationStocklistEntity::getReservationId, id));
Map<Long, List<DistributionReservationStocklistEntity>> oleInventoryList = reservationStocklistEntities.stream().collect(Collectors.groupingBy(DistributionReservationStocklistEntity::getStocklistId));
List<DistributionStockListDTO> inventoryList = distributionReservationDTO.getInventoryList();
Map<Long, List<DistributionStockListDTO>> newInventoryList = inventoryList.stream().collect(Collectors.groupingBy(DistributionStockListDTO::getId));
AtomicInteger inventorTotal = new AtomicInteger();
newInventoryList.forEach((c, d) -> {
DistributionReservationStocklistEntity reservationStocklistEntity = new DistributionReservationStocklistEntity();
DistributionStockListDTO distributionStockListDTO = d.get(0);
if (Func.isEmpty(oleInventoryList.get(c))) {
//新增库存品
reservationStocklistEntity.setStocklistId(distributionStockListDTO.getId());
reservationStocklistEntity.setReservationId(id);
reservationStocklistEntity.setReservationNum(distributionStockListDTO.getReservationNum());
reservationStocklistEntity.setUnit(distributionStockListDTO.getCargoUnit());
// reservationStocklistEntity.setIsUnpackProduct(distributionStockListDTO.getUnpack());
reservationStocklistEntity.setStockListStatus(ReservationInventoryStatusConstant.zengjia.getValue());
distributionReservationStocklistService.save(reservationStocklistEntity);
//TODO 这里新增还需要对库存品的数量进行修改
DistributionStockListEntity stockListEntity = Func.copy(distributionStockListDTO, DistributionStockListEntity.class);
Integer quantityOccupied = stockListEntity.getQuantityOccupied();
stockListEntity.setQuantityOccupied(quantityOccupied + reservationStocklistEntity.getReservationNum());
distributionStockListService.updateById(stockListEntity);
} else {
DistributionReservationStocklistEntity distributionReservationStocklistEntity = oleInventoryList.get(c).get(0);
// DistributionStockListDTO distributionStockListDTO = newInventoryList.get(c).get(0);
//比对原来的库存品数量和现在的数量是否一致
if (!Func.equals(distributionStockListDTO.getReservationNum(), distributionReservationStocklistEntity.getReservationNum())) {
Integer reservationNum = distributionReservationStocklistEntity.getReservationNum();
DistributionStockListEntity stockListEntity = distributionStockListService.getById(distributionReservationStocklistEntity.getStocklistId());
Integer quantityOccupied = stockListEntity.getQuantityOccupied();
Integer total = quantityOccupied - reservationNum;
distributionReservationStocklistEntity.setReservationNum(distributionStockListDTO.getReservationNum());
distributionReservationStocklistService.updateById(distributionReservationStocklistEntity);
stockListEntity.setQuantityOccupied(total + distributionReservationStocklistEntity.getReservationNum());
distributionStockListService.updateById(stockListEntity);
//TODO 对库存品数量修改
}
oleInventoryList.remove(c);
//比较库存品之间的数据
}
inventorTotal.getAndAdd(distributionStockListDTO.getReservationNum());
});
//对移除的库存品进行取消操作
oleInventoryList.forEach((k, v) -> {
DistributionReservationStocklistEntity distributionReservationStocklistEntity = v.get(0);
distributionReservationStocklistEntity.setStockListStatus(ReservationInventoryStatusConstant.quxiao.getValue());
distributionReservationStocklistService.updateById(distributionReservationStocklistEntity);
//TODO 库存品数量变更
});
//删除原有
// DistributionReservationEntity distributionReservationEntity = this.getById(distributionReservationDTO.getId());
// Func.copy(distributionReservationDTO, distributionReservationEntity);
// QueryWrapper<DistributionReservationStockarticleEntity> q = Condition.getQueryWrapper(new HashMap<String, Object>(), DistributionReservationStockarticleEntity.class);
// q.lambda().eq(DistributionReservationStockarticleEntity::getReservationId, distributionReservationEntity.getId());
// QueryWrapper<DistributionReservationStocklistEntity> w = Condition.getQueryWrapper(new HashMap<String, Object>(), DistributionReservationStocklistEntity.class);
// w.lambda().eq(DistributionReservationStocklistEntity::getReservationId, distributionReservationEntity.getId());
// QueryWrapper<DistributionReservationPackageEntity> o = Condition.getQueryWrapper(new HashMap<String, Object>(), DistributionReservationPackageEntity.class);
// o.lambda().eq(DistributionReservationPackageEntity::getReservationId, distributionReservationEntity.getId());
// //查询已有的中间表信息
// List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionReservationStockarticleService.getBaseMapper().selectList(q);
// List<DistributionReservationStocklistEntity> reservationStocklistEntityList = distributionReservationStocklistService.getBaseMapper().selectList(w);
// List<DistributionReservationPackageEntity> reservationPackageEntityList = distributionReservationPackageMapper.selectList(o);
// if (!Func.isEmpty(reservationStockarticleEntityList)) {
// //对已有预约信息的订单包件数量进行清理
// reservationStockarticleEntityList.forEach(s1 -> {
// //删除前需要对订单的可用数进行操作
// DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(s1.getStockArticleId());
// stockArticleEntity.setAvailableQuantity(s1.getReservationNum() + stockArticleEntity.getAvailableQuantity());
// stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue());
// distributionStockArticleService.updateById(stockArticleEntity);
// //这里对原表进行物理删除
// distributionReservationStockarticleMapper.deleteReservationStockarticle(distributionReservationDTO.getId(),s1.getId());
// });
// }
// if (!Func.isEmpty(reservationStocklistEntityList)) {
// //对已有预约信息的库存品数据进行维护
// reservationStocklistEntityList.forEach(r1 -> {
// Long stocklistId = r1.getStocklistId();
// DistributionStockListEntity stockListEntity = distributionStockListService.getById(stocklistId);
// int num = stockListEntity.getQuantityOccupied() - r1.getReservationNum();
// stockListEntity.setQuantityOccupied(num);
//// stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() + r1.getReservationNum());
// //这里对原表进行物理删除
// distributionStockListService.updateById(stockListEntity);
// distributionReservationStocklistMapper.deleteReservationStocklist(distributionReservationDTO.getId());
// });
// }
// if (!Func.isEmpty(reservationPackageEntityList)) {
// //对已有预约信息的订单包件数量进行清理
// reservationPackageEntityList.forEach(p1 -> {
// DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(p1.getParceListId());
// parcelListEntity.setOrderPackageStockupStatus(OrderPackageStockupStatusConstant.daibeihuo.getValue());
// parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue());
// //todo 这里需要将包件状态设置成未预约;备货信息设置为未备货
//// parcelListEntity.setOrderPackageReservationStatus();
// //这里对原表进行物理删除
// distributionReservationPackageMapper.deleteReservationPackage(distributionReservationDTO.getId());
// });
// }
// //包件数量累加
// AtomicInteger packageCount = new AtomicInteger();
// //计算总费用
// AtomicReference<BigDecimal> initTotal = new AtomicReference<>(BigDecimal.ZERO);
// //订单自编号拼接
// HashSet<String> hashSet = new HashSet<>();
// List<DistributionStockArticleDTO> stockArticleList = distributionReservationDTO.getStockArticleList();
// if (!Func.isEmpty(stockArticleList)) {
// //这里判断修改内容是否存在订单信息,如果存在则进行中间表数据的重新插入
// stockArticleList.forEach(s -> {
// List<DistributionParcelListEntity> packageList = s.getPackageList();
// QueryWrapper<DistributionParcelListEntity> parcelListEntityQueryWrapper = new QueryWrapper<>();
// LambdaQueryWrapper<DistributionParcelListEntity> queryWrapper = parcelListEntityQueryWrapper.lambda().eq(DistributionParcelListEntity::getStockArticleId, s.getId());
// List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListService.getBaseMapper().selectList(queryWrapper);
// if (packageList.size() != parcelListEntityList.size()) {
// s.setReservationStatus(OrderReservationStatusConstant.bufenyuyue.getValue());
// } else {
// s.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
// }
// AtomicInteger packageNum = new AtomicInteger();
// if (Func.isEmpty(packageList)) {
// Map<String, Object> map = new HashMap<>();
// map.put("stockArticleId", s.getId());
// QueryWrapper<DistributionParcelListEntity> qw = Condition.getQueryWrapper(map, DistributionParcelListEntity.class);
// //添加订单下的所有在库订单
// List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListService.getBaseMapper().selectList(qw);
// distributionParcelListEntities.forEach(p -> {
// packageNum.getAndIncrement();
// DistributionReservationPackageEntity distributionReservationPackageEntity = new DistributionReservationPackageEntity();
// distributionReservationPackageEntity.setReservationId(distributionReservationDTO.getId());
// distributionReservationPackageEntity.setPacketBarCode(p.getOrderPackageCode());
// distributionReservationPackageEntity.setParceListId(p.getId());
// distributionReservationPackageEntity.setStockArticleId(s.getId());
// //维护订单下包件信息
// distributionReservationPackageService.save(distributionReservationPackageEntity);
// p.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue());
// distributionParcelListService.updateById(p);
// });
// //设置订单可用数为0
// s.setAvailableQuantity(0);
// } else {
// //维护选中的包件信息
// packageList.forEach(p -> {
// packageNum.getAndIncrement();
// DistributionReservationPackageEntity distributionReservationPackageEntity = new DistributionReservationPackageEntity();
// distributionReservationPackageEntity.setReservationId(distributionReservationDTO.getId());
// distributionReservationPackageEntity.setParceListId(p.getId());
// distributionReservationPackageEntity.setStockArticleId(s.getId());
// distributionReservationPackageEntity.setPacketBarCode(p.getOrderPackageCode());
// distributionReservationPackageService.save(distributionReservationPackageEntity);
// p.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue());
// distributionParcelListService.updateById(p);
// });
// s.setAvailableQuantity(s.getAvailableQuantity() - s.getReservationNum());
//
// }
// DistributionReservationStockarticleEntity distributionReservationStockarticleEntity = new DistributionReservationStockarticleEntity();
// //构建预约订单中间表信息
// distributionReservationStockarticleEntity.setReservationNum(packageNum.get());
// distributionReservationStockarticleEntity.setStockArticleId(s.getId());
// distributionReservationStockarticleEntity.setIsHaveData(s.getIsHaveData());
// distributionReservationStockarticleEntity.setReservationId(distributionReservationEntity.getId());
// distributionReservationStockarticleService.save(distributionReservationStockarticleEntity);
// packageCount.getAndAdd(distributionReservationStockarticleEntity.getReservationNum());
// //统计订单包件数量
// //订单到付费用
//// initTotal.getAndAccumulate(new BigDecimal(s.getCollectFee().toString()), BigDecimal::add);
//// //订单仓储费
//// initTotal.getAndAccumulate(new BigDecimal(s.getStorageFee().toString()), BigDecimal::add);
//// //协商费用
//// initTotal.getAndAccumulate(new BigDecimal(s.getRate().toString()), BigDecimal::add);
// hashSet.add(s.getOrderCode());
// });
// }
// List<DistributionStockListDTO> inventoryList = distributionReservationDTO.getInventoryList();
// AtomicInteger stockListNum = new AtomicInteger();
// if (!Func.isEmpty(inventoryList)) {
// //重新构建预约和库存之间的关系
// inventoryList.forEach(i -> {
// DistributionStockListEntity stockListEntity = distributionStockListService.getById(i.getId());
// int count = stockListEntity.getQuantityOccupied() + i.getReservationNum();
// stockListEntity.setQuantityOccupied(count);
// distributionStockListService.updateById(stockListEntity);
// DistributionReservationStocklistEntity distributionReservationStocklistEntity = new DistributionReservationStocklistEntity();
// distributionReservationStocklistEntity.setReservationId(distributionReservationEntity.getId());
// distributionReservationStocklistEntity.setReservationNum(i.getReservationNum());
// distributionReservationStocklistEntity.setStocklistId(i.getId());
// distributionReservationStocklistService.save(distributionReservationStocklistEntity);
// hashSet.add(i.getOrderCode());
// stockListNum.getAndAdd(distributionReservationStocklistEntity.getReservationNum());
// });
// }
// String orderId = String.join(",", hashSet);
// distributionReservationEntity.setFee(initTotal.get());
// distributionReservationEntity.setServeType(DistributionTypeConstant.shipie.getValue());
// distributionReservationEntity.setReservationNum(packageCount.get());
// distributionReservationEntity.setStockArticleId(orderId);
// distributionReservationEntity.setReservationStockListNum(stockListNum.get());
// distributionReservationMapper.updateById(distributionReservationEntity);
DistributionReservationEntity reservationEntity = this.getById(id);
Integer reservationNum = reservationEntity.getReservationNum();
reservationEntity.setOtherFee(distributionReservationDTO.getOtherFee());
reservationEntity.setDeliveryType(distributionReservationDTO.getDeliveryType());
reservationEntity.setDeliveryWay(distributionReservationDTO.getDeliveryWay());
reservationEntity.setServeType(distributionReservationDTO.getServeType());
reservationEntity.setReservationNum(packTotal.get());
reservationEntity.setReservationStockListNum(inventorTotal.get());
reservationEntity.setReservationDate(distributionReservationDTO.getReservationDate());
reservationEntity.setPeriodOfTime(distributionReservationDTO.getPeriodOfTime());
reservationEntity.setReplaceFee(distributionReservationDTO.getReplaceFee());
// reservationEntity.setCollectFee(distributionReservationDTO.getCollectFee());
reservationEntity.setRemarks(distributionReservationDTO.getRemarks());
reservationEntity.setIsUrgent(distributionReservationDTO.getIsUrgent());
this.updateById(reservationEntity);
return true;
}
@ -1066,7 +998,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
// TODO 计算总费用
// AtomicReference<BigDecimal> initTotal = new AtomicReference<>(BigDecimal.ZERO);
//统计包件数量
AtomicInteger packageTotal= new AtomicInteger();
AtomicInteger packageTotal = new AtomicInteger();
v.forEach(a -> {
orderTotal.getAndIncrement();
DistributionStockArticleEntity stockArticleEntity = Func.copy(a, DistributionStockArticleEntity.class);

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

@ -57,6 +57,7 @@ import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.cache.DictBizCache;
import org.springframework.boot.actuate.autoconfigure.metrics.MetricsProperties;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import sun.misc.BASE64Encoder;
@ -355,11 +356,11 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
//这里进行订单查询
l.forEach(id -> {
DistributionStockArticleEntity distributionStockArticleEntity = this.baseMapper.selectById(id);
// DistributionStockArticleVO distributionStockArticleVO = Func.copy(distributionStockArticleEntity, DistributionStockArticleVO.class);
distributionStockArticleEntityList.add(DistributionStockArticleWrapper.build().entityVO(distributionStockArticleEntity));
DistributionStockArticleVO distributionStockArticleVO = DistributionStockArticleWrapper.build().entityVO(distributionStockArticleEntity);
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListService.getBaseMapper().selectList(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getStockArticleId, distributionStockArticleEntity.getId()));
distributionStockArticleVO.setParcelListVOS(DistributionParcelListWrapper.build().listVO(parcelListEntityList));
distributionStockArticleEntityList.add(distributionStockArticleVO);
});
return R.data(distributionStockArticleEntityList);
}
@ -551,4 +552,13 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
return orderPackgeCodeDataVO;
}
@Override
public IPage<DistributionStockArticleVO> handlePackage(IPage<DistributionStockArticleVO> pageVO) {
pageVO.getRecords().forEach(s->{
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListService.getBaseMapper().selectList(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getStockArticleId, s.getId()));
s.setParcelListVOS(DistributionParcelListWrapper.build().listVO(parcelListEntityList));
});
return pageVO;
}
}

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionParcelListWrapper.java

@ -7,6 +7,7 @@ import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.system.cache.DictBizCache;
import java.util.List;
import java.util.Objects;
/**

34
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionStockListWrapper.java

@ -0,0 +1,34 @@
package com.logpm.distribution.wrapper;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.entity.DistributionStockListEntity;
import com.logpm.distribution.vo.DistributionStockArticleVO;
import com.logpm.distribution.vo.DistributionStockListVO;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.SpringUtil;
import org.springblade.system.cache.DictBizCache;
import org.springblade.system.feign.IUserClient;
import java.util.Date;
import java.util.Objects;
/**
* 在库订单实体VO 转换
*/
public class DistributionStockListWrapper extends BaseEntityWrapper<DistributionStockListEntity
, DistributionStockListVO> {
public static DistributionStockListWrapper build() {
return new DistributionStockListWrapper();
}
@Override
public DistributionStockListVO entityVO(DistributionStockListEntity entity) {
DistributionStockListVO distributionStockListVO = Objects.requireNonNull(BeanUtil.copy(entity, DistributionStockListVO.class));
return distributionStockListVO;
}
}
Loading…
Cancel
Save